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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 : HTMLElement(optionTag, document) | 49 : HTMLElement(optionTag, document) |
50 , m_disabled(false) | 50 , m_disabled(false) |
51 , m_isSelected(false) | 51 , m_isSelected(false) |
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 adoptRefWillBeRefCountedGarbageCollected(new HTMLOptionElement(docume
nt)); | 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(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 RefPtrWillBeRawPtr<HTMLOptionElement> element = adoptRefWillBeRefCountedGarb
ageCollected(new HTMLOptionElement(document)); | 65 RefPtrWillBeRawPtr<HTMLOptionElement> element = adoptRefWillBeNoop(new HTMLO
ptionElement(document)); |
66 element->appendChild(Text::create(document, data.isNull() ? "" : data), exce
ptionState); | 66 element->appendChild(Text::create(document, data.isNull() ? "" : data), exce
ptionState); |
67 if (exceptionState.hadException()) | 67 if (exceptionState.hadException()) |
68 return nullptr; | 68 return nullptr; |
69 | 69 |
70 if (!value.isNull()) | 70 if (!value.isNull()) |
71 element->setValue(value); | 71 element->setValue(value); |
72 if (defaultSelected) | 72 if (defaultSelected) |
73 element->setAttribute(selectedAttr, emptyAtom); | 73 element->setAttribute(selectedAttr, emptyAtom); |
74 element->setSelected(selected); | 74 element->setSelected(selected); |
75 | 75 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 // Check for parent optgroup having display NONE | 372 // Check for parent optgroup having display NONE |
373 if (parent && isHTMLOptGroupElement(*parent)) { | 373 if (parent && isHTMLOptGroupElement(*parent)) { |
374 if (toHTMLOptGroupElement(*parent).isDisplayNone()) | 374 if (toHTMLOptGroupElement(*parent).isDisplayNone()) |
375 return true; | 375 return true; |
376 } | 376 } |
377 RenderStyle* style = nonRendererStyle(); | 377 RenderStyle* style = nonRendererStyle(); |
378 return style && style->display() == NONE; | 378 return style && style->display() == NONE; |
379 } | 379 } |
380 | 380 |
381 } // namespace WebCore | 381 } // namespace WebCore |
OLD | NEW |