Title: [145465] branches/chromium/1410
- Revision
- 145465
- Author
- [email protected]
- Date
- 2013-03-11 19:18:02 -0700 (Mon, 11 Mar 2013)
Log Message
Merge 144790
BUG=179287
Review URL: https://codereview.chromium.org/12518023
Modified Paths
Added Paths
Diff
Copied: branches/chromium/1410/LayoutTests/fast/forms/range/slider-inline-crash-expected.txt (from rev 144790, trunk/LayoutTests/fast/forms/range/slider-inline-crash-expected.txt) (0 => 145465)
--- branches/chromium/1410/LayoutTests/fast/forms/range/slider-inline-crash-expected.txt (rev 0)
+++ branches/chromium/1410/LayoutTests/fast/forms/range/slider-inline-crash-expected.txt 2013-03-12 02:18:02 UTC (rev 145465)
@@ -0,0 +1,3 @@
+This test passes if dragging the thumb does not crash.
+
+
Copied: branches/chromium/1410/LayoutTests/fast/forms/range/slider-inline-crash.html (from rev 144790, trunk/LayoutTests/fast/forms/range/slider-inline-crash.html) (0 => 145465)
--- branches/chromium/1410/LayoutTests/fast/forms/range/slider-inline-crash.html (rev 0)
+++ branches/chromium/1410/LayoutTests/fast/forms/range/slider-inline-crash.html 2013-03-12 02:18:02 UTC (rev 145465)
@@ -0,0 +1,29 @@
+<!DOCTYLE html>
+<html>
+<style>
+input[type="range"]::-webkit-slider-container,
+input[type="range"]::-webkit-slider-runnable-track,
+input[type="range"]::-webkit-slider-thumb {
+ display: inline;
+}
+</style>
+<p>This test passes if dragging the thumb does not crash.</p>
+<input id="slider" type="range">
+<script>
+function runTest()
+{
+ if (!window.testRunner || !window.eventSender)
+ return;
+ testRunner.dumpAsText();
+
+ var slider = document.getElementById("slider");
+ var x = slider.offsetLeft + slider.offsetWidth / 2;
+ var y = slider.offsetTop + slider.offsetHeight / 2;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}
+
+runTest();
+</script>
+</html>
Modified: branches/chromium/1410/Source/WebCore/html/shadow/SliderThumbElement.cpp (145464 => 145465)
--- branches/chromium/1410/Source/WebCore/html/shadow/SliderThumbElement.cpp 2013-03-12 02:09:50 UTC (rev 145464)
+++ branches/chromium/1410/Source/WebCore/html/shadow/SliderThumbElement.cpp 2013-03-12 02:18:02 UTC (rev 145465)
@@ -177,21 +177,18 @@
style()->setDirection(LTR);
}
- RenderBox* thumb = 0;
- RenderBox* track = 0;
- if (input->sliderThumbElement() && input->sliderThumbElement()->renderer()) {
- thumb = toRenderBox(input->sliderThumbElement()->renderer());
- track = toRenderBox(thumb->parent());
- // Force a layout to reset the position of the thumb so the code below doesn't move the thumb to the wrong place.
- // FIXME: Make a custom Render class for the track and move the thumb positioning code there.
+ RenderBox* thumb = input->sliderThumbElement() ? input->sliderThumbElement()->renderBox() : 0;
+ RenderBox* track = input->sliderTrackElement() ? input->sliderTrackElement()->renderBox() : 0;
+ // Force a layout to reset the position of the thumb so the code below doesn't move the thumb to the wrong place.
+ // FIXME: Make a custom Render class for the track and move the thumb positioning code there.
+ if (track)
track->setChildNeedsLayout(true, MarkOnlyThis);
- }
RenderFlexibleBox::layout();
style()->setDirection(oldTextDirection);
// These should always exist, unless someone mutates the shadow DOM (e.g., in the inspector).
- if (!thumb)
+ if (!thumb || !track)
return;
double percentageOffset = sliderPosition(input).toDouble();
@@ -255,7 +252,7 @@
HTMLInputElement* input = hostInput();
HTMLElement* trackElement = sliderTrackElementOf(input);
- if (!input->renderer() || !renderer() || !trackElement->renderer())
+ if (!input->renderer() || !renderBox() || !trackElement->renderBox())
return;
input->setTextAsOfLastFormControlChangeEvent(input->value());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes