Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index 92f5c6dd47b0fc04183972ac590261bdfc925442..e1f3ac6afc5cbb9ea635a54ec0256a38963454ac 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -4711,21 +4711,19 @@ void Document::detachRange(Range* range) |
CanvasRenderingContext* Document::getCSSCanvasContext(const String& type, const String& name, int width, int height) |
{ |
- HTMLCanvasElement* element = getCSSCanvasElement(name); |
- if (!element) |
- return 0; |
- element->setSize(IntSize(width, height)); |
- return element->getContext(type); |
+ HTMLCanvasElement& element = getCSSCanvasElement(name); |
+ element.setSize(IntSize(width, height)); |
+ return element.getContext(type); |
} |
-HTMLCanvasElement* Document::getCSSCanvasElement(const String& name) |
+HTMLCanvasElement& Document::getCSSCanvasElement(const String& name) |
{ |
RefPtr<HTMLCanvasElement>& element = m_cssCanvasElements.add(name, nullptr).storedValue->value; |
if (!element) { |
element = HTMLCanvasElement::create(*this); |
element->setAccelerationDisabled(true); |
} |
- return element.get(); |
+ return *element; |
} |
void Document::initDNSPrefetch() |