Move Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 May 2019 22:08:00 +0000 (22:08 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 May 2019 22:08:00 +0000 (22:08 +0000)
commit0773c43a2cfef1c828989b33610553fddf02ac4f
tree611be7e6c579f25e2d29f01a0f895508f34ea9aa
parent13cceef55c2599318e4d83b7da13d3203642f925
Move Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
https://bugs.webkit.org/show_bug.cgi?id=181950
<rdar://problem/43357371>

Reviewed by Brent Fulgham.

Source/WebCore:

This patch moves Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
to be more aligned with the HTML standard:
https://html.spec.whatwg.org/multipage/origin.html#is-a-registrable-domain-suffix-of-or-is-equal-to.
Besides that, it also removes redundant codes within the original method that is also done in
OriginAccessEntry::matchesOrigin.

Covered by new API tests.

* dom/Document.cpp:
(WebCore::Document::setDomain):
(WebCore::Document::domainIsRegisterable const): Deleted.
* dom/Document.h:
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::isMatchingRegistrableDomainSuffix const):
* page/SecurityOrigin.h:

Tools:

* TestWebKitAPI/Tests/WebCore/SecurityOrigin.cpp:
(TestWebKitAPI::TEST_F):

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