| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 void HTMLFieldSetElement::trace(Visitor* visitor) | 53 void HTMLFieldSetElement::trace(Visitor* visitor) |
| 54 { | 54 { |
| 55 #if ENABLE(OILPAN) | 55 #if ENABLE(OILPAN) |
| 56 visitor->trace(m_associatedElements); | 56 visitor->trace(m_associatedElements); |
| 57 #endif | 57 #endif |
| 58 HTMLFormControlElement::trace(visitor); | 58 HTMLFormControlElement::trace(visitor); |
| 59 } | 59 } |
| 60 | 60 |
| 61 bool HTMLFieldSetElement::matchesValidityPseudoClasses() const |
| 62 { |
| 63 return true; |
| 64 } |
| 65 |
| 66 bool HTMLFieldSetElement::isValidElement() |
| 67 { |
| 68 const FormAssociatedElement::List& elements = associatedElements(); |
| 69 for (unsigned i = 0; i < elements.size(); ++i) { |
| 70 if (elements[i]->isFormControlElement()) { |
| 71 HTMLFormControlElement* control = toHTMLFormControlElement(elements[
i].get()); |
| 72 if (!control->checkValidity(0, CheckValidityDispatchNoEvent)) |
| 73 return false; |
| 74 } |
| 75 } |
| 76 return true; |
| 77 } |
| 78 |
| 79 void HTMLFieldSetElement::setNeedsValidityCheck() |
| 80 { |
| 81 // For now unconditionally order style recalculation, which triggers |
| 82 // validity recalculation. In the near future, consider implement validity |
| 83 // cache and recalculate style only if it changed. |
| 84 // If setNeedsStyleRecalc ends up being called conditionally here, then |
| 85 // the caller will have to call setNeedsValidityCheck for all ancestor |
| 86 // fieldsets, not only the furthest one. |
| 87 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createW
ithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Invalid)); |
| 88 } |
| 89 |
| 61 void HTMLFieldSetElement::invalidateDisabledStateUnder(Element& base) | 90 void HTMLFieldSetElement::invalidateDisabledStateUnder(Element& base) |
| 62 { | 91 { |
| 63 for (HTMLFormControlElement* element = Traversal<HTMLFormControlElement>::fi
rstWithin(base); element; element = Traversal<HTMLFormControlElement>::next(*ele
ment, &base)) | 92 for (HTMLFormControlElement* element = Traversal<HTMLFormControlElement>::fi
rstWithin(base); element; element = Traversal<HTMLFormControlElement>::next(*ele
ment, &base)) |
| 64 element->ancestorDisabledStateWasChanged(); | 93 element->ancestorDisabledStateWasChanged(); |
| 65 } | 94 } |
| 66 | 95 |
| 67 void HTMLFieldSetElement::disabledAttributeChanged() | 96 void HTMLFieldSetElement::disabledAttributeChanged() |
| 68 { | 97 { |
| 69 // This element must be updated before the style of nodes in its subtree get
s recalculated. | 98 // This element must be updated before the style of nodes in its subtree get
s recalculated. |
| 70 HTMLFormControlElement::disabledAttributeChanged(); | 99 HTMLFormControlElement::disabledAttributeChanged(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 } | 156 } |
| 128 } | 157 } |
| 129 | 158 |
| 130 const FormAssociatedElement::List& HTMLFieldSetElement::associatedElements() con
st | 159 const FormAssociatedElement::List& HTMLFieldSetElement::associatedElements() con
st |
| 131 { | 160 { |
| 132 refreshElementsIfNeeded(); | 161 refreshElementsIfNeeded(); |
| 133 return m_associatedElements; | 162 return m_associatedElements; |
| 134 } | 163 } |
| 135 | 164 |
| 136 } // namespace | 165 } // namespace |
| OLD | NEW |