Title: [197864] trunk
Revision
197864
Author
[email protected]
Date
2016-03-09 10:45:18 -0800 (Wed, 09 Mar 2016)

Log Message

Align HTMLKeygenElement.keytype with the specification
https://bugs.webkit.org/show_bug.cgi?id=155214

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/reflection-forms-expected.txt:

Source/WebCore:

Align HTMLKeygenElement.keytype with the specification:
- https://html.spec.whatwg.org/#dom-keygen-keytype
- https://html.spec.whatwg.org/#attr-keygen-keytype

In particular, the following changes were made:
1. Return "rsa" by default (i.e. when the corresponding content attribute is missing)
2. Only return known values

Test: fast/dom/HTMLKeygenElement/keygen-keytype.html

* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::setKeytype):
(WebCore::HTMLKeygenElement::keytype):
(WebCore::HTMLKeygenElement::appendFormData):
* html/HTMLKeygenElement.h:
* html/HTMLKeygenElement.idl:

LayoutTests:

Add test coverage for HTMLKeygenElement.keytype.

* fast/dom/HTMLKeygenElement/keygen-keytype-expected.txt: Added.
* fast/dom/HTMLKeygenElement/keygen-keytype.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (197863 => 197864)


--- trunk/LayoutTests/ChangeLog	2016-03-09 18:26:38 UTC (rev 197863)
+++ trunk/LayoutTests/ChangeLog	2016-03-09 18:45:18 UTC (rev 197864)
@@ -1,3 +1,15 @@
+2016-03-09  Chris Dumez  <[email protected]>
+
+        Align HTMLKeygenElement.keytype with the specification
+        https://bugs.webkit.org/show_bug.cgi?id=155214
+
+        Reviewed by Darin Adler.
+
+        Add test coverage for HTMLKeygenElement.keytype.
+
+        * fast/dom/HTMLKeygenElement/keygen-keytype-expected.txt: Added.
+        * fast/dom/HTMLKeygenElement/keygen-keytype.html: Added.
+
 2016-03-09  Ryan Haddad  <[email protected]>
 
         Cleaning up TestExpectations files to remove deleted tests and duplicate entries for ios-simulator.

Added: trunk/LayoutTests/fast/dom/HTMLKeygenElement/keygen-keytype-expected.txt (0 => 197864)


--- trunk/LayoutTests/fast/dom/HTMLKeygenElement/keygen-keytype-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLKeygenElement/keygen-keytype-expected.txt	2016-03-09 18:45:18 UTC (rev 197864)
@@ -0,0 +1,20 @@
+Tests the keygen.keytype attribute
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS keygen.keytype is "rsa"
+PASS keygen.getAttribute('keytype') is null
+keygen.keytype = 'RSA'
+PASS keygen.keytype is "rsa"
+PASS keygen.getAttribute('keytype') is "RSA"
+keygen.keytype = 'INVALID'
+PASS keygen.keytype is ""
+PASS keygen.getAttribute('keytype') is "INVALID"
+keygen.keytype = 'rsa'
+PASS keygen.keytype is "rsa"
+PASS keygen.getAttribute('keytype') is "rsa"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/dom/HTMLKeygenElement/keygen-keytype.html (0 => 197864)


--- trunk/LayoutTests/fast/dom/HTMLKeygenElement/keygen-keytype.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLKeygenElement/keygen-keytype.html	2016-03-09 18:45:18 UTC (rev 197864)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+description("Tests the keygen.keytype attribute");
+
+var keygen = document.createElement("keygen");
+shouldBeEqualToString("keygen.keytype", "rsa");
+shouldBeNull("keygen.getAttribute('keytype')");
+
+evalAndLog("keygen.keytype = 'RSA'");
+shouldBeEqualToString("keygen.keytype", "rsa");
+shouldBeEqualToString("keygen.getAttribute('keytype')", "RSA");
+
+evalAndLog("keygen.keytype = 'INVALID'");
+shouldBeEqualToString("keygen.keytype", "");
+shouldBeEqualToString("keygen.getAttribute('keytype')", "INVALID");
+
+evalAndLog("keygen.keytype = 'rsa'");
+shouldBeEqualToString("keygen.keytype", "rsa");
+shouldBeEqualToString("keygen.getAttribute('keytype')", "rsa");
+
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (197863 => 197864)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-03-09 18:26:38 UTC (rev 197863)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-03-09 18:45:18 UTC (rev 197864)
@@ -1,3 +1,14 @@
+2016-03-09  Chris Dumez  <[email protected]>
+
+        Align HTMLKeygenElement.keytype with the specification
+        https://bugs.webkit.org/show_bug.cgi?id=155214
+
+        Reviewed by Darin Adler.
+
+        Rebaseline now that more checks are passing.
+
+        * web-platform-tests/html/dom/reflection-forms-expected.txt:
+
 2016-03-08  Youenn Fablet  <[email protected]>
 
         [Fetch API] Implement fetch skeleton

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (197863 => 197864)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt	2016-03-09 18:26:38 UTC (rev 197863)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt	2016-03-09 18:45:18 UTC (rev 197864)
@@ -16766,7 +16766,7 @@
 PASS keygen.keytype: setAttribute() to "rsa" followed by getAttribute() 
 PASS keygen.keytype: setAttribute() to "rsa" followed by IDL get 
 PASS keygen.keytype: setAttribute() to "RSA" followed by getAttribute() 
-FAIL keygen.keytype: setAttribute() to "RSA" followed by IDL get assert_equals: expected "rsa" but got "RSA"
+PASS keygen.keytype: setAttribute() to "RSA" followed by IDL get 
 PASS keygen.keytype: IDL set to "" should not throw 
 PASS keygen.keytype: IDL set to "" followed by getAttribute() 
 PASS keygen.keytype: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " should not throw 
@@ -16807,7 +16807,7 @@
 PASS keygen.keytype: IDL set to "sa" followed by getAttribute() 
 PASS keygen.keytype: IDL set to "RSA" should not throw 
 PASS keygen.keytype: IDL set to "RSA" followed by getAttribute() 
-FAIL keygen.keytype: IDL set to "RSA" followed by IDL get assert_equals: expected "rsa" but got "RSA"
+PASS keygen.keytype: IDL set to "RSA" followed by IDL get 
 PASS keygen.name: typeof IDL attribute 
 PASS keygen.name: IDL get with DOM attribute unset 
 PASS keygen.name: setAttribute() to "" followed by getAttribute() 

Modified: trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (197863 => 197864)


--- trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt	2016-03-09 18:26:38 UTC (rev 197863)
+++ trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt	2016-03-09 18:45:18 UTC (rev 197864)
@@ -16766,7 +16766,7 @@
 PASS keygen.keytype: setAttribute() to "rsa" followed by getAttribute() 
 PASS keygen.keytype: setAttribute() to "rsa" followed by IDL get 
 PASS keygen.keytype: setAttribute() to "RSA" followed by getAttribute() 
-FAIL keygen.keytype: setAttribute() to "RSA" followed by IDL get assert_equals: expected "rsa" but got "RSA"
+PASS keygen.keytype: setAttribute() to "RSA" followed by IDL get 
 PASS keygen.keytype: IDL set to "" should not throw 
 PASS keygen.keytype: IDL set to "" followed by getAttribute() 
 PASS keygen.keytype: IDL set to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " should not throw 
@@ -16807,7 +16807,7 @@
 PASS keygen.keytype: IDL set to "sa" followed by getAttribute() 
 PASS keygen.keytype: IDL set to "RSA" should not throw 
 PASS keygen.keytype: IDL set to "RSA" followed by getAttribute() 
-FAIL keygen.keytype: IDL set to "RSA" followed by IDL get assert_equals: expected "rsa" but got "RSA"
+PASS keygen.keytype: IDL set to "RSA" followed by IDL get 
 PASS keygen.name: typeof IDL attribute 
 PASS keygen.name: IDL get with DOM attribute unset 
 PASS keygen.name: setAttribute() to "" followed by getAttribute() 

Modified: trunk/Source/WebCore/ChangeLog (197863 => 197864)


--- trunk/Source/WebCore/ChangeLog	2016-03-09 18:26:38 UTC (rev 197863)
+++ trunk/Source/WebCore/ChangeLog	2016-03-09 18:45:18 UTC (rev 197864)
@@ -1,3 +1,27 @@
+2016-03-09  Chris Dumez  <[email protected]>
+
+        Align HTMLKeygenElement.keytype with the specification
+        https://bugs.webkit.org/show_bug.cgi?id=155214
+
+        Reviewed by Darin Adler.
+
+        Align HTMLKeygenElement.keytype with the specification:
+        - https://html.spec.whatwg.org/#dom-keygen-keytype
+        - https://html.spec.whatwg.org/#attr-keygen-keytype
+
+        In particular, the following changes were made:
+        1. Return "rsa" by default (i.e. when the corresponding content attribute is missing)
+        2. Only return known values
+
+        Test: fast/dom/HTMLKeygenElement/keygen-keytype.html
+
+        * html/HTMLKeygenElement.cpp:
+        (WebCore::HTMLKeygenElement::setKeytype):
+        (WebCore::HTMLKeygenElement::keytype):
+        (WebCore::HTMLKeygenElement::appendFormData):
+        * html/HTMLKeygenElement.h:
+        * html/HTMLKeygenElement.idl:
+
 2016-03-09  Philippe Normand  <[email protected]>
 
         [GStreamer] Fix MediaPlayerPrivate conflicts

Modified: trunk/Source/WebCore/html/HTMLKeygenElement.cpp (197863 => 197864)


--- trunk/Source/WebCore/html/HTMLKeygenElement.cpp	2016-03-09 18:26:38 UTC (rev 197863)
+++ trunk/Source/WebCore/html/HTMLKeygenElement.cpp	2016-03-09 18:45:18 UTC (rev 197864)
@@ -98,11 +98,26 @@
     HTMLFormControlElement::parseAttribute(name, value);
 }
 
+bool HTMLKeygenElement::isKeytypeRSA() const
+{
+    const auto& keyType = fastGetAttribute(keytypeAttr);
+    return keyType.isNull() || equalLettersIgnoringASCIICase(keyType, "rsa");
+}
+
+void HTMLKeygenElement::setKeytype(const AtomicString& value)
+{
+    setAttributeWithoutSynchronization(keytypeAttr, value);
+}
+
+String HTMLKeygenElement::keytype() const
+{
+    return isKeytypeRSA() ? ASCIILiteral("rsa") : emptyString();
+}
+
 bool HTMLKeygenElement::appendFormData(FormDataList& encoded_values, bool)
 {
     // Only RSA is supported at this time.
-    const AtomicString& keyType = fastGetAttribute(keytypeAttr);
-    if (!keyType.isNull() && !equalLettersIgnoringASCIICase(keyType, "rsa"))
+    if (!isKeytypeRSA())
         return false;
     String value = signedPublicKeyAndChallengeString(shadowSelect()->selectedIndex(), fastGetAttribute(challengeAttr), document().baseURL());
     if (value.isNull())

Modified: trunk/Source/WebCore/html/HTMLKeygenElement.h (197863 => 197864)


--- trunk/Source/WebCore/html/HTMLKeygenElement.h	2016-03-09 18:26:38 UTC (rev 197863)
+++ trunk/Source/WebCore/html/HTMLKeygenElement.h	2016-03-09 18:45:18 UTC (rev 197864)
@@ -34,6 +34,9 @@
 public:
     static Ref<HTMLKeygenElement> create(const QualifiedName&, Document&, HTMLFormElement*);
 
+    void setKeytype(const AtomicString&);
+    String keytype() const;
+
 private:
     HTMLKeygenElement(const QualifiedName&, Document&, HTMLFormElement*);
 
@@ -54,6 +57,8 @@
 
     bool canHaveUserAgentShadowRoot() const final { return true; }
 
+    bool isKeytypeRSA() const;
+
     HTMLSelectElement* shadowSelect() const;
 };
 

Modified: trunk/Source/WebCore/html/HTMLKeygenElement.idl (197863 => 197864)


--- trunk/Source/WebCore/html/HTMLKeygenElement.idl	2016-03-09 18:26:38 UTC (rev 197863)
+++ trunk/Source/WebCore/html/HTMLKeygenElement.idl	2016-03-09 18:45:18 UTC (rev 197864)
@@ -33,7 +33,7 @@
     [Reflect] attribute DOMString challenge;
     [Reflect] attribute boolean disabled;
     readonly attribute HTMLFormElement form;
-    [Reflect] attribute DOMString keytype;
+    attribute DOMString keytype;
     [Reflect] attribute DOMString name;
 
     readonly attribute DOMString type;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to