diff options
Diffstat (limited to 'Source/WebCore/rendering/RenderTheme.cpp')
-rw-r--r-- | Source/WebCore/rendering/RenderTheme.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/WebCore/rendering/RenderTheme.cpp b/Source/WebCore/rendering/RenderTheme.cpp index f1661722e..3382d3fbd 100644 --- a/Source/WebCore/rendering/RenderTheme.cpp +++ b/Source/WebCore/rendering/RenderTheme.cpp @@ -828,7 +828,7 @@ bool RenderTheme::isReadOnlyControl(const RenderObject* o) const Node* node = o->node(); if (!node || !node->isElementNode()) return false; - return static_cast<Element*>(node)->isReadOnlyFormControl(); + return static_cast<Element*>(node)->shouldMatchReadOnlySelector(); } bool RenderTheme::isHovered(const RenderObject* o) const @@ -963,6 +963,11 @@ bool RenderTheme::paintMeter(RenderObject*, const PaintInfo&, const IntRect&) #endif #if ENABLE(DATALIST_ELEMENT) +LayoutUnit RenderTheme::sliderTickSnappingThreshold() const +{ + return 0; +} + void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo, const IntRect& rect) { Node* node = o->node(); @@ -1024,13 +1029,13 @@ void RenderTheme::paintSliderTicks(RenderObject* o, const PaintInfo& paintInfo, if (!input->isValidValue(value)) continue; double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(value)); - double tickPosition = (parsedValue - min) / (max - min); - if (!o->style()->isLeftToRightDirection()) - tickPosition = 1.0 - tickPosition; + double tickFraction = (parsedValue - min) / (max - min); + double tickRatio = isHorizontal && o->style()->isLeftToRightDirection() ? tickFraction : 1.0 - tickFraction; + double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tickRatio); if (isHorizontal) - tickRect.setX(floor(tickRegionSideMargin + tickRegionWidth * tickPosition)); + tickRect.setX(tickPosition); else - tickRect.setY(floor(tickRegionSideMargin + tickRegionWidth * tickPosition)); + tickRect.setY(tickPosition); paintInfo.context->fillRect(tickRect); } } |