Changeset 102511 in webkit


Ignore:
Timestamp:
Dec 9, 2011 6:29:51 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

NameNodeListCache should be invalidated when name attribute changes/modified.
https://bugs.webkit.org/show_bug.cgi?id=70810

Patch by Arko Saha <arko@motorola.com> on 2011-12-09
Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: fast/dom/getelementsbyname-invalidation-cache.html

  • html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::parseMappedAttribute):

  • html/HTMLAppletElement.cpp:

(WebCore::HTMLAppletElement::parseMappedAttribute):

  • html/HTMLElement.cpp:

(WebCore::HTMLElement::parseMappedAttribute):

  • html/HTMLEmbedElement.cpp:

(WebCore::HTMLEmbedElement::parseMappedAttribute):

  • html/HTMLFormElement.cpp:

(WebCore::HTMLFormElement::parseMappedAttribute):

  • html/HTMLFrameElementBase.cpp:

(WebCore::HTMLFrameElementBase::parseMappedAttribute):

  • html/HTMLIFrameElement.cpp:

(WebCore::HTMLIFrameElement::parseMappedAttribute):

  • html/HTMLImageElement.cpp:

(WebCore::HTMLImageElement::parseMappedAttribute):

  • html/HTMLMapElement.cpp:

(WebCore::HTMLMapElement::parseMappedAttribute):

  • html/HTMLMetaElement.cpp:

(WebCore::HTMLMetaElement::parseMappedAttribute):

  • html/HTMLObjectElement.cpp:

(WebCore::HTMLObjectElement::parseMappedAttribute):

  • html/HTMLParamElement.cpp:

(WebCore::HTMLParamElement::parseMappedAttribute):

LayoutTests:

  • fast/dom/getelementsbyname-invalidation-cache-expected.txt: Added.
  • fast/dom/getelementsbyname-invalidation-cache.html: Added.
Location:
trunk
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r102510 r102511  
     12011-12-09   Arko Saha  <arko@motorola.com>
     2
     3        NameNodeListCache should be invalidated when name attribute changes/modified.
     4        https://bugs.webkit.org/show_bug.cgi?id=70810
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * fast/dom/getelementsbyname-invalidation-cache-expected.txt: Added.
     9        * fast/dom/getelementsbyname-invalidation-cache.html: Added.
     10
    1112011-12-09  David Levin  <levin@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r102503 r102511  
     12011-12-09   Arko Saha  <arko@motorola.com>
     2
     3        NameNodeListCache should be invalidated when name attribute changes/modified.
     4        https://bugs.webkit.org/show_bug.cgi?id=70810
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Test: fast/dom/getelementsbyname-invalidation-cache.html
     9
     10        * html/HTMLAnchorElement.cpp:
     11        (WebCore::HTMLAnchorElement::parseMappedAttribute):
     12        * html/HTMLAppletElement.cpp:
     13        (WebCore::HTMLAppletElement::parseMappedAttribute):
     14        * html/HTMLElement.cpp:
     15        (WebCore::HTMLElement::parseMappedAttribute):
     16        * html/HTMLEmbedElement.cpp:
     17        (WebCore::HTMLEmbedElement::parseMappedAttribute):
     18        * html/HTMLFormElement.cpp:
     19        (WebCore::HTMLFormElement::parseMappedAttribute):
     20        * html/HTMLFrameElementBase.cpp:
     21        (WebCore::HTMLFrameElementBase::parseMappedAttribute):
     22        * html/HTMLIFrameElement.cpp:
     23        (WebCore::HTMLIFrameElement::parseMappedAttribute):
     24        * html/HTMLImageElement.cpp:
     25        (WebCore::HTMLImageElement::parseMappedAttribute):
     26        * html/HTMLMapElement.cpp:
     27        (WebCore::HTMLMapElement::parseMappedAttribute):
     28        * html/HTMLMetaElement.cpp:
     29        (WebCore::HTMLMetaElement::parseMappedAttribute):
     30        * html/HTMLObjectElement.cpp:
     31        (WebCore::HTMLObjectElement::parseMappedAttribute):
     32        * html/HTMLParamElement.cpp:
     33        (WebCore::HTMLParamElement::parseMappedAttribute):
     34
    1352011-12-09  Anders Carlsson  <andersca@apple.com>
    236
  • trunk/Source/WebCore/html/HTMLAnchorElement.cpp

    r100895 r102511  
    222222            }
    223223        }
    224     } else if (attr->name() == nameAttr ||
    225              attr->name() == titleAttr) {
     224    } else if (attr->name() == nameAttr) {
     225        invalidateNodeListsCacheAfterAttributeChanged();
     226    } else if (attr->name() == titleAttr) {
    226227        // Do nothing.
    227228    } else if (attr->name() == relAttr)
  • trunk/Source/WebCore/html/HTMLAppletElement.cpp

    r99347 r102511  
    6565        }
    6666        m_name = newName;
     67        invalidateNodeListsCacheAfterAttributeChanged();
    6768    } else if (isIdAttributeName(attr->name())) {
    6869        const AtomicString& newId = attr->value();
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r101268 r102511  
    211211        } else if (equalIgnoringCase(value, "false"))
    212212            addCSSProperty(attr, CSSPropertyWebkitUserDrag, CSSValueNone);
     213    } else if (attr->name() == nameAttr) {
     214        invalidateNodeListsCacheAfterAttributeChanged();
    213215#if ENABLE(MICRODATA)
    214216    } else if (attr->name() == itempropAttr) {
  • trunk/Source/WebCore/html/HTMLEmbedElement.cpp

    r99742 r102511  
    119119        }
    120120        m_name = value;
     121        invalidateNodeListsCacheAfterAttributeChanged();
    121122    } else
    122123        HTMLPlugInImageElement::parseMappedAttribute(attr);
  • trunk/Source/WebCore/html/HTMLFormElement.cpp

    r99742 r102511  
    393393        }
    394394        m_name = newName;
     395        invalidateNodeListsCacheAfterAttributeChanged();
    395396    } else
    396397        HTMLElement::parseMappedAttribute(attr);
  • trunk/Source/WebCore/html/HTMLFrameElementBase.cpp

    r99742 r102511  
    142142    } else if (attr->name() == nameAttr) {
    143143        m_frameName = attr->value();
     144        invalidateNodeListsCacheAfterAttributeChanged();
    144145        // FIXME: If we are already attached, this doesn't actually change the frame's name.
    145146        // FIXME: If we are already attached, this doesn't check for frame name
  • trunk/Source/WebCore/html/HTMLIFrameElement.cpp

    r99742 r102511  
    8585        }
    8686        m_name = newName;
     87        invalidateNodeListsCacheAfterAttributeChanged();
    8788    } else if (attr->name() == frameborderAttr) {
    8889        // Frame border doesn't really match the HTML4 spec definition for iframes.  It simply adds
  • trunk/Source/WebCore/html/HTMLImageElement.cpp

    r99742 r102511  
    142142        }
    143143        m_name = newName;
     144        invalidateNodeListsCacheAfterAttributeChanged();
    144145    } else if (isIdAttributeName(attr->name())) {
    145146        const AtomicString& newId = attr->value();
  • trunk/Source/WebCore/html/HTMLMapElement.cpp

    r94427 r102511  
    120120        if (inDocument())
    121121            treeScope()->addImageMap(this);
     122
     123        if (attrName == nameAttr)
     124            invalidateNodeListsCacheAfterAttributeChanged();
    122125        return;
    123126    }
  • trunk/Source/WebCore/html/HTMLMetaElement.cpp

    r100895 r102511  
    5050        process();
    5151    else if (attr->name() == nameAttr) {
    52         // Do nothing.
     52        invalidateNodeListsCacheAfterAttributeChanged();
    5353    } else
    5454        HTMLElement::parseMappedAttribute(attr);
  • trunk/Source/WebCore/html/HTMLObjectElement.cpp

    r99742 r102511  
    123123        }
    124124        m_name = newName;
     125        invalidateNodeListsCacheAfterAttributeChanged();
    125126    } else if (attr->name() == borderAttr)
    126127        applyBorderAttribute(attr);
  • trunk/Source/WebCore/html/HTMLParamElement.cpp

    r99742 r102511  
    5858    } else if (attr->name() == nameAttr) {
    5959        m_name = attr->value();
     60        invalidateNodeListsCacheAfterAttributeChanged();
    6061    } else if (attr->name() == valueAttr) {
    6162        m_value = attr->value();
Note: See TracChangeset for help on using the changeset viewer.