2011-06-03  Dominic Cooney  <dominicc@chromium.org>

        Reviewed by Kent Tamura.

        Adds a test that keygen clones have the right shadow pseudoclass.
        https://bugs.webkit.org/show_bug.cgi?id=61984

        * fast/html/clone-keygen-expected.txt: Added.
        * fast/html/clone-keygen.html: Added.
        * platform/win/Skipped: Test needs DRT functionality not in this port.
2011-06-03  Dominic Cooney  <dominicc@chromium.org>

        Reviewed by Kent Tamura.

        Cloned keygen shadows should have -webkit-keygen-select pseudoclass.
        https://bugs.webkit.org/show_bug.cgi?id=61984

        When cloneNode's tag name-based cloning algorithm clones the
        KeygenSelectElements of a keygen shadow as select elements. These
        lack the -webkit-keygen-select pseudoclass.

        Test: fast/html/clone-keygen.html

        * html/HTMLKeygenElement.cpp:
        (WebCore::KeygenSelectElement::cloneElementWithoutAttributesAndChildren): Create a KeygenSelectElement when being cloned.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@88002 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/html/HTMLKeygenElement.cpp b/Source/WebCore/html/HTMLKeygenElement.cpp
index 29c9deb..41b3ac3 100644
--- a/Source/WebCore/html/HTMLKeygenElement.cpp
+++ b/Source/WebCore/html/HTMLKeygenElement.cpp
@@ -60,6 +60,12 @@
         : HTMLSelectElement(selectTag, document, 0)
     {
     }
+
+private:
+    virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren() const
+    {
+        return create(document());
+    }
 };
 
 inline HTMLKeygenElement::HTMLKeygenElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)