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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSImageValue.cpp

Issue 1363233003: Make sure <url>s are being serialized according to spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix interpolation tests Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 return true; 101 return true;
102 } 102 }
103 103
104 bool CSSImageValue::equals(const CSSImageValue& other) const 104 bool CSSImageValue::equals(const CSSImageValue& other) const
105 { 105 {
106 return m_absoluteURL == other.m_absoluteURL; 106 return m_absoluteURL == other.m_absoluteURL;
107 } 107 }
108 108
109 String CSSImageValue::customCSSText() const 109 String CSSImageValue::customCSSText() const
110 { 110 {
111 // TODO(nainar): Serialise with quotation marks to match spec: https://draft s.csswg.org/cssom/#serialize-a-url 111 return serializeURI(m_relativeURL);
112 return "url(" + quoteCSSURLIfNeeded(serializeStringWithoutQuotations(m_relat iveURL)) + ")";
113 } 112 }
114 113
115 bool CSSImageValue::knownToBeOpaque(const LayoutObject* layoutObject) const 114 bool CSSImageValue::knownToBeOpaque(const LayoutObject* layoutObject) const
116 { 115 {
117 return m_image ? m_image->knownToBeOpaque(layoutObject) : false; 116 return m_image ? m_image->knownToBeOpaque(layoutObject) : false;
118 } 117 }
119 118
120 DEFINE_TRACE_AFTER_DISPATCH(CSSImageValue) 119 DEFINE_TRACE_AFTER_DISPATCH(CSSImageValue)
121 { 120 {
122 visitor->trace(m_image); 121 visitor->trace(m_image);
123 CSSValue::traceAfterDispatch(visitor); 122 CSSValue::traceAfterDispatch(visitor);
124 } 123 }
125 124
126 void CSSImageValue::reResolveURL(const Document& document) 125 void CSSImageValue::reResolveURL(const Document& document)
127 { 126 {
128 KURL url = document.completeURL(m_relativeURL); 127 KURL url = document.completeURL(m_relativeURL);
129 AtomicString urlString(url.string()); 128 AtomicString urlString(url.string());
130 if (urlString == m_absoluteURL) 129 if (urlString == m_absoluteURL)
131 return; 130 return;
132 m_absoluteURL = urlString; 131 m_absoluteURL = urlString;
133 m_accessedImage = false; 132 m_accessedImage = false;
134 m_image.clear(); 133 m_image.clear();
135 } 134 }
136 135
137 } // namespace blink 136 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698