| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 279 } |
| 280 | 280 |
| 281 void HTMLOptionElement::setLabel(const AtomicString& label) | 281 void HTMLOptionElement::setLabel(const AtomicString& label) |
| 282 { | 282 { |
| 283 setAttribute(labelAttr, label); | 283 setAttribute(labelAttr, label); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void HTMLOptionElement::updateNonRenderStyle() | 286 void HTMLOptionElement::updateNonRenderStyle() |
| 287 { | 287 { |
| 288 m_style = originalStyleForRenderer(); | 288 m_style = originalStyleForRenderer(); |
| 289 if (m_style->display() != NONE) { |
| 290 HTMLElement* parent = Traversal<HTMLElement>::firstAncestor(*this); |
| 291 ASSERT(parent); |
| 292 if (parent->hasTagName(optgroupTag)) { |
| 293 RenderStyle* parentStyle = parent->renderStyle() ? parent->renderSty
le() : parent->computedStyle(); |
| 294 if (parentStyle && parentStyle->display() == NONE) |
| 295 m_style->setDisplay(NONE); |
| 296 } |
| 297 } |
| 289 if (HTMLSelectElement* select = ownerSelectElement()) | 298 if (HTMLSelectElement* select = ownerSelectElement()) |
| 290 select->updateListOnRenderer(); | 299 select->updateListOnRenderer(); |
| 291 } | 300 } |
| 292 | 301 |
| 293 RenderStyle* HTMLOptionElement::nonRendererStyle() const | 302 RenderStyle* HTMLOptionElement::nonRendererStyle() const |
| 294 { | 303 { |
| 295 return m_style.get(); | 304 return m_style.get(); |
| 296 } | 305 } |
| 297 | 306 |
| 298 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer() | 307 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer() |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 400 |
| 392 bool HTMLOptionElement::spatialNavigationFocused() const | 401 bool HTMLOptionElement::spatialNavigationFocused() const |
| 393 { | 402 { |
| 394 HTMLSelectElement* select = ownerSelectElement(); | 403 HTMLSelectElement* select = ownerSelectElement(); |
| 395 if (!select || !select->focused()) | 404 if (!select || !select->focused()) |
| 396 return false; | 405 return false; |
| 397 return select->spatialNavigationFocusedOption() == this; | 406 return select->spatialNavigationFocusedOption() == this; |
| 398 } | 407 } |
| 399 | 408 |
| 400 } // namespace blink | 409 } // namespace blink |
| OLD | NEW |