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

Issue 239353007: Set proper referrer for css resource fetching (Closed)

Created:
6 years, 8 months ago by bashi
Modified:
6 years, 8 months ago
CC:
blink-reviews, ed+blinkwatch_opera.com, dglazkov+blink, apavlov+blink_chromium.org, darktears, rune+blink, rwlbuis, Kunihiko Sakamoto, Nate Chapin
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Set proper referrer for css resource fetching Fetching css resources are initiated as follows: - Create FetchRequest - Call ResourceFetcher::fetchXXX() git-grep shows me that CSSImageValue, CSSImageSetValue and CSSFontFaceSrcValue are all of the resource fetch initiators which live in css/. I think that setting referrer in these classes should cover all css resource fetching. Since resource fetching is delayed until the resource is actually needed, we need to hold the referrer somewhere. This CL modifies the css parser to set referrer to corresponding CSSValue (CSSImageValue and CSSFontFaceSrcValue) when it sees url(...). Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=172433

Patch Set 1 #

Total comments: 12

Patch Set 2 : follow comments, set referrer in more classes #

Patch Set 3 : add test #

Total comments: 6

Patch Set 4 : use outgoingReferrer(), add test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+268 lines, -12 lines) Patch
A LayoutTests/http/tests/css/css-resources-referrer.html View 1 2 1 chunk +48 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/css/css-resources-referrer-expected.html View 1 2 1 chunk +34 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/css/css-resources-referrer-srcdoc.html View 1 2 3 1 chunk +36 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/css/css-resources-referrer-srcdoc-expected.html View 1 2 3 1 chunk +23 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/css/resources/css-resources-referrer.css View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/css/resources/css-resources-referrer-import.css View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/css/resources/referrer-check.php View 1 2 3 1 chunk +52 lines, -0 lines 0 comments Download
M Source/core/css/CSSCursorImageValue.cpp View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/CSSFontFaceSrcValue.h View 1 2 chunks +2 lines, -0 lines 0 comments Download
M Source/core/css/CSSFontFaceSrcValue.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/css/CSSImageSetValue.h View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/CSSImageSetValue.cpp View 3 chunks +5 lines, -2 lines 0 comments Download
M Source/core/css/CSSImageValue.h View 1 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/css/CSSImageValue.cpp View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/parser/CSSPropertyParser.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/parser/CSSPropertyParser.cpp View 1 2 3 8 chunks +14 lines, -6 lines 0 comments Download
M Source/core/html/HTMLBodyElement.cpp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/HTMLTableElement.cpp View 1 2 3 1 chunk +5 lines, -2 lines 0 comments Download
M Source/core/html/HTMLTablePartElement.cpp View 1 2 3 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
bashi
Hi abarth@, Could you take a look? If this approach sounds reasonable, I'll add tests.
6 years, 8 months ago (2014-04-16 05:28:30 UTC) #1
abarth-chromium
This approach looks much better, thanks! I have a few detail-oriented questions. I'm kind of ...
6 years, 8 months ago (2014-04-17 17:44:58 UTC) #2
bashi
Thank you for review. Added a test, updated the description(remove WIP). Could you take another ...
6 years, 8 months ago (2014-04-18 10:16:59 UTC) #3
abarth-chromium
Please add tests to cover the srcdoc bug in this iteration of the CL. https://codereview.chromium.org/239353007/diff/60001/Source/core/html/HTMLBodyElement.cpp ...
6 years, 8 months ago (2014-04-18 16:36:49 UTC) #4
abarth-chromium
By the way, do other browsers have this behavior?
6 years, 8 months ago (2014-04-18 16:39:23 UTC) #5
bashi
Sorry for late response. Added a test for srcdoc. I'm not sure what the srcdoc ...
6 years, 8 months ago (2014-04-22 01:22:55 UTC) #6
abarth-chromium
lgtm
6 years, 8 months ago (2014-04-22 16:11:10 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bashi@chromium.org/239353007/80001
6 years, 8 months ago (2014-04-22 16:11:31 UTC) #8
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-22 16:44:00 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_rel
6 years, 8 months ago (2014-04-22 16:44:01 UTC) #10
eseidel
We do this so that servers can block certain referrers? Presumably we already send referrers ...
6 years, 8 months ago (2014-04-22 16:51:01 UTC) #11
abarth-chromium
On 2014/04/22 16:51:01, eseidel wrote: > We do this so that servers can block certain ...
6 years, 8 months ago (2014-04-22 23:30:06 UTC) #12
bashi
On 2014/04/22 16:51:01, eseidel wrote: > We do this so that servers can block certain ...
6 years, 8 months ago (2014-04-22 23:33:10 UTC) #13
bashi
On 2014/04/22 23:30:06, abarth wrote: > On 2014/04/22 16:51:01, eseidel wrote: > > We do ...
6 years, 8 months ago (2014-04-22 23:45:43 UTC) #14
bashi
The CQ bit was checked by bashi@chromium.org
6 years, 8 months ago (2014-04-23 23:26:00 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bashi@chromium.org/239353007/80001
6 years, 8 months ago (2014-04-23 23:26:20 UTC) #16
commit-bot: I haz the power
Change committed as 172433
6 years, 8 months ago (2014-04-24 00:09:23 UTC) #17
bashi
6 years, 6 months ago (2014-05-28 12:07:56 UTC) #18
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/304603006/ by bashi@chromium.org.

The reason for reverting is: Caused regression.

Powered by Google App Engine
This is Rietveld 408576698