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 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 if (!LayoutTheme::theme().popsMenuByReturnKey() && keyCode == '\r') { | 1328 if (!LayoutTheme::theme().popsMenuByReturnKey() && keyCode == '\r') { |
1329 if (form()) | 1329 if (form()) |
1330 form()->submitImplicitly(event, false); | 1330 form()->submitImplicitly(event, false); |
1331 dispatchInputAndChangeEventForMenuList(); | 1331 dispatchInputAndChangeEventForMenuList(); |
1332 event->setDefaultHandled(); | 1332 event->setDefaultHandled(); |
1333 } | 1333 } |
1334 } | 1334 } |
1335 | 1335 |
1336 if (event->type() == EventTypeNames::mousedown && event->isMouseEvent() && t
oMouseEvent(event)->button() == LeftButton) { | 1336 if (event->type() == EventTypeNames::mousedown && event->isMouseEvent() && t
oMouseEvent(event)->button() == LeftButton) { |
1337 InputDeviceCapabilities* sourceCapabilities = toMouseEvent(event)->fromT
ouch() ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities() : InputDe
viceCapabilities::doesntFireTouchEventsSourceCapabilities(); | 1337 InputDeviceCapabilities* sourceCapabilities = toMouseEvent(event)->fromT
ouch() ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities() : InputDe
viceCapabilities::doesntFireTouchEventsSourceCapabilities(); |
1338 focus(true, WebFocusTypeNone, sourceCapabilities); | 1338 focus(FocusParams(SelectionBehaviorOnFocus::Restore, WebFocusTypeNone, s
ourceCapabilities)); |
1339 if (layoutObject() && layoutObject()->isMenuList() && !isDisabledFormCon
trol()) { | 1339 if (layoutObject() && layoutObject()->isMenuList() && !isDisabledFormCon
trol()) { |
1340 if (popupIsVisible()) { | 1340 if (popupIsVisible()) { |
1341 hidePopup(); | 1341 hidePopup(); |
1342 } else { | 1342 } else { |
1343 // Save the selection so it can be compared to the new selection | 1343 // Save the selection so it can be compared to the new selection |
1344 // when we call onChange during selectOption, which gets called | 1344 // when we call onChange during selectOption, which gets called |
1345 // from valueChanged, which gets called after the user makes a | 1345 // from valueChanged, which gets called after the user makes a |
1346 // selection from the menu. | 1346 // selection from the menu. |
1347 saveLastSelection(); | 1347 saveLastSelection(); |
1348 // TODO(lanwei): Will check if we need to add InputDeviceCapabil
ities here | 1348 // TODO(lanwei): Will check if we need to add InputDeviceCapabil
ities here |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1956 m_popupIsVisible = false; | 1956 m_popupIsVisible = false; |
1957 m_popup = nullptr; | 1957 m_popup = nullptr; |
1958 } | 1958 } |
1959 | 1959 |
1960 void HTMLSelectElement::resetTypeAheadSessionForTesting() | 1960 void HTMLSelectElement::resetTypeAheadSessionForTesting() |
1961 { | 1961 { |
1962 m_typeAhead.resetSession(); | 1962 m_typeAhead.resetSession(); |
1963 } | 1963 } |
1964 | 1964 |
1965 } // namespace blink | 1965 } // namespace blink |
OLD | NEW |