diff options
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Document.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 8397ef9e93..5ba5e43dfa 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -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. |