Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp

Issue 2687903002: Track constant InputDeviceCapabilities objects per-window. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "core/frame/FrameHost.h" 53 #include "core/frame/FrameHost.h"
54 #include "core/frame/FrameView.h" 54 #include "core/frame/FrameView.h"
55 #include "core/frame/LocalFrame.h" 55 #include "core/frame/LocalFrame.h"
56 #include "core/html/FormData.h" 56 #include "core/html/FormData.h"
57 #include "core/html/HTMLFormElement.h" 57 #include "core/html/HTMLFormElement.h"
58 #include "core/html/HTMLHRElement.h" 58 #include "core/html/HTMLHRElement.h"
59 #include "core/html/HTMLOptGroupElement.h" 59 #include "core/html/HTMLOptGroupElement.h"
60 #include "core/html/HTMLOptionElement.h" 60 #include "core/html/HTMLOptionElement.h"
61 #include "core/html/forms/FormController.h" 61 #include "core/html/forms/FormController.h"
62 #include "core/input/EventHandler.h" 62 #include "core/input/EventHandler.h"
63 #include "core/input/InputDeviceCapabilities.h"
63 #include "core/inspector/ConsoleMessage.h" 64 #include "core/inspector/ConsoleMessage.h"
64 #include "core/layout/HitTestRequest.h" 65 #include "core/layout/HitTestRequest.h"
65 #include "core/layout/HitTestResult.h" 66 #include "core/layout/HitTestResult.h"
66 #include "core/layout/LayoutListBox.h" 67 #include "core/layout/LayoutListBox.h"
67 #include "core/layout/LayoutMenuList.h" 68 #include "core/layout/LayoutMenuList.h"
68 #include "core/layout/LayoutTheme.h" 69 #include "core/layout/LayoutTheme.h"
69 #include "core/page/AutoscrollController.h" 70 #include "core/page/AutoscrollController.h"
70 #include "core/page/ChromeClient.h" 71 #include "core/page/ChromeClient.h"
71 #include "core/page/Page.h" 72 #include "core/page/Page.h"
72 #include "core/page/SpatialNavigation.h" 73 #include "core/page/SpatialNavigation.h"
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 form()->submitImplicitly(event, false); 1346 form()->submitImplicitly(event, false);
1346 dispatchInputAndChangeEventForMenuList(); 1347 dispatchInputAndChangeEventForMenuList();
1347 event->setDefaultHandled(); 1348 event->setDefaultHandled();
1348 } 1349 }
1349 } 1350 }
1350 1351
1351 if (event->type() == EventTypeNames::mousedown && event->isMouseEvent() && 1352 if (event->type() == EventTypeNames::mousedown && event->isMouseEvent() &&
1352 toMouseEvent(event)->button() == 1353 toMouseEvent(event)->button() ==
1353 static_cast<short>(WebPointerProperties::Button::Left)) { 1354 static_cast<short>(WebPointerProperties::Button::Left)) {
1354 InputDeviceCapabilities* sourceCapabilities = 1355 InputDeviceCapabilities* sourceCapabilities =
1355 toMouseEvent(event)->fromTouch() 1356 document().domWindow()->getInputDeviceCapabilities()->firesTouchEvents(
1356 ? InputDeviceCapabilities::firesTouchEventsSourceCapabilities() 1357 toMouseEvent(event)->fromTouch());
1357 : InputDeviceCapabilities::
1358 doesntFireTouchEventsSourceCapabilities();
1359 focus(FocusParams(SelectionBehaviorOnFocus::Restore, WebFocusTypeNone, 1358 focus(FocusParams(SelectionBehaviorOnFocus::Restore, WebFocusTypeNone,
1360 sourceCapabilities)); 1359 sourceCapabilities));
1361 if (layoutObject() && layoutObject()->isMenuList() && 1360 if (layoutObject() && layoutObject()->isMenuList() &&
1362 !isDisabledFormControl()) { 1361 !isDisabledFormControl()) {
1363 if (popupIsVisible()) { 1362 if (popupIsVisible()) {
1364 hidePopup(); 1363 hidePopup();
1365 } else { 1364 } else {
1366 // Save the selection so it can be compared to the new selection 1365 // Save the selection so it can be compared to the new selection
1367 // when we call onChange during selectOption, which gets called 1366 // when we call onChange during selectOption, which gets called
1368 // from selectOptionByPopup, which gets called after the user 1367 // from selectOptionByPopup, which gets called after the user
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
2044 m_popupUpdater = nullptr; 2043 m_popupUpdater = nullptr;
2045 } 2044 }
2046 2045
2047 void HTMLSelectElement::didMutateSubtree() { 2046 void HTMLSelectElement::didMutateSubtree() {
2048 DCHECK(popupIsVisible()); 2047 DCHECK(popupIsVisible());
2049 DCHECK(m_popup); 2048 DCHECK(m_popup);
2050 m_popup->updateFromElement(PopupMenu::ByDOMChange); 2049 m_popup->updateFromElement(PopupMenu::ByDOMChange);
2051 } 2050 }
2052 2051
2053 } // namespace blink 2052 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMWindow.cpp ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698