OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
4 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
10 * | 10 * |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 ASSERT(option); | 479 ASSERT(option); |
480 add(toHTMLElement(option), 0, exceptionState); | 480 add(toHTMLElement(option), 0, exceptionState); |
481 if (exceptionState.hadException()) | 481 if (exceptionState.hadException()) |
482 break; | 482 break; |
483 } while (++diff); | 483 } while (++diff); |
484 } else { | 484 } else { |
485 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& items = listIt
ems(); | 485 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& items = listIt
ems(); |
486 | 486 |
487 // Removing children fires mutation events, which might mutate the DOM f
urther, so we first copy out a list | 487 // Removing children fires mutation events, which might mutate the DOM f
urther, so we first copy out a list |
488 // of elements that we intend to remove then attempt to remove them one
at a time. | 488 // of elements that we intend to remove then attempt to remove them one
at a time. |
489 Vector<RefPtr<Element> > itemsToRemove; | 489 WillBeHeapVector<RefPtrWillBeMember<Element> > itemsToRemove; |
490 size_t optionIndex = 0; | 490 size_t optionIndex = 0; |
491 for (size_t i = 0; i < items.size(); ++i) { | 491 for (size_t i = 0; i < items.size(); ++i) { |
492 Element* item = items[i]; | 492 Element* item = items[i]; |
493 if (isHTMLOptionElement(items[i]) && optionIndex++ >= newLen) { | 493 if (isHTMLOptionElement(items[i]) && optionIndex++ >= newLen) { |
494 ASSERT(item->parentNode()); | 494 ASSERT(item->parentNode()); |
495 itemsToRemove.append(item); | 495 itemsToRemove.append(item); |
496 } | 496 } |
497 } | 497 } |
498 | 498 |
499 for (size_t i = 0; i < itemsToRemove.size(); ++i) { | 499 for (size_t i = 0; i < itemsToRemove.size(); ++i) { |
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 | 1658 |
1659 void HTMLSelectElement::trace(Visitor* visitor) | 1659 void HTMLSelectElement::trace(Visitor* visitor) |
1660 { | 1660 { |
1661 #if ENABLE(OILPAN) | 1661 #if ENABLE(OILPAN) |
1662 visitor->trace(m_listItems); | 1662 visitor->trace(m_listItems); |
1663 #endif | 1663 #endif |
1664 HTMLFormControlElementWithState::trace(visitor); | 1664 HTMLFormControlElementWithState::trace(visitor); |
1665 } | 1665 } |
1666 | 1666 |
1667 } // namespace | 1667 } // namespace |
OLD | NEW |