Title: [99297] trunk
Revision
99297
Author
[email protected]
Date
2011-11-04 10:55:14 -0700 (Fri, 04 Nov 2011)

Log Message

HTMLKeygenElement: Fix "keytype" handling in appendFormData.
https://bugs.webkit.org/show_bug.cgi?id=70617

This fixes a bug introduced by http://trac.webkit.org/changeset/97658
which causes all HTML Keygen elements with a keytype optional attribute
to be considered as unsupported.

A regression test is included.

Patch by Gaurav Shah <[email protected]> on 2011-11-04
Reviewed by Darin Adler.

Source/WebCore:

Test: http/tests/misc/submit-post-keygen.html

* html/HTMLKeygenElement.cpp:

LayoutTests:

* http/tests/misc/resources/check-keygen-post.php: Added.
* http/tests/misc/submit-post-keygen-expected.txt: Added.
* http/tests/misc/submit-post-keygen.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (99296 => 99297)


--- trunk/LayoutTests/ChangeLog	2011-11-04 17:51:11 UTC (rev 99296)
+++ trunk/LayoutTests/ChangeLog	2011-11-04 17:55:14 UTC (rev 99297)
@@ -1,3 +1,21 @@
+2011-11-04  Gaurav Shah  <[email protected]>
+
+        HTMLKeygenElement: Fix "keytype" handling in appendFormData.
+        https://bugs.webkit.org/show_bug.cgi?id=70617
+
+        This fixes a bug introduced by http://trac.webkit.org/changeset/97658
+        which causes all HTML Keygen elements with a keytype optional attribute
+        to be considered as unsupported.
+
+        A regression test is included.
+
+        Reviewed by Darin Adler.
+
+        * http/tests/misc/resources/check-keygen-post.php: Added.
+        * http/tests/misc/submit-post-keygen-expected.txt: Added.
+        * http/tests/misc/submit-post-keygen.html: Added.
+
+
 2011-11-04  Simon Hausmann  <[email protected]>
 
         [Qt] Temporarily skip failing tests after the build system refactoring.

Added: trunk/LayoutTests/http/tests/misc/resources/check-keygen-post.php (0 => 99297)


--- trunk/LayoutTests/http/tests/misc/resources/check-keygen-post.php	                        (rev 0)
+++ trunk/LayoutTests/http/tests/misc/resources/check-keygen-post.php	2011-11-04 17:55:14 UTC (rev 99297)
@@ -0,0 +1,38 @@
+<?php
+header("Content-Type: text/html; charset=UTF-8");
+?>
+<html>
+<head>
+<script>
+
+function runTest()
+{
+    var r = document.getElementById('result');
+    var o = document.getElementById('output').firstChild;
+    if (o.nodeValue == 'spkac exists') 
+        r.innerHTML = "SUCCESS: keygen was parsed correctly";
+    else
+        r.innerHTML = "FAILURE: keygen was not parsed correctly. value=" +
+        o.nodeValue;
+        
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+
+</script>
+</head>
+<body _onload_="runTest()">
+<p>
+This is a regression test for keygen tag POST processing: https://bugs.webkit.org/show_bug.cgi?id=70617.
+</p>
+<div style='display: none;' id='output'><?php
+if (array_key_exists('spkac', $_REQUEST)) {
+    echo "spkac exists";
+} else {
+    echo "spkac does not exist";
+}
+?>
+</div>
+<div id="result"></div>
+</body>
+</html>

Added: trunk/LayoutTests/http/tests/misc/submit-post-keygen-expected.txt (0 => 99297)


--- trunk/LayoutTests/http/tests/misc/submit-post-keygen-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/misc/submit-post-keygen-expected.txt	2011-11-04 17:55:14 UTC (rev 99297)
@@ -0,0 +1,3 @@
+This is a regression test for keygen tag POST processing: https://bugs.webkit.org/show_bug.cgi?id=70617.
+
+SUCCESS: keygen was parsed correctly

Added: trunk/LayoutTests/http/tests/misc/submit-post-keygen.html (0 => 99297)


--- trunk/LayoutTests/http/tests/misc/submit-post-keygen.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/misc/submit-post-keygen.html	2011-11-04 17:55:14 UTC (rev 99297)
@@ -0,0 +1,19 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.waitUntilDone();
+    layoutTestController.dumpAsText();
+}
+function clickf()
+{
+    document.f.submit();
+}
+</script>
+</head>
+<body _onload_="clickf()">
+<form name="f" action="" method="post">
+<keygen name="spkac" keytype="RSA" />
+</form>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (99296 => 99297)


--- trunk/Source/WebCore/ChangeLog	2011-11-04 17:51:11 UTC (rev 99296)
+++ trunk/Source/WebCore/ChangeLog	2011-11-04 17:55:14 UTC (rev 99297)
@@ -1,3 +1,20 @@
+2011-11-04  Gaurav Shah  <[email protected]>
+
+        HTMLKeygenElement: Fix "keytype" handling in appendFormData.
+        https://bugs.webkit.org/show_bug.cgi?id=70617
+
+        This fixes a bug introduced by http://trac.webkit.org/changeset/97658
+        which causes all HTML Keygen elements with a keytype optional attribute
+        to be considered as unsupported.
+
+        A regression test is included.
+
+        Reviewed by Darin Adler.
+
+        Test: http/tests/misc/submit-post-keygen.html
+
+        * html/HTMLKeygenElement.cpp:
+
 2011-11-03  Adrienne Walker  <[email protected]>
 
         [chromium] Implement checkerboarding for missing layer tiles

Modified: trunk/Source/WebCore/html/HTMLKeygenElement.cpp (99296 => 99297)


--- trunk/Source/WebCore/html/HTMLKeygenElement.cpp	2011-11-04 17:51:11 UTC (rev 99296)
+++ trunk/Source/WebCore/html/HTMLKeygenElement.cpp	2011-11-04 17:55:14 UTC (rev 99297)
@@ -106,7 +106,7 @@
 {
     // Only RSA is supported at this time.
     const AtomicString& keyType = fastGetAttribute(keytypeAttr);
-    if (!keyType.isNull() || !equalIgnoringCase(keyType, "rsa"))
+    if (!keyType.isNull() && !equalIgnoringCase(keyType, "rsa"))
         return false;
     String value = signedPublicKeyAndChallengeString(shadowSelect()->selectedIndex(), fastGetAttribute(challengeAttr), document()->baseURL());
     if (value.isNull())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to