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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 HTMLDivElement::defaultEventHandler(event); | 85 HTMLDivElement::defaultEventHandler(event); |
86 return; | 86 return; |
87 } | 87 } |
88 | 88 |
89 MouseEvent* mouseEvent = toMouseEvent(event); | 89 MouseEvent* mouseEvent = toMouseEvent(event); |
90 IntPoint local = roundedIntPoint(box->absoluteToLocal(FloatPoint(mouseEvent-
>absoluteLocation()), UseTransforms)); | 90 IntPoint local = roundedIntPoint(box->absoluteToLocal(FloatPoint(mouseEvent-
>absoluteLocation()), UseTransforms)); |
91 if (mouseEvent->type() == EventTypeNames::mousedown && mouseEvent->button()
== LeftButton) { | 91 if (mouseEvent->type() == EventTypeNames::mousedown && mouseEvent->button()
== LeftButton) { |
92 if (box->pixelSnappedBorderBoxRect().contains(local)) { | 92 if (box->pixelSnappedBorderBoxRect().contains(local)) { |
93 if (m_spinButtonOwner) | 93 if (m_spinButtonOwner) |
94 m_spinButtonOwner->focusAndSelectSpinButtonOwner(); | 94 m_spinButtonOwner->focusAndSelectSpinButtonOwner(); |
95 if (layoutObject()) { | 95 if (hasLayoutObject()) { |
96 if (m_upDownState != Indeterminate) { | 96 if (m_upDownState != Indeterminate) { |
97 // A JavaScript event handler called in doStepAction() below | 97 // A JavaScript event handler called in doStepAction() below |
98 // might change the element state and we might need to | 98 // might change the element state and we might need to |
99 // cancel the repeating timer by the state change. If we | 99 // cancel the repeating timer by the state change. If we |
100 // started the timer after doStepAction(), we would have no | 100 // started the timer after doStepAction(), we would have no |
101 // chance to cancel the timer. | 101 // chance to cancel the timer. |
102 startRepeatingTimer(); | 102 startRepeatingTimer(); |
103 doStepAction(m_upDownState == Up ? 1 : -1); | 103 doStepAction(m_upDownState == Up ? 1 : -1); |
104 } | 104 } |
105 } | 105 } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 return !m_spinButtonOwner || m_spinButtonOwner->shouldSpinButtonRespondToMou
seEvents(); | 252 return !m_spinButtonOwner || m_spinButtonOwner->shouldSpinButtonRespondToMou
seEvents(); |
253 } | 253 } |
254 | 254 |
255 DEFINE_TRACE(SpinButtonElement) | 255 DEFINE_TRACE(SpinButtonElement) |
256 { | 256 { |
257 visitor->trace(m_spinButtonOwner); | 257 visitor->trace(m_spinButtonOwner); |
258 HTMLDivElement::trace(visitor); | 258 HTMLDivElement::trace(visitor); |
259 } | 259 } |
260 | 260 |
261 } // namespace blink | 261 } // namespace blink |
OLD | NEW |