Changeset 270784 in webkit
- Timestamp:
- Dec 14, 2020 10:43:23 AM (19 months ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/css-selector-text-expected.txt (modified) (1 diff)
-
LayoutTests/fast/css/css-selector-text.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSSelector.cpp (modified) (1 diff)
-
Source/WebCore/css/SelectorPseudoElementTypeMap.in (modified) (1 diff)
-
Source/WebCore/css/formControlsIOS.css (modified) (2 diffs)
-
Source/WebCore/css/html.css (modified) (6 diffs)
-
Source/WebCore/css/parser/CSSParserSelector.cpp (modified) (1 diff)
-
Source/WebCore/css/themeWin.css (modified) (1 diff)
-
Source/WebCore/html/FileInputType.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r270772 r270784 1 2020-12-14 Emilio Cobos Álvarez <emilio@crisal.io> 2 3 Implement ::file-selector-button pseudo-element. 4 https://bugs.webkit.org/show_bug.cgi?id=219836 5 6 Reviewed by Simon Fraser. 7 8 There are WPTs for this, but WebKit's importer doesn't handle 9 <link rel="mismatch"> which is used by these. Instead, I adapted UA 10 sheets to use the standard selector so we should get coverage, and 11 extended the existing tests for -webkit-file-upload-button. 12 13 * fast/css/css-selector-text-expected.txt: 14 * fast/css/css-selector-text.html: Tweak test to cover new pseudo. 15 1 16 2020-12-14 Sihui Liu <sihui_liu@apple.com> 2 17 -
trunk/LayoutTests/fast/css/css-selector-text-expected.txt
r260338 r270784 278 278 PASS parseThenSerializeRule('::-webkit-search-results-decoration { }') is '::-webkit-search-results-decoration { }' 279 279 PASS parseThenSerializeRule('::-webkit-slider-thumb { }') is '::-webkit-slider-thumb { }' 280 PASS parseThenSerializeRule('::file-selector-button { }') is '::file-selector-button { }' 280 281 281 282 PASS parseThenSerializeRule('a::-webkit-slider-thumb { }') is 'a::-webkit-slider-thumb { }' -
trunk/LayoutTests/fast/css/css-selector-text.html
r260338 r270784 369 369 shouldBe("parseThenSerializeRule('::-webkit-search-results-decoration { }')", "'::-webkit-search-results-decoration { }'"); 370 370 shouldBe("parseThenSerializeRule('::-webkit-slider-thumb { }')", "'::-webkit-slider-thumb { }'"); 371 shouldBe("parseThenSerializeRule('::file-selector-button { }')", "'::file-selector-button { }'"); 371 372 372 373 debug(''); -
trunk/Source/WebCore/ChangeLog
r270772 r270784 1 2020-12-14 Emilio Cobos Álvarez <emilio@crisal.io> 2 3 Implement ::file-selector-button pseudo-element. 4 https://bugs.webkit.org/show_bug.cgi?id=219836 5 6 Reviewed by Simon Fraser. 7 8 Treat it like ::placeholder. 9 10 Tests: fast/css/css-selector-text.html (plus see the comment in 11 changelog). 12 13 * css/CSSSelector.cpp: 14 (WebCore::CSSSelector::selectorText const): 15 * css/SelectorPseudoElementTypeMap.in: 16 * css/formControlsIOS.css: 17 (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::file-selector-button, button): 18 (input:matches([type="button"], [type="reset"]), input[type="file"]::file-selector-button, button): 19 * css/html.css: 20 (input[type="file"]::file-selector-button): 21 (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::file-selector-button, button): 22 (input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]::file-selector-button:active, button:active): 23 (input:matches([type="button"], [type="submit"], [type="reset"]):active:disabled,): 24 * css/parser/CSSParserSelector.cpp: 25 (WebCore::CSSParserSelector::parsePseudoElementSelector): 26 * css/themeWin.css: 27 (input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::file-selector-button, button): 28 * html/FileInputType.cpp: 29 (WebCore::UploadButtonElement::createInternal): 30 1 31 2020-12-14 Sihui Liu <sihui_liu@apple.com> 2 32 -
trunk/Source/WebCore/css/CSSSelector.cpp
r267172 r270784 701 701 if (cs->value() == "placeholder") 702 702 builder.appendLiteral("::-webkit-input-placeholder"); 703 if (cs->value() == "file-selector-button") 704 builder.appendLiteral("::-webkit-file-upload-button"); 703 705 break; 704 706 #if ENABLE(VIDEO) -
trunk/Source/WebCore/css/SelectorPseudoElementTypeMap.in
r262695 r270784 9 9 marker 10 10 part 11 file-selector-button, PseudoElementWebKitCustom 11 12 placeholder, PseudoElementWebKitCustom 12 13 -webkit-input-placeholder, PseudoElementWebKitCustomLegacyPrefixed 14 -webkit-file-upload-button, PseudoElementWebKitCustomLegacyPrefixed 13 15 -webkit-resizer 14 16 -webkit-scrollbar -
trunk/Source/WebCore/css/formControlsIOS.css
r270713 r270784 59 59 } 60 60 61 input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]:: -webkit-file-upload-button, button {61 input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::file-selector-button, button { 62 62 border: initial; 63 63 font: 11px system-ui; … … 68 68 /* FIXME: Add styles for additional button states once final specifications are obtained. */ 69 69 70 input:matches([type="button"], [type="reset"]), input[type="file"]:: -webkit-file-upload-button, button {70 input:matches([type="button"], [type="reset"]), input[type="file"]::file-selector-button, button { 71 71 background-color: rgb(235, 245, 255); 72 72 color: rgb(22, 122, 255); -
trunk/Source/WebCore/css/html.css
r270398 r270784 792 792 } 793 793 794 input[type="file"]:: -webkit-file-upload-button {794 input[type="file"]::file-selector-button { 795 795 -webkit-appearance: push-button; 796 796 white-space: nowrap; … … 799 799 } 800 800 801 input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]:: -webkit-file-upload-button, button {801 input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::file-selector-button, button { 802 802 align-items: flex-start; 803 803 text-align: center; … … 818 818 } 819 819 820 input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]:: -webkit-file-upload-button:active, button:active {820 input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]::file-selector-button:active, button:active { 821 821 color: ActiveButtonText; 822 822 } … … 871 871 872 872 input:matches([type="button"], [type="submit"], [type="reset"]):disabled, 873 input[type="file"]:disabled:: -webkit-file-upload-button, button:disabled,873 input[type="file"]:disabled::file-selector-button, button:disabled, 874 874 select:disabled, keygen:disabled, optgroup:disabled, option:disabled, 875 875 select[disabled]>option { … … 878 878 879 879 #if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY) 880 input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]:active:: -webkit-file-upload-button, button:active {880 input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]:active::file-selector-button, button:active { 881 881 border-style: inset; 882 882 } 883 883 884 884 input:matches([type="button"], [type="submit"], [type="reset"]):active:disabled, 885 input[type="file"]:active:disabled:: -webkit-file-upload-button, button:active:disabled {885 input[type="file"]:active:disabled::file-selector-button, button:active:disabled { 886 886 border-style: outset; 887 887 } … … 1220 1220 1221 1221 input:matches([type="button"], [type="checkbox"], [type="file"], [type="hidden"], [type="image"], [type="radio"], [type="reset"], [type="search"], [type="submit"]):focus, 1222 input[type="file"]:focus:: -webkit-file-upload-button {1222 input[type="file"]:focus::file-selector-button { 1223 1223 outline-offset: 0; 1224 1224 } -
trunk/Source/WebCore/css/parser/CSSParserSelector.cpp
r250643 r270784 64 64 name = pseudoTypeString.convertToASCIILowercase(); 65 65 else { 66 ASSERT_WITH_MESSAGE(equalLettersIgnoringASCIICase(pseudoTypeString, "-webkit-input-placeholder"), "-webkit-input-placeholder is the only LegacyPrefix pseudo type.");67 66 if (equalLettersIgnoringASCIICase(pseudoTypeString, "-webkit-input-placeholder")) 68 67 name = AtomString("placeholder", AtomString::ConstructFromLiteral); 69 else 68 else if (equalLettersIgnoringASCIICase(pseudoTypeString, "-webkit-file-upload-button")) 69 name = AtomString("file-selector-button", AtomString::ConstructFromLiteral); 70 else { 71 ASSERT_NOT_REACHED(); 70 72 name = pseudoTypeString.convertToASCIILowercase(); 73 } 71 74 } 72 75 selector->m_selector->setValue(name); -
trunk/Source/WebCore/css/themeWin.css
r145977 r270784 102 102 } 103 103 104 input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]:: -webkit-file-upload-button, button {104 input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::file-selector-button, button { 105 105 padding: 1px 6px; 106 106 } -
trunk/Source/WebCore/html/FileInputType.cpp
r267074 r270784 94 94 auto button = adoptRef(*new UploadButtonElement(document)); 95 95 static MainThreadNeverDestroyed<const AtomString> buttonName("button", AtomString::ConstructFromLiteral); 96 static MainThreadNeverDestroyed<const AtomString> webkitFileUploadButtonName("-webkit-file-upload-button", AtomString::ConstructFromLiteral);96 static MainThreadNeverDestroyed<const AtomString> fileSelectorButtonName("file-selector-button", AtomString::ConstructFromLiteral); 97 97 button->setType(buttonName); 98 button->setPseudo( webkitFileUploadButtonName);98 button->setPseudo(fileSelectorButtonName); 99 99 button->setValue(value); 100 100 return button;
Note: See TracChangeset
for help on using the changeset viewer.