[webkit-reviews] review granted: [Bug 130090] Optimize hasTagName when called on an HTMLElement : [Attachment 226467] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 13 03:23:55 PDT 2014


Antti Koivisto <koivisto at iki.fi> has granted Darin Adler <darin at apple.com>'s
request for review:
Bug 130090: Optimize hasTagName when called on an HTMLElement
https://bugs.webkit.org/show_bug.cgi?id=130090

Attachment 226467: Patch
https://bugs.webkit.org/attachment.cgi?id=226467&action=review

------- Additional Comments from Antti Koivisto <koivisto at iki.fi>
View in context: https://bugs.webkit.org/attachment.cgi?id=226467&action=review


Nice! I don't think this is overengineered at all.

Looks like there are some bad hasLocalName calls left at least in
TextIterator.cpp.

> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:2429
> +    for (RenderElement* parent = m_renderer->parent(); parent; parent =
parent->parent()) {

This could use

for (auto& ancestor : ancestorsOfType<RenderElement>(*m_renderer))

> Source/WebCore/xml/parser/XMLDocumentParser.cpp:278
> -    if (contextElement &&
(contextElement->hasLocalName(HTMLNames::scriptTag) ||
contextElement->hasLocalName(HTMLNames::styleTag))) {
> +    if (contextElement &&
(contextElement->hasLocalName(HTMLNames::scriptTag.localName()) ||
contextElement->hasLocalName(HTMLNames::styleTag.localName()))) {

Wonder if this is a bug or if the "hack" requires ignoring the namespace.


More information about the webkit-reviews mailing list