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

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

Issue 2625873010: Resolve CSS url(...) non-<image> values against the correct base (Closed)
Patch Set: Rebase 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) 2 * Copyright (C) 2011 Andreas Kling (kling@webkit.org)
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 if (getClassType() == ImageClass) 105 if (getClassType() == ImageClass)
106 return toCSSImageValue(this)->hasFailedOrCanceledSubresources(); 106 return toCSSImageValue(this)->hasFailedOrCanceledSubresources();
107 if (getClassType() == CrossfadeClass) 107 if (getClassType() == CrossfadeClass)
108 return toCSSCrossfadeValue(this)->hasFailedOrCanceledSubresources(); 108 return toCSSCrossfadeValue(this)->hasFailedOrCanceledSubresources();
109 if (getClassType() == ImageSetClass) 109 if (getClassType() == ImageSetClass)
110 return toCSSImageSetValue(this)->hasFailedOrCanceledSubresources(); 110 return toCSSImageSetValue(this)->hasFailedOrCanceledSubresources();
111 111
112 return false; 112 return false;
113 } 113 }
114 114
115 bool CSSValue::mayContainUrl() const {
116 if (isValueList())
117 return toCSSValueList(*this).mayContainUrl();
118 return isImageValue() || isURIValue();
119 }
120
121 void CSSValue::reResolveUrl(const Document& document) const {
122 // TODO(fs): Should handle all values that can contain URLs.
123 if (isImageValue()) {
124 toCSSImageValue(*this).reResolveURL(document);
125 return;
126 }
127 if (isURIValue()) {
128 toCSSURIValue(*this).reResolveUrl(document);
129 return;
130 }
131 if (isValueList()) {
132 toCSSValueList(*this).reResolveUrl(document);
133 return;
134 }
135 }
136
115 template <class ChildClassType> 137 template <class ChildClassType>
116 inline static bool compareCSSValues(const CSSValue& first, 138 inline static bool compareCSSValues(const CSSValue& first,
117 const CSSValue& second) { 139 const CSSValue& second) {
118 return static_cast<const ChildClassType&>(first).equals( 140 return static_cast<const ChildClassType&>(first).equals(
119 static_cast<const ChildClassType&>(second)); 141 static_cast<const ChildClassType&>(second));
120 } 142 }
121 143
122 bool CSSValue::equals(const CSSValue& other) const { 144 bool CSSValue::equals(const CSSValue& other) const {
123 if (m_classType == other.m_classType) { 145 if (m_classType == other.m_classType) {
124 switch (getClassType()) { 146 switch (getClassType()) {
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 toCSSCustomPropertyDeclaration(this)->traceAfterDispatch(visitor); 596 toCSSCustomPropertyDeclaration(this)->traceAfterDispatch(visitor);
575 return; 597 return;
576 case PendingSubstitutionValueClass: 598 case PendingSubstitutionValueClass:
577 toCSSPendingSubstitutionValue(this)->traceAfterDispatch(visitor); 599 toCSSPendingSubstitutionValue(this)->traceAfterDispatch(visitor);
578 return; 600 return;
579 } 601 }
580 ASSERT_NOT_REACHED(); 602 ASSERT_NOT_REACHED();
581 } 603 }
582 604
583 } // namespace blink 605 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValue.h ('k') | third_party/WebKit/Source/core/css/CSSValueList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698