- Revision
- 261450
- Author
- [email protected]
- Date
- 2020-05-09 20:05:40 -0700 (Sat, 09 May 2020)
Log Message
[macOS] Search field on mayoclinic.org/forms/us-resident-appointment clips the submit button
https://bugs.webkit.org/show_bug.cgi?id=211673
<rdar://problem/62572501>
Reviewed by Tim Horton.
Source/WebCore:
Allow search fields to be style-able, but only if the CSS `border` value is non-default.
Note that there was a previous attempt to achieve something similar in r157443 by adding search fields to the
base class implementation of `RenderTheme::isControlStyled`; however, this patch wasn't actually accompanied by
support for rendering native search fields with a non-default background, which meant that customizing just the
background of a search field would cause the entire search field to opt out of the native search field
appearance (a pill with rounded corners on macOS).
However, in the case where the border is customized on macOS, it is incorrect to use the default search field
appearance, since the search field cell just consists of a border; as such, there should be little compatibility
risk of a web page unexpectedly getting the fallback (non-native) appearance for a search field, due to having
custom border styles.
This also makes the behavior of search fields match that of text fields, textareas, and list boxes (multi-option
selects) on macOS, in terms of what is needed in order to bail out of native appearance rendering.
Rebaselined existing tests: fast/css/text-input-with-webkit-border-radius.html
fast/forms/search-styled.html
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::isControlStyled const): Add SearchFieldPart.
LayoutTests:
Rebaseline a couple of layout tests that contain search fields with custom CSS border styles.
* platform/mac/fast/css/text-input-with-webkit-border-radius-expected.txt:
* platform/mac/fast/forms/search-styled-expected.txt:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (261449 => 261450)
--- trunk/LayoutTests/ChangeLog 2020-05-10 01:21:55 UTC (rev 261449)
+++ trunk/LayoutTests/ChangeLog 2020-05-10 03:05:40 UTC (rev 261450)
@@ -1,3 +1,16 @@
+2020-05-09 Wenson Hsieh <[email protected]>
+
+ [macOS] Search field on mayoclinic.org/forms/us-resident-appointment clips the submit button
+ https://bugs.webkit.org/show_bug.cgi?id=211673
+ <rdar://problem/62572501>
+
+ Reviewed by Tim Horton.
+
+ Rebaseline a couple of layout tests that contain search fields with custom CSS border styles.
+
+ * platform/mac/fast/css/text-input-with-webkit-border-radius-expected.txt:
+ * platform/mac/fast/forms/search-styled-expected.txt:
+
2020-05-09 Kenneth Russell <[email protected]>
[ macOS ] REGRESSION (r259139): webgl/2.0.0/conformance2/rendering/framebuffer-completeness-unaffected.html is failing
Modified: trunk/LayoutTests/platform/mac/fast/css/text-input-with-webkit-border-radius-expected.txt (261449 => 261450)
--- trunk/LayoutTests/platform/mac/fast/css/text-input-with-webkit-border-radius-expected.txt 2020-05-10 01:21:55 UTC (rev 261449)
+++ trunk/LayoutTests/platform/mac/fast/css/text-input-with-webkit-border-radius-expected.txt 2020-05-10 03:05:40 UTC (rev 261450)
@@ -15,13 +15,13 @@
RenderText {#text} at (0,0) size 629x18
text run at (0,0) width 629: "If the test passes, you will see a text entry field containing \"default text\" inside the grey div below."
RenderBlock {DIV} at (0,68) size 163x45 [bgcolor=#888888]
- RenderTextControl {INPUT} at (11,9) size 133x19 [bgcolor=#00FF00] [border: (2px inset #000000)]
- RenderFlexibleBox {DIV} at (3,0) size 127x19
+ RenderTextControl {INPUT} at (11,9) size 133x25 [bgcolor=#00FF00] [border: (2px inset #000000)]
+ RenderFlexibleBox {DIV} at (3,3) size 127x19
RenderBlock {DIV} at (0,0) size 8x19
RenderBlock {DIV} at (8,3) size 100x13
RenderBlock {DIV} at (108,0) size 19x19
RenderText {#text} at (0,0) size 0x0
-layer at (30,96) size 100x13
+layer at (30,99) size 100x13
RenderBlock {DIV} at (0,0) size 100x13
RenderText {#text} at (0,0) size 60x13
text run at (0,0) width 60: "default text"
Modified: trunk/LayoutTests/platform/mac/fast/forms/search-styled-expected.txt (261449 => 261450)
--- trunk/LayoutTests/platform/mac/fast/forms/search-styled-expected.txt 2020-05-10 01:21:55 UTC (rev 261449)
+++ trunk/LayoutTests/platform/mac/fast/forms/search-styled-expected.txt 2020-05-10 03:05:40 UTC (rev 261450)
@@ -1,17 +1,17 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
-layer at (0,0) size 800x39
- RenderBlock {HTML} at (0,0) size 800x39
- RenderBody {BODY} at (8,8) size 784x23
- RenderTextControl {INPUT} at (2,2) size 187x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
- RenderFlexibleBox {DIV} at (3,0) size 181x19
+layer at (0,0) size 800x47
+ RenderBlock {HTML} at (0,0) size 800x47
+ RenderBody {BODY} at (8,8) size 784x31
+ RenderTextControl {INPUT} at (2,2) size 226x27 [bgcolor=#FFFFFF] [border: (1px solid #BDC7D8)]
+ RenderFlexibleBox {DIV} at (18,4) size 204x19
RenderBlock {DIV} at (0,0) size 22x19
- RenderBlock {DIV} at (22,3) size 140x13
- RenderBlock {DIV} at (161,0) size 20x19
+ RenderBlock {DIV} at (22,3) size 163x13
+ RenderBlock {DIV} at (185,0) size 19x19
RenderText {#text} at (0,0) size 0x0
-layer at (35,13) size 140x13
- RenderBlock {DIV} at (25,3) size 140x13 [color=#A9A9A9]
- RenderText {#text} at (0,0) size 93x13
- text run at (0,0) width 93: "Search for Events"
-layer at (35,13) size 140x13
- RenderBlock {DIV} at (0,0) size 140x13
+layer at (50,17) size 163x13
+ RenderBlock {DIV} at (40,7) size 163x13 [color=#A9A9A9]
+ RenderText {#text} at (0,0) size 92x13
+ text run at (0,0) width 92: "Search for Events"
+layer at (50,17) size 163x13
+ RenderBlock {DIV} at (0,0) size 163x13
Modified: trunk/Source/WebCore/ChangeLog (261449 => 261450)
--- trunk/Source/WebCore/ChangeLog 2020-05-10 01:21:55 UTC (rev 261449)
+++ trunk/Source/WebCore/ChangeLog 2020-05-10 03:05:40 UTC (rev 261450)
@@ -1,3 +1,33 @@
+2020-05-09 Wenson Hsieh <[email protected]>
+
+ [macOS] Search field on mayoclinic.org/forms/us-resident-appointment clips the submit button
+ https://bugs.webkit.org/show_bug.cgi?id=211673
+ <rdar://problem/62572501>
+
+ Reviewed by Tim Horton.
+
+ Allow search fields to be style-able, but only if the CSS `border` value is non-default.
+
+ Note that there was a previous attempt to achieve something similar in r157443 by adding search fields to the
+ base class implementation of `RenderTheme::isControlStyled`; however, this patch wasn't actually accompanied by
+ support for rendering native search fields with a non-default background, which meant that customizing just the
+ background of a search field would cause the entire search field to opt out of the native search field
+ appearance (a pill with rounded corners on macOS).
+
+ However, in the case where the border is customized on macOS, it is incorrect to use the default search field
+ appearance, since the search field cell just consists of a border; as such, there should be little compatibility
+ risk of a web page unexpectedly getting the fallback (non-native) appearance for a search field, due to having
+ custom border styles.
+
+ This also makes the behavior of search fields match that of text fields, textareas, and list boxes (multi-option
+ selects) on macOS, in terms of what is needed in order to bail out of native appearance rendering.
+
+ Rebaselined existing tests: fast/css/text-input-with-webkit-border-radius.html
+ fast/forms/search-styled.html
+
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::isControlStyled const): Add SearchFieldPart.
+
2020-05-09 Jer Noble <[email protected]>
REGRESSION(r258493): CRASH running fast/mediastream/RTCPeerConnection tests
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (261449 => 261450)
--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2020-05-10 01:21:55 UTC (rev 261449)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm 2020-05-10 03:05:40 UTC (rev 261450)
@@ -866,7 +866,8 @@
bool RenderThemeMac::isControlStyled(const RenderStyle& style, const RenderStyle& userAgentStyle) const
{
- if (style.appearance() == TextFieldPart || style.appearance() == TextAreaPart || style.appearance() == ListboxPart)
+ auto appearance = style.appearance();
+ if (appearance == TextFieldPart || appearance == TextAreaPart || appearance == SearchFieldPart || appearance == ListboxPart)
return style.border() != userAgentStyle.border();
// FIXME: This is horrible, but there is not much else that can be done. Menu lists cannot draw properly when
@@ -873,7 +874,7 @@
// scaled. They can't really draw properly when transformed either. We can't detect the transform case at style
// adjustment time so that will just have to stay broken. We can however detect that we're zooming. If zooming
// is in effect we treat it like the control is styled.
- if (style.appearance() == MenulistPart && style.effectiveZoom() != 1.0f)
+ if (appearance == MenulistPart && style.effectiveZoom() != 1.0f)
return true;
return RenderTheme::isControlStyled(style, userAgentStyle);