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

Side by Side Diff: sky/engine/core/dom/Element.cpp

Issue 868933003: Remove user gesture tracking (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « sky/engine/bindings/core/v8/ScriptController.cpp ('k') | sky/engine/core/frame/DOMTimer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 #include "sky/engine/core/html/HTMLTemplateElement.h" 76 #include "sky/engine/core/html/HTMLTemplateElement.h"
77 #include "sky/engine/core/html/parser/HTMLDocumentParser.h" 77 #include "sky/engine/core/html/parser/HTMLDocumentParser.h"
78 #include "sky/engine/core/html/parser/HTMLParserIdioms.h" 78 #include "sky/engine/core/html/parser/HTMLParserIdioms.h"
79 #include "sky/engine/core/page/Chrome.h" 79 #include "sky/engine/core/page/Chrome.h"
80 #include "sky/engine/core/page/ChromeClient.h" 80 #include "sky/engine/core/page/ChromeClient.h"
81 #include "sky/engine/core/page/FocusController.h" 81 #include "sky/engine/core/page/FocusController.h"
82 #include "sky/engine/core/page/Page.h" 82 #include "sky/engine/core/page/Page.h"
83 #include "sky/engine/core/rendering/RenderLayer.h" 83 #include "sky/engine/core/rendering/RenderLayer.h"
84 #include "sky/engine/core/rendering/RenderView.h" 84 #include "sky/engine/core/rendering/RenderView.h"
85 #include "sky/engine/platform/EventDispatchForbiddenScope.h" 85 #include "sky/engine/platform/EventDispatchForbiddenScope.h"
86 #include "sky/engine/platform/UserGestureIndicator.h"
87 #include "sky/engine/platform/scroll/ScrollableArea.h" 86 #include "sky/engine/platform/scroll/ScrollableArea.h"
88 #include "sky/engine/wtf/BitVector.h" 87 #include "sky/engine/wtf/BitVector.h"
89 #include "sky/engine/wtf/HashFunctions.h" 88 #include "sky/engine/wtf/HashFunctions.h"
90 #include "sky/engine/wtf/text/CString.h" 89 #include "sky/engine/wtf/text/CString.h"
91 #include "sky/engine/wtf/text/StringBuilder.h" 90 #include "sky/engine/wtf/text/StringBuilder.h"
92 #include "sky/engine/wtf/text/TextPosition.h" 91 #include "sky/engine/wtf/text/TextPosition.h"
93 92
94 namespace blink { 93 namespace blink {
95 94
96 PassRefPtr<Element> Element::create(const QualifiedName& tagName, Document* docu ment) 95 PassRefPtr<Element> Element::create(const QualifiedName& tagName, Document* docu ment)
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 RefPtr<Node> protect(this); 1204 RefPtr<Node> protect(this);
1206 if (!document().page()->focusController().setFocusedElement(this, document() .frame(), type)) 1205 if (!document().page()->focusController().setFocusedElement(this, document() .frame(), type))
1207 return; 1206 return;
1208 1207
1209 // Setting the focused node above might have invalidated the layout due to s cripts. 1208 // Setting the focused node above might have invalidated the layout due to s cripts.
1210 document().updateLayout(); 1209 document().updateLayout();
1211 if (!isFocusable()) 1210 if (!isFocusable())
1212 return; 1211 return;
1213 updateFocusAppearance(restorePreviousSelection); 1212 updateFocusAppearance(restorePreviousSelection);
1214 1213
1215 if (UserGestureIndicator::processedUserGestureSinceLoad()) { 1214 // Bring up the keyboard in the context of anything triggered by a user
1216 // Bring up the keyboard in the context of anything triggered by a user 1215 // gesture. Since tracking that across arbitrary boundaries (eg.
1217 // gesture. Since tracking that across arbitrary boundaries (eg. 1216 // animations) is difficult, for now we match IE's heuristic and bring
1218 // animations) is difficult, for now we match IE's heuristic and bring 1217 // up the keyboard if there's been any gesture since load.
eseidel 2015/01/22 23:49:29 This comment is meaningless, no?
abarth-chromium 2015/01/22 23:59:13 Yes! Thanks.
1219 // up the keyboard if there's been any gesture since load. 1218 document().page()->chrome().client().showImeIfNeeded();
1220 document().page()->chrome().client().showImeIfNeeded();
1221 }
1222 } 1219 }
1223 1220
1224 void Element::updateFocusAppearance(bool /*restorePreviousSelection*/) 1221 void Element::updateFocusAppearance(bool /*restorePreviousSelection*/)
1225 { 1222 {
1226 if (isRootEditableElement()) { 1223 if (isRootEditableElement()) {
1227 // Taking the ownership since setSelection() may release the last refere nce to |frame|. 1224 // Taking the ownership since setSelection() may release the last refere nce to |frame|.
1228 RefPtr<LocalFrame> frame(document().frame()); 1225 RefPtr<LocalFrame> frame(document().frame());
1229 if (!frame) 1226 if (!frame)
1230 return; 1227 return;
1231 1228
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1786 return false; 1783 return false;
1787 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) 1784 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue))
1788 return true; 1785 return true;
1789 // Host rules could also have effects. 1786 // Host rules could also have effects.
1790 if (ShadowRoot* shadowRoot = this->shadowRoot()) 1787 if (ShadowRoot* shadowRoot = this->shadowRoot())
1791 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue); 1788 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue);
1792 return false; 1789 return false;
1793 } 1790 }
1794 1791
1795 } // namespace blink 1792 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/bindings/core/v8/ScriptController.cpp ('k') | sky/engine/core/frame/DOMTimer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698