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

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: Addtional layout test included. Created 6 years, 9 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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 return collectOptionInnerText().stripWhiteSpace(isHTMLSpace<UChar>).simplify WhiteSpace(isHTMLSpace<UChar>); 286 return collectOptionInnerText().stripWhiteSpace(isHTMLSpace<UChar>).simplify WhiteSpace(isHTMLSpace<UChar>);
287 } 287 }
288 288
289 void HTMLOptionElement::setLabel(const AtomicString& label) 289 void HTMLOptionElement::setLabel(const AtomicString& label)
290 { 290 {
291 setAttribute(labelAttr, label); 291 setAttribute(labelAttr, label);
292 } 292 }
293 293
294 void HTMLOptionElement::updateNonRenderStyle() 294 void HTMLOptionElement::updateNonRenderStyle()
295 { 295 {
296 bool oldDisplayNoneStatus = isDisplayNone();
296 m_style = originalStyleForRenderer(); 297 m_style = originalStyleForRenderer();
298 if (oldDisplayNoneStatus != isDisplayNone()) {
299 if (HTMLSelectElement* select = ownerSelectElement())
300 select->updateListOnRenderer();
301 }
297 } 302 }
298 303
299 RenderStyle* HTMLOptionElement::nonRendererStyle() const 304 RenderStyle* HTMLOptionElement::nonRendererStyle() const
300 { 305 {
301 return m_style.get(); 306 return m_style.get();
302 } 307 }
303 308
304 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer() 309 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer()
305 { 310 {
306 updateNonRenderStyle(); 311 updateNonRenderStyle();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 } 373 }
369 374
370 HTMLFormElement* HTMLOptionElement::form() const 375 HTMLFormElement* HTMLOptionElement::form() const
371 { 376 {
372 if (HTMLSelectElement* selectElement = ownerSelectElement()) 377 if (HTMLSelectElement* selectElement = ownerSelectElement())
373 return selectElement->formOwner(); 378 return selectElement->formOwner();
374 379
375 return 0; 380 return 0;
376 } 381 }
377 382
383 bool HTMLOptionElement::isDisplayNone() const
384 {
385 RenderStyle* style = nonRendererStyle();
386 return style && style->display() == NONE;
387 }
388
378 } // namespace WebCore 389 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698