Document's fallback base URL should be deduced from its creator when URL is about:blank: - https://html.spec.whatwg.org/multipage/urls-and-fetching.html#fallback-base-url Chrome and Firefox match the specification here.
Created attachment 434592 [details] Patch
Created attachment 434634 [details] Patch
Created attachment 434648 [details] Patch
Comment on attachment 434648 [details] Patch r=me
Committed r280491 (240123@main): <https://commits.webkit.org/240123@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 434648 [details].
<rdar://problem/81340285>
Comment on attachment 434648 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=434648&action=review > Source/WebCore/dom/Document.cpp:3422 > + if (m_baseURL == aboutBlankURL()) { This is a case-sensitive check. Is that really what we want?
Comment on attachment 434648 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=434648&action=review >> Source/WebCore/dom/Document.cpp:3422 >> + if (m_baseURL == aboutBlankURL()) { > > This is a case-sensitive check. Is that really what we want? I can replace by m_baseURL.isAboutBlank() for clarity but it is also implemented like so: ``` bool URL::isAboutBlank() const { return protocolIsAbout() && path() == "blank"; } ``` Note that the path() string check is case-sensitive. My understanding is that the path ("blank") is case-sensitive. Note that here, I have just parsed m_baseURL, the URL parser lowercases the scheme/protocol so the protocol would be lower case no matter what here. Therefore, I think my check is identical to URL::isAboutBlank(). That said, I will switch to isAboutBlank() for clarity.
(In reply to Chris Dumez from comment #8) > Comment on attachment 434648 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=434648&action=review > > >> Source/WebCore/dom/Document.cpp:3422 > >> + if (m_baseURL == aboutBlankURL()) { > > > > This is a case-sensitive check. Is that really what we want? > > I can replace by m_baseURL.isAboutBlank() for clarity but it is also > implemented like so: > ``` > bool URL::isAboutBlank() const > { > return protocolIsAbout() && path() == "blank"; > } > ``` > > Note that the path() string check is case-sensitive. My understanding is > that the path ("blank") is case-sensitive. > > Note that here, I have just parsed m_baseURL, the URL parser lowercases the > scheme/protocol so the protocol would be lower case no matter what here. > Therefore, I think my check is identical to URL::isAboutBlank(). That said, > I will switch to isAboutBlank() for clarity. Switched to using URL::isAboutBlank() in <https://commits.webkit.org/r280498>.