New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 595099 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Implement HTMLLinkElement referrerpolicy attribute

Project Member Reported by est...@chromium.org, Mar 15 2016

Issue description

The referrer policy spec now defines a referrerpolicy attribute on the HTML link element (https://github.com/w3c/webappsec-referrer-policy/issues/15). We should implement it.
 
Cc: y...@yoav.ws
Yoav, is this something you might be interested in doing by any chance? I've had this on my to-do list for a while but haven't gotten to it yet.

Comment 2 by y...@yoav.ws, Oct 6 2016

Hmm, maybe? :) I'll see if I can fit that in

Comment 3 by y...@yoav.ws, Oct 7 2016

Would would it take to implement this? Is it anything more than reading the attribute at the various places a preload header can be defined and setting the right flag on the request?

Does referrer policy impact resource reuse in ResourceFetcher?

Comment 4 by est...@chromium.org, Oct 11 2016

Re #3: I think ideally it shouldn't just be <link rel="preload"> but also other fetches for external resources, namely <link rel="icon"> and <link rel="stylesheet">. But, yeah, it's basically a matter of setting the referrer policy on the request whenever an HTMLLinkElement creates a request.

One note is that HTMLPreloadScanner will have to pick up the referrer policy attribute when scanning link elements. I think that should just be a matter of setting |m_referrerPolicy| when parsing a referrerpolicy attribute on a link element, similar to what we already do for img elements: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp?sq=package:chromium&rcl=1476127171&l=328

> Does referrer policy impact resource reuse in ResourceFetcher?

Nope, don't think so. It should only affect outgoing HTTP requests.

Comment 5 by y...@yoav.ws, Oct 21 2016

Owner: y...@yoav.ws
Status: Started (was: Assigned)
Taking over ownership...
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 3 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/93f84740e06572bd05ca465067d7f98c24c4c514

commit 93f84740e06572bd05ca465067d7f98c24c4c514
Author: yoav <yoav@yoav.ws>
Date: Thu Nov 03 13:56:01 2016

Add ReferrerPolicy support to preload

This CL adds referrerpolicy attribute support to link rel preload.

Intent to implement and ship:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/LukPJ86fcs8/RX_dsbUiCAAJ

BUG=  595099 

Review-Url: https://codereview.chromium.org/2424943002
Cr-Commit-Position: refs/heads/master@{#429567}

[modify] https://crrev.com/93f84740e06572bd05ca465067d7f98c24c4c514/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
[modify] https://crrev.com/93f84740e06572bd05ca465067d7f98c24c4c514/third_party/WebKit/Source/core/html/HTMLLinkElement.h
[modify] https://crrev.com/93f84740e06572bd05ca465067d7f98c24c4c514/third_party/WebKit/Source/core/html/LinkStyle.cpp
[modify] https://crrev.com/93f84740e06572bd05ca465067d7f98c24c4c514/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
[modify] https://crrev.com/93f84740e06572bd05ca465067d7f98c24c4c514/third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerTest.cpp
[modify] https://crrev.com/93f84740e06572bd05ca465067d7f98c24c4c514/third_party/WebKit/Source/core/loader/LinkLoader.cpp
[modify] https://crrev.com/93f84740e06572bd05ca465067d7f98c24c4c514/third_party/WebKit/Source/core/loader/LinkLoader.h
[modify] https://crrev.com/93f84740e06572bd05ca465067d7f98c24c4c514/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp

Project Member

Comment 7 by bugdroid1@chromium.org, Nov 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/970f4a4b5393b71d1bb37bdba7f82c2e515c5c62

commit 970f4a4b5393b71d1bb37bdba7f82c2e515c5c62
Author: yoav <yoav@yoav.ws>
Date: Tue Nov 08 12:20:17 2016

Add referrerpolicy support to link prefetch

This CL adds referrerpolicy support to <link rel=prefetch>. It also
refactors and removes no-longer-relevant TODOs from related code.

Another functional change is making it so that dns-prefetch and
preconnect relations no longer work unless the node is added to the
document.

BUG= 595099 

Review-Url: https://codereview.chromium.org/2483713002
Cr-Commit-Position: refs/heads/master@{#430588}

[modify] https://crrev.com/970f4a4b5393b71d1bb37bdba7f82c2e515c5c62/third_party/WebKit/Source/core/loader/LinkLoader.cpp
[modify] https://crrev.com/970f4a4b5393b71d1bb37bdba7f82c2e515c5c62/third_party/WebKit/Source/core/loader/LinkLoader.h
[modify] https://crrev.com/970f4a4b5393b71d1bb37bdba7f82c2e515c5c62/third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp

Project Member

Comment 8 by bugdroid1@chromium.org, Jan 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/44793d655d87d2c0a5161b59adf3ead794b9663b

commit 44793d655d87d2c0a5161b59adf3ead794b9663b
Author: yoav <yoav@yoav.ws>
Date: Tue Jan 03 11:07:21 2017

Add referrerpolicy to style and import

This CL adds referrerpolicy attribute support to `<link rel=style>` and
`<link rel=import>`.

Intent to implement and ship:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/LukPJ86fcs8/RX_dsbUiCAAJ

BUG= 595099 

Review-Url: https://codereview.chromium.org/2495313002
Cr-Commit-Position: refs/heads/master@{#441108}

[add] https://crrev.com/44793d655d87d2c0a5161b59adf3ead794b9663b/third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-attribute-import-no-referrer-expected.txt
[add] https://crrev.com/44793d655d87d2c0a5161b59adf3ead794b9663b/third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-attribute-import-no-referrer.html
[add] https://crrev.com/44793d655d87d2c0a5161b59adf3ead794b9663b/third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-attribute-style-no-referrer-expected.html
[add] https://crrev.com/44793d655d87d2c0a5161b59adf3ead794b9663b/third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-attribute-style-no-referrer.html
[add] https://crrev.com/44793d655d87d2c0a5161b59adf3ead794b9663b/third_party/WebKit/LayoutTests/http/tests/security/resources/green-if-no-referrer-css.php
[add] https://crrev.com/44793d655d87d2c0a5161b59adf3ead794b9663b/third_party/WebKit/LayoutTests/http/tests/security/resources/pass-if-no-referrer.php
[modify] https://crrev.com/44793d655d87d2c0a5161b59adf3ead794b9663b/third_party/WebKit/Source/core/html/LinkResource.cpp

Comment 9 by y...@yoav.ws, Jan 3 2017

Status: Fixed (was: Started)
Project Member

Comment 10 by bugdroid1@chromium.org, Feb 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/447bc8081a162e572e0083d264cdbf1b0561b8bd

commit 447bc8081a162e572e0083d264cdbf1b0561b8bd
Author: jochen <jochen@chromium.org>
Date: Wed Feb 15 10:05:41 2017

Add missing IDL definition of referrerPolicy attribute to <link>

This will make
referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html
pass

R=yoav@yoav.ws
BUG= 595099 

Review-Url: https://codereview.chromium.org/2698433002
Cr-Commit-Position: refs/heads/master@{#450649}

[modify] https://crrev.com/447bc8081a162e572e0083d264cdbf1b0561b8bd/third_party/WebKit/LayoutTests/external/wpt/html/dom/reflection-metadata-expected.txt
[modify] https://crrev.com/447bc8081a162e572e0083d264cdbf1b0561b8bd/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/447bc8081a162e572e0083d264cdbf1b0561b8bd/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/447bc8081a162e572e0083d264cdbf1b0561b8bd/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt
[modify] https://crrev.com/447bc8081a162e572e0083d264cdbf1b0561b8bd/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt
[modify] https://crrev.com/447bc8081a162e572e0083d264cdbf1b0561b8bd/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/447bc8081a162e572e0083d264cdbf1b0561b8bd/third_party/WebKit/Source/core/html/HTMLLinkElement.idl

Sign in to add a comment