haikuwebkit/Source/WebCore/css/legacyFormControlsIOS.css

152 lines
4.5 KiB
CSS
Raw Permalink Normal View History

/*
* Copyright (C) 2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if defined(ENABLE_IOS_FORM_CONTROL_REFRESH) && ENABLE_IOS_FORM_CONTROL_REFRESH
[iOS][FCR] Add new look for checkboxes https://bugs.webkit.org/show_bug.cgi?id=218808 <rdar://problem/71286037> Reviewed by Wenson Hsieh. Source/WebCore: Tests: fast/forms/ios/form-control-refresh/checkbox/border.html fast/forms/ios/form-control-refresh/checkbox/checked-appearance.html fast/forms/ios/form-control-refresh/checkbox/ignored-properties.html fast/forms/ios/form-control-refresh/checkbox/indeterminate-appearance.html fast/forms/ios/form-control-refresh/checkbox/width-height.html * css/iOSFormControlRefresh.css: (input[type="checkbox"]): Use "border: initial" and "box-sizing: border-box" to match macOS, now that the native checkbox styles on macOS and iOS are similar. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckboxDecorations): Move away from using paintCheckboxDecorations to paintCheckbox for the new design. This is necessary to avoid painting custom borders and backgrounds for native checkboxes, matching macOS. Painting both a CSS background as well as the native checkbox can lead to background bleeding. Customizations can still be made using "-webkit-appearance: none". (WebCore::RenderThemeIOS::paintCheckbox): A new implementation for painting checkboxes to match the updated design. The checkmark drawing was generated using SF Symbols. LayoutTests: Added tests to verify the stylability of native checkboxes and to verify that different checkbox states are painted with a different appearance. * fast/forms/ios/form-control-refresh/checkbox/border-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/checkbox/border.html: Added. * fast/forms/ios/form-control-refresh/checkbox/checked-appearance-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/checkbox/checked-appearance.html: Added. * fast/forms/ios/form-control-refresh/checkbox/ignored-properties-expected.html: Added. * fast/forms/ios/form-control-refresh/checkbox/ignored-properties.html: Added. * fast/forms/ios/form-control-refresh/checkbox/indeterminate-appearance-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/checkbox/indeterminate-appearance.html: Added. * fast/forms/ios/form-control-refresh/checkbox/width-height-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/checkbox/width-height.html: Added. Canonical link: https://commits.webkit.org/231665@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-17 18:59:12 +00:00
textarea,
input {
2021-03-03 22:04:55 +00:00
border: 1px solid #4c4c4c;
font: 11px Helvetica, -webkit-pictograph;
}
[iOS][FCR] Add new look for radio buttons https://bugs.webkit.org/show_bug.cgi?id=219046 <rdar://problem/71498263> Reviewed by Wenson Hsieh. Source/WebCore: Tests: fast/forms/ios/form-control-refresh/radio/border.html fast/forms/ios/form-control-refresh/radio/checked-appearance.html fast/forms/ios/form-control-refresh/radio/disabled-appearance.html fast/forms/ios/form-control-refresh/radio/ignored-properties.html fast/forms/ios/form-control-refresh/radio/width-height.html * css/iOSFormControlRefresh.css: (input:matches([type="checkbox"], [type="radio"])): Use "border: initial" and "box-sizing: border-box" to match macOS, now that the native radio button styles on macOS and iOS are similar. This also aligns with the new iOS checkbox style. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintRadioDecorations): Move away from using paintRadioDecorations to paintRadio for the new design. This is necessary to avoid painting custom borders and backgrounds for native checkboxes, matching macOS. Painting both a CSS background as well as the native checkbox can lead to background bleeding. Customizations can still be made using "-webkit-appearance: none". (WebCore::RenderThemeIOS::paintRadio): A new implementation for painting radio buttons to match the updated design. If the button is unchecked, a single circle is painted. Otherwise, an inner and outer circle are painted. LayoutTests: Added tests to verify the stylability of native radio buttons and to verify that different states are painted with a different appearance. * fast/forms/ios/form-control-refresh/radio/border-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/radio/border.html: Added. * fast/forms/ios/form-control-refresh/radio/checked-appearance-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/radio/checked-appearance.html: Added. * fast/forms/ios/form-control-refresh/radio/disabled-appearance-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/radio/disabled-appearance.html: Added. * fast/forms/ios/form-control-refresh/radio/ignored-properties-expected.html: Added. * fast/forms/ios/form-control-refresh/radio/ignored-properties.html: Added. * fast/forms/ios/form-control-refresh/radio/width-height-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/radio/width-height.html: Added. Canonical link: https://commits.webkit.org/231722@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-18 20:28:17 +00:00
input:matches([type="checkbox"], [type="radio"]) {
2021-03-03 22:04:55 +00:00
border: 1px solid #4c4c4c;
[iOS][FCR] Add new look for checkboxes https://bugs.webkit.org/show_bug.cgi?id=218808 <rdar://problem/71286037> Reviewed by Wenson Hsieh. Source/WebCore: Tests: fast/forms/ios/form-control-refresh/checkbox/border.html fast/forms/ios/form-control-refresh/checkbox/checked-appearance.html fast/forms/ios/form-control-refresh/checkbox/ignored-properties.html fast/forms/ios/form-control-refresh/checkbox/indeterminate-appearance.html fast/forms/ios/form-control-refresh/checkbox/width-height.html * css/iOSFormControlRefresh.css: (input[type="checkbox"]): Use "border: initial" and "box-sizing: border-box" to match macOS, now that the native checkbox styles on macOS and iOS are similar. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckboxDecorations): Move away from using paintCheckboxDecorations to paintCheckbox for the new design. This is necessary to avoid painting custom borders and backgrounds for native checkboxes, matching macOS. Painting both a CSS background as well as the native checkbox can lead to background bleeding. Customizations can still be made using "-webkit-appearance: none". (WebCore::RenderThemeIOS::paintCheckbox): A new implementation for painting checkboxes to match the updated design. The checkmark drawing was generated using SF Symbols. LayoutTests: Added tests to verify the stylability of native checkboxes and to verify that different checkbox states are painted with a different appearance. * fast/forms/ios/form-control-refresh/checkbox/border-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/checkbox/border.html: Added. * fast/forms/ios/form-control-refresh/checkbox/checked-appearance-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/checkbox/checked-appearance.html: Added. * fast/forms/ios/form-control-refresh/checkbox/ignored-properties-expected.html: Added. * fast/forms/ios/form-control-refresh/checkbox/ignored-properties.html: Added. * fast/forms/ios/form-control-refresh/checkbox/indeterminate-appearance-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/checkbox/indeterminate-appearance.html: Added. * fast/forms/ios/form-control-refresh/checkbox/width-height-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/checkbox/width-height.html: Added. Canonical link: https://commits.webkit.org/231665@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-17 18:59:12 +00:00
}
[iOS][FCR] Update disabled state for button-like controls https://bugs.webkit.org/show_bug.cgi?id=222318 <rdar://problem/74645980> Reviewed by Wenson Hsieh. Source/WebCore: Update the disabled state for all button-like controls to match the latest specification. The default disabled state is dark gray text on a light gray background. * css/html.css: (input:matches([type="button"], [type="submit"], [type="reset"]):disabled,): (input[type="checkbox"]:indeterminate:disabled): (input:matches([type="checkbox"], [type="radio"]):disabled): (input:matches([type="checkbox"], [type="radio"]):checked:disabled): * css/legacyFormControlsIOS.css: (input[type="checkbox"]:indeterminate:disabled,): (input:matches([type="button"], [type="submit"], [type="reset"]):disabled,): (input[type="file"]:disabled): (input:matches([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]):disabled): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckbox): (WebCore::RenderThemeIOS::paintRadio): (WebCore::RenderThemeIOS::paintMenuListButtonDecorationsWithFormControlRefresh): LayoutTests: Rebaslined tests to account for the new disabled appearance. * platform/ios/fast/forms/basic-inputs-expected.txt: * platform/ios/fast/forms/basic-selects-expected.txt: * platform/ios/fast/forms/disabled-select-change-index-expected.txt: * platform/ios/fast/forms/file/file-input-disabled-expected.txt: * platform/ios/fast/forms/select-disabled-appearance-expected.txt: Canonical link: https://commits.webkit.org/235195@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-11 22:41:13 +00:00
input[type="checkbox"]:indeterminate:disabled,
input:matches([type="checkbox"], [type="radio"]):checked:disabled,
input:matches([type="checkbox"], [type="radio"]):disabled {
opacity: 0.4;
}
input::-webkit-list-button {
2021-03-03 22:04:55 +00:00
width: 16px;
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" stroke="black" fill="black" width="16" height="16"><polygon points="8 11.031, 4.5 4.969, 11.5 4.969"/></svg>');
}
[iOS][FCR] Add new look for search fields https://bugs.webkit.org/show_bug.cgi?id=219443 <rdar://problem/71902666> Reviewed by Wenson Hsieh. Source/WebCore: Tests: fast/forms/ios/form-control-refresh/search/background-color.html fast/forms/ios/form-control-refresh/search/border.html fast/forms/ios/form-control-refresh/search/font-size.html fast/forms/ios/form-control-refresh/search/results-attribute.html fast/forms/ios/form-control-refresh/search/width-height.html * css/formControlsIOS.css: (input[type="search"]): Unlike traditional text fields, the new appearance has no border and a filled background. (input[type="search"]::-webkit-search-decoration,): The new appearance has a magnifying glass glyph in the search field. On macOS, the glyph changes depending on the value of the "results" attribute. However, on iOS, the glyph should always be shown. Consequently, "-webkit-search-decoration", "-webkit-search-results-decoration", and "-webkit-search-results-button" all specify the same glyph. * rendering/RenderThemeIOS.mm: (WebCore::canAdjustBorderRadiusForAppearance): The old search field forced a pill-like appearance. This is no longer required under the new appearance. (WebCore::RenderThemeIOS::adjustRoundBorderRadius): LayoutTests: Added tests to verify the stylability of search fields with the new appearance. * fast/forms/ios/form-control-refresh/search/background-color-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/background-color.html: Added. * fast/forms/ios/form-control-refresh/search/border-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/border.html: Added. * fast/forms/ios/form-control-refresh/search/font-size-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/font-size.html: Added. * fast/forms/ios/form-control-refresh/search/results-attribute-expected.html: Added. * fast/forms/ios/form-control-refresh/search/results-attribute.html: Added. * fast/forms/ios/form-control-refresh/search/width-height-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/width-height.html: Added. Canonical link: https://commits.webkit.org/232084@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-03 19:07:26 +00:00
input[type="search"] {
2021-03-03 22:04:55 +00:00
border: 1px solid #4c4c4c;
background-color: initial;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-decoration {
margin: auto 0;
}
input[type="search"]::-webkit-search-results-button {
align-self: initial;
margin: initial;
[iOS][FCR] Add new look for search fields https://bugs.webkit.org/show_bug.cgi?id=219443 <rdar://problem/71902666> Reviewed by Wenson Hsieh. Source/WebCore: Tests: fast/forms/ios/form-control-refresh/search/background-color.html fast/forms/ios/form-control-refresh/search/border.html fast/forms/ios/form-control-refresh/search/font-size.html fast/forms/ios/form-control-refresh/search/results-attribute.html fast/forms/ios/form-control-refresh/search/width-height.html * css/formControlsIOS.css: (input[type="search"]): Unlike traditional text fields, the new appearance has no border and a filled background. (input[type="search"]::-webkit-search-decoration,): The new appearance has a magnifying glass glyph in the search field. On macOS, the glyph changes depending on the value of the "results" attribute. However, on iOS, the glyph should always be shown. Consequently, "-webkit-search-decoration", "-webkit-search-results-decoration", and "-webkit-search-results-button" all specify the same glyph. * rendering/RenderThemeIOS.mm: (WebCore::canAdjustBorderRadiusForAppearance): The old search field forced a pill-like appearance. This is no longer required under the new appearance. (WebCore::RenderThemeIOS::adjustRoundBorderRadius): LayoutTests: Added tests to verify the stylability of search fields with the new appearance. * fast/forms/ios/form-control-refresh/search/background-color-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/background-color.html: Added. * fast/forms/ios/form-control-refresh/search/border-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/border.html: Added. * fast/forms/ios/form-control-refresh/search/font-size-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/font-size.html: Added. * fast/forms/ios/form-control-refresh/search/results-attribute-expected.html: Added. * fast/forms/ios/form-control-refresh/search/results-attribute.html: Added. * fast/forms/ios/form-control-refresh/search/width-height-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/width-height.html: Added. Canonical link: https://commits.webkit.org/232084@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-03 19:07:26 +00:00
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-results-decoration,
input[type="search"]::-webkit-search-results-button {
2021-03-03 22:04:55 +00:00
background-color: initial;
height: initial;
width: initial;
-webkit-mask-image: initial;
[iOS][FCR] Add new look for search fields https://bugs.webkit.org/show_bug.cgi?id=219443 <rdar://problem/71902666> Reviewed by Wenson Hsieh. Source/WebCore: Tests: fast/forms/ios/form-control-refresh/search/background-color.html fast/forms/ios/form-control-refresh/search/border.html fast/forms/ios/form-control-refresh/search/font-size.html fast/forms/ios/form-control-refresh/search/results-attribute.html fast/forms/ios/form-control-refresh/search/width-height.html * css/formControlsIOS.css: (input[type="search"]): Unlike traditional text fields, the new appearance has no border and a filled background. (input[type="search"]::-webkit-search-decoration,): The new appearance has a magnifying glass glyph in the search field. On macOS, the glyph changes depending on the value of the "results" attribute. However, on iOS, the glyph should always be shown. Consequently, "-webkit-search-decoration", "-webkit-search-results-decoration", and "-webkit-search-results-button" all specify the same glyph. * rendering/RenderThemeIOS.mm: (WebCore::canAdjustBorderRadiusForAppearance): The old search field forced a pill-like appearance. This is no longer required under the new appearance. (WebCore::RenderThemeIOS::adjustRoundBorderRadius): LayoutTests: Added tests to verify the stylability of search fields with the new appearance. * fast/forms/ios/form-control-refresh/search/background-color-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/background-color.html: Added. * fast/forms/ios/form-control-refresh/search/border-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/border.html: Added. * fast/forms/ios/form-control-refresh/search/font-size-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/font-size.html: Added. * fast/forms/ios/form-control-refresh/search/results-attribute-expected.html: Added. * fast/forms/ios/form-control-refresh/search/results-attribute.html: Added. * fast/forms/ios/form-control-refresh/search/width-height-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/search/width-height.html: Added. Canonical link: https://commits.webkit.org/232084@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-03 19:07:26 +00:00
}
Implement ::file-selector-button pseudo-element. https://bugs.webkit.org/show_bug.cgi?id=219836 Reviewed by Simon Fraser. Source/WebCore: Treat it like ::placeholder. Tests: fast/css/css-selector-text.html (plus see the comment in changelog). * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * css/SelectorPseudoElementTypeMap.in: * css/formControlsIOS.css: (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::file-selector-button, button): (input:matches([type="button"], [type="reset"]), input[type="file"]::file-selector-button, button): * css/html.css: (input[type="file"]::file-selector-button): (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::file-selector-button, button): (input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]::file-selector-button:active, button:active): (input:matches([type="button"], [type="submit"], [type="reset"]):active:disabled,): * css/parser/CSSParserSelector.cpp: (WebCore::CSSParserSelector::parsePseudoElementSelector): * css/themeWin.css: (input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::file-selector-button, button): * html/FileInputType.cpp: (WebCore::UploadButtonElement::createInternal): LayoutTests: There are WPTs for this, but WebKit's importer doesn't handle <link rel="mismatch"> which is used by these. Instead, I adapted UA sheets to use the standard selector so we should get coverage, and extended the existing tests for -webkit-file-upload-button. * fast/css/css-selector-text-expected.txt: * fast/css/css-selector-text.html: Tweak test to cover new pseudo. Canonical link: https://commits.webkit.org/232441@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-14 18:43:23 +00:00
input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::file-selector-button, button {
2021-03-03 22:04:55 +00:00
color: ButtonText;
border: 1px solid #4c4c4c;
/* We want to be as close to background-color:transparent as possible without actually being transparent. */
background-color: rgba(255, 255, 255, 0.01);
font: 11px Helvetica;
}
2021-03-03 22:04:55 +00:00
input[type="submit"] {
font-weight: initial;
}
[iOS][FCR] Update disabled state for button-like controls https://bugs.webkit.org/show_bug.cgi?id=222318 <rdar://problem/74645980> Reviewed by Wenson Hsieh. Source/WebCore: Update the disabled state for all button-like controls to match the latest specification. The default disabled state is dark gray text on a light gray background. * css/html.css: (input:matches([type="button"], [type="submit"], [type="reset"]):disabled,): (input[type="checkbox"]:indeterminate:disabled): (input:matches([type="checkbox"], [type="radio"]):disabled): (input:matches([type="checkbox"], [type="radio"]):checked:disabled): * css/legacyFormControlsIOS.css: (input[type="checkbox"]:indeterminate:disabled,): (input:matches([type="button"], [type="submit"], [type="reset"]):disabled,): (input[type="file"]:disabled): (input:matches([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]):disabled): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckbox): (WebCore::RenderThemeIOS::paintRadio): (WebCore::RenderThemeIOS::paintMenuListButtonDecorationsWithFormControlRefresh): LayoutTests: Rebaslined tests to account for the new disabled appearance. * platform/ios/fast/forms/basic-inputs-expected.txt: * platform/ios/fast/forms/basic-selects-expected.txt: * platform/ios/fast/forms/disabled-select-change-index-expected.txt: * platform/ios/fast/forms/file/file-input-disabled-expected.txt: * platform/ios/fast/forms/select-disabled-appearance-expected.txt: Canonical link: https://commits.webkit.org/235195@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-11 22:41:13 +00:00
input:matches([type="button"], [type="submit"], [type="reset"]):disabled,
input[type="file"]:disabled::file-selector-button, button:disabled,
select:disabled, keygen:disabled, optgroup:disabled, option:disabled,
select[disabled]>option {
color: GrayText;
}
input[type="file"]:disabled {
color: initial;
opacity: 0.4;
}
2021-03-03 22:04:55 +00:00
input[type="range"]::-webkit-slider-thumb {
background-color: white;
}
2021-03-03 22:04:55 +00:00
input[type="range"]::-webkit-slider-thumb:active {
background-color: black;
}
[iOS][FCR] Add new look for input type=range https://bugs.webkit.org/show_bug.cgi?id=219698 <rdar://problem/72144727> Reviewed by Wenson Hsieh. Source/WebCore: The new appearance matches the appearance of UIKit's UISlider. Tests: fast/forms/ios/form-control-refresh/range/background-color.html fast/forms/ios/form-control-refresh/range/border.html fast/forms/ios/form-control-refresh/range/datalist.html fast/forms/ios/form-control-refresh/range/style-height.html fast/forms/ios/form-control-refresh/range/style-width.html fast/forms/ios/form-control-refresh/range/value.html * css/formControlsIOS.css: (input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-slider-thumb:active): The pressed appearance of slider thumbs on iOS is the same as the unpressed appearance. * rendering/RenderSlider.cpp: (WebCore::RenderSlider::valueRatio const): * rendering/RenderSlider.h: Added the valueRatio() method so that the appropriate portion of the slider can be filled when the value is non-zero. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustStyle): Consult supportsBoxShadow() rather than unconditionally dropping the box shadow for native controls. * rendering/RenderTheme.h: (WebCore::RenderTheme::supportsBoxShadow const): Preserve the default behavior of dropping box shadows for native controls. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintSliderTrack): (WebCore::RenderThemeIOS::paintSliderThumbDecorations): (WebCore::RenderThemeIOS::paintProgressBar): (WebCore::RenderThemeIOS::supportsBoxShadow const): Slider thumbs rely on box shadows for their appearance. Other controls may also be able to support box shadows; more investigation is needed, which is outside the scope of this patch. (WebCore::RenderThemeIOS::paintProgressBarWithFormControlRefresh): Removed acronym to follow style guidelines. (WebCore::RenderThemeIOS::paintSliderTrackWithFormControlRefresh): LayoutTests: Added tests to verify the stylability of inputs with the new appearance. * fast/forms/ios/form-control-refresh/range/background-color-expected.html: Added. * fast/forms/ios/form-control-refresh/range/background-color.html: Added. * fast/forms/ios/form-control-refresh/range/border-expected.html: Added. * fast/forms/ios/form-control-refresh/range/border.html: Added. * fast/forms/ios/form-control-refresh/range/datalist-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/range/datalist.html: Added. * fast/forms/ios/form-control-refresh/range/style-height-expected.html: Added. * fast/forms/ios/form-control-refresh/range/style-height.html: Added. * fast/forms/ios/form-control-refresh/range/style-width-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/range/style-width.html: Added. * fast/forms/ios/form-control-refresh/range/value-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/range/value.html: Added. Canonical link: https://commits.webkit.org/232292@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-10 15:12:13 +00:00
input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-slider-thumb:active {
2021-03-03 22:04:55 +00:00
box-shadow: initial;
border: 1px solid rgb(66, 66, 66);
padding: 0px;
}
input[type="color"]::-webkit-color-swatch-wrapper {
border-radius: initial;
[iOS][FCR] Color inputs are painted outside their box https://bugs.webkit.org/show_bug.cgi?id=222299 <rdar://problem/74621954> Reviewed by Wenson Hsieh. Source/WebCore: Color inputs have a gradient decoration around their inner swatch. Since this decoration is painted using a stroke with a non-zero thickness around the input's box, a portion of the decoration overflows the box. To fix, use an inset rect to draw the gradient decoration, ensuring the stroke is drawn within the input's box. This patch also updates the padding and stroke thickness to match the latest specifications. Test: fast/forms/ios/form-control-refresh/color/paint-within-box.html * css/html.css: (input[type="color"]): Update padding to match specification. (input[type="color"]::-webkit-color-swatch-wrapper): Update padding to match specification. * css/legacyFormControlsIOS.css: (input[type="color"]::-webkit-color-swatch-wrapper): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paintDecorations): Use the device-pixel-snapped rect when painting the decoration for color inputs, to ensure the swatch is centered within the input. We should also consider moving other controls to using the device-pixel-snapped rect when painting, as some controls still use integral snapped rects. However, each control should be individually audited to avoid breakage. (WebCore::RenderTheme::paintColorWellDecorations): * rendering/RenderTheme.h: * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::colorInputStyleSheet): Update the default width/height of color inputs to match the latest specification. (WebCore::RenderThemeIOS::paintColorWellDecorations): Inset the stroke rect to ensure the gradient is painted within the input's box. LayoutTests: Added a reference test which verifies that color inputs are painted within their box. This is done by drawing a square over the input and comparing to a page which contains a square of the same size, with the input hidden. Rebaselined tests after change to padding. * fast/forms/ios/form-control-refresh/color/paint-within-box-expected.html: Added. * fast/forms/ios/form-control-refresh/color/paint-within-box.html: Added. * platform/ios-wk2/imported/w3c/web-platform-tests/html/rendering/widgets/baseline-alignment-and-overflow.tentative-expected.txt: * platform/ios/fast/forms/color/input-appearance-color-expected.txt: Canonical link: https://commits.webkit.org/235143@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-10 21:16:59 +00:00
padding: 0;
[iOS][FCR] Add new look for input type=range https://bugs.webkit.org/show_bug.cgi?id=219698 <rdar://problem/72144727> Reviewed by Wenson Hsieh. Source/WebCore: The new appearance matches the appearance of UIKit's UISlider. Tests: fast/forms/ios/form-control-refresh/range/background-color.html fast/forms/ios/form-control-refresh/range/border.html fast/forms/ios/form-control-refresh/range/datalist.html fast/forms/ios/form-control-refresh/range/style-height.html fast/forms/ios/form-control-refresh/range/style-width.html fast/forms/ios/form-control-refresh/range/value.html * css/formControlsIOS.css: (input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-slider-thumb:active): The pressed appearance of slider thumbs on iOS is the same as the unpressed appearance. * rendering/RenderSlider.cpp: (WebCore::RenderSlider::valueRatio const): * rendering/RenderSlider.h: Added the valueRatio() method so that the appropriate portion of the slider can be filled when the value is non-zero. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustStyle): Consult supportsBoxShadow() rather than unconditionally dropping the box shadow for native controls. * rendering/RenderTheme.h: (WebCore::RenderTheme::supportsBoxShadow const): Preserve the default behavior of dropping box shadows for native controls. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintSliderTrack): (WebCore::RenderThemeIOS::paintSliderThumbDecorations): (WebCore::RenderThemeIOS::paintProgressBar): (WebCore::RenderThemeIOS::supportsBoxShadow const): Slider thumbs rely on box shadows for their appearance. Other controls may also be able to support box shadows; more investigation is needed, which is outside the scope of this patch. (WebCore::RenderThemeIOS::paintProgressBarWithFormControlRefresh): Removed acronym to follow style guidelines. (WebCore::RenderThemeIOS::paintSliderTrackWithFormControlRefresh): LayoutTests: Added tests to verify the stylability of inputs with the new appearance. * fast/forms/ios/form-control-refresh/range/background-color-expected.html: Added. * fast/forms/ios/form-control-refresh/range/background-color.html: Added. * fast/forms/ios/form-control-refresh/range/border-expected.html: Added. * fast/forms/ios/form-control-refresh/range/border.html: Added. * fast/forms/ios/form-control-refresh/range/datalist-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/range/datalist.html: Added. * fast/forms/ios/form-control-refresh/range/style-height-expected.html: Added. * fast/forms/ios/form-control-refresh/range/style-height.html: Added. * fast/forms/ios/form-control-refresh/range/style-width-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/range/style-width.html: Added. * fast/forms/ios/form-control-refresh/range/value-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/range/value.html: Added. Canonical link: https://commits.webkit.org/232292@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-10 15:12:13 +00:00
}
[iOS][FCR] Add new look for color inputs https://bugs.webkit.org/show_bug.cgi?id=219654 <rdar://problem/72107493> Reviewed by Wenson Hsieh. Source/WebCore: The new appearance matches the appearance of UIKit's UIColorWell. Tests: fast/forms/ios/form-control-refresh/color/background-color.html fast/forms/ios/form-control-refresh/color/border-radius.html fast/forms/ios/form-control-refresh/color/border.html fast/forms/ios/form-control-refresh/color/width-height.html * css/formControlsIOS.css: (input[type="color"]::-webkit-color-swatch-wrapper, input[type="color"]::-webkit-color-swatch): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustStyle): (WebCore::RenderTheme::paint): (WebCore::RenderTheme::paintDecorations): (WebCore::RenderTheme::adjustColorWellStyle const): Call adjustButtonStyle to preserve existing behavior in cases where the form control refresh does not apply (setting disabled, non-iOS ports). (WebCore::RenderTheme::paintColorWell): Call paintButton to preserve existing behavior in cases where the form control refresh does not apply (setting disabled, non-iOS ports). (WebCore::RenderTheme::paintColorWellDecorations): Call paintButtonDecorations to preserve existing behavior in cases where the form control refresh does not apply (setting disabled, non-iOS ports). (WebCore::RenderTheme::colorInputStyleSheet const): * rendering/RenderTheme.h: Previously, color inputs always had the same appearance as buttons. However, with the new appearance on iOS this is no longer always the case. Consequently, it is necessary to introduce adjustColorWellStyle, paintColorWell and paintColorWellDecorations. Updated colorInputStyleSheet to take an additional parameter, so that the style can change depending on whether or not the form control refresh setting is enabled. It is not possible to simply add the new style to formControlsiOS.css, since <input type=color> is another runtime enabled feature. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::colorInputStyleSheet const): (WebCore::RenderThemeIOS::adjustColorWellStyle const): (WebCore::RenderThemeIOS::paintColorWell): (WebCore::RenderThemeIOS::paintColorWellDecorations): Use a conic gradient to achieve the new appearance. * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): LayoutTests: Added tests to verify the stylability of color inputs with the new appearance. * fast/forms/ios/form-control-refresh/color/background-color-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/color/background-color.html: Added. * fast/forms/ios/form-control-refresh/color/border-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/color/border-radius-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/color/border-radius.html: Added. * fast/forms/ios/form-control-refresh/color/border.html: Added. * fast/forms/ios/form-control-refresh/color/width-height-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/color/width-height.html: Added. Canonical link: https://commits.webkit.org/232341@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-11 16:42:17 +00:00
input[type="color"]::-webkit-color-swatch {
2021-03-03 22:04:55 +00:00
border-radius: 2px;
[iOS][FCR] Add new look for color inputs https://bugs.webkit.org/show_bug.cgi?id=219654 <rdar://problem/72107493> Reviewed by Wenson Hsieh. Source/WebCore: The new appearance matches the appearance of UIKit's UIColorWell. Tests: fast/forms/ios/form-control-refresh/color/background-color.html fast/forms/ios/form-control-refresh/color/border-radius.html fast/forms/ios/form-control-refresh/color/border.html fast/forms/ios/form-control-refresh/color/width-height.html * css/formControlsIOS.css: (input[type="color"]::-webkit-color-swatch-wrapper, input[type="color"]::-webkit-color-swatch): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::adjustStyle): (WebCore::RenderTheme::paint): (WebCore::RenderTheme::paintDecorations): (WebCore::RenderTheme::adjustColorWellStyle const): Call adjustButtonStyle to preserve existing behavior in cases where the form control refresh does not apply (setting disabled, non-iOS ports). (WebCore::RenderTheme::paintColorWell): Call paintButton to preserve existing behavior in cases where the form control refresh does not apply (setting disabled, non-iOS ports). (WebCore::RenderTheme::paintColorWellDecorations): Call paintButtonDecorations to preserve existing behavior in cases where the form control refresh does not apply (setting disabled, non-iOS ports). (WebCore::RenderTheme::colorInputStyleSheet const): * rendering/RenderTheme.h: Previously, color inputs always had the same appearance as buttons. However, with the new appearance on iOS this is no longer always the case. Consequently, it is necessary to introduce adjustColorWellStyle, paintColorWell and paintColorWellDecorations. Updated colorInputStyleSheet to take an additional parameter, so that the style can change depending on whether or not the form control refresh setting is enabled. It is not possible to simply add the new style to formControlsiOS.css, since <input type=color> is another runtime enabled feature. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::colorInputStyleSheet const): (WebCore::RenderThemeIOS::adjustColorWellStyle const): (WebCore::RenderThemeIOS::paintColorWell): (WebCore::RenderThemeIOS::paintColorWellDecorations): Use a conic gradient to achieve the new appearance. * style/UserAgentStyle.cpp: (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement): LayoutTests: Added tests to verify the stylability of color inputs with the new appearance. * fast/forms/ios/form-control-refresh/color/background-color-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/color/background-color.html: Added. * fast/forms/ios/form-control-refresh/color/border-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/color/border-radius-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/color/border-radius.html: Added. * fast/forms/ios/form-control-refresh/color/border.html: Added. * fast/forms/ios/form-control-refresh/color/width-height-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/color/width-height.html: Added. Canonical link: https://commits.webkit.org/232341@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-11 16:42:17 +00:00
}
input:matches([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]) {
2021-03-03 22:04:55 +00:00
border: 1px solid #4c4c4c;
font-family: Helvetica;
color: initial;
}
[iOS][FCR] Update disabled state for button-like controls https://bugs.webkit.org/show_bug.cgi?id=222318 <rdar://problem/74645980> Reviewed by Wenson Hsieh. Source/WebCore: Update the disabled state for all button-like controls to match the latest specification. The default disabled state is dark gray text on a light gray background. * css/html.css: (input:matches([type="button"], [type="submit"], [type="reset"]):disabled,): (input[type="checkbox"]:indeterminate:disabled): (input:matches([type="checkbox"], [type="radio"]):disabled): (input:matches([type="checkbox"], [type="radio"]):checked:disabled): * css/legacyFormControlsIOS.css: (input[type="checkbox"]:indeterminate:disabled,): (input:matches([type="button"], [type="submit"], [type="reset"]):disabled,): (input[type="file"]:disabled): (input:matches([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]):disabled): * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckbox): (WebCore::RenderThemeIOS::paintRadio): (WebCore::RenderThemeIOS::paintMenuListButtonDecorationsWithFormControlRefresh): LayoutTests: Rebaslined tests to account for the new disabled appearance. * platform/ios/fast/forms/basic-inputs-expected.txt: * platform/ios/fast/forms/basic-selects-expected.txt: * platform/ios/fast/forms/disabled-select-change-index-expected.txt: * platform/ios/fast/forms/file/file-input-disabled-expected.txt: * platform/ios/fast/forms/select-disabled-appearance-expected.txt: Canonical link: https://commits.webkit.org/235195@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-11 22:41:13 +00:00
input:matches([type="date"], [type="time"], [type="datetime-local"], [type="month"], [type="week"]):disabled {
background-color: white;
color: initial;
opacity: 0.4;
}
input::-webkit-date-and-time-value {
2021-03-03 22:04:55 +00:00
margin-right: 18px;
text-align: inherit;
width: initial;
}
[iOS][FCR] Add new look for select elements https://bugs.webkit.org/show_bug.cgi?id=219507 <rdar://problem/71951874> Reviewed by Wenson Hsieh. Source/WebCore: Implement the new in-page appearance for <select> and <select multiple>. The new appearance/behavior of the select popup will be added separately. Tests: fast/forms/ios/form-control-refresh/select/background-color.html fast/forms/ios/form-control-refresh/select/border-radius.html fast/forms/ios/form-control-refresh/select/border.html fast/forms/ios/form-control-refresh/select/multiple-appearance.html fast/forms/ios/form-control-refresh/select/rtl-appearance.html fast/forms/ios/form-control-refresh/select/text-color.html fast/forms/ios/form-control-refresh/select/width-height.html * css/formControlsIOS.css: (select): * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::adjustInnerStyle): (RenderMenuList::layout): Override the layout method so that the border radius can be adjusted to enforce the pill-shaped appearance. Ideally, we should not be adjusting styles during layout. However, for a pill-shaped appearance, the horizontal border radius is dependent on the computed height of the box. This means that the border radius cannot be declared prior to layout, since CSS only allows the horizontal border radius to be dependent on the computed width of the box. Ignoring the style's border radius and forcing a pill-shaped appearance at paint time is not an option, since focus rings and tap highlights will not use the correct border radius. Consequently, we need to adjust the border radius after layout. Note that similar adjustments to style after layout are made in RenderSliderThumb, RenderButton, and RenderTextControlSingleLine. * rendering/RenderMenuList.h: * rendering/RenderTheme.h: (WebCore::RenderTheme::popupInternalPaddingBox const): Added a new parameter, so that the padding can be controlled at runtime. * rendering/RenderThemeAdwaita.cpp: (WebCore::RenderThemeAdwaita::popupInternalPaddingBox const): * rendering/RenderThemeAdwaita.h: * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::popupInternalPaddingBox const): Use a 1em padding, so that the button scales with the font size. (WebCore::canAdjustBorderRadiusForAppearance): Enforce a pill-like shape, only if the author has not specified a custom border radius. (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): (WebCore::RenderThemeIOS::paintMenuListButtonDecorationsWithFormControlRefresh): Paint the appropriate glyph for <select> (a two-headed arrow) and <select multiple> (ellipses). Both glyphs were obtained from SF Symbols. The glyph is painted on the right by default, and on the left if the element's direction is RTL. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::popupInternalPaddingBox const): LayoutTests: Added tests to verify the stylability of select elements with the new appearance. * fast/forms/ios/form-control-refresh/select/background-color-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/background-color.html: Added. * fast/forms/ios/form-control-refresh/select/border-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/border-radius-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/border-radius.html: Added. * fast/forms/ios/form-control-refresh/select/border.html: Added. * fast/forms/ios/form-control-refresh/select/multiple-appearance-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/multiple-appearance.html: Added. * fast/forms/ios/form-control-refresh/select/rtl-appearance-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/rtl-appearance.html: Added. * fast/forms/ios/form-control-refresh/select/text-color-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/text-color.html: Added. * fast/forms/ios/form-control-refresh/select/width-height-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/width-height.html: Added. Canonical link: https://commits.webkit.org/232376@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-11 23:27:35 +00:00
select {
2021-03-03 22:04:55 +00:00
color: initial;
font-weight: initial;
font: 11px Helvetica;
border: 1px solid #4c4c4c;
border-radius: 5px;
/* We want to be as close to background:transparent as possible without actually being transparent */
background-color: rgba(255, 255, 255, 0.01);
[iOS][FCR] Add new look for select elements https://bugs.webkit.org/show_bug.cgi?id=219507 <rdar://problem/71951874> Reviewed by Wenson Hsieh. Source/WebCore: Implement the new in-page appearance for <select> and <select multiple>. The new appearance/behavior of the select popup will be added separately. Tests: fast/forms/ios/form-control-refresh/select/background-color.html fast/forms/ios/form-control-refresh/select/border-radius.html fast/forms/ios/form-control-refresh/select/border.html fast/forms/ios/form-control-refresh/select/multiple-appearance.html fast/forms/ios/form-control-refresh/select/rtl-appearance.html fast/forms/ios/form-control-refresh/select/text-color.html fast/forms/ios/form-control-refresh/select/width-height.html * css/formControlsIOS.css: (select): * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::adjustInnerStyle): (RenderMenuList::layout): Override the layout method so that the border radius can be adjusted to enforce the pill-shaped appearance. Ideally, we should not be adjusting styles during layout. However, for a pill-shaped appearance, the horizontal border radius is dependent on the computed height of the box. This means that the border radius cannot be declared prior to layout, since CSS only allows the horizontal border radius to be dependent on the computed width of the box. Ignoring the style's border radius and forcing a pill-shaped appearance at paint time is not an option, since focus rings and tap highlights will not use the correct border radius. Consequently, we need to adjust the border radius after layout. Note that similar adjustments to style after layout are made in RenderSliderThumb, RenderButton, and RenderTextControlSingleLine. * rendering/RenderMenuList.h: * rendering/RenderTheme.h: (WebCore::RenderTheme::popupInternalPaddingBox const): Added a new parameter, so that the padding can be controlled at runtime. * rendering/RenderThemeAdwaita.cpp: (WebCore::RenderThemeAdwaita::popupInternalPaddingBox const): * rendering/RenderThemeAdwaita.h: * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::popupInternalPaddingBox const): Use a 1em padding, so that the button scales with the font size. (WebCore::canAdjustBorderRadiusForAppearance): Enforce a pill-like shape, only if the author has not specified a custom border radius. (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): (WebCore::RenderThemeIOS::paintMenuListButtonDecorationsWithFormControlRefresh): Paint the appropriate glyph for <select> (a two-headed arrow) and <select multiple> (ellipses). Both glyphs were obtained from SF Symbols. The glyph is painted on the right by default, and on the left if the element's direction is RTL. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::popupInternalPaddingBox const): LayoutTests: Added tests to verify the stylability of select elements with the new appearance. * fast/forms/ios/form-control-refresh/select/background-color-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/background-color.html: Added. * fast/forms/ios/form-control-refresh/select/border-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/border-radius-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/border-radius.html: Added. * fast/forms/ios/form-control-refresh/select/border.html: Added. * fast/forms/ios/form-control-refresh/select/multiple-appearance-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/multiple-appearance.html: Added. * fast/forms/ios/form-control-refresh/select/rtl-appearance-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/rtl-appearance.html: Added. * fast/forms/ios/form-control-refresh/select/text-color-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/text-color.html: Added. * fast/forms/ios/form-control-refresh/select/width-height-expected-mismatch.html: Added. * fast/forms/ios/form-control-refresh/select/width-height.html: Added. Canonical link: https://commits.webkit.org/232376@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-11 23:27:35 +00:00
}
[iOS][FCR] Add borders for better control visibility https://bugs.webkit.org/show_bug.cgi?id=225058 <rdar://problem/77161616> Reviewed by Sam Weinig. Source/WebCore: The solid gray backgrounds of new form controls have poor visibility on site's that have gray-ish backgrounds or draw the controls on top of a gray area. To fix this, borders are added to all controls to ensure visibility no matter the background. The border color is the system background color. This means the border is invisible on white backgrounds in light mode, and dark backgrounds in dark mode, ensuring the controls match UIKit styles on backgrounds where they are guaranteed to be visible. However, these borders are visible when the page/area background has a similar color to the control background, improving control visibility. To paint the borders, a mix of UA stylesheet changes and custom painting changes are used. This approach is taken to maintain our existing level of stylability. UA stylesheet changes were applied to controls that specified a "1px solid black" border in the old design. The border is now brought back, but with a different color. For controls that have always had completely custom painting (independent of styles), the border is painted by the theme. * css/html.css: Specify a "1px solid -webkit-control-background" border on controls that previously (pre-redesign) specified a border in the UA stylesheet. * css/legacyFormControlsIOS.css: (select:focus): Move the <select> focus style into the legacy stylesheet, since it should not apply to the new design. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::paintCheckbox): Paint the checkbox border inside the painting rect, and inset the actual checkbox by the border. This is necessary, checkboxes use "box-sizing: border-box", and we do not want to increase the overall size of checkboxes for compatibility reasons. (WebCore::RenderThemeIOS::paintRadio): Painted in a similar manner as checkboxes. (WebCore::RenderThemeIOS::paintProgressBarWithFormControlRefresh): (WebCore::RenderThemeIOS::paintMeter): (WebCore::RenderThemeIOS::paintSliderTrackWithFormControlRefresh): Slider tracks are already inset by the border size, so we can just draw a border in the available area. LayoutTests: Rebaselined tests to account for changes in appearance. * accessibility/ios-simulator/unobscured-content-rect-expected.txt: * accessibility/ios-simulator/unobscured-content-rect.html: * editing/editable-region/search-field-basic-expected.txt: * fast/forms/date/date-input-rendering-basic-expected.txt: * fast/forms/date/date-pseudo-elements-expected.txt: * fast/forms/ios/form-control-refresh/checkbox/border.html: Specify a border style, so that the border applies. Note that this test is currently failing on internal bots. * fast/forms/ios/form-control-refresh/checkbox/subpixel-clipping-expected-mismatch.html: * fast/forms/ios/form-control-refresh/checkbox/subpixel-clipping.html: Add a green background so that the (white) border is visible. * fast/forms/ios/form-control-refresh/radio/border.html: * fast/forms/ios/form-control-refresh/radio/subpixel-clipping-expected-mismatch.html: * fast/forms/ios/form-control-refresh/radio/subpixel-clipping.html: * fast/forms/time/time-input-rendering-basic-expected.txt: * platform/ios-simulator/fast/forms/datalist/datalist-searchinput-appearance-expected.txt: * platform/ios-wk2/compositing/contents-opaque/control-layer-expected.txt: * platform/ios-wk2/editing/pasteboard/4641033-expected.txt: * platform/ios-wk2/editing/pasteboard/4944770-1-expected.txt: * platform/ios-wk2/editing/pasteboard/4944770-2-expected.txt: * platform/ios-wk2/editing/selection/caret-before-select-expected.txt: * platform/ios-wk2/fast/block/margin-collapse/103-expected.txt: * platform/ios-wk2/fast/forms/basic-buttons-expected.txt: * platform/ios-wk2/fast/forms/targeted-frame-submission-expected.txt: * platform/ios-wk2/fast/overflow/scroll-nested-positioned-layer-in-overflow-expected.txt: * platform/ios-wk2/fast/overflow/scrollRevealButton-expected.txt: * platform/ios-wk2/fast/parser/document-write-option-expected.txt: * platform/ios-wk2/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/css/css-pseudo/file-chooser-button-display-toggle-crash.tentative-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/html/rendering/widgets/baseline-alignment-and-overflow.tentative-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/html/rendering/widgets/button-layout/abspos-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/html/rendering/widgets/select-wrap-no-spill.optional-expected.txt: * platform/ios/css2.1/20110323/replaced-elements-001-expected.txt: * platform/ios/css3/flexbox/button-expected.txt: * platform/ios/editing/selection/3690703-2-expected.txt: * platform/ios/editing/selection/3690703-expected.txt: * platform/ios/editing/selection/3690719-expected.txt: * platform/ios/editing/selection/4397952-expected.txt: * platform/ios/editing/selection/5240265-expected.txt: * platform/ios/editing/selection/replaced-boundaries-3-expected.txt: * platform/ios/editing/selection/select-box-expected.txt: * platform/ios/editing/selection/select-element-paragraph-boundary-expected.txt: * platform/ios/editing/selection/selection-button-text-expected.txt: * platform/ios/fast/block/float/float-avoidance-expected.txt: * platform/ios/fast/block/positioning/inline-block-relposition-expected.txt: * platform/ios/fast/css/continuationCrash-expected.txt: * platform/ios/fast/css/focus-ring-exists-for-search-field-expected.txt: * platform/ios/fast/css/input-search-padding-expected.txt: * platform/ios/fast/css/margin-top-bottom-dynamic-expected.txt: * platform/ios/fast/css/rtl-ordering-expected.txt: * platform/ios/fast/css/text-input-with-webkit-border-radius-expected.txt: * platform/ios/fast/css/text-overflow-input-expected.txt: * platform/ios/fast/css/text-transform-select-expected.txt: * platform/ios/fast/dom/HTMLTableColElement/resize-table-using-col-width-expected.txt: * platform/ios/fast/dom/HTMLTextAreaElement/reset-textarea-expected.txt: * platform/ios/fast/dynamic/positioned-movement-with-positioned-children-expected.txt: * platform/ios/fast/forms/001-expected.txt: * platform/ios/fast/forms/003-expected.txt: * platform/ios/fast/forms/004-expected.txt: * platform/ios/fast/forms/basic-selects-expected.txt: * platform/ios/fast/forms/blankbuttons-expected.txt: * platform/ios/fast/forms/box-shadow-override-expected.txt: * platform/ios/fast/forms/button-align-expected.txt: * platform/ios/fast/forms/button-cannot-be-nested-expected.txt: * platform/ios/fast/forms/button-default-title-expected.txt: * platform/ios/fast/forms/button-generated-content-expected.txt: * platform/ios/fast/forms/button-positioned-expected.txt: * platform/ios/fast/forms/button-sizes-expected.txt: * platform/ios/fast/forms/button-style-color-expected.txt: * platform/ios/fast/forms/button-table-styles-expected.txt: * platform/ios/fast/forms/button-text-transform-expected.txt: * platform/ios/fast/forms/button-white-space-expected.txt: * platform/ios/fast/forms/control-clip-expected.txt: * platform/ios/fast/forms/control-clip-overflow-expected.txt: * platform/ios/fast/forms/control-restrict-line-height-expected.txt: * platform/ios/fast/forms/disabled-select-change-index-expected.txt: * platform/ios/fast/forms/file/file-input-direction-expected.txt: * platform/ios/fast/forms/file/file-input-disabled-expected.txt: * platform/ios/fast/forms/form-element-geometry-expected.txt: * platform/ios/fast/forms/formmove3-expected.txt: * platform/ios/fast/forms/hidden-listbox-expected.txt: * platform/ios/fast/forms/input-appearance-height-expected.txt: * platform/ios/fast/forms/input-button-sizes-expected.txt: * platform/ios/fast/forms/input-first-letter-expected.txt: * platform/ios/fast/forms/input-value-expected.txt: * platform/ios/fast/forms/listbox-bidi-align-expected.txt: * platform/ios/fast/forms/listbox-scrollbar-incremental-load-expected.txt: * platform/ios/fast/forms/listbox-width-change-expected.txt: * platform/ios/fast/forms/menulist-clip-expected.txt: * platform/ios/fast/forms/menulist-deselect-update-expected.txt: * platform/ios/fast/forms/menulist-narrow-width-expected.txt: * platform/ios/fast/forms/menulist-no-overflow-expected.txt: * platform/ios/fast/forms/menulist-option-wrap-expected.txt: * platform/ios/fast/forms/menulist-restrict-line-height-expected.txt: * platform/ios/fast/forms/menulist-separator-painting-expected.txt: * platform/ios/fast/forms/menulist-style-color-expected.txt: * platform/ios/fast/forms/menulist-width-change-expected.txt: * platform/ios/fast/forms/option-script-expected.txt: * platform/ios/fast/forms/option-strip-whitespace-expected.txt: * platform/ios/fast/forms/option-text-clip-expected.txt: * platform/ios/fast/forms/placeholder-pseudo-style-expected.txt: * platform/ios/fast/forms/search-cancel-button-style-sharing-expected.txt: * platform/ios/fast/forms/search-display-none-cancel-button-expected.txt: * platform/ios/fast/forms/search-input-rtl-expected.txt: * platform/ios/fast/forms/search/search-zoom-computed-style-height-expected.txt: * platform/ios/fast/forms/select-align-expected.txt: * platform/ios/fast/forms/select-background-none-expected.txt: * platform/ios/fast/forms/select-baseline-expected.txt: * platform/ios/fast/forms/select-block-background-expected.txt: * platform/ios/fast/forms/select-change-listbox-size-expected.txt: * platform/ios/fast/forms/select-change-listbox-to-popup-expected.txt: * platform/ios/fast/forms/select-change-popup-to-listbox-expected.txt: * platform/ios/fast/forms/select-dirty-parent-pref-widths-expected.txt: * platform/ios/fast/forms/select-disabled-appearance-expected.txt: * platform/ios/fast/forms/select-element-focus-ring-expected.txt: * platform/ios/fast/forms/select-empty-option-height-expected.txt: * platform/ios/fast/forms/select-initial-position-expected.txt: * platform/ios/fast/forms/select-list-box-with-height-expected.txt: * platform/ios/fast/forms/select-selected-expected.txt: * platform/ios/fast/forms/select-style-expected.txt: * platform/ios/fast/forms/select-visual-hebrew-expected.txt: * platform/ios/fast/forms/select-writing-direction-natural-expected.txt: * platform/ios/fast/forms/select/optgroup-rendering-expected.txt: * platform/ios/fast/forms/selectlist-minsize-expected.txt: * platform/ios/fast/forms/stuff-on-my-optgroup-expected.txt: * platform/ios/fast/html/details-replace-summary-child-expected.txt: * platform/ios/fast/html/details-replace-text-expected.txt: * platform/ios/fast/html/keygen-expected.txt: * platform/ios/fast/invalid/014-expected.txt: * platform/ios/fast/replaced/replaced-breaking-expected.txt: * platform/ios/fast/replaced/replaced-breaking-mixture-expected.txt: * platform/ios/fast/replaced/three-selects-break-expected.txt: * platform/ios/fast/replaced/width100percent-button-expected.txt: * platform/ios/fast/replaced/width100percent-menulist-expected.txt: * platform/ios/fast/replaced/width100percent-searchfield-expected.txt: * platform/ios/fast/selectors/064-expected.txt: * platform/ios/fast/table/append-cells2-expected.txt: * platform/ios/fast/table/remove-td-display-none-expected.txt: * platform/ios/fast/text/drawBidiText-expected.txt: * platform/ios/fast/text/international/bidi-listbox-atsui-expected.txt: * platform/ios/fast/text/international/bidi-listbox-expected.txt: * platform/ios/fast/text/international/bidi-menulist-expected.txt: * platform/ios/fast/text/international/hindi-spacing-expected.txt: * platform/ios/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt: * platform/ios/svg/custom/foreign-object-skew-expected.txt: * platform/ios/svg/custom/inline-svg-in-xhtml-expected.txt: * platform/ios/tables/mozilla/bugs/bug1188-expected.txt: * platform/ios/tables/mozilla/bugs/bug1318-expected.txt: * platform/ios/tables/mozilla/bugs/bug138725-expected.txt: * platform/ios/tables/mozilla/bugs/bug18359-expected.txt: * platform/ios/tables/mozilla/bugs/bug2479-2-expected.txt: * platform/ios/tables/mozilla/bugs/bug2479-3-expected.txt: * platform/ios/tables/mozilla/bugs/bug2479-4-expected.txt: * platform/ios/tables/mozilla/bugs/bug26178-expected.txt: * platform/ios/tables/mozilla/bugs/bug28928-expected.txt: * platform/ios/tables/mozilla/bugs/bug29326-expected.txt: * platform/ios/tables/mozilla/bugs/bug33855-expected.txt: * platform/ios/tables/mozilla/bugs/bug39209-expected.txt: * platform/ios/tables/mozilla/bugs/bug4382-expected.txt: * platform/ios/tables/mozilla/bugs/bug4429-expected.txt: * platform/ios/tables/mozilla/bugs/bug44505-expected.txt: * platform/ios/tables/mozilla/bugs/bug46368-1-expected.txt: * platform/ios/tables/mozilla/bugs/bug46368-2-expected.txt: * platform/ios/tables/mozilla/bugs/bug51037-expected.txt: * platform/ios/tables/mozilla/bugs/bug51727-expected.txt: * platform/ios/tables/mozilla/bugs/bug52505-expected.txt: * platform/ios/tables/mozilla/bugs/bug52506-expected.txt: * platform/ios/tables/mozilla/bugs/bug60749-expected.txt: * platform/ios/tables/mozilla/bugs/bug68912-expected.txt: * platform/ios/tables/mozilla/bugs/bug7342-expected.txt: * platform/ios/tables/mozilla/bugs/bug92647-2-expected.txt: * platform/ios/tables/mozilla/bugs/bug96334-expected.txt: * platform/ios/tables/mozilla/collapsing_borders/bug41262-4-expected.txt: * platform/ios/tables/mozilla/core/margins-expected.txt: * platform/ios/tables/mozilla/dom/tableDom-expected.txt: * platform/ios/tables/mozilla/other/move_row-expected.txt: * platform/ios/tables/mozilla_expected_failures/bugs/bug1725-expected.txt: * platform/ios/tables/mozilla_expected_failures/bugs/bug2479-5-expected.txt: * platform/ios/tables/mozilla_expected_failures/bugs/bug58402-2-expected.txt: * platform/ios/tables/mozilla_expected_failures/collapsing_borders/bug41262-5-expected.txt: * platform/ios/tables/mozilla_expected_failures/collapsing_borders/bug41262-6-expected.txt: * platform/ios/transforms/2d/zoom-menulist-expected.txt: Canonical link: https://commits.webkit.org/237084@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-27 20:28:09 +00:00
select:focus {
border-color: rgb(17, 46, 135);
}
#endif