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

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: 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 2b554b54362aa1de55080ff79e61bf09aad4937e..6c9f82fde2758ae7531aa113206e37aabe3c3769 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