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

Side by Side Diff: Source/core/html/forms/TextFieldInputType.cpp

Issue 1033943002: Rename LayoutStyle to papayawhip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ensureComputedStyle Created 5 years, 8 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 16 matching lines...) Expand all
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #include "config.h" 32 #include "config.h"
33 #include "core/html/forms/TextFieldInputType.h" 33 #include "core/html/forms/TextFieldInputType.h"
34 34
35 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 35 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
36 #include "core/HTMLNames.h" 36 #include "core/HTMLNames.h"
37 #include "core/dom/NodeLayoutStyle.h" 37 #include "core/dom/NodeComputedStyle.h"
38 #include "core/dom/shadow/ShadowRoot.h" 38 #include "core/dom/shadow/ShadowRoot.h"
39 #include "core/editing/FrameSelection.h" 39 #include "core/editing/FrameSelection.h"
40 #include "core/editing/iterators/TextIterator.h" 40 #include "core/editing/iterators/TextIterator.h"
41 #include "core/events/BeforeTextInsertedEvent.h" 41 #include "core/events/BeforeTextInsertedEvent.h"
42 #include "core/events/KeyboardEvent.h" 42 #include "core/events/KeyboardEvent.h"
43 #include "core/events/TextEvent.h" 43 #include "core/events/TextEvent.h"
44 #include "core/frame/FrameHost.h" 44 #include "core/frame/FrameHost.h"
45 #include "core/frame/LocalFrame.h" 45 #include "core/frame/LocalFrame.h"
46 #include "core/html/FormDataList.h" 46 #include "core/html/FormDataList.h"
47 #include "core/html/HTMLInputElement.h" 47 #include "core/html/HTMLInputElement.h"
(...skipping 10 matching lines...) Expand all
58 58
59 namespace blink { 59 namespace blink {
60 60
61 using namespace HTMLNames; 61 using namespace HTMLNames;
62 62
63 class DataListIndicatorElement final : public HTMLDivElement { 63 class DataListIndicatorElement final : public HTMLDivElement {
64 private: 64 private:
65 inline DataListIndicatorElement(Document& document) : HTMLDivElement(documen t) { } 65 inline DataListIndicatorElement(Document& document) : HTMLDivElement(documen t) { }
66 inline HTMLInputElement* hostInput() const { return toHTMLInputElement(shado wHost()); } 66 inline HTMLInputElement* hostInput() const { return toHTMLInputElement(shado wHost()); }
67 67
68 virtual LayoutObject* createLayoutObject(const LayoutStyle&) override 68 virtual LayoutObject* createLayoutObject(const ComputedStyle&) override
69 { 69 {
70 return new LayoutDetailsMarker(this); 70 return new LayoutDetailsMarker(this);
71 } 71 }
72 72
73 virtual void* preDispatchEventHandler(Event* event) override 73 virtual void* preDispatchEventHandler(Event* event) override
74 { 74 {
75 // Chromium opens autofill popup in a mousedown event listener 75 // Chromium opens autofill popup in a mousedown event listener
76 // associated to the document. We don't want to open it in this case 76 // associated to the document. We don't want to open it in this case
77 // because we opens a datalist chooser later. 77 // because we opens a datalist chooser later.
78 // FIXME: We should dispatch mousedown events even in such case. 78 // FIXME: We should dispatch mousedown events even in such case.
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 element().endEditing(); 261 element().endEditing();
262 if (SpinButtonElement *spinButton = spinButtonElement()) 262 if (SpinButtonElement *spinButton = spinButtonElement())
263 spinButton->releaseCapture(); 263 spinButton->releaseCapture();
264 } 264 }
265 265
266 bool TextFieldInputType::shouldSubmitImplicitly(Event* event) 266 bool TextFieldInputType::shouldSubmitImplicitly(Event* event)
267 { 267 {
268 return (event->type() == EventTypeNames::textInput && event->hasInterface(Ev entNames::TextEvent) && toTextEvent(event)->data() == "\n") || InputType::should SubmitImplicitly(event); 268 return (event->type() == EventTypeNames::textInput && event->hasInterface(Ev entNames::TextEvent) && toTextEvent(event)->data() == "\n") || InputType::should SubmitImplicitly(event);
269 } 269 }
270 270
271 LayoutObject* TextFieldInputType::createLayoutObject(const LayoutStyle&) const 271 LayoutObject* TextFieldInputType::createLayoutObject(const ComputedStyle&) const
272 { 272 {
273 return new LayoutTextControlSingleLine(&element()); 273 return new LayoutTextControlSingleLine(&element());
274 } 274 }
275 275
276 bool TextFieldInputType::shouldHaveSpinButton() const 276 bool TextFieldInputType::shouldHaveSpinButton() const
277 { 277 {
278 return LayoutTheme::theme().shouldHaveSpinButton(&element()); 278 return LayoutTheme::theme().shouldHaveSpinButton(&element());
279 } 279 }
280 280
281 void TextFieldInputType::createShadowSubtree() 281 void TextFieldInputType::createShadowSubtree()
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 return shouldSpinButtonRespondToMouseEvents() && element().focused(); 553 return shouldSpinButtonRespondToMouseEvents() && element().focused();
554 } 554 }
555 555
556 void TextFieldInputType::spinButtonDidReleaseMouseCapture(SpinButtonElement::Eve ntDispatch eventDispatch) 556 void TextFieldInputType::spinButtonDidReleaseMouseCapture(SpinButtonElement::Eve ntDispatch eventDispatch)
557 { 557 {
558 if (eventDispatch == SpinButtonElement::EventDispatchAllowed) 558 if (eventDispatch == SpinButtonElement::EventDispatchAllowed)
559 element().dispatchFormControlChangeEvent(); 559 element().dispatchFormControlChangeEvent();
560 } 560 }
561 561
562 } // namespace blink 562 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/forms/TextFieldInputType.h ('k') | Source/core/html/shadow/DateTimeEditElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698