mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-09 04:37:52 +03:00
LibWeb: Initialize document referrer from Fetch Request if available
This commit is contained in:
parent
9683da4470
commit
77d947b8ad
Notes:
sideshowbarker
2024-07-17 06:49:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/77d947b8ad
@ -243,9 +243,16 @@ JS::NonnullGCPtr<Document> Document::create_and_initialize(Type type, String con
|
||||
|
||||
// 12. If navigationParams's request is non-null, then:
|
||||
if (navigation_params.request) {
|
||||
// FIXME: 1. Set document's referrer to the empty string.
|
||||
// FIXME: 2. Let referrer be navigationParams's request's referrer.
|
||||
// FIXME: 3. If referrer is a URL record, then set document's referrer to the serialization of referrer.
|
||||
// 1. Set document's referrer to the empty string.
|
||||
document->m_referrer = String::empty();
|
||||
|
||||
// 2. Let referrer be navigationParams's request's referrer.
|
||||
auto& referrer = navigation_params.request->referrer();
|
||||
|
||||
// 3. If referrer is a URL record, then set document's referrer to the serialization of referrer.
|
||||
if (referrer.has<AK::URL>()) {
|
||||
document->m_referrer = referrer.get<AK::URL>().serialize();
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: 13. Let historyHandling be navigationParams's history handling.
|
||||
|
Loading…
Reference in New Issue
Block a user