Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutTheme.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutTheme.cpp b/third_party/WebKit/Source/core/layout/LayoutTheme.cpp |
| index 6d830002df66fcebd3c01e77bd2c49bf04eef9ba..7337bd639c096239f7f7e957b58b4b71a51553b1 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutTheme.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutTheme.cpp |
| @@ -63,6 +63,12 @@ namespace blink { |
| using namespace HTMLNames; |
| +inline static bool isUnderInputRangeShadow(Element* e) |
|
tkent
2016/08/17 01:32:00
e -> element
|
| +{ |
| + Element* host = e->shadowHost(); |
| + return host && isHTMLInputElement(host) && toHTMLInputElement(host)->type() == InputTypeNames::range; |
|
tkent
2016/08/17 01:32:00
Can you check e->shadowPseudoId() instead? We'd l
|
| +} |
| + |
| LayoutTheme& LayoutTheme::theme() |
| { |
| if (RuntimeEnabledFeatures::mobileLayoutThemeEnabled()) { |
| @@ -210,6 +216,9 @@ void LayoutTheme::adjustStyle(ComputedStyle& style, Element* e) |
| return adjustMenuListStyle(style, e); |
| case MenulistButtonPart: |
| return adjustMenuListButtonStyle(style, e); |
| + case SliderHorizontalPart: |
| + case SliderVerticalPart: |
| + return adjustSliderContainerStyle(style, e); |
| case SliderThumbHorizontalPart: |
| case SliderThumbVerticalPart: |
| return adjustSliderThumbStyle(style); |
| @@ -627,6 +636,19 @@ void LayoutTheme::adjustMenuListButtonStyle(ComputedStyle&, Element*) const |
| { |
| } |
| +void LayoutTheme::adjustSliderContainerStyle(ComputedStyle& style, Element* e) const |
| +{ |
| + if (isUnderInputRangeShadow(e)) { |
| + if (style.appearance() == SliderVerticalPart) { |
| + style.setTouchAction(TouchActionPanX); |
| + style.setAppearance(NoControlPart); |
| + } else { |
| + style.setTouchAction(TouchActionPanY); |
| + style.setAppearance(NoControlPart); |
| + } |
| + } |
| +} |
| + |
| void LayoutTheme::adjustSliderThumbStyle(ComputedStyle& style) const |
| { |
| adjustSliderThumbSize(style); |