Sandbox flags do not support document.domain control
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 23:27:08 +0000 (23:27 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 23:27:08 +0000 (23:27 +0000)
commitbbfc163027b124c7bffb5939e2ac9cd3449fa786
treed910afaafddbda4668d4950237228882314a7364
parent74e27e3d3a8518f9a1497d2b2ffee15ca8487d89
Sandbox flags do not support document.domain control
https://bugs.webkit.org/show_bug.cgi?id=175281
<rdar://problem/33778936>

Reviewed by Chris Dumez.

Source/WebCore:

Update the 'setDomain' logic to honor the sandbox properties as defined in the current
HTML5 specification. This brings us in line with how Chrome and other browsers have
worked for some time.

Test: fast/frames/sandboxed-iframe-domain.html

* dom/Document.cpp:
(WebCore::Document::setDomain): Add check for sandbox flag (with appropriate error message)
* dom/SecurityContext.h:

LayoutTests:

* fast/frames/resources/sandboxed-iframe-set-domain.html: Added.
* fast/frames/sandboxed-iframe-domain.html: Added.
* fast/frames/sandboxed-iframe-domain-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/frames/resources/sandboxed-iframe-set-domain.html [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-domain-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/sandboxed-iframe-domain.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/SecurityContext.h