| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 { | 52 { |
| 53 setHasCustomStyleCallbacks(); | 53 setHasCustomStyleCallbacks(); |
| 54 ScriptWrappable::init(this); | 54 ScriptWrappable::init(this); |
| 55 } | 55 } |
| 56 | 56 |
| 57 PassRefPtrWillBeRawPtr<HTMLOptionElement> HTMLOptionElement::create(Document& do
cument) | 57 PassRefPtrWillBeRawPtr<HTMLOptionElement> HTMLOptionElement::create(Document& do
cument) |
| 58 { | 58 { |
| 59 return adoptRefWillBeNoop(new HTMLOptionElement(document)); | 59 return adoptRefWillBeNoop(new HTMLOptionElement(document)); |
| 60 } | 60 } |
| 61 | 61 |
| 62 PassRefPtrWillBeRawPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstruc
tor(Document& document, const String& data, const AtomicString& value, | 62 PassRefPtrWillBeRawPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstruc
tor(ExecutionContext* executionContext, const String& data, const AtomicString&
value, |
| 63 bool defaultSelected, bool selected, ExceptionState& exceptionState) | 63 bool defaultSelected, bool selected, ExceptionState& exceptionState) |
| 64 { | 64 { |
| 65 Document& document = *toDocument(executionContext); |
| 65 RefPtrWillBeRawPtr<HTMLOptionElement> element = adoptRefWillBeNoop(new HTMLO
ptionElement(document)); | 66 RefPtrWillBeRawPtr<HTMLOptionElement> element = adoptRefWillBeNoop(new HTMLO
ptionElement(document)); |
| 66 element->appendChild(Text::create(document, data.isNull() ? "" : data), exce
ptionState); | 67 element->appendChild(Text::create(document, data.isNull() ? "" : data), exce
ptionState); |
| 67 if (exceptionState.hadException()) | 68 if (exceptionState.hadException()) |
| 68 return nullptr; | 69 return nullptr; |
| 69 | 70 |
| 70 if (!value.isNull()) | 71 if (!value.isNull()) |
| 71 element->setValue(value); | 72 element->setValue(value); |
| 72 if (defaultSelected) | 73 if (defaultSelected) |
| 73 element->setAttribute(selectedAttr, emptyAtom); | 74 element->setAttribute(selectedAttr, emptyAtom); |
| 74 element->setSelected(selected); | 75 element->setSelected(selected); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 // Check for parent optgroup having display NONE | 373 // Check for parent optgroup having display NONE |
| 373 if (parent && isHTMLOptGroupElement(*parent)) { | 374 if (parent && isHTMLOptGroupElement(*parent)) { |
| 374 if (toHTMLOptGroupElement(*parent).isDisplayNone()) | 375 if (toHTMLOptGroupElement(*parent).isDisplayNone()) |
| 375 return true; | 376 return true; |
| 376 } | 377 } |
| 377 RenderStyle* style = nonRendererStyle(); | 378 RenderStyle* style = nonRendererStyle(); |
| 378 return style && style->display() == NONE; | 379 return style && style->display() == NONE; |
| 379 } | 380 } |
| 380 | 381 |
| 381 } // namespace WebCore | 382 } // namespace WebCore |
| OLD | NEW |