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

Unified Diff: third_party/WebKit/Source/core/html/HTMLImageElement.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/HTMLImageElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
index 25baa498a4e77f62148abf6594c18cb95eb9871e..5adb52b9e27d3ad715450455ddeb87d6fb91cf44 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -399,8 +399,11 @@ void HTMLImageElement::removedFrom(ContainerNode* insertionPoint)
{
if (!m_form || NodeTraversal::highestAncestorOrSelf(*m_form.get()) != NodeTraversal::highestAncestorOrSelf(*this))
resetFormOwner();
- if (m_listener)
+ if (m_listener) {
document().mediaQueryMatcher().removeViewportListener(m_listener);
+ if (m_source)
+ m_source->notifyImgSiblingRemoved();
cbiesinger 2016/08/17 19:32:05 What about the <source> elements that were not cho
Yoav Weiss 2016/08/30 07:37:07 Good call. I'll add that.
+ }
HTMLElement::removedFrom(insertionPoint);
}

Powered by Google App Engine
This is Rietveld 408576698