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 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. |
7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved. | 8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 if (!value.isNull()) | 81 if (!value.isNull()) |
82 element->setValue(value); | 82 element->setValue(value); |
83 if (defaultSelected) | 83 if (defaultSelected) |
84 element->setAttribute(selectedAttr, emptyAtom); | 84 element->setAttribute(selectedAttr, emptyAtom); |
85 element->setSelected(selected); | 85 element->setSelected(selected); |
86 | 86 |
87 return element.release(); | 87 return element.release(); |
88 } | 88 } |
89 | 89 |
90 void HTMLOptionElement::attach() | 90 void HTMLOptionElement::attach(const AttachContext& context) |
91 { | 91 { |
92 HTMLElement::attach(); | 92 HTMLElement::attach(context); |
93 // If after attaching nothing called styleForRenderer() on this node we | 93 // If after attaching nothing called styleForRenderer() on this node we |
94 // manually cache the value. This happens if our parent doesn't have a | 94 // manually cache the value. This happens if our parent doesn't have a |
95 // renderer like <optgroup> or if it doesn't allow children like <select>. | 95 // renderer like <optgroup> or if it doesn't allow children like <select>. |
96 if (!m_style && parentNode()->renderStyle()) | 96 if (!m_style && parentNode()->renderStyle()) |
97 updateNonRenderStyle(); | 97 updateNonRenderStyle(); |
98 } | 98 } |
99 | 99 |
100 void HTMLOptionElement::detach() | 100 void HTMLOptionElement::detach(const AttachContext& context) |
101 { | 101 { |
102 m_style.clear(); | 102 m_style.clear(); |
103 HTMLElement::detach(); | 103 HTMLElement::detach(context); |
104 } | 104 } |
105 | 105 |
106 bool HTMLOptionElement::supportsFocus() const | 106 bool HTMLOptionElement::supportsFocus() const |
107 { | 107 { |
108 return HTMLElement::supportsFocus(); | 108 return HTMLElement::supportsFocus(); |
109 } | 109 } |
110 | 110 |
111 bool HTMLOptionElement::isFocusable() const | 111 bool HTMLOptionElement::isFocusable() const |
112 { | 112 { |
113 // Option elements do not have a renderer so we check the renderStyle instea
d. | 113 // Option elements do not have a renderer so we check the renderStyle instea
d. |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 | 398 |
399 const HTMLOptionElement* toHTMLOptionElement(const Node* node) | 399 const HTMLOptionElement* toHTMLOptionElement(const Node* node) |
400 { | 400 { |
401 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(optionTag)); | 401 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(optionTag)); |
402 return static_cast<const HTMLOptionElement*>(node); | 402 return static_cast<const HTMLOptionElement*>(node); |
403 } | 403 } |
404 | 404 |
405 #endif | 405 #endif |
406 | 406 |
407 } // namespace | 407 } // namespace |
OLD | NEW |