Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[iOS] Search inputs with '-webkit-appearance: textfield' should have …
…a textfield background color https://bugs.webkit.org/show_bug.cgi?id=229883 rdar://82146288 Reviewed by Tim Horton. Source/WebCore: In iOS 15, search inputs have a gray background color by default. Some sites, such as booking.com, request that the input appear like a textfield, by specifying '-webkit-appearance: textfield', over the default 'searchfield'. This request was previously ignored, but there was no observable difference since search inputs and text inputs had the same default styling before iOS 15. Now that the default styling is different, the appearance should be honored, so that sites get the background color they expect. Test: fast/forms/ios/form-control-refresh/search/textfield-appearance-background.html * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::adjustTextFieldStyle const): Exclude any elements that have a textfield appearance by default from the background color adjustment, so that their background color can be customized. LayoutTests: * fast/forms/ios/form-control-refresh/search/textfield-appearance-background-expected.txt: Added. * fast/forms/ios/form-control-refresh/search/textfield-appearance-background.html: Added. * platform/ios/fast/css/input-search-padding-expected.txt: Rebaseline. Canonical link: https://commits.webkit.org/241704@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@282451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
7 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...s/fast/forms/ios/form-control-refresh/search/textfield-appearance-background-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Test that setting -webkit-appearance: textfield on a search input sets the background color to match the text input background color. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS textBackgroundColor is "rgb(255, 255, 255)" | ||
PASS searchBackgroundColor is textBackgroundColor | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
26 changes: 26 additions & 0 deletions
26
LayoutTests/fast/forms/ios/form-control-refresh/search/textfield-appearance-background.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true IOSFormControlRefreshEnabled=true ] --> | ||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> | ||
<script src="../../../../../resources/js-test.js"></script> | ||
<style> | ||
#search { | ||
-webkit-appearance: textfield; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<input type="search" id="search"> | ||
<input type="text" id="text"> | ||
</body> | ||
<script> | ||
|
||
description("Test that setting -webkit-appearance: textfield on a search input sets the background color to match the text input background color."); | ||
|
||
searchBackgroundColor = window.getComputedStyle(search).backgroundColor; | ||
textBackgroundColor = window.getComputedStyle(text).backgroundColor; | ||
shouldBeEqualToString("textBackgroundColor", "rgb(255, 255, 255)"); | ||
shouldBe("searchBackgroundColor", "textBackgroundColor"); | ||
|
||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters