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

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

Issue 2622993003: Compare relative url if absolute urls are empty for CSSImageValue (Closed)
Patch Set: modified tc Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/background-image-url-setproperty.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 bool CSSImageValue::hasFailedOrCanceledSubresources() const { 96 bool CSSImageValue::hasFailedOrCanceledSubresources() const {
97 if (!m_cachedImage) 97 if (!m_cachedImage)
98 return false; 98 return false;
99 if (ImageResourceContent* cachedResource = m_cachedImage->cachedImage()) 99 if (ImageResourceContent* cachedResource = m_cachedImage->cachedImage())
100 return cachedResource->loadFailedOrCanceled(); 100 return cachedResource->loadFailedOrCanceled();
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 if (m_absoluteURL.isEmpty() && other.m_absoluteURL.isEmpty())
106 return m_relativeURL == other.m_relativeURL;
105 return m_absoluteURL == other.m_absoluteURL; 107 return m_absoluteURL == other.m_absoluteURL;
106 } 108 }
107 109
108 String CSSImageValue::customCSSText() const { 110 String CSSImageValue::customCSSText() const {
109 return serializeURI(m_relativeURL); 111 return serializeURI(m_relativeURL);
110 } 112 }
111 113
112 bool CSSImageValue::knownToBeOpaque(const LayoutObject& layoutObject) const { 114 bool CSSImageValue::knownToBeOpaque(const LayoutObject& layoutObject) const {
113 return m_cachedImage ? m_cachedImage->knownToBeOpaque(layoutObject) : false; 115 return m_cachedImage ? m_cachedImage->knownToBeOpaque(layoutObject) : false;
114 } 116 }
115 117
116 DEFINE_TRACE_AFTER_DISPATCH(CSSImageValue) { 118 DEFINE_TRACE_AFTER_DISPATCH(CSSImageValue) {
117 visitor->trace(m_cachedImage); 119 visitor->trace(m_cachedImage);
118 CSSValue::traceAfterDispatch(visitor); 120 CSSValue::traceAfterDispatch(visitor);
119 } 121 }
120 122
121 void CSSImageValue::reResolveURL(const Document& document) const { 123 void CSSImageValue::reResolveURL(const Document& document) const {
122 KURL url = document.completeURL(m_relativeURL); 124 KURL url = document.completeURL(m_relativeURL);
123 AtomicString urlString(url.getString()); 125 AtomicString urlString(url.getString());
124 if (urlString == m_absoluteURL) 126 if (urlString == m_absoluteURL)
125 return; 127 return;
126 m_absoluteURL = urlString; 128 m_absoluteURL = urlString;
127 m_cachedImage.clear(); 129 m_cachedImage.clear();
128 } 130 }
129 131
130 } // namespace blink 132 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/background-image-url-setproperty.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698