Title: [216534] trunk/Source/WebCore
Revision
216534
Author
[email protected]
Date
2017-05-09 13:01:05 -0700 (Tue, 09 May 2017)

Log Message

Drop custom bindings code for Window.location setter
https://bugs.webkit.org/show_bug.cgi?id=171846

Reviewed by Sam Weinig.

Drop custom bindings code for Window.location setter as the custom code was merely needed
to address a very old Mac widget that has long been fixed (rdar://problem/5695330).

No new tests, no Web-facing behavior change.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setLocation): Deleted.
Drop custom code.

* page/DOMWindow.idl:
Align Window.location with https://html.spec.whatwg.org/#the-window-object:
- Mark property as readonly.
- Add [PutsForward=href] IDL extended attribute.
Also, we need to mark the atribute as nullable as this reflects our current implementation.
We currently return null if the associated Window does not have a frame. This does not match
the specification and we should update our implementation in the future to never return null.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (216533 => 216534)


--- trunk/Source/WebCore/ChangeLog	2017-05-09 19:27:39 UTC (rev 216533)
+++ trunk/Source/WebCore/ChangeLog	2017-05-09 20:01:05 UTC (rev 216534)
@@ -1,3 +1,27 @@
+2017-05-09  Chris Dumez  <[email protected]>
+
+        Drop custom bindings code for Window.location setter
+        https://bugs.webkit.org/show_bug.cgi?id=171846
+
+        Reviewed by Sam Weinig.
+
+        Drop custom bindings code for Window.location setter as the custom code was merely needed
+        to address a very old Mac widget that has long been fixed (rdar://problem/5695330).
+
+        No new tests, no Web-facing behavior change.
+
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::setLocation): Deleted.
+        Drop custom code.
+
+        * page/DOMWindow.idl:
+        Align Window.location with https://html.spec.whatwg.org/#the-window-object:
+        - Mark property as readonly.
+        - Add [PutsForward=href] IDL extended attribute.
+        Also, we need to mark the atribute as nullable as this reflects our current implementation.
+        We currently return null if the associated Window does not have a frame. This does not match
+        the specification and we should update our implementation in the future to never return null.
+
 2017-05-09  Matt Lewis  <[email protected]>
 
         Unreviewed, rolling out r216508.

Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (216533 => 216534)


--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp	2017-05-09 19:27:39 UTC (rev 216533)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp	2017-05-09 20:01:05 UTC (rev 216534)
@@ -452,30 +452,6 @@
 
 // Custom Attributes
 
-void JSDOMWindow::setLocation(ExecState& state, JSValue value)
-{
-    VM& vm = state.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-#if ENABLE(DASHBOARD_SUPPORT)
-    // To avoid breaking old widgets, make "var location =" in a top-level frame create
-    // a property named "location" instead of performing a navigation (<rdar://problem/5688039>).
-    if (Frame* activeFrame = activeDOMWindow(&state).frame()) {
-        if (activeFrame->settings().usesDashboardBackwardCompatibilityMode() && !activeFrame->tree().parent()) {
-            if (BindingSecurity::shouldAllowAccessToDOMWindow(&state, wrapped()))
-                putDirect(state.vm(), Identifier::fromString(&state, "location"), value);
-            return;
-        }
-    }
-#endif
-
-    String locationString = value.toWTFString(&state);
-    RETURN_IF_EXCEPTION(scope, void());
-
-    if (Location* location = wrapped().location())
-        location->setHref(activeDOMWindow(&state), firstDOMWindow(&state), locationString);
-}
-
 JSValue JSDOMWindow::event(ExecState& state) const
 {
     Event* event = currentEvent();

Modified: trunk/Source/WebCore/page/DOMWindow.idl (216533 => 216534)


--- trunk/Source/WebCore/page/DOMWindow.idl	2017-05-09 19:27:39 UTC (rev 216533)
+++ trunk/Source/WebCore/page/DOMWindow.idl	2017-05-09 20:01:05 UTC (rev 216534)
@@ -53,7 +53,7 @@
     [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute DOMWindow self;
     [Unforgeable] readonly attribute Document document;
     attribute DOMString name;
-    [DoNotCheckSecurity, CustomSetter, Unforgeable] attribute Location location; // FIXME: Should be readonly and [PutForwards=href].
+    [DoNotCheckSecurity, PutForwards=href, Unforgeable] readonly attribute Location? location; // FIXME: Should not be nullable.
     readonly attribute History history;
     [EnabledAtRuntime=CustomElements, ImplementedAs=ensureCustomElementRegistry] readonly attribute CustomElementRegistry customElements;
     [Replaceable] readonly attribute BarProp locationbar;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to