OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google 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 | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // The owner of SpinButtonElement must call removeSpinButtonOwner | 59 // The owner of SpinButtonElement must call removeSpinButtonOwner |
60 // because SpinButtonElement can be outlive SpinButtonOwner | 60 // because SpinButtonElement can be outlive SpinButtonOwner |
61 // implementation, e.g. during event handling. | 61 // implementation, e.g. during event handling. |
62 static PassRefPtrWillBeRawPtr<SpinButtonElement> create(Document&, SpinButto
nOwner&); | 62 static PassRefPtrWillBeRawPtr<SpinButtonElement> create(Document&, SpinButto
nOwner&); |
63 UpDownState upDownState() const { return m_upDownState; } | 63 UpDownState upDownState() const { return m_upDownState; } |
64 void releaseCapture(EventDispatch = EventDispatchAllowed); | 64 void releaseCapture(EventDispatch = EventDispatchAllowed); |
65 void removeSpinButtonOwner() { m_spinButtonOwner = nullptr; } | 65 void removeSpinButtonOwner() { m_spinButtonOwner = nullptr; } |
66 | 66 |
67 void step(int amount); | 67 void step(int amount); |
68 | 68 |
69 virtual bool willRespondToMouseMoveEvents() override; | 69 bool willRespondToMouseMoveEvents() override; |
70 virtual bool willRespondToMouseClickEvents() override; | 70 bool willRespondToMouseClickEvents() override; |
71 | 71 |
72 void forwardEvent(Event*); | 72 void forwardEvent(Event*); |
73 | 73 |
74 DECLARE_VIRTUAL_TRACE(); | 74 DECLARE_VIRTUAL_TRACE(); |
75 | 75 |
76 private: | 76 private: |
77 SpinButtonElement(Document&, SpinButtonOwner&); | 77 SpinButtonElement(Document&, SpinButtonOwner&); |
78 | 78 |
79 virtual void detach(const AttachContext&) override; | 79 void detach(const AttachContext&) override; |
80 virtual bool isSpinButtonElement() const override { return true; } | 80 bool isSpinButtonElement() const override { return true; } |
81 virtual bool isDisabledFormControl() const override { return shadowHost() &&
shadowHost()->isDisabledFormControl(); } | 81 bool isDisabledFormControl() const override { return shadowHost() && shadowH
ost()->isDisabledFormControl(); } |
82 virtual bool matchesReadOnlyPseudoClass() const override; | 82 bool matchesReadOnlyPseudoClass() const override; |
83 virtual bool matchesReadWritePseudoClass() const override; | 83 bool matchesReadWritePseudoClass() const override; |
84 virtual void defaultEventHandler(Event*) override; | 84 void defaultEventHandler(Event*) override; |
85 virtual void willOpenPopup() override; | 85 void willOpenPopup() override; |
86 void doStepAction(int); | 86 void doStepAction(int); |
87 void startRepeatingTimer(); | 87 void startRepeatingTimer(); |
88 void stopRepeatingTimer(); | 88 void stopRepeatingTimer(); |
89 void repeatingTimerFired(Timer<SpinButtonElement>*); | 89 void repeatingTimerFired(Timer<SpinButtonElement>*); |
90 virtual void setHovered(bool = true) override; | 90 void setHovered(bool = true) override; |
91 bool shouldRespondToMouseEvents(); | 91 bool shouldRespondToMouseEvents(); |
92 virtual bool isMouseFocusable() const override { return false; } | 92 bool isMouseFocusable() const override { return false; } |
93 | 93 |
94 RawPtrWillBeMember<SpinButtonOwner> m_spinButtonOwner; | 94 RawPtrWillBeMember<SpinButtonOwner> m_spinButtonOwner; |
95 bool m_capturing; | 95 bool m_capturing; |
96 UpDownState m_upDownState; | 96 UpDownState m_upDownState; |
97 UpDownState m_pressStartingState; | 97 UpDownState m_pressStartingState; |
98 Timer<SpinButtonElement> m_repeatingTimer; | 98 Timer<SpinButtonElement> m_repeatingTimer; |
99 }; | 99 }; |
100 | 100 |
101 DEFINE_TYPE_CASTS(SpinButtonElement, Node, node, toElement(node)->isSpinButtonEl
ement(), toElement(node).isSpinButtonElement()); | 101 DEFINE_TYPE_CASTS(SpinButtonElement, Node, node, toElement(node)->isSpinButtonEl
ement(), toElement(node).isSpinButtonElement()); |
102 | 102 |
103 } // namespace | 103 } // namespace |
104 | 104 |
105 #endif | 105 #endif |
OLD | NEW |