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

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

Issue 415343003: Option Groups with display: none should not show the children option elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 { 529 {
530 ASSERT(direction == -1 || direction == 1); 530 ASSERT(direction == -1 || direction == 1);
531 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = this-> listItems(); 531 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = this-> listItems();
532 int lastGoodIndex = listIndex; 532 int lastGoodIndex = listIndex;
533 int size = listItems.size(); 533 int size = listItems.size();
534 for (listIndex += direction; listIndex >= 0 && listIndex < size; listIndex + = direction) { 534 for (listIndex += direction; listIndex >= 0 && listIndex < size; listIndex + = direction) {
535 --skip; 535 --skip;
536 HTMLElement* element = listItems[listIndex]; 536 HTMLElement* element = listItems[listIndex];
537 if (!isHTMLOptionElement(*element)) 537 if (!isHTMLOptionElement(*element))
538 continue; 538 continue;
539 if (RenderStyle* style = element->renderStyle() ? element->renderStyle() : element->computedStyle()) {
540 if (style->display() == NONE)
541 continue;
542 }
539 if (element->isDisabledFormControl()) 543 if (element->isDisabledFormControl())
540 continue; 544 continue;
541 if (!usesMenuList() && !element->renderer()) 545 if (!usesMenuList() && !element->renderer())
542 continue; 546 continue;
543 lastGoodIndex = listIndex; 547 lastGoodIndex = listIndex;
544 if (skip <= 0) 548 if (skip <= 0)
545 break; 549 break;
546 } 550 }
547 return lastGoodIndex; 551 return lastGoodIndex;
548 } 552 }
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 int focusedIndex = activeSelectionEndListIndex(); 1739 int focusedIndex = activeSelectionEndListIndex();
1736 if (focusedIndex < 0) 1740 if (focusedIndex < 0)
1737 focusedIndex = firstSelectableListIndex(); 1741 focusedIndex = firstSelectableListIndex();
1738 if (focusedIndex < 0) 1742 if (focusedIndex < 0)
1739 return nullptr; 1743 return nullptr;
1740 HTMLElement* focused = listItems()[focusedIndex]; 1744 HTMLElement* focused = listItems()[focusedIndex];
1741 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr ; 1745 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr ;
1742 } 1746 }
1743 1747
1744 } // namespace 1748 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698