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

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: Fixed assert failure in linux dbg build 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
« no previous file with comments | « Source/core/html/HTMLOptionElement.h ('k') | Source/core/html/HTMLSelectElement.cpp » ('j') | 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) 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() const
401 {
402 // If m_style is not set, then the node is still unattached.
403 // We have to wait till it gets attached to read the display property.
404 if (!m_style)
405 return false;
406
407 if (m_style->display() != NONE) {
408 Element* parent = parentElement();
409 ASSERT(parent);
410 if (isHTMLOptGroupElement(*parent)) {
411 RenderStyle* parentStyle = parent->renderStyle() ? parent->renderSty le() : parent->computedStyle();
412 return !parentStyle || parentStyle->display() == NONE;
413 }
414 }
415 return m_style->display() == NONE;
416 }
417
400 } // namespace blink 418 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLOptionElement.h ('k') | Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698