summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/layout_slider_container.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-16 11:45:35 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-17 08:59:23 +0000
commit552906b0f222c5d5dd11b9fd73829d510980461a (patch)
tree3a11e6ed0538a81dd83b20cf3a4783e297f26d91 /chromium/third_party/blink/renderer/core/layout/layout_slider_container.cc
parent1b05827804eaf047779b597718c03e7d38344261 (diff)
downloadqtwebengine-chromium-552906b0f222c5d5dd11b9fd73829d510980461a.tar.gz
BASELINE: Update Chromium to 83.0.4103.122
Change-Id: Ie3a82f5bb0076eec2a7c6a6162326b4301ee291e Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/layout_slider_container.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/layout/layout_slider_container.cc26
1 files changed, 11 insertions, 15 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/layout_slider_container.cc b/chromium/third_party/blink/renderer/core/layout/layout_slider_container.cc
index b88895afa6f..4df8effbab1 100644
--- a/chromium/third_party/blink/renderer/core/layout/layout_slider_container.cc
+++ b/chromium/third_party/blink/renderer/core/layout/layout_slider_container.cc
@@ -51,22 +51,13 @@ inline static Decimal SliderPosition(HTMLInputElement* element) {
return step_range.ProportionFromValue(step_range.ClampValue(old_value));
}
-inline static bool HasVerticalAppearance(HTMLInputElement* input) {
- DCHECK(input->GetLayoutObject());
- if (!input->GetLayoutObject() || !input->GetLayoutObject()->Style())
- return false;
- const ComputedStyle& slider_style = input->GetLayoutObject()->StyleRef();
- return slider_style.EffectiveAppearance() == kSliderVerticalPart;
-}
-
void LayoutSliderContainer::ComputeLogicalHeight(
LayoutUnit logical_height,
LayoutUnit logical_top,
LogicalExtentComputedValues& computed_values) const {
auto* input = To<HTMLInputElement>(GetNode()->OwnerShadowHost());
- bool is_vertical = HasVerticalAppearance(input);
- if (input->GetLayoutObject()->IsSlider() && !is_vertical && input->list()) {
+ if (input->GetLayoutObject()->IsSlider() && input->list()) {
int offset_from_center =
LayoutTheme::GetTheme().SliderTickOffsetFromTrackCenter();
LayoutUnit track_height;
@@ -87,8 +78,6 @@ void LayoutSliderContainer::ComputeLogicalHeight(
LayoutBox::ComputeLogicalHeight(track_height, logical_top, computed_values);
return;
}
- if (is_vertical)
- logical_height = LayoutUnit(LayoutSlider::kDefaultTrackLength);
// FIXME: The trackHeight should have been added before updateLogicalHeight
// was called to avoid this hack.
@@ -97,9 +86,17 @@ void LayoutSliderContainer::ComputeLogicalHeight(
LayoutBox::ComputeLogicalHeight(logical_height, logical_top, computed_values);
}
+MinMaxSizes LayoutSliderContainer::ComputeIntrinsicLogicalWidths() const {
+ MinMaxSizes sizes;
+ sizes += LayoutUnit(LayoutSlider::kDefaultTrackLength *
+ StyleRef().EffectiveZoom()) +
+ BorderAndPaddingLogicalWidth();
+ return sizes;
+}
+
void LayoutSliderContainer::UpdateLayout() {
auto* input = To<HTMLInputElement>(GetNode()->OwnerShadowHost());
- bool is_vertical = HasVerticalAppearance(input);
+ const bool is_vertical = !StyleRef().IsHorizontalWritingMode();
Element* thumb_element = input->UserAgentShadowRoot()->getElementById(
shadow_element_names::SliderThumb());
@@ -131,8 +128,7 @@ void LayoutSliderContainer::UpdateLayout() {
LayoutUnit offset(percentage_offset * available_extent);
LayoutPoint thumb_location = thumb->Location();
if (is_vertical) {
- thumb_location.SetY(thumb_location.Y() + track->ContentHeight() -
- thumb->Size().Height() - offset);
+ thumb_location.SetY(thumb_location.Y() - offset);
} else if (StyleRef().IsLeftToRightDirection()) {
thumb_location.SetX(thumb_location.X() + offset);
} else {