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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 void HTMLFieldSetElement::disabledAttributeChanged() | 60 void HTMLFieldSetElement::disabledAttributeChanged() |
61 { | 61 { |
62 // This element must be updated before the style of nodes in its subtree get
s recalculated. | 62 // This element must be updated before the style of nodes in its subtree get
s recalculated. |
63 HTMLFormControlElement::disabledAttributeChanged(); | 63 HTMLFormControlElement::disabledAttributeChanged(); |
64 invalidateDisabledStateUnder(*this); | 64 invalidateDisabledStateUnder(*this); |
65 } | 65 } |
66 | 66 |
67 void HTMLFieldSetElement::childrenChanged(bool changedByParser, Node* beforeChan
ge, Node* afterChange, int childCountDelta) | 67 void HTMLFieldSetElement::childrenChanged(bool changedByParser, Node* beforeChan
ge, Node* afterChange, int childCountDelta) |
68 { | 68 { |
69 HTMLFormControlElement::childrenChanged(changedByParser, beforeChange, after
Change, childCountDelta); | 69 HTMLFormControlElement::childrenChanged(changedByParser, beforeChange, after
Change, childCountDelta); |
70 for (Element* element = ElementTraversal::firstWithin(*this); element; eleme
nt = ElementTraversal::nextSkippingChildren(*element, this)) { | 70 for (HTMLLegendElement* legend = Traversal<HTMLLegendElement>::firstChild(*t
his); legend; legend = Traversal<HTMLLegendElement>::nextSibling(*legend)) |
71 if (element->hasTagName(legendTag)) | 71 invalidateDisabledStateUnder(*legend); |
72 invalidateDisabledStateUnder(*element); | |
73 } | |
74 } | 72 } |
75 | 73 |
76 bool HTMLFieldSetElement::supportsFocus() const | 74 bool HTMLFieldSetElement::supportsFocus() const |
77 { | 75 { |
78 return HTMLElement::supportsFocus(); | 76 return HTMLElement::supportsFocus(); |
79 } | 77 } |
80 | 78 |
81 const AtomicString& HTMLFieldSetElement::formControlType() const | 79 const AtomicString& HTMLFieldSetElement::formControlType() const |
82 { | 80 { |
83 DEFINE_STATIC_LOCAL(const AtomicString, fieldset, ("fieldset", AtomicString:
:ConstructFromLiteral)); | 81 DEFINE_STATIC_LOCAL(const AtomicString, fieldset, ("fieldset", AtomicString:
:ConstructFromLiteral)); |
84 return fieldset; | 82 return fieldset; |
85 } | 83 } |
86 | 84 |
87 RenderObject* HTMLFieldSetElement::createRenderer(RenderStyle*) | 85 RenderObject* HTMLFieldSetElement::createRenderer(RenderStyle*) |
88 { | 86 { |
89 return new RenderFieldset(this); | 87 return new RenderFieldset(this); |
90 } | 88 } |
91 | 89 |
92 HTMLLegendElement* HTMLFieldSetElement::legend() const | 90 HTMLLegendElement* HTMLFieldSetElement::legend() const |
93 { | 91 { |
94 for (Element* child = ElementTraversal::firstWithin(*this); child; child = E
lementTraversal::nextSkippingChildren(*child, this)) { | 92 return Traversal<HTMLLegendElement>::firstChild(*this); |
95 if (child->hasTagName(legendTag)) | |
96 return toHTMLLegendElement(child); | |
97 } | |
98 return 0; | |
99 } | 93 } |
100 | 94 |
101 PassRefPtr<HTMLCollection> HTMLFieldSetElement::elements() | 95 PassRefPtr<HTMLCollection> HTMLFieldSetElement::elements() |
102 { | 96 { |
103 return ensureCachedHTMLCollection(FormControls); | 97 return ensureCachedHTMLCollection(FormControls); |
104 } | 98 } |
105 | 99 |
106 void HTMLFieldSetElement::refreshElementsIfNeeded() const | 100 void HTMLFieldSetElement::refreshElementsIfNeeded() const |
107 { | 101 { |
108 uint64_t docVersion = document().domTreeVersion(); | 102 uint64_t docVersion = document().domTreeVersion(); |
(...skipping 17 matching lines...) Expand all Loading... |
126 } | 120 } |
127 } | 121 } |
128 | 122 |
129 const Vector<FormAssociatedElement*>& HTMLFieldSetElement::associatedElements()
const | 123 const Vector<FormAssociatedElement*>& HTMLFieldSetElement::associatedElements()
const |
130 { | 124 { |
131 refreshElementsIfNeeded(); | 125 refreshElementsIfNeeded(); |
132 return m_associatedElements; | 126 return m_associatedElements; |
133 } | 127 } |
134 | 128 |
135 } // namespace | 129 } // namespace |
OLD | NEW |