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 15 matching lines...) Expand all Loading... |
26 #include "core/html/HTMLKeygenElement.h" | 26 #include "core/html/HTMLKeygenElement.h" |
27 | 27 |
28 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 28 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
29 #include "core/HTMLNames.h" | 29 #include "core/HTMLNames.h" |
30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
31 #include "core/dom/Text.h" | 31 #include "core/dom/Text.h" |
32 #include "core/dom/shadow/ShadowRoot.h" | 32 #include "core/dom/shadow/ShadowRoot.h" |
33 #include "core/html/FormDataList.h" | 33 #include "core/html/FormDataList.h" |
34 #include "core/html/HTMLOptionElement.h" | 34 #include "core/html/HTMLOptionElement.h" |
35 #include "core/html/HTMLSelectElement.h" | 35 #include "core/html/HTMLSelectElement.h" |
| 36 #include "core/layout/LayoutBlockFlow.h" |
36 #include "platform/text/PlatformLocale.h" | 37 #include "platform/text/PlatformLocale.h" |
37 #include "public/platform/Platform.h" | 38 #include "public/platform/Platform.h" |
38 #include "public/platform/WebLocalizedString.h" | 39 #include "public/platform/WebLocalizedString.h" |
39 #include "wtf/StdLibExtras.h" | 40 #include "wtf/StdLibExtras.h" |
40 | 41 |
41 using namespace blink; | 42 using namespace blink; |
42 | 43 |
43 namespace blink { | 44 namespace blink { |
44 | 45 |
45 using namespace HTMLNames; | 46 using namespace HTMLNames; |
46 | 47 |
47 HTMLKeygenElement::HTMLKeygenElement(Document& document, HTMLFormElement* form) | 48 HTMLKeygenElement::HTMLKeygenElement(Document& document, HTMLFormElement* form) |
48 : HTMLFormControlElementWithState(keygenTag, document, form) | 49 : HTMLFormControlElementWithState(keygenTag, document, form) |
49 { | 50 { |
50 } | 51 } |
51 | 52 |
52 PassRefPtrWillBeRawPtr<HTMLKeygenElement> HTMLKeygenElement::create(Document& do
cument, HTMLFormElement* form) | 53 PassRefPtrWillBeRawPtr<HTMLKeygenElement> HTMLKeygenElement::create(Document& do
cument, HTMLFormElement* form) |
53 { | 54 { |
54 RefPtrWillBeRawPtr<HTMLKeygenElement> keygen = adoptRefWillBeNoop(new HTMLKe
ygenElement(document, form)); | 55 RefPtrWillBeRawPtr<HTMLKeygenElement> keygen = adoptRefWillBeNoop(new HTMLKe
ygenElement(document, form)); |
55 keygen->ensureClosedShadowRoot(); | 56 keygen->ensureClosedShadowRoot(); |
56 return keygen.release(); | 57 return keygen.release(); |
57 } | 58 } |
58 | 59 |
| 60 LayoutObject* HTMLKeygenElement::createLayoutObject(const LayoutStyle& style) |
| 61 { |
| 62 // TODO(mstensho): While it's harmful and meaningless to allow most display
types on replaced |
| 63 // content (e.g. table, table-row or flex), it would be useful to honor at l
east some of |
| 64 // them. Table-cell (and maybe table-caption too), for instance. See crbug.c
om/335040 |
| 65 return new LayoutBlockFlow(this); |
| 66 } |
| 67 |
59 void HTMLKeygenElement::didAddClosedShadowRoot(ShadowRoot& root) | 68 void HTMLKeygenElement::didAddClosedShadowRoot(ShadowRoot& root) |
60 { | 69 { |
61 DEFINE_STATIC_LOCAL(AtomicString, keygenSelectPseudoId, ("-webkit-keygen-sel
ect", AtomicString::ConstructFromLiteral)); | 70 DEFINE_STATIC_LOCAL(AtomicString, keygenSelectPseudoId, ("-webkit-keygen-sel
ect", AtomicString::ConstructFromLiteral)); |
62 | 71 |
63 Vector<String> keys; | 72 Vector<String> keys; |
64 keys.reserveCapacity(2); | 73 keys.reserveCapacity(2); |
65 keys.append(locale().queryString(WebLocalizedString::KeygenMenuHighGradeKeyS
ize)); | 74 keys.append(locale().queryString(WebLocalizedString::KeygenMenuHighGradeKeyS
ize)); |
66 keys.append(locale().queryString(WebLocalizedString::KeygenMenuMediumGradeKe
ySize)); | 75 keys.append(locale().queryString(WebLocalizedString::KeygenMenuMediumGradeKe
ySize)); |
67 | 76 |
68 // Create a select element with one option element for each key size. | 77 // Create a select element with one option element for each key size. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 { | 129 { |
121 return true; | 130 return true; |
122 } | 131 } |
123 | 132 |
124 bool HTMLKeygenElement::supportsAutofocus() const | 133 bool HTMLKeygenElement::supportsAutofocus() const |
125 { | 134 { |
126 return true; | 135 return true; |
127 } | 136 } |
128 | 137 |
129 } // namespace | 138 } // namespace |
OLD | NEW |