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

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

Issue 2561043002: Clean-up after Form Association Refactoring (Closed)
Patch Set: Removed constructorNeedsFormElement from scripts and HTMLTagNames Created 4 years 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, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights
5 * reserved. 5 * reserved.
6 * Copyright (C) 2010 Google Inc. All rights reserved. 6 * Copyright (C) 2010 Google Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 MediaQueryListListener::trace(visitor); 80 MediaQueryListListener::trace(visitor);
81 } 81 }
82 82
83 private: 83 private:
84 explicit ViewportChangeListener(HTMLImageElement* element) 84 explicit ViewportChangeListener(HTMLImageElement* element)
85 : m_element(element) {} 85 : m_element(element) {}
86 Member<HTMLImageElement> m_element; 86 Member<HTMLImageElement> m_element;
87 }; 87 };
88 88
89 HTMLImageElement::HTMLImageElement(Document& document, 89 HTMLImageElement::HTMLImageElement(Document& document,
90 HTMLFormElement* form,
91 bool createdByParser) 90 bool createdByParser)
92 : HTMLElement(imgTag, document), 91 : HTMLElement(imgTag, document),
93 ActiveScriptWrappable(this), 92 ActiveScriptWrappable(this),
94 m_imageLoader(HTMLImageLoader::create(this)), 93 m_imageLoader(HTMLImageLoader::create(this)),
95 m_imageDevicePixelRatio(1.0f), 94 m_imageDevicePixelRatio(1.0f),
96 m_source(nullptr), 95 m_source(nullptr),
97 m_layoutDisposition(LayoutDisposition::PrimaryContent), 96 m_layoutDisposition(LayoutDisposition::PrimaryContent),
98 m_formWasSetByParser(false), 97 m_formWasSetByParser(false),
99 m_elementCreatedByParser(createdByParser), 98 m_elementCreatedByParser(createdByParser),
100 m_isFallbackImage(false), 99 m_isFallbackImage(false),
101 m_referrerPolicy(ReferrerPolicyDefault) { 100 m_referrerPolicy(ReferrerPolicyDefault) {
102 setHasCustomStyleCallbacks(); 101 setHasCustomStyleCallbacks();
103 } 102 }
104 103
105 HTMLImageElement* HTMLImageElement::create(Document& document) { 104 HTMLImageElement* HTMLImageElement::create(Document& document) {
106 return new HTMLImageElement(document); 105 return new HTMLImageElement(document);
107 } 106 }
108 107
109 HTMLImageElement* HTMLImageElement::create(Document& document, 108 HTMLImageElement* HTMLImageElement::create(Document& document,
110 HTMLFormElement* form,
111 bool createdByParser) { 109 bool createdByParser) {
112 return new HTMLImageElement(document, form, createdByParser); 110 return new HTMLImageElement(document, createdByParser);
113 } 111 }
114 112
115 HTMLImageElement::~HTMLImageElement() {} 113 HTMLImageElement::~HTMLImageElement() {}
116 114
117 DEFINE_TRACE(HTMLImageElement) { 115 DEFINE_TRACE(HTMLImageElement) {
118 visitor->trace(m_imageLoader); 116 visitor->trace(m_imageLoader);
119 visitor->trace(m_listener); 117 visitor->trace(m_listener);
120 visitor->trace(m_form); 118 visitor->trace(m_form);
121 visitor->trace(m_source); 119 visitor->trace(m_source);
122 HTMLElement::trace(visitor); 120 HTMLElement::trace(visitor);
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 void HTMLImageElement::associateWith(HTMLFormElement* form) { 913 void HTMLImageElement::associateWith(HTMLFormElement* form) {
916 if (form && form->isConnected()) { 914 if (form && form->isConnected()) {
917 m_form = form; 915 m_form = form;
918 m_formWasSetByParser = true; 916 m_formWasSetByParser = true;
919 m_form->associate(*this); 917 m_form->associate(*this);
920 m_form->didAssociateByParser(); 918 m_form->didAssociateByParser();
921 } 919 }
922 }; 920 };
923 921
924 } // namespace blink 922 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLImageElement.h ('k') | third_party/WebKit/Source/core/html/HTMLImageElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698