Bug 148117

Summary: NodeList should not have a named getter
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, barraclough, buildbot, commit-queue, darin, ggaren, koivisto, rniwa
Priority: P2 Keywords: WebExposed
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
URL: https://dom.spec.whatwg.org/#interface-nodelist
Bug Depends on: 110611, 147980    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from ews102 for mac-mavericks
none
Archive of layout-test-results from ews105 for mac-mavericks-wk2
none
Patch
none
Archive of layout-test-results from ews100 for mac-mavericks
none
Patch
none
Test none

Chris Dumez
Reported 2015-08-17 20:12:06 PDT
NodeList should not have a named getter. We currently have one because several of our Web APIs (getElementsByTagName / getElementsByClassName) return a NodeList instead of an HTMLCollection. One we fix those APIs, we may be able to drop the named getter on NodeList.
Attachments
Patch (13.19 KB, patch)
2015-08-21 19:31 PDT, Chris Dumez
no flags
Patch (13.21 KB, patch)
2015-08-21 19:37 PDT, Chris Dumez
no flags
Archive of layout-test-results from ews102 for mac-mavericks (537.86 KB, application/zip)
2015-08-21 20:11 PDT, Build Bot
no flags
Archive of layout-test-results from ews105 for mac-mavericks-wk2 (674.67 KB, application/zip)
2015-08-21 20:15 PDT, Build Bot
no flags
Patch (15.13 KB, patch)
2015-08-21 20:29 PDT, Chris Dumez
no flags
Archive of layout-test-results from ews100 for mac-mavericks (537.14 KB, application/zip)
2015-08-21 21:04 PDT, Build Bot
no flags
Patch (15.07 KB, patch)
2015-08-21 21:05 PDT, Chris Dumez
no flags
Test (2.42 KB, patch)
2015-08-24 11:03 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2015-08-21 19:31:41 PDT
Chris Dumez
Comment 2 2015-08-21 19:37:16 PDT
Build Bot
Comment 3 2015-08-21 20:11:22 PDT
Comment on attachment 259700 [details] Patch Attachment 259700 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/88405 New failing tests: fast/dom/named-items-with-symbol-name.html
Build Bot
Comment 4 2015-08-21 20:11:25 PDT
Created attachment 259701 [details] Archive of layout-test-results from ews102 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-mavericks Platform: Mac OS X 10.9.5
Build Bot
Comment 5 2015-08-21 20:15:55 PDT
Comment on attachment 259700 [details] Patch Attachment 259700 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/88409 New failing tests: fast/dom/named-items-with-symbol-name.html
Build Bot
Comment 6 2015-08-21 20:15:58 PDT
Created attachment 259702 [details] Archive of layout-test-results from ews105 for mac-mavericks-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-mavericks-wk2 Platform: Mac OS X 10.9.5
Chris Dumez
Comment 7 2015-08-21 20:29:45 PDT
Build Bot
Comment 8 2015-08-21 21:04:22 PDT
Comment on attachment 259703 [details] Patch Attachment 259703 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/88543 New failing tests: fast/dom/named-items-with-symbol-name.html
Build Bot
Comment 9 2015-08-21 21:04:25 PDT
Created attachment 259707 [details] Archive of layout-test-results from ews100 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-mavericks Platform: Mac OS X 10.9.5
Chris Dumez
Comment 10 2015-08-21 21:05:59 PDT
Darin Adler
Comment 11 2015-08-22 14:42:55 PDT
Comment on attachment 259708 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=259708&action=review > LayoutTests/fast/dom/named-items-with-symbol-name.html:19 > debug("\n" + String(getElementsByTagNameList)); Really should remove this unneeded newline.
Darin Adler
Comment 12 2015-08-22 14:45:38 PDT
Comment on attachment 259708 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=259708&action=review > Source/WebCore/ChangeLog:21 > + This change could be a bit risky but: > + 1. Firefox and IE never had this named property getter on NodeList. > + 2. Chrome successfuly dropped this named property getter in early 2014: > + https://src.chromium.org/viewvc/blink?revision=166356&view=revision > + 3. Our named property getter on NodeList is only partly functional: > + It only matches by 'id' attribute, not by 'name' attribute. > + 4. Our APIs that were wrongly returning a NodeList instead of an > + HTMLCollection (getElementsByTagName() / getElementsByClassName()) > + have been fixed in r188735 and r188809. HTMLCollection does have > + a named property getter. > + 5. This named getter adds code complexity. A few other thoughts, but I don’t think I should remove the commit queue flag. None of these fully address the issue of non-live-website content relying on this by accident. The change could break, say, iPhone apps that used this. I wonder how we can mitigate that risk? Items 3 and 5 are ways in which this patch improves things, but they are not relevant to risk, so I’m not sure they belong on this list. Spelling error: "successfully" is correct, "successfully" is wrong.
WebKit Commit Bot
Comment 13 2015-08-22 15:29:38 PDT
Comment on attachment 259708 [details] Patch Clearing flags on attachment: 259708 Committed r188829: <http://trac.webkit.org/changeset/188829>
WebKit Commit Bot
Comment 14 2015-08-22 15:29:44 PDT
All reviewed patches have been landed. Closing bug.
Chris Dumez
Comment 15 2015-08-24 10:02:50 PDT
(In reply to comment #11) > Comment on attachment 259708 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=259708&action=review > > > LayoutTests/fast/dom/named-items-with-symbol-name.html:19 > > debug("\n" + String(getElementsByTagNameList)); > > Really should remove this unneeded newline. Done in <http://trac.webkit.org/changeset/188863>.
Geoffrey Garen
Comment 16 2015-08-24 10:43:24 PDT
Should we add a test that verifies the absence of the name getter?
Chris Dumez
Comment 17 2015-08-24 10:44:19 PDT
(In reply to comment #16) > Should we add a test that verifies the absence of the name getter? I wasn't sure it was needed. But since you're suggesting it, I'll add one :)
Chris Dumez
Comment 18 2015-08-24 11:03:06 PDT
Reopening to attach new patch.
Chris Dumez
Comment 19 2015-08-24 11:03:11 PDT
Chris Dumez
Comment 20 2015-08-24 11:03:47 PDT
(In reply to comment #16) > Should we add a test that verifies the absence of the name getter? Just uploaded a patch that adds such test.
Geoffrey Garen
Comment 21 2015-08-24 13:59:52 PDT
Comment on attachment 259758 [details] Test r=me It's a bit strange to test for something *not* being there, but I think it's good practice in order to confirm the difference before and after the code change.
WebKit Commit Bot
Comment 22 2015-08-24 14:44:46 PDT
Comment on attachment 259758 [details] Test Clearing flags on attachment: 259758 Committed r188885: <http://trac.webkit.org/changeset/188885>
WebKit Commit Bot
Comment 23 2015-08-24 14:44:53 PDT
All reviewed patches have been landed. Closing bug.
Chris Dumez
Comment 24 2015-09-23 19:20:34 PDT
According to the perf bots, this was a ~9% progression on Dromaeo DOM Query subtest and ~3.8% overall on Dromaeo DOM Core.
Ryosuke Niwa
Comment 25 2015-09-23 19:23:43 PDT
(In reply to comment #24) > According to the perf bots, this was a ~9% progression on Dromaeo DOM Query > subtest and ~3.8% overall on Dromaeo DOM Core. Nice!
Note You need to log in before you can comment on or make changes to this bug.