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

Unified Diff: Source/core/css/CSSCrossfadeValue.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/CSSCrossfadeValue.cpp
diff --git a/Source/core/css/CSSCrossfadeValue.cpp b/Source/core/css/CSSCrossfadeValue.cpp
index 43536472b972fa8c1adccba67c7ba68eaea491a5..efb0bdfeda806e609b636bfde3f1b2d685970382 100644
--- a/Source/core/css/CSSCrossfadeValue.cpp
+++ b/Source/core/css/CSSCrossfadeValue.cpp
@@ -117,10 +117,22 @@ String CSSCrossfadeValue::customCSSText() const
return result.toString();
}
+PassRefPtrWillBeRawPtr<CSSCrossfadeValue> CSSCrossfadeValue::valueWithAbsoluteURL()
+{
+ if (m_fromValue->isImageValue() && m_toValue->isImageValue()) {
Timothy Loh 2015/09/15 12:20:47 The logic here seems weird. What if only one side
nainar 2015/09/16 07:16:48 Fixed.
+ return CSSCrossfadeValue::create(toCSSImageValue(*m_fromValue).valueWithAbsoluteURL(), toCSSImageValue(*m_toValue).valueWithAbsoluteURL(), m_percentageValue);
+ }
+ return this;
+}
+
IntSize CSSCrossfadeValue::fixedSize(const LayoutObject* layoutObject)
{
- Image* fromImage = renderableImageForCSSValue(m_fromValue.get(), layoutObject);
- Image* toImage = renderableImageForCSSValue(m_toValue.get(), layoutObject);
+ float percentage = m_percentageValue->getFloatValue();
Timothy Loh 2015/09/15 12:20:47 ???
nainar 2015/09/16 07:16:48 Fixed.
+ float inversePercentage = 1 - percentage;
+
+ Document* document = &layoutObject->document();
+ ImageResource* cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), document);
+ ImageResource* cachedToImage = cachedImageForCSSValue(m_toValue.get(), document);
if (!fromImage || !toImage)
return IntSize();

Powered by Google App Engine
This is Rietveld 408576698