OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009 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 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 305 |
306 // FIXME: This is no longer being set from renderer. Consider updating the m
ethod name. | 306 // FIXME: This is no longer being set from renderer. Consider updating the m
ethod name. |
307 input->setValueFromRenderer(valueString); | 307 input->setValueFromRenderer(valueString); |
308 if (renderer()) | 308 if (renderer()) |
309 renderer()->setNeedsLayout(); | 309 renderer()->setNeedsLayout(); |
310 input->dispatchFormControlChangeEvent(); | 310 input->dispatchFormControlChangeEvent(); |
311 } | 311 } |
312 | 312 |
313 void SliderThumbElement::startDragging() | 313 void SliderThumbElement::startDragging() |
314 { | 314 { |
315 if (Frame* frame = document()->frame()) { | 315 if (Frame* frame = document().frame()) { |
316 frame->eventHandler()->setCapturingMouseEventsNode(this); | 316 frame->eventHandler()->setCapturingMouseEventsNode(this); |
317 m_inDragMode = true; | 317 m_inDragMode = true; |
318 } | 318 } |
319 } | 319 } |
320 | 320 |
321 void SliderThumbElement::stopDragging() | 321 void SliderThumbElement::stopDragging() |
322 { | 322 { |
323 if (!m_inDragMode) | 323 if (!m_inDragMode) |
324 return; | 324 return; |
325 | 325 |
326 if (Frame* frame = document()->frame()) | 326 if (Frame* frame = document().frame()) |
327 frame->eventHandler()->setCapturingMouseEventsNode(0); | 327 frame->eventHandler()->setCapturingMouseEventsNode(0); |
328 m_inDragMode = false; | 328 m_inDragMode = false; |
329 if (renderer()) | 329 if (renderer()) |
330 renderer()->setNeedsLayout(); | 330 renderer()->setNeedsLayout(); |
331 } | 331 } |
332 | 332 |
333 void SliderThumbElement::defaultEventHandler(Event* event) | 333 void SliderThumbElement::defaultEventHandler(Event* event) |
334 { | 334 { |
335 if (!event->isMouseEvent()) { | 335 if (!event->isMouseEvent()) { |
336 HTMLDivElement::defaultEventHandler(event); | 336 HTMLDivElement::defaultEventHandler(event); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 const HTMLInputElement* input = hostInput(); | 382 const HTMLInputElement* input = hostInput(); |
383 if (input && !input->isDisabledOrReadOnly()) | 383 if (input && !input->isDisabledOrReadOnly()) |
384 return true; | 384 return true; |
385 | 385 |
386 return HTMLDivElement::willRespondToMouseClickEvents(); | 386 return HTMLDivElement::willRespondToMouseClickEvents(); |
387 } | 387 } |
388 | 388 |
389 void SliderThumbElement::detach(const AttachContext& context) | 389 void SliderThumbElement::detach(const AttachContext& context) |
390 { | 390 { |
391 if (m_inDragMode) { | 391 if (m_inDragMode) { |
392 if (Frame* frame = document()->frame()) | 392 if (Frame* frame = document().frame()) |
393 frame->eventHandler()->setCapturingMouseEventsNode(0); | 393 frame->eventHandler()->setCapturingMouseEventsNode(0); |
394 } | 394 } |
395 HTMLDivElement::detach(context); | 395 HTMLDivElement::detach(context); |
396 } | 396 } |
397 | 397 |
398 HTMLInputElement* SliderThumbElement::hostInput() const | 398 HTMLInputElement* SliderThumbElement::hostInput() const |
399 { | 399 { |
400 // Only HTMLInputElement creates SliderThumbElement instances as its shadow
nodes. | 400 // Only HTMLInputElement creates SliderThumbElement instances as its shadow
nodes. |
401 // So, shadowHost() must be an HTMLInputElement. | 401 // So, shadowHost() must be an HTMLInputElement. |
402 return toHTMLInputElement(shadowHost()); | 402 return toHTMLInputElement(shadowHost()); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 case MediaVolumeSliderThumbPart: | 467 case MediaVolumeSliderThumbPart: |
468 case MediaFullScreenVolumeSliderPart: | 468 case MediaFullScreenVolumeSliderPart: |
469 case MediaFullScreenVolumeSliderThumbPart: | 469 case MediaFullScreenVolumeSliderThumbPart: |
470 return mediaSliderContainer; | 470 return mediaSliderContainer; |
471 default: | 471 default: |
472 return sliderContainer; | 472 return sliderContainer; |
473 } | 473 } |
474 } | 474 } |
475 | 475 |
476 } | 476 } |
OLD | NEW |