Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Issue 1148603002: Anchor element's referrer attribute implementation for Referrer Policy

Created:
5 years, 7 months ago by burnik
Modified:
5 years, 7 months ago
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Anchor element's referrer attribute implementation for Referrer Policy. Support for the HTML referrer attribute on elements: <a>, <area>, <img>, <iframe> (and possibly others) allowing authors to set a Referrer-Policy for a single request associated with the HTML element referencing a sub-resource. More details are disclosed in the spec. Design doc: https://goo.gl/aMFGRY Spec: https://goo.gl/tkLkxN BUG=490608

Patch Set 1 : Fails for right-click opening (new window/tab, etc.) #

Total comments: 17

Patch Set 2 : First round nits. #

Patch Set 3 : Bugfix: When setting referrer policy for a request, prefer the document's policy if the request's p… #

Patch Set 4 : Remove debug logging. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+153 lines, -44 lines) Patch
M Source/core/dom/Document.cpp View 1 2 1 chunk +3 lines, -10 lines 0 comments Download
M Source/core/html/HTMLAnchorElement.cpp View 1 2 2 chunks +17 lines, -2 lines 0 comments Download
M Source/core/html/HTMLAnchorElement.idl View 1 2 1 chunk +1 line, -0 lines 2 comments Download
M Source/core/html/HTMLAttributeNames.in View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/loader/EmptyClients.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/loader/FrameLoadRequest.h View 1 7 chunks +8 lines, -8 lines 0 comments Download
M Source/core/loader/FrameLoader.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/loader/FrameLoader.cpp View 1 2 3 3 chunks +14 lines, -5 lines 0 comments Download
M Source/core/loader/FrameLoaderTypes.h View 1 2 1 chunk +0 lines, -5 lines 0 comments Download
M Source/core/page/ChromeClient.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/CreateWindow.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/CreateWindow.cpp View 1 2 5 chunks +8 lines, -6 lines 0 comments Download
M Source/platform/blink_platform.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/weborigin/ReferrerPolicy.h View 1 2 2 chunks +7 lines, -1 line 0 comments Download
A Source/platform/weborigin/ReferrerPolicy.cpp View 1 2 1 chunk +82 lines, -0 lines 2 comments Download
M Source/web/ChromeClientImpl.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/web/ChromeClientImpl.cpp View 1 2 2 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 7 (1 generated)
Mike West
This is a good start. I've added some comments. Adding Jochen as well, as he's ...
5 years, 7 months ago (2015-05-20 07:56:42 UTC) #2
burnik
Some nits fixed. Open discussion. https://codereview.chromium.org/1148603002/diff/1/Source/core/html/HTMLAnchorElement.cpp File Source/core/html/HTMLAnchorElement.cpp (left): https://codereview.chromium.org/1148603002/diff/1/Source/core/html/HTMLAnchorElement.cpp#oldcode362 Source/core/html/HTMLAnchorElement.cpp:362: frameRequest.setShouldSendReferrer(NeverSendReferrer); On 2015/05/20 07:56:41, ...
5 years, 7 months ago (2015-05-20 08:27:56 UTC) #3
burnik
One major bug fixed. A bit of clean up and refactoring. I now also have ...
5 years, 7 months ago (2015-05-20 13:45:18 UTC) #4
jochen (gone - plz use gerrit)
what about layout tests? https://codereview.chromium.org/1148603002/diff/60001/Source/core/html/HTMLAnchorElement.idl File Source/core/html/HTMLAnchorElement.idl (right): https://codereview.chromium.org/1148603002/diff/60001/Source/core/html/HTMLAnchorElement.idl#newcode29 Source/core/html/HTMLAnchorElement.idl:29: [Reflect] attribute DOMString referrer; this ...
5 years, 7 months ago (2015-05-21 07:48:58 UTC) #5
burnik
jochen@: Thanks for the notes. I left some questions for you and mkwst@. I'll be ...
5 years, 7 months ago (2015-05-21 10:44:37 UTC) #6
Mike West
5 years, 7 months ago (2015-05-21 11:10:27 UTC) #7
On 2015/05/21 at 10:44:37, burnik wrote:
> @mkwst: Is this a good approach for this feature?

It is! It would be worth sending an "Intent to Implement" as well to blink-dev@,
and adding the attribute to chromestatus.com.

>
https://codereview.chromium.org/1148603002/diff/60001/Source/platform/weborig...
> File Source/platform/weborigin/ReferrerPolicy.cpp (right):
> 
>
https://codereview.chromium.org/1148603002/diff/60001/Source/platform/weborig...
> Source/platform/weborigin/ReferrerPolicy.cpp:64: case ReferrerPolicyDefault:
> On 2015/05/21 07:48:58, jochen wrote:
> > what is no-meta?
> 
> This is copied from a test. See above. Mike added this, I suppose for testing
purposes only. If I'm not mistaken there should be a fall-through here, right?

If we're going to expose this to the web, we certainly shouldn't use "no-meta".
Are we exposing it to the web anywhere? Looking at the diff, I don't actually
see where this method is used at all. Do we need it?

Powered by Google App Engine
This is Rietveld 408576698