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

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

Issue 790673006: Delete focused by mouse code. (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/core/dom/Element.h ('k') | sky/engine/core/dom/Node.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 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 bool Element::isKeyboardFocusable() const 1281 bool Element::isKeyboardFocusable() const
1282 { 1282 {
1283 return isFocusable() && tabIndex() >= 0; 1283 return isFocusable() && tabIndex() >= 0;
1284 } 1284 }
1285 1285
1286 bool Element::isMouseFocusable() const 1286 bool Element::isMouseFocusable() const
1287 { 1287 {
1288 return isFocusable(); 1288 return isFocusable();
1289 } 1289 }
1290 1290
1291 void Element::willCallDefaultEventHandler(const Event& event)
1292 {
1293 // FIXME(sky): wasFocusedByMouse always returns false. Remove this function.
1294 if (!wasFocusedByMouse())
1295 return;
1296 if (!event.isKeyboardEvent() || event.type() != EventTypeNames::keydown)
1297 return;
1298 setWasFocusedByMouse(false);
1299 }
1300
1301 void Element::dispatchFocusEvent(Element* oldFocusedElement, FocusType type) 1291 void Element::dispatchFocusEvent(Element* oldFocusedElement, FocusType type)
1302 { 1292 {
1303 if (type != FocusTypePage)
1304 setWasFocusedByMouse(type == FocusTypeMouse);
1305
1306 RefPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::focus, false, false, document().domWindow(), 0, oldFocusedElement); 1293 RefPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::focus, false, false, document().domWindow(), 0, oldFocusedElement);
1307 EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(even t.release())); 1294 EventDispatcher::dispatchEvent(this, FocusEventDispatchMediator::create(even t.release()));
1308 } 1295 }
1309 1296
1310 void Element::dispatchBlurEvent(Element* newFocusedElement) 1297 void Element::dispatchBlurEvent(Element* newFocusedElement)
1311 { 1298 {
1312 RefPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::blur, false, f alse, document().domWindow(), 0, newFocusedElement); 1299 RefPtr<FocusEvent> event = FocusEvent::create(EventTypeNames::blur, false, f alse, document().domWindow(), 0, newFocusedElement);
1313 EventDispatcher::dispatchEvent(this, BlurEventDispatchMediator::create(event .release())); 1300 EventDispatcher::dispatchEvent(this, BlurEventDispatchMediator::create(event .release()));
1314 } 1301 }
1315 1302
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1860 document().ensureStyleResolver(); 1847 document().ensureStyleResolver();
1861 if (treeScope().scopedStyleResolver().features().hasSelectorForId(idValue)) 1848 if (treeScope().scopedStyleResolver().features().hasSelectorForId(idValue))
1862 return true; 1849 return true;
1863 // Host rules could also have effects. 1850 // Host rules could also have effects.
1864 if (ShadowRoot* shadowRoot = this->shadowRoot()) 1851 if (ShadowRoot* shadowRoot = this->shadowRoot())
1865 return shadowRoot->scopedStyleResolver().features().hasSelectorForId(idV alue); 1852 return shadowRoot->scopedStyleResolver().features().hasSelectorForId(idV alue);
1866 return false; 1853 return false;
1867 } 1854 }
1868 1855
1869 } // namespace blink 1856 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698