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

Unified Diff: Source/WebCore/html/shadow/SliderThumbElement.cpp

Issue 12518023: Merge 144790 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/forms/range/slider-inline-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/shadow/SliderThumbElement.cpp
===================================================================
--- Source/WebCore/html/shadow/SliderThumbElement.cpp (revision 145464)
+++ Source/WebCore/html/shadow/SliderThumbElement.cpp (working copy)
@@ -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());
« no previous file with comments | « LayoutTests/fast/forms/range/slider-inline-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698