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

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

Issue 239353007: Set proper referrer for css resource fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add test Created 6 years, 8 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 m_accessedImage = true; 125 m_accessedImage = true;
126 126
127 // For SVG images we need to lazily substitute in the correct URL. Rathe r than attempt 127 // For SVG images we need to lazily substitute in the correct URL. Rathe r than attempt
128 // to change the URL of the CSSImageValue (which would then change behav ior like cssText), 128 // to change the URL of the CSSImageValue (which would then change behav ior like cssText),
129 // we create an alternate CSSImageValue to use. 129 // we create an alternate CSSImageValue to use.
130 if (isSVGCursor() && loader && loader->document()) { 130 if (isSVGCursor() && loader && loader->document()) {
131 RefPtrWillBeRawPtr<CSSImageValue> imageValue = toCSSImageValue(m_ima geValue.get()); 131 RefPtrWillBeRawPtr<CSSImageValue> imageValue = toCSSImageValue(m_ima geValue.get());
132 // FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827) 132 // FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827)
133 if (SVGCursorElement* cursorElement = resourceReferencedByCursorElem ent(imageValue->url(), *loader->document())) { 133 if (SVGCursorElement* cursorElement = resourceReferencedByCursorElem ent(imageValue->url(), *loader->document())) {
134 RefPtrWillBeRawPtr<CSSImageValue> svgImageValue = CSSImageValue: :create(loader->document()->completeURL(cursorElement->href()->currentValue()->v alue())); 134 RefPtrWillBeRawPtr<CSSImageValue> svgImageValue = CSSImageValue: :create(loader->document()->completeURL(cursorElement->href()->currentValue()->v alue()));
135 svgImageValue->setReferrer(imageValue->referrer());
135 StyleFetchedImage* cachedImage = svgImageValue->cachedImage(load er); 136 StyleFetchedImage* cachedImage = svgImageValue->cachedImage(load er);
136 m_image = cachedImage; 137 m_image = cachedImage;
137 return cachedImage; 138 return cachedImage;
138 } 139 }
139 } 140 }
140 141
141 if (m_imageValue->isImageValue()) 142 if (m_imageValue->isImageValue())
142 m_image = toCSSImageValue(m_imageValue.get())->cachedImage(loader); 143 m_image = toCSSImageValue(m_imageValue.get())->cachedImage(loader);
143 } 144 }
144 145
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 return m_hasHotSpot ? other.m_hasHotSpot && m_hotSpot == other.m_hotSpot : ! other.m_hasHotSpot 193 return m_hasHotSpot ? other.m_hasHotSpot && m_hotSpot == other.m_hotSpot : ! other.m_hasHotSpot
193 && compareCSSValuePtr(m_imageValue, other.m_imageValue); 194 && compareCSSValuePtr(m_imageValue, other.m_imageValue);
194 } 195 }
195 196
196 void CSSCursorImageValue::traceAfterDispatch(Visitor* visitor) 197 void CSSCursorImageValue::traceAfterDispatch(Visitor* visitor)
197 { 198 {
198 CSSValue::traceAfterDispatch(visitor); 199 CSSValue::traceAfterDispatch(visitor);
199 } 200 }
200 201
201 } // namespace WebCore 202 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698