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

Side by Side Diff: Source/core/css/CSSCursorImageValue.cpp

Issue 314893003: Set referrer for CSS resources (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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) 2006 Rob Buis <buis@kde.org> 2 * Copyright (C) 2006 Rob Buis <buis@kde.org>
3 * (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 * (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2008 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 m_accessedImage = true; 130 m_accessedImage = true;
131 131
132 // For SVG images we need to lazily substitute in the correct URL. Rathe r than attempt 132 // For SVG images we need to lazily substitute in the correct URL. Rathe r than attempt
133 // to change the URL of the CSSImageValue (which would then change behav ior like cssText), 133 // to change the URL of the CSSImageValue (which would then change behav ior like cssText),
134 // we create an alternate CSSImageValue to use. 134 // we create an alternate CSSImageValue to use.
135 if (isSVGCursor() && loader && loader->document()) { 135 if (isSVGCursor() && loader && loader->document()) {
136 RefPtrWillBeRawPtr<CSSImageValue> imageValue = toCSSImageValue(m_ima geValue.get()); 136 RefPtrWillBeRawPtr<CSSImageValue> imageValue = toCSSImageValue(m_ima geValue.get());
137 // FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827) 137 // FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827)
138 if (SVGCursorElement* cursorElement = resourceReferencedByCursorElem ent(imageValue->url(), *loader->document())) { 138 if (SVGCursorElement* cursorElement = resourceReferencedByCursorElem ent(imageValue->url(), *loader->document())) {
139 RefPtrWillBeRawPtr<CSSImageValue> svgImageValue = CSSImageValue: :create(loader->document()->completeURL(cursorElement->href()->currentValue()->v alue())); 139 RefPtrWillBeRawPtr<CSSImageValue> svgImageValue = CSSImageValue: :create(loader->document()->completeURL(cursorElement->href()->currentValue()->v alue()));
140 svgImageValue->setReferrer(imageValue->referrer());
140 StyleFetchedImage* cachedImage = svgImageValue->cachedImage(load er); 141 StyleFetchedImage* cachedImage = svgImageValue->cachedImage(load er);
141 m_image = cachedImage; 142 m_image = cachedImage;
142 return cachedImage; 143 return cachedImage;
143 } 144 }
144 } 145 }
145 146
146 if (m_imageValue->isImageValue()) 147 if (m_imageValue->isImageValue())
147 m_image = toCSSImageValue(m_imageValue.get())->cachedImage(loader); 148 m_image = toCSSImageValue(m_imageValue.get())->cachedImage(loader);
148 } 149 }
149 150
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 && compareCSSValuePtr(m_imageValue, other.m_imageValue); 201 && compareCSSValuePtr(m_imageValue, other.m_imageValue);
201 } 202 }
202 203
203 void CSSCursorImageValue::traceAfterDispatch(Visitor* visitor) 204 void CSSCursorImageValue::traceAfterDispatch(Visitor* visitor)
204 { 205 {
205 visitor->trace(m_imageValue); 206 visitor->trace(m_imageValue);
206 CSSValue::traceAfterDispatch(visitor); 207 CSSValue::traceAfterDispatch(visitor);
207 } 208 }
208 209
209 } // namespace WebCore 210 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698