Changeset 251686 in webkit
- Timestamp:
- Oct 28, 2019 4:56:14 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r251685 r251686 1 2019-10-28 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add bindings support for the enterkeyhint HTML attribute 4 https://bugs.webkit.org/show_bug.cgi?id=203440 5 6 Reviewed by Ryosuke Niwa. 7 8 * fast/forms/enterkeyhint-attribute-values-expected.txt: Added. 9 * fast/forms/enterkeyhint-attribute-values.html: Added. 10 11 Add a new layout test to exercise the new attribute (including case sensitivity, the default value, unknown 12 values, all known value types, and different types of elements). 13 14 * platform/ios-wk2/TestExpectations: 15 * platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: 16 * platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt: Added. 17 * platform/ios-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt: 18 * platform/mac-wk2/TestExpectations: 19 * platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: 20 * platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/reflection-misc-expected.txt: Added. 21 * platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt: 22 23 Add some new baselines for some existing layout tests. 24 1 25 2019-10-28 Truitt Savell <tsavell@apple.com> 2 26 -
trunk/LayoutTests/TestExpectations
r251677 r251686 70 70 # WebKit2 only. 71 71 printing/printing-events.html [ Skip ] 72 fast/forms/enterkeyhint-attribute-values.html [ Skip ] 72 73 73 74 http/tests/security/xss-DENIED-xsl-external-entity-no-logging.xml [ Skip ] -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt
r251630 r251686 193 193 FAIL HTMLElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing 194 194 PASS HTMLElement interface: attribute contentEditable 195 FAIL HTMLElement interface: attribute enterKeyHint assert_true: The prototype object must have a property "enterKeyHint" expected true got false 195 PASS HTMLElement interface: attribute enterKeyHint 196 196 PASS HTMLElement interface: attribute isContentEditable 197 197 PASS HTMLElement interface: attribute inputMode … … 283 283 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onpaste" with the proper type 284 284 PASS HTMLElement interface: document.createElement("noscript") must inherit property "contentEditable" with the proper type 285 FAIL HTMLElement interface: document.createElement("noscript") must inherit property "enterKeyHint" with the proper type assert_inherits: property "enterKeyHint" not found in prototype chain 285 PASS HTMLElement interface: document.createElement("noscript") must inherit property "enterKeyHint" with the proper type 286 286 PASS HTMLElement interface: document.createElement("noscript") must inherit property "isContentEditable" with the proper type 287 287 PASS HTMLElement interface: document.createElement("noscript") must inherit property "inputMode" with the proper type -
trunk/LayoutTests/platform/ios-wk2/TestExpectations
r251609 r251686 28 28 accessibility/smart-invert.html [ Pass ] 29 29 accessibility/smart-invert-reference.html [ Pass ] 30 fast/forms/enterkeyhint-attribute-values.html [ Pass ] 30 31 fast/media/mq-inverted-colors-live-update.html [ Pass ] 31 32 fast/media/mq-inverted-colors-live-update-in-subframes.html [ Pass ] -
trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt
r251630 r251686 193 193 FAIL HTMLElement interface: attribute onpaste assert_own_property: expected property "onpaste" missing 194 194 PASS HTMLElement interface: attribute contentEditable 195 FAIL HTMLElement interface: attribute enterKeyHint assert_true: The prototype object must have a property "enterKeyHint" expected true got false 195 PASS HTMLElement interface: attribute enterKeyHint 196 196 PASS HTMLElement interface: attribute isContentEditable 197 197 PASS HTMLElement interface: attribute inputMode … … 283 283 PASS HTMLElement interface: document.createElement("noscript") must inherit property "onpaste" with the proper type 284 284 PASS HTMLElement interface: document.createElement("noscript") must inherit property "contentEditable" with the proper type 285 FAIL HTMLElement interface: document.createElement("noscript") must inherit property "enterKeyHint" with the proper type assert_inherits: property "enterKeyHint" not found in prototype chain 285 PASS HTMLElement interface: document.createElement("noscript") must inherit property "enterKeyHint" with the proper type 286 286 PASS HTMLElement interface: document.createElement("noscript") must inherit property "isContentEditable" with the proper type 287 287 PASS HTMLElement interface: document.createElement("noscript") must inherit property "inputMode" with the proper type -
trunk/LayoutTests/platform/ios-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt
r244582 r251686 53 53 PASS a["webkitdropzone"] is 54 54 PASS a["inputMode"] is 55 PASS a["enterKeyHint"] is 55 56 PASS a["style"] is [object CSSStyleDeclaration] 56 57 PASS a["attributeStyleMap"] is [object StylePropertyMap] -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r251598 r251686 22 22 fast/events/autoscroll-when-zoomed.html [ Pass ] 23 23 fast/events/autoscroll-main-document.html [ Pass ] 24 25 fast/forms/enterkeyhint-attribute-values.html [ Pass ] 24 26 25 27 accessibility/smart-invert.html [ Pass ] -
trunk/LayoutTests/platform/mac-wk2/js/dom/dom-static-property-for-in-iteration-expected.txt
r250584 r251686 53 53 PASS a["webkitdropzone"] is 54 54 PASS a["inputMode"] is 55 PASS a["enterKeyHint"] is 55 56 PASS a["style"] is [object CSSStyleDeclaration] 56 57 PASS a["attributeStyleMap"] is [object StylePropertyMap] -
trunk/Source/WebCore/ChangeLog
r251683 r251686 1 2019-10-28 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add bindings support for the enterkeyhint HTML attribute 4 https://bugs.webkit.org/show_bug.cgi?id=203440 5 6 Reviewed by Ryosuke Niwa. 7 8 Work towards support for the enterkeyhint attribute. This patch introduces the new attribute to HTMLElement's 9 IDL; see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-enterkeyhint-attribute 10 for more information. This version of the spec was last updated October 25, 2019 (at time of writing). 11 12 Test: fast/forms/enterkeyhint-attribute-values.html 13 14 * Sources.txt: 15 * WebCore.xcodeproj/project.pbxproj: 16 * html/EnterKeyHint.cpp: Added. 17 18 Add a new helper file that declares a new EnterKeyHint enum type, as well as helper functions to map between 19 attribute values and EnterKeyHint values. 20 21 (WebCore::enterKeyHintForAttributeValue): 22 (WebCore::attributeValueForEnterKeyHint): 23 * html/EnterKeyHint.h: Added. 24 * html/HTMLAttributeNames.in: 25 * html/HTMLElement.cpp: 26 (WebCore::HTMLElement::canonicalEnterKeyHint const): 27 28 Returns the canonical EnterKeyHint enum value, by inspecting the "enterkeyhint" attribute value. 29 30 (WebCore::HTMLElement::enterKeyHint const): 31 (WebCore::HTMLElement::setEnterKeyHint): 32 33 Implement enterKeyHint. Since enterkeyhint is a reflected HTML attribute with enumerated values, the setter sets 34 the attribute value and the getter returns the "canonicalized" attribute value. 35 36 * html/HTMLElement.h: 37 * html/HTMLElement.idl: 38 39 Add the new attribute. Note that this isn't marked as [Reflect] in IDL, since doing so would generate incorrect 40 bindings code. This is because we don't support reflection for enumerated attributes in our bindings generator 41 yet, so for now, we just match `HTMLInputElement.type` and `HTMLElement.inputMode`. 42 43 * page/Settings.yaml: 44 45 Add a new runtime switch to guard the enterkeyhint attribute. 46 1 47 2019-10-28 Chris Dumez <cdumez@apple.com> 2 48 -
trunk/Source/WebCore/Sources.txt
r251637 r251686 1111 1111 html/DateTimeLocalInputType.cpp 1112 1112 html/EmailInputType.cpp 1113 html/EnterKeyHint.cpp 1113 1114 html/FTPDirectoryDocument.cpp 1114 1115 html/FileListCreator.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r251655 r251686 4891 4891 F3ABFE0C130E9DA000E7F7D1 /* InstrumentingAgents.h in Headers */ = {isa = PBXBuildFile; fileRef = F3ABFE0B130E9DA000E7F7D1 /* InstrumentingAgents.h */; }; 4892 4892 F3D461491161D53200CA0D09 /* JSErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = F3D461471161D53200CA0D09 /* JSErrorHandler.h */; }; 4893 F403E7872363B58C00044550 /* EnterKeyHint.h in Headers */ = {isa = PBXBuildFile; fileRef = F403E7852363B58C00044550 /* EnterKeyHint.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4893 4894 F433E9031DBBDBA200EF0D14 /* StaticPasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F433E9021DBBDBA200EF0D14 /* StaticPasteboard.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4894 4895 F440E77A233D94D70063F9AB /* NavigatorClipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F440E76F233D94D30063F9AB /* NavigatorClipboard.h */; }; … … 15261 15262 F3D461461161D53200CA0D09 /* JSErrorHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSErrorHandler.cpp; sourceTree = "<group>"; }; 15262 15263 F3D461471161D53200CA0D09 /* JSErrorHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorHandler.h; sourceTree = "<group>"; }; 15264 F403E7852363B58C00044550 /* EnterKeyHint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EnterKeyHint.h; sourceTree = "<group>"; }; 15265 F403E7862363B58C00044550 /* EnterKeyHint.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = EnterKeyHint.cpp; sourceTree = "<group>"; }; 15263 15266 F42CEB54214031EE002DCA72 /* FontAttributeChangesCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FontAttributeChangesCocoa.mm; sourceTree = "<group>"; }; 15264 15267 F433E9021DBBDBA200EF0D14 /* StaticPasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticPasteboard.h; sourceTree = "<group>"; }; … … 21598 21601 F55B3D871251F12D003EF269 /* EmailInputType.cpp */, 21599 21602 F55B3D881251F12D003EF269 /* EmailInputType.h */, 21603 F403E7862363B58C00044550 /* EnterKeyHint.cpp */, 21604 F403E7852363B58C00044550 /* EnterKeyHint.h */, 21600 21605 41A0829B22932EF4008426E0 /* FeaturePolicy.cpp */, 21601 21606 41A0829922932EF4008426E0 /* FeaturePolicy.h */, … … 29513 29518 414DEDE71F9FE91E0047C40D /* EmptyFrameLoaderClient.h in Headers */, 29514 29519 515BE1901D54F5FB00DD7C68 /* EmptyGamepadProvider.h in Headers */, 29520 F403E7872363B58C00044550 /* EnterKeyHint.h in Headers */, 29515 29521 1D2F8E042344751600993B68 /* EnterPictureInPictureEvent.h in Headers */, 29516 29522 FD31609312B026F700C1A359 /* EqualPowerPanner.h in Headers */, -
trunk/Source/WebCore/html/HTMLAttributeNames.in
r250712 r251686 122 122 enctype 123 123 end 124 enterkeyhint 124 125 event 125 126 expanded -
trunk/Source/WebCore/html/HTMLElement.cpp
r248784 r251686 35 35 #include "DocumentFragment.h" 36 36 #include "ElementAncestorIterator.h" 37 #include "EnterKeyHint.h" 37 38 #include "Event.h" 38 39 #include "EventListener.h" … … 1120 1121 } 1121 1122 1123 EnterKeyHint HTMLElement::canonicalEnterKeyHint() const 1124 { 1125 return enterKeyHintForAttributeValue(attributeWithoutSynchronization(enterkeyhintAttr)); 1126 } 1127 1128 String HTMLElement::enterKeyHint() const 1129 { 1130 return attributeValueForEnterKeyHint(canonicalEnterKeyHint()); 1131 } 1132 1133 void HTMLElement::setEnterKeyHint(const String& value) 1134 { 1135 setAttributeWithoutSynchronization(enterkeyhintAttr, value); 1136 } 1137 1122 1138 } // namespace WebCore 1123 1139 -
trunk/Source/WebCore/html/HTMLElement.h
r249194 r251686 37 37 class HTMLCollection; 38 38 class HTMLFormElement; 39 40 enum class EnterKeyHint : uint8_t; 39 41 40 42 class HTMLElement : public StyledElement { … … 115 117 void setInputMode(const AtomString& value); 116 118 119 WEBCORE_EXPORT EnterKeyHint canonicalEnterKeyHint() const; 120 String enterKeyHint() const; 121 void setEnterKeyHint(const String& value); 122 117 123 protected: 118 124 HTMLElement(const QualifiedName& tagName, Document&, ConstructionType); -
trunk/Source/WebCore/html/HTMLElement.idl
r249212 r251686 66 66 67 67 attribute DOMString inputMode; 68 [EnabledBySetting=EnterKeyHint] attribute DOMString enterKeyHint; 68 69 }; 69 70 -
trunk/Source/WebCore/page/Settings.yaml
r251467 r251686 876 876 initial: false 877 877 878 enterKeyHintEnabled: 879 initial: false 880 878 881 # Deprecated 879 882 -
trunk/Source/WebKit/ChangeLog
r251676 r251686 1 2019-10-28 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add bindings support for the enterkeyhint HTML attribute 4 https://bugs.webkit.org/show_bug.cgi?id=203440 5 6 Reviewed by Ryosuke Niwa. 7 8 Add a new runtime switch for the enterkeyhint attribute, and enable it by default on macOS and iOS. 9 10 * Shared/WebPreferences.yaml: 11 * Shared/WebPreferencesDefaultValues.h: 12 1 13 2019-10-28 Alex Christensen <achristensen@webkit.org> 2 14 -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r251656 r251686 1714 1714 condition: PLATFORM(IOS_FAMILY) 1715 1715 1716 EnterKeyHintEnabled: 1717 type: bool 1718 defaultValue: DEFAULT_ENTER_KEY_HINT_ENABLED 1719 humanReadableName: "Enter Key Hint" 1720 humanReadableDescription: "Enable the enterKeyHint HTML attribute" 1721 category: internal 1722 1716 1723 ReferrerPolicyAttributeEnabled: 1717 1724 type: bool -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h
r251656 r251686 301 301 #endif 302 302 303 #if PLATFORM(COCOA) 304 #define DEFAULT_ENTER_KEY_HINT_ENABLED true 305 #else 306 #define DEFAULT_ENTER_KEY_HINT_ENABLED false 307 #endif 308 303 309 namespace WebKit { 304 310
Note: See TracChangeset
for help on using the changeset viewer.