This would align with Safari and the HTML Standard. See https://github.com/web-platform-tests/wpt/pull/11402 for tests. See https://github.com/whatwg/html/pull/3742 for a related change to the HTML Standard that makes the standard align more with Chrome.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5dd78c188ba259d86af6ee12bb26fca4156880ae commit 5dd78c188ba259d86af6ee12bb26fca4156880ae Author: Sunny <ratsunny@gmail.com> Date: Mon Jun 25 00:15:26 2018 Check browsing context before set document.domain According to spec[1], when document object doesn't have browsing context, it should throw a "SecurityError" DOMException. [1] https://html.spec.whatwg.org/multipage/origin.html#dom-document-domain BUG= 850432 Change-Id: Ibc12decadb2405bb5f3b190d60ad65e1ee21303b Reviewed-on: https://chromium-review.googlesource.com/1112937 Reviewed-by: Kent Tamura <tkent@chromium.org> Commit-Queue: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#569942} [delete] https://crrev.com/7ed4cd1f125806d9c01e877bca5645bd10275fb3/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter-expected.txt [delete] https://crrev.com/7ed4cd1f125806d9c01e877bca5645bd10275fb3/third_party/WebKit/LayoutTests/external/wpt/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain-expected.txt [modify] https://crrev.com/5dd78c188ba259d86af6ee12bb26fca4156880ae/third_party/blink/renderer/core/dom/document.cc
Comment 1 by tkent@chromium.org
, Jun 8 2018Status: Available (was: Unconfirmed)