Changeset 274411 in webkit
- Timestamp:
- Mar 15, 2021 4:27:16 AM (16 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/radiobutton-min-size-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/Theme.cpp (modified) (1 diff)
-
Source/WebCore/platform/Theme.h (modified) (2 diffs)
-
Source/WebCore/rendering/RenderTheme.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r274408 r274411 1 2021-03-10 Sergio Villar Senin <svillar@igalia.com> 2 3 Do not shrink radio buttons bellow its size 4 https://bugs.webkit.org/show_bug.cgi?id=215575 5 6 Reviewed by Darin Adler. 7 8 * web-platform-tests/css/css-flexbox/radiobutton-min-size-expected.txt: Replaced FAIL by PASS expectations. 9 1 10 2021-03-14 Sam Weinig <weinig@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/radiobutton-min-size-expected.txt
r272795 r274411 5 5 Text 6 6 7 FAIL two radio button widths are identical assert_equals: width should be equal expected 0 but got 12 7 PASS two radio button widths are identical 8 8 -
trunk/Source/WebCore/ChangeLog
r274410 r274411 1 2021-03-10 Sergio Villar Senin <svillar@igalia.com> 2 3 Do not shrink radio buttons bellow its size 4 https://bugs.webkit.org/show_bug.cgi?id=215575 5 6 Reviewed by Darin Adler. 7 8 A radio button used as a flex item would be invisible by default because it'll compute is 9 min-size to 0. That's why we should not let them shrink below their size (width/height). 10 11 * platform/Theme.cpp: 12 (WebCore::Theme::minimumControlSize const): Do not let Radio buttons shrink bellow their size. 13 * platform/Theme.h: make minimumControlSize() protected. Add a new non-virtual method with the same parameter 14 plus another one (the minimum size under which we cannot shrink) which calls the virtual method. 15 * rendering/RenderTheme.cpp: 16 (WebCore::RenderTheme::adjustStyle): Pass the {style.width(),style.height()} as the minimum size under which 17 we should not shrink the control. 18 1 19 2021-03-15 Kimmo Kinnunen <kkinnunen@apple.com> 2 20 -
trunk/Source/WebCore/platform/Theme.cpp
r272805 r274411 47 47 { 48 48 return zoomedSize; 49 } 50 51 LengthSize Theme::minimumControlSize(ControlPart part, const FontCascade& fontCascade, const LengthSize& zoomedSize, const LengthSize& nonShrinkableZoomedSize, float zoom) const 52 { 53 auto minSize = minimumControlSize(part, fontCascade, zoomedSize, zoom); 54 if (part == ControlPart::RadioPart) { 55 if (zoomedSize.width.isIntrinsicOrAuto()) 56 minSize.width = nonShrinkableZoomedSize.width; 57 if (zoomedSize.height.isIntrinsicOrAuto()) 58 minSize.height = nonShrinkableZoomedSize.height; 59 } 60 return minSize; 49 61 } 50 62 -
trunk/Source/WebCore/platform/Theme.h
r270823 r274411 58 58 59 59 // Returns the minimum size for a control in zoomed coordinates. 60 virtual LengthSize minimumControlSize(ControlPart, const FontCascade&, const LengthSize& zoomedSize, float zoomFactor) const;60 LengthSize minimumControlSize(ControlPart, const FontCascade&, const LengthSize& zoomedSize, const LengthSize& nonShrinkableZoomedSize, float zoomFactor) const; 61 61 62 62 // Allows the theme to modify the existing padding/border. … … 85 85 virtual ~Theme() = default; 86 86 87 virtual LengthSize minimumControlSize(ControlPart, const FontCascade&, const LengthSize& zoomedSize, float zoomFactor) const; 88 87 89 private: 88 90 Theme(const Theme&) = delete; -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r274232 r274411 169 169 170 170 // Min-Width / Min-Height 171 LengthSize minControlSize = Theme::singleton().minimumControlSize(part, style.fontCascade(), { style.minWidth(), style.minHeight() }, style.effectiveZoom());171 LengthSize minControlSize = Theme::singleton().minimumControlSize(part, style.fontCascade(), { style.minWidth(), style.minHeight() }, { style.width(), style.height() }, style.effectiveZoom()); 172 172 if (minControlSize.width != style.minWidth()) 173 173 style.setMinWidth(WTFMove(minControlSize.width));
Note: See TracChangeset
for help on using the changeset viewer.