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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 return InsertionDone; 108 return InsertionDone;
109 } 109 }
110 110
111 void HTMLSourceElement::removedFrom(ContainerNode* removalRoot) 111 void HTMLSourceElement::removedFrom(ContainerNode* removalRoot)
112 { 112 {
113 Element* parent = parentElement(); 113 Element* parent = parentElement();
114 if (!parent && removalRoot->isElementNode()) 114 if (!parent && removalRoot->isElementNode())
115 parent = toElement(removalRoot); 115 parent = toElement(removalRoot);
116 if (isHTMLMediaElement(parent)) 116 if (isHTMLMediaElement(parent))
117 toHTMLMediaElement(parent)->sourceWasRemoved(this); 117 toHTMLMediaElement(parent)->sourceWasRemoved(this);
118 if (isHTMLPictureElement(parent)) 118 if (isHTMLPictureElement(parent)) {
119 if (m_mediaQueryList)
120 m_mediaQueryList->removeListener(m_listener);
119 toHTMLPictureElement(parent)->sourceOrMediaChanged(); 121 toHTMLPictureElement(parent)->sourceOrMediaChanged();
122 }
120 HTMLElement::removedFrom(removalRoot); 123 HTMLElement::removedFrom(removalRoot);
121 } 124 }
122 125
126 void HTMLSourceElement::notifyImgSiblingRemoved()
127 {
128 if (m_mediaQueryList)
129 m_mediaQueryList->removeListener(m_listener);
130 }
131
123 void HTMLSourceElement::setSrc(const String& url) 132 void HTMLSourceElement::setSrc(const String& url)
124 { 133 {
125 setAttribute(srcAttr, AtomicString(url)); 134 setAttribute(srcAttr, AtomicString(url));
126 } 135 }
127 136
128 const AtomicString& HTMLSourceElement::type() const 137 const AtomicString& HTMLSourceElement::type() const
129 { 138 {
130 return getAttribute(typeAttr); 139 return getAttribute(typeAttr);
131 } 140 }
132 141
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 196 }
188 197
189 DEFINE_TRACE(HTMLSourceElement) 198 DEFINE_TRACE(HTMLSourceElement)
190 { 199 {
191 visitor->trace(m_mediaQueryList); 200 visitor->trace(m_mediaQueryList);
192 visitor->trace(m_listener); 201 visitor->trace(m_listener);
193 HTMLElement::trace(visitor); 202 HTMLElement::trace(visitor);
194 } 203 }
195 204
196 } // namespace blink 205 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698