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

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: Adding changes to ExternalPopupMenu 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } 279 }
280 280
281 void HTMLOptionElement::setLabel(const AtomicString& label) 281 void HTMLOptionElement::setLabel(const AtomicString& label)
282 { 282 {
283 setAttribute(labelAttr, label); 283 setAttribute(labelAttr, label);
284 } 284 }
285 285
286 void HTMLOptionElement::updateNonRenderStyle() 286 void HTMLOptionElement::updateNonRenderStyle()
287 { 287 {
288 m_style = originalStyleForRenderer(); 288 m_style = originalStyleForRenderer();
289 if (m_style->display() != NONE) {
290 HTMLElement* parent = Traversal<HTMLElement>::firstAncestor(*this);
291 ASSERT(parent);
292 if (parent->hasTagName(optgroupTag)) {
293 RenderStyle* parentStyle = parent->renderStyle() ? parent->renderSty le() : parent->computedStyle();
294 if (parentStyle && parentStyle->display() == NONE)
295 m_style->setDisplay(NONE);
keishi 2014/08/04 03:04:03 I don't think we should be changing the style of t
spartha 2014/08/04 15:59:02 Done.
296 }
297 }
289 if (HTMLSelectElement* select = ownerSelectElement()) 298 if (HTMLSelectElement* select = ownerSelectElement())
290 select->updateListOnRenderer(); 299 select->updateListOnRenderer();
291 } 300 }
292 301
293 RenderStyle* HTMLOptionElement::nonRendererStyle() const 302 RenderStyle* HTMLOptionElement::nonRendererStyle() const
294 { 303 {
295 return m_style.get(); 304 return m_style.get();
296 } 305 }
297 306
298 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer() 307 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer()
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 400
392 bool HTMLOptionElement::spatialNavigationFocused() const 401 bool HTMLOptionElement::spatialNavigationFocused() const
393 { 402 {
394 HTMLSelectElement* select = ownerSelectElement(); 403 HTMLSelectElement* select = ownerSelectElement();
395 if (!select || !select->focused()) 404 if (!select || !select->focused())
396 return false; 405 return false;
397 return select->spatialNavigationFocusedOption() == this; 406 return select->spatialNavigationFocusedOption() == this;
398 } 407 }
399 408
400 } // namespace blink 409 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/select/popup-with-display-none-optgroup-expected.txt ('k') | Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698