Closed
Bug 1347706
Opened 7 years ago
Closed 7 years ago
WindowProxy and Location [[SetPrototypeOf]] should not throw when null is passed
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: d, Assigned: bzbarsky)
Details
Attachments
(1 file)
WindowProxy and Location are supposed to behave as immutable prototype objects, and not allow changing their prototype. This behavior is supposed to be uniform across same- and cross-origin WindowProxy and Location objects. - https://html.spec.whatwg.org/#windowproxy-setprototypeof - https://html.spec.whatwg.org/#location-setprototypeof The following web platform tests show that Firefox throws the wrong error in the cross-origin case: - WindowProxy - http://w3c-test.org/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin-domain.sub.html - http://w3c-test.org/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin.sub.html - http://w3c-test.org/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html - Location - http://w3c-test.org/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin-domain.sub.html - http://w3c-test.org/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin.sub.html - http://w3c-test.org/html/browsers/history/the-location-interface/location-prototype-setting-goes-cross-origin-domain.sub.html Firefox is doing fine though in general apart from the error types.
Comment 1•7 years ago
|
||
Boris is probably the best person to know what's up here.
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 2•7 years ago
|
||
A few things: 1) Some of the tests are wrong. Specifically, this: assert_throws(new TypeError, function() { target.__proto__ = newValue; }); is wrong. If "target" is a cross-origin object, this lands in https://html.spec.whatwg.org/multipage/browsers.html#windowproxy-set and thence in https://html.spec.whatwg.org/multipage/browsers.html#crossoriginset-(-o,-p,-v,-receiver-) which calls [[GetOwnProperty]] which throws a SecurityError DOMException in this case. We never get to [[SetPrototypeOf]] at all in this case. Domenic, do you mind fixing those tests? 2) The "setting to null" behavior of not throwing is a very recent spec change. I'm going to mutate this bug to cover that. 3) The rest was fixed a week ago in bug 1344443. ;)
Flags: needinfo?(bzbarsky) → needinfo?(d)
Summary: WindowProxy and Location SetPrototypeOf should throw a TypeError on changes → WindowProxy and Location [[SetPrototypeOf]] should not throw when null is passed
Assignee | ||
Comment 3•7 years ago
|
||
MozReview-Commit-ID: 42je5yfBRee
Attachment #8848238 -
Flags: review?(bobbyholley)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•7 years ago
|
||
Note that the wpt test at html/browsers/origin/cross-origin-objects/cross-origin-objects.html does the __proto__ thing right, by the way.
Updated•7 years ago
|
Attachment #8848238 -
Flags: review?(bobbyholley) → review+
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/38e85537c429 Update to spec change for [[SetPrototypeOf]] on cross-origin objects. It should return true if null is passed. r=bholley
Comment 6•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/38e85537c429
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Reporter | ||
Updated•7 years ago
|
Flags: needinfo?(d)
You need to log in
before you can comment on or make changes to this bug.
Description
•