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

Unified Diff: third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp

Issue 2352193004: Document* -> Document& for loadSubimages and friends. (Closed)
Patch Set: Added constness Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp b/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp
index bb0c878543887ac046b1a2e3ee0f4af84cfd1242..130a46def528043c76ba233e0758243061fb1d42 100644
--- a/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSCursorImageValue.cpp
@@ -36,7 +36,7 @@
namespace blink {
-static inline SVGCursorElement* resourceReferencedByCursorElement(const String& url, TreeScope& treeScope)
+static inline SVGCursorElement* resourceReferencedByCursorElement(const String& url, const TreeScope& treeScope)
{
Element* element = SVGURIReference::targetElementFromIRIString(url, treeScope);
return isSVGCursorElement(element) ? toSVGCursorElement(element) : nullptr;
@@ -97,7 +97,7 @@ StyleImage* CSSCursorImageValue::cachedImage(float deviceScaleFactor) const
return m_cachedImage.get();
}
-StyleImage* CSSCursorImageValue::cacheImage(Document* document, float deviceScaleFactor)
+StyleImage* CSSCursorImageValue::cacheImage(const Document& document, float deviceScaleFactor)
{
if (m_imageValue->isImageSetValue())
return toCSSImageSetValue(*m_imageValue).cacheImage(document, deviceScaleFactor);
@@ -108,11 +108,11 @@ StyleImage* CSSCursorImageValue::cacheImage(Document* document, float deviceScal
// For SVG images we need to lazily substitute in the correct URL. Rather than attempt
// to change the URL of the CSSImageValue (which would then change behavior like cssText),
// we create an alternate CSSImageValue to use.
- if (hasFragmentInURL() && document) {
+ if (hasFragmentInURL()) {
CSSImageValue* imageValue = toCSSImageValue(m_imageValue.get());
// FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827)
- if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(imageValue->url(), *document)) {
- CSSImageValue* svgImageValue = CSSImageValue::create(document->completeURL(cursorElement->href()->currentValue()->value()));
+ if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(imageValue->url(), document)) {
+ CSSImageValue* svgImageValue = CSSImageValue::create(document.completeURL(cursorElement->href()->currentValue()->value()));
svgImageValue->setReferrer(imageValue->referrer());
m_cachedImage = svgImageValue->cacheImage(document);
return m_cachedImage.get();
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSCursorImageValue.h ('k') | third_party/WebKit/Source/core/css/CSSGradientValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698