RESOLVED FIXED 154156
Separate out !allowsAccess path in JSDOMWindowCustom getOwnPropertySlot
https://bugs.webkit.org/show_bug.cgi?id=154156
Summary Separate out !allowsAccess path in JSDOMWindowCustom getOwnPropertySlot
Gavin Barraclough
Reported 2016-02-11 23:22:49 PST
Make the decision as to what we allow access to more explicit.
Attachments
WIP (15.69 KB, patch)
2016-02-11 23:23 PST, Gavin Barraclough
no flags
WIP 2 (17.10 KB, patch)
2016-02-11 23:30 PST, Gavin Barraclough
buildbot: commit-queue-
Archive of layout-test-results from ews103 for mac-yosemite (881.06 KB, application/zip)
2016-02-12 00:32 PST, Build Bot
no flags
Archive of layout-test-results from ews107 for mac-yosemite-wk2 (945.75 KB, application/zip)
2016-02-12 00:33 PST, Build Bot
no flags
Archive of layout-test-results from ews113 for mac-yosemite (825.41 KB, application/zip)
2016-02-12 00:36 PST, Build Bot
no flags
Patch (19.53 KB, patch)
2016-02-12 01:52 PST, Gavin Barraclough
no flags
Patch (19.51 KB, patch)
2016-02-12 02:00 PST, Gavin Barraclough
no flags
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (871.44 KB, application/zip)
2016-02-12 02:57 PST, Build Bot
no flags
Archive of layout-test-results from ews102 for mac-yosemite (771.58 KB, application/zip)
2016-02-12 03:01 PST, Build Bot
no flags
Archive of layout-test-results from ews113 for mac-yosemite (869.62 KB, application/zip)
2016-02-12 03:05 PST, Build Bot
no flags
Patch (20.37 KB, patch)
2016-02-12 10:06 PST, Gavin Barraclough
cdumez: review+
cdumez: commit-queue-
Gavin Barraclough
Comment 1 2016-02-11 23:23:58 PST
WebKit Commit Bot
Comment 2 2016-02-11 23:24:42 PST
Attachment 271138 [details] did not pass style-queue: ERROR: Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:126: An else if statement should be written as an if statement when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] ERROR: Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:160: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:160: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:161: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:162: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:163: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:164: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:165: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:166: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] ERROR: Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:167: Boolean expressions that span multiple lines should have their operators on the left side of the line instead of the right side. [whitespace/operators] [4] Total errors found: 10 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Gavin Barraclough
Comment 3 2016-02-11 23:30:00 PST
Build Bot
Comment 4 2016-02-12 00:31:58 PST
Comment on attachment 271139 [details] WIP 2 Attachment 271139 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/818151 New failing tests: http/tests/security/xss-DENIED-window-name-navigator.html imported/w3c/web-platform-tests/html/dom/interfaces.html fast/dom/Window/window-postmessage-clone-frames.html
Build Bot
Comment 5 2016-02-12 00:32:03 PST
Created attachment 271143 [details] Archive of layout-test-results from ews103 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 6 2016-02-12 00:33:19 PST
Comment on attachment 271139 [details] WIP 2 Attachment 271139 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/818150 New failing tests: http/tests/security/xss-DENIED-window-name-navigator.html imported/w3c/web-platform-tests/html/dom/interfaces.html
Build Bot
Comment 7 2016-02-12 00:33:22 PST
Created attachment 271144 [details] Archive of layout-test-results from ews107 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 8 2016-02-12 00:36:47 PST
Comment on attachment 271139 [details] WIP 2 Attachment 271139 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/818149 New failing tests: http/tests/security/xss-DENIED-window-name-navigator.html fast/dom/Window/window-postmessage-clone-frames.html
Build Bot
Comment 9 2016-02-12 00:36:51 PST
Created attachment 271145 [details] Archive of layout-test-results from ews113 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-yosemite Platform: Mac OS X 10.10.5
Gavin Barraclough
Comment 10 2016-02-12 01:52:20 PST
WebKit Commit Bot
Comment 11 2016-02-12 01:55:02 PST
Attachment 271152 [details] did not pass style-queue: ERROR: Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:148: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] Total errors found: 1 in 4 files If any of these errors are false positives, please file a bug against check-webkit-style.
Gavin Barraclough
Comment 12 2016-02-12 02:00:20 PST
Build Bot
Comment 13 2016-02-12 02:57:22 PST
Comment on attachment 271153 [details] Patch Attachment 271153 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/818581 New failing tests: http/tests/security/document-all.html http/tests/security/window-named-valueOf.html http/tests/security/window-named-proto.html
Build Bot
Comment 14 2016-02-12 02:57:25 PST
Created attachment 271157 [details] Archive of layout-test-results from ews106 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 15 2016-02-12 03:00:58 PST
Comment on attachment 271153 [details] Patch Attachment 271153 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/818605 New failing tests: http/tests/security/document-all.html http/tests/security/window-named-valueOf.html http/tests/security/window-named-proto.html
Build Bot
Comment 16 2016-02-12 03:01:02 PST
Created attachment 271158 [details] Archive of layout-test-results from ews102 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 17 2016-02-12 03:05:51 PST
Comment on attachment 271153 [details] Patch Attachment 271153 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/818600 New failing tests: http/tests/security/document-all.html http/tests/security/window-named-valueOf.html http/tests/security/window-named-proto.html
Build Bot
Comment 18 2016-02-12 03:05:54 PST
Created attachment 271159 [details] Archive of layout-test-results from ews113 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews113 Port: mac-yosemite Platform: Mac OS X 10.10.5
Gavin Barraclough
Comment 19 2016-02-12 10:06:30 PST
Chris Dumez
Comment 20 2016-02-12 11:33:43 PST
Comment on attachment 271184 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=271184&action=review r=me > Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:115 > +static bool jsDOMWindowGetOwnPropertySlotDisallowAccess(JSDOMWindow* thisObject, ExecState* exec, PropertyName propertyName, PropertySlot& slot, String& errorMessage) I would have gone with "CrossOrigin" instead of "DisallowAccess" but no big deal. > Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:160 > + // For any other entrires in the static property table, deny access. (Early return also prevents "entries" > Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:175 > + if (asObject(proto)->getPropertySlot(exec, propertyName, slot)) { Could be in the previous if condition with && > Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:200 > + if (auto scopedChild = thisObject->wrapped().frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))) { auto* for clarity > Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:316 > + if (asObject(proto)->getPropertySlot(exec, propertyName, slot)) Could be in the previous if condition with &&. Then we can loose the curly brackets. > Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:331 > + if (auto scopedChild = thisObject->wrapped().frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))) { auto* > Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:390 > + if (auto scopedChild = thisObject->wrapped().frame()->tree().scopedChild(propertyNameToAtomicString(propertyName))) { auto* > Source/WebCore/bindings/js/JSDOMWindowCustom.cpp:399 > + if (asObject(proto)->getPropertySlot(exec, index, slot)) Could be in previous if condition with &&
Gavin Barraclough
Comment 21 2016-02-12 12:21:01 PST
Made all code review changes; Committed revision 196494.
Note You need to log in before you can comment on or make changes to this bug.