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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 document().formController().restoreControlStateIn(*this); | 743 document().formController().restoreControlStateIn(*this); |
744 m_didFinishParsingChildren = true; | 744 m_didFinishParsingChildren = true; |
745 } | 745 } |
746 | 746 |
747 void HTMLFormElement::copyNonAttributePropertiesFromElement(const Element& sourc
e) | 747 void HTMLFormElement::copyNonAttributePropertiesFromElement(const Element& sourc
e) |
748 { | 748 { |
749 m_wasDemoted = static_cast<const HTMLFormElement&>(source).m_wasDemoted; | 749 m_wasDemoted = static_cast<const HTMLFormElement&>(source).m_wasDemoted; |
750 HTMLElement::copyNonAttributePropertiesFromElement(source); | 750 HTMLElement::copyNonAttributePropertiesFromElement(source); |
751 } | 751 } |
752 | 752 |
753 void HTMLFormElement::anonymousNamedGetter(const AtomicString& name, bool& retur
nValue0Enabled, RefPtrWillBeRawPtr<RadioNodeList>& returnValue0, bool& returnVal
ue1Enabled, RefPtr<Element>& returnValue1) | 753 void HTMLFormElement::anonymousNamedGetter(const AtomicString& name, bool& retur
nValue0Enabled, RefPtrWillBeRawPtr<RadioNodeList>& returnValue0, bool& returnVal
ue1Enabled, RefPtrWillBeRawPtr<Element>& returnValue1) |
754 { | 754 { |
755 // Call getNamedElements twice, first time check if it has a value | 755 // Call getNamedElements twice, first time check if it has a value |
756 // and let HTMLFormElement update its cache. | 756 // and let HTMLFormElement update its cache. |
757 // See issue: 867404 | 757 // See issue: 867404 |
758 { | 758 { |
759 WillBeHeapVector<RefPtrWillBeMember<Element> > elements; | 759 WillBeHeapVector<RefPtrWillBeMember<Element> > elements; |
760 getNamedElements(name, elements); | 760 getNamedElements(name, elements); |
761 if (elements.isEmpty()) | 761 if (elements.isEmpty()) |
762 return; | 762 return; |
763 } | 763 } |
764 | 764 |
765 // Second call may return different results from the first call, | 765 // Second call may return different results from the first call, |
766 // but if the first the size cannot be zero. | 766 // but if the first the size cannot be zero. |
767 WillBeHeapVector<RefPtrWillBeMember<Element> > elements; | 767 WillBeHeapVector<RefPtrWillBeMember<Element> > elements; |
768 getNamedElements(name, elements); | 768 getNamedElements(name, elements); |
769 ASSERT(!elements.isEmpty()); | 769 ASSERT(!elements.isEmpty()); |
770 | 770 |
771 if (elements.size() == 1) { | 771 if (elements.size() == 1) { |
772 returnValue1Enabled = true; | 772 returnValue1Enabled = true; |
773 // FIXME: Oilpan: remove the call to |get| when Element becomes [Garbage
Collected]. | 773 returnValue1 = elements.at(0); |
774 returnValue1 = elements.at(0).get(); | |
775 return; | 774 return; |
776 } | 775 } |
777 | 776 |
778 bool onlyMatchImg = !elements.isEmpty() && isHTMLImageElement(*elements.firs
t()); | 777 bool onlyMatchImg = !elements.isEmpty() && isHTMLImageElement(*elements.firs
t()); |
779 returnValue0Enabled = true; | 778 returnValue0Enabled = true; |
780 returnValue0 = radioNodeList(name, onlyMatchImg); | 779 returnValue0 = radioNodeList(name, onlyMatchImg); |
781 } | 780 } |
782 | 781 |
783 void HTMLFormElement::setDemoted(bool demoted) | 782 void HTMLFormElement::setDemoted(bool demoted) |
784 { | 783 { |
785 if (demoted) | 784 if (demoted) |
786 UseCounter::count(document(), UseCounter::DemotedFormElement); | 785 UseCounter::count(document(), UseCounter::DemotedFormElement); |
787 m_wasDemoted = demoted; | 786 m_wasDemoted = demoted; |
788 } | 787 } |
789 | 788 |
790 } // namespace | 789 } // namespace |
OLD | NEW |