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

Side by Side Diff: Source/WebCore/html/HTMLSelectElement.cpp

Issue 11881046: Merge 139038 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 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
« no previous file with comments | « LayoutTests/fast/forms/select/select-empty-optgroup-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 currentElement = ElementTraversal::nextSkippingChildren(currentEleme nt, this); 740 currentElement = ElementTraversal::nextSkippingChildren(currentEleme nt, this);
741 continue; 741 continue;
742 } 742 }
743 HTMLElement* current = toHTMLElement(currentElement); 743 HTMLElement* current = toHTMLElement(currentElement);
744 744
745 // optgroup tags may not nest. However, both FireFox and IE will 745 // optgroup tags may not nest. However, both FireFox and IE will
746 // flatten the tree automatically, so we follow suit. 746 // flatten the tree automatically, so we follow suit.
747 // (http://www.w3.org/TR/html401/interact/forms.html#h-17.6) 747 // (http://www.w3.org/TR/html401/interact/forms.html#h-17.6)
748 if (current->hasTagName(optgroupTag)) { 748 if (current->hasTagName(optgroupTag)) {
749 m_listItems.append(current); 749 m_listItems.append(current);
750 if (current->firstChild()) { 750 if (Element* nextElement = ElementTraversal::firstWithin(current)) {
751 currentElement = ElementTraversal::firstWithin(current); 751 currentElement = nextElement;
752 continue; 752 continue;
753 } 753 }
754 } 754 }
755 755
756 if (current->hasTagName(optionTag)) { 756 if (current->hasTagName(optionTag)) {
757 m_listItems.append(current); 757 m_listItems.append(current);
758 758
759 if (updateSelectedStates && !m_multiple) { 759 if (updateSelectedStates && !m_multiple) {
760 HTMLOptionElement* option = toHTMLOptionElement(current); 760 HTMLOptionElement* option = toHTMLOptionElement(current);
761 if (!firstOption) 761 if (!firstOption)
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 const Vector<HTMLElement*>& items = listItems(); 1545 const Vector<HTMLElement*>& items = listItems();
1546 for (unsigned i = 0; i < items.size(); ++i) { 1546 for (unsigned i = 0; i < items.size(); ++i) {
1547 if (items[i]->hasTagName(optionTag)) 1547 if (items[i]->hasTagName(optionTag))
1548 ++options; 1548 ++options;
1549 } 1549 }
1550 1550
1551 return options; 1551 return options;
1552 } 1552 }
1553 1553
1554 } // namespace 1554 } // namespace
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/select/select-empty-optgroup-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698