Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp

Issue 2709393004: Media Controls: Fix time updates when dragging from track not scrubber (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 bool SliderThumbElement::matchesReadWritePseudoClass() const { 90 bool SliderThumbElement::matchesReadWritePseudoClass() const {
91 return hostInput() && hostInput()->matchesReadWritePseudoClass(); 91 return hostInput() && hostInput()->matchesReadWritePseudoClass();
92 } 92 }
93 93
94 Node* SliderThumbElement::focusDelegate() { 94 Node* SliderThumbElement::focusDelegate() {
95 return hostInput(); 95 return hostInput();
96 } 96 }
97 97
98 void SliderThumbElement::dragFrom(const LayoutPoint& point) { 98 void SliderThumbElement::dragFrom(const LayoutPoint& point) {
99 // Call setPositionFromPoint before startDragging, since this initial position
100 // change is due to the mousedown on track that precedes dragging (mousemove).
101 setPositionFromPoint(point);
99 startDragging(); 102 startDragging();
100 setPositionFromPoint(point);
101 } 103 }
102 104
103 void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point) { 105 void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point) {
104 HTMLInputElement* input(hostInput()); 106 HTMLInputElement* input(hostInput());
105 Element* trackElement = input->userAgentShadowRoot()->getElementById( 107 Element* trackElement = input->userAgentShadowRoot()->getElementById(
106 ShadowElementNames::sliderTrack()); 108 ShadowElementNames::sliderTrack());
107 109
108 if (!input->layoutObject() || !layoutBox() || !trackElement->layoutBox()) 110 if (!input->layoutObject() || !layoutBox() || !trackElement->layoutBox())
109 return; 111 return;
110 112
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 updateTouchEventHandlerRegistry(); 450 updateTouchEventHandlerRegistry();
449 HTMLElement::didMoveToNewDocument(oldDocument); 451 HTMLElement::didMoveToNewDocument(oldDocument);
450 } 452 }
451 453
452 void SliderContainerElement::removeAllEventListeners() { 454 void SliderContainerElement::removeAllEventListeners() {
453 Node::removeAllEventListeners(); 455 Node::removeAllEventListeners();
454 m_hasTouchEventHandler = false; 456 m_hasTouchEventHandler = false;
455 } 457 }
456 458
457 } // namespace blink 459 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/shadow/SliderThumbElement.h ('k') | third_party/WebKit/Source/core/layout/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698