Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp

Issue 2002063003: Change "bool createdByParser" of createElement() to enum (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cestate
Patch Set: Add ImportNode Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 // We should check |newLen > maxListItems| first to avoid integer overflow. 496 // We should check |newLen > maxListItems| first to avoid integer overflow.
497 if (newLen > maxListItems || listItems().size() + newLen - length() > maxLis tItems) { 497 if (newLen > maxListItems || listItems().size() + newLen - length() > maxLis tItems) {
498 document().addConsoleMessage(ConsoleMessage::create(JSMessageSource, War ningMessageLevel, 498 document().addConsoleMessage(ConsoleMessage::create(JSMessageSource, War ningMessageLevel,
499 String::format("Blocked to expand the option list to %u items. The maximum list length is %u.", newLen, maxListItems))); 499 String::format("Blocked to expand the option list to %u items. The maximum list length is %u.", newLen, maxListItems)));
500 return; 500 return;
501 } 501 }
502 int diff = length() - newLen; 502 int diff = length() - newLen;
503 503
504 if (diff < 0) { // Add dummy elements. 504 if (diff < 0) { // Add dummy elements.
505 do { 505 do {
506 appendChild(document().createElement(optionTag, false), exceptionSta te); 506 appendChild(document().createElement(optionTag, CreatedByCreateEleme nt), exceptionState);
507 if (exceptionState.hadException()) 507 if (exceptionState.hadException())
508 break; 508 break;
509 } while (++diff); 509 } while (++diff);
510 } else { 510 } else {
511 // Removing children fires mutation events, which might mutate the DOM 511 // Removing children fires mutation events, which might mutate the DOM
512 // further, so we first copy out a list of elements that we intend to 512 // further, so we first copy out a list of elements that we intend to
513 // remove then attempt to remove them one at a time. 513 // remove then attempt to remove them one at a time.
514 HeapVector<Member<Element>> itemsToRemove; 514 HeapVector<Member<Element>> itemsToRemove;
515 size_t optionIndex = 0; 515 size_t optionIndex = 0;
516 for (auto& item : listItems()) { 516 for (auto& item : listItems()) {
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after
2063 } 2063 }
2064 2064
2065 void HTMLSelectElement::didMutateSubtree() 2065 void HTMLSelectElement::didMutateSubtree()
2066 { 2066 {
2067 DCHECK(popupIsVisible()); 2067 DCHECK(popupIsVisible());
2068 DCHECK(m_popup); 2068 DCHECK(m_popup);
2069 m_popup->updateFromElement(PopupMenu::ByDOMChange); 2069 m_popup->updateFromElement(PopupMenu::ByDOMChange);
2070 } 2070 }
2071 2071
2072 } // namespace blink 2072 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698