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

Side by Side Diff: sky/engine/core/html/HTMLImageElement.cpp

Issue 723253004: Remove tons of OILPAN. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/html/HTMLImageElement.h ('k') | sky/engine/core/html/HTMLStyleElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 { 52 {
53 return adoptRef(new ViewportChangeListener(element)); 53 return adoptRef(new ViewportChangeListener(element));
54 } 54 }
55 55
56 virtual void notifyMediaQueryChanged() override 56 virtual void notifyMediaQueryChanged() override
57 { 57 {
58 if (m_element) 58 if (m_element)
59 m_element->notifyViewportChanged(); 59 m_element->notifyViewportChanged();
60 } 60 }
61 61
62 #if !ENABLE(OILPAN)
63 void clearElement() { m_element = nullptr; } 62 void clearElement() { m_element = nullptr; }
64 #endif 63
65 virtual void trace(Visitor* visitor) override
66 {
67 visitor->trace(m_element);
68 MediaQueryListListener::trace(visitor);
69 }
70 private: 64 private:
71 explicit ViewportChangeListener(HTMLImageElement* element) : m_element(eleme nt) { } 65 explicit ViewportChangeListener(HTMLImageElement* element) : m_element(eleme nt) { }
72 RawPtr<HTMLImageElement> m_element; 66 RawPtr<HTMLImageElement> m_element;
73 }; 67 };
74 68
75 HTMLImageElement::HTMLImageElement(Document& document, bool createdByParser) 69 HTMLImageElement::HTMLImageElement(Document& document, bool createdByParser)
76 : HTMLElement(HTMLNames::imgTag, document) 70 : HTMLElement(HTMLNames::imgTag, document)
77 , m_imageLoader(HTMLImageLoader::create(this)) 71 , m_imageLoader(HTMLImageLoader::create(this))
78 , m_imageDevicePixelRatio(1.0f) 72 , m_imageDevicePixelRatio(1.0f)
79 , m_elementCreatedByParser(createdByParser) 73 , m_elementCreatedByParser(createdByParser)
(...skipping 15 matching lines...) Expand all
95 HTMLImageElement::~HTMLImageElement() 89 HTMLImageElement::~HTMLImageElement()
96 { 90 {
97 #if !ENABLE(OILPAN) 91 #if !ENABLE(OILPAN)
98 if (m_listener) { 92 if (m_listener) {
99 document().mediaQueryMatcher().removeViewportListener(m_listener.get()); 93 document().mediaQueryMatcher().removeViewportListener(m_listener.get());
100 m_listener->clearElement(); 94 m_listener->clearElement();
101 } 95 }
102 #endif 96 #endif
103 } 97 }
104 98
105 void HTMLImageElement::trace(Visitor* visitor)
106 {
107 visitor->trace(m_imageLoader);
108 visitor->trace(m_listener);
109 HTMLElement::trace(visitor);
110 }
111
112 void HTMLImageElement::notifyViewportChanged() 99 void HTMLImageElement::notifyViewportChanged()
113 { 100 {
114 // Re-selecting the source URL in order to pick a more fitting resource 101 // Re-selecting the source URL in order to pick a more fitting resource
115 // And update the image's intrinsic dimensions when the viewport changes. 102 // And update the image's intrinsic dimensions when the viewport changes.
116 // Picking of a better fitting resource is UA dependant, not spec required. 103 // Picking of a better fitting resource is UA dependant, not spec required.
117 selectSourceURL(ImageLoader::UpdateSizeChanged); 104 selectSourceURL(ImageLoader::UpdateSizeChanged);
118 } 105 }
119 106
120 PassRefPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document& document, int width, int height) 107 PassRefPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document& document, int width, int height)
121 { 108 {
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 402 }
416 imageLoader().updateFromElement(behavior); 403 imageLoader().updateFromElement(behavior);
417 } 404 }
418 405
419 const KURL& HTMLImageElement::sourceURL() const 406 const KURL& HTMLImageElement::sourceURL() const
420 { 407 {
421 return cachedImage()->response().url(); 408 return cachedImage()->response().url();
422 } 409 }
423 410
424 } 411 }
OLDNEW
« no previous file with comments | « sky/engine/core/html/HTMLImageElement.h ('k') | sky/engine/core/html/HTMLStyleElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698