Changeset 126132 in webkit
- Timestamp:
- Aug 20, 2012 9:27:27 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r126131 r126132 1 2012-08-20 Keishi Hattori <keishi@webkit.org> 2 3 Clicking input type=range with padding or border sets wrong value 4 https://bugs.webkit.org/show_bug.cgi?id=94473 5 6 Reviewed by Kent Tamura. 7 8 * fast/forms/range/range-hit-test-with-padding-expected.txt: Added. 9 * fast/forms/range/range-hit-test-with-padding.html: Added. 10 1 11 2012-08-20 MORITA Hajime <morrita@google.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r126131 r126132 1 2012-08-20 Keishi Hattori <keishi@webkit.org> 2 3 Clicking input type=range with padding or border sets wrong value 4 https://bugs.webkit.org/show_bug.cgi?id=94473 5 6 Reviewed by Kent Tamura. 7 8 We should take the padding and border width into account when calculating the value from the mouse location. 9 10 Test: fast/forms/range/range-hit-test-with-padding.html 11 12 * html/shadow/SliderThumbElement.cpp: 13 (WebCore::sliderTrackElementOf): 14 (WebCore): 15 (WebCore::SliderThumbElement::setPositionFromPoint): 16 * html/shadow/SliderThumbElement.h: 17 (WebCore): 18 1 19 2012-08-20 MORITA Hajime <morrita@google.com> 2 20 -
trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp
r125048 r126132 82 82 ASSERT(thumb); 83 83 return toSliderThumbElement(thumb); 84 } 85 86 HTMLElement* sliderTrackElementOf(Node* node) 87 { 88 ASSERT(node); 89 ShadowRoot* shadow = node->toInputElement()->userAgentShadowRoot(); 90 ASSERT(shadow); 91 Node* track = shadow->firstChild()->firstChild(); 92 ASSERT(track); 93 return toHTMLElement(track); 84 94 } 85 95 … … 241 251 { 242 252 HTMLInputElement* input = hostInput(); 243 244 if (!input->renderer() || !renderer()) 253 HTMLElement* trackElement = sliderTrackElementOf(input); 254 255 if (!input->renderer() || !renderer() || !trackElement->renderer()) 245 256 return; 246 257 … … 257 268 LayoutPoint absoluteThumbOrigin = renderBox()->absoluteBoundingBoxRectIgnoringTransforms().location(); 258 269 LayoutPoint absoluteSliderContentOrigin = roundedLayoutPoint(input->renderer()->localToAbsolute()); 270 IntRect trackBoundingBox = trackElement->renderer()->absoluteBoundingBoxRectIgnoringTransforms(); 271 IntRect inputBoundingBox = input->renderer()->absoluteBoundingBoxRectIgnoringTransforms(); 259 272 if (isVertical) { 260 trackSize = input->renderBox()->contentHeight() - renderBox()->height();261 position = offset.y() - renderBox()->height() / 2 ;273 trackSize = trackElement->renderBox()->contentHeight(); 274 position = offset.y() - renderBox()->height() / 2 - trackBoundingBox.y() + inputBoundingBox.y(); 262 275 currentPosition = absoluteThumbOrigin.y() - absoluteSliderContentOrigin.y(); 263 276 } else { 264 trackSize = input->renderBox()->contentWidth() - renderBox()->width();265 position = offset.x() - renderBox()->width() / 2 ;277 trackSize = trackElement->renderBox()->contentWidth(); 278 position = offset.x() - renderBox()->width() / 2 - trackBoundingBox.x() + inputBoundingBox.x(); 266 279 currentPosition = absoluteThumbOrigin.x() - absoluteSliderContentOrigin.x(); 267 280 } -
trunk/Source/WebCore/html/shadow/SliderThumbElement.h
r124180 r126132 101 101 // An assertion fails if the specified node is not a range input. 102 102 SliderThumbElement* sliderThumbElementOf(Node*); 103 HTMLElement* sliderTrackElementOf(Node*); 103 104 104 105 // --------------------------------
Note: See TracChangeset
for help on using the changeset viewer.