Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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()))) { | |
|
esprehn
2014/03/21 20:43:39
This can be much simpler, just do:
bool wasDispla
spartha
2014/03/21 21:29:03
Done.
| |
| 309 if (HTMLSelectElement* select = ownerSelectElement()) | |
| 310 select->updateListOnRenderer(); | |
| 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 Loading... | |
| 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 |
| OLD | NEW |