Source/WebCore:
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 02:28:25 +0000 (02:28 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 02:28:25 +0000 (02:28 +0000)
commited715aa7002a92fef37eee66dbfe870ece12f9c8
treedf629e51842c638a5d1f43d1d82a0e51469adb80
parent98666ef19052a38925d664ee2db1956541f1fc14
Source/WebCore:
Implement the HTML5 same-origin restriction specification
https://bugs.webkit.org/show_bug.cgi?id=175226
<rdar://problem/11079948>

Reviewed by Chris Dumez.

Follow the algorithms defined in the HTML5 specification for relaxing
the same-origin restriction. We were missing a few steps related to
checking for public suffix and presence of a browsing context.

Tested by new TestWebKitAPI tests.

* dom/Document.cpp:
(WebCore::Document::domainIsRegisterable): Added helper function.
(WebCore::Document::setDomain):

Tools:
Prevent domain from being set to a TLD
https://bugs.webkit.org/show_bug.cgi?id=175226
<rdar://problem/11079948>

Reviewed by Chris Dumez.

Extend the public suffix tests to include cases used by the
Public Domain 'Public Suffix List'.

* TestWebKitAPI/Tests/mac/PublicSuffix.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/mac/PublicSuffix.mm