Bug 160456 - HTMLCollection's named getter should only do 'name' attribute matching for HTMLElements
Summary: HTMLCollection's named getter should only do 'name' attribute matching for HT...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2016-08-02 10:33 PDT by Chris Dumez
Modified: 2016-08-02 12:15 PDT (History)
9 users (show)

See Also:


Attachments
Patch (5.05 KB, patch)
2016-08-02 10:41 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-08-02 10:33:17 PDT
HTMLCollection's named getter should only do 'name' attribute matching for HTMLElements:
- https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem

Our slow path which relies on HTMLCollection::updateNamedElementCache() does the right thing. However, we have a fast path in CachedHTMLCollection<HTMLCollectionClass, traversalType>::namedItem() that is missing a check.

Firefox and Chrome both behave correctly here.
Comment 1 Chris Dumez 2016-08-02 10:41:42 PDT
Created attachment 285119 [details]
Patch
Comment 2 Chris Dumez 2016-08-02 10:50:17 PDT
Comment on attachment 285119 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=285119&action=review

> LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-getElementsByTagName-expected.txt:11
> +FAIL hasOwnProperty, getOwnPropertyDescriptor, getOwnPropertyNames assert_true: desc.configurable expected true got false

This is due to https://bugs.webkit.org/show_bug.cgi?id=160457
Comment 3 Chris Dumez 2016-08-02 12:15:02 PDT
Comment on attachment 285119 [details]
Patch

Clearing flags on attachment: 285119

Committed r204034: <http://trac.webkit.org/changeset/204034>
Comment 4 Chris Dumez 2016-08-02 12:15:08 PDT
All reviewed patches have been landed.  Closing bug.