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)

55 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: d, Assigned: bzbarsky)

Details

Attachments

(1 file)

Boris is probably the best person to know what's up here.
Flags: needinfo?(bzbarsky)
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: nobody → bzbarsky
Status: NEW → ASSIGNED
Note that the wpt test at html/browsers/origin/cross-origin-objects/cross-origin-objects.html does the __proto__ thing right, by the way.
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
https://hg.mozilla.org/mozilla-central/rev/38e85537c429
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Flags: needinfo?(d)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: