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

Unified Diff: Source/core/css/CSSImageValue.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/CSSImageValue.cpp
diff --git a/Source/core/css/CSSImageValue.cpp b/Source/core/css/CSSImageValue.cpp
index 8be299fbac042f8635fb779080bdf87b7027f4f8..7d369c276e3d8cded425470515018c1e9aec60c2 100644
--- a/Source/core/css/CSSImageValue.cpp
+++ b/Source/core/css/CSSImageValue.cpp
@@ -31,6 +31,7 @@
#include "core/style/StylePendingImage.h"
#include "platform/weborigin/KURL.h"
#include "platform/weborigin/SecurityPolicy.h"
+#include "wtf/text/StringBuilder.h"
Timothy Loh 2015/09/15 12:20:47 unneeded?
nainar 2015/09/16 07:16:49 Done.
namespace blink {
@@ -108,7 +109,11 @@ bool CSSImageValue::equals(const CSSImageValue& other) const
String CSSImageValue::customCSSText() const
{
- return "url(" + quoteCSSURLIfNeeded(m_absoluteURL) + ")";
+ // TODO (nainar): Currently the spec -> https://drafts.csswg.org/cssom/#serialize-a-string
+ // states that the serialized string in the URL should have quotation marks appended on
+ // both ends of the string. However, the layout tests currently do not expect that, hence
+ // we need another patch that fixes that. For now serializing without quotation marks
+ return "url(" + quoteCSSURLIfNeeded(serializeStringWithoutQuotations(m_relativeURL)) + ")";
}
bool CSSImageValue::knownToBeOpaque(const LayoutObject* layoutObject) const

Powered by Google App Engine
This is Rietveld 408576698