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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 break; | 461 break; |
462 } while (++diff); | 462 } while (++diff); |
463 } else { | 463 } else { |
464 const Vector<HTMLElement*>& items = listItems(); | 464 const Vector<HTMLElement*>& items = listItems(); |
465 | 465 |
466 // Removing children fires mutation events, which might mutate the DOM f
urther, so we first copy out a list | 466 // Removing children fires mutation events, which might mutate the DOM f
urther, so we first copy out a list |
467 // of elements that we intend to remove then attempt to remove them one
at a time. | 467 // of elements that we intend to remove then attempt to remove them one
at a time. |
468 Vector<RefPtr<Element> > itemsToRemove; | 468 Vector<RefPtr<Element> > itemsToRemove; |
469 size_t optionIndex = 0; | 469 size_t optionIndex = 0; |
470 for (size_t i = 0; i < items.size(); ++i) { | 470 for (size_t i = 0; i < items.size(); ++i) { |
471 NoHandleScope scope; | 471 HandleScope scope; |
472 Element* item = items[i]; | 472 Element* item = items[i]; |
473 if (item->hasLocalName(optionTag) && optionIndex++ >= newLen) { | 473 if (item->hasLocalName(optionTag) && optionIndex++ >= newLen) { |
474 ASSERT(item->parentNode()); | 474 ASSERT(item->parentNode()); |
475 itemsToRemove.append(item); | 475 itemsToRemove.append(item); |
476 } | 476 } |
477 } | 477 } |
478 | 478 |
479 for (size_t i = 0; i < itemsToRemove.size(); ++i) { | 479 for (size_t i = 0; i < itemsToRemove.size(); ++i) { |
480 HandleScope scope; | 480 HandleScope scope; |
481 Element* item = itemsToRemove[i].get(); | 481 Element* item = itemsToRemove[i].get(); |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 | 1565 |
1566 return options; | 1566 return options; |
1567 } | 1567 } |
1568 | 1568 |
1569 void HTMLSelectElement::acceptHeapVisitor(Visitor* visitor) const | 1569 void HTMLSelectElement::acceptHeapVisitor(Visitor* visitor) const |
1570 { | 1570 { |
1571 HTMLFormControlElementWithState::acceptHeapVisitor(visitor); | 1571 HTMLFormControlElementWithState::acceptHeapVisitor(visitor); |
1572 } | 1572 } |
1573 | 1573 |
1574 } // namespace | 1574 } // namespace |
OLD | NEW |