Changeset 289201 in webkit


Ignore:
Timestamp:
Feb 7, 2022, 1:22:33 AM (4 years ago)
Author:
Ziran Sun
Message:

[Forms] Alias appearance <compat-auto> keywords to 'auto'
https://bugs.webkit.org/show_bug.cgi?id=235944

Reviewed by Aditya Keerthi.

Source/WebCore:

This CL alias the <compat-auto> keywords 'auto'. We need to address the cases of MenuList, button,
square-button, push-button and slider-horizontal etc. separately.

Spec ref: https://drafts.csswg.org/css-ui-4/#typedef-appearance-compat-auto

  • rendering/RenderTheme.cpp:

(WebCore::RenderTheme::adjustAppearanceWithElementType const):
(WebCore::RenderTheme::adjustStyle):
(WebCore::RenderTheme::paint):

  • rendering/RenderTheme.h:

LayoutTests:

Unskip tests in test expactation files that are now passing.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r289196 r289201  
     12022-02-07  Ziran Sun  <zsun@igalia.com>
     2
     3        [Forms] Alias appearance <compat-auto> keywords to 'auto'
     4        https://bugs.webkit.org/show_bug.cgi?id=235944
     5
     6        Reviewed by Aditya Keerthi.
     7
     8        Unskip tests in test expactation files that are now passing.         
     9        * TestExpectations:
     10        * platform/gtk/TestExpectations:
     11
    1122022-02-06  Jean-Yves Avenard  <jya@apple.com>
    213
  • trunk/LayoutTests/TestExpectations

    r289165 r289201  
    43064306# New failures after updating WPT import of css/css-text on 2020-07
    43074307webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-button-001.html [ ImageOnlyFailure ]
    4308 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-checkbox-001.html [ ImageOnlyFailure ]
    4309 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-listbox-001.html [ ImageOnlyFailure ]
    43104308webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-menulist-001.html [ ImageOnlyFailure ]
    4311 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-menulist-button-001.html [ ImageOnlyFailure ]
    43124309webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-menulist-button-002.tentative.html [ ImageOnlyFailure ]
    4313 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-meter-001.html [ ImageOnlyFailure ]
    4314 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-progress-bar-001.html [ ImageOnlyFailure ]
    43154310webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-push-button-001.html [ ImageOnlyFailure ]
    4316 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-radio-001.html [ ImageOnlyFailure ]
    4317 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-searchfield-001.html [ ImageOnlyFailure ]
    43184311webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-slider-horizontal-001.html [ ImageOnlyFailure ]
    43194312webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-square-button-001.html [ ImageOnlyFailure ]
    4320 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-textarea-001.html [ ImageOnlyFailure ]
    43214313webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-textfield-001.html [ ImageOnlyFailure ]
    43224314webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/outline-021.html [ ImageOnlyFailure ]
     
    43284320webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/text-overflow-ruby.html [ ImageOnlyFailure ]
    43294321webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-button-001.html [ ImageOnlyFailure ]
    4330 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-checkbox-001.html [ ImageOnlyFailure ]
    4331 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-listbox-001.html [ ImageOnlyFailure ]
    43324322webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-menulist-001.html [ ImageOnlyFailure ]
    4333 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-menulist-button-001.html [ ImageOnlyFailure ]
    43344323webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-menulist-button-002.tentative.html [ ImageOnlyFailure ]
    4335 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-meter-001.html [ ImageOnlyFailure ]
    4336 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-progress-bar-001.html [ ImageOnlyFailure ]
    43374324webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-push-button-001.html [ ImageOnlyFailure ]
    4338 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-radio-001.html [ ImageOnlyFailure ]
    4339 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-searchfield-001.html [ ImageOnlyFailure ]
    43404325webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-slider-horizontal-001.html [ ImageOnlyFailure ]
    43414326webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-square-button-001.html [ ImageOnlyFailure ]
    4342 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-textarea-001.html [ ImageOnlyFailure ]
    43434327webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/webkit-appearance-textfield-001.html [ ImageOnlyFailure ]
    43444328webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/resize-child-will-change-transform.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r289140 r289201  
    186186webkit.org/b/216777 compositing/video/video-update-rendering.html [ Pass Crash ]
    187187webkit.org/b/216777 imported/w3c/web-platform-tests/css/css-text/writing-system/writing-system-segment-break-001.html [ ImageOnlyFailure Crash ]
    188 webkit.org/b/216777 imported/w3c/web-platform-tests/css/css-ui/appearance-checkbox-001.html [ ImageOnlyFailure Crash ]
    189 webkit.org/b/216777 webkit.org/b/214299 imported/w3c/web-platform-tests/css/css-ui/appearance-listbox-001.html [ ImageOnlyFailure Crash ]
    190188
    191189# Navigation
  • trunk/Source/WebCore/ChangeLog

    r289199 r289201  
     12022-02-07  Ziran Sun  <zsun@igalia.com>
     2
     3        [Forms] Alias appearance <compat-auto> keywords to 'auto'
     4        https://bugs.webkit.org/show_bug.cgi?id=235944
     5
     6        Reviewed by Aditya Keerthi.
     7
     8        This CL alias the <compat-auto> keywords 'auto'. We need to address the cases of MenuList, button,
     9        square-button, push-button and slider-horizontal etc. separately.
     10
     11        Spec ref: https://drafts.csswg.org/css-ui-4/#typedef-appearance-compat-auto       
     12
     13        * rendering/RenderTheme.cpp:
     14        (WebCore::RenderTheme::adjustAppearanceWithElementType const):
     15        (WebCore::RenderTheme::adjustStyle):
     16        (WebCore::RenderTheme::paint):
     17        * rendering/RenderTheme.h:
     18
    1192022-02-06  Lauro Moura  <lmoura@igalia.com>
    220
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r287663 r289201  
    8585}
    8686
     87ControlPart RenderTheme::adjustAppearanceForElement(RenderStyle& style, const Element* element) const
     88{
     89    if (!element)
     90        return NoControlPart;
     91
     92    ControlPart part = style.effectiveAppearance();
     93    ControlPart autoAppearance = autoAppearanceForElement(element);
     94    if (part == autoAppearance)
     95        return part;
     96
     97    // Aliases of 'auto'.
     98    // https://drafts.csswg.org/css-ui-4/#typedef-appearance-compat-auto
     99    if (part == AutoPart || part == SearchFieldPart || part == TextAreaPart || part == CheckboxPart || part == RadioPart || part == ListboxPart || part == MeterPart || part == ProgressBarPart) {
     100        style.setEffectiveAppearance(autoAppearance);
     101        return autoAppearance;
     102    }
     103
     104    // The following keywords should work well for some element types
     105    // even if their default appearances are different from the keywords.
     106    if (part == MenulistButtonPart && autoAppearance != MenulistPart) {
     107        style.setEffectiveAppearance(autoAppearance);
     108        part = autoAppearance;
     109    }
     110
     111    return part;
     112}
     113
    87114void RenderTheme::adjustStyle(RenderStyle& style, const Element* element, const RenderStyle* userAgentAppearanceStyle)
    88115{
    89     auto part = style.effectiveAppearance();
    90     if (part == AutoPart) {
    91         part = autoAppearanceForElement(element);
    92 
    93         ASSERT(part != AutoPart);
    94         style.setEffectiveAppearance(part);
    95 
    96         if (part == NoControlPart)
    97             return;
    98     }
     116    auto part = adjustAppearanceForElement(style, element);
     117
     118    if (part == NoControlPart)
     119        return;
    99120
    100121    // Force inline and table display styles to be inline-block (except for table- which is block)
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r287663 r289201  
    467467private:
    468468    ControlPart autoAppearanceForElement(const Element*) const;
     469    ControlPart adjustAppearanceForElement(RenderStyle&, const Element*) const;
    469470
    470471    void adjustSearchFieldDecorationStyle(RenderStyle&, const Element*) const;
Note: See TracChangeset for help on using the changeset viewer.