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

Side by Side Diff: Source/core/html/HTMLOptionElement.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved. 8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 390 }
391 391
392 bool HTMLOptionElement::spatialNavigationFocused() const 392 bool HTMLOptionElement::spatialNavigationFocused() const
393 { 393 {
394 HTMLSelectElement* select = ownerSelectElement(); 394 HTMLSelectElement* select = ownerSelectElement();
395 if (!select || !select->focused()) 395 if (!select || !select->focused())
396 return false; 396 return false;
397 return select->spatialNavigationFocusedOption() == this; 397 return select->spatialNavigationFocusedOption() == this;
398 } 398 }
399 399
400 bool HTMLOptionElement::isDisplayNone()
401 {
402 RenderStyle* style = renderStyle() ? renderStyle() : computedStyle();
403 if (style && style->display() != NONE) {
404 HTMLElement* parent = Traversal<HTMLElement>::firstAncestor(*this);
keishi 2014/08/06 03:00:20 I don't think we need to traverse. Options that ar
spartha 2014/08/06 06:23:02 The spec says "In HTML 4, all OPTGROUP elements mu
spartha 2014/08/06 08:13:31 Avoided calling the Traversal On 2014/08/06 03:00:
405 ASSERT(parent);
406 if (isHTMLOptGroupElement(*parent)) {
407 RenderStyle* parentStyle = parent->renderStyle() ? parent->renderSty le() : parent->computedStyle();
408 return !parentStyle || parentStyle->display() == NONE;
409 }
410 }
411 return !style || style->display() == NONE;
412 }
413
400 } // namespace blink 414 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698