Changeset 287753 in webkit
- Timestamp:
- Jan 7, 2022, 9:32:52 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/forms/checkbox-radio-font-size-expected.html (added)
-
LayoutTests/fast/forms/checkbox-radio-font-size.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/mac/ThemeMac.mm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r287752 r287753 1 2022-01-07 Aditya Keerthi <akeerthi@apple.com> 2 3 Checkboxes on PurpleAir map controls are much smaller in Safari than other browsers 4 https://bugs.webkit.org/show_bug.cgi?id=234897 5 rdar://83367191 6 7 Reviewed by Darin Adler. 8 9 * fast/forms/checkbox-radio-font-size-expected.html: Added. 10 * fast/forms/checkbox-radio-font-size.html: Added. 11 1 12 2022-01-07 Diego Pino Garcia <dpino@igalia.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r287744 r287753 1 2022-01-07 Aditya Keerthi <akeerthi@apple.com> 2 3 Checkboxes on PurpleAir map controls are much smaller in Safari than other browsers 4 https://bugs.webkit.org/show_bug.cgi?id=234897 5 rdar://83367191 6 7 Reviewed by Darin Adler. 8 9 Unlike other browser engines, WebKit adjusts the size of checkboxes and 10 radio buttons based on the font-size of the element, when the size is 11 unspecified. The checkboxes on PurpleAir have a font-size of 9px, which 12 results in WebKit painting a checkbox using NSControlSizeMini (with a 13 length of 10px). In constrast, Chrome and Firefox simply use their 14 default sizes (13px and 12.6px respectively). 15 16 To fix, remove the font-size adjustments for checkboxes and radio 17 buttons with an unspecified size, and use the current effective 18 default of NSControlSizeSmall (with a length of 12px) to paint the 19 controls. 20 21 This ensures our unspecified sizing behavior matches other browsers. 22 There may be some risk for other WebKit clients that currently rely 23 on font-size getting them their desired size. However, this risk is 24 believed to be minimal given the sizes of these controls are already 25 restricted to a 10 - 16px range. 26 27 Test: fast/forms/checkbox-radio-font-size.html 28 29 * platform/mac/ThemeMac.mm: 30 (WebCore::checkboxSize): 31 (WebCore::radioSize): 32 (WebCore::ThemeMac::controlSize const): 33 1 34 2022-01-07 Alan Bujtas <zalan@apple.com> 2 35 -
trunk/Source/WebCore/platform/mac/ThemeMac.mm
r287697 r287753 282 282 } 283 283 284 static LengthSize checkboxSize(const FontCascade& font, constLengthSize& zoomedSize, float zoomFactor)284 static LengthSize checkboxSize(const LengthSize& zoomedSize, float zoomFactor) 285 285 { 286 286 // If the width and height are both specified, then we have nothing to do. … … 288 288 return zoomedSize; 289 289 290 // Use the font size to determine the intrinsic width of the control. 291 return sizeFromFont(font, zoomedSize, zoomFactor, checkboxSizes()); 290 return sizeFromNSControlSize(NSControlSizeSmall, zoomedSize, zoomFactor, checkboxSizes()); 292 291 } 293 292 … … 323 322 } 324 323 325 static LengthSize radioSize(const FontCascade& font, constLengthSize& zoomedSize, float zoomFactor)324 static LengthSize radioSize(const LengthSize& zoomedSize, float zoomFactor) 326 325 { 327 326 // If the width and height are both specified, then we have nothing to do. … … 329 328 return zoomedSize; 330 329 331 // Use the font size to determine the intrinsic width of the control. 332 return sizeFromFont(font, zoomedSize, zoomFactor, radioSizes()); 330 return sizeFromNSControlSize(NSControlSizeSmall, zoomedSize, zoomFactor, radioSizes()); 333 331 } 334 332 … … 823 821 switch (part) { 824 822 case CheckboxPart: 825 return checkboxSize( font,zoomedSize, zoomFactor);823 return checkboxSize(zoomedSize, zoomFactor); 826 824 case RadioPart: 827 return radioSize( font,zoomedSize, zoomFactor);825 return radioSize(zoomedSize, zoomFactor); 828 826 case PushButtonPart: 829 827 // Height is reset to auto so that specified heights can be ignored.
Note:
See TracChangeset
for help on using the changeset viewer.