RESOLVED DUPLICATE of bug 260938 211607
[Quirks] Add a helper function to match top level domains.
https://bugs.webkit.org/show_bug.cgi?id=211607
Summary [Quirks] Add a helper function to match top level domains.
zalan
Reported 2020-05-07 19:29:17 PDT
auto host = m_document->topDocument().url().host(); return equalLettersIgnoringASCIICase(host, "netflix.com") || host.endsWithIgnoringASCIICase(".netflix.com"); is a common pattern we have in Quirks class.
Attachments
Patch (8.09 KB, patch)
2020-05-07 19:33 PDT, zalan
no flags
zalan
Comment 1 2020-05-07 19:33:50 PDT
zalan
Comment 2 2020-05-07 19:35:46 PDT
In some cases m_document->url() is used instead of m_document->topDocument().url(). Some investigation is needed whether they are intentional.
Simon Fraser (smfr)
Comment 3 2020-05-07 20:22:35 PDT
Comment on attachment 398828 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=398828&action=review > Source/WebCore/page/Quirks.cpp:74 > +bool Quirks::matchesTopLevelDomain(StringView hostNameToMatch) const I think this name needs to make it clear that it looks at topDocument. > Source/WebCore/page/Quirks.cpp:-807 > - auto host = m_document->url().host(); This was not topDocument. Bug?
zalan
Comment 4 2020-05-07 20:24:16 PDT
(In reply to Simon Fraser (smfr) from comment #3) > Comment on attachment 398828 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=398828&action=review > > > Source/WebCore/page/Quirks.cpp:74 > > +bool Quirks::matchesTopLevelDomain(StringView hostNameToMatch) const > > I think this name needs to make it clear that it looks at topDocument. Any suggestions? > > > Source/WebCore/page/Quirks.cpp:-807 > > - auto host = m_document->url().host(); > > This was not topDocument. Bug? Yes.
Darin Adler
Comment 5 2020-05-08 14:40:17 PDT
Comment on attachment 398828 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=398828&action=review >>> Source/WebCore/page/Quirks.cpp:74 >>> +bool Quirks::matchesTopLevelDomain(StringView hostNameToMatch) const >> >> I think this name needs to make it clear that it looks at topDocument. > > Any suggestions? topDocumentMatchesTopLevelDomain
Karl Dubost
Comment 6 2023-11-23 14:39:59 PST
it has been done in https://github.com/WebKit/WebKit/pull/17329 with Bug 260938 *** This bug has been marked as a duplicate of bug 260938 ***
Note You need to log in before you can comment on or make changes to this bug.