| 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 | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights |
| 7 * reserved. | 7 * reserved. |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2010 Google Inc. All rights reserved. | 9 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 10 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 10 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 #include "core/layout/LayoutMenuList.h" | 67 #include "core/layout/LayoutMenuList.h" |
| 68 #include "core/layout/LayoutTheme.h" | 68 #include "core/layout/LayoutTheme.h" |
| 69 #include "core/page/AutoscrollController.h" | 69 #include "core/page/AutoscrollController.h" |
| 70 #include "core/page/ChromeClient.h" | 70 #include "core/page/ChromeClient.h" |
| 71 #include "core/page/Page.h" | 71 #include "core/page/Page.h" |
| 72 #include "core/page/SpatialNavigation.h" | 72 #include "core/page/SpatialNavigation.h" |
| 73 #include "platform/PopupMenu.h" | 73 #include "platform/PopupMenu.h" |
| 74 #include "platform/instrumentation/tracing/TraceEvent.h" | 74 #include "platform/instrumentation/tracing/TraceEvent.h" |
| 75 #include "platform/text/PlatformLocale.h" | 75 #include "platform/text/PlatformLocale.h" |
| 76 | 76 |
| 77 using namespace WTF::Unicode; | |
| 78 | |
| 79 namespace blink { | 77 namespace blink { |
| 80 | 78 |
| 81 using namespace HTMLNames; | 79 using namespace HTMLNames; |
| 82 | 80 |
| 83 // Upper limit of m_listItems. According to the HTML standard, options larger | 81 // Upper limit of m_listItems. According to the HTML standard, options larger |
| 84 // than this limit doesn't work well because |selectedIndex| IDL attribute is | 82 // than this limit doesn't work well because |selectedIndex| IDL attribute is |
| 85 // signed. | 83 // signed. |
| 86 static const unsigned maxListItems = INT_MAX; | 84 static const unsigned maxListItems = INT_MAX; |
| 87 | 85 |
| 88 HTMLSelectElement::HTMLSelectElement(Document& document) | 86 HTMLSelectElement::HTMLSelectElement(Document& document) |
| (...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 menuListDefaultEventHandler(event); | 1669 menuListDefaultEventHandler(event); |
| 1672 else | 1670 else |
| 1673 listBoxDefaultEventHandler(event); | 1671 listBoxDefaultEventHandler(event); |
| 1674 if (event->defaultHandled()) | 1672 if (event->defaultHandled()) |
| 1675 return; | 1673 return; |
| 1676 | 1674 |
| 1677 if (event->type() == EventTypeNames::keypress && event->isKeyboardEvent()) { | 1675 if (event->type() == EventTypeNames::keypress && event->isKeyboardEvent()) { |
| 1678 KeyboardEvent* keyboardEvent = toKeyboardEvent(event); | 1676 KeyboardEvent* keyboardEvent = toKeyboardEvent(event); |
| 1679 if (!keyboardEvent->ctrlKey() && !keyboardEvent->altKey() && | 1677 if (!keyboardEvent->ctrlKey() && !keyboardEvent->altKey() && |
| 1680 !keyboardEvent->metaKey() && | 1678 !keyboardEvent->metaKey() && |
| 1681 isPrintableChar(keyboardEvent->charCode())) { | 1679 WTF::Unicode::isPrintableChar(keyboardEvent->charCode())) { |
| 1682 typeAheadFind(keyboardEvent); | 1680 typeAheadFind(keyboardEvent); |
| 1683 event->setDefaultHandled(); | 1681 event->setDefaultHandled(); |
| 1684 return; | 1682 return; |
| 1685 } | 1683 } |
| 1686 } | 1684 } |
| 1687 HTMLFormControlElementWithState::defaultEventHandler(event); | 1685 HTMLFormControlElementWithState::defaultEventHandler(event); |
| 1688 } | 1686 } |
| 1689 | 1687 |
| 1690 HTMLOptionElement* HTMLSelectElement::lastSelectedOption() const { | 1688 HTMLOptionElement* HTMLSelectElement::lastSelectedOption() const { |
| 1691 const ListItems& items = listItems(); | 1689 const ListItems& items = listItems(); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 m_popupUpdater = nullptr; | 2039 m_popupUpdater = nullptr; |
| 2042 } | 2040 } |
| 2043 | 2041 |
| 2044 void HTMLSelectElement::didMutateSubtree() { | 2042 void HTMLSelectElement::didMutateSubtree() { |
| 2045 DCHECK(popupIsVisible()); | 2043 DCHECK(popupIsVisible()); |
| 2046 DCHECK(m_popup); | 2044 DCHECK(m_popup); |
| 2047 m_popup->updateFromElement(PopupMenu::ByDOMChange); | 2045 m_popup->updateFromElement(PopupMenu::ByDOMChange); |
| 2048 } | 2046 } |
| 2049 | 2047 |
| 2050 } // namespace blink | 2048 } // namespace blink |
| OLD | NEW |