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

Issue 1306283006: BackgroundImage incorrectly returns empty url() when created on-the-fly (Closed)

Created:
5 years, 3 months ago by nainar
Modified:
5 years, 3 months ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, dglazkov+blink, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

BackgroundImage incorrectly returns empty url() when created on-the-fly When you direcly create a <style> element and set it's backgroundImage via styleElement.textContent, accessing the image URL via styleElement.sheet.cssRules[0].style.backgroundImage results in empty URL. This is inconsistent with both FF and IE. This patch also ensures that getComputedStyle().backgroundImage returns the absolute URL while style.backgroundImage returns the relativeURL as is consistent with the spec stated here: https://drafts.csswg.org/css-backgrounds-3/#the-background-image. Please note that certain layout tests have been changed to increase readability and to make sure that they are consistent with FF. Also FF currently returns all URLs with quotes arounds them - that is consistent with spec. We currently don't do that. That will have to be a different patch. BUG=161644, 529640 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=202625

Patch Set 1 #

Total comments: 4

Patch Set 2 : Removed indentation issues and absoluteURL #

Patch Set 3 : Remove unnecessary if statement #

Patch Set 4 : Rebase tests #

Patch Set 5 : Rebase tests - make sure getComputedStyle returns absolute URL #

Patch Set 6 : Ensure getComputedStyle returns absolute URLs #

Patch Set 7 : Percentage default value #

Patch Set 8 : Ensure getComputedStyle returns absolute URLs #

Patch Set 9 : Ensure getComputedStyle returns absolute URLs #

Total comments: 28

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : Rebase #

Total comments: 22

Patch Set 13 : As per feedback #

Patch Set 14 : As per feedback #

Total comments: 8

Patch Set 15 : Test changes #

Patch Set 16 : Change StyleFetchedImage #

Total comments: 4

Patch Set 17 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+158 lines, -45 lines) Patch
M LayoutTests/fast/css/css-escaped-identifier.html View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
A LayoutTests/fast/css/css-imagevalue-url.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +20 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/getComputedStyle-relativeURL.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +14 lines, -0 lines 0 comments Download
M LayoutTests/fast/css/parse-border-image-repeat-null-crash-expected.txt View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/css/uri-token-parsing.html View 1 2 3 2 chunks +11 lines, -10 lines 0 comments Download
M LayoutTests/fast/css/uri-token-parsing-expected.txt View 1 2 3 4 chunks +18 lines, -18 lines 0 comments Download
M LayoutTests/fast/css/url-with-multi-byte-unicode-escape.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/css/url-with-multi-byte-unicode-escape-expected.txt View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/innerHTML/innerHTML-uri-resolution.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSCrossfadeValue.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/CSSCrossfadeValue.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/css/CSSImageGeneratorValue.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/CSSImageGeneratorValue.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +7 lines, -0 lines 0 comments Download
M Source/core/css/CSSImageSetValue.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/CSSImageSetValue.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +9 lines, -0 lines 0 comments Download
M Source/core/css/CSSImageValue.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/css/CSSImageValue.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/css/CSSMarkup.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSMarkup.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +17 lines, -0 lines 0 comments Download
M Source/core/css/ComputedStyleCSSValueMapping.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +9 lines, -9 lines 0 comments Download
M Source/core/style/StyleFetchedImage.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/style/StyleFetchedImage.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/style/StyleFetchedImageSet.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/style/StyleFetchedImageSet.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/style/StyleGeneratedImage.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/style/StyleGeneratedImage.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/style/StyleImage.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/style/StylePendingImage.h View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 36 (10 generated)
nainar
PTAL Thank you!
5 years, 3 months ago (2015-09-08 23:14:49 UTC) #2
rune
https://codereview.chromium.org/1306283006/diff/1/LayoutTests/fast/css/css-imagevalue-url.html File LayoutTests/fast/css/css-imagevalue-url.html (right): https://codereview.chromium.org/1306283006/diff/1/LayoutTests/fast/css/css-imagevalue-url.html#newcode34 LayoutTests/fast/css/css-imagevalue-url.html:34: test(function() { Indentation looks inconsistent. Sometimes 8, most of ...
5 years, 3 months ago (2015-09-08 23:57:28 UTC) #4
nainar
rune, Have made the changes, PTAL? Thanks! https://codereview.chromium.org/1306283006/diff/1/LayoutTests/fast/css/css-imagevalue-url.html File LayoutTests/fast/css/css-imagevalue-url.html (right): https://codereview.chromium.org/1306283006/diff/1/LayoutTests/fast/css/css-imagevalue-url.html#newcode34 LayoutTests/fast/css/css-imagevalue-url.html:34: test(function() { ...
5 years, 3 months ago (2015-09-09 00:30:30 UTC) #5
rune
On 2015/09/09 00:30:30, nainar92 wrote: > rune, > > Have made the changes, PTAL? We ...
5 years, 3 months ago (2015-09-09 07:24:21 UTC) #6
nainar
Could you provide me with a link to the spec? For my own perusal in ...
5 years, 3 months ago (2015-09-09 07:43:07 UTC) #7
rune
On 2015/09/09 07:43:07, nainar92 wrote: > Could you provide me with a link to the ...
5 years, 3 months ago (2015-09-09 07:54:42 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1306283006/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1306283006/120001
5 years, 3 months ago (2015-09-15 09:20:28 UTC) #10
commit-bot: I haz the power
Dry run: No L-G-T-M from a valid reviewer yet. Only full committers are accepted. Even ...
5 years, 3 months ago (2015-09-15 09:20:31 UTC) #12
nainar
Hi! I have managed to rebaseline the tests. Sorry it took so long. PTAL? JThanks!
5 years, 3 months ago (2015-09-15 09:45:22 UTC) #13
Timothy Loh
https://codereview.chromium.org/1306283006/diff/160001/LayoutTests/fast/css/all-inherit-or-unset-color.html File LayoutTests/fast/css/all-inherit-or-unset-color.html (left): https://codereview.chromium.org/1306283006/diff/160001/LayoutTests/fast/css/all-inherit-or-unset-color.html#oldcode1 LayoutTests/fast/css/all-inherit-or-unset-color.html:1: <!DOCTYPE html> Why is this file removed? https://codereview.chromium.org/1306283006/diff/160001/LayoutTests/fast/css/css-escaped-identifier.html File ...
5 years, 3 months ago (2015-09-15 12:20:48 UTC) #14
nainar
Tim, PTAL? Thanks! https://codereview.chromium.org/1306283006/diff/160001/LayoutTests/fast/css/all-inherit-or-unset-color.html File LayoutTests/fast/css/all-inherit-or-unset-color.html (left): https://codereview.chromium.org/1306283006/diff/160001/LayoutTests/fast/css/all-inherit-or-unset-color.html#oldcode1 LayoutTests/fast/css/all-inherit-or-unset-color.html:1: <!DOCTYPE html> Fixed. https://codereview.chromium.org/1306283006/diff/160001/LayoutTests/fast/css/css-escaped-identifier.html File LayoutTests/fast/css/css-escaped-identifier.html ...
5 years, 3 months ago (2015-09-16 07:16:49 UTC) #15
nainar
Have rebased, PTAL?
5 years, 3 months ago (2015-09-16 08:34:21 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1306283006/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1306283006/220001
5 years, 3 months ago (2015-09-16 12:26:24 UTC) #18
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. Only full committers are accepted. Even if an ...
5 years, 3 months ago (2015-09-16 12:26:27 UTC) #20
alancutter (OOO until 2018)
https://codereview.chromium.org/1306283006/diff/220001/LayoutTests/fast/css/css-imagevalue-url.html File LayoutTests/fast/css/css-imagevalue-url.html (right): https://codereview.chromium.org/1306283006/diff/220001/LayoutTests/fast/css/css-imagevalue-url.html#newcode13 LayoutTests/fast/css/css-imagevalue-url.html:13: var rulesForCssText = function (styleContent) { No space after ...
5 years, 3 months ago (2015-09-18 02:55:09 UTC) #23
alancutter (OOO until 2018)
5 years, 3 months ago (2015-09-18 02:55:11 UTC) #24
nainar
PTAL? https://codereview.chromium.org/1306283006/diff/220001/LayoutTests/fast/css/css-imagevalue-url.html File LayoutTests/fast/css/css-imagevalue-url.html (right): https://codereview.chromium.org/1306283006/diff/220001/LayoutTests/fast/css/css-imagevalue-url.html#newcode13 LayoutTests/fast/css/css-imagevalue-url.html:13: var rulesForCssText = function (styleContent) { Done. https://codereview.chromium.org/1306283006/diff/220001/LayoutTests/fast/css/css-imagevalue-url.html#newcode15 ...
5 years, 3 months ago (2015-09-18 03:47:25 UTC) #25
alancutter (OOO until 2018)
https://codereview.chromium.org/1306283006/diff/260001/LayoutTests/fast/css/css-imagevalue-url.html File LayoutTests/fast/css/css-imagevalue-url.html (right): https://codereview.chromium.org/1306283006/diff/260001/LayoutTests/fast/css/css-imagevalue-url.html#newcode6 LayoutTests/fast/css/css-imagevalue-url.html:6: addEventListener("load", function() { Is it necessary to wait for ...
5 years, 3 months ago (2015-09-21 00:57:47 UTC) #26
nainar
Alan, PTAL? https://codereview.chromium.org/1306283006/diff/260001/LayoutTests/fast/css/css-imagevalue-url.html File LayoutTests/fast/css/css-imagevalue-url.html (right): https://codereview.chromium.org/1306283006/diff/260001/LayoutTests/fast/css/css-imagevalue-url.html#newcode6 LayoutTests/fast/css/css-imagevalue-url.html:6: addEventListener("load", function() { Done. https://codereview.chromium.org/1306283006/diff/260001/LayoutTests/fast/css/css-imagevalue-url.html#newcode19 LayoutTests/fast/css/css-imagevalue-url.html:19: }); ...
5 years, 3 months ago (2015-09-21 01:27:36 UTC) #27
alancutter (OOO until 2018)
lgtm
5 years, 3 months ago (2015-09-21 01:39:19 UTC) #28
nainar
Tim, PTAL? Thanks!
5 years, 3 months ago (2015-09-22 05:41:25 UTC) #29
Timothy Loh
lgtm as long as we fix up url serialization soonish https://codereview.chromium.org/1306283006/diff/300001/Source/core/css/CSSCrossfadeValue.h File Source/core/css/CSSCrossfadeValue.h (right): https://codereview.chromium.org/1306283006/diff/300001/Source/core/css/CSSCrossfadeValue.h#newcode67 ...
5 years, 3 months ago (2015-09-22 05:53:27 UTC) #30
nainar
Rune, PTAL? Thanks! https://codereview.chromium.org/1306283006/diff/300001/Source/core/css/CSSCrossfadeValue.h File Source/core/css/CSSCrossfadeValue.h (right): https://codereview.chromium.org/1306283006/diff/300001/Source/core/css/CSSCrossfadeValue.h#newcode67 Source/core/css/CSSCrossfadeValue.h:67: PassRefPtrWillBeRawPtr<CSSCrossfadeValue> valueWithURLMadeAbsolute(); Done. https://codereview.chromium.org/1306283006/diff/300001/Source/core/css/CSSImageValue.cpp File Source/core/css/CSSImageValue.cpp ...
5 years, 3 months ago (2015-09-22 06:14:16 UTC) #31
rune
On 2015/09/22 06:14:16, nainar wrote: > Rune, > > PTAL? You already got two l*tms. ...
5 years, 3 months ago (2015-09-22 07:43:16 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1306283006/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1306283006/320001
5 years, 3 months ago (2015-09-22 07:49:19 UTC) #35
commit-bot: I haz the power
5 years, 3 months ago (2015-09-22 08:49:28 UTC) #36
Message was sent while issue was closed.
Committed patchset #17 (id:320001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=202625

Powered by Google App Engine
This is Rietveld 408576698