| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 PassRefPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstructor(Document
& document, const String& data, const AtomicString& value, | 62 PassRefPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstructor(Document
& document, const String& data, const AtomicString& value, |
| 63 bool defaultSelected, bool selected, ExceptionState& exceptionState) | 63 bool defaultSelected, bool selected, ExceptionState& exceptionState) |
| 64 { | 64 { |
| 65 RefPtr<HTMLOptionElement> element = adoptRef(new HTMLOptionElement(document)
); | 65 RefPtr<HTMLOptionElement> element = adoptRef(new HTMLOptionElement(document)
); |
| 66 | 66 |
| 67 RefPtr<Text> text = Text::create(document, data.isNull() ? "" : data); | 67 RefPtr<Text> text = Text::create(document, data.isNull() ? "" : data); |
| 68 | 68 |
| 69 element->appendChild(text.release(), exceptionState); | 69 element->appendChild(text.release(), exceptionState); |
| 70 if (exceptionState.hadException()) | 70 if (exceptionState.hadException()) |
| 71 return 0; | 71 return nullptr; |
| 72 | 72 |
| 73 if (!value.isNull()) | 73 if (!value.isNull()) |
| 74 element->setValue(value); | 74 element->setValue(value); |
| 75 if (defaultSelected) | 75 if (defaultSelected) |
| 76 element->setAttribute(selectedAttr, emptyAtom); | 76 element->setAttribute(selectedAttr, emptyAtom); |
| 77 element->setSelected(selected); | 77 element->setSelected(selected); |
| 78 | 78 |
| 79 return element.release(); | 79 return element.release(); |
| 80 } | 80 } |
| 81 | 81 |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 | 369 |
| 370 HTMLFormElement* HTMLOptionElement::form() const | 370 HTMLFormElement* HTMLOptionElement::form() const |
| 371 { | 371 { |
| 372 if (HTMLSelectElement* selectElement = ownerSelectElement()) | 372 if (HTMLSelectElement* selectElement = ownerSelectElement()) |
| 373 return selectElement->formOwner(); | 373 return selectElement->formOwner(); |
| 374 | 374 |
| 375 return 0; | 375 return 0; |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace WebCore | 378 } // namespace WebCore |
| OLD | NEW |