Bug 154102 - JSDOMWindow::getOwnPropertySlot should not search prototype chain
Summary: JSDOMWindow::getOwnPropertySlot should not search prototype chain
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gavin Barraclough
URL:
Keywords:
Depends on: 154120
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-11 00:07 PST by Gavin Barraclough
Modified: 2016-02-17 22:25 PST (History)
9 users (show)

See Also:


Attachments
Patch for EWS (9.76 KB, patch)
2016-02-11 00:11 PST, Gavin Barraclough
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (899.14 KB, application/zip)
2016-02-11 00:58 PST, Build Bot
no flags Details
Archive of layout-test-results from ews104 for mac-yosemite-wk2 (1.05 MB, application/zip)
2016-02-11 01:02 PST, Build Bot
no flags Details
Archive of layout-test-results from ews114 for mac-yosemite (863.52 KB, application/zip)
2016-02-11 01:15 PST, Build Bot
no flags Details
Fix (5.75 KB, patch)
2016-02-16 15:24 PST, Gavin Barraclough
cdumez: review-
Details | Formatted Diff | Diff
Updated patch (9.06 KB, patch)
2016-02-16 17:07 PST, Gavin Barraclough
cdumez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2016-02-11 00:07:31 PST
"Own"
Comment 1 Gavin Barraclough 2016-02-11 00:11:40 PST
Created attachment 271049 [details]
Patch for EWS
Comment 2 Build Bot 2016-02-11 00:58:04 PST
Comment on attachment 271049 [details]
Patch for EWS

Attachment 271049 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/813426

New failing tests:
imported/w3c/web-platform-tests/html/dom/interfaces.html
http/tests/security/window-named-valueOf.html
fast/dom/Window/es52-globals.html
Comment 3 Build Bot 2016-02-11 00:58:05 PST
Created attachment 271051 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 4 Build Bot 2016-02-11 01:02:32 PST
Comment on attachment 271049 [details]
Patch for EWS

Attachment 271049 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/813434

New failing tests:
imported/w3c/web-platform-tests/html/dom/interfaces.html
http/tests/security/window-named-valueOf.html
fast/dom/Window/es52-globals.html
Comment 5 Build Bot 2016-02-11 01:02:33 PST
Created attachment 271052 [details]
Archive of layout-test-results from ews104 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 6 Build Bot 2016-02-11 01:15:00 PST
Comment on attachment 271049 [details]
Patch for EWS

Attachment 271049 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/813420

New failing tests:
http/tests/security/window-named-valueOf.html
fast/dom/Window/es52-globals.html
Comment 7 Build Bot 2016-02-11 01:15:01 PST
Created attachment 271053 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 8 Gavin Barraclough 2016-02-16 15:24:12 PST
Created attachment 271494 [details]
Fix
Comment 9 Chris Dumez 2016-02-16 15:35:36 PST
Comment on attachment 271494 [details]
Fix

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

> Source/JavaScriptCore/runtime/JSObject.cpp:-2555
> -    // JSDOMWindow::getOwnPropertySlot() may return attributes from the prototype chain but getOwnPropertyDescriptor()

Nice that we can get rid of this hack.

> Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:199
> +    if (proto.isObject() && asObject(proto)->getPropertySlot(exec, propertyName, prototypeSlot))

Why don't we use asObject(proto)->hasProperty(exec, propertyName) ? This is what our generated bindings are doing and it avoids having to construct a slot.
Comment 10 Chris Dumez 2016-02-16 15:37:46 PST
Comment on attachment 271494 [details]
Fix

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

> Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:195
>      // FIXME: If the property is present on the prototype we should 'return false;', not

We should also drop this FIXME :o)
Comment 11 Chris Dumez 2016-02-16 15:39:29 PST
Comment on attachment 271494 [details]
Fix

You also apparently need to check imported/w3c/web-platform-tests/html/dom/interfaces.html as it is failing on ews.
Comment 12 Gavin Barraclough 2016-02-16 17:07:43 PST
Created attachment 271511 [details]
Updated patch
Comment 13 Chris Dumez 2016-02-16 17:10:25 PST
Comment on attachment 271511 [details]
Updated patch

Nice, r=me!
Comment 14 Gavin Barraclough 2016-02-16 17:38:00 PST
Transmitting file data ........
Committed revision 196676.
Comment 15 Simon Fraser (smfr) 2016-02-16 17:42:54 PST
What is the photo chain?
Comment 16 Chris Dumez 2016-02-17 22:25:55 PST
Comment on attachment 271511 [details]
Updated patch

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

> Source/JavaScriptCore/runtime/JSObject.cpp:-2555
> -    // JSDOMWindow::getOwnPropertySlot() may return attributes from the prototype chain but getOwnPropertyDescriptor()

Looks like this may have caused Bug 154378. As it turns out, JSDOMWindow::getOwnPropertySlot() is not the only one returning attributes from the prototype chain, so does DebuggerScope::getOwnPropertySlot() :/