| 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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 document().formController().restoreControlStateIn(*this); | 810 document().formController().restoreControlStateIn(*this); |
| 811 m_didFinishParsingChildren = true; | 811 m_didFinishParsingChildren = true; |
| 812 } | 812 } |
| 813 | 813 |
| 814 void HTMLFormElement::copyNonAttributePropertiesFromElement(const Element& sourc
e) | 814 void HTMLFormElement::copyNonAttributePropertiesFromElement(const Element& sourc
e) |
| 815 { | 815 { |
| 816 m_wasDemoted = static_cast<const HTMLFormElement&>(source).m_wasDemoted; | 816 m_wasDemoted = static_cast<const HTMLFormElement&>(source).m_wasDemoted; |
| 817 HTMLElement::copyNonAttributePropertiesFromElement(source); | 817 HTMLElement::copyNonAttributePropertiesFromElement(source); |
| 818 } | 818 } |
| 819 | 819 |
| 820 void HTMLFormElement::anonymousNamedGetter(const AtomicString& name, bool& retur
nValue0Enabled, RefPtrWillBeRawPtr<RadioNodeList>& returnValue0, bool& returnVal
ue1Enabled, RefPtrWillBeRawPtr<Element>& returnValue1) | 820 void HTMLFormElement::anonymousNamedGetter(const AtomicString& name, RefPtrWillB
eRawPtr<RadioNodeList>& returnValue0, RefPtrWillBeRawPtr<Element>& returnValue1) |
| 821 { | 821 { |
| 822 // Call getNamedElements twice, first time check if it has a value | 822 // Call getNamedElements twice, first time check if it has a value |
| 823 // and let HTMLFormElement update its cache. | 823 // and let HTMLFormElement update its cache. |
| 824 // See issue: 867404 | 824 // See issue: 867404 |
| 825 { | 825 { |
| 826 WillBeHeapVector<RefPtrWillBeMember<Element> > elements; | 826 WillBeHeapVector<RefPtrWillBeMember<Element> > elements; |
| 827 getNamedElements(name, elements); | 827 getNamedElements(name, elements); |
| 828 if (elements.isEmpty()) | 828 if (elements.isEmpty()) |
| 829 return; | 829 return; |
| 830 } | 830 } |
| 831 | 831 |
| 832 // Second call may return different results from the first call, | 832 // Second call may return different results from the first call, |
| 833 // but if the first the size cannot be zero. | 833 // but if the first the size cannot be zero. |
| 834 WillBeHeapVector<RefPtrWillBeMember<Element> > elements; | 834 WillBeHeapVector<RefPtrWillBeMember<Element> > elements; |
| 835 getNamedElements(name, elements); | 835 getNamedElements(name, elements); |
| 836 ASSERT(!elements.isEmpty()); | 836 ASSERT(!elements.isEmpty()); |
| 837 | 837 |
| 838 if (elements.size() == 1) { | 838 if (elements.size() == 1) { |
| 839 returnValue1Enabled = true; | |
| 840 returnValue1 = elements.at(0); | 839 returnValue1 = elements.at(0); |
| 841 return; | 840 return; |
| 842 } | 841 } |
| 843 | 842 |
| 844 bool onlyMatchImg = !elements.isEmpty() && isHTMLImageElement(*elements.firs
t()); | 843 bool onlyMatchImg = !elements.isEmpty() && isHTMLImageElement(*elements.firs
t()); |
| 845 returnValue0Enabled = true; | |
| 846 returnValue0 = radioNodeList(name, onlyMatchImg); | 844 returnValue0 = radioNodeList(name, onlyMatchImg); |
| 847 } | 845 } |
| 848 | 846 |
| 849 void HTMLFormElement::setDemoted(bool demoted) | 847 void HTMLFormElement::setDemoted(bool demoted) |
| 850 { | 848 { |
| 851 if (demoted) | 849 if (demoted) |
| 852 UseCounter::count(document(), UseCounter::DemotedFormElement); | 850 UseCounter::count(document(), UseCounter::DemotedFormElement); |
| 853 m_wasDemoted = demoted; | 851 m_wasDemoted = demoted; |
| 854 } | 852 } |
| 855 | 853 |
| 856 } // namespace | 854 } // namespace |
| OLD | NEW |