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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLPictureElement.cpp

Issue 2256533002: Remove MediaQueryList listener from removed HTMLSourceElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 3 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/html/HTMLPictureElement.h" 5 #include "core/html/HTMLPictureElement.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/dom/ElementTraversal.h" 8 #include "core/dom/ElementTraversal.h"
9 #include "core/frame/UseCounter.h" 9 #include "core/frame/UseCounter.h"
10 #include "core/html/HTMLImageElement.h" 10 #include "core/html/HTMLImageElement.h"
11 #include "core/html/HTMLSourceElement.h"
11 #include "core/loader/ImageLoader.h" 12 #include "core/loader/ImageLoader.h"
12 13
13 namespace blink { 14 namespace blink {
14 15
15 using namespace HTMLNames; 16 using namespace HTMLNames;
16 17
17 inline HTMLPictureElement::HTMLPictureElement(Document& document) 18 inline HTMLPictureElement::HTMLPictureElement(Document& document)
18 : HTMLElement(pictureTag, document) 19 : HTMLElement(pictureTag, document)
19 { 20 {
20 } 21 }
21 22
22 DEFINE_NODE_FACTORY(HTMLPictureElement) 23 DEFINE_NODE_FACTORY(HTMLPictureElement)
23 24
24 void HTMLPictureElement::sourceOrMediaChanged() 25 void HTMLPictureElement::sourceOrMediaChanged()
25 { 26 {
26 for (HTMLImageElement* imageElement = Traversal<HTMLImageElement>::firstChil d(*this); imageElement; imageElement = Traversal<HTMLImageElement>::nextSibling( *imageElement)) { 27 for (HTMLImageElement* imageElement = Traversal<HTMLImageElement>::firstChil d(*this); imageElement; imageElement = Traversal<HTMLImageElement>::nextSibling( *imageElement)) {
27 imageElement->selectSourceURL(ImageLoader::UpdateNormal); 28 imageElement->selectSourceURL(ImageLoader::UpdateNormal);
28 } 29 }
29 } 30 }
30 31
32 void HTMLPictureElement::removeListenerFromSourceChildren()
33 {
34 for (HTMLSourceElement* sourceElement = Traversal<HTMLSourceElement>::firstC hild(*this); sourceElement; sourceElement = Traversal<HTMLSourceElement>::nextSi bling(*sourceElement)) {
35 sourceElement->removeMediaQueryListListener();
36 }
37 }
38
39 void HTMLPictureElement::addListenerToSourceChildren()
40 {
41 for (HTMLSourceElement* sourceElement = Traversal<HTMLSourceElement>::firstC hild(*this); sourceElement; sourceElement = Traversal<HTMLSourceElement>::nextSi bling(*sourceElement)) {
42 sourceElement->addMediaQueryListListener();
43 }
44 }
45
46
31 Node::InsertionNotificationRequest HTMLPictureElement::insertedInto(ContainerNod e* insertionPoint) 47 Node::InsertionNotificationRequest HTMLPictureElement::insertedInto(ContainerNod e* insertionPoint)
32 { 48 {
33 UseCounter::count(document(), UseCounter::Picture); 49 UseCounter::count(document(), UseCounter::Picture);
34 return HTMLElement::insertedInto(insertionPoint); 50 return HTMLElement::insertedInto(insertionPoint);
35 } 51 }
36 52
37 } // namespace blink 53 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLPictureElement.h ('k') | third_party/WebKit/Source/core/html/HTMLSourceElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698