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

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

Issue 2256533002: Remove MediaQueryList listener from removed HTMLSourceElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/HTMLSourceElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLSourceElement.cpp b/third_party/WebKit/Source/core/html/HTMLSourceElement.cpp
index 3029e047d4cd43371e70cddc64ab9c4da667a6cf..8fdc44aa70e2fdb5c20089e38097a46e142d2dee 100644
--- a/third_party/WebKit/Source/core/html/HTMLSourceElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLSourceElement.cpp
@@ -115,11 +115,20 @@ void HTMLSourceElement::removedFrom(ContainerNode* removalRoot)
parent = toElement(removalRoot);
if (isHTMLMediaElement(parent))
toHTMLMediaElement(parent)->sourceWasRemoved(this);
- if (isHTMLPictureElement(parent))
+ if (isHTMLPictureElement(parent)) {
+ if (m_mediaQueryList)
+ m_mediaQueryList->removeListener(m_listener);
toHTMLPictureElement(parent)->sourceOrMediaChanged();
+ }
HTMLElement::removedFrom(removalRoot);
}
+void HTMLSourceElement::notifyImgSiblingRemoved()
+{
+ if (m_mediaQueryList)
+ m_mediaQueryList->removeListener(m_listener);
+}
+
void HTMLSourceElement::setSrc(const String& url)
{
setAttribute(srcAttr, AtomicString(url));

Powered by Google App Engine
This is Rietveld 408576698