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

Unified Diff: Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 1306283006: BackgroundImage incorrectly returns empty url() when created on-the-fly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Ensure getComputedStyle returns absolute URLs Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/Source/core/css/ComputedStyleCSSValueMapping.cpp b/Source/core/css/ComputedStyleCSSValueMapping.cpp
index 15e7959687276d50ab1a43e60c5bad9373b87a1a..0aba99eb62773bf6a005070bd5bce848d9c362fe 100644
--- a/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -322,7 +322,7 @@ static PassRefPtrWillBeRawPtr<CSSValue> valueForNinePieceImage(const NinePieceIm
// Image first.
RefPtrWillBeRawPtr<CSSValue> imageValue = nullptr;
if (image.image())
- imageValue = image.image()->cssValue();
+ imageValue = image.image()->computedCSSValue();
// Create the image slice.
RefPtrWillBeRawPtr<CSSBorderImageSliceValue> imageSlices = valueForNinePieceImageSlice(image);
@@ -424,7 +424,7 @@ static PassRefPtrWillBeRawPtr<CSSValueList> valuesForBackgroundShorthand(const C
ASSERT(value);
beforeSlash->append(value);
}
- beforeSlash->append(currLayer->image() ? currLayer->image()->cssValue() : cssValuePool().createIdentifierValue(CSSValueNone));
+ beforeSlash->append(currLayer->image() ? currLayer->image()->computedCSSValue() : cssValuePool().createIdentifierValue(CSSValueNone));
beforeSlash->append(valueForFillRepeat(currLayer->repeatX(), currLayer->repeatY()));
beforeSlash->append(cssValuePool().createValue(currLayer->attachment()));
beforeSlash->append(createPositionListForLayer(CSSPropertyBackgroundPosition, *currLayer, style));
@@ -991,7 +991,7 @@ static PassRefPtrWillBeRawPtr<CSSValue> valueForContentData(const ComputedStyle&
} else if (contentData->isImage()) {
const StyleImage* image = toImageContentData(contentData)->image();
ASSERT(image);
- list->append(image->cssValue());
+ list->append(image->computedCSSValue());
} else if (contentData->isText()) {
list->append(cssValuePool().createValue(toTextContentData(contentData)->text(), CSSPrimitiveValue::UnitType::String));
} else if (contentData->isQuote()) {
@@ -1035,7 +1035,7 @@ static PassRefPtrWillBeRawPtr<CSSValue> valueForShape(const ComputedStyle& style
return cssValuePool().createValue(shapeValue->cssBox());
if (shapeValue->type() == ShapeValue::Image) {
if (shapeValue->image())
- return shapeValue->image()->cssValue();
+ return shapeValue->image()->computedCSSValue();
return cssValuePool().createIdentifierValue(CSSValueNone);
}
@@ -1357,7 +1357,7 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImage ? &style.maskLayers() : &style.backgroundLayers();
for (; currLayer; currLayer = currLayer->next()) {
if (currLayer->image())
- list->append(currLayer->image()->cssValue());
+ list->append(currLayer->image()->computedCSSValue());
else
list->append(cssValuePool().createIdentifierValue(CSSValueNone));
}
@@ -1454,7 +1454,7 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
return zoomAdjustedPixelValue(style.verticalBorderSpacing(), style);
case CSSPropertyBorderImageSource:
if (style.borderImageSource())
- return style.borderImageSource()->cssValue();
+ return style.borderImageSource()->computedCSSValue();
return cssValuePool().createIdentifierValue(CSSValueNone);
case CSSPropertyBorderTopColor:
return allowVisitedStyle ? cssValuePool().createColorValue(style.visitedDependentColor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidColor(style, style.borderTopColor());
@@ -1553,7 +1553,7 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
list = CSSValueList::createCommaSeparated();
for (unsigned i = 0; i < cursors->size(); ++i) {
if (StyleImage* image = cursors->at(i).image())
- list->append(image->cssValue());
+ list->append(image->computedCSSValue());
}
}
RefPtrWillBeRawPtr<CSSValue> value = cssValuePool().createValue(style.cursor());
@@ -1738,7 +1738,7 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
return valueForLineHeight(style);
case CSSPropertyListStyleImage:
if (style.listStyleImage())
- return style.listStyleImage()->cssValue();
+ return style.listStyleImage()->computedCSSValue();
return cssValuePool().createIdentifierValue(CSSValueNone);
case CSSPropertyListStylePosition:
return cssValuePool().createValue(style.listStylePosition());
@@ -2185,7 +2185,7 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
return valueForNinePieceImageQuad(style.maskBoxImage().borderSlices(), style);
case CSSPropertyWebkitMaskBoxImageSource:
if (style.maskBoxImageSource())
- return style.maskBoxImageSource()->cssValue();
+ return style.maskBoxImageSource()->computedCSSValue();
return cssValuePool().createIdentifierValue(CSSValueNone);
case CSSPropertyWebkitFontSizeDelta:
// Not a real style property -- used by the editing engine -- so has no computed value.

Powered by Google App Engine
This is Rietveld 408576698