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

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

Issue 189543012: Update <select> when any of its <option> children has "display: none" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 /*
keishi 2014/04/11 15:07:09 We need to do the same changes to HTMLOptGroupElem
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
11 * modify it under the terms of the GNU Library General Public 11 * modify it under the terms of the GNU Library General Public
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 return collectOptionInnerText().stripWhiteSpace(isHTMLSpace<UChar>).simplify WhiteSpace(isHTMLSpace<UChar>); 275 return collectOptionInnerText().stripWhiteSpace(isHTMLSpace<UChar>).simplify WhiteSpace(isHTMLSpace<UChar>);
276 } 276 }
277 277
278 void HTMLOptionElement::setLabel(const AtomicString& label) 278 void HTMLOptionElement::setLabel(const AtomicString& label)
279 { 279 {
280 setAttribute(labelAttr, label); 280 setAttribute(labelAttr, label);
281 } 281 }
282 282
283 void HTMLOptionElement::updateNonRenderStyle() 283 void HTMLOptionElement::updateNonRenderStyle()
284 { 284 {
285 bool oldDisplayNoneStatus = isDisplayNone();
285 m_style = originalStyleForRenderer(); 286 m_style = originalStyleForRenderer();
287 if (oldDisplayNoneStatus != isDisplayNone()) {
288 if (HTMLSelectElement* select = ownerSelectElement())
289 select->updateListOnRenderer();
290 }
286 } 291 }
287 292
288 RenderStyle* HTMLOptionElement::nonRendererStyle() const 293 RenderStyle* HTMLOptionElement::nonRendererStyle() const
289 { 294 {
290 return m_style.get(); 295 return m_style.get();
291 } 296 }
292 297
293 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer() 298 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer()
294 { 299 {
295 updateNonRenderStyle(); 300 updateNonRenderStyle();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 } 362 }
358 363
359 HTMLFormElement* HTMLOptionElement::form() const 364 HTMLFormElement* HTMLOptionElement::form() const
360 { 365 {
361 if (HTMLSelectElement* selectElement = ownerSelectElement()) 366 if (HTMLSelectElement* selectElement = ownerSelectElement())
362 return selectElement->formOwner(); 367 return selectElement->formOwner();
363 368
364 return 0; 369 return 0;
365 } 370 }
366 371
372 bool HTMLOptionElement::isDisplayNone() const
373 {
374 RenderStyle* style = nonRendererStyle();
375 return style && style->display() == NONE;
keishi 2014/04/11 15:07:09 We should check parent optgroup.isDisplayNone
spartha 2014/04/12 18:53:22 Done.
376 }
377
367 } // namespace WebCore 378 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698