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

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: Rebase + Layout Testcase 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 m_style = originalStyleForRenderer(); 296 m_style = originalStyleForRenderer();
297 } 297 }
298 298
299 RenderStyle* HTMLOptionElement::nonRendererStyle() const 299 RenderStyle* HTMLOptionElement::nonRendererStyle() const
300 { 300 {
301 return m_style.get(); 301 return m_style.get();
302 } 302 }
303 303
304 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer() 304 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer()
305 { 305 {
306 RefPtr<RenderStyle> oldStyle = m_style;
306 updateNonRenderStyle(); 307 updateNonRenderStyle();
308 if ((m_style->display() == NONE || (!oldStyle || oldStyle->display() == NONE )) && (!oldStyle || (m_style->display() != oldStyle->display()))) {
309 if (HTMLSelectElement* select = ownerSelectElement())
310 select->updateListOnRenderer();
esprehn 2014/03/20 17:09:25 This is not the correct place to do this.
spartha 2014/03/21 05:13:26 Since we don't have a renderer associated with thi
311 }
307 return m_style; 312 return m_style;
308 } 313 }
309 314
310 void HTMLOptionElement::didRecalcStyle(StyleRecalcChange change) 315 void HTMLOptionElement::didRecalcStyle(StyleRecalcChange change)
311 { 316 {
312 if (change == NoChange) 317 if (change == NoChange)
313 return; 318 return;
314 319
315 // FIXME: We ask our owner select to repaint regardless of which property ch anged. 320 // FIXME: We ask our owner select to repaint regardless of which property ch anged.
316 if (HTMLSelectElement* select = ownerSelectElement()) { 321 if (HTMLSelectElement* select = ownerSelectElement()) {
(...skipping 51 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 if (style && style->display() == NONE)
esprehn 2014/03/20 17:09:25 return style && style->display() == NONE;
spartha 2014/03/21 05:13:26 Done.
387 return false;
388 return true;
389 }
390
378 } // namespace WebCore 391 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698