Commit 71f4e8a0 authored by Nate Chapin's avatar Nate Chapin Committed by Commit Bot

Don't try to parser referrer policy on a <meta> in a detached document

Bug: 1083743
Test: fast/frames/parse-referrer-policy-in-detached-frame.html
Change-Id: Iec4233be2c23b6012e438ac5ff64683d6f1a9058
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209234
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Nate Chapin <japhet@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770404}
parent 2d53ecee
......@@ -574,7 +574,8 @@ void HTMLMetaElement::ProcessContent() {
if (EqualIgnoringASCIICase(name_value, "viewport")) {
ProcessViewportContentAttribute(content_value,
ViewportDescription::kViewportMeta);
} else if (EqualIgnoringASCIICase(name_value, "referrer")) {
} else if (EqualIgnoringASCIICase(name_value, "referrer") &&
GetExecutionContext()) {
UseCounter::Count(&GetDocument(),
WebFeature::kHTMLMetaElementReferrerPolicy);
GetExecutionContext()->ParseAndSetReferrerPolicy(
......
<body>
<meta content=origin name=referrer>
<iframe id="i"></iframe>
<script>
if (window.testRunner)
testRunner.dumpAsText();
i.contentDocument.documentElement.appendChild(document.body);
document.documentElement.appendChild(document.createTextNode("PASS if no crash."));
</script>
</body>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment