Changeset 283269 in webkit
- Timestamp:
- Sep 29, 2021, 3:25:07 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 41 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt (modified) (1 diff)
-
LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt (modified) (1 diff)
-
LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt (modified) (1 diff)
-
LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityObject.cpp (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityRenderObject.cpp (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilitySlider.cpp (modified) (1 diff)
-
Source/WebCore/dom/Element.cpp (modified) (2 diffs)
-
Source/WebCore/editing/FrameSelection.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLFormControlElement.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLInputElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLMeterElement.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLOptionElement.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLProgressElement.cpp (modified) (1 diff)
-
Source/WebCore/html/RangeInputType.cpp (modified) (1 diff)
-
Source/WebCore/html/shadow/ProgressShadowElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/shadow/SliderThumbElement.cpp (modified) (4 diffs)
-
Source/WebCore/html/shadow/TextControlInnerElements.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderAttachment.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderBlock.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (5 diffs)
-
Source/WebCore/rendering/RenderBoxModelObject.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderLayerBacking.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderLayerScrollableArea.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderMenuList.cpp (modified) (3 diffs)
-
Source/WebCore/rendering/RenderProgress.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderTheme.cpp (modified) (12 diffs)
-
Source/WebCore/rendering/RenderThemeAdwaita.cpp (modified) (5 diffs)
-
Source/WebCore/rendering/RenderThemeIOS.mm (modified) (11 diffs)
-
Source/WebCore/rendering/RenderThemeMac.mm (modified) (16 diffs)
-
Source/WebCore/rendering/RenderThemeWin.cpp (modified) (12 diffs)
-
Source/WebCore/rendering/style/RenderStyle.cpp (modified) (3 diffs)
-
Source/WebCore/rendering/style/RenderStyle.h (modified) (3 diffs)
-
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (modified) (3 diffs)
-
Source/WebCore/rendering/style/StyleRareNonInheritedData.h (modified) (1 diff)
-
Source/WebCore/style/MatchedDeclarationsCache.cpp (modified) (1 diff)
-
Source/WebCore/style/StyleAdjuster.cpp (modified) (1 diff)
-
Source/WebCore/style/StyleTreeResolver.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r283268 r283269 1 2021-09-29 Aditya Keerthi <akeerthi@apple.com> 2 3 [css-ui] getComputedStyle() must return the specified value for '-webkit-appearance' 4 https://bugs.webkit.org/show_bug.cgi?id=230916 5 rdar://83640938 6 7 Reviewed by Simon Fraser. 8 9 * platform/gtk/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt: 10 * platform/ios-wk2/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt: 11 * platform/wpe/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt: 12 1 13 2021-09-29 Robert Jenner <Jenner@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/ChangeLog
r283244 r283269 1 2021-09-29 Aditya Keerthi <akeerthi@apple.com> 2 3 [css-ui] getComputedStyle() must return the specified value for '-webkit-appearance' 4 https://bugs.webkit.org/show_bug.cgi?id=230916 5 rdar://83640938 6 7 Reviewed by Simon Fraser. 8 9 * web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt: 10 11 Rebaseline for progression. 12 1 13 2021-09-29 Myles C. Maxfield <mmaxfield@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt
r283223 r283269 3 3 PASS -webkit-appearance: none 4 4 FAIL -webkit-appearance: auto assert_equals: style.WebkitAppearance (uppercase W) expected "auto" but got "" 5 FAIL -webkit-appearance: button assert_equals: style.WebkitAppearance (uppercase W) expected "button" but got "none" 5 PASS -webkit-appearance: button 6 6 PASS -webkit-appearance: checkbox 7 7 PASS -webkit-appearance: listbox 8 FAIL -webkit-appearance: menulist assert_equals: style.WebkitAppearance (uppercase W) expected "menulist" but got "menulist-button" 8 PASS -webkit-appearance: menulist 9 9 PASS -webkit-appearance: menulist-button 10 FAIL -webkit-appearance: meter assert_equals: style.WebkitAppearance (uppercase W) expected "meter" but got "none" 11 FAIL -webkit-appearance: progress-bar assert_equals: style.WebkitAppearance (uppercase W) expected "progress-bar" but got "none" 12 FAIL -webkit-appearance: push-button assert_equals: style.WebkitAppearance (uppercase W) expected "push-button" but got "none" 10 PASS -webkit-appearance: meter 11 PASS -webkit-appearance: progress-bar 12 PASS -webkit-appearance: push-button 13 13 PASS -webkit-appearance: radio 14 14 PASS -webkit-appearance: searchfield 15 15 PASS -webkit-appearance: slider-horizontal 16 FAIL -webkit-appearance: square-button assert_equals: style.WebkitAppearance (uppercase W) expected "square-button" but got "none" 16 PASS -webkit-appearance: square-button 17 17 PASS -webkit-appearance: textarea 18 18 PASS -webkit-appearance: textfield -
trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt
r283223 r283269 3 3 PASS -webkit-appearance: none 4 4 FAIL -webkit-appearance: auto assert_equals: style.WebkitAppearance (uppercase W) expected "auto" but got "" 5 FAIL -webkit-appearance: button assert_equals: style.WebkitAppearance (uppercase W) expected "button" but got "none" 5 PASS -webkit-appearance: button 6 6 PASS -webkit-appearance: checkbox 7 FAIL -webkit-appearance: listbox assert_equals: style.WebkitAppearance (uppercase W) expected "listbox" but got "none" 8 FAIL -webkit-appearance: menulist assert_equals: style.WebkitAppearance (uppercase W) expected "menulist" but got "menulist-button" 7 PASS -webkit-appearance: listbox 8 PASS -webkit-appearance: menulist 9 9 PASS -webkit-appearance: menulist-button 10 FAIL -webkit-appearance: meter assert_equals: style.WebkitAppearance (uppercase W) expected "meter" but got "none" 11 FAIL -webkit-appearance: progress-bar assert_equals: style.WebkitAppearance (uppercase W) expected "progress-bar" but got "none" 10 PASS -webkit-appearance: meter 11 PASS -webkit-appearance: progress-bar 12 12 PASS -webkit-appearance: push-button 13 13 PASS -webkit-appearance: radio 14 14 PASS -webkit-appearance: searchfield 15 15 PASS -webkit-appearance: slider-horizontal 16 FAIL -webkit-appearance: square-button assert_equals: style.WebkitAppearance (uppercase W) expected "square-button" but got "none" 16 PASS -webkit-appearance: square-button 17 17 PASS -webkit-appearance: textarea 18 18 PASS -webkit-appearance: textfield -
trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt
r283223 r283269 3 3 PASS -webkit-appearance: none 4 4 FAIL -webkit-appearance: auto assert_equals: style.WebkitAppearance (uppercase W) expected "auto" but got "" 5 FAIL -webkit-appearance: button assert_equals: style.WebkitAppearance (uppercase W) expected "button" but got "none" 5 PASS -webkit-appearance: button 6 6 PASS -webkit-appearance: checkbox 7 FAIL -webkit-appearance: listbox assert_equals: style.WebkitAppearance (uppercase W) expected "listbox" but got "none" 8 FAIL -webkit-appearance: menulist assert_equals: style.WebkitAppearance (uppercase W) expected "menulist" but got "menulist-button" 7 PASS -webkit-appearance: listbox 8 PASS -webkit-appearance: menulist 9 9 PASS -webkit-appearance: menulist-button 10 FAIL -webkit-appearance: meter assert_equals: style.WebkitAppearance (uppercase W) expected "meter" but got "none" 11 FAIL -webkit-appearance: progress-bar assert_equals: style.WebkitAppearance (uppercase W) expected "progress-bar" but got "none" 10 PASS -webkit-appearance: meter 11 PASS -webkit-appearance: progress-bar 12 12 PASS -webkit-appearance: push-button 13 13 PASS -webkit-appearance: radio 14 14 PASS -webkit-appearance: searchfield 15 15 PASS -webkit-appearance: slider-horizontal 16 FAIL -webkit-appearance: square-button assert_equals: style.WebkitAppearance (uppercase W) expected "square-button" but got "none" 16 PASS -webkit-appearance: square-button 17 17 PASS -webkit-appearance: textarea 18 18 PASS -webkit-appearance: textfield -
trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-ui/appearance-cssom-001-expected.txt
r283223 r283269 3 3 PASS -webkit-appearance: none 4 4 FAIL -webkit-appearance: auto assert_equals: style.WebkitAppearance (uppercase W) expected "auto" but got "" 5 FAIL -webkit-appearance: button assert_equals: style.WebkitAppearance (uppercase W) expected "button" but got "none" 5 PASS -webkit-appearance: button 6 6 PASS -webkit-appearance: checkbox 7 FAIL -webkit-appearance: listbox assert_equals: style.WebkitAppearance (uppercase W) expected "listbox" but got "none" 8 FAIL -webkit-appearance: menulist assert_equals: style.WebkitAppearance (uppercase W) expected "menulist" but got "menulist-button" 7 PASS -webkit-appearance: listbox 8 PASS -webkit-appearance: menulist 9 9 PASS -webkit-appearance: menulist-button 10 FAIL -webkit-appearance: meter assert_equals: style.WebkitAppearance (uppercase W) expected "meter" but got "none" 11 FAIL -webkit-appearance: progress-bar assert_equals: style.WebkitAppearance (uppercase W) expected "progress-bar" but got "none" 10 PASS -webkit-appearance: meter 11 PASS -webkit-appearance: progress-bar 12 12 PASS -webkit-appearance: push-button 13 13 PASS -webkit-appearance: radio 14 14 PASS -webkit-appearance: searchfield 15 15 PASS -webkit-appearance: slider-horizontal 16 FAIL -webkit-appearance: square-button assert_equals: style.WebkitAppearance (uppercase W) expected "square-button" but got "none" 16 PASS -webkit-appearance: square-button 17 17 PASS -webkit-appearance: textarea 18 18 PASS -webkit-appearance: textfield -
trunk/Source/WebCore/ChangeLog
r283260 r283269 1 2021-09-29 Aditya Keerthi <akeerthi@apple.com> 2 3 [css-ui] getComputedStyle() must return the specified value for '-webkit-appearance' 4 https://bugs.webkit.org/show_bug.cgi?id=230916 5 rdar://83640938 6 7 Reviewed by Simon Fraser. 8 9 Currently, an element's appearance can be adjusted to "none" depending 10 on the applied CSS properties. For example, buttons that specify a 11 background-color lose their native appearance. The existing behavior is 12 implemented by modifying the appearance field on RenderStyle. 13 14 While the spec allows certain properties to affect appearance, it 15 also asserts that the computed value must be equal to the specific 16 value [1]. However, since the specified and adjusted values are stored 17 in the same field in RenderStyle, the computed value does not always 18 equal the specified value. 19 20 To fix, introduce an effectiveAppearance field to RenderStyle, which 21 stores the used appearance. The specified appearance remains in the 22 appearance field, ensuring the computed value adheres to the spec. 23 24 The new behavior matches Chrome and Firefox. This work is also necessary 25 for WebKit to support 'auto' as a valid appearance value, since the 26 used value will need to be adjusted depending on the element type, but 27 the computed value should remain 'auto'. 28 29 [1] https://www.w3.org/TR/css-ui-4/#appearance-switching 30 31 * accessibility/AccessibilityObject.cpp: 32 (WebCore::AccessibilityObject::boundingBoxForQuads): 33 * accessibility/AccessibilityRenderObject.cpp: 34 (WebCore::AccessibilityRenderObject::isApplePayButton const): 35 * accessibility/AccessibilitySlider.cpp: 36 (WebCore::AccessibilitySlider::orientation const): 37 * dom/Element.cpp: 38 (WebCore::Element::setActive): 39 (WebCore::Element::setHovered): 40 * editing/FrameSelection.cpp: 41 (WebCore::FrameSelection::focusedOrActiveStateChanged): 42 * html/HTMLFormControlElement.cpp: 43 (WebCore::HTMLFormControlElement::disabledStateChanged): 44 * html/HTMLInputElement.cpp: 45 (WebCore::HTMLInputElement::setChecked): 46 (WebCore::HTMLInputElement::setIndeterminate): 47 * html/HTMLMeterElement.cpp: 48 (WebCore::HTMLMeterElement::createElementRenderer): 49 * html/HTMLOptionElement.cpp: 50 (WebCore::HTMLOptionElement::parseAttribute): 51 * html/HTMLProgressElement.cpp: 52 (WebCore::HTMLProgressElement::createElementRenderer): 53 * html/RangeInputType.cpp: 54 (WebCore::RangeInputType::handleKeydownEvent): 55 * html/shadow/ProgressShadowElement.cpp: 56 (WebCore::ProgressShadowElement::rendererIsNeeded): 57 (WebCore::ProgressInnerElement::rendererIsNeeded): 58 * html/shadow/SliderThumbElement.cpp: 59 (WebCore::hasVerticalAppearance): 60 (WebCore::RenderSliderThumb::updateAppearance): 61 (WebCore::SliderThumbElement::resolveCustomStyle): 62 (WebCore::SliderContainerElement::resolveCustomStyle): 63 * html/shadow/TextControlInnerElements.cpp: 64 (WebCore::SearchFieldResultsButtonElement::resolveCustomStyle): 65 * rendering/RenderAttachment.cpp: 66 (WebCore::RenderAttachment::shouldDrawBorder const): 67 (WebCore::RenderAttachment::paintReplaced): 68 * rendering/RenderBlock.cpp: 69 (WebCore::RenderBlock::addVisualOverflowFromTheme): 70 (WebCore::RenderBlock::baselinePosition const): 71 * rendering/RenderBox.cpp: 72 (WebCore::RenderBox::determineBackgroundBleedAvoidance const): 73 (WebCore::RenderBox::paintBoxDecorations): 74 (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect const): 75 * rendering/RenderBoxModelObject.cpp: 76 (WebCore::RenderBoxModelObject::hasVisibleBoxDecorationStyle const): 77 (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const): 78 * rendering/RenderLayerBacking.cpp: 79 (WebCore::RenderLayerBacking::updateCustomAppearance): 80 (WebCore::hasVisibleBoxDecorations): 81 * rendering/RenderLayerScrollableArea.cpp: 82 (WebCore::RenderLayerScrollableArea::updateScrollbarsAfterStyleChange): 83 (WebCore::RenderLayerScrollableArea::updateScrollbarsAfterLayout): 84 * rendering/RenderMenuList.cpp: 85 (RenderMenuList::menuStyle const): 86 (RenderMenuList::clientPaddingLeft const): 87 (RenderMenuList::clientPaddingRight const): 88 * rendering/RenderProgress.cpp: 89 (WebCore::RenderProgress::updateAnimationState): 90 * rendering/RenderTheme.cpp: 91 (WebCore::RenderTheme::adjustStyle): 92 93 Ensure the specified value is not modified by adjusting the 94 effectiveAppearance field instead of the appearance field. 95 96 (WebCore::RenderTheme::adjustSearchFieldDecorationStyle const): 97 (WebCore::RenderTheme::paint): 98 (WebCore::RenderTheme::paintBorderOnly): 99 (WebCore::RenderTheme::paintDecorations): 100 (WebCore::RenderTheme::baselinePosition const): 101 (WebCore::RenderTheme::isControlStyled const): 102 (WebCore::RenderTheme::adjustRepaintRect): 103 (WebCore::RenderTheme::supportsFocusRing const): 104 (WebCore::RenderTheme::isDefault const): 105 (WebCore::RenderTheme::paintSliderTicks): 106 * rendering/RenderThemeAdwaita.cpp: 107 (WebCore::RenderThemeAdwaita::supportsFocusRing const): 108 (WebCore::RenderThemeAdwaita::popupInternalPaddingBox const): 109 (WebCore::RenderThemeAdwaita::paintSliderTrack): 110 (WebCore::RenderThemeAdwaita::adjustSliderThumbSize const): 111 (WebCore::RenderThemeAdwaita::paintSliderThumb): 112 * rendering/RenderThemeIOS.mm: 113 (WebCore::RenderThemeIOS::adjustedPaintRect const): 114 (WebCore::RenderThemeIOS::baselinePosition const): 115 (WebCore::RenderThemeIOS::isControlStyled const): 116 (WebCore::RenderThemeIOS::popupInternalPaddingBox const): 117 (WebCore::RenderThemeIOS::adjustRoundBorderRadius): 118 (WebCore::RenderThemeIOS::paintSliderTrack): 119 (WebCore::RenderThemeIOS::adjustSliderThumbSize const): 120 (WebCore::RenderThemeIOS::adjustButtonStyle const): 121 (WebCore::RenderThemeIOS::supportsBoxShadow const): 122 (WebCore::RenderThemeIOS::paintSliderTicks): 123 (WebCore::RenderThemeIOS::paintSliderTrackWithFormControlRefresh): 124 * rendering/RenderThemeMac.mm: 125 (WebCore::RenderThemeMac::isControlStyled const): 126 (WebCore::RenderThemeMac::adjustRepaintRect): 127 (WebCore::RenderThemeMac::controlSupportsTints const): 128 (WebCore::RenderThemeMac::meterSizeForBounds const): 129 (WebCore::RenderThemeMac::levelIndicatorFor const): 130 (WebCore::RenderThemeMac::progressBarRectForBounds const): 131 (WebCore::RenderThemeMac::popupInternalPaddingBox const): 132 (WebCore::RenderThemeMac::paintSliderTrack): 133 (WebCore::RenderThemeMac::paintSliderThumb): 134 (WebCore::RenderThemeMac::adjustSliderThumbSize const): 135 * rendering/RenderThemeWin.cpp: 136 (WebCore::RenderThemeWin::supportsFocusRing const): 137 (WebCore::RenderThemeWin::determineClassicState): 138 (WebCore::RenderThemeWin::determineState): 139 (WebCore::RenderThemeWin::determineSliderThumbState): 140 (WebCore::RenderThemeWin::determineButtonState): 141 (WebCore::RenderThemeWin::getClassicThemeData): 142 (WebCore::RenderThemeWin::getThemeData): 143 (WebCore::drawControl): 144 (WebCore::RenderThemeWin::paintSliderTrack): 145 (WebCore::RenderThemeWin::adjustSliderThumbSize const): 146 * rendering/style/RenderStyle.cpp: 147 (WebCore::RenderStyle::hashForTextAutosizing const): 148 (WebCore::RenderStyle::equalForTextAutosizing const): 149 (WebCore::rareNonInheritedDataChangeRequiresLayout): 150 * rendering/style/RenderStyle.h: 151 (WebCore::RenderStyle::hasEffectiveAppearance const): 152 (WebCore::RenderStyle::effectiveAppearance const): 153 (WebCore::RenderStyle::setAppearance): 154 (WebCore::RenderStyle::setEffectiveAppearance): 155 * rendering/style/StyleRareNonInheritedData.cpp: 156 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 157 (WebCore::StyleRareNonInheritedData::operator== const): 158 * rendering/style/StyleRareNonInheritedData.h: 159 * style/MatchedDeclarationsCache.cpp: 160 (WebCore::Style::MatchedDeclarationsCache::isCacheable): 161 * style/StyleAdjuster.cpp: 162 (WebCore::Style::Adjuster::adjust const): 163 * style/StyleTreeResolver.cpp: 164 (WebCore::Style::TreeResolver::resolveElement): 165 1 166 2021-09-29 Alan Bujtas <zalan@apple.com> 2 167 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r283115 r283269 787 787 FloatRect r = quad.enclosingBoundingBox(); 788 788 if (!r.isEmpty()) { 789 if (obj->style().has Appearance())789 if (obj->style().hasEffectiveAppearance()) 790 790 obj->theme().adjustRepaintRect(*obj, r); 791 791 result.unite(r); -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r283078 r283269 3849 3849 if (!m_renderer) 3850 3850 return false; 3851 return m_renderer->style(). appearance() == ApplePayButtonPart;3851 return m_renderer->style().effectiveAppearance() == ApplePayButtonPart; 3852 3852 } 3853 3853 -
trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp
r271166 r283269 67 67 const RenderStyle& style = m_renderer->style(); 68 68 69 ControlPart styleAppearance = style. appearance();69 ControlPart styleAppearance = style.effectiveAppearance(); 70 70 switch (styleAppearance) { 71 71 case SliderThumbHorizontalPart: -
trunk/Source/WebCore/dom/Element.cpp
r283237 r283269 710 710 711 711 bool reactsToPress = false; 712 if (renderer()->style().has Appearance() && renderer()->theme().stateChanged(*renderer(), ControlStates::States::Pressed))712 if (renderer()->style().hasEffectiveAppearance() && renderer()->theme().stateChanged(*renderer(), ControlStates::States::Pressed)) 713 713 reactsToPress = true; 714 714 … … 807 807 } 808 808 809 if (auto* style = renderStyle(); style && style->has Appearance())809 if (auto* style = renderStyle(); style && style->hasEffectiveAppearance()) 810 810 renderer()->theme().stateChanged(*renderer(), ControlStates::States::Hovered); 811 811 } -
trunk/Source/WebCore/editing/FrameSelection.cpp
r282784 r283269 2105 2105 element->invalidateStyleForSubtree(); 2106 2106 if (RenderObject* renderer = element->renderer()) 2107 if (renderer && renderer->style().has Appearance())2107 if (renderer && renderer->style().hasEffectiveAppearance()) 2108 2108 renderer->theme().stateChanged(*renderer, ControlStates::States::Focused); 2109 2109 } -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r283134 r283269 184 184 updateWillValidateAndValidity(); 185 185 invalidateStyleForSubtree(); 186 if (renderer() && renderer()->style().has Appearance())186 if (renderer() && renderer()->style().hasEffectiveAppearance()) 187 187 renderer()->theme().stateChanged(*renderer(), ControlStates::States::Enabled); 188 188 } -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r282799 r283269 986 986 if (RadioButtonGroups* buttons = radioButtonGroups()) 987 987 buttons->updateCheckedState(*this); 988 if (renderer() && renderer()->style().has Appearance())988 if (renderer() && renderer()->style().hasEffectiveAppearance()) 989 989 renderer()->theme().stateChanged(*renderer(), ControlStates::States::Checked); 990 990 updateValidity(); … … 1010 1010 invalidateStyleForSubtree(); 1011 1011 1012 if (renderer() && renderer()->style().has Appearance())1012 if (renderer() && renderer()->style().hasEffectiveAppearance()) 1013 1013 renderer()->theme().stateChanged(*renderer(), ControlStates::States::Checked); 1014 1014 } -
trunk/Source/WebCore/html/HTMLMeterElement.cpp
r274997 r283269 59 59 RenderPtr<RenderElement> HTMLMeterElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) 60 60 { 61 if (!RenderTheme::singleton().supportsMeter(style. appearance(), *this))61 if (!RenderTheme::singleton().supportsMeter(style.effectiveAppearance(), *this)) 62 62 return RenderElement::createFor(*this, WTFMove(style)); 63 63 -
trunk/Source/WebCore/html/HTMLOptionElement.cpp
r276547 r283269 180 180 if (oldDisabled != m_disabled) { 181 181 invalidateStyleForSubtree(); 182 if (renderer() && renderer()->style().has Appearance())182 if (renderer() && renderer()->style().hasEffectiveAppearance()) 183 183 renderer()->theme().stateChanged(*renderer(), ControlStates::States::Enabled); 184 184 } -
trunk/Source/WebCore/html/HTMLProgressElement.cpp
r246490 r283269 58 58 RenderPtr<RenderElement> HTMLProgressElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) 59 59 { 60 if (!style.has Appearance())60 if (!style.hasEffectiveAppearance()) 61 61 return RenderElement::createFor(*this, WTFMove(style)); 62 62 -
trunk/Source/WebCore/html/RangeInputType.cpp
r279054 r283269 206 206 bool isVertical = false; 207 207 if (auto* renderer = element()->renderer()) { 208 ControlPart part = renderer->style(). appearance();208 ControlPart part = renderer->style().effectiveAppearance(); 209 209 isVertical = part == SliderVerticalPart || part == MediaVolumeSliderPart; 210 210 } -
trunk/Source/WebCore/html/shadow/ProgressShadowElement.cpp
r261013 r283269 56 56 { 57 57 RenderObject* progressRenderer = progressElement()->renderer(); 58 return progressRenderer && !progressRenderer->style().has Appearance() && HTMLDivElement::rendererIsNeeded(style);58 return progressRenderer && !progressRenderer->style().hasEffectiveAppearance() && HTMLDivElement::rendererIsNeeded(style); 59 59 } 60 60 … … 72 72 { 73 73 RenderObject* progressRenderer = progressElement()->renderer(); 74 return progressRenderer && !progressRenderer->style().has Appearance() && HTMLDivElement::rendererIsNeeded(style);74 return progressRenderer && !progressRenderer->style().hasEffectiveAppearance() && HTMLDivElement::rendererIsNeeded(style); 75 75 } 76 76 -
trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp
r278253 r283269 78 78 79 79 #if ENABLE(VIDEO) 80 if (sliderStyle. appearance() == MediaVolumeSliderPart && input.renderer()->theme().usesVerticalVolumeSlider())80 if (sliderStyle.effectiveAppearance() == MediaVolumeSliderPart && input.renderer()->theme().usesVerticalVolumeSlider()) 81 81 return true; 82 82 #endif 83 83 84 return sliderStyle. appearance() == SliderVerticalPart;84 return sliderStyle.effectiveAppearance() == SliderVerticalPart; 85 85 } 86 86 … … 94 94 void RenderSliderThumb::updateAppearance(const RenderStyle* parentStyle) 95 95 { 96 if (parentStyle-> appearance() == SliderVerticalPart)97 mutableStyle().set Appearance(SliderThumbVerticalPart);98 else if (parentStyle-> appearance() == SliderHorizontalPart)99 mutableStyle().set Appearance(SliderThumbHorizontalPart);100 else if (parentStyle-> appearance() == MediaSliderPart)101 mutableStyle().set Appearance(MediaSliderThumbPart);102 else if (parentStyle-> appearance() == MediaVolumeSliderPart)103 mutableStyle().set Appearance(MediaVolumeSliderThumbPart);104 else if (parentStyle-> appearance() == MediaFullScreenVolumeSliderPart)105 mutableStyle().set Appearance(MediaFullScreenVolumeSliderThumbPart);106 if (style().has Appearance()) {96 if (parentStyle->effectiveAppearance() == SliderVerticalPart) 97 mutableStyle().setEffectiveAppearance(SliderThumbVerticalPart); 98 else if (parentStyle->effectiveAppearance() == SliderHorizontalPart) 99 mutableStyle().setEffectiveAppearance(SliderThumbHorizontalPart); 100 else if (parentStyle->effectiveAppearance() == MediaSliderPart) 101 mutableStyle().setEffectiveAppearance(MediaSliderThumbPart); 102 else if (parentStyle->effectiveAppearance() == MediaVolumeSliderPart) 103 mutableStyle().setEffectiveAppearance(MediaVolumeSliderThumbPart); 104 else if (parentStyle->effectiveAppearance() == MediaFullScreenVolumeSliderPart) 105 mutableStyle().setEffectiveAppearance(MediaFullScreenVolumeSliderThumbPart); 106 if (style().hasEffectiveAppearance()) { 107 107 ASSERT(element()); 108 108 theme().adjustSliderThumbSize(mutableStyle(), element()); … … 596 596 return std::nullopt; 597 597 598 switch (hostStyle-> appearance()) {598 switch (hostStyle->effectiveAppearance()) { 599 599 case MediaSliderPart: 600 600 case MediaSliderThumbPart: … … 650 650 return std::nullopt; 651 651 652 switch (hostStyle-> appearance()) {652 switch (hostStyle->effectiveAppearance()) { 653 653 case MediaSliderPart: 654 654 case MediaSliderThumbPart: -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp
r282799 r283269 246 246 return std::nullopt; 247 247 248 if (shadowHostStyle && shadowHostStyle-> appearance() != SearchFieldPart) {248 if (shadowHostStyle && shadowHostStyle->effectiveAppearance() != SearchFieldPart) { 249 249 SetForScope<bool> canAdjustStyleForAppearance(m_canAdjustStyleForAppearance, false); 250 250 return resolveStyle(&parentStyle); -
trunk/Source/WebCore/rendering/RenderAttachment.cpp
r275413 r283269 80 80 bool RenderAttachment::shouldDrawBorder() const 81 81 { 82 if (style(). appearance() == BorderlessAttachmentPart)82 if (style().effectiveAppearance() == BorderlessAttachmentPart) 83 83 return false; 84 84 return m_shouldDrawBorder; … … 87 87 void RenderAttachment::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& offset) 88 88 { 89 if (paintInfo.phase != PaintPhase::Selection || !hasVisibleBoxDecorations() || !style().has Appearance())89 if (paintInfo.phase != PaintPhase::Selection || !hasVisibleBoxDecorations() || !style().hasEffectiveAppearance()) 90 90 return; 91 91 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r282736 r283269 755 755 void RenderBlock::addVisualOverflowFromTheme() 756 756 { 757 if (!style().has Appearance())757 if (!style().hasEffectiveAppearance()) 758 758 return; 759 759 … … 2452 2452 // is turned off, checkboxes/radios will still have decent baselines. 2453 2453 // FIXME: Need to patch form controls to deal with vertical lines. 2454 if (style().has Appearance() && !theme().isControlContainer(style().appearance()))2454 if (style().hasEffectiveAppearance() && !theme().isControlContainer(style().effectiveAppearance())) 2455 2455 return theme().baselinePosition(*this); 2456 2456 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r283100 r283269 1504 1504 if (borderObscuresBackgroundEdge(contextScaling)) 1505 1505 return BackgroundBleedShrinkBackground; 1506 if (!style.has Appearance() && borderObscuresBackground() && backgroundHasOpaqueTopLayer())1506 if (!style.hasEffectiveAppearance() && borderObscuresBackground() && backgroundHasOpaqueTopLayer()) 1507 1507 return BackgroundBleedBackgroundOverBorder; 1508 1508 … … 1540 1540 // The theme will tell us whether or not we should also paint the CSS background. 1541 1541 bool borderOrBackgroundPaintingIsNeeded = true; 1542 if (style().has Appearance()) {1542 if (style().hasEffectiveAppearance()) { 1543 1543 ControlStates* controlStates = controlStatesForRenderer(*this); 1544 1544 borderOrBackgroundPaintingIsNeeded = theme().paint(*this, *controlStates, paintInfo, paintRect); … … 1553 1553 paintBackground(paintInfo, paintRect, bleedAvoidance); 1554 1554 1555 if (style().has Appearance())1555 if (style().hasEffectiveAppearance()) 1556 1556 theme().paintDecorations(*this, paintInfo, paintRect); 1557 1557 } … … 1559 1559 1560 1560 // The theme will tell us whether or not we should also paint the CSS border. 1561 if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().has Appearance() || (borderOrBackgroundPaintingIsNeeded && theme().paintBorderOnly(*this, paintInfo, paintRect))) && style().hasVisibleBorderDecoration())1561 if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasEffectiveAppearance() || (borderOrBackgroundPaintingIsNeeded && theme().paintBorderOnly(*this, paintInfo, paintRect))) && style().hasVisibleBorderDecoration()) 1562 1562 paintBorder(paintInfo, paintRect, style(), bleedAvoidance); 1563 1563 … … 1634 1634 // In this case it is safe to not assume opaqueness. 1635 1635 // FIXME: May be ask theme if it paints opaque. 1636 if (style().has Appearance())1636 if (style().hasEffectiveAppearance()) 1637 1637 return false; 1638 1638 // FIXME: Check the opaqueness of background images. -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r283258 r283269 194 194 bool RenderBoxModelObject::hasVisibleBoxDecorationStyle() const 195 195 { 196 return hasBackground() || style().hasVisibleBorderDecoration() || style().has Appearance() || style().boxShadow();196 return hasBackground() || style().hasVisibleBorderDecoration() || style().hasEffectiveAppearance() || style().boxShadow(); 197 197 } 198 198 … … 2332 2332 return false; 2333 2333 2334 if (style().has Appearance())2334 if (style().hasEffectiveAppearance()) 2335 2335 return false; 2336 2336 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r282957 r283269 772 772 void RenderLayerBacking::updateCustomAppearance(const RenderStyle& style) 773 773 { 774 ControlPart appearance = style. appearance();774 ControlPart appearance = style.effectiveAppearance(); 775 775 if (appearance == MediaControlsLightBarBackgroundPart) 776 776 m_graphicsLayer->setCustomAppearance(GraphicsLayer::CustomAppearance::LightBackdrop); … … 2469 2469 static inline bool hasVisibleBoxDecorations(const RenderStyle& style) 2470 2470 { 2471 return style.hasVisibleBorder() || style.hasBorderRadius() || style.hasOutline() || style.has Appearance() || style.boxShadow() || style.hasFilter();2471 return style.hasVisibleBorder() || style.hasBorderRadius() || style.hasOutline() || style.hasEffectiveAppearance() || style.boxShadow() || style.hasFilter(); 2472 2472 } 2473 2473 -
trunk/Source/WebCore/rendering/RenderLayerScrollableArea.cpp
r282903 r283269 1119 1119 1120 1120 // List box parts handle the scrollbars by themselves so we have nothing to do. 1121 if (box->style(). appearance() == ListboxPart)1121 if (box->style().effectiveAppearance() == ListboxPart) 1122 1122 return; 1123 1123 … … 1139 1139 1140 1140 // List box parts handle the scrollbars by themselves so we have nothing to do. 1141 if (box->style(). appearance() == ListboxPart)1141 if (box->style().effectiveAppearance() == ListboxPart) 1142 1142 return; 1143 1143 -
trunk/Source/WebCore/rendering/RenderMenuList.cpp
r277321 r283269 541 541 return PopupMenuStyle(styleToUse.visitedDependentColorWithColorFilter(CSSPropertyColor), styleToUse.visitedDependentColorWithColorFilter(CSSPropertyBackgroundColor), 542 542 styleToUse.fontCascade(), styleToUse.visibility() == Visibility::Visible, styleToUse.display() == DisplayType::None, 543 style().has Appearance() && style().appearance() == MenulistPart, styleToUse.textIndent(),543 style().hasEffectiveAppearance() && style().effectiveAppearance() == MenulistPart, styleToUse.textIndent(), 544 544 style().direction(), isOverride(style().unicodeBidi()), PopupMenuStyle::DefaultBackgroundColor, 545 545 PopupMenuStyle::SelectPopup, theme().popupMenuSize(styleToUse, absBounds)); … … 573 573 LayoutUnit RenderMenuList::clientPaddingLeft() const 574 574 { 575 if ((style(). appearance() == MenulistPart || style().appearance() == MenulistButtonPart) && style().direction() == TextDirection::RTL) {575 if ((style().effectiveAppearance() == MenulistPart || style().effectiveAppearance() == MenulistButtonPart) && style().direction() == TextDirection::RTL) { 576 576 // For these appearance values, the theme applies padding to leave room for the 577 577 // drop-down button. But leaving room for the button inside the popup menu itself … … 587 587 LayoutUnit RenderMenuList::clientPaddingRight() const 588 588 { 589 if ((style(). appearance() == MenulistPart || style().appearance() == MenulistButtonPart) && style().direction() == TextDirection::LTR)589 if ((style().effectiveAppearance() == MenulistPart || style().effectiveAppearance() == MenulistButtonPart) && style().direction() == TextDirection::LTR) 590 590 return endOfLinePadding; 591 591 -
trunk/Source/WebCore/rendering/RenderProgress.cpp
r275942 r283269 92 92 m_animationRepeatInterval = theme().animationRepeatIntervalForProgressBar(*this); 93 93 94 bool animating = style().has Appearance() && m_animationRepeatInterval > 0_s && !isDeterminate();94 bool animating = style().hasEffectiveAppearance() && m_animationRepeatInterval > 0_s && !isDeterminate(); 95 95 if (animating == m_animating) 96 96 return; -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r282440 r283269 91 91 switch (part) { 92 92 case MenulistPart: 93 style.set Appearance(MenulistButtonPart);93 style.setEffectiveAppearance(MenulistButtonPart); 94 94 part = MenulistButtonPart; 95 95 break; 96 96 default: 97 style.set Appearance(NoControlPart);97 style.setEffectiveAppearance(NoControlPart); 98 98 break; 99 99 } 100 100 } 101 101 102 if (!style.has Appearance())102 if (!style.hasEffectiveAppearance()) 103 103 return; 104 104 … … 192 192 193 193 // Call the appropriate style adjustment method based off the appearance value. 194 switch (style. appearance()) {194 switch (style.effectiveAppearance()) { 195 195 #if !USE(NEW_THEME) 196 196 case CheckboxPart: … … 274 274 { 275 275 if (is<SearchFieldResultsButtonElement>(element) && !downcast<SearchFieldResultsButtonElement>(*element).canAdjustStyleForAppearance()) { 276 style.set Appearance(NoControlPart);276 style.setEffectiveAppearance(NoControlPart); 277 277 return; 278 278 } 279 279 280 switch (style. appearance()) {280 switch (style.effectiveAppearance()) { 281 281 case SearchFieldDecorationPart: 282 282 return adjustSearchFieldDecorationPartStyle(style, element); … … 306 306 return false; 307 307 308 ControlPart part = box.style(). appearance();308 ControlPart part = box.style().effectiveAppearance(); 309 309 IntRect integralSnappedRect = snappedIntRect(rect); 310 310 float deviceScaleFactor = box.document().deviceScaleFactor(); … … 451 451 #if PLATFORM(IOS_FAMILY) 452 452 UNUSED_PARAM(rect); 453 return box.style(). appearance() != NoControlPart;453 return box.style().effectiveAppearance() != NoControlPart; 454 454 #else 455 455 FloatRect devicePixelSnappedRect = snapRectToDevicePixels(rect, box.document().deviceScaleFactor()); 456 456 // Call the appropriate paint method based off the appearance value. 457 switch (box.style(). appearance()) {457 switch (box.style().effectiveAppearance()) { 458 458 case TextFieldPart: 459 459 return paintTextField(box, paintInfo, devicePixelSnappedRect); … … 508 508 509 509 // Call the appropriate paint method based off the appearance value. 510 switch (box.style(). appearance()) {510 switch (box.style().effectiveAppearance()) { 511 511 case MenulistButtonPart: 512 512 paintMenuListButtonDecorations(box, paintInfo, devicePixelSnappedRect); … … 721 721 { 722 722 #if USE(NEW_THEME) 723 return box.height() + box.marginTop() + Theme::singleton().baselinePositionAdjustment(box.style(). appearance()) * box.style().effectiveZoom();723 return box.height() + box.marginTop() + Theme::singleton().baselinePositionAdjustment(box.style().effectiveAppearance()) * box.style().effectiveZoom(); 724 724 #else 725 725 return box.height() + box.marginTop(); … … 736 736 bool RenderTheme::isControlStyled(const RenderStyle& style, const RenderStyle& userAgentStyle) const 737 737 { 738 switch (style. appearance()) {738 switch (style.effectiveAppearance()) { 739 739 case PushButtonPart: 740 740 case SquareButtonPart: … … 768 768 #if USE(NEW_THEME) 769 769 ControlStates states(extractControlStatesForRenderer(renderer)); 770 Theme::singleton().inflateControlPaintRect(renderer.style(). appearance(), states, rect, renderer.style().effectiveZoom());770 Theme::singleton().inflateControlPaintRect(renderer.style().effectiveAppearance(), states, rect, renderer.style().effectiveZoom()); 771 771 #else 772 772 UNUSED_PARAM(renderer); … … 777 777 bool RenderTheme::supportsFocusRing(const RenderStyle& style) const 778 778 { 779 return (style.has Appearance() && style.appearance() != TextFieldPart && style.appearance() != TextAreaPart && style.appearance() != MenulistButtonPart && style.appearance() != ListboxPart);779 return (style.hasEffectiveAppearance() && style.effectiveAppearance() != TextFieldPart && style.effectiveAppearance() != TextAreaPart && style.effectiveAppearance() != MenulistButtonPart && style.effectiveAppearance() != ListboxPart); 780 780 } 781 781 … … 925 925 return false; 926 926 927 return o.style(). appearance() == DefaultButtonPart;927 return o.style().effectiveAppearance() == DefaultButtonPart; 928 928 } 929 929 … … 1090 1090 double min = input.minimum(); 1091 1091 double max = input.maximum(); 1092 ControlPart part = o.style(). appearance();1092 ControlPart part = o.style().effectiveAppearance(); 1093 1093 // We don't support ticks on alternate sliders like MediaVolumeSliders. 1094 1094 if (part != SliderHorizontalPart && part != SliderVerticalPart) -
trunk/Source/WebCore/rendering/RenderThemeAdwaita.cpp
r279987 r283269 112 112 bool RenderThemeAdwaita::supportsFocusRing(const RenderStyle& style) const 113 113 { 114 switch (style. appearance()) {114 switch (style.effectiveAppearance()) { 115 115 case PushButtonPart: 116 116 case ButtonPart: … … 361 361 LengthBox RenderThemeAdwaita::popupInternalPaddingBox(const RenderStyle& style, const Settings&) const 362 362 { 363 if (style. appearance() == NoControlPart)363 if (style.effectiveAppearance() == NoControlPart) 364 364 return { }; 365 365 … … 499 499 GraphicsContextStateSaver stateSaver(graphicsContext); 500 500 501 ControlPart part = renderObject.style(). appearance();501 ControlPart part = renderObject.style().effectiveAppearance(); 502 502 ASSERT(part == SliderHorizontalPart || part == SliderVerticalPart); 503 503 … … 582 582 void RenderThemeAdwaita::adjustSliderThumbSize(RenderStyle& style, const Element*) const 583 583 { 584 ControlPart part = style. appearance();584 ControlPart part = style.effectiveAppearance(); 585 585 if (part != SliderThumbHorizontalPart && part != SliderThumbVerticalPart) 586 586 return; … … 595 595 GraphicsContextStateSaver stateSaver(graphicsContext); 596 596 597 ASSERT(renderObject.style(). appearance() == SliderThumbHorizontalPart || renderObject.style().appearance() == SliderThumbVerticalPart);597 ASSERT(renderObject.style().effectiveAppearance() == SliderThumbHorizontalPart || renderObject.style().effectiveAppearance() == SliderThumbVerticalPart); 598 598 599 599 SRGBA<uint8_t> sliderThumbBackgroundColor; -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r282844 r283269 447 447 { 448 448 // Workaround for <rdar://problem/6209763>. Force the painting bounds of checkboxes and radio controls to be square. 449 if (box.style(). appearance() == CheckboxPart || box.style().appearance() == RadioPart) {449 if (box.style().effectiveAppearance() == CheckboxPart || box.style().effectiveAppearance() == RadioPart) { 450 450 float width = std::min(paintRect.width(), paintRect.height()); 451 451 float height = width; … … 458 458 int RenderThemeIOS::baselinePosition(const RenderBox& box) const 459 459 { 460 if (box.style(). appearance() == CheckboxPart || box.style().appearance() == RadioPart)460 if (box.style().effectiveAppearance() == CheckboxPart || box.style().effectiveAppearance() == RadioPart) 461 461 return box.marginTop() + box.height() - 2; // The baseline is 2px up from the bottom of the checkbox/radio in AppKit. 462 if (box.style(). appearance() == MenulistPart)462 if (box.style().effectiveAppearance() == MenulistPart) 463 463 return box.marginTop() + box.height() - 5; // This is to match AppKit. There might be a better way to calculate this though. 464 464 return RenderTheme::baselinePosition(box); … … 468 468 { 469 469 // Buttons and MenulistButtons are styled if they contain a background image. 470 if (style. appearance() == PushButtonPart || style.appearance() == MenulistButtonPart)470 if (style.effectiveAppearance() == PushButtonPart || style.effectiveAppearance() == MenulistButtonPart) 471 471 return !style.visitedDependentColor(CSSPropertyBackgroundColor).isVisible() || style.backgroundLayers().hasImage(); 472 472 473 if (style. appearance() == TextFieldPart || style.appearance() == TextAreaPart)473 if (style.effectiveAppearance() == TextFieldPart || style.effectiveAppearance() == TextAreaPart) 474 474 return style.backgroundLayers() != userAgentStyle.backgroundLayers(); 475 475 … … 596 596 } 597 597 598 if (style. appearance() == MenulistButtonPart) {598 if (style.effectiveAppearance() == MenulistButtonPart) { 599 599 if (style.direction() == TextDirection::RTL) 600 600 return { 0, 0, 0, static_cast<int>(padding + style.borderTopWidth()) }; … … 625 625 void RenderThemeIOS::adjustRoundBorderRadius(RenderStyle& style, RenderBox& box) 626 626 { 627 if (!canAdjustBorderRadiusForAppearance(style. appearance(), box) || style.backgroundLayers().hasImage())627 if (!canAdjustBorderRadiusForAppearance(style.effectiveAppearance(), box) || style.backgroundLayers().hasImage()) 628 628 return; 629 629 … … 877 877 878 878 bool isHorizontal = true; 879 switch (style. appearance()) {879 switch (style.effectiveAppearance()) { 880 880 case SliderHorizontalPart: 881 881 isHorizontal = true; … … 951 951 void RenderThemeIOS::adjustSliderThumbSize(RenderStyle& style, const Element*) const 952 952 { 953 if (style. appearance() != SliderThumbHorizontalPart && style.appearance() != SliderThumbVerticalPart)953 if (style.effectiveAppearance() != SliderThumbHorizontalPart && style.effectiveAppearance() != SliderThumbVerticalPart) 954 954 return; 955 955 … … 1133 1133 1134 1134 #if ENABLE(INPUT_TYPE_COLOR) 1135 if (style. appearance() == ColorWellPart)1135 if (style.effectiveAppearance() == ColorWellPart) 1136 1136 return; 1137 1137 #endif … … 1289 1289 { 1290 1290 // FIXME: See if additional native controls can support box shadows. 1291 switch (style. appearance()) {1291 switch (style.effectiveAppearance()) { 1292 1292 case SliderThumbHorizontalPart: 1293 1293 case SliderThumbVerticalPart: … … 2371 2371 FloatRoundedRect::Radii tickCornerRadii(tickCornerRadius); 2372 2372 2373 bool isHorizontal = box.style(). appearance() == SliderHorizontalPart;2373 bool isHorizontal = box.style().effectiveAppearance() == SliderHorizontalPart; 2374 2374 if (isHorizontal) { 2375 2375 tickRect.setWidth(tickWidth); … … 2418 2418 FloatRect trackClip = rect; 2419 2419 2420 switch (box.style(). appearance()) {2420 switch (box.style().effectiveAppearance()) { 2421 2421 case SliderHorizontalPart: 2422 2422 // Inset slightly so the thumb covers the edge. -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r283237 r283269 750 750 bool RenderThemeMac::isControlStyled(const RenderStyle& style, const RenderStyle& userAgentStyle) const 751 751 { 752 auto appearance = style. appearance();752 auto appearance = style.effectiveAppearance(); 753 753 if (appearance == TextFieldPart || appearance == TextAreaPart || appearance == SearchFieldPart || appearance == ListboxPart) 754 754 return style.border() != userAgentStyle.border(); … … 784 784 void RenderThemeMac::adjustRepaintRect(const RenderObject& renderer, FloatRect& rect) 785 785 { 786 ControlPart part = renderer.style(). appearance();786 ControlPart part = renderer.style().effectiveAppearance(); 787 787 788 788 #if USE(NEW_THEME) … … 876 876 877 877 // Checkboxes only have tint when checked. 878 if (o.style(). appearance() == CheckboxPart)878 if (o.style().effectiveAppearance() == CheckboxPart) 879 879 return isChecked(o); 880 880 … … 1155 1155 IntSize RenderThemeMac::meterSizeForBounds(const RenderMeter& renderMeter, const IntRect& bounds) const 1156 1156 { 1157 if (NoControlPart == renderMeter.style(). appearance())1157 if (NoControlPart == renderMeter.style().effectiveAppearance()) 1158 1158 return bounds.size(); 1159 1159 … … 1214 1214 { 1215 1215 const RenderStyle& style = renderMeter.style(); 1216 ASSERT(style. appearance() != NoControlPart);1216 ASSERT(style.effectiveAppearance() != NoControlPart); 1217 1217 1218 1218 if (!m_levelIndicator) … … 1243 1243 } 1244 1244 1245 [cell setLevelIndicatorStyle:levelIndicatorStyleFor(style. appearance())];1245 [cell setLevelIndicatorStyle:levelIndicatorStyleFor(style.effectiveAppearance())]; 1246 1246 [cell setUserInterfaceLayoutDirection:style.isLeftToRightDirection() ? NSUserInterfaceLayoutDirectionLeftToRight : NSUserInterfaceLayoutDirectionRightToLeft]; 1247 1247 [cell setMinValue:element->min()]; … … 1275 1275 int maxDimension = static_cast<int>(std::numeric_limits<ushort>::max()); 1276 1276 IntRect progressBarBounds(bounds.x(), bounds.y(), std::min(bounds.width(), maxDimension), std::min(bounds.height(), maxDimension)); 1277 if (NoControlPart == renderObject.style(). appearance())1277 if (NoControlPart == renderObject.style().effectiveAppearance()) 1278 1278 return progressBarBounds; 1279 1279 … … 1590 1590 LengthBox RenderThemeMac::popupInternalPaddingBox(const RenderStyle& style, const Settings&) const 1591 1591 { 1592 if (style. appearance() == MenulistPart) {1592 if (style.effectiveAppearance() == MenulistPart) { 1593 1593 const int* padding = popupButtonPadding(controlSizeForFont(style), style.direction() == TextDirection::RTL); 1594 1594 return { static_cast<int>(padding[topPadding] * style.effectiveZoom()), … … 1598 1598 } 1599 1599 1600 if (style. appearance() == MenulistButtonPart) {1600 if (style.effectiveAppearance() == MenulistButtonPart) { 1601 1601 float arrowWidth = baseArrowWidth * (style.computedFontPixelSize() / baseFontSize); 1602 1602 float rightPadding = ceilf(arrowWidth + (arrowPaddingBefore + arrowPaddingAfter + paddingBeforeSeparator) * style.effectiveZoom()); … … 1695 1695 float zoomedTrackWidth = trackWidth * zoomLevel; 1696 1696 1697 if (o.style(). appearance() == SliderHorizontalPart || o.style().appearance() == MediaSliderPart) {1697 if (o.style().effectiveAppearance() == SliderHorizontalPart || o.style().effectiveAppearance() == MediaSliderPart) { 1698 1698 bounds.setHeight(zoomedTrackWidth); 1699 1699 bounds.setY(r.y() + r.height() / 2 - zoomedTrackWidth / 2); 1700 } else if (o.style(). appearance() == SliderVerticalPart) {1700 } else if (o.style().effectiveAppearance() == SliderVerticalPart) { 1701 1701 bounds.setWidth(zoomedTrackWidth); 1702 1702 bounds.setX(r.x() + r.width() / 2 - zoomedTrackWidth / 2); … … 1717 1717 RetainPtr<CGFunctionRef> mainFunction = adoptCF(CGFunctionCreate(NULL, 1, NULL, 4, NULL, &mainCallbacks)); 1718 1718 RetainPtr<CGShadingRef> mainShading; 1719 if (o.style(). appearance() == SliderVerticalPart)1719 if (o.style().effectiveAppearance() == SliderVerticalPart) 1720 1720 mainShading = adoptCF(CGShadingCreateAxial(cspace, CGPointMake(bounds.x(), bounds.maxY()), CGPointMake(bounds.maxX(), bounds.maxY()), mainFunction.get(), false, false)); 1721 1721 else … … 1740 1740 bool RenderThemeMac::paintSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r) 1741 1741 { 1742 NSSliderCell* sliderThumbCell = o.style(). appearance() == SliderThumbVerticalPart1742 NSSliderCell* sliderThumbCell = o.style().effectiveAppearance() == SliderThumbVerticalPart 1743 1743 ? sliderThumbVertical() 1744 1744 : sliderThumbHorizontal(); … … 1755 1755 // Update the pressed state using the NSCell tracking methods, since that's how NSSliderCell keeps track of it. 1756 1756 bool oldPressed; 1757 if (o.style(). appearance() == SliderThumbVerticalPart)1757 if (o.style().effectiveAppearance() == SliderThumbVerticalPart) 1758 1758 oldPressed = m_isSliderThumbVerticalPressed; 1759 1759 else … … 1762 1762 bool pressed = isPressed(o); 1763 1763 1764 if (o.style(). appearance() == SliderThumbVerticalPart)1764 if (o.style().effectiveAppearance() == SliderThumbVerticalPart) 1765 1765 m_isSliderThumbVerticalPressed = pressed; 1766 1766 else … … 1778 1778 FloatRect bounds = r; 1779 1779 // Make the height of the vertical slider slightly larger so NSSliderCell will draw a vertical slider. 1780 if (o.style(). appearance() == SliderThumbVerticalPart)1780 if (o.style().effectiveAppearance() == SliderThumbVerticalPart) 1781 1781 bounds.setHeight(bounds.height() + verticalSliderHeightPadding * o.style().effectiveZoom()); 1782 1782 … … 2115 2115 { 2116 2116 float zoomLevel = style.effectiveZoom(); 2117 if (style. appearance() == SliderThumbHorizontalPart || style.appearance() == SliderThumbVerticalPart) {2117 if (style.effectiveAppearance() == SliderThumbHorizontalPart || style.effectiveAppearance() == SliderThumbVerticalPart) { 2118 2118 style.setWidth(Length(static_cast<int>(sliderThumbThickness * zoomLevel), LengthType::Fixed)); 2119 2119 style.setHeight(Length(static_cast<int>(sliderThumbThickness * zoomLevel), LengthType::Fixed)); -
trunk/Source/WebCore/rendering/RenderThemeWin.cpp
r282237 r283269 380 380 bool RenderThemeWin::supportsFocusRing(const RenderStyle& style) const 381 381 { 382 return supportsFocus(style. appearance());382 return supportsFocus(style.effectiveAppearance()); 383 383 } 384 384 … … 386 386 { 387 387 unsigned state = 0; 388 switch (o.style(). appearance()) {388 switch (o.style().effectiveAppearance()) { 389 389 case PushButtonPart: 390 390 case ButtonPart: … … 398 398 case RadioPart: 399 399 case CheckboxPart: 400 state = (o.style(). appearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK;400 state = (o.style().effectiveAppearance() == RadioPart) ? DFCS_BUTTONRADIO : DFCS_BUTTONCHECK; 401 401 if (isChecked(o)) 402 402 state |= DFCS_CHECKED; … … 433 433 { 434 434 unsigned result = TS_NORMAL; 435 ControlPart appearance = o.style(). appearance();435 ControlPart appearance = o.style().effectiveAppearance(); 436 436 if (!isEnabled(o)) 437 437 result = TS_DISABLED; … … 456 456 if (!isEnabled(o)) 457 457 result = TUS_DISABLED; 458 else if (supportsFocus(o.style(). appearance()) && isFocused(o))458 else if (supportsFocus(o.style().effectiveAppearance()) && isFocused(o)) 459 459 result = TUS_FOCUSED; 460 460 else if (isPressed(o)) … … 472 472 else if (isPressed(o)) 473 473 result = PBS_PRESSED; 474 else if (supportsFocus(o.style(). appearance()) && isFocused(o))474 else if (supportsFocus(o.style().effectiveAppearance()) && isFocused(o)) 475 475 result = PBS_DEFAULTED; 476 476 else if (isHovered(o)) … … 497 497 { 498 498 ThemeData result; 499 switch (o.style(). appearance()) {499 switch (o.style().effectiveAppearance()) { 500 500 case PushButtonPart: 501 501 case ButtonPart: … … 552 552 553 553 ThemeData result; 554 switch (o.style(). appearance()) {554 switch (o.style().effectiveAppearance()) { 555 555 case PushButtonPart: 556 556 case ButtonPart: … … 634 634 ::DrawEdge(hdc, &widgetRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST); 635 635 ::FillRect(hdc, &widgetRect, (HBRUSH)GetStockObject(GRAY_BRUSH)); 636 } else if ((o.style(). appearance() == SliderThumbHorizontalPart637 || o.style(). appearance() == SliderThumbVerticalPart)636 } else if ((o.style().effectiveAppearance() == SliderThumbHorizontalPart 637 || o.style().effectiveAppearance() == SliderThumbVerticalPart) 638 638 && (themeData.m_part == TKP_THUMBBOTTOM || themeData.m_part == TKP_THUMBTOP 639 639 || themeData.m_part == TKP_THUMBLEFT || themeData.m_part == TKP_THUMBRIGHT)) { … … 659 659 } else { 660 660 // Push buttons, buttons, checkboxes and radios, and the dropdown arrow in menulists. 661 if (o.style(). appearance() == DefaultButtonPart) {661 if (o.style().effectiveAppearance() == DefaultButtonPart) { 662 662 HBRUSH brush = ::GetSysColorBrush(COLOR_3DDKSHADOW); 663 663 ::FrameRect(hdc, &widgetRect, brush); … … 811 811 IntRect bounds = r; 812 812 813 if (o.style(). appearance() == SliderHorizontalPart) {813 if (o.style().effectiveAppearance() == SliderHorizontalPart) { 814 814 bounds.setHeight(trackWidth); 815 815 bounds.setY(r.y() + r.height() / 2 - trackWidth / 2); 816 } else if (o.style(). appearance() == SliderVerticalPart) {816 } else if (o.style().effectiveAppearance() == SliderVerticalPart) { 817 817 bounds.setWidth(trackWidth); 818 818 bounds.setX(r.x() + r.width() / 2 - trackWidth / 2); … … 834 834 void RenderThemeWin::adjustSliderThumbSize(RenderStyle& style, const Element*) const 835 835 { 836 ControlPart part = style. appearance();836 ControlPart part = style.effectiveAppearance(); 837 837 if (part == SliderThumbVerticalPart) { 838 838 style.setWidth(Length(sliderThumbHeight, LengthType::Fixed)); -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r283082 r283269 458 458 { 459 459 // FIXME: Not a very smart hash. Could be improved upon. See <https://bugs.webkit.org/show_bug.cgi?id=121131>. 460 unsigned hash = m_rareNonInheritedData-> appearance;460 unsigned hash = m_rareNonInheritedData->effectiveAppearance; 461 461 hash ^= m_rareNonInheritedData->marginBeforeCollapse; 462 462 hash ^= m_rareNonInheritedData->marginAfterCollapse; … … 480 480 bool RenderStyle::equalForTextAutosizing(const RenderStyle& other) const 481 481 { 482 return m_rareNonInheritedData-> appearance == other.m_rareNonInheritedData->appearance482 return m_rareNonInheritedData->effectiveAppearance == other.m_rareNonInheritedData->effectiveAppearance 483 483 && m_rareNonInheritedData->marginBeforeCollapse == other.m_rareNonInheritedData->marginBeforeCollapse 484 484 && m_rareNonInheritedData->marginAfterCollapse == other.m_rareNonInheritedData->marginAfterCollapse … … 651 651 ASSERT(&first != &second); 652 652 653 if (first. appearance != second.appearance653 if (first.effectiveAppearance != second.effectiveAppearance 654 654 || first.marginBeforeCollapse != second.marginBeforeCollapse 655 655 || first.marginAfterCollapse != second.marginAfterCollapse -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r283082 r283269 216 216 217 217 bool hasAppearance() const { return appearance() != NoControlPart; } 218 bool hasEffectiveAppearance() const { return effectiveAppearance() != NoControlPart; } 218 219 219 220 bool hasBackground() const; … … 510 511 bool hasOpacity() const { return m_rareNonInheritedData->opacity < 1; } 511 512 ControlPart appearance() const { return static_cast<ControlPart>(m_rareNonInheritedData->appearance); } 513 ControlPart effectiveAppearance() const { return static_cast<ControlPart>(m_rareNonInheritedData->effectiveAppearance); } 512 514 AspectRatioType aspectRatioType() const { return static_cast<AspectRatioType>(m_rareNonInheritedData->aspectRatioType); } 513 515 double aspectRatioWidth() const { return m_rareNonInheritedData->aspectRatioWidth; } … … 1132 1134 void setHasAutoCaretColor() { SET_VAR(m_rareInheritedData, hasAutoCaretColor, true); SET_VAR(m_rareInheritedData, caretColor, currentColor()); } 1133 1135 void setOpacity(float f) { float v = clampTo<float>(f, 0.f, 1.f); SET_VAR(m_rareNonInheritedData, opacity, v); } 1134 void setAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, appearance, a); } 1136 void setAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, appearance, a); SET_VAR(m_rareNonInheritedData, effectiveAppearance, a); } 1137 void setEffectiveAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, effectiveAppearance, a); } 1135 1138 // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/#alignment 1136 1139 void setBoxAlign(BoxAlignment a) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, align, static_cast<unsigned>(a)); } -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r282750 r283269 93 93 , marginAfterCollapse(static_cast<unsigned>(MarginCollapse::Collapse)) 94 94 , appearance(static_cast<unsigned>(RenderStyle::initialAppearance())) 95 , effectiveAppearance(static_cast<unsigned>(RenderStyle::initialAppearance())) 95 96 , borderFit(static_cast<unsigned>(RenderStyle::initialBorderFit())) 96 97 , textCombine(static_cast<unsigned>(RenderStyle::initialTextCombine())) … … 193 194 , marginAfterCollapse(o.marginAfterCollapse) 194 195 , appearance(o.appearance) 196 , effectiveAppearance(o.effectiveAppearance) 195 197 , borderFit(o.borderFit) 196 198 , textCombine(o.textCombine) … … 297 299 && marginAfterCollapse == o.marginAfterCollapse 298 300 && appearance == o.appearance 301 && effectiveAppearance == o.effectiveAppearance 299 302 && borderFit == o.borderFit 300 303 && textCombine == o.textCombine -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r282750 r283269 202 202 unsigned marginAfterCollapse : 2; // MarginCollapse 203 203 unsigned appearance : 6; // EAppearance 204 unsigned effectiveAppearance : 6; // EAppearance 204 205 unsigned borderFit : 1; // BorderFit 205 206 unsigned textCombine : 1; // CSS3 text-combine properties -
trunk/Source/WebCore/style/MatchedDeclarationsCache.cpp
r278277 r283269 54 54 if (style.hasAttrContent() || (style.styleType() != PseudoId::None && parentStyle.hasAttrContent())) 55 55 return false; 56 if (style.has Appearance())56 if (style.hasEffectiveAppearance()) 57 57 return false; 58 58 if (style.zoom() != RenderStyle::initialZoom()) -
trunk/Source/WebCore/style/StyleAdjuster.cpp
r283079 r283269 460 460 461 461 // Menulists should have visible overflow 462 if (style. appearance() == MenulistPart) {462 if (style.effectiveAppearance() == MenulistPart) { 463 463 style.setOverflowX(Overflow::Visible); 464 464 style.setOverflowY(Overflow::Visible); -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r283134 r283269 247 247 || is<HTMLProgressElement>(element) 248 248 || (is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isSearchField())) { 249 if (existingStyle && update.style-> appearance() != existingStyle->appearance()) {249 if (existingStyle && update.style->effectiveAppearance() != existingStyle->effectiveAppearance()) { 250 250 update.change = Change::Renderer; 251 251 descendantsToResolve = DescendantsToResolve::All;
Note:
See TracChangeset
for help on using the changeset viewer.