Commit edbc5e46 authored by darin's avatar darin

Reviewed by John Sullivan.

        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4654
          one more pass of HTMLNames refinement

        * khtml/html/htmlnames.h: Used new "for each" macros so the lists of tags here can
        be re-used in other files.
        * khtml/html/htmlnames.cpp: (DOM::HTMLNames::init): Changed the name of the function
        and used the macros defined in the header to avoid repeating the lists.

        * khtml/khtml_part.cpp: (KHTMLPart::init): Update for function name change.

        * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::isRecognizedTagName): Use the
        macro from htmlnames.h to avoid repeating the list of tags.

        * khtml/ecma/kjs_css.cpp:
        * khtml/ecma/kjs_dom.cpp:
        * khtml/ecma/kjs_html.cpp:
        * khtml/editing/apply_style_command.cpp:
        * khtml/editing/break_blockquote_command.cpp:
        * khtml/editing/composite_edit_command.cpp:
        * khtml/editing/delete_selection_command.cpp:
        * khtml/editing/htmlediting.cpp:
        * khtml/editing/insert_line_break_command.cpp:
        * khtml/editing/insert_paragraph_separator_command.cpp:
        * khtml/editing/markup.cpp:
        * khtml/editing/replace_selection_command.cpp:
        * khtml/editing/visible_position.cpp:
        * khtml/editing/visible_text.cpp:
        * khtml/editing/visible_units.cpp:
        * khtml/html/html_documentimpl.cpp:
        * khtml/html/html_formimpl.cpp:
        * khtml/html/html_inlineimpl.cpp:
        * khtml/html/html_listimpl.cpp:
        * khtml/html/html_listimpl.h:
        * khtml/html/html_miscimpl.cpp:
        * khtml/html/html_objectimpl.cpp:
        * khtml/html/html_tableimpl.cpp:
        * khtml/html/htmlfactory.cpp:
        * khtml/html/htmlparser.cpp:
        * khtml/html/htmltokenizer.cpp:
        * khtml/misc/decoder.cpp:
        * khtml/rendering/render_applet.cpp:
        * khtml/rendering/render_form.cpp:
        * khtml/rendering/render_frames.cpp:
        * khtml/rendering/render_list.cpp:
        * khtml/rendering/render_table.cpp:
        * khtml/rendering/render_theme.cpp:
        * khtml/xml/dom_nodeimpl.cpp:
        * khtml/xml/dom_position.cpp:
        * khtml/xml/xml_tokenizer.cpp:
        * kwq/DOM.mm:
        * kwq/DOMHTML.mm:
        * kwq/KWQAccObject.mm:
        * kwq/KWQKHTMLPart.cpp:
        * kwq/KWQKHTMLPart.mm:
        * kwq/WebCoreBridge.mm:
        Updated "using" because HTMLNames is now inside the DOM namespace.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10332 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d44842b1
2005-08-25 Darin Adler <darin@apple.com>
Reviewed by John Sullivan.
- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4654
one more pass of HTMLNames refinement
* khtml/html/htmlnames.h: Used new "for each" macros so the lists of tags here can
be re-used in other files.
* khtml/html/htmlnames.cpp: (DOM::HTMLNames::init): Changed the name of the function
and used the macros defined in the header to avoid repeating the lists.
* khtml/khtml_part.cpp: (KHTMLPart::init): Update for function name change.
* khtml/html/html_elementimpl.cpp: (HTMLElementImpl::isRecognizedTagName): Use the
macro from htmlnames.h to avoid repeating the list of tags.
* khtml/ecma/kjs_css.cpp:
* khtml/ecma/kjs_dom.cpp:
* khtml/ecma/kjs_html.cpp:
* khtml/editing/apply_style_command.cpp:
* khtml/editing/break_blockquote_command.cpp:
* khtml/editing/composite_edit_command.cpp:
* khtml/editing/delete_selection_command.cpp:
* khtml/editing/htmlediting.cpp:
* khtml/editing/insert_line_break_command.cpp:
* khtml/editing/insert_paragraph_separator_command.cpp:
* khtml/editing/markup.cpp:
* khtml/editing/replace_selection_command.cpp:
* khtml/editing/visible_position.cpp:
* khtml/editing/visible_text.cpp:
* khtml/editing/visible_units.cpp:
* khtml/html/html_documentimpl.cpp:
* khtml/html/html_formimpl.cpp:
* khtml/html/html_inlineimpl.cpp:
* khtml/html/html_listimpl.cpp:
* khtml/html/html_listimpl.h:
* khtml/html/html_miscimpl.cpp:
* khtml/html/html_objectimpl.cpp:
* khtml/html/html_tableimpl.cpp:
* khtml/html/htmlfactory.cpp:
* khtml/html/htmlparser.cpp:
* khtml/html/htmltokenizer.cpp:
* khtml/misc/decoder.cpp:
* khtml/rendering/render_applet.cpp:
* khtml/rendering/render_form.cpp:
* khtml/rendering/render_frames.cpp:
* khtml/rendering/render_list.cpp:
* khtml/rendering/render_table.cpp:
* khtml/rendering/render_theme.cpp:
* khtml/xml/dom_nodeimpl.cpp:
* khtml/xml/dom_position.cpp:
* khtml/xml/xml_tokenizer.cpp:
* kwq/DOM.mm:
* kwq/DOMHTML.mm:
* kwq/KWQAccObject.mm:
* kwq/KWQKHTMLPart.cpp:
* kwq/KWQKHTMLPart.mm:
* kwq/WebCoreBridge.mm:
Updated "using" because HTMLNames is now inside the DOM namespace.
2005-08-25 Darin Adler <darin@apple.com>
Reviewed by Maciej.
......
......@@ -35,6 +35,8 @@
#include "kjs_css.lut.h"
using namespace DOM::HTMLNames;
using DOM::CSSCharsetRuleImpl;
using DOM::CSSFontFaceRuleImpl;
using DOM::CSSImportRuleImpl;
......@@ -55,7 +57,6 @@ using DOM::CounterImpl;
using DOM::DocumentImpl;
using DOM::DOMString;
using DOM::ElementImpl;
using namespace HTMLNames;
using DOM::HTMLStyleElementImpl;
using DOM::MediaListImpl;
using DOM::RectImpl;
......
......@@ -51,6 +51,8 @@
#include <JavaScriptCore/runtime_object.h>
#endif
using namespace DOM::HTMLNames;
using DOM::AttrImpl;
using DOM::CharacterDataImpl;
using DOM::DocumentImpl;
......@@ -65,7 +67,6 @@ using DOM::HTMLAppletElementImpl;
using DOM::HTMLDocumentImpl;
using DOM::HTMLElementImpl;
using DOM::HTMLEmbedElementImpl;
using namespace HTMLNames;
using DOM::HTMLObjectElementImpl;
using DOM::NamedNodeMapImpl;
using DOM::Node;
......
......@@ -64,6 +64,8 @@
#include <ApplicationServices/ApplicationServices.h>
#endif
using namespace DOM::HTMLNames;
using DOM::DOMString;
using DOM::DocumentImpl;
using DOM::ElementImpl;
......@@ -107,7 +109,6 @@ using DOM::HTMLMapElementImpl;
using DOM::HTMLMenuElementImpl;
using DOM::HTMLMetaElementImpl;
using DOM::HTMLModElementImpl;
using namespace HTMLNames;
using DOM::HTMLOListElementImpl;
using DOM::HTMLObjectElementImpl;
using DOM::HTMLOptGroupElementImpl;
......
......@@ -46,6 +46,8 @@
#define ASSERT(assertion) assert(assertion)
#endif
using namespace DOM::HTMLNames;
using DOM::CSSComputedStyleDeclarationImpl;
using DOM::CSSMutableStyleDeclarationImpl;
using DOM::CSSParser;
......@@ -65,7 +67,6 @@ using DOM::NodeImpl;
using DOM::Position;
using DOM::RangeImpl;
using DOM::TextImpl;
using namespace HTMLNames;
namespace khtml {
......
......@@ -38,12 +38,13 @@
#define ASSERT(assertion) assert(assertion)
#endif
using namespace DOM::HTMLNames;
using DOM::DocumentImpl;
using DOM::ElementImpl;
using DOM::NodeImpl;
using DOM::Position;
using DOM::TextImpl;
using namespace HTMLNames;
namespace khtml {
......
......@@ -57,6 +57,8 @@
#define ASSERT(assertion) assert(assertion)
#endif
using namespace DOM::HTMLNames;
using DOM::CSSStyleDeclarationImpl;
using DOM::DocumentImpl;
using DOM::DOMString;
......@@ -67,7 +69,6 @@ using DOM::Position;
using DOM::RangeImpl;
using DOM::TextImpl;
using DOM::QualifiedName;
using namespace HTMLNames;
namespace khtml {
......
......@@ -46,6 +46,8 @@
#define LOG(channel, formatAndArgs...) ((void)0)
#endif
using namespace DOM::HTMLNames;
using DOM::CSSComputedStyleDeclarationImpl;
using DOM::CSSMutableStyleDeclarationImpl;
using DOM::DOMString;
......@@ -54,7 +56,6 @@ using DOM::NodeImpl;
using DOM::Position;
using DOM::RangeImpl;
using DOM::TextImpl;
using namespace HTMLNames;
namespace khtml {
......
......@@ -54,6 +54,8 @@
#include "visible_text.h"
#include "visible_units.h"
using namespace DOM::HTMLNames;
using DOM::AttrImpl;
using DOM::CSSComputedStyleDeclarationImpl;
using DOM::CSSMutableStyleDeclarationImpl;
......@@ -80,7 +82,6 @@ using DOM::Position;
using DOM::RangeImpl;
using DOM::TextImpl;
using DOM::TreeWalkerImpl;
using namespace HTMLNames;
#if APPLE_CHANGES
#include "KWQAssertions.h"
......
......@@ -44,13 +44,14 @@
#define LOG(channel, formatAndArgs...) ((void)0)
#endif
using namespace DOM::HTMLNames;
using DOM::DocumentImpl;
using DOM::ElementImpl;
using DOM::NodeImpl;
using DOM::Position;
using DOM::TextImpl;
using DOM::CSSMutableStyleDeclarationImpl;
using namespace HTMLNames;
namespace khtml {
......
......@@ -44,13 +44,14 @@
#define LOG(channel, formatAndArgs...) ((void)0)
#endif
using namespace DOM::HTMLNames;
using DOM::CSSComputedStyleDeclarationImpl;
using DOM::DocumentImpl;
using DOM::ElementImpl;
using DOM::NodeImpl;
using DOM::Position;
using DOM::TextImpl;
using namespace HTMLNames;
namespace khtml {
......
......@@ -37,6 +37,8 @@
#include "rendering/render_text.h"
#include "htmlnames.h"
using namespace DOM::HTMLNames;
using DOM::AttributeImpl;
using DOM::CommentImpl;
using DOM::CSSComputedStyleDeclarationImpl;
......@@ -53,7 +55,6 @@ using DOM::NodeImpl;
using DOM::Position;
using DOM::RangeImpl;
using DOM::TextImpl;
using namespace HTMLNames;
#if APPLE_CHANGES
#include "KWQAssertions.h"
......
......@@ -47,6 +47,8 @@
#define ASSERT(assertion) assert(assertion)
#endif
using namespace DOM::HTMLNames;
using DOM::CSSComputedStyleDeclarationImpl;
using DOM::DocumentImpl;
using DOM::NodeImpl;
......@@ -54,7 +56,6 @@ using DOM::DocumentFragmentImpl;
using DOM::ElementImpl;
using DOM::TextImpl;
using DOM::DOMString;
using namespace HTMLNames;
using DOM::HTMLElementImpl;
using DOM::CSSMutableStyleDeclarationImpl;
using DOM::Position;
......
......@@ -42,6 +42,8 @@
#define LOG(channel, formatAndArgs...) ((void)0)
#endif
using namespace DOM::HTMLNames;
using DOM::CharacterDataImpl;
using DOM::NodeImpl;
using DOM::offsetInCharacters;
......@@ -50,7 +52,6 @@ using DOM::Position;
using DOM::Range;
using DOM::RangeImpl;
using DOM::TextImpl;
using namespace HTMLNames;
namespace khtml {
......
......@@ -31,13 +31,14 @@
#include "xml/dom_position.h"
#include "xml/dom2_rangeimpl.h"
using namespace DOM::HTMLNames;
using DOM::DocumentImpl;
using DOM::DOMString;
using DOM::Node;
using DOM::NodeImpl;
using DOM::offsetInCharacters;
using DOM::RangeImpl;
using namespace HTMLNames;
// FIXME: These classes should probably use the render tree and not the DOM tree, since elements could
// be hidden using CSS, or additional generated content could be added. For now, we just make sure
......
......@@ -36,12 +36,13 @@
#include "xml/dom_docimpl.h"
#include "xml/dom_elementimpl.h"
using namespace DOM::HTMLNames;
using DOM::DocumentImpl;
using DOM::ElementImpl;
using DOM::NodeImpl;
using DOM::Position;
using DOM::RangeImpl;
using namespace HTMLNames;
namespace khtml {
......
......@@ -101,11 +101,12 @@
template class QPtrStack<DOM::NodeImpl>;
using namespace HTMLNames;
using namespace khtml;
namespace DOM {
using namespace HTMLNames;
HTMLDocumentImpl::HTMLDocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v)
: DocumentImpl(_implementation, v)
{
......
......@@ -700,110 +700,9 @@ bool HTMLElementImpl::isRecognizedTagName(const QualifiedName& tagName)
{
static HashSet<DOMStringImpl*, PointerHash<DOMStringImpl*> > tagList;
if (tagList.isEmpty()) {
tagList.insert(aTag.localName().implementation());
tagList.insert(abbrTag.localName().implementation());
tagList.insert(acronymTag.localName().implementation());
tagList.insert(addressTag.localName().implementation());
tagList.insert(appletTag.localName().implementation());
tagList.insert(areaTag.localName().implementation());
tagList.insert(bTag.localName().implementation());
tagList.insert(baseTag.localName().implementation());
tagList.insert(basefontTag.localName().implementation());
tagList.insert(bdoTag.localName().implementation());
tagList.insert(bigTag.localName().implementation());
tagList.insert(blockquoteTag.localName().implementation());
tagList.insert(bodyTag.localName().implementation());
tagList.insert(brTag.localName().implementation());
tagList.insert(buttonTag.localName().implementation());
tagList.insert(canvasTag.localName().implementation());
tagList.insert(captionTag.localName().implementation());
tagList.insert(centerTag.localName().implementation());
tagList.insert(citeTag.localName().implementation());
tagList.insert(codeTag.localName().implementation());
tagList.insert(colTag.localName().implementation());
tagList.insert(colgroupTag.localName().implementation());
tagList.insert(ddTag.localName().implementation());
tagList.insert(delTag.localName().implementation());
tagList.insert(dfnTag.localName().implementation());
tagList.insert(dirTag.localName().implementation());
tagList.insert(divTag.localName().implementation());
tagList.insert(dlTag.localName().implementation());
tagList.insert(dtTag.localName().implementation());
tagList.insert(emTag.localName().implementation());
tagList.insert(embedTag.localName().implementation());
tagList.insert(fieldsetTag.localName().implementation());
tagList.insert(fontTag.localName().implementation());
tagList.insert(formTag.localName().implementation());
tagList.insert(frameTag.localName().implementation());
tagList.insert(framesetTag.localName().implementation());
tagList.insert(headTag.localName().implementation());
tagList.insert(h1Tag.localName().implementation());
tagList.insert(h2Tag.localName().implementation());
tagList.insert(h3Tag.localName().implementation());
tagList.insert(h4Tag.localName().implementation());
tagList.insert(h5Tag.localName().implementation());
tagList.insert(h6Tag.localName().implementation());
tagList.insert(hrTag.localName().implementation());
tagList.insert(htmlTag.localName().implementation());
tagList.insert(iTag.localName().implementation());
tagList.insert(iframeTag.localName().implementation());
tagList.insert(imgTag.localName().implementation());
tagList.insert(inputTag.localName().implementation());
tagList.insert(insTag.localName().implementation());
tagList.insert(isindexTag.localName().implementation());
tagList.insert(kbdTag.localName().implementation());
tagList.insert(keygenTag.localName().implementation());
tagList.insert(labelTag.localName().implementation());
tagList.insert(layerTag.localName().implementation());
tagList.insert(legendTag.localName().implementation());
tagList.insert(liTag.localName().implementation());
tagList.insert(linkTag.localName().implementation());
tagList.insert(mapTag.localName().implementation());
tagList.insert(marqueeTag.localName().implementation());
tagList.insert(menuTag.localName().implementation());
tagList.insert(metaTag.localName().implementation());
tagList.insert(nobrTag.localName().implementation());
tagList.insert(noembedTag.localName().implementation());
tagList.insert(noframesTag.localName().implementation());
tagList.insert(nolayerTag.localName().implementation());
tagList.insert(noscriptTag.localName().implementation());
tagList.insert(objectTag.localName().implementation());
tagList.insert(olTag.localName().implementation());
tagList.insert(optgroupTag.localName().implementation());
tagList.insert(optionTag.localName().implementation());
tagList.insert(pTag.localName().implementation());
tagList.insert(paramTag.localName().implementation());
tagList.insert(plaintextTag.localName().implementation());
tagList.insert(preTag.localName().implementation());
tagList.insert(qTag.localName().implementation());
tagList.insert(sTag.localName().implementation());
tagList.insert(sampTag.localName().implementation());
tagList.insert(scriptTag.localName().implementation());
tagList.insert(selectTag.localName().implementation());
tagList.insert(smallTag.localName().implementation());
tagList.insert(spanTag.localName().implementation());
tagList.insert(strikeTag.localName().implementation());
tagList.insert(strongTag.localName().implementation());
tagList.insert(styleTag.localName().implementation());
tagList.insert(subTag.localName().implementation());
tagList.insert(supTag.localName().implementation());
tagList.insert(tableTag.localName().implementation());
tagList.insert(tbodyTag.localName().implementation());
tagList.insert(tdTag.localName().implementation());
tagList.insert(textareaTag.localName().implementation());
tagList.insert(tfootTag.localName().implementation());
tagList.insert(thTag.localName().implementation());
tagList.insert(theadTag.localName().implementation());
tagList.insert(titleTag.localName().implementation());
tagList.insert(trTag.localName().implementation());
tagList.insert(ttTag.localName().implementation());
tagList.insert(uTag.localName().implementation());
tagList.insert(ulTag.localName().implementation());
tagList.insert(varTag.localName().implementation());
tagList.insert(wbrTag.localName().implementation());
tagList.insert(xmpTag.localName().implementation());
#define INSERT_TAG(name) tagList.insert(name##Tag.localName().implementation());
DOM_HTMLNAMES_FOR_EACH_TAG(INSERT_TAG)
}
return tagList.contains(tagName.localName().implementation());
}
......
......@@ -63,11 +63,12 @@
#include <assert.h>
using namespace HTMLNames;
using namespace khtml;
namespace DOM {
using namespace HTMLNames;
struct FormDataListItem {
FormDataListItem(const QCString &data) : m_data(data) { }
FormDataListItem(const QString &path) : m_path(path) { }
......
......@@ -39,11 +39,12 @@
#include <kdebug.h>
using namespace HTMLNames;
using namespace khtml;
namespace DOM {
using namespace HTMLNames;
HTMLAnchorElementImpl::HTMLAnchorElementImpl(DocumentPtr *doc)
: HTMLElementImpl(aTag, doc)
{
......
......@@ -31,6 +31,8 @@ using namespace khtml;
namespace DOM {
using namespace HTMLNames;
bool HTMLUListElementImpl::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
{
if (attrName == typeAttr) {
......
......@@ -20,6 +20,7 @@
* Boston, MA 02111-1307, USA.
*
*/
#ifndef HTML_LISTIMPL_H
#define HTML_LISTIMPL_H
......@@ -29,8 +30,6 @@
#include "html_elementimpl.h"
using namespace HTMLNames;
namespace DOM
{
......
......@@ -31,10 +31,10 @@
#include <kdebug.h>
using namespace HTMLNames;
namespace DOM {
using namespace HTMLNames;
HTMLBaseFontElementImpl::HTMLBaseFontElementImpl(DocumentPtr *doc)
: HTMLElementImpl(basefontTag, doc)
{
......
......@@ -51,11 +51,12 @@
#include "KWQKHTMLPart.h"
#endif
using namespace HTMLNames;
using namespace khtml;
namespace DOM {
using namespace HTMLNames;
// -------------------------------------------------------------------------
HTMLAppletElementImpl::HTMLAppletElementImpl(DocumentPtr *doc)
......
......@@ -45,11 +45,12 @@
#include <kdebug.h>
#include <kglobal.h>
using namespace HTMLNames;
using namespace khtml;
namespace DOM {
using namespace HTMLNames;
HTMLTableElementImpl::HTMLTableElementImpl(DocumentPtr *doc)
: HTMLElementImpl(tableTag, doc)
{
......
......@@ -43,6 +43,8 @@ using khtml::HashMap;
namespace DOM
{
using namespace HTMLNames;
typedef HTMLElementImpl* (*ConstructorFunc)(const AtomicString& tagName, DocumentPtr* docPtr, HTMLFormElementImpl* form, bool createdByParser);
typedef HashMap<DOMStringImpl *, void*, PointerHash<DOMStringImpl *> > FunctionMap;
static FunctionMap* gFunctionMap;
......
This diff is collapsed.
This diff is collapsed.
......@@ -63,6 +63,7 @@
#include <klocale.h>
using namespace DOM;
using namespace HTMLNames;
using namespace khtml;
//----------------------------------------------------------------------------
......
......@@ -55,6 +55,8 @@
#include <kdebug.h>
#include <stdlib.h>
using namespace DOM::HTMLNames;
using DOM::AtomicString;
using DOM::AttributeImpl;
using DOM::DOMString;
......@@ -64,7 +66,6 @@ using DOM::emptyAtom;
using DOM::commentAtom;
using DOM::nullAtom;
using DOM::textAtom;
using namespace HTMLNames;
using DOM::QualifiedName;
using DOM::MappedAttributeImpl;
using DOM::NamedMappedAttrMapImpl;
......@@ -444,7 +445,7 @@ void HTMLTokenizer::scriptHandler()
processToken();
// Scripts following a frameset element should not be executed or even loaded in the case of extern scripts.
bool followingFrameset = (parser->doc()->body() && parser->doc()->body()->hasTagName(HTMLNames::framesetTag));
bool followingFrameset = (parser->doc()->body() && parser->doc()->body()->hasTagName(framesetTag));
TokenizerString *savedPrependingSrc = currentPrependingSrc;
TokenizerString prependingSrc;
currentPrependingSrc = &prependingSrc;
......
......@@ -209,7 +209,7 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof )
{
AtomicString::init();
QualifiedName::init();
HTMLNames::initHTMLNames(); // FIXME: We should make this happen only when HTML is used.
HTMLNames::init(); // FIXME: We should make this happen only when HTML is used.
if ( prof == DefaultGUI )
setXMLFile( "khtml.rc" );
else if ( prof == BrowserViewGUI )
......
......@@ -40,8 +40,9 @@ using namespace khtml;
#include "htmlnames.h"
using namespace DOM::HTMLNames;
using DOM::AtomicString;
using namespace HTMLNames;
using DOM::nullAtom;
class KanjiCode
......
......@@ -38,9 +38,9 @@
#include "java/kjavaappletwidget.h"
#include "html/html_objectimpl.h"
using namespace HTMLNames;