| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 event->setDefaultHandled(); | 114 event->setDefaultHandled(); |
| 115 } | 115 } |
| 116 } else if (mouseEvent->type() == eventNames().mouseupEvent && mouseEvent->bu
tton() == LeftButton) | 116 } else if (mouseEvent->type() == eventNames().mouseupEvent && mouseEvent->bu
tton() == LeftButton) |
| 117 stopRepeatingTimer(); | 117 stopRepeatingTimer(); |
| 118 else if (event->type() == eventNames().mousemoveEvent) { | 118 else if (event->type() == eventNames().mousemoveEvent) { |
| 119 if (box->pixelSnappedBorderBoxRect().contains(local)) { | 119 if (box->pixelSnappedBorderBoxRect().contains(local)) { |
| 120 if (!m_capturing) { | 120 if (!m_capturing) { |
| 121 if (Frame* frame = document()->frame()) { | 121 if (Frame* frame = document()->frame()) { |
| 122 frame->eventHandler()->setCapturingMouseEventsNode(this); | 122 frame->eventHandler()->setCapturingMouseEventsNode(this); |
| 123 m_capturing = true; | 123 m_capturing = true; |
| 124 if (Page* page = document()->page()) { | 124 if (Page* page = document()->page()) |
| 125 if (page->chrome()) | 125 page->chrome().registerPopupOpeningObserver(this); |
| 126 page->chrome()->registerPopupOpeningObserver(this); | |
| 127 } | |
| 128 } | 126 } |
| 129 } | 127 } |
| 130 UpDownState oldUpDownState = m_upDownState; | 128 UpDownState oldUpDownState = m_upDownState; |
| 131 m_upDownState = local.y() < box->height() / 2 ? Up : Down; | 129 m_upDownState = local.y() < box->height() / 2 ? Up : Down; |
| 132 if (m_upDownState != oldUpDownState) | 130 if (m_upDownState != oldUpDownState) |
| 133 renderer()->repaint(); | 131 renderer()->repaint(); |
| 134 } else { | 132 } else { |
| 135 releaseCapture(); | 133 releaseCapture(); |
| 136 m_upDownState = Indeterminate; | 134 m_upDownState = Indeterminate; |
| 137 } | 135 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 m_spinButtonOwner->spinButtonStepDown(); | 190 m_spinButtonOwner->spinButtonStepDown(); |
| 193 } | 191 } |
| 194 | 192 |
| 195 void SpinButtonElement::releaseCapture() | 193 void SpinButtonElement::releaseCapture() |
| 196 { | 194 { |
| 197 stopRepeatingTimer(); | 195 stopRepeatingTimer(); |
| 198 if (m_capturing) { | 196 if (m_capturing) { |
| 199 if (Frame* frame = document()->frame()) { | 197 if (Frame* frame = document()->frame()) { |
| 200 frame->eventHandler()->setCapturingMouseEventsNode(0); | 198 frame->eventHandler()->setCapturingMouseEventsNode(0); |
| 201 m_capturing = false; | 199 m_capturing = false; |
| 202 if (Page* page = document()->page()) { | 200 if (Page* page = document()->page()) |
| 203 if (page->chrome()) | 201 page->chrome().unregisterPopupOpeningObserver(this); |
| 204 page->chrome()->unregisterPopupOpeningObserver(this); | |
| 205 } | |
| 206 } | 202 } |
| 207 } | 203 } |
| 208 } | 204 } |
| 209 | 205 |
| 210 bool SpinButtonElement::matchesReadOnlyPseudoClass() const | 206 bool SpinButtonElement::matchesReadOnlyPseudoClass() const |
| 211 { | 207 { |
| 212 return shadowHost()->matchesReadOnlyPseudoClass(); | 208 return shadowHost()->matchesReadOnlyPseudoClass(); |
| 213 } | 209 } |
| 214 | 210 |
| 215 bool SpinButtonElement::matchesReadWritePseudoClass() const | 211 bool SpinButtonElement::matchesReadWritePseudoClass() const |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 m_upDownState = Indeterminate; | 251 m_upDownState = Indeterminate; |
| 256 HTMLDivElement::setHovered(flag); | 252 HTMLDivElement::setHovered(flag); |
| 257 } | 253 } |
| 258 | 254 |
| 259 bool SpinButtonElement::shouldRespondToMouseEvents() | 255 bool SpinButtonElement::shouldRespondToMouseEvents() |
| 260 { | 256 { |
| 261 return !m_spinButtonOwner || m_spinButtonOwner->shouldSpinButtonRespondToMou
seEvents(); | 257 return !m_spinButtonOwner || m_spinButtonOwner->shouldSpinButtonRespondToMou
seEvents(); |
| 262 } | 258 } |
| 263 | 259 |
| 264 } | 260 } |
| OLD | NEW |