OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 using namespace HTMLNames; | 45 using namespace HTMLNames; |
46 | 46 |
47 HTMLKeygenElement::HTMLKeygenElement(Document& document, HTMLFormElement* form) | 47 HTMLKeygenElement::HTMLKeygenElement(Document& document, HTMLFormElement* form) |
48 : HTMLFormControlElementWithState(keygenTag, document, form) | 48 : HTMLFormControlElementWithState(keygenTag, document, form) |
49 { | 49 { |
50 } | 50 } |
51 | 51 |
52 PassRefPtrWillBeRawPtr<HTMLKeygenElement> HTMLKeygenElement::create(Document& do
cument, HTMLFormElement* form) | 52 PassRefPtrWillBeRawPtr<HTMLKeygenElement> HTMLKeygenElement::create(Document& do
cument, HTMLFormElement* form) |
53 { | 53 { |
54 RefPtrWillBeRawPtr<HTMLKeygenElement> keygen = adoptRefWillBeNoop(new HTMLKe
ygenElement(document, form)); | 54 RefPtrWillBeRawPtr<HTMLKeygenElement> keygen = adoptRefWillBeNoop(new HTMLKe
ygenElement(document, form)); |
55 keygen->ensureUserAgentShadowRoot(); | 55 keygen->ensureClosedShadowRoot(); |
56 return keygen.release(); | 56 return keygen.release(); |
57 } | 57 } |
58 | 58 |
59 void HTMLKeygenElement::didAddUserAgentShadowRoot(ShadowRoot& root) | 59 void HTMLKeygenElement::didAddClosedShadowRoot(ShadowRoot& root) |
60 { | 60 { |
61 DEFINE_STATIC_LOCAL(AtomicString, keygenSelectPseudoId, ("-webkit-keygen-sel
ect", AtomicString::ConstructFromLiteral)); | 61 DEFINE_STATIC_LOCAL(AtomicString, keygenSelectPseudoId, ("-webkit-keygen-sel
ect", AtomicString::ConstructFromLiteral)); |
62 | 62 |
63 Vector<String> keys; | 63 Vector<String> keys; |
64 keys.reserveCapacity(2); | 64 keys.reserveCapacity(2); |
65 keys.append(locale().queryString(WebLocalizedString::KeygenMenuHighGradeKeyS
ize)); | 65 keys.append(locale().queryString(WebLocalizedString::KeygenMenuHighGradeKeyS
ize)); |
66 keys.append(locale().queryString(WebLocalizedString::KeygenMenuMediumGradeKe
ySize)); | 66 keys.append(locale().queryString(WebLocalizedString::KeygenMenuMediumGradeKe
ySize)); |
67 | 67 |
68 // Create a select element with one option element for each key size. | 68 // Create a select element with one option element for each key size. |
69 RefPtrWillBeRawPtr<HTMLSelectElement> select = HTMLSelectElement::create(doc
ument()); | 69 RefPtrWillBeRawPtr<HTMLSelectElement> select = HTMLSelectElement::create(doc
ument()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return keygen; | 105 return keygen; |
106 } | 106 } |
107 | 107 |
108 void HTMLKeygenElement::resetImpl() | 108 void HTMLKeygenElement::resetImpl() |
109 { | 109 { |
110 shadowSelect()->reset(); | 110 shadowSelect()->reset(); |
111 } | 111 } |
112 | 112 |
113 HTMLSelectElement* HTMLKeygenElement::shadowSelect() const | 113 HTMLSelectElement* HTMLKeygenElement::shadowSelect() const |
114 { | 114 { |
115 ShadowRoot* root = userAgentShadowRoot(); | 115 ShadowRoot* root = closedShadowRoot(); |
116 return root ? toHTMLSelectElement(root->firstChild()) : 0; | 116 return root ? toHTMLSelectElement(root->firstChild()) : 0; |
117 } | 117 } |
118 | 118 |
119 bool HTMLKeygenElement::isInteractiveContent() const | 119 bool HTMLKeygenElement::isInteractiveContent() const |
120 { | 120 { |
121 return true; | 121 return true; |
122 } | 122 } |
123 | 123 |
124 bool HTMLKeygenElement::supportsAutofocus() const | 124 bool HTMLKeygenElement::supportsAutofocus() const |
125 { | 125 { |
126 return true; | 126 return true; |
127 } | 127 } |
128 | 128 |
129 } // namespace | 129 } // namespace |
OLD | NEW |