| 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, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 } | 608 } |
| 609 | 609 |
| 610 PassRefPtrWillBeRawPtr<HTMLFormControlsCollection> HTMLFormElement::elements() | 610 PassRefPtrWillBeRawPtr<HTMLFormControlsCollection> HTMLFormElement::elements() |
| 611 { | 611 { |
| 612 return ensureCachedCollection<HTMLFormControlsCollection>(FormControls); | 612 return ensureCachedCollection<HTMLFormControlsCollection>(FormControls); |
| 613 } | 613 } |
| 614 | 614 |
| 615 void HTMLFormElement::collectAssociatedElements(Node& root, FormAssociatedElemen
t::List& elements) const | 615 void HTMLFormElement::collectAssociatedElements(Node& root, FormAssociatedElemen
t::List& elements) const |
| 616 { | 616 { |
| 617 elements.clear(); | 617 elements.clear(); |
| 618 for (HTMLElement& element : Traversal<HTMLElement>::fromNext(root)) { | 618 for (HTMLElement& element : Traversal<HTMLElement>::startsAfter(root)) { |
| 619 FormAssociatedElement* associatedElement = 0; | 619 FormAssociatedElement* associatedElement = 0; |
| 620 if (element.isFormControlElement()) | 620 if (element.isFormControlElement()) |
| 621 associatedElement = toHTMLFormControlElement(&element); | 621 associatedElement = toHTMLFormControlElement(&element); |
| 622 else if (isHTMLObjectElement(element)) | 622 else if (isHTMLObjectElement(element)) |
| 623 associatedElement = toHTMLObjectElement(&element); | 623 associatedElement = toHTMLObjectElement(&element); |
| 624 else | 624 else |
| 625 continue; | 625 continue; |
| 626 if (associatedElement->form()== this) | 626 if (associatedElement->form()== this) |
| 627 elements.append(associatedElement); | 627 elements.append(associatedElement); |
| 628 } | 628 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 642 scope = &treeScope().rootNode(); | 642 scope = &treeScope().rootNode(); |
| 643 ASSERT(scope); | 643 ASSERT(scope); |
| 644 collectAssociatedElements(*scope, mutableThis->m_associatedElements); | 644 collectAssociatedElements(*scope, mutableThis->m_associatedElements); |
| 645 mutableThis->m_associatedElementsAreDirty = false; | 645 mutableThis->m_associatedElementsAreDirty = false; |
| 646 return m_associatedElements; | 646 return m_associatedElements; |
| 647 } | 647 } |
| 648 | 648 |
| 649 void HTMLFormElement::collectImageElements(Node& root, WillBeHeapVector<RawPtrWi
llBeMember<HTMLImageElement> >& elements) | 649 void HTMLFormElement::collectImageElements(Node& root, WillBeHeapVector<RawPtrWi
llBeMember<HTMLImageElement> >& elements) |
| 650 { | 650 { |
| 651 elements.clear(); | 651 elements.clear(); |
| 652 for (HTMLImageElement& image : Traversal<HTMLImageElement>::fromNext(root))
{ | 652 for (HTMLImageElement& image : Traversal<HTMLImageElement>::startsAfter(root
)) { |
| 653 if (image.formOwner() == this) | 653 if (image.formOwner() == this) |
| 654 elements.append(&image); | 654 elements.append(&image); |
| 655 } | 655 } |
| 656 } | 656 } |
| 657 | 657 |
| 658 const WillBeHeapVector<RawPtrWillBeMember<HTMLImageElement> >& HTMLFormElement::
imageElements() | 658 const WillBeHeapVector<RawPtrWillBeMember<HTMLImageElement> >& HTMLFormElement::
imageElements() |
| 659 { | 659 { |
| 660 if (!m_imageElementsAreDirty) | 660 if (!m_imageElementsAreDirty) |
| 661 return m_imageElements; | 661 return m_imageElements; |
| 662 collectImageElements(m_hasElementsAssociatedByParser ? NodeTraversal::highes
tAncestorOrSelf(*this) : *this, m_imageElements); | 662 collectImageElements(m_hasElementsAssociatedByParser ? NodeTraversal::highes
tAncestorOrSelf(*this) : *this, m_imageElements); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 } | 857 } |
| 858 | 858 |
| 859 void HTMLFormElement::setDemoted(bool demoted) | 859 void HTMLFormElement::setDemoted(bool demoted) |
| 860 { | 860 { |
| 861 if (demoted) | 861 if (demoted) |
| 862 UseCounter::count(document(), UseCounter::DemotedFormElement); | 862 UseCounter::count(document(), UseCounter::DemotedFormElement); |
| 863 m_wasDemoted = demoted; | 863 m_wasDemoted = demoted; |
| 864 } | 864 } |
| 865 | 865 |
| 866 } // namespace | 866 } // namespace |
| OLD | NEW |