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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 return; | 783 return; |
784 if (!m_pastNamesMap) | 784 if (!m_pastNamesMap) |
785 m_pastNamesMap = adoptPtrWillBeNoop(new PastNamesMap); | 785 m_pastNamesMap = adoptPtrWillBeNoop(new PastNamesMap); |
786 m_pastNamesMap->set(pastName, element); | 786 m_pastNamesMap->set(pastName, element); |
787 } | 787 } |
788 | 788 |
789 void HTMLFormElement::removeFromPastNamesMap(HTMLElement& element) | 789 void HTMLFormElement::removeFromPastNamesMap(HTMLElement& element) |
790 { | 790 { |
791 if (!m_pastNamesMap) | 791 if (!m_pastNamesMap) |
792 return; | 792 return; |
793 PastNamesMap::iterator end = m_pastNamesMap->end(); | 793 for (auto& it : *m_pastNamesMap) { |
794 for (PastNamesMap::iterator it = m_pastNamesMap->begin(); it != end; ++it) { | 794 if (it.value == &element) { |
795 if (it->value == &element) { | 795 it.value = nullptr; |
796 it->value = nullptr; | |
797 // Keep looping. Single element can have multiple names. | 796 // Keep looping. Single element can have multiple names. |
798 } | 797 } |
799 } | 798 } |
800 } | 799 } |
801 | 800 |
802 void HTMLFormElement::getNamedElements(const AtomicString& name, WillBeHeapVecto
r<RefPtrWillBeMember<Element> >& namedItems) | 801 void HTMLFormElement::getNamedElements(const AtomicString& name, WillBeHeapVecto
r<RefPtrWillBeMember<Element> >& namedItems) |
803 { | 802 { |
804 // http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#do
m-form-nameditem | 803 // http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#do
m-form-nameditem |
805 elements()->namedItems(name, namedItems); | 804 elements()->namedItems(name, namedItems); |
806 | 805 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 } | 858 } |
860 | 859 |
861 void HTMLFormElement::setDemoted(bool demoted) | 860 void HTMLFormElement::setDemoted(bool demoted) |
862 { | 861 { |
863 if (demoted) | 862 if (demoted) |
864 UseCounter::count(document(), UseCounter::DemotedFormElement); | 863 UseCounter::count(document(), UseCounter::DemotedFormElement); |
865 m_wasDemoted = demoted; | 864 m_wasDemoted = demoted; |
866 } | 865 } |
867 | 866 |
868 } // namespace | 867 } // namespace |
OLD | NEW |