| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 element->setAttribute(idAttr, ShadowElementNames::sliderThumb()); | 211 element->setAttribute(idAttr, ShadowElementNames::sliderThumb()); |
| 212 return element.release(); | 212 return element.release(); |
| 213 } | 213 } |
| 214 | 214 |
| 215 void SliderThumbElement::setPositionFromValue() | 215 void SliderThumbElement::setPositionFromValue() |
| 216 { | 216 { |
| 217 // Since the code to calculate position is in the RenderSliderThumb layout | 217 // Since the code to calculate position is in the RenderSliderThumb layout |
| 218 // path, we don't actually update the value here. Instead, we poke at the | 218 // path, we don't actually update the value here. Instead, we poke at the |
| 219 // renderer directly to trigger layout. | 219 // renderer directly to trigger layout. |
| 220 if (renderer()) | 220 if (renderer()) |
| 221 renderer()->setNeedsLayout(); | 221 renderer()->setNeedsLayoutAndFullRepaint(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 RenderObject* SliderThumbElement::createRenderer(RenderStyle*) | 224 RenderObject* SliderThumbElement::createRenderer(RenderStyle*) |
| 225 { | 225 { |
| 226 return new RenderSliderThumb(this); | 226 return new RenderSliderThumb(this); |
| 227 } | 227 } |
| 228 | 228 |
| 229 bool SliderThumbElement::isDisabledFormControl() const | 229 bool SliderThumbElement::isDisabledFormControl() const |
| 230 { | 230 { |
| 231 return hostInput() && hostInput()->isDisabledFormControl(); | 231 return hostInput() && hostInput()->isDisabledFormControl(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 value = closest; | 301 value = closest; |
| 302 } | 302 } |
| 303 | 303 |
| 304 String valueString = serializeForNumberType(value); | 304 String valueString = serializeForNumberType(value); |
| 305 if (valueString == input->value()) | 305 if (valueString == input->value()) |
| 306 return; | 306 return; |
| 307 | 307 |
| 308 // FIXME: This is no longer being set from renderer. Consider updating the m
ethod name. | 308 // FIXME: This is no longer being set from renderer. Consider updating the m
ethod name. |
| 309 input->setValueFromRenderer(valueString); | 309 input->setValueFromRenderer(valueString); |
| 310 if (renderer()) | 310 if (renderer()) |
| 311 renderer()->setNeedsLayout(); | 311 renderer()->setNeedsLayoutAndFullRepaint(); |
| 312 } | 312 } |
| 313 | 313 |
| 314 void SliderThumbElement::startDragging() | 314 void SliderThumbElement::startDragging() |
| 315 { | 315 { |
| 316 if (LocalFrame* frame = document().frame()) { | 316 if (LocalFrame* frame = document().frame()) { |
| 317 frame->eventHandler().setCapturingMouseEventsNode(this); | 317 frame->eventHandler().setCapturingMouseEventsNode(this); |
| 318 m_inDragMode = true; | 318 m_inDragMode = true; |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 | 321 |
| 322 void SliderThumbElement::stopDragging() | 322 void SliderThumbElement::stopDragging() |
| 323 { | 323 { |
| 324 if (!m_inDragMode) | 324 if (!m_inDragMode) |
| 325 return; | 325 return; |
| 326 | 326 |
| 327 if (LocalFrame* frame = document().frame()) | 327 if (LocalFrame* frame = document().frame()) |
| 328 frame->eventHandler().setCapturingMouseEventsNode(nullptr); | 328 frame->eventHandler().setCapturingMouseEventsNode(nullptr); |
| 329 m_inDragMode = false; | 329 m_inDragMode = false; |
| 330 if (renderer()) | 330 if (renderer()) |
| 331 renderer()->setNeedsLayout(); | 331 renderer()->setNeedsLayoutAndFullRepaint(); |
| 332 if (hostInput()) | 332 if (hostInput()) |
| 333 hostInput()->dispatchFormControlChangeEvent(); | 333 hostInput()->dispatchFormControlChangeEvent(); |
| 334 } | 334 } |
| 335 | 335 |
| 336 void SliderThumbElement::defaultEventHandler(Event* event) | 336 void SliderThumbElement::defaultEventHandler(Event* event) |
| 337 { | 337 { |
| 338 if (!event->isMouseEvent()) { | 338 if (!event->isMouseEvent()) { |
| 339 HTMLDivElement::defaultEventHandler(event); | 339 HTMLDivElement::defaultEventHandler(event); |
| 340 return; | 340 return; |
| 341 } | 341 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 case MediaVolumeSliderThumbPart: | 470 case MediaVolumeSliderThumbPart: |
| 471 case MediaFullScreenVolumeSliderPart: | 471 case MediaFullScreenVolumeSliderPart: |
| 472 case MediaFullScreenVolumeSliderThumbPart: | 472 case MediaFullScreenVolumeSliderThumbPart: |
| 473 return mediaSliderContainer; | 473 return mediaSliderContainer; |
| 474 default: | 474 default: |
| 475 return sliderContainer; | 475 return sliderContainer; |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 | 478 |
| 479 } | 479 } |
| OLD | NEW |