Diff
Modified: trunk/LayoutTests/ChangeLog (283268 => 283269)
--- trunk/LayoutTests/ChangeLog 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/LayoutTests/ChangeLog 2021-09-29 22:25:07 UTC (rev 283269)
@@ -1,3 +1,15 @@
+2021-09-29 Aditya Keerthi <[email protected]>
+
+ [css-ui] getComputedStyle() must return the specified value for '-webkit-appearance'
+ https://bugs.webkit.org/show_bug.cgi?id=230916
+ rdar://83640938
+
+ Reviewed by Simon Fraser.
+
+ * platform/gtk/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt:
+ * platform/ios-wk2/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt:
+
2021-09-29 Robert Jenner <[email protected]>
[ Catalina+ Debug wk2 ] fast/speechrecognition/start-recognition-after-gum.html is a flaky timeout
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (283268 => 283269)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2021-09-29 22:25:07 UTC (rev 283269)
@@ -1,3 +1,15 @@
+2021-09-29 Aditya Keerthi <[email protected]>
+
+ [css-ui] getComputedStyle() must return the specified value for '-webkit-appearance'
+ https://bugs.webkit.org/show_bug.cgi?id=230916
+ rdar://83640938
+
+ Reviewed by Simon Fraser.
+
+ * web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt:
+
+ Rebaseline for progression.
+
2021-09-29 Myles C. Maxfield <[email protected]>
Update WPT's IDL for font palettes
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt (283268 => 283269)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt 2021-09-29 22:25:07 UTC (rev 283269)
@@ -2,18 +2,18 @@
PASS -webkit-appearance: none
FAIL -webkit-appearance: auto assert_equals: style.WebkitAppearance (uppercase W) expected "auto" but got ""
-FAIL -webkit-appearance: button assert_equals: style.WebkitAppearance (uppercase W) expected "button" but got "none"
+PASS -webkit-appearance: button
PASS -webkit-appearance: checkbox
PASS -webkit-appearance: listbox
-FAIL -webkit-appearance: menulist assert_equals: style.WebkitAppearance (uppercase W) expected "menulist" but got "menulist-button"
+PASS -webkit-appearance: menulist
PASS -webkit-appearance: menulist-button
-FAIL -webkit-appearance: meter assert_equals: style.WebkitAppearance (uppercase W) expected "meter" but got "none"
-FAIL -webkit-appearance: progress-bar assert_equals: style.WebkitAppearance (uppercase W) expected "progress-bar" but got "none"
-FAIL -webkit-appearance: push-button assert_equals: style.WebkitAppearance (uppercase W) expected "push-button" but got "none"
+PASS -webkit-appearance: meter
+PASS -webkit-appearance: progress-bar
+PASS -webkit-appearance: push-button
PASS -webkit-appearance: radio
PASS -webkit-appearance: searchfield
PASS -webkit-appearance: slider-horizontal
-FAIL -webkit-appearance: square-button assert_equals: style.WebkitAppearance (uppercase W) expected "square-button" but got "none"
+PASS -webkit-appearance: square-button
PASS -webkit-appearance: textarea
PASS -webkit-appearance: textfield
FAIL -webkit-appearance: bogus-button (invalid) assert_equals: style.WebkitAppearance (uppercase W) expected (undefined) undefined but got (string) "button"
Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt (283268 => 283269)
--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt 2021-09-29 22:25:07 UTC (rev 283269)
@@ -2,18 +2,18 @@
PASS -webkit-appearance: none
FAIL -webkit-appearance: auto assert_equals: style.WebkitAppearance (uppercase W) expected "auto" but got ""
-FAIL -webkit-appearance: button assert_equals: style.WebkitAppearance (uppercase W) expected "button" but got "none"
+PASS -webkit-appearance: button
PASS -webkit-appearance: checkbox
-FAIL -webkit-appearance: listbox assert_equals: style.WebkitAppearance (uppercase W) expected "listbox" but got "none"
-FAIL -webkit-appearance: menulist assert_equals: style.WebkitAppearance (uppercase W) expected "menulist" but got "menulist-button"
+PASS -webkit-appearance: listbox
+PASS -webkit-appearance: menulist
PASS -webkit-appearance: menulist-button
-FAIL -webkit-appearance: meter assert_equals: style.WebkitAppearance (uppercase W) expected "meter" but got "none"
-FAIL -webkit-appearance: progress-bar assert_equals: style.WebkitAppearance (uppercase W) expected "progress-bar" but got "none"
+PASS -webkit-appearance: meter
+PASS -webkit-appearance: progress-bar
PASS -webkit-appearance: push-button
PASS -webkit-appearance: radio
PASS -webkit-appearance: searchfield
PASS -webkit-appearance: slider-horizontal
-FAIL -webkit-appearance: square-button assert_equals: style.WebkitAppearance (uppercase W) expected "square-button" but got "none"
+PASS -webkit-appearance: square-button
PASS -webkit-appearance: textarea
PASS -webkit-appearance: textfield
FAIL -webkit-appearance: bogus-button (invalid) assert_equals: style.WebkitAppearance (uppercase W) expected (undefined) undefined but got (string) "button"
Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt (283268 => 283269)
--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt 2021-09-29 22:25:07 UTC (rev 283269)
@@ -2,18 +2,18 @@
PASS -webkit-appearance: none
FAIL -webkit-appearance: auto assert_equals: style.WebkitAppearance (uppercase W) expected "auto" but got ""
-FAIL -webkit-appearance: button assert_equals: style.WebkitAppearance (uppercase W) expected "button" but got "none"
+PASS -webkit-appearance: button
PASS -webkit-appearance: checkbox
-FAIL -webkit-appearance: listbox assert_equals: style.WebkitAppearance (uppercase W) expected "listbox" but got "none"
-FAIL -webkit-appearance: menulist assert_equals: style.WebkitAppearance (uppercase W) expected "menulist" but got "menulist-button"
+PASS -webkit-appearance: listbox
+PASS -webkit-appearance: menulist
PASS -webkit-appearance: menulist-button
-FAIL -webkit-appearance: meter assert_equals: style.WebkitAppearance (uppercase W) expected "meter" but got "none"
-FAIL -webkit-appearance: progress-bar assert_equals: style.WebkitAppearance (uppercase W) expected "progress-bar" but got "none"
+PASS -webkit-appearance: meter
+PASS -webkit-appearance: progress-bar
PASS -webkit-appearance: push-button
PASS -webkit-appearance: radio
PASS -webkit-appearance: searchfield
PASS -webkit-appearance: slider-horizontal
-FAIL -webkit-appearance: square-button assert_equals: style.WebkitAppearance (uppercase W) expected "square-button" but got "none"
+PASS -webkit-appearance: square-button
PASS -webkit-appearance: textarea
PASS -webkit-appearance: textfield
FAIL -webkit-appearance: bogus-button (invalid) assert_equals: style.WebkitAppearance (uppercase W) expected (undefined) undefined but got (string) "button"
Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt (283268 => 283269)
--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt 2021-09-29 22:25:07 UTC (rev 283269)
@@ -2,18 +2,18 @@
PASS -webkit-appearance: none
FAIL -webkit-appearance: auto assert_equals: style.WebkitAppearance (uppercase W) expected "auto" but got ""
-FAIL -webkit-appearance: button assert_equals: style.WebkitAppearance (uppercase W) expected "button" but got "none"
+PASS -webkit-appearance: button
PASS -webkit-appearance: checkbox
-FAIL -webkit-appearance: listbox assert_equals: style.WebkitAppearance (uppercase W) expected "listbox" but got "none"
-FAIL -webkit-appearance: menulist assert_equals: style.WebkitAppearance (uppercase W) expected "menulist" but got "menulist-button"
+PASS -webkit-appearance: listbox
+PASS -webkit-appearance: menulist
PASS -webkit-appearance: menulist-button
-FAIL -webkit-appearance: meter assert_equals: style.WebkitAppearance (uppercase W) expected "meter" but got "none"
-FAIL -webkit-appearance: progress-bar assert_equals: style.WebkitAppearance (uppercase W) expected "progress-bar" but got "none"
+PASS -webkit-appearance: meter
+PASS -webkit-appearance: progress-bar
PASS -webkit-appearance: push-button
PASS -webkit-appearance: radio
PASS -webkit-appearance: searchfield
PASS -webkit-appearance: slider-horizontal
-FAIL -webkit-appearance: square-button assert_equals: style.WebkitAppearance (uppercase W) expected "square-button" but got "none"
+PASS -webkit-appearance: square-button
PASS -webkit-appearance: textarea
PASS -webkit-appearance: textfield
FAIL -webkit-appearance: bogus-button (invalid) assert_equals: style.WebkitAppearance (uppercase W) expected (undefined) undefined but got (string) "button"
Modified: trunk/Source/WebCore/ChangeLog (283268 => 283269)
--- trunk/Source/WebCore/ChangeLog 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/ChangeLog 2021-09-29 22:25:07 UTC (rev 283269)
@@ -1,3 +1,168 @@
+2021-09-29 Aditya Keerthi <[email protected]>
+
+ [css-ui] getComputedStyle() must return the specified value for '-webkit-appearance'
+ https://bugs.webkit.org/show_bug.cgi?id=230916
+ rdar://83640938
+
+ Reviewed by Simon Fraser.
+
+ Currently, an element's appearance can be adjusted to "none" depending
+ on the applied CSS properties. For example, buttons that specify a
+ background-color lose their native appearance. The existing behavior is
+ implemented by modifying the appearance field on RenderStyle.
+
+ While the spec allows certain properties to affect appearance, it
+ also asserts that the computed value must be equal to the specific
+ value [1]. However, since the specified and adjusted values are stored
+ in the same field in RenderStyle, the computed value does not always
+ equal the specified value.
+
+ To fix, introduce an effectiveAppearance field to RenderStyle, which
+ stores the used appearance. The specified appearance remains in the
+ appearance field, ensuring the computed value adheres to the spec.
+
+ The new behavior matches Chrome and Firefox. This work is also necessary
+ for WebKit to support 'auto' as a valid appearance value, since the
+ used value will need to be adjusted depending on the element type, but
+ the computed value should remain 'auto'.
+
+ [1] https://www.w3.org/TR/css-ui-4/#appearance-switching
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::boundingBoxForQuads):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::isApplePayButton const):
+ * accessibility/AccessibilitySlider.cpp:
+ (WebCore::AccessibilitySlider::orientation const):
+ * dom/Element.cpp:
+ (WebCore::Element::setActive):
+ (WebCore::Element::setHovered):
+ * editing/FrameSelection.cpp:
+ (WebCore::FrameSelection::focusedOrActiveStateChanged):
+ * html/HTMLFormControlElement.cpp:
+ (WebCore::HTMLFormControlElement::disabledStateChanged):
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::setChecked):
+ (WebCore::HTMLInputElement::setIndeterminate):
+ * html/HTMLMeterElement.cpp:
+ (WebCore::HTMLMeterElement::createElementRenderer):
+ * html/HTMLOptionElement.cpp:
+ (WebCore::HTMLOptionElement::parseAttribute):
+ * html/HTMLProgressElement.cpp:
+ (WebCore::HTMLProgressElement::createElementRenderer):
+ * html/RangeInputType.cpp:
+ (WebCore::RangeInputType::handleKeydownEvent):
+ * html/shadow/ProgressShadowElement.cpp:
+ (WebCore::ProgressShadowElement::rendererIsNeeded):
+ (WebCore::ProgressInnerElement::rendererIsNeeded):
+ * html/shadow/SliderThumbElement.cpp:
+ (WebCore::hasVerticalAppearance):
+ (WebCore::RenderSliderThumb::updateAppearance):
+ (WebCore::SliderThumbElement::resolveCustomStyle):
+ (WebCore::SliderContainerElement::resolveCustomStyle):
+ * html/shadow/TextControlInnerElements.cpp:
+ (WebCore::SearchFieldResultsButtonElement::resolveCustomStyle):
+ * rendering/RenderAttachment.cpp:
+ (WebCore::RenderAttachment::shouldDrawBorder const):
+ (WebCore::RenderAttachment::paintReplaced):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::addVisualOverflowFromTheme):
+ (WebCore::RenderBlock::baselinePosition const):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::determineBackgroundBleedAvoidance const):
+ (WebCore::RenderBox::paintBoxDecorations):
+ (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect const):
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::hasVisibleBoxDecorationStyle const):
+ (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateCustomAppearance):
+ (WebCore::hasVisibleBoxDecorations):
+ * rendering/RenderLayerScrollableArea.cpp:
+ (WebCore::RenderLayerScrollableArea::updateScrollbarsAfterStyleChange):
+ (WebCore::RenderLayerScrollableArea::updateScrollbarsAfterLayout):
+ * rendering/RenderMenuList.cpp:
+ (RenderMenuList::menuStyle const):
+ (RenderMenuList::clientPaddingLeft const):
+ (RenderMenuList::clientPaddingRight const):
+ * rendering/RenderProgress.cpp:
+ (WebCore::RenderProgress::updateAnimationState):
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::adjustStyle):
+
+ Ensure the specified value is not modified by adjusting the
+ effectiveAppearance field instead of the appearance field.
+
+ (WebCore::RenderTheme::adjustSearchFieldDecorationStyle const):
+ (WebCore::RenderTheme::paint):
+ (WebCore::RenderTheme::paintBorderOnly):
+ (WebCore::RenderTheme::paintDecorations):
+ (WebCore::RenderTheme::baselinePosition const):
+ (WebCore::RenderTheme::isControlStyled const):
+ (WebCore::RenderTheme::adjustRepaintRect):
+ (WebCore::RenderTheme::supportsFocusRing const):
+ (WebCore::RenderTheme::isDefault const):
+ (WebCore::RenderTheme::paintSliderTicks):
+ * rendering/RenderThemeAdwaita.cpp:
+ (WebCore::RenderThemeAdwaita::supportsFocusRing const):
+ (WebCore::RenderThemeAdwaita::popupInternalPaddingBox const):
+ (WebCore::RenderThemeAdwaita::paintSliderTrack):
+ (WebCore::RenderThemeAdwaita::adjustSliderThumbSize const):
+ (WebCore::RenderThemeAdwaita::paintSliderThumb):
+ * rendering/RenderThemeIOS.mm:
+ (WebCore::RenderThemeIOS::adjustedPaintRect const):
+ (WebCore::RenderThemeIOS::baselinePosition const):
+ (WebCore::RenderThemeIOS::isControlStyled const):
+ (WebCore::RenderThemeIOS::popupInternalPaddingBox const):
+ (WebCore::RenderThemeIOS::adjustRoundBorderRadius):
+ (WebCore::RenderThemeIOS::paintSliderTrack):
+ (WebCore::RenderThemeIOS::adjustSliderThumbSize const):
+ (WebCore::RenderThemeIOS::adjustButtonStyle const):
+ (WebCore::RenderThemeIOS::supportsBoxShadow const):
+ (WebCore::RenderThemeIOS::paintSliderTicks):
+ (WebCore::RenderThemeIOS::paintSliderTrackWithFormControlRefresh):
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::isControlStyled const):
+ (WebCore::RenderThemeMac::adjustRepaintRect):
+ (WebCore::RenderThemeMac::controlSupportsTints const):
+ (WebCore::RenderThemeMac::meterSizeForBounds const):
+ (WebCore::RenderThemeMac::levelIndicatorFor const):
+ (WebCore::RenderThemeMac::progressBarRectForBounds const):
+ (WebCore::RenderThemeMac::popupInternalPaddingBox const):
+ (WebCore::RenderThemeMac::paintSliderTrack):
+ (WebCore::RenderThemeMac::paintSliderThumb):
+ (WebCore::RenderThemeMac::adjustSliderThumbSize const):
+ * rendering/RenderThemeWin.cpp:
+ (WebCore::RenderThemeWin::supportsFocusRing const):
+ (WebCore::RenderThemeWin::determineClassicState):
+ (WebCore::RenderThemeWin::determineState):
+ (WebCore::RenderThemeWin::determineSliderThumbState):
+ (WebCore::RenderThemeWin::determineButtonState):
+ (WebCore::RenderThemeWin::getClassicThemeData):
+ (WebCore::RenderThemeWin::getThemeData):
+ (WebCore::drawControl):
+ (WebCore::RenderThemeWin::paintSliderTrack):
+ (WebCore::RenderThemeWin::adjustSliderThumbSize const):
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::hashForTextAutosizing const):
+ (WebCore::RenderStyle::equalForTextAutosizing const):
+ (WebCore::rareNonInheritedDataChangeRequiresLayout):
+ * rendering/style/RenderStyle.h:
+ (WebCore::RenderStyle::hasEffectiveAppearance const):
+ (WebCore::RenderStyle::effectiveAppearance const):
+ (WebCore::RenderStyle::setAppearance):
+ (WebCore::RenderStyle::setEffectiveAppearance):
+ * rendering/style/StyleRareNonInheritedData.cpp:
+ (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+ (WebCore::StyleRareNonInheritedData::operator== const):
+ * rendering/style/StyleRareNonInheritedData.h:
+ * style/MatchedDeclarationsCache.cpp:
+ (WebCore::Style::MatchedDeclarationsCache::isCacheable):
+ * style/StyleAdjuster.cpp:
+ (WebCore::Style::Adjuster::adjust const):
+ * style/StyleTreeResolver.cpp:
+ (WebCore::Style::TreeResolver::resolveElement):
+
2021-09-29 Alan Bujtas <[email protected]>
[LFC][IFC] LineBoxBuilder should use the first-line style when applicable
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (283268 => 283269)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -786,7 +786,7 @@
for (const auto& quad : quads) {
FloatRect r = quad.enclosingBoundingBox();
if (!r.isEmpty()) {
- if (obj->style().hasAppearance())
+ if (obj->style().hasEffectiveAppearance())
obj->theme().adjustRepaintRect(*obj, r);
result.unite(r);
}
Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (283268 => 283269)
--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -3848,7 +3848,7 @@
{
if (!m_renderer)
return false;
- return m_renderer->style().appearance() == ApplePayButtonPart;
+ return m_renderer->style().effectiveAppearance() == ApplePayButtonPart;
}
ApplePayButtonType AccessibilityRenderObject::applePayButtonType() const
Modified: trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp (283268 => 283269)
--- trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -66,7 +66,7 @@
const RenderStyle& style = m_renderer->style();
- ControlPart styleAppearance = style.appearance();
+ ControlPart styleAppearance = style.effectiveAppearance();
switch (styleAppearance) {
case SliderThumbHorizontalPart:
case SliderHorizontalPart:
Modified: trunk/Source/WebCore/dom/Element.cpp (283268 => 283269)
--- trunk/Source/WebCore/dom/Element.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/dom/Element.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -709,7 +709,7 @@
return;
bool reactsToPress = false;
- if (renderer()->style().hasAppearance() && renderer()->theme().stateChanged(*renderer(), ControlStates::States::Pressed))
+ if (renderer()->style().hasEffectiveAppearance() && renderer()->theme().stateChanged(*renderer(), ControlStates::States::Pressed))
reactsToPress = true;
// The rest of this function implements a feature that only works if the
@@ -806,7 +806,7 @@
document().userActionElements().setHovered(*this, flag);
}
- if (auto* style = renderStyle(); style && style->hasAppearance())
+ if (auto* style = renderStyle(); style && style->hasEffectiveAppearance())
renderer()->theme().stateChanged(*renderer(), ControlStates::States::Hovered);
}
Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (283268 => 283269)
--- trunk/Source/WebCore/editing/FrameSelection.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -2104,7 +2104,7 @@
if (Element* element = m_document->focusedElement()) {
element->invalidateStyleForSubtree();
if (RenderObject* renderer = element->renderer())
- if (renderer && renderer->style().hasAppearance())
+ if (renderer && renderer->style().hasEffectiveAppearance())
renderer->theme().stateChanged(*renderer, ControlStates::States::Focused);
}
#endif
Modified: trunk/Source/WebCore/html/HTMLFormControlElement.cpp (283268 => 283269)
--- trunk/Source/WebCore/html/HTMLFormControlElement.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -183,7 +183,7 @@
{
updateWillValidateAndValidity();
invalidateStyleForSubtree();
- if (renderer() && renderer()->style().hasAppearance())
+ if (renderer() && renderer()->style().hasEffectiveAppearance())
renderer()->theme().stateChanged(*renderer(), ControlStates::States::Enabled);
}
Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (283268 => 283269)
--- trunk/Source/WebCore/html/HTMLInputElement.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -985,7 +985,7 @@
if (RadioButtonGroups* buttons = radioButtonGroups())
buttons->updateCheckedState(*this);
- if (renderer() && renderer()->style().hasAppearance())
+ if (renderer() && renderer()->style().hasEffectiveAppearance())
renderer()->theme().stateChanged(*renderer(), ControlStates::States::Checked);
updateValidity();
@@ -1009,7 +1009,7 @@
invalidateStyleForSubtree();
- if (renderer() && renderer()->style().hasAppearance())
+ if (renderer() && renderer()->style().hasEffectiveAppearance())
renderer()->theme().stateChanged(*renderer(), ControlStates::States::Checked);
}
Modified: trunk/Source/WebCore/html/HTMLMeterElement.cpp (283268 => 283269)
--- trunk/Source/WebCore/html/HTMLMeterElement.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/html/HTMLMeterElement.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -58,7 +58,7 @@
RenderPtr<RenderElement> HTMLMeterElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
{
- if (!RenderTheme::singleton().supportsMeter(style.appearance(), *this))
+ if (!RenderTheme::singleton().supportsMeter(style.effectiveAppearance(), *this))
return RenderElement::createFor(*this, WTFMove(style));
return createRenderer<RenderMeter>(*this, WTFMove(style));
Modified: trunk/Source/WebCore/html/HTMLOptionElement.cpp (283268 => 283269)
--- trunk/Source/WebCore/html/HTMLOptionElement.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/html/HTMLOptionElement.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -179,7 +179,7 @@
m_disabled = !value.isNull();
if (oldDisabled != m_disabled) {
invalidateStyleForSubtree();
- if (renderer() && renderer()->style().hasAppearance())
+ if (renderer() && renderer()->style().hasEffectiveAppearance())
renderer()->theme().stateChanged(*renderer(), ControlStates::States::Enabled);
}
} else if (name == selectedAttr) {
Modified: trunk/Source/WebCore/html/HTMLProgressElement.cpp (283268 => 283269)
--- trunk/Source/WebCore/html/HTMLProgressElement.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/html/HTMLProgressElement.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -57,7 +57,7 @@
RenderPtr<RenderElement> HTMLProgressElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
{
- if (!style.hasAppearance())
+ if (!style.hasEffectiveAppearance())
return RenderElement::createFor(*this, WTFMove(style));
return createRenderer<RenderProgress>(*this, WTFMove(style));
Modified: trunk/Source/WebCore/html/RangeInputType.cpp (283268 => 283269)
--- trunk/Source/WebCore/html/RangeInputType.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/html/RangeInputType.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -205,7 +205,7 @@
bool isVertical = false;
if (auto* renderer = element()->renderer()) {
- ControlPart part = renderer->style().appearance();
+ ControlPart part = renderer->style().effectiveAppearance();
isVertical = part == SliderVerticalPart || part == MediaVolumeSliderPart;
}
Modified: trunk/Source/WebCore/html/shadow/ProgressShadowElement.cpp (283268 => 283269)
--- trunk/Source/WebCore/html/shadow/ProgressShadowElement.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/html/shadow/ProgressShadowElement.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -55,7 +55,7 @@
bool ProgressShadowElement::rendererIsNeeded(const RenderStyle& style)
{
RenderObject* progressRenderer = progressElement()->renderer();
- return progressRenderer && !progressRenderer->style().hasAppearance() && HTMLDivElement::rendererIsNeeded(style);
+ return progressRenderer && !progressRenderer->style().hasEffectiveAppearance() && HTMLDivElement::rendererIsNeeded(style);
}
ProgressInnerElement::ProgressInnerElement(Document& document)
@@ -71,7 +71,7 @@
bool ProgressInnerElement::rendererIsNeeded(const RenderStyle& style)
{
RenderObject* progressRenderer = progressElement()->renderer();
- return progressRenderer && !progressRenderer->style().hasAppearance() && HTMLDivElement::rendererIsNeeded(style);
+ return progressRenderer && !progressRenderer->style().hasEffectiveAppearance() && HTMLDivElement::rendererIsNeeded(style);
}
ProgressBarElement::ProgressBarElement(Document& document)
Modified: trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp (283268 => 283269)
--- trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -77,11 +77,11 @@
const RenderStyle& sliderStyle = input.renderer()->style();
#if ENABLE(VIDEO)
- if (sliderStyle.appearance() == MediaVolumeSliderPart && input.renderer()->theme().usesVerticalVolumeSlider())
+ if (sliderStyle.effectiveAppearance() == MediaVolumeSliderPart && input.renderer()->theme().usesVerticalVolumeSlider())
return true;
#endif
- return sliderStyle.appearance() == SliderVerticalPart;
+ return sliderStyle.effectiveAppearance() == SliderVerticalPart;
}
// --------------------------------
@@ -93,17 +93,17 @@
void RenderSliderThumb::updateAppearance(const RenderStyle* parentStyle)
{
- if (parentStyle->appearance() == SliderVerticalPart)
- mutableStyle().setAppearance(SliderThumbVerticalPart);
- else if (parentStyle->appearance() == SliderHorizontalPart)
- mutableStyle().setAppearance(SliderThumbHorizontalPart);
- else if (parentStyle->appearance() == MediaSliderPart)
- mutableStyle().setAppearance(MediaSliderThumbPart);
- else if (parentStyle->appearance() == MediaVolumeSliderPart)
- mutableStyle().setAppearance(MediaVolumeSliderThumbPart);
- else if (parentStyle->appearance() == MediaFullScreenVolumeSliderPart)
- mutableStyle().setAppearance(MediaFullScreenVolumeSliderThumbPart);
- if (style().hasAppearance()) {
+ if (parentStyle->effectiveAppearance() == SliderVerticalPart)
+ mutableStyle().setEffectiveAppearance(SliderThumbVerticalPart);
+ else if (parentStyle->effectiveAppearance() == SliderHorizontalPart)
+ mutableStyle().setEffectiveAppearance(SliderThumbHorizontalPart);
+ else if (parentStyle->effectiveAppearance() == MediaSliderPart)
+ mutableStyle().setEffectiveAppearance(MediaSliderThumbPart);
+ else if (parentStyle->effectiveAppearance() == MediaVolumeSliderPart)
+ mutableStyle().setEffectiveAppearance(MediaVolumeSliderThumbPart);
+ else if (parentStyle->effectiveAppearance() == MediaFullScreenVolumeSliderPart)
+ mutableStyle().setEffectiveAppearance(MediaFullScreenVolumeSliderThumbPart);
+ if (style().hasEffectiveAppearance()) {
ASSERT(element());
theme().adjustSliderThumbSize(mutableStyle(), element());
}
@@ -595,7 +595,7 @@
if (!hostStyle)
return std::nullopt;
- switch (hostStyle->appearance()) {
+ switch (hostStyle->effectiveAppearance()) {
case MediaSliderPart:
case MediaSliderThumbPart:
case MediaVolumeSliderPart:
@@ -649,7 +649,7 @@
if (!hostStyle)
return std::nullopt;
- switch (hostStyle->appearance()) {
+ switch (hostStyle->effectiveAppearance()) {
case MediaSliderPart:
case MediaSliderThumbPart:
case MediaVolumeSliderPart:
Modified: trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp (283268 => 283269)
--- trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -245,7 +245,7 @@
if (input && input->maxResults() >= 0)
return std::nullopt;
- if (shadowHostStyle && shadowHostStyle->appearance() != SearchFieldPart) {
+ if (shadowHostStyle && shadowHostStyle->effectiveAppearance() != SearchFieldPart) {
SetForScope<bool> canAdjustStyleForAppearance(m_canAdjustStyleForAppearance, false);
return resolveStyle(&parentStyle);
}
Modified: trunk/Source/WebCore/rendering/RenderAttachment.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderAttachment.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderAttachment.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -79,7 +79,7 @@
bool RenderAttachment::shouldDrawBorder() const
{
- if (style().appearance() == BorderlessAttachmentPart)
+ if (style().effectiveAppearance() == BorderlessAttachmentPart)
return false;
return m_shouldDrawBorder;
}
@@ -86,7 +86,7 @@
void RenderAttachment::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& offset)
{
- if (paintInfo.phase != PaintPhase::Selection || !hasVisibleBoxDecorations() || !style().hasAppearance())
+ if (paintInfo.phase != PaintPhase::Selection || !hasVisibleBoxDecorations() || !style().hasEffectiveAppearance())
return;
auto paintRect = borderBoxRect();
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -754,7 +754,7 @@
void RenderBlock::addVisualOverflowFromTheme()
{
- if (!style().hasAppearance())
+ if (!style().hasEffectiveAppearance())
return;
FloatRect inflatedRect = borderBoxRect();
@@ -2451,7 +2451,7 @@
// FIXME: Might be better to have a custom CSS property instead, so that if the theme
// is turned off, checkboxes/radios will still have decent baselines.
// FIXME: Need to patch form controls to deal with vertical lines.
- if (style().hasAppearance() && !theme().isControlContainer(style().appearance()))
+ if (style().hasEffectiveAppearance() && !theme().isControlContainer(style().effectiveAppearance()))
return theme().baselinePosition(*this);
// CSS2.1 states that the baseline of an inline block is the baseline of the last line box in
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -1503,7 +1503,7 @@
if (borderObscuresBackgroundEdge(contextScaling))
return BackgroundBleedShrinkBackground;
- if (!style.hasAppearance() && borderObscuresBackground() && backgroundHasOpaqueTopLayer())
+ if (!style.hasEffectiveAppearance() && borderObscuresBackground() && backgroundHasOpaqueTopLayer())
return BackgroundBleedBackgroundOverBorder;
return BackgroundBleedUseTransparencyLayer;
@@ -1539,7 +1539,7 @@
// If we have a native theme appearance, paint that before painting our background.
// The theme will tell us whether or not we should also paint the CSS background.
bool borderOrBackgroundPaintingIsNeeded = true;
- if (style().hasAppearance()) {
+ if (style().hasEffectiveAppearance()) {
ControlStates* controlStates = controlStatesForRenderer(*this);
borderOrBackgroundPaintingIsNeeded = theme().paint(*this, *controlStates, paintInfo, paintRect);
if (controlStates->needsRepaint())
@@ -1552,13 +1552,13 @@
paintBackground(paintInfo, paintRect, bleedAvoidance);
- if (style().hasAppearance())
+ if (style().hasEffectiveAppearance())
theme().paintDecorations(*this, paintInfo, paintRect);
}
paintBoxShadow(paintInfo, paintRect, style(), ShadowStyle::Inset);
// The theme will tell us whether or not we should also paint the CSS border.
- if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (borderOrBackgroundPaintingIsNeeded && theme().paintBorderOnly(*this, paintInfo, paintRect))) && style().hasVisibleBorderDecoration())
+ if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasEffectiveAppearance() || (borderOrBackgroundPaintingIsNeeded && theme().paintBorderOnly(*this, paintInfo, paintRect))) && style().hasVisibleBorderDecoration())
paintBorder(paintInfo, paintRect, style(), bleedAvoidance);
if (bleedAvoidance == BackgroundBleedUseTransparencyLayer)
@@ -1633,7 +1633,7 @@
// We cannot be sure if theme paints the background opaque.
// In this case it is safe to not assume opaqueness.
// FIXME: May be ask theme if it paints opaque.
- if (style().hasAppearance())
+ if (style().hasEffectiveAppearance())
return false;
// FIXME: Check the opaqueness of background images.
Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -193,7 +193,7 @@
bool RenderBoxModelObject::hasVisibleBoxDecorationStyle() const
{
- return hasBackground() || style().hasVisibleBorderDecoration() || style().hasAppearance() || style().boxShadow();
+ return hasBackground() || style().hasVisibleBorderDecoration() || style().hasEffectiveAppearance() || style().boxShadow();
}
void RenderBoxModelObject::updateFromStyle()
@@ -2331,7 +2331,7 @@
if (bleedAvoidance != BackgroundBleedNone)
return false;
- if (style().hasAppearance())
+ if (style().hasEffectiveAppearance())
return false;
bool hasOneNormalBoxShadow = false;
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -771,7 +771,7 @@
void RenderLayerBacking::updateCustomAppearance(const RenderStyle& style)
{
- ControlPart appearance = style.appearance();
+ ControlPart appearance = style.effectiveAppearance();
if (appearance == MediaControlsLightBarBackgroundPart)
m_graphicsLayer->setCustomAppearance(GraphicsLayer::CustomAppearance::LightBackdrop);
else if (appearance == MediaControlsDarkBarBackgroundPart)
@@ -2468,7 +2468,7 @@
// FIXME: Code is duplicated in RenderLayer. Also, we should probably not consider filters a box decoration here.
static inline bool hasVisibleBoxDecorations(const RenderStyle& style)
{
- return style.hasVisibleBorder() || style.hasBorderRadius() || style.hasOutline() || style.hasAppearance() || style.boxShadow() || style.hasFilter();
+ return style.hasVisibleBorder() || style.hasBorderRadius() || style.hasOutline() || style.hasEffectiveAppearance() || style.boxShadow() || style.hasFilter();
}
static bool canDirectlyCompositeBackgroundBackgroundImage(const RenderStyle& style)
Modified: trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -1118,7 +1118,7 @@
return;
// List box parts handle the scrollbars by themselves so we have nothing to do.
- if (box->style().appearance() == ListboxPart)
+ if (box->style().effectiveAppearance() == ListboxPart)
return;
bool hadVerticalScrollbar = hasVerticalScrollbar();
@@ -1138,7 +1138,7 @@
ASSERT(box);
// List box parts handle the scrollbars by themselves so we have nothing to do.
- if (box->style().appearance() == ListboxPart)
+ if (box->style().effectiveAppearance() == ListboxPart)
return;
bool hadHorizontalScrollbar = hasHorizontalScrollbar();
Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderMenuList.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -540,7 +540,7 @@
IntRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
return PopupMenuStyle(styleToUse.visitedDependentColorWithColorFilter(CSSPropertyColor), styleToUse.visitedDependentColorWithColorFilter(CSSPropertyBackgroundColor),
styleToUse.fontCascade(), styleToUse.visibility() == Visibility::Visible, styleToUse.display() == DisplayType::None,
- style().hasAppearance() && style().appearance() == MenulistPart, styleToUse.textIndent(),
+ style().hasEffectiveAppearance() && style().effectiveAppearance() == MenulistPart, styleToUse.textIndent(),
style().direction(), isOverride(style().unicodeBidi()), PopupMenuStyle::DefaultBackgroundColor,
PopupMenuStyle::SelectPopup, theme().popupMenuSize(styleToUse, absBounds));
}
@@ -572,7 +572,7 @@
LayoutUnit RenderMenuList::clientPaddingLeft() const
{
- if ((style().appearance() == MenulistPart || style().appearance() == MenulistButtonPart) && style().direction() == TextDirection::RTL) {
+ if ((style().effectiveAppearance() == MenulistPart || style().effectiveAppearance() == MenulistButtonPart) && style().direction() == TextDirection::RTL) {
// For these appearance values, the theme applies padding to leave room for the
// drop-down button. But leaving room for the button inside the popup menu itself
// looks strange, so we return a small default padding to avoid having a large empty
@@ -586,7 +586,7 @@
LayoutUnit RenderMenuList::clientPaddingRight() const
{
- if ((style().appearance() == MenulistPart || style().appearance() == MenulistButtonPart) && style().direction() == TextDirection::LTR)
+ if ((style().effectiveAppearance() == MenulistPart || style().effectiveAppearance() == MenulistButtonPart) && style().direction() == TextDirection::LTR)
return endOfLinePadding;
return paddingRight() + m_innerBlock->paddingRight();
Modified: trunk/Source/WebCore/rendering/RenderProgress.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderProgress.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderProgress.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -91,7 +91,7 @@
m_animationDuration = theme().animationDurationForProgressBar(*this);
m_animationRepeatInterval = theme().animationRepeatIntervalForProgressBar(*this);
- bool animating = style().hasAppearance() && m_animationRepeatInterval > 0_s && !isDeterminate();
+ bool animating = style().hasEffectiveAppearance() && m_animationRepeatInterval > 0_s && !isDeterminate();
if (animating == m_animating)
return;
Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderTheme.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -90,16 +90,16 @@
if (userAgentAppearanceStyle && isControlStyled(style, *userAgentAppearanceStyle)) {
switch (part) {
case MenulistPart:
- style.setAppearance(MenulistButtonPart);
+ style.setEffectiveAppearance(MenulistButtonPart);
part = MenulistButtonPart;
break;
default:
- style.setAppearance(NoControlPart);
+ style.setEffectiveAppearance(NoControlPart);
break;
}
}
- if (!style.hasAppearance())
+ if (!style.hasEffectiveAppearance())
return;
if (!supportsBoxShadow(style))
@@ -191,7 +191,7 @@
#endif
// Call the appropriate style adjustment method based off the appearance value.
- switch (style.appearance()) {
+ switch (style.effectiveAppearance()) {
#if !USE(NEW_THEME)
case CheckboxPart:
return adjustCheckboxStyle(style, element);
@@ -273,11 +273,11 @@
void RenderTheme::adjustSearchFieldDecorationStyle(RenderStyle& style, const Element* element) const
{
if (is<SearchFieldResultsButtonElement>(element) && !downcast<SearchFieldResultsButtonElement>(*element).canAdjustStyleForAppearance()) {
- style.setAppearance(NoControlPart);
+ style.setEffectiveAppearance(NoControlPart);
return;
}
- switch (style.appearance()) {
+ switch (style.effectiveAppearance()) {
case SearchFieldDecorationPart:
return adjustSearchFieldDecorationPartStyle(style, element);
case SearchFieldResultsDecorationPart:
@@ -305,7 +305,7 @@
if (UNLIKELY(!canPaint(paintInfo, box.settings())))
return false;
- ControlPart part = box.style().appearance();
+ ControlPart part = box.style().effectiveAppearance();
IntRect integralSnappedRect = snappedIntRect(rect);
float deviceScaleFactor = box.document().deviceScaleFactor();
FloatRect devicePixelSnappedRect = snapRectToDevicePixels(rect, deviceScaleFactor);
@@ -450,11 +450,11 @@
#if PLATFORM(IOS_FAMILY)
UNUSED_PARAM(rect);
- return box.style().appearance() != NoControlPart;
+ return box.style().effectiveAppearance() != NoControlPart;
#else
FloatRect devicePixelSnappedRect = snapRectToDevicePixels(rect, box.document().deviceScaleFactor());
// Call the appropriate paint method based off the appearance value.
- switch (box.style().appearance()) {
+ switch (box.style().effectiveAppearance()) {
case TextFieldPart:
return paintTextField(box, paintInfo, devicePixelSnappedRect);
case ListboxPart:
@@ -507,7 +507,7 @@
FloatRect devicePixelSnappedRect = snapRectToDevicePixels(rect, box.document().deviceScaleFactor());
// Call the appropriate paint method based off the appearance value.
- switch (box.style().appearance()) {
+ switch (box.style().effectiveAppearance()) {
case MenulistButtonPart:
paintMenuListButtonDecorations(box, paintInfo, devicePixelSnappedRect);
break;
@@ -720,7 +720,7 @@
int RenderTheme::baselinePosition(const RenderBox& box) const
{
#if USE(NEW_THEME)
- return box.height() + box.marginTop() + Theme::singleton().baselinePositionAdjustment(box.style().appearance()) * box.style().effectiveZoom();
+ return box.height() + box.marginTop() + Theme::singleton().baselinePositionAdjustment(box.style().effectiveAppearance()) * box.style().effectiveZoom();
#else
return box.height() + box.marginTop();
#endif
@@ -735,7 +735,7 @@
bool RenderTheme::isControlStyled(const RenderStyle& style, const RenderStyle& userAgentStyle) const
{
- switch (style.appearance()) {
+ switch (style.effectiveAppearance()) {
case PushButtonPart:
case SquareButtonPart:
#if ENABLE(INPUT_TYPE_COLOR)
@@ -767,7 +767,7 @@
{
#if USE(NEW_THEME)
ControlStates states(extractControlStatesForRenderer(renderer));
- Theme::singleton().inflateControlPaintRect(renderer.style().appearance(), states, rect, renderer.style().effectiveZoom());
+ Theme::singleton().inflateControlPaintRect(renderer.style().effectiveAppearance(), states, rect, renderer.style().effectiveZoom());
#else
UNUSED_PARAM(renderer);
UNUSED_PARAM(rect);
@@ -776,7 +776,7 @@
bool RenderTheme::supportsFocusRing(const RenderStyle& style) const
{
- return (style.hasAppearance() && style.appearance() != TextFieldPart && style.appearance() != TextAreaPart && style.appearance() != MenulistButtonPart && style.appearance() != ListboxPart);
+ return (style.hasEffectiveAppearance() && style.effectiveAppearance() != TextFieldPart && style.effectiveAppearance() != TextAreaPart && style.effectiveAppearance() != MenulistButtonPart && style.effectiveAppearance() != ListboxPart);
}
bool RenderTheme::stateChanged(const RenderObject& o, ControlStates::States state) const
@@ -924,7 +924,7 @@
if (!isActive(o))
return false;
- return o.style().appearance() == DefaultButtonPart;
+ return o.style().effectiveAppearance() == DefaultButtonPart;
}
#if !USE(NEW_THEME)
@@ -1089,7 +1089,7 @@
double min = input.minimum();
double max = input.maximum();
- ControlPart part = o.style().appearance();
+ ControlPart part = o.style().effectiveAppearance();
// We don't support ticks on alternate sliders like MediaVolumeSliders.
if (part != SliderHorizontalPart && part != SliderVerticalPart)
return;
Modified: trunk/Source/WebCore/rendering/RenderThemeAdwaita.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderThemeAdwaita.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderThemeAdwaita.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -111,7 +111,7 @@
bool RenderThemeAdwaita::supportsFocusRing(const RenderStyle& style) const
{
- switch (style.appearance()) {
+ switch (style.effectiveAppearance()) {
case PushButtonPart:
case ButtonPart:
case TextFieldPart:
@@ -360,7 +360,7 @@
LengthBox RenderThemeAdwaita::popupInternalPaddingBox(const RenderStyle& style, const Settings&) const
{
- if (style.appearance() == NoControlPart)
+ if (style.effectiveAppearance() == NoControlPart)
return { };
int leftPadding = menuListButtonPadding + (style.direction() == TextDirection::RTL ? menuListButtonArrowSize : 0);
@@ -498,7 +498,7 @@
auto& graphicsContext = paintInfo.context();
GraphicsContextStateSaver stateSaver(graphicsContext);
- ControlPart part = renderObject.style().appearance();
+ ControlPart part = renderObject.style().effectiveAppearance();
ASSERT(part == SliderHorizontalPart || part == SliderVerticalPart);
FloatRect fieldRect = rect;
@@ -581,7 +581,7 @@
void RenderThemeAdwaita::adjustSliderThumbSize(RenderStyle& style, const Element*) const
{
- ControlPart part = style.appearance();
+ ControlPart part = style.effectiveAppearance();
if (part != SliderThumbHorizontalPart && part != SliderThumbVerticalPart)
return;
@@ -594,7 +594,7 @@
auto& graphicsContext = paintInfo.context();
GraphicsContextStateSaver stateSaver(graphicsContext);
- ASSERT(renderObject.style().appearance() == SliderThumbHorizontalPart || renderObject.style().appearance() == SliderThumbVerticalPart);
+ ASSERT(renderObject.style().effectiveAppearance() == SliderThumbHorizontalPart || renderObject.style().effectiveAppearance() == SliderThumbVerticalPart);
SRGBA<uint8_t> sliderThumbBackgroundColor;
SRGBA<uint8_t> sliderThumbBackgroundHoveredColor;
Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2021-09-29 22:25:07 UTC (rev 283269)
@@ -446,7 +446,7 @@
LayoutRect RenderThemeIOS::adjustedPaintRect(const RenderBox& box, const LayoutRect& paintRect) const
{
// Workaround for <rdar://problem/6209763>. Force the painting bounds of checkboxes and radio controls to be square.
- if (box.style().appearance() == CheckboxPart || box.style().appearance() == RadioPart) {
+ if (box.style().effectiveAppearance() == CheckboxPart || box.style().effectiveAppearance() == RadioPart) {
float width = std::min(paintRect.width(), paintRect.height());
float height = width;
return enclosingLayoutRect(FloatRect(paintRect.x(), paintRect.y() + (box.height() - height) / 2, width, height)); // Vertically center the checkbox, like on desktop
@@ -457,9 +457,9 @@
int RenderThemeIOS::baselinePosition(const RenderBox& box) const
{
- if (box.style().appearance() == CheckboxPart || box.style().appearance() == RadioPart)
+ if (box.style().effectiveAppearance() == CheckboxPart || box.style().effectiveAppearance() == RadioPart)
return box.marginTop() + box.height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit.
- if (box.style().appearance() == MenulistPart)
+ if (box.style().effectiveAppearance() == MenulistPart)
return box.marginTop() + box.height() - 5; // This is to match AppKit. There might be a better way to calculate this though.
return RenderTheme::baselinePosition(box);
}
@@ -467,10 +467,10 @@
bool RenderThemeIOS::isControlStyled(const RenderStyle& style, const RenderStyle& userAgentStyle) const
{
// Buttons and MenulistButtons are styled if they contain a background image.
- if (style.appearance() == PushButtonPart || style.appearance() == MenulistButtonPart)
+ if (style.effectiveAppearance() == PushButtonPart || style.effectiveAppearance() == MenulistButtonPart)
return !style.visitedDependentColor(CSSPropertyBackgroundColor).isVisible() || style.backgroundLayers().hasImage();
- if (style.appearance() == TextFieldPart || style.appearance() == TextAreaPart)
+ if (style.effectiveAppearance() == TextFieldPart || style.effectiveAppearance() == TextAreaPart)
return style.backgroundLayers() != userAgentStyle.backgroundLayers();
return RenderTheme::isControlStyled(style, userAgentStyle);
@@ -595,7 +595,7 @@
padding = emSize->computeLength<float>(CSSToLengthConversionData(&style, nullptr, nullptr, nullptr, 1.0, std::nullopt));
}
- if (style.appearance() == MenulistButtonPart) {
+ if (style.effectiveAppearance() == MenulistButtonPart) {
if (style.direction() == TextDirection::RTL)
return { 0, 0, 0, static_cast<int>(padding + style.borderTopWidth()) };
return { 0, static_cast<int>(padding + style.borderTopWidth()), 0, 0 };
@@ -624,7 +624,7 @@
void RenderThemeIOS::adjustRoundBorderRadius(RenderStyle& style, RenderBox& box)
{
- if (!canAdjustBorderRadiusForAppearance(style.appearance(), box) || style.backgroundLayers().hasImage())
+ if (!canAdjustBorderRadiusForAppearance(style.effectiveAppearance(), box) || style.backgroundLayers().hasImage())
return;
if ((is<RenderButton>(box) || is<RenderMenuList>(box)) && box.height() >= largeButtonSize) {
@@ -876,7 +876,7 @@
auto& style = box.style();
bool isHorizontal = true;
- switch (style.appearance()) {
+ switch (style.effectiveAppearance()) {
case SliderHorizontalPart:
isHorizontal = true;
// Inset slightly so the thumb covers the edge.
@@ -950,7 +950,7 @@
void RenderThemeIOS::adjustSliderThumbSize(RenderStyle& style, const Element*) const
{
- if (style.appearance() != SliderThumbHorizontalPart && style.appearance() != SliderThumbVerticalPart)
+ if (style.effectiveAppearance() != SliderThumbHorizontalPart && style.effectiveAppearance() != SliderThumbVerticalPart)
return;
// Enforce "border-radius: 50%".
@@ -1132,7 +1132,7 @@
style.setMinHeight(Length(ControlBaseHeight / ControlBaseFontSize * style.fontDescription().computedSize(), LengthType::Fixed));
#if ENABLE(INPUT_TYPE_COLOR)
- if (style.appearance() == ColorWellPart)
+ if (style.effectiveAppearance() == ColorWellPart)
return;
#endif
@@ -1288,7 +1288,7 @@
bool RenderThemeIOS::supportsBoxShadow(const RenderStyle& style) const
{
// FIXME: See if additional native controls can support box shadows.
- switch (style.appearance()) {
+ switch (style.effectiveAppearance()) {
case SliderThumbHorizontalPart:
case SliderThumbVerticalPart:
return true;
@@ -2370,7 +2370,7 @@
FloatRect tickRect;
FloatRoundedRect::Radii tickCornerRadii(tickCornerRadius);
- bool isHorizontal = box.style().appearance() == SliderHorizontalPart;
+ bool isHorizontal = box.style().effectiveAppearance() == SliderHorizontalPart;
if (isHorizontal) {
tickRect.setWidth(tickWidth);
tickRect.setHeight(tickHeight);
@@ -2417,7 +2417,7 @@
bool isHorizontal = true;
FloatRect trackClip = rect;
- switch (box.style().appearance()) {
+ switch (box.style().effectiveAppearance()) {
case SliderHorizontalPart:
// Inset slightly so the thumb covers the edge.
if (trackClip.width() > 2) {
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm 2021-09-29 22:25:07 UTC (rev 283269)
@@ -749,7 +749,7 @@
bool RenderThemeMac::isControlStyled(const RenderStyle& style, const RenderStyle& userAgentStyle) const
{
- auto appearance = style.appearance();
+ auto appearance = style.effectiveAppearance();
if (appearance == TextFieldPart || appearance == TextAreaPart || appearance == SearchFieldPart || appearance == ListboxPart)
return style.border() != userAgentStyle.border();
@@ -783,7 +783,7 @@
void RenderThemeMac::adjustRepaintRect(const RenderObject& renderer, FloatRect& rect)
{
- ControlPart part = renderer.style().appearance();
+ ControlPart part = renderer.style().effectiveAppearance();
#if USE(NEW_THEME)
switch (part) {
@@ -875,7 +875,7 @@
return false;
// Checkboxes only have tint when checked.
- if (o.style().appearance() == CheckboxPart)
+ if (o.style().effectiveAppearance() == CheckboxPart)
return isChecked(o);
// For now assume other controls have tint if enabled.
@@ -1154,7 +1154,7 @@
IntSize RenderThemeMac::meterSizeForBounds(const RenderMeter& renderMeter, const IntRect& bounds) const
{
- if (NoControlPart == renderMeter.style().appearance())
+ if (NoControlPart == renderMeter.style().effectiveAppearance())
return bounds.size();
NSLevelIndicatorCell* cell = levelIndicatorFor(renderMeter);
@@ -1213,7 +1213,7 @@
NSLevelIndicatorCell* RenderThemeMac::levelIndicatorFor(const RenderMeter& renderMeter) const
{
const RenderStyle& style = renderMeter.style();
- ASSERT(style.appearance() != NoControlPart);
+ ASSERT(style.effectiveAppearance() != NoControlPart);
if (!m_levelIndicator)
m_levelIndicator = adoptNS([[NSLevelIndicatorCell alloc] initWithLevelIndicatorStyle:NSLevelIndicatorStyleContinuousCapacity]);
@@ -1242,7 +1242,7 @@
break;
}
- [cell setLevelIndicatorStyle:levelIndicatorStyleFor(style.appearance())];
+ [cell setLevelIndicatorStyle:levelIndicatorStyleFor(style.effectiveAppearance())];
[cell setUserInterfaceLayoutDirection:style.isLeftToRightDirection() ? NSUserInterfaceLayoutDirectionLeftToRight : NSUserInterfaceLayoutDirectionRightToLeft];
[cell setMinValue:element->min()];
[cell setMaxValue:element->max()];
@@ -1274,7 +1274,7 @@
// Workaround until <rdar://problem/15855086> is fixed.
int maxDimension = static_cast<int>(std::numeric_limits<ushort>::max());
IntRect progressBarBounds(bounds.x(), bounds.y(), std::min(bounds.width(), maxDimension), std::min(bounds.height(), maxDimension));
- if (NoControlPart == renderObject.style().appearance())
+ if (NoControlPart == renderObject.style().effectiveAppearance())
return progressBarBounds;
float zoomLevel = renderObject.style().effectiveZoom();
@@ -1589,7 +1589,7 @@
LengthBox RenderThemeMac::popupInternalPaddingBox(const RenderStyle& style, const Settings&) const
{
- if (style.appearance() == MenulistPart) {
+ if (style.effectiveAppearance() == MenulistPart) {
const int* padding = popupButtonPadding(controlSizeForFont(style), style.direction() == TextDirection::RTL);
return { static_cast<int>(padding[topPadding] * style.effectiveZoom()),
static_cast<int>(padding[rightPadding] * style.effectiveZoom()),
@@ -1597,7 +1597,7 @@
static_cast<int>(padding[leftPadding] * style.effectiveZoom()) };
}
- if (style.appearance() == MenulistButtonPart) {
+ if (style.effectiveAppearance() == MenulistButtonPart) {
float arrowWidth = baseArrowWidth * (style.computedFontPixelSize() / baseFontSize);
float rightPadding = ceilf(arrowWidth + (arrowPaddingBefore + arrowPaddingAfter + paddingBeforeSeparator) * style.effectiveZoom());
float leftPadding = styledPopupPaddingLeft * style.effectiveZoom();
@@ -1694,10 +1694,10 @@
float zoomLevel = o.style().effectiveZoom();
float zoomedTrackWidth = trackWidth * zoomLevel;
- if (o.style().appearance() == SliderHorizontalPart || o.style().appearance() == MediaSliderPart) {
+ if (o.style().effectiveAppearance() == SliderHorizontalPart || o.style().effectiveAppearance() == MediaSliderPart) {
bounds.setHeight(zoomedTrackWidth);
bounds.setY(r.y() + r.height() / 2 - zoomedTrackWidth / 2);
- } else if (o.style().appearance() == SliderVerticalPart) {
+ } else if (o.style().effectiveAppearance() == SliderVerticalPart) {
bounds.setWidth(zoomedTrackWidth);
bounds.setX(r.x() + r.width() / 2 - zoomedTrackWidth / 2);
}
@@ -1716,7 +1716,7 @@
struct CGFunctionCallbacks mainCallbacks = { 0, TrackGradientInterpolate, NULL };
RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks));
RetainPtr<CGShadingRef> mainShading;
- if (o.style().appearance() == SliderVerticalPart)
+ if (o.style().effectiveAppearance() == SliderVerticalPart)
mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.x(), bounds.maxY()), CGPointMake(bounds.maxX(), bounds.maxY()), mainFunction.get(), false, false));
else
mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.x(), bounds.y()), CGPointMake(bounds.x(), bounds.maxY()), mainFunction.get(), false, false));
@@ -1739,7 +1739,7 @@
bool RenderThemeMac::paintSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
{
- NSSliderCell* sliderThumbCell = o.style().appearance() == SliderThumbVerticalPart
+ NSSliderCell* sliderThumbCell = o.style().effectiveAppearance() == SliderThumbVerticalPart
? sliderThumbVertical()
: sliderThumbHorizontal();
@@ -1754,7 +1754,7 @@
// Update the pressed state using the NSCell tracking methods, since that's how NSSliderCell keeps track of it.
bool oldPressed;
- if (o.style().appearance() == SliderThumbVerticalPart)
+ if (o.style().effectiveAppearance() == SliderThumbVerticalPart)
oldPressed = m_isSliderThumbVerticalPressed;
else
oldPressed = m_isSliderThumbHorizontalPressed;
@@ -1761,7 +1761,7 @@
bool pressed = isPressed(o);
- if (o.style().appearance() == SliderThumbVerticalPart)
+ if (o.style().effectiveAppearance() == SliderThumbVerticalPart)
m_isSliderThumbVerticalPressed = pressed;
else
m_isSliderThumbHorizontalPressed = pressed;
@@ -1777,7 +1777,7 @@
FloatRect bounds = r;
// Make the height of the vertical slider slightly larger so NSSliderCell will draw a vertical slider.
- if (o.style().appearance() == SliderThumbVerticalPart)
+ if (o.style().effectiveAppearance() == SliderThumbVerticalPart)
bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o.style().effectiveZoom());
GraphicsContextStateSaver stateSaver(paintInfo.context());
@@ -2114,7 +2114,7 @@
void RenderThemeMac::adjustSliderThumbSize(RenderStyle& style, const Element*) const
{
float zoomLevel = style.effectiveZoom();
- if (style.appearance() == SliderThumbHorizontalPart || style.appearance() == SliderThumbVerticalPart) {
+ if (style.effectiveAppearance() == SliderThumbHorizontalPart || style.effectiveAppearance() == SliderThumbVerticalPart) {
style.setWidth(Length(static_cast<int>(sliderThumbThickness * zoomLevel), LengthType::Fixed));
style.setHeight(Length(static_cast<int>(sliderThumbThickness * zoomLevel), LengthType::Fixed));
}
Modified: trunk/Source/WebCore/rendering/RenderThemeWin.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/RenderThemeWin.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -379,13 +379,13 @@
bool RenderThemeWin::supportsFocusRing(const RenderStyle& style) const
{
- return supportsFocus(style.appearance());
+ return supportsFocus(style.effectiveAppearance());
}
unsigned RenderThemeWin::determineClassicState(const RenderObject& o, ControlSubPart subPart)
{
unsigned state = 0;
- switch (o.style().appearance()) {
+ switch (o.style().effectiveAppearance()) {
case PushButtonPart:
case ButtonPart:
case DefaultButtonPart:
@@ -397,7 +397,7 @@
break;
case RadioPart:
case CheckboxPart:
- state = (o.style().appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;
+ state = (o.style().effectiveAppearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;
if (isChecked(o))
state |= DFCS_CHECKED;
if (!isEnabled(o))
@@ -432,7 +432,7 @@
unsigned RenderThemeWin::determineState(const RenderObject& o)
{
unsigned result = TS_NORMAL;
- ControlPart appearance = o.style().appearance();
+ ControlPart appearance = o.style().effectiveAppearance();
if (!isEnabled(o))
result = TS_DISABLED;
else if (isReadOnlyControl(o) && (TextFieldPart == appearance || TextAreaPart == appearance || SearchFieldPart == appearance))
@@ -455,7 +455,7 @@
unsigned result = TUS_NORMAL;
if (!isEnabled(o))
result = TUS_DISABLED;
- else if (supportsFocus(o.style().appearance()) && isFocused(o))
+ else if (supportsFocus(o.style().effectiveAppearance()) && isFocused(o))
result = TUS_FOCUSED;
else if (isPressed(o))
result = TUS_PRESSED;
@@ -471,7 +471,7 @@
result = PBS_DISABLED;
else if (isPressed(o))
result = PBS_PRESSED;
- else if (supportsFocus(o.style().appearance()) && isFocused(o))
+ else if (supportsFocus(o.style().effectiveAppearance()) && isFocused(o))
result = PBS_DEFAULTED;
else if (isHovered(o))
result = PBS_HOT;
@@ -496,7 +496,7 @@
ThemeData RenderThemeWin::getClassicThemeData(const RenderObject& o, ControlSubPart subPart)
{
ThemeData result;
- switch (o.style().appearance()) {
+ switch (o.style().effectiveAppearance()) {
case PushButtonPart:
case ButtonPart:
case DefaultButtonPart:
@@ -551,7 +551,7 @@
return getClassicThemeData(o, subPart);
ThemeData result;
- switch (o.style().appearance()) {
+ switch (o.style().effectiveAppearance()) {
case PushButtonPart:
case ButtonPart:
case DefaultButtonPart:
@@ -633,8 +633,8 @@
} else if (themeData.m_part == TKP_TRACK || themeData.m_part == TKP_TRACKVERT) {
::DrawEdge(hdc, &widgetRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
::FillRect(hdc, &widgetRect, (HBRUSH)GetStockObject(GRAY_BRUSH));
- } else if ((o.style().appearance() == SliderThumbHorizontalPart
- || o.style().appearance() == SliderThumbVerticalPart)
+ } else if ((o.style().effectiveAppearance() == SliderThumbHorizontalPart
+ || o.style().effectiveAppearance() == SliderThumbVerticalPart)
&& (themeData.m_part == TKP_THUMBBOTTOM || themeData.m_part == TKP_THUMBTOP
|| themeData.m_part == TKP_THUMBLEFT || themeData.m_part == TKP_THUMBRIGHT)) {
::DrawEdge(hdc, &widgetRect, EDGE_RAISED, BF_RECT | BF_SOFT | BF_MIDDLE | BF_ADJUST);
@@ -658,7 +658,7 @@
}
} else {
// Push buttons, buttons, checkboxes and radios, and the dropdown arrow in menulists.
- if (o.style().appearance() == DefaultButtonPart) {
+ if (o.style().effectiveAppearance() == DefaultButtonPart) {
HBRUSH brush = ::GetSysColorBrush(COLOR_3DDKSHADOW);
::FrameRect(hdc, &widgetRect, brush);
::InflateRect(&widgetRect, -1, -1);
@@ -810,10 +810,10 @@
{
IntRect bounds = r;
- if (o.style().appearance() == SliderHorizontalPart) {
+ if (o.style().effectiveAppearance() == SliderHorizontalPart) {
bounds.setHeight(trackWidth);
bounds.setY(r.y() + r.height() / 2 - trackWidth / 2);
- } else if (o.style().appearance() == SliderVerticalPart) {
+ } else if (o.style().effectiveAppearance() == SliderVerticalPart) {
bounds.setWidth(trackWidth);
bounds.setX(r.x() + r.width() / 2 - trackWidth / 2);
}
@@ -833,7 +833,7 @@
void RenderThemeWin::adjustSliderThumbSize(RenderStyle& style, const Element*) const
{
- ControlPart part = style.appearance();
+ ControlPart part = style.effectiveAppearance();
if (part == SliderThumbVerticalPart) {
style.setWidth(Length(sliderThumbHeight, LengthType::Fixed));
style.setHeight(Length(sliderThumbWidth, LengthType::Fixed));
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -457,7 +457,7 @@
unsigned RenderStyle::hashForTextAutosizing() const
{
// FIXME: Not a very smart hash. Could be improved upon. See <https://bugs.webkit.org/show_bug.cgi?id=121131>.
- unsigned hash = m_rareNonInheritedData->appearance;
+ unsigned hash = m_rareNonInheritedData->effectiveAppearance;
hash ^= m_rareNonInheritedData->marginBeforeCollapse;
hash ^= m_rareNonInheritedData->marginAfterCollapse;
hash ^= m_rareNonInheritedData->lineClamp.value();
@@ -479,7 +479,7 @@
bool RenderStyle::equalForTextAutosizing(const RenderStyle& other) const
{
- return m_rareNonInheritedData->appearance == other.m_rareNonInheritedData->appearance
+ return m_rareNonInheritedData->effectiveAppearance == other.m_rareNonInheritedData->effectiveAppearance
&& m_rareNonInheritedData->marginBeforeCollapse == other.m_rareNonInheritedData->marginBeforeCollapse
&& m_rareNonInheritedData->marginAfterCollapse == other.m_rareNonInheritedData->marginAfterCollapse
&& m_rareNonInheritedData->lineClamp == other.m_rareNonInheritedData->lineClamp
@@ -650,7 +650,7 @@
{
ASSERT(&first != &second);
- if (first.appearance != second.appearance
+ if (first.effectiveAppearance != second.effectiveAppearance
|| first.marginBeforeCollapse != second.marginBeforeCollapse
|| first.marginAfterCollapse != second.marginAfterCollapse
|| first.lineClamp != second.lineClamp
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (283268 => 283269)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2021-09-29 22:25:07 UTC (rev 283269)
@@ -215,6 +215,7 @@
bool hasEntirelyFixedBackground() const;
bool hasAppearance() const { return appearance() != NoControlPart; }
+ bool hasEffectiveAppearance() const { return effectiveAppearance() != NoControlPart; }
bool hasBackground() const;
@@ -509,6 +510,7 @@
float opacity() const { return m_rareNonInheritedData->opacity; }
bool hasOpacity() const { return m_rareNonInheritedData->opacity < 1; }
ControlPart appearance() const { return static_cast<ControlPart>(m_rareNonInheritedData->appearance); }
+ ControlPart effectiveAppearance() const { return static_cast<ControlPart>(m_rareNonInheritedData->effectiveAppearance); }
AspectRatioType aspectRatioType() const { return static_cast<AspectRatioType>(m_rareNonInheritedData->aspectRatioType); }
double aspectRatioWidth() const { return m_rareNonInheritedData->aspectRatioWidth; }
double aspectRatioHeight() const { return m_rareNonInheritedData->aspectRatioHeight; }
@@ -1131,7 +1133,8 @@
void setCaretColor(const Color& c) { SET_VAR(m_rareInheritedData, caretColor, c); SET_VAR(m_rareInheritedData, hasAutoCaretColor, false); }
void setHasAutoCaretColor() { SET_VAR(m_rareInheritedData, hasAutoCaretColor, true); SET_VAR(m_rareInheritedData, caretColor, currentColor()); }
void setOpacity(float f) { float v = clampTo<float>(f, 0.f, 1.f); SET_VAR(m_rareNonInheritedData, opacity, v); }
- void setAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, appearance, a); }
+ void setAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, appearance, a); SET_VAR(m_rareNonInheritedData, effectiveAppearance, a); }
+ void setEffectiveAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, effectiveAppearance, a); }
// For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/#alignment
void setBoxAlign(BoxAlignment a) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, align, static_cast<unsigned>(a)); }
void setBoxDirection(BoxDirection d) { m_inheritedFlags.boxDirection = static_cast<unsigned>(d); }
Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (283268 => 283269)
--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -92,6 +92,7 @@
, marginBeforeCollapse(static_cast<unsigned>(MarginCollapse::Collapse))
, marginAfterCollapse(static_cast<unsigned>(MarginCollapse::Collapse))
, appearance(static_cast<unsigned>(RenderStyle::initialAppearance()))
+ , effectiveAppearance(static_cast<unsigned>(RenderStyle::initialAppearance()))
, borderFit(static_cast<unsigned>(RenderStyle::initialBorderFit()))
, textCombine(static_cast<unsigned>(RenderStyle::initialTextCombine()))
, textDecorationStyle(static_cast<unsigned>(RenderStyle::initialTextDecorationStyle()))
@@ -192,6 +193,7 @@
, marginBeforeCollapse(o.marginBeforeCollapse)
, marginAfterCollapse(o.marginAfterCollapse)
, appearance(o.appearance)
+ , effectiveAppearance(o.effectiveAppearance)
, borderFit(o.borderFit)
, textCombine(o.textCombine)
, textDecorationStyle(o.textDecorationStyle)
@@ -296,6 +298,7 @@
&& marginBeforeCollapse == o.marginBeforeCollapse
&& marginAfterCollapse == o.marginAfterCollapse
&& appearance == o.appearance
+ && effectiveAppearance == o.effectiveAppearance
&& borderFit == o.borderFit
&& textCombine == o.textCombine
&& textDecorationStyle == o.textDecorationStyle
Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (283268 => 283269)
--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h 2021-09-29 22:25:07 UTC (rev 283269)
@@ -201,6 +201,7 @@
unsigned marginBeforeCollapse : 2; // MarginCollapse
unsigned marginAfterCollapse : 2; // MarginCollapse
unsigned appearance : 6; // EAppearance
+ unsigned effectiveAppearance : 6; // EAppearance
unsigned borderFit : 1; // BorderFit
unsigned textCombine : 1; // CSS3 text-combine properties
Modified: trunk/Source/WebCore/style/MatchedDeclarationsCache.cpp (283268 => 283269)
--- trunk/Source/WebCore/style/MatchedDeclarationsCache.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/style/MatchedDeclarationsCache.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -53,7 +53,7 @@
// content:attr() value depends on the element it is being applied to.
if (style.hasAttrContent() || (style.styleType() != PseudoId::None && parentStyle.hasAttrContent()))
return false;
- if (style.hasAppearance())
+ if (style.hasEffectiveAppearance())
return false;
if (style.zoom() != RenderStyle::initialZoom())
return false;
Modified: trunk/Source/WebCore/style/StyleAdjuster.cpp (283268 => 283269)
--- trunk/Source/WebCore/style/StyleAdjuster.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/style/StyleAdjuster.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -459,7 +459,7 @@
}
// Menulists should have visible overflow
- if (style.appearance() == MenulistPart) {
+ if (style.effectiveAppearance() == MenulistPart) {
style.setOverflowX(Overflow::Visible);
style.setOverflowY(Overflow::Visible);
}
Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (283268 => 283269)
--- trunk/Source/WebCore/style/StyleTreeResolver.cpp 2021-09-29 22:22:43 UTC (rev 283268)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp 2021-09-29 22:25:07 UTC (rev 283269)
@@ -246,7 +246,7 @@
if (element.hasTagName(HTMLNames::meterTag)
|| is<HTMLProgressElement>(element)
|| (is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isSearchField())) {
- if (existingStyle && update.style->appearance() != existingStyle->appearance()) {
+ if (existingStyle && update.style->effectiveAppearance() != existingStyle->effectiveAppearance()) {
update.change = Change::Renderer;
descendantsToResolve = DescendantsToResolve::All;
}