OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
4 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
10 * | 10 * |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 int HTMLSelectElement::activeSelectionEndListIndex() const | 196 int HTMLSelectElement::activeSelectionEndListIndex() const |
197 { | 197 { |
198 if (m_activeSelectionEndIndex >= 0) | 198 if (m_activeSelectionEndIndex >= 0) |
199 return m_activeSelectionEndIndex; | 199 return m_activeSelectionEndIndex; |
200 return lastSelectedListIndex(); | 200 return lastSelectedListIndex(); |
201 } | 201 } |
202 | 202 |
203 void HTMLSelectElement::add(HTMLElement* element, HTMLElement* before, Exception
State& exceptionState) | 203 void HTMLSelectElement::add(HTMLElement* element, HTMLElement* before, Exception
State& exceptionState) |
204 { | 204 { |
205 // Make sure the element is ref'd and deref'd so we don't leak it. | 205 // Make sure the element is ref'd and deref'd so we don't leak it. |
206 RefPtr<HTMLElement> protectNewChild(element); | 206 RefPtrWillBeRawPtr<HTMLElement> protectNewChild(element); |
207 | 207 |
208 if (!element || !(isHTMLOptionElement(element) || isHTMLOptGroupElement(elem
ent) || isHTMLHRElement(element))) | 208 if (!element || !(isHTMLOptionElement(element) || isHTMLOptGroupElement(elem
ent) || isHTMLHRElement(element))) |
209 return; | 209 return; |
210 | 210 |
211 insertBefore(element, before, exceptionState); | 211 insertBefore(element, before, exceptionState); |
212 setNeedsValidityCheck(); | 212 setNeedsValidityCheck(); |
213 } | 213 } |
214 | 214 |
215 void HTMLSelectElement::addBeforeOptionAtIndex(HTMLElement* element, int beforeI
ndex, ExceptionState& exceptionState) | 215 void HTMLSelectElement::addBeforeOptionAtIndex(HTMLElement* element, int beforeI
ndex, ExceptionState& exceptionState) |
216 { | 216 { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 Element* HTMLSelectElement::item(unsigned index) | 443 Element* HTMLSelectElement::item(unsigned index) |
444 { | 444 { |
445 return options()->item(index); | 445 return options()->item(index); |
446 } | 446 } |
447 | 447 |
448 void HTMLSelectElement::setOption(unsigned index, HTMLOptionElement* option, Exc
eptionState& exceptionState) | 448 void HTMLSelectElement::setOption(unsigned index, HTMLOptionElement* option, Exc
eptionState& exceptionState) |
449 { | 449 { |
450 if (index > maxSelectItems - 1) | 450 if (index > maxSelectItems - 1) |
451 index = maxSelectItems - 1; | 451 index = maxSelectItems - 1; |
452 int diff = index - length(); | 452 int diff = index - length(); |
453 RefPtr<HTMLElement> before = nullptr; | 453 RefPtrWillBeRawPtr<HTMLElement> before = nullptr; |
454 // Out of array bounds? First insert empty dummies. | 454 // Out of array bounds? First insert empty dummies. |
455 if (diff > 0) { | 455 if (diff > 0) { |
456 setLength(index, exceptionState); | 456 setLength(index, exceptionState); |
457 // Replace an existing entry? | 457 // Replace an existing entry? |
458 } else if (diff < 0) { | 458 } else if (diff < 0) { |
459 before = toHTMLElement(options()->item(index+1)); | 459 before = toHTMLElement(options()->item(index+1)); |
460 remove(index); | 460 remove(index); |
461 } | 461 } |
462 // Finally add the new element. | 462 // Finally add the new element. |
463 if (!exceptionState.hadException()) { | 463 if (!exceptionState.hadException()) { |
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 | 1658 |
1659 void HTMLSelectElement::trace(Visitor* visitor) | 1659 void HTMLSelectElement::trace(Visitor* visitor) |
1660 { | 1660 { |
1661 #if ENABLE(OILPAN) | 1661 #if ENABLE(OILPAN) |
1662 visitor->trace(m_listItems); | 1662 visitor->trace(m_listItems); |
1663 #endif | 1663 #endif |
1664 HTMLFormControlElementWithState::trace(visitor); | 1664 HTMLFormControlElementWithState::trace(visitor); |
1665 } | 1665 } |
1666 | 1666 |
1667 } // namespace | 1667 } // namespace |
OLD | NEW |