OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |