Changeset 283423 in webkit
- Timestamp:
- Oct 1, 2021, 4:48:33 PM (5 years ago)
- Location:
- branches/safari-612.2.9.0-branch
- Files:
-
- 16 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/security/frameNavigation/context-for-location-href-gopd-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-incumbent-expected.txt (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/interpreter/CallFrame.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSObject.cpp (modified) (1 diff)
-
Source/JavaScriptCore/runtime/PropertySlot.h (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp (modified) (2 diffs)
-
Source/WebCore/bindings/js/JSDOMGlobalObject.h (modified) (1 diff)
-
Source/WebCore/bindings/js/JSDOMWindowBase.cpp (modified) (2 diffs)
-
Source/WebCore/bindings/js/JSDOMWindowBase.h (modified) (1 diff)
-
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (modified) (2 diffs)
-
Source/WebCore/page/Location.idl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612.2.9.0-branch/LayoutTests/ChangeLog
r283146 r283423 1 2021-10-01 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r283410. rdar://problem/83784757 4 5 Disable new incumbent-window until it is fully implemented 6 https://bugs.webkit.org/show_bug.cgi?id=230261 7 <rdar://problem/83099726> 8 9 Reviewed by Chris Dumez and Geoffrey Garen. 10 11 LayoutTests/imported/w3c: 12 13 * web-platform-tests/html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt: 14 * web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-incumbent-expected.txt: 15 16 Source/JavaScriptCore: 17 18 * interpreter/CallFrame.cpp: 19 (JSC::CallFrame::globalObjectOfClosestCodeBlock): 20 * runtime/JSObject.cpp: 21 (JSC::JSObject::getOwnPropertyDescriptor): 22 * runtime/PropertySlot.h: 23 24 Source/WebCore: 25 26 This patch disables new incumbent-window until it is fully implemented to avoid compatibility issue. 27 28 * bindings/js/JSDOMConvertCallbacks.h: 29 (WebCore::Converter<IDLCallbackFunction<T>>::convert): 30 (WebCore::Converter<IDLCallbackInterface<T>>::convert): 31 * bindings/js/JSDOMGlobalObject.cpp: 32 (WebCore::callerGlobalObject): 33 (WebCore::legacyActiveGlobalObjectForAccessor): 34 * bindings/js/JSDOMGlobalObject.h: 35 * bindings/js/JSDOMWindowBase.cpp: 36 (WebCore::incumbentDOMWindow): 37 (WebCore::legacyActiveDOMWindowForAccessor): 38 * bindings/js/JSDOMWindowBase.h: 39 * bindings/scripts/CodeGeneratorJS.pm: 40 (GetJSCAttributesForAttribute): 41 (GenerateCallWith): 42 * page/Location.idl: 43 44 LayoutTests: 45 46 * http/tests/security/frameNavigation/context-for-location-href-gopd-expected.txt: 47 48 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283410 268f45cc-cd09-0410-ab3c-d52691b4dbfc 49 50 2021-10-01 Yusuke Suzuki <ysuzuki@apple.com> 51 52 Disable new incumbent-window until it is fully implemented 53 https://bugs.webkit.org/show_bug.cgi?id=230261 54 <rdar://problem/83099726> 55 56 Reviewed by Chris Dumez and Geoffrey Garen. 57 58 * http/tests/security/frameNavigation/context-for-location-href-gopd-expected.txt: 59 1 60 2021-09-27 Alan Coon <alancoon@apple.com> 2 61 -
branches/safari-612.2.9.0-branch/LayoutTests/http/tests/security/frameNavigation/context-for-location-href-gopd-expected.txt
r280256 r283423 1 document.referrer = http://127.0.0.1:8000/security/frameNavigation/ context-for-location-href-gopd.html1 document.referrer = http://127.0.0.1:8000/security/frameNavigation/resources/middle-frame-for-location.html 2 2 -
branches/safari-612.2.9.0-branch/LayoutTests/imported/w3c/ChangeLog
r283057 r283423 1 2021-10-01 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r283410. rdar://problem/83784757 4 5 Disable new incumbent-window until it is fully implemented 6 https://bugs.webkit.org/show_bug.cgi?id=230261 7 <rdar://problem/83099726> 8 9 Reviewed by Chris Dumez and Geoffrey Garen. 10 11 LayoutTests/imported/w3c: 12 13 * web-platform-tests/html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt: 14 * web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-incumbent-expected.txt: 15 16 Source/JavaScriptCore: 17 18 * interpreter/CallFrame.cpp: 19 (JSC::CallFrame::globalObjectOfClosestCodeBlock): 20 * runtime/JSObject.cpp: 21 (JSC::JSObject::getOwnPropertyDescriptor): 22 * runtime/PropertySlot.h: 23 24 Source/WebCore: 25 26 This patch disables new incumbent-window until it is fully implemented to avoid compatibility issue. 27 28 * bindings/js/JSDOMConvertCallbacks.h: 29 (WebCore::Converter<IDLCallbackFunction<T>>::convert): 30 (WebCore::Converter<IDLCallbackInterface<T>>::convert): 31 * bindings/js/JSDOMGlobalObject.cpp: 32 (WebCore::callerGlobalObject): 33 (WebCore::legacyActiveGlobalObjectForAccessor): 34 * bindings/js/JSDOMGlobalObject.h: 35 * bindings/js/JSDOMWindowBase.cpp: 36 (WebCore::incumbentDOMWindow): 37 (WebCore::legacyActiveDOMWindowForAccessor): 38 * bindings/js/JSDOMWindowBase.h: 39 * bindings/scripts/CodeGeneratorJS.pm: 40 (GetJSCAttributesForAttribute): 41 (GenerateCallWith): 42 * page/Location.idl: 43 44 LayoutTests: 45 46 * http/tests/security/frameNavigation/context-for-location-href-gopd-expected.txt: 47 48 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283410 268f45cc-cd09-0410-ab3c-d52691b4dbfc 49 50 2021-10-01 Yusuke Suzuki <ysuzuki@apple.com> 51 52 Disable new incumbent-window until it is fully implemented 53 https://bugs.webkit.org/show_bug.cgi?id=230261 54 <rdar://problem/83099726> 55 56 Reviewed by Chris Dumez and Geoffrey Garen. 57 58 * web-platform-tests/html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt: 59 * web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-incumbent-expected.txt: 60 1 61 2021-09-24 Russell Epstein <repstein@apple.com> 2 62 -
branches/safari-612.2.9.0-branch/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt
r280256 r283423 2 2 PASS The Function instance must be created in the Realm of the node document 3 3 FAIL The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document assert_equals: expected "/html/webappapis/scripting/events/resources/open-window.html" but got "/html/webappapis/scripting/events/open-window.html" 4 PASS The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document 4 FAIL The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document assert_equals: expected "iframe" but got "parent frame" 5 5 -
branches/safari-612.2.9.0-branch/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-incumbent-expected.txt
r280256 r283423 3 3 PASS Sanity check: this all works as expected with no promises involved 4 4 PASS Fulfillment handler on fulfilled promise 5 FAIL Fulfillment handler on fulfilled promise, using backup incumbent settings object stack assert_equals: expected "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/promise-job-incumbent-incumbent.html" but got "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/ promise-job-incumbent.html"5 FAIL Fulfillment handler on fulfilled promise, using backup incumbent settings object stack assert_equals: expected "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/promise-job-incumbent-incumbent.html" but got "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/current/current.html" 6 6 PASS Rejection handler on rejected promise 7 FAIL Rejection handler on rejected promise, using backup incumbent settings object stack assert_equals: expected "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/promise-job-incumbent-incumbent.html" but got "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/ promise-job-incumbent.html"7 FAIL Rejection handler on rejected promise, using backup incumbent settings object stack assert_equals: expected "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/promise-job-incumbent-incumbent.html" but got "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/current/current.html" 8 8 PASS Fulfillment handler on pending-then-fulfilled promise 9 FAIL Fulfillment handler on pending-then-fulfilled promise, using backup incumbent settings object stack assert_equals: expected "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/promise-job-incumbent-incumbent.html" but got "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/ promise-job-incumbent.html"9 FAIL Fulfillment handler on pending-then-fulfilled promise, using backup incumbent settings object stack assert_equals: expected "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/promise-job-incumbent-incumbent.html" but got "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/current/current.html" 10 10 PASS Rejection handler on pending-then-rejected promise 11 FAIL Rejection handler on pending-then-rejected promise, using backup incumbent settings object stack assert_equals: expected "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/promise-job-incumbent-incumbent.html" but got "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/ promise-job-incumbent.html"11 FAIL Rejection handler on pending-then-rejected promise, using backup incumbent settings object stack assert_equals: expected "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/promise-job-incumbent-incumbent.html" but got "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/current/current.html" 12 12 PASS Thenable resolution 13 FAIL Thenable resolution, using backup incumbent settings object stack assert_equals: expected "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/promise-job-incumbent-incumbent.html" but got "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/ promise-job-incumbent.html"13 FAIL Thenable resolution, using backup incumbent settings object stack assert_equals: expected "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/promise-job-incumbent-incumbent.html" but got "http://localhost:8800/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/resources/current/current.html" 14 14 -
branches/safari-612.2.9.0-branch/Source/JavaScriptCore/ChangeLog
r283148 r283423 1 2021-10-01 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r283410. rdar://problem/83784757 4 5 Disable new incumbent-window until it is fully implemented 6 https://bugs.webkit.org/show_bug.cgi?id=230261 7 <rdar://problem/83099726> 8 9 Reviewed by Chris Dumez and Geoffrey Garen. 10 11 LayoutTests/imported/w3c: 12 13 * web-platform-tests/html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt: 14 * web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-incumbent-expected.txt: 15 16 Source/JavaScriptCore: 17 18 * interpreter/CallFrame.cpp: 19 (JSC::CallFrame::globalObjectOfClosestCodeBlock): 20 * runtime/JSObject.cpp: 21 (JSC::JSObject::getOwnPropertyDescriptor): 22 * runtime/PropertySlot.h: 23 24 Source/WebCore: 25 26 This patch disables new incumbent-window until it is fully implemented to avoid compatibility issue. 27 28 * bindings/js/JSDOMConvertCallbacks.h: 29 (WebCore::Converter<IDLCallbackFunction<T>>::convert): 30 (WebCore::Converter<IDLCallbackInterface<T>>::convert): 31 * bindings/js/JSDOMGlobalObject.cpp: 32 (WebCore::callerGlobalObject): 33 (WebCore::legacyActiveGlobalObjectForAccessor): 34 * bindings/js/JSDOMGlobalObject.h: 35 * bindings/js/JSDOMWindowBase.cpp: 36 (WebCore::incumbentDOMWindow): 37 (WebCore::legacyActiveDOMWindowForAccessor): 38 * bindings/js/JSDOMWindowBase.h: 39 * bindings/scripts/CodeGeneratorJS.pm: 40 (GetJSCAttributesForAttribute): 41 (GenerateCallWith): 42 * page/Location.idl: 43 44 LayoutTests: 45 46 * http/tests/security/frameNavigation/context-for-location-href-gopd-expected.txt: 47 48 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283410 268f45cc-cd09-0410-ab3c-d52691b4dbfc 49 50 2021-10-01 Yusuke Suzuki <ysuzuki@apple.com> 51 52 Disable new incumbent-window until it is fully implemented 53 https://bugs.webkit.org/show_bug.cgi?id=230261 54 <rdar://problem/83099726> 55 56 Reviewed by Chris Dumez and Geoffrey Garen. 57 58 * interpreter/CallFrame.cpp: 59 (JSC::CallFrame::globalObjectOfClosestCodeBlock): 60 * runtime/JSObject.cpp: 61 (JSC::JSObject::getOwnPropertyDescriptor): 62 * runtime/PropertySlot.h: 63 1 64 2021-09-27 Alan Coon <alancoon@apple.com> 2 65 -
branches/safari-612.2.9.0-branch/Source/JavaScriptCore/interpreter/CallFrame.cpp
r280256 r283423 248 248 JSGlobalObject* CallFrame::globalObjectOfClosestCodeBlock(VM& vm, CallFrame* callFrame) 249 249 { 250 // FIXME: We need to handle JSONP interpretation case in ProgramExecutable since it does not have vm.topCallFrame. 251 // rdar://83691438 250 252 JSGlobalObject* globalObject = nullptr; 251 253 StackVisitor::visit(callFrame, vm, [&](StackVisitor& visitor) { -
branches/safari-612.2.9.0-branch/Source/JavaScriptCore/runtime/JSObject.cpp
r280505 r283423 3678 3678 descriptor.setAccessorDescriptor((slot.attributes() | PropertyAttribute::Accessor) & ~PropertyAttribute::CustomAccessor); 3679 3679 JSGlobalObject* slotBaseGlobalObject = slot.slotBase()->globalObject(vm); 3680 if (slot.attributes() & PropertyAttribute::DOMLegacyAccessor) 3681 slotBaseGlobalObject = globalObject; 3680 3682 if (slot.customGetter()) 3681 3683 descriptor.setGetter(createCustomGetterFunction(slotBaseGlobalObject, vm, propertyName, slot.customGetter(), slot.domAttribute())); -
branches/safari-612.2.9.0-branch/Source/JavaScriptCore/runtime/PropertySlot.h
r280256 r283423 46 46 CustomAccessor = 1 << 5, 47 47 CustomValue = 1 << 6, 48 DOMLegacyAccessor = 1 << 7, // property is a DOM legacy accessor, which holds caller's global object when it is materialized. 48 49 CustomAccessorOrValue = CustomAccessor | CustomValue, 49 50 AccessorOrCustomAccessorOrValue = Accessor | CustomAccessor | CustomValue, -
branches/safari-612.2.9.0-branch/Source/WebCore/ChangeLog
r283146 r283423 1 2021-10-01 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r283410. rdar://problem/83784757 4 5 Disable new incumbent-window until it is fully implemented 6 https://bugs.webkit.org/show_bug.cgi?id=230261 7 <rdar://problem/83099726> 8 9 Reviewed by Chris Dumez and Geoffrey Garen. 10 11 LayoutTests/imported/w3c: 12 13 * web-platform-tests/html/webappapis/scripting/events/compile-event-handler-settings-objects-expected.txt: 14 * web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-incumbent-expected.txt: 15 16 Source/JavaScriptCore: 17 18 * interpreter/CallFrame.cpp: 19 (JSC::CallFrame::globalObjectOfClosestCodeBlock): 20 * runtime/JSObject.cpp: 21 (JSC::JSObject::getOwnPropertyDescriptor): 22 * runtime/PropertySlot.h: 23 24 Source/WebCore: 25 26 This patch disables new incumbent-window until it is fully implemented to avoid compatibility issue. 27 28 * bindings/js/JSDOMConvertCallbacks.h: 29 (WebCore::Converter<IDLCallbackFunction<T>>::convert): 30 (WebCore::Converter<IDLCallbackInterface<T>>::convert): 31 * bindings/js/JSDOMGlobalObject.cpp: 32 (WebCore::callerGlobalObject): 33 (WebCore::legacyActiveGlobalObjectForAccessor): 34 * bindings/js/JSDOMGlobalObject.h: 35 * bindings/js/JSDOMWindowBase.cpp: 36 (WebCore::incumbentDOMWindow): 37 (WebCore::legacyActiveDOMWindowForAccessor): 38 * bindings/js/JSDOMWindowBase.h: 39 * bindings/scripts/CodeGeneratorJS.pm: 40 (GetJSCAttributesForAttribute): 41 (GenerateCallWith): 42 * page/Location.idl: 43 44 LayoutTests: 45 46 * http/tests/security/frameNavigation/context-for-location-href-gopd-expected.txt: 47 48 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283410 268f45cc-cd09-0410-ab3c-d52691b4dbfc 49 50 2021-10-01 Yusuke Suzuki <ysuzuki@apple.com> 51 52 Disable new incumbent-window until it is fully implemented 53 https://bugs.webkit.org/show_bug.cgi?id=230261 54 <rdar://problem/83099726> 55 56 Reviewed by Chris Dumez and Geoffrey Garen. 57 58 This patch disables new incumbent-window until it is fully implemented to avoid compatibility issue. 59 60 * bindings/js/JSDOMConvertCallbacks.h: 61 (WebCore::Converter<IDLCallbackFunction<T>>::convert): 62 (WebCore::Converter<IDLCallbackInterface<T>>::convert): 63 * bindings/js/JSDOMGlobalObject.cpp: 64 (WebCore::callerGlobalObject): 65 (WebCore::legacyActiveGlobalObjectForAccessor): 66 * bindings/js/JSDOMGlobalObject.h: 67 * bindings/js/JSDOMWindowBase.cpp: 68 (WebCore::incumbentDOMWindow): 69 (WebCore::legacyActiveDOMWindowForAccessor): 70 * bindings/js/JSDOMWindowBase.h: 71 * bindings/scripts/CodeGeneratorJS.pm: 72 (GetJSCAttributesForAttribute): 73 (GenerateCallWith): 74 * page/Location.idl: 75 1 76 2021-09-27 Alan Coon <alancoon@apple.com> 2 77 -
branches/safari-612.2.9.0-branch/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
r280627 r283423 61 61 #include <JavaScriptCore/JSInternalPromise.h> 62 62 #include <JavaScriptCore/StructureInlines.h> 63 #include <JavaScriptCore/VMEntryScope.h> 63 64 #include <JavaScriptCore/VMTrapsInlines.h> 64 65 #include <JavaScriptCore/WasmStreamingCompiler.h> … … 561 562 } 562 563 564 static JSDOMGlobalObject& callerGlobalObject(JSC::JSGlobalObject& lexicalGlobalObject, JSC::CallFrame* callFrame, bool skipFirstFrame, bool lookUpFromVMEntryScope) 565 { 566 VM& vm = lexicalGlobalObject.vm(); 567 if (callFrame) { 568 class GetCallerGlobalObjectFunctor { 569 public: 570 GetCallerGlobalObjectFunctor(bool skipFirstFrame) 571 : m_skipFirstFrame(skipFirstFrame) 572 { } 573 574 StackVisitor::Status operator()(StackVisitor& visitor) const 575 { 576 if (m_skipFirstFrame) { 577 if (!m_hasSkippedFirstFrame) { 578 m_hasSkippedFirstFrame = true; 579 return StackVisitor::Continue; 580 } 581 } 582 583 if (auto* codeBlock = visitor->codeBlock()) 584 m_globalObject = codeBlock->globalObject(); 585 else { 586 ASSERT(visitor->callee().rawPtr()); 587 // FIXME: Callee is not an object if the caller is Web Assembly. 588 // Figure out what to do here. We can probably get the global object 589 // from the top-most Wasm Instance. https://bugs.webkit.org/show_bug.cgi?id=165721 590 if (visitor->callee().isCell() && visitor->callee().asCell()->isObject()) 591 m_globalObject = jsCast<JSObject*>(visitor->callee().asCell())->globalObject(); 592 } 593 return StackVisitor::Done; 594 } 595 596 JSC::JSGlobalObject* globalObject() const { return m_globalObject; } 597 598 private: 599 bool m_skipFirstFrame { false }; 600 mutable bool m_hasSkippedFirstFrame { false }; 601 mutable JSC::JSGlobalObject* m_globalObject { nullptr }; 602 }; 603 604 GetCallerGlobalObjectFunctor iter(skipFirstFrame); 605 callFrame->iterate(vm, iter); 606 if (iter.globalObject()) 607 return *jsCast<JSDOMGlobalObject*>(iter.globalObject()); 608 } 609 610 // In the case of legacyActiveGlobalObjectForAccessor, it is possible that vm.topCallFrame is nullptr when the script is evaluated as JSONP. 611 // Since we put JSGlobalObject to VMEntryScope, we can retrieve the right globalObject from that. 612 // For callerGlobalObject, we do not check vm.entryScope to keep it the old behavior. 613 if (lookUpFromVMEntryScope) { 614 if (vm.entryScope) { 615 if (auto* result = vm.entryScope->globalObject()) 616 return *jsCast<JSDOMGlobalObject*>(result); 617 } 618 } 619 620 // If we cannot find JSGlobalObject in caller frames, we just return the current lexicalGlobalObject. 621 return *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject); 622 } 623 624 JSDOMGlobalObject& callerGlobalObject(JSC::JSGlobalObject& lexicalGlobalObject, JSC::CallFrame* callFrame) 625 { 626 constexpr bool skipFirstFrame = true; 627 constexpr bool lookUpFromVMEntryScope = false; 628 return callerGlobalObject(lexicalGlobalObject, callFrame, skipFirstFrame, lookUpFromVMEntryScope); 629 } 630 631 JSDOMGlobalObject& legacyActiveGlobalObjectForAccessor(JSC::JSGlobalObject& lexicalGlobalObject, JSC::CallFrame* callFrame) 632 { 633 constexpr bool skipFirstFrame = false; 634 constexpr bool lookUpFromVMEntryScope = true; 635 return callerGlobalObject(lexicalGlobalObject, callFrame, skipFirstFrame, lookUpFromVMEntryScope); 636 } 637 563 638 } // namespace WebCore -
branches/safari-612.2.9.0-branch/Source/WebCore/bindings/js/JSDOMGlobalObject.h
r280256 r283423 144 144 145 145 JSDOMGlobalObject* toJSDOMGlobalObject(ScriptExecutionContext&, DOMWrapperWorld&); 146 WEBCORE_EXPORT JSDOMGlobalObject& callerGlobalObject(JSC::JSGlobalObject&, JSC::CallFrame*); 147 JSDOMGlobalObject& legacyActiveGlobalObjectForAccessor(JSC::JSGlobalObject&, JSC::CallFrame*); 146 148 147 149 template<class JSClass> -
branches/safari-612.2.9.0-branch/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
r280256 r283423 285 285 DOMWindow& incumbentDOMWindow(JSGlobalObject& fallbackGlobalObject, CallFrame& callFrame) 286 286 { 287 if (auto* globalObject = CallFrame::globalObjectOfClosestCodeBlock(fallbackGlobalObject.vm(), &callFrame)) 288 return asJSDOMWindow(globalObject)->wrapped(); 289 return asJSDOMWindow(&fallbackGlobalObject)->wrapped(); 287 return asJSDOMWindow(&callerGlobalObject(fallbackGlobalObject, &callFrame))->wrapped(); 290 288 } 291 289 292 290 DOMWindow& incumbentDOMWindow(JSGlobalObject& fallbackGlobalObject) 293 291 { 294 VM& vm = fallbackGlobalObject.vm(); 295 if (auto* globalObject = CallFrame::globalObjectOfClosestCodeBlock(vm, vm.topCallFrame)) 296 return asJSDOMWindow(globalObject)->wrapped(); 297 return asJSDOMWindow(&fallbackGlobalObject)->wrapped(); 292 return asJSDOMWindow(&callerGlobalObject(fallbackGlobalObject, fallbackGlobalObject.vm().topCallFrame))->wrapped(); 298 293 } 299 294 … … 307 302 VM& vm = lexicalGlobalObject.vm(); 308 303 return asJSDOMWindow(vm.deprecatedVMEntryGlobalObject(&lexicalGlobalObject))->wrapped(); 304 } 305 306 DOMWindow& legacyActiveDOMWindowForAccessor(JSGlobalObject& fallbackGlobalObject, CallFrame& callFrame) 307 { 308 return asJSDOMWindow(&legacyActiveGlobalObjectForAccessor(fallbackGlobalObject, &callFrame))->wrapped(); 309 } 310 311 DOMWindow& legacyActiveDOMWindowForAccessor(JSGlobalObject& fallbackGlobalObject) 312 { 313 return asJSDOMWindow(&legacyActiveGlobalObjectForAccessor(fallbackGlobalObject, fallbackGlobalObject.vm().topCallFrame))->wrapped(); 309 314 } 310 315 -
branches/safari-612.2.9.0-branch/Source/WebCore/bindings/js/JSDOMWindowBase.h
r280256 r283423 127 127 DOMWindow& firstDOMWindow(JSC::JSGlobalObject&); 128 128 129 DOMWindow& legacyActiveDOMWindowForAccessor(JSC::JSGlobalObject&, JSC::CallFrame&); 130 DOMWindow& legacyActiveDOMWindowForAccessor(JSC::JSGlobalObject&); 131 129 132 // FIXME: This should probably be removed in favor of one of the other DOMWindow accessors. It is intended 130 133 // to provide the document specfied as the 'responsible document' in the algorithm for document.open() -
branches/safari-612.2.9.0-branch/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r283017 r283423 2056 2056 push(@specials, "JSC::PropertyAttribute::ReadOnly") if IsReadonly($attribute); 2057 2057 push(@specials, "JSC::PropertyAttribute::CustomAccessor") unless $isGlobalConstructor or IsJSBuiltin($interface, $attribute); 2058 push(@specials, "JSC::PropertyAttribute::DOMLegacyAccessor") if $attribute->extendedAttributes->{LegacyActiveWindowForAccessor}; 2058 2059 push(@specials, "JSC::PropertyAttribute::DOMAttribute") if IsAcceleratedDOMAttribute($interface, $attribute); 2059 2060 push(@specials, "JSC::PropertyAttribute::DOMJITAttribute") if $attribute->extendedAttributes->{DOMJIT}; … … 5985 5986 push(@callWithArgs, "incumbentDOMWindow(*$globalObject" . ($callFrameReference ? ", " . $callFrameReference : "") . ")"); 5986 5987 } 5988 if ($codeGenerator->ExtendedAttributeContains($callWith, "LegacyActiveWindowForAccessor")) { 5989 AddToImplIncludes("DOMWindow.h"); 5990 AddToImplIncludes("JSDOMWindowBase.h"); 5991 push(@callWithArgs, "legacyActiveDOMWindowForAccessor(*$globalObject" . ($callFrameReference ? ", " . $callFrameReference : "") . ")"); 5992 } 5987 5993 if ($codeGenerator->ExtendedAttributeContains($callWith, "FirstWindow")) { 5988 5994 AddToImplIncludes("DOMWindow.h"); -
branches/safari-612.2.9.0-branch/Source/WebCore/page/Location.idl
r280826 r283423 44 44 Exposed=Window 45 45 ] interface Location { 46 [SetterCallWith= IncumbentWindow&FirstWindow, DoNotCheckSecurityOnSetter] stringifier attribute USVString href;46 [SetterCallWith=LegacyActiveWindowForAccessor&FirstWindow, DoNotCheckSecurityOnSetter] stringifier attribute USVString href; 47 47 48 48 // FIXME: We should use IncumbentWindow once we found why https://bugs.webkit.org/show_bug.cgi?id=228943 issue occured. … … 52 52 53 53 // URI decomposition attributes 54 [SetterCallWith= IncumbentWindow&FirstWindow] attribute USVString protocol;55 [SetterCallWith= IncumbentWindow&FirstWindow] attribute USVString host;56 [SetterCallWith= IncumbentWindow&FirstWindow] attribute USVString hostname;57 [SetterCallWith= IncumbentWindow&FirstWindow] attribute USVString port;58 [SetterCallWith= IncumbentWindow&FirstWindow] attribute USVString pathname;59 [SetterCallWith= IncumbentWindow&FirstWindow] attribute USVString search;60 [SetterCallWith= IncumbentWindow&FirstWindow] attribute USVString hash;54 [SetterCallWith=LegacyActiveWindowForAccessor&FirstWindow] attribute USVString protocol; 55 [SetterCallWith=LegacyActiveWindowForAccessor&FirstWindow] attribute USVString host; 56 [SetterCallWith=LegacyActiveWindowForAccessor&FirstWindow] attribute USVString hostname; 57 [SetterCallWith=LegacyActiveWindowForAccessor&FirstWindow] attribute USVString port; 58 [SetterCallWith=LegacyActiveWindowForAccessor&FirstWindow] attribute USVString pathname; 59 [SetterCallWith=LegacyActiveWindowForAccessor&FirstWindow] attribute USVString search; 60 [SetterCallWith=LegacyActiveWindowForAccessor&FirstWindow] attribute USVString hash; 61 61 62 62 readonly attribute USVString origin;
Note:
See TracChangeset
for help on using the changeset viewer.