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