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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLInputElement.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 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
8 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 8 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
9 * Copyright (C) 2010 Google Inc. All rights reserved. 9 * Copyright (C) 2010 Google Inc. All rights reserved.
10 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. 10 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 void idTargetChanged() override; 89 void idTargetChanged() override;
90 90
91 private: 91 private:
92 ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement*); 92 ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement*);
93 93
94 Member<HTMLInputElement> m_element; 94 Member<HTMLInputElement> m_element;
95 }; 95 };
96 96
97 const int defaultSize = 20; 97 const int defaultSize = 20;
98 98
99 HTMLInputElement::HTMLInputElement(Document& document, 99 HTMLInputElement::HTMLInputElement(Document& document, bool createdByParser)
100 HTMLFormElement* form, 100 : TextControlElement(inputTag, document),
101 bool createdByParser)
102 : TextControlElement(inputTag, document, form),
103 m_size(defaultSize), 101 m_size(defaultSize),
104 m_hasDirtyValue(false), 102 m_hasDirtyValue(false),
105 m_isChecked(false), 103 m_isChecked(false),
106 m_dirtyCheckedness(false), 104 m_dirtyCheckedness(false),
107 m_isIndeterminate(false), 105 m_isIndeterminate(false),
108 m_isActivatedSubmit(false), 106 m_isActivatedSubmit(false),
109 m_autocomplete(Uninitialized), 107 m_autocomplete(Uninitialized),
110 m_hasNonEmptyList(false), 108 m_hasNonEmptyList(false),
111 m_stateRestored(false), 109 m_stateRestored(false),
112 m_parsingInProgress(createdByParser), 110 m_parsingInProgress(createdByParser),
113 m_valueAttributeWasUpdatedAfterParsing(false), 111 m_valueAttributeWasUpdatedAfterParsing(false),
114 m_canReceiveDroppedFiles(false), 112 m_canReceiveDroppedFiles(false),
115 m_shouldRevealPassword(false), 113 m_shouldRevealPassword(false),
116 m_needsToUpdateViewValue(true), 114 m_needsToUpdateViewValue(true),
117 m_isPlaceholderVisible(false), 115 m_isPlaceholderVisible(false),
118 // |m_inputType| is lazily created when constructed by the parser to avoid 116 // |m_inputType| is lazily created when constructed by the parser to avoid
119 // constructing unnecessarily a text inputType and its shadow subtree, 117 // constructing unnecessarily a text inputType and its shadow subtree,
120 // just to destroy them when the |type| attribute gets set by the parser 118 // just to destroy them when the |type| attribute gets set by the parser
121 // to something else than 'text'. 119 // to something else than 'text'.
122 m_inputType(createdByParser ? nullptr : InputType::createText(*this)), 120 m_inputType(createdByParser ? nullptr : InputType::createText(*this)),
123 m_inputTypeView(m_inputType ? m_inputType->createView() : nullptr) { 121 m_inputTypeView(m_inputType ? m_inputType->createView() : nullptr) {
124 setHasCustomStyleCallbacks(); 122 setHasCustomStyleCallbacks();
125 } 123 }
126 124
127 HTMLInputElement* HTMLInputElement::create(Document& document, 125 HTMLInputElement* HTMLInputElement::create(Document& document,
128 HTMLFormElement* form,
129 bool createdByParser) { 126 bool createdByParser) {
130 HTMLInputElement* inputElement = 127 HTMLInputElement* inputElement =
131 new HTMLInputElement(document, form, createdByParser); 128 new HTMLInputElement(document, createdByParser);
132 if (!createdByParser) 129 if (!createdByParser)
133 inputElement->ensureUserAgentShadowRoot(); 130 inputElement->ensureUserAgentShadowRoot();
134 return inputElement; 131 return inputElement;
135 } 132 }
136 133
137 DEFINE_TRACE(HTMLInputElement) { 134 DEFINE_TRACE(HTMLInputElement) {
138 visitor->trace(m_inputType); 135 visitor->trace(m_inputType);
139 visitor->trace(m_inputTypeView); 136 visitor->trace(m_inputTypeView);
140 visitor->trace(m_listAttributeTargetObserver); 137 visitor->trace(m_listAttributeTargetObserver);
141 visitor->trace(m_imageLoader); 138 visitor->trace(m_imageLoader);
(...skipping 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 1890
1894 bool HTMLInputElement::hasFallbackContent() const { 1891 bool HTMLInputElement::hasFallbackContent() const {
1895 return m_inputTypeView->hasFallbackContent(); 1892 return m_inputTypeView->hasFallbackContent();
1896 } 1893 }
1897 1894
1898 void HTMLInputElement::setFilesFromPaths(const Vector<String>& paths) { 1895 void HTMLInputElement::setFilesFromPaths(const Vector<String>& paths) {
1899 return m_inputType->setFilesFromPaths(paths); 1896 return m_inputType->setFilesFromPaths(paths);
1900 } 1897 }
1901 1898
1902 } // namespace blink 1899 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLInputElement.h ('k') | third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698