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

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

Issue 732163004: Teach HTMLImageElement that it doesn't need ::attach. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Swap logic. 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
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, 2008, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2008, 2010 Apple Inc. All rights reserved.
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 protected: 86 protected:
87 explicit HTMLImageElement(Document&, bool createdByParser = false); 87 explicit HTMLImageElement(Document&, bool createdByParser = false);
88 88
89 virtual void didMoveToNewDocument(Document& oldDocument) override; 89 virtual void didMoveToNewDocument(Document& oldDocument) override;
90 90
91 private: 91 private:
92 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide; 92 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide;
93 93
94 void selectSourceURL(ImageLoader::UpdateFromElementBehavior); 94 void selectSourceURL(ImageLoader::UpdateFromElementBehavior);
95 95
96 virtual void attach(const AttachContext& = AttachContext()) override;
97 virtual RenderObject* createRenderer(RenderStyle*) override; 96 virtual RenderObject* createRenderer(RenderStyle*) override;
98 97
99 virtual bool canStartSelection() const override; 98 virtual bool canStartSelection() const override;
100 99
101 virtual bool isURLAttribute(const Attribute&) const override; 100 virtual bool isURLAttribute(const Attribute&) const override;
102 101
103 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; 102 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override;
104 virtual void removedFrom(ContainerNode*) override; 103 virtual void removedFrom(ContainerNode*) override;
105 virtual Image* imageContents() override; 104 virtual Image* imageContents() override;
106 105
107 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); 106 void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&);
108 HTMLImageLoader& imageLoader() const { return *m_imageLoader; } 107 HTMLImageLoader& imageLoader() const { return *m_imageLoader; }
109 void notifyViewportChanged(); 108 void notifyViewportChanged();
110 void createMediaQueryListIfDoesNotExist(); 109 void createMediaQueryListIfDoesNotExist();
111 110
112 OwnPtr<HTMLImageLoader> m_imageLoader; 111 OwnPtr<HTMLImageLoader> m_imageLoader;
113 RefPtr<ViewportChangeListener> m_listener; 112 RefPtr<ViewportChangeListener> m_listener;
114 AtomicString m_bestFitImageURL; 113 AtomicString m_bestFitImageURL;
115 float m_imageDevicePixelRatio; 114 float m_imageDevicePixelRatio;
116 unsigned m_elementCreatedByParser : 1; 115 unsigned m_elementCreatedByParser : 1;
117 // Intrinsic sizing is viewport dependant if the 'w' descriptor was used for the picked resource. 116 // Intrinsic sizing is viewport dependant if the 'w' descriptor was used for the picked resource.
118 unsigned m_intrinsicSizingViewportDependant : 1; 117 unsigned m_intrinsicSizingViewportDependant : 1;
119 // Effective size is viewport dependant if the sizes attribute's effective s ize used v* length units. 118 // Effective size is viewport dependant if the sizes attribute's effective s ize used v* length units.
120 unsigned m_effectiveSizeViewportDependant : 1; 119 unsigned m_effectiveSizeViewportDependant : 1;
121 }; 120 };
122 121
123 } // namespace blink 122 } // namespace blink
124 123
125 #endif // HTMLImageElement_h 124 #endif // HTMLImageElement_h
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/html/HTMLImageElement.cpp » ('j') | sky/engine/core/rendering/RenderImage.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698