Changeset 77781 in webkit
- Timestamp:
- Feb 6, 2011 5:40:17 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r77778 r77781 1 2011-02-06 Dominic Cooney <dominicc@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 Convert <keygen> option elements to a shadow DOM 6 https://bugs.webkit.org/show_bug.cgi?id=51379 7 8 * html5lib/runner-expected.txt: Two more tests pass. 9 * platform/mac/fast/html/keygen-expected.txt: Shadow render tree. 10 * platform/mac/fast/invalid/residual-style-expected.txt: 11 1 12 2011-02-06 Patrick Gansterer <paroga@webkit.org> 2 13 -
trunk/LayoutTests/html5lib/runner-expected.txt
r70293 r77781 28 28 resources/tests6.dat: PASS 29 29 30 resources/tests7.dat: 31 30 32 33 Test 30 of 30 in resources/tests7.dat failed. Input: 34 <select><keygen> 35 Got: 36 | <html> 37 | <head> 38 | <body> 39 | <select> 40 | <keygen> 41 | <option> 42 | "2048 (High Grade)" 43 | <option> 44 | "1024 (Medium Grade)" 45 | <option> 46 | "512 (Low Grade)" 47 Expected: 48 | <html> 49 | <head> 50 | <body> 51 | <select> 52 | <keygen> 30 resources/tests7.dat: PASS 31 53 32 resources/tests8.dat: PASS 54 33 … … 250 229 31 251 230 32 252 63253 231 78 254 232 … … 298 276 | <p> 299 277 | <h1> 300 301 Test 63 of 97 in resources/tests19.dat failed. Input:302 <!doctype html><keygen><frameset>303 Got:304 | <!DOCTYPE html>305 | <html>306 | <head>307 | <body>308 | <keygen>309 | <option>310 | "2048 (High Grade)"311 | <option>312 | "1024 (Medium Grade)"313 | <option>314 | "512 (Low Grade)"315 Expected:316 | <!DOCTYPE html>317 | <html>318 | <head>319 | <body>320 | <keygen>321 278 322 279 Test 78 of 97 in resources/tests19.dat failed. Input: -
trunk/LayoutTests/platform/gtk/Skipped
r77769 r77781 4387 4387 http/tests/xmlhttprequest/remember-bad-password.html 4388 4388 4389 # There's somethign strange going on with <keygen> that causes a4390 # different DOM to be created.4391 html5lib/runner.html4392 4393 4389 # Still failing, looks like a bug in the EventSender drag-and-drop 4394 4390 fast/css/user-drag-none.html -
trunk/LayoutTests/platform/mac/fast/html/keygen-expected.txt
r63403 r77781 4 4 RenderBlock {HTML} at (0,0) size 800x600 5 5 RenderBody {BODY} at (8,8) size 784x584 6 RenderMenuList {KEYGEN} at (2,2) size 148x18 [bgcolor=#FFFFFF] 7 RenderBlock (anonymous) at (0,0) size 148x18 8 RenderText at (8,2) size 99x13 9 text run at (8,2) width 99: "2048 (High Grade)" 6 RenderBlock {KEYGEN} at (2,2) size 148x18 7 RenderMenuList {SELECT} at (0,0) size 148x18 [bgcolor=#FFFFFF] 8 RenderBlock (anonymous) at (0,0) size 148x18 9 RenderText at (8,2) size 99x13 10 text run at (8,2) width 99: "2048 (High Grade)" 10 11 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/fast/invalid/residual-style-expected.txt
r64712 r77781 445 445 RenderText {#text} at (0,1) size 76x18 446 446 text run at (0,1) width 76: "KEYGEN: " 447 RenderMenuList {KEYGEN} at (78,2) size 148x18 [bgcolor=#FFFFFF] 448 RenderBlock (anonymous) at (0,0) size 148x18 449 RenderText at (8,2) size 99x13 450 text run at (8,2) width 99: "2048 (High Grade)" 447 RenderBlock {KEYGEN} at (78,2) size 148x18 448 RenderMenuList {SELECT} at (0,0) size 148x18 [bgcolor=#FFFFFF] 449 RenderBlock (anonymous) at (0,0) size 148x18 450 RenderText at (8,2) size 99x13 451 text run at (8,2) width 99: "2048 (High Grade)" 451 452 RenderInline {FONT} at (0,0) size 171x18 [color=#008000] 452 453 RenderText {#text} at (228,1) size 171x18 -
trunk/LayoutTests/platform/qt/Skipped
r77764 r77781 4825 4825 http/tests/xmlhttprequest/remember-bad-password.html 4826 4826 4827 # There's somethign strange going on with <keygen> that causes a4828 # different DOM to be created.4829 html5lib/runner.html4830 4831 4827 # The feature was disabled due to a compatibility issue. 4832 4828 # https://bugs.webkit.org/show_bug.cgi?id=40520 -
trunk/Source/WebCore/ChangeLog
r77779 r77781 1 2011-02-03 Dominic Cooney <dominicc@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 Convert <keygen> option elements to a shadow DOM 6 https://bugs.webkit.org/show_bug.cgi?id=51379 7 8 Covered by existing tests e.g. fast/html/keygen.html, 9 html5lib/runner.html, etc. 10 11 * css/html.css: 12 (form): Cleanup. 13 (keygen, select): Border radii should match so focus ring looks good. 14 (keygen::-webkit-keygen-select): No margin on the shadow element. 15 (select): Hoisting border radius to keygen, select rule. 16 * dom/SelectElement.cpp: 17 (WebCore::toSelectElement): keygen is no longer a select element. 18 * html/HTMLKeygenElement.cpp: Implements keygen shadow. 19 (WebCore::KeygenSelectElement::create): 20 (WebCore::KeygenSelectElement::shadowPseudoId): 21 (WebCore::KeygenSelectElement::KeygenSelectElement): 22 (WebCore::HTMLKeygenElement::HTMLKeygenElement): 23 (WebCore::HTMLKeygenElement::parseMappedAttribute): 24 (WebCore::HTMLKeygenElement::appendFormData): 25 (WebCore::HTMLKeygenElement::formControlType): 26 (WebCore::HTMLKeygenElement::reset): 27 (WebCore::HTMLKeygenElement::selectShadow): 28 * html/HTMLKeygenElement.h: keygen is no longer a select on C++ side. 29 (WebCore::HTMLKeygenElement::canStartSelection): 30 (WebCore::HTMLKeygenElement::isEnumeratable): 31 (WebCore::HTMLKeygenElement::isResettable): 32 * html/HTMLOptionElement.cpp: 33 (WebCore::HTMLOptionElement::ownerSelectElement): Only owned by selects. 34 * html/HTMLSelectElement.cpp: 35 (WebCore::HTMLSelectElement::HTMLSelectElement): Only 'select' tag name. 36 1 37 2011-02-06 Benjamin Poulain <ikipou@gmail.com> 2 38 -
trunk/Source/WebCore/css/html.css
r77665 r77781 324 324 form { 325 325 display: block; 326 margin-top: 0__qem 326 margin-top: 0__qem; 327 327 } 328 328 … … 432 432 -webkit-appearance: -webkit-input-speech-button; 433 433 display: inline-block; 434 } 435 436 keygen, select { 437 -webkit-border-radius: 5px; 438 } 439 440 keygen::-webkit-keygen-select { 441 margin: 0px; 434 442 } 435 443 … … 536 544 } 537 545 538 keygen,select {546 select { 539 547 -webkit-appearance: menulist; 540 548 -webkit-box-sizing: border-box; 541 549 -webkit-box-align: center; 542 550 border: 1px solid; 543 -webkit-border-radius: 5px;544 551 white-space: pre; 545 552 -webkit-rtl-ordering: logical; -
trunk/Source/WebCore/dom/SelectElement.cpp
r77206 r77781 31 31 #include "Frame.h" 32 32 #include "HTMLFormElement.h" 33 #include "HTMLKeygenElement.h"34 33 #include "HTMLNames.h" 35 34 #include "HTMLSelectElement.h" … … 1028 1027 SelectElement* toSelectElement(Element* element) 1029 1028 { 1030 if (element->isHTMLElement()) { 1031 if (element->hasTagName(HTMLNames::selectTag)) 1032 return static_cast<HTMLSelectElement*>(element); 1033 if (element->hasTagName(HTMLNames::keygenTag)) 1034 return static_cast<HTMLKeygenElement*>(element); 1035 } 1029 if (element->isHTMLElement() && element->hasTagName(HTMLNames::selectTag)) 1030 return static_cast<HTMLSelectElement*>(element); 1036 1031 1037 1032 #if ENABLE(WML) -
trunk/Source/WebCore/html/HTMLKeygenElement.cpp
r65986 r77781 30 30 #include "FormDataList.h" 31 31 #include "HTMLNames.h" 32 #include "HTMLSelectElement.h" 32 33 #include "HTMLOptionElement.h" 33 34 #include "SSLKeyGenerator.h" … … 41 42 using namespace HTMLNames; 42 43 44 class KeygenSelectElement : public HTMLSelectElement { 45 public: 46 static PassRefPtr<KeygenSelectElement> create(Document* document) 47 { 48 return adoptRef(new KeygenSelectElement(document)); 49 } 50 51 virtual const AtomicString& shadowPseudoId() const 52 { 53 DEFINE_STATIC_LOCAL(AtomicString, pseudoId, ("-webkit-keygen-select")); 54 return pseudoId; 55 } 56 57 protected: 58 KeygenSelectElement(Document* document) 59 : HTMLSelectElement(selectTag, document, 0) 60 { 61 } 62 }; 63 43 64 inline HTMLKeygenElement::HTMLKeygenElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form) 44 : HTML SelectElement(tagName, document, form)65 : HTMLFormControlElementWithState(tagName, document, form) 45 66 { 46 67 ASSERT(hasTagName(keygenTag)); 47 68 48 // FIXME: This markup should go in the shadow tree.49 // Add one option element for each key size.69 // Create a select element with one option element for each key size. 70 RefPtr<HTMLSelectElement> select = KeygenSelectElement::create(document); 50 71 Vector<String> keys; 51 72 getSupportedKeySizes(keys); 52 73 for (size_t i = 0; i < keys.size(); ++i) { 53 74 RefPtr<HTMLOptionElement> option = HTMLOptionElement::create(document, this->form()); 54 parserAddChild(option);75 select->parserAddChild(option); 55 76 option->parserAddChild(Text::create(document, keys[i])); 56 77 } 78 setShadowRoot(select); 57 79 } 58 80 … … 60 82 { 61 83 return adoptRef(new HTMLKeygenElement(tagName, document, form)); 84 } 85 86 void HTMLKeygenElement::parseMappedAttribute(Attribute* attr) 87 { 88 // Reflect disabled attribute on the shadow select element 89 if (attr->name() == disabledAttr) 90 selectShadow()->setAttribute(attr->name(), attr->value()); 91 92 if (attr->name() == challengeAttr) 93 m_challenge = attr->value(); 94 else if (attr->name() == keytypeAttr) 95 m_keyType = attr->value(); 96 else 97 HTMLFormControlElement::parseMappedAttribute(attr); 98 } 99 100 bool HTMLKeygenElement::appendFormData(FormDataList& encoded_values, bool) 101 { 102 // Only RSA is supported at this time. 103 if (!m_keyType.isNull() && !equalIgnoringCase(m_keyType, "rsa")) 104 return false; 105 String value = signedPublicKeyAndChallengeString(selectShadow()->selectedIndex(), m_challenge, document()->baseURL()); 106 if (value.isNull()) 107 return false; 108 encoded_values.appendData(name(), value.utf8()); 109 return true; 62 110 } 63 111 … … 68 116 } 69 117 70 void HTMLKeygenElement:: parseMappedAttribute(Attribute* attr)118 void HTMLKeygenElement::reset() 71 119 { 72 if (attr->name() == challengeAttr) 73 m_challenge = attr->value(); 74 else if (attr->name() == keytypeAttr) 75 m_keyType = attr->value(); 76 else { 77 // Skip HTMLSelectElement parsing. 78 HTMLFormControlElement::parseMappedAttribute(attr); 79 } 120 static_cast<HTMLFormControlElement*>(selectShadow())->reset(); 80 121 } 81 122 82 bool HTMLKeygenElement::appendFormData(FormDataList& encoded_values, bool)123 HTMLSelectElement* HTMLKeygenElement::selectShadow() 83 124 { 84 // Only RSA is supported at this time. 85 if (!m_keyType.isNull() && !equalIgnoringCase(m_keyType, "rsa")) 86 return false; 87 String value = signedPublicKeyAndChallengeString(selectedIndex(), m_challenge, document()->baseURL()); 88 if (value.isNull()) 89 return false; 90 encoded_values.appendData(name(), value.utf8()); 91 return true; 125 return static_cast<HTMLSelectElement*>(shadowRoot()); 92 126 } 93 127 -
trunk/Source/WebCore/html/HTMLKeygenElement.h
r76208 r77781 25 25 #define HTMLKeygenElement_h 26 26 27 #include "HTML SelectElement.h"27 #include "HTMLFormControlElement.h" 28 28 29 29 namespace WebCore { 30 30 31 class HTMLKeygenElement : public HTMLSelectElement { 31 class HTMLSelectElement; 32 33 class HTMLKeygenElement : public HTMLFormControlElementWithState { 32 34 public: 33 35 static PassRefPtr<HTMLKeygenElement> create(const QualifiedName&, Document*, HTMLFormElement*); … … 38 40 HTMLKeygenElement(const QualifiedName&, Document*, HTMLFormElement*); 39 41 42 virtual bool canStartSelection() const { return false; } 43 44 virtual void parseMappedAttribute(Attribute*); 45 46 virtual bool appendFormData(FormDataList&, bool); 47 virtual const AtomicString& formControlType() const; 48 virtual bool isOptionalFormControl() const { return false; } 49 50 virtual bool isEnumeratable() const { return true; } 51 40 52 virtual bool isResettable() const { return true; } 53 virtual void reset(); 41 54 42 virtual const AtomicString& formControlType() const; 43 virtual void parseMappedAttribute(Attribute*); 44 virtual bool appendFormData(FormDataList&, bool); 45 virtual bool isOptionalFormControl() const { return false; } 55 HTMLSelectElement* selectShadow(); 46 56 47 57 AtomicString m_challenge; -
trunk/Source/WebCore/html/HTMLOptionElement.cpp
r76826 r77781 195 195 { 196 196 ContainerNode* select = parentNode(); 197 while (select && ! (select->hasTagName(selectTag) || select->hasTagName(keygenTag)))197 while (select && !select->hasTagName(selectTag)) 198 198 select = select->parentNode(); 199 199 -
trunk/Source/WebCore/html/HTMLSelectElement.cpp
r76929 r77781 50 50 : HTMLFormControlElementWithState(tagName, document, form) 51 51 { 52 ASSERT(hasTagName(selectTag) || hasTagName(keygenTag));52 ASSERT(hasTagName(selectTag)); 53 53 } 54 54
Note: See TracChangeset
for help on using the changeset viewer.