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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 1662423002: Make CanvasRenderingContext not inherit from ActiveDOMObject (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make the function pure virtual Created 4 years, 10 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/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index 63d691d071e28e0340a84d5aae3a19f0c0839ca3..f0c2f5bb0e85aca9b5f2d33dc1db886b48a4252b 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -937,6 +937,7 @@ void HTMLCanvasElement::didChangeVisibilityState(PageVisibilityState visibility)
{
if (!m_context)
return;
+
bool hidden = visibility != PageVisibilityStateVisible;
m_context->setIsHidden(hidden);
if (hidden) {
@@ -947,6 +948,12 @@ void HTMLCanvasElement::didChangeVisibilityState(PageVisibilityState visibility)
}
}
+void HTMLCanvasElement::willDetachDocument()
+{
+ if (m_context)
+ m_context->stop();
+}
+
void HTMLCanvasElement::styleDidChange(const ComputedStyle* oldStyle, const ComputedStyle& newStyle)
{
if (m_context)
@@ -956,8 +963,6 @@ void HTMLCanvasElement::styleDidChange(const ComputedStyle* oldStyle, const Comp
void HTMLCanvasElement::didMoveToNewDocument(Document& oldDocument)
{
setObservedDocument(document());
- if (m_context)
- m_context->didMoveToNewDocument(&document());
HTMLElement::didMoveToNewDocument(oldDocument);
}

Powered by Google App Engine
This is Rietveld 408576698