| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 using namespace std; | 58 using namespace std; |
| 59 using namespace WTF::Unicode; | 59 using namespace WTF::Unicode; |
| 60 | 60 |
| 61 namespace WebCore { | 61 namespace WebCore { |
| 62 | 62 |
| 63 using namespace HTMLNames; | 63 using namespace HTMLNames; |
| 64 | 64 |
| 65 // Upper limit agreed upon with representatives of Opera and Mozilla. | 65 // Upper limit agreed upon with representatives of Opera and Mozilla. |
| 66 static const unsigned maxSelectItems = 10000; | 66 static const unsigned maxSelectItems = 10000; |
| 67 | 67 |
| 68 HTMLSelectElement::HTMLSelectElement(const QualifiedName& tagName, Document* doc
ument, HTMLFormElement* form, bool createdByParser) | 68 HTMLSelectElement::HTMLSelectElement(const QualifiedName& tagName, Document& doc
ument, HTMLFormElement* form, bool createdByParser) |
| 69 : HTMLFormControlElementWithState(tagName, document, form) | 69 : HTMLFormControlElementWithState(tagName, document, form) |
| 70 , m_typeAhead(this) | 70 , m_typeAhead(this) |
| 71 , m_size(0) | 71 , m_size(0) |
| 72 , m_lastOnChangeIndex(-1) | 72 , m_lastOnChangeIndex(-1) |
| 73 , m_activeSelectionAnchorIndex(-1) | 73 , m_activeSelectionAnchorIndex(-1) |
| 74 , m_activeSelectionEndIndex(-1) | 74 , m_activeSelectionEndIndex(-1) |
| 75 , m_isProcessingUserDrivenChange(false) | 75 , m_isProcessingUserDrivenChange(false) |
| 76 , m_multiple(false) | 76 , m_multiple(false) |
| 77 , m_activeSelectionState(false) | 77 , m_activeSelectionState(false) |
| 78 , m_shouldRecalcListItems(false) | 78 , m_shouldRecalcListItems(false) |
| 79 , m_isParsingInProgress(createdByParser) | 79 , m_isParsingInProgress(createdByParser) |
| 80 { | 80 { |
| 81 ASSERT(hasTagName(selectTag)); | 81 ASSERT(hasTagName(selectTag)); |
| 82 ScriptWrappable::init(this); | 82 ScriptWrappable::init(this); |
| 83 } | 83 } |
| 84 | 84 |
| 85 PassRefPtr<HTMLSelectElement> HTMLSelectElement::create(Document* document) | 85 PassRefPtr<HTMLSelectElement> HTMLSelectElement::create(Document& document) |
| 86 { | 86 { |
| 87 return adoptRef(new HTMLSelectElement(selectTag, document, 0, false)); | 87 return adoptRef(new HTMLSelectElement(selectTag, document, 0, false)); |
| 88 } | 88 } |
| 89 | 89 |
| 90 PassRefPtr<HTMLSelectElement> HTMLSelectElement::create(const QualifiedName& tag
Name, Document* document, HTMLFormElement* form, bool createdByParser) | 90 PassRefPtr<HTMLSelectElement> HTMLSelectElement::create(const QualifiedName& tag
Name, Document& document, HTMLFormElement* form, bool createdByParser) |
| 91 { | 91 { |
| 92 ASSERT(tagName.matches(selectTag)); | 92 ASSERT(tagName.matches(selectTag)); |
| 93 return adoptRef(new HTMLSelectElement(tagName, document, form, createdByPars
er)); | 93 return adoptRef(new HTMLSelectElement(tagName, document, form, createdByPars
er)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 const AtomicString& HTMLSelectElement::formControlType() const | 96 const AtomicString& HTMLSelectElement::formControlType() const |
| 97 { | 97 { |
| 98 DEFINE_STATIC_LOCAL(const AtomicString, selectMultiple, ("select-multiple",
AtomicString::ConstructFromLiteral)); | 98 DEFINE_STATIC_LOCAL(const AtomicString, selectMultiple, ("select-multiple",
AtomicString::ConstructFromLiteral)); |
| 99 DEFINE_STATIC_LOCAL(const AtomicString, selectOne, ("select-one", AtomicStri
ng::ConstructFromLiteral)); | 99 DEFINE_STATIC_LOCAL(const AtomicString, selectOne, ("select-one", AtomicStri
ng::ConstructFromLiteral)); |
| 100 return m_multiple ? selectMultiple : selectOne; | 100 return m_multiple ? selectMultiple : selectOne; |
| (...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1573 return true; | 1573 return true; |
| 1574 } | 1574 } |
| 1575 | 1575 |
| 1576 bool HTMLSelectElement::anonymousIndexedSetterRemove(unsigned index, ExceptionSt
ate& es) | 1576 bool HTMLSelectElement::anonymousIndexedSetterRemove(unsigned index, ExceptionSt
ate& es) |
| 1577 { | 1577 { |
| 1578 remove(index); | 1578 remove(index); |
| 1579 return true; | 1579 return true; |
| 1580 } | 1580 } |
| 1581 | 1581 |
| 1582 } // namespace | 1582 } // namespace |
| OLD | NEW |