Commit 44117507 authored by abarth@webkit.org's avatar abarth@webkit.org
Browse files

2010-08-24 Adam Barth <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Remove tagPriority
        https://bugs.webkit.org/show_bug.cgi?id=44557

        This code used to be used by the old parser.  Now it's unused.

        * html/HTMLAnchorElement.h:
        * html/HTMLAppletElement.h:
        * html/HTMLAreaElement.h:
        * html/HTMLAudioElement.h:
        * html/HTMLBRElement.h:
        * html/HTMLBaseElement.h:
        * html/HTMLBaseFontElement.h:
        * html/HTMLBlockquoteElement.h:
        * html/HTMLBodyElement.h:
        * html/HTMLCanvasElement.cpp:
        * html/HTMLCanvasElement.h:
        * html/HTMLDListElement.h:
        * html/HTMLDataGridCellElement.h:
        * html/HTMLDataGridColElement.h:
        * html/HTMLDataGridElement.h:
        * html/HTMLDataGridRowElement.h:
        * html/HTMLDirectoryElement.h:
        * html/HTMLDivElement.h:
        * html/HTMLElement.cpp:
        * html/HTMLElement.h:
        * html/HTMLEmbedElement.h:
        * html/HTMLFieldSetElement.h:
        * html/HTMLFontElement.h:
        * html/HTMLFormControlElement.h:
        * html/HTMLFormElement.h:
        * html/HTMLFrameElement.h:
        * html/HTMLFrameSetElement.h:
        * html/HTMLHRElement.h:
        * html/HTMLHeadElement.h:
        * html/HTMLHeadingElement.h:
        * html/HTMLHtmlElement.h:
        * html/HTMLIFrameElement.h:
        * html/HTMLImageElement.h:
        * html/HTMLInputElement.h:
        * html/HTMLIsIndexElement.h:
        * html/HTMLKeygenElement.h:
        * html/HTMLLIElement.h:
        * html/HTMLLabelElement.h:
        * html/HTMLLinkElement.h:
        * html/HTMLMapElement.h:
        * html/HTMLMarqueeElement.h:
        * html/HTMLMenuElement.h:
        * html/HTMLMetaElement.h:
        * html/HTMLModElement.h:
        * html/HTMLOListElement.h:
        * html/HTMLObjectElement.h:
        * html/HTMLOptionElement.h:
        * html/HTMLParagraphElement.h:
        * html/HTMLParamElement.h:
        * html/HTMLPreElement.h:
        * html/HTMLQuoteElement.h:
        * html/HTMLScriptElement.h:
        * html/HTMLSelectElement.h:
        * html/HTMLSourceElement.h:
        * html/HTMLStyleElement.h:
        * html/HTMLTableCaptionElement.h:
        * html/HTMLTableCellElement.h:
        * html/HTMLTableColElement.cpp:
        * html/HTMLTableColElement.h:
        * html/HTMLTableElement.h:
        * html/HTMLTableRowElement.h:
        * html/HTMLTableSectionElement.h:
        * html/HTMLUListElement.h:
        * html/HTMLVideoElement.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 24f75d92
2010-08-24 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
Remove tagPriority
https://bugs.webkit.org/show_bug.cgi?id=44557
This code used to be used by the old parser. Now it's unused.
* html/HTMLAnchorElement.h:
* html/HTMLAppletElement.h:
* html/HTMLAreaElement.h:
* html/HTMLAudioElement.h:
* html/HTMLBRElement.h:
* html/HTMLBaseElement.h:
* html/HTMLBaseFontElement.h:
* html/HTMLBlockquoteElement.h:
* html/HTMLBodyElement.h:
* html/HTMLCanvasElement.cpp:
* html/HTMLCanvasElement.h:
* html/HTMLDListElement.h:
* html/HTMLDataGridCellElement.h:
* html/HTMLDataGridColElement.h:
* html/HTMLDataGridElement.h:
* html/HTMLDataGridRowElement.h:
* html/HTMLDirectoryElement.h:
* html/HTMLDivElement.h:
* html/HTMLElement.cpp:
* html/HTMLElement.h:
* html/HTMLEmbedElement.h:
* html/HTMLFieldSetElement.h:
* html/HTMLFontElement.h:
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.h:
* html/HTMLFrameElement.h:
* html/HTMLFrameSetElement.h:
* html/HTMLHRElement.h:
* html/HTMLHeadElement.h:
* html/HTMLHeadingElement.h:
* html/HTMLHtmlElement.h:
* html/HTMLIFrameElement.h:
* html/HTMLImageElement.h:
* html/HTMLInputElement.h:
* html/HTMLIsIndexElement.h:
* html/HTMLKeygenElement.h:
* html/HTMLLIElement.h:
* html/HTMLLabelElement.h:
* html/HTMLLinkElement.h:
* html/HTMLMapElement.h:
* html/HTMLMarqueeElement.h:
* html/HTMLMenuElement.h:
* html/HTMLMetaElement.h:
* html/HTMLModElement.h:
* html/HTMLOListElement.h:
* html/HTMLObjectElement.h:
* html/HTMLOptionElement.h:
* html/HTMLParagraphElement.h:
* html/HTMLParamElement.h:
* html/HTMLPreElement.h:
* html/HTMLQuoteElement.h:
* html/HTMLScriptElement.h:
* html/HTMLSelectElement.h:
* html/HTMLSourceElement.h:
* html/HTMLStyleElement.h:
* html/HTMLTableCaptionElement.h:
* html/HTMLTableCellElement.h:
* html/HTMLTableColElement.cpp:
* html/HTMLTableColElement.h:
* html/HTMLTableElement.h:
* html/HTMLTableRowElement.h:
* html/HTMLTableSectionElement.h:
* html/HTMLUListElement.h:
* html/HTMLVideoElement.h:
2010-08-24 Eric Seidel <eric@webkit.org>
 
Reviewed by Adam Barth.
......@@ -98,7 +98,6 @@ protected:
private:
virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
virtual int tagPriority() const { return 1; }
virtual bool supportsFocus() const;
virtual bool isMouseFocusable() const;
virtual bool isKeyboardFocusable(KeyboardEvent*) const;
......
......@@ -34,8 +34,6 @@ public:
private:
HTMLAppletElement(const QualifiedName&, Document*);
virtual int tagPriority() const { return 1; }
virtual void parseMappedAttribute(Attribute*);
virtual bool rendererIsNeeded(RenderStyle*);
......
......@@ -51,7 +51,6 @@ private:
HTMLAreaElement(const QualifiedName&, Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
virtual int tagPriority() const { return 0; }
virtual void parseMappedAttribute(Attribute*);
virtual bool supportsFocus() const;
virtual String target() const;
......
......@@ -43,7 +43,6 @@ private:
HTMLAudioElement(const QualifiedName&, Document*);
virtual bool isVideo() const { return false; }
virtual int tagPriority() const { return 5; }
};
} //namespace
......
......@@ -37,7 +37,6 @@ private:
HTMLBRElement(const QualifiedName&, Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
virtual int tagPriority() const { return 0; }
virtual bool mapToEntry(const QualifiedName&, MappedAttributeEntry&) const;
virtual void parseMappedAttribute(Attribute*);
......
......@@ -35,7 +35,6 @@ private:
HTMLBaseElement(const QualifiedName&, Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
virtual int tagPriority() const { return 0; }
virtual String target() const { return m_target; }
......
......@@ -35,7 +35,6 @@ private:
HTMLBaseFontElement(const QualifiedName&, Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
virtual int tagPriority() const { return 0; }
};
} // namespace
......
......@@ -36,7 +36,6 @@ private:
HTMLBlockquoteElement(const QualifiedName&, Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
virtual int tagPriority() const { return 5; }
};
} // namespace WebCore
......
......@@ -70,8 +70,7 @@ private:
HTMLBodyElement(const QualifiedName&, Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
virtual int tagPriority() const { return 10; }
virtual bool mapToEntry(const QualifiedName&, MappedAttributeEntry&) const;
virtual void parseMappedAttribute(Attribute*);
......
......@@ -108,15 +108,6 @@ HTMLTagStatus HTMLCanvasElement::endTagRequirement() const
return HTMLElement::endTagRequirement();
}
int HTMLCanvasElement::tagPriority() const
{
Settings* settings = document()->settings();
if (settings && settings->usesDashboardBackwardCompatibilityMode())
return 0;
return HTMLElement::tagPriority();
}
#endif
void HTMLCanvasElement::parseMappedAttribute(Attribute* attr)
......
......@@ -120,7 +120,6 @@ private:
#if ENABLE(DASHBOARD_SUPPORT)
virtual HTMLTagStatus endTagRequirement() const;
virtual int tagPriority() const;
#endif
virtual void parseMappedAttribute(Attribute*);
......
......@@ -35,7 +35,6 @@ private:
HTMLDListElement(const QualifiedName&, Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
virtual int tagPriority() const { return 5; }
};
} //namespace
......
......@@ -55,7 +55,6 @@ private:
HTMLDataGridCellElement(const QualifiedName&, Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
virtual int tagPriority() const { return 0; }
};
......
......@@ -61,7 +61,6 @@ private:
HTMLDataGridColElement(const QualifiedName&, Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
virtual int tagPriority() const { return 0; }
virtual void insertedIntoTree(bool /*deep*/);
virtual void removedFromTree(bool /*deep*/);
virtual void parseMappedAttribute(Attribute*);
......
......@@ -56,7 +56,6 @@ public:
private:
HTMLDataGridElement(const QualifiedName&, Document*);
virtual int tagPriority() const { return 6; } // Same as <select>s
virtual bool checkDTD(const Node*);
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
......
......@@ -48,7 +48,6 @@ public:
private:
HTMLDataGridRowElement(const QualifiedName&, Document*);
virtual int tagPriority() const { return 2; } // Same as <option>s.
virtual bool checkDTD(const Node*);
};
......
......@@ -35,7 +35,6 @@ private:
HTMLDirectoryElement(const QualifiedName&, Document*);
virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
virtual int tagPriority() const { return 5; }
};
} //namespace
......
......@@ -37,7 +37,6 @@ protected:
private:
virtual HTMLTagStatus endTagRequirement() const { return TagStatusRequired; }
virtual int tagPriority() const { return 5; }
virtual bool mapToEntry(const QualifiedName&, MappedAttributeEntry&) const;
virtual void parseMappedAttribute(Attribute*);
......
......@@ -80,51 +80,6 @@ HTMLTagStatus HTMLElement::endTagRequirement() const
return TagStatusRequired;
}
struct Empty1IntHashTraits : HashTraits<int> {
static const bool emptyValueIsZero = false;
static int emptyValue() { return 1; }
};
typedef HashMap<AtomicStringImpl*, int, DefaultHash<AtomicStringImpl*>::Hash, HashTraits<AtomicStringImpl*>, Empty1IntHashTraits> TagPriorityMap;
static const TagPriorityMap* createTagPriorityMap()
{
TagPriorityMap* map = new TagPriorityMap;
map->add(wbrTag.localName().impl(), 0);
map->add(addressTag.localName().impl(), 3);
map->add(ddTag.localName().impl(), 3);
map->add(dtTag.localName().impl(), 3);
map->add(noscriptTag.localName().impl(), 3);
map->add(rpTag.localName().impl(), 3);
map->add(rtTag.localName().impl(), 3);
// 5 is same as <div>'s priority.
map->add(articleTag.localName().impl(), 5);
map->add(asideTag.localName().impl(), 5);
map->add(centerTag.localName().impl(), 5);
map->add(footerTag.localName().impl(), 5);
map->add(headerTag.localName().impl(), 5);
map->add(hgroupTag.localName().impl(), 5);
map->add(nobrTag.localName().impl(), 5);
map->add(rubyTag.localName().impl(), 5);
map->add(navTag.localName().impl(), 5);
map->add(sectionTag.localName().impl(), 5);
map->add(noembedTag.localName().impl(), 10);
map->add(noframesTag.localName().impl(), 10);
// TagPriorityMap returns 1 for unregistered tags. It's same as <span>.
// This way custom tag name elements will behave like inline spans.
return map;
}
int HTMLElement::tagPriority() const
{
static const TagPriorityMap* tagPriorityMap = createTagPriorityMap();
return tagPriorityMap->get(localName().impl());
}
bool HTMLElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
{
if (attrName == alignAttr ||
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment