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

Side by Side Diff: Source/core/dom/Element.cpp

Issue 382043002: Devirtualize supportsSpatialNavigationFocus (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 | « Source/core/dom/Element.h ('k') | Source/core/svg/SVGElement.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 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2175 // for the element to be focusable, introduced by spatial navigation feature , 2175 // for the element to be focusable, introduced by spatial navigation feature ,
2176 // i.e. checks if click or keyboard event handler is specified. 2176 // i.e. checks if click or keyboard event handler is specified.
2177 // This is the way to make it possible to navigate to (focus) elements 2177 // This is the way to make it possible to navigate to (focus) elements
2178 // which web designer meant for being active (made them respond to click eve nts). 2178 // which web designer meant for being active (made them respond to click eve nts).
2179 2179
2180 if (!document().settings() || !document().settings()->spatialNavigationEnabl ed()) 2180 if (!document().settings() || !document().settings()->spatialNavigationEnabl ed())
2181 return false; 2181 return false;
2182 return hasEventListeners(EventTypeNames::click) 2182 return hasEventListeners(EventTypeNames::click)
2183 || hasEventListeners(EventTypeNames::keydown) 2183 || hasEventListeners(EventTypeNames::keydown)
2184 || hasEventListeners(EventTypeNames::keypress) 2184 || hasEventListeners(EventTypeNames::keypress)
2185 || hasEventListeners(EventTypeNames::keyup); 2185 || hasEventListeners(EventTypeNames::keyup)
2186 || (isSVGElement() && (hasEventListeners(EventTypeNames::focus)
pdr. 2014/07/10 21:19:23 I don't think the indentation is correct here, or
2187 || hasEventListeners(EventTypeNames::blur)
2188 || hasEventListeners(EventTypeNames::focusin)
2189 || hasEventListeners(EventTypeNames::focusout)));
2190
2186 } 2191 }
2187 2192
2188 bool Element::isFocusable() const 2193 bool Element::isFocusable() const
2189 { 2194 {
2190 return inDocument() && supportsFocus() && !isInert() && rendererIsFocusable( ); 2195 return inDocument() && supportsFocus() && !isInert() && rendererIsFocusable( );
2191 } 2196 }
2192 2197
2193 bool Element::isKeyboardFocusable() const 2198 bool Element::isKeyboardFocusable() const
2194 { 2199 {
2195 return isFocusable() && tabIndex() >= 0; 2200 return isFocusable() && tabIndex() >= 0;
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
3345 3350
3346 void Element::trace(Visitor* visitor) 3351 void Element::trace(Visitor* visitor)
3347 { 3352 {
3348 if (hasRareData()) 3353 if (hasRareData())
3349 visitor->trace(elementRareData()); 3354 visitor->trace(elementRareData());
3350 visitor->trace(m_elementData); 3355 visitor->trace(m_elementData);
3351 ContainerNode::trace(visitor); 3356 ContainerNode::trace(visitor);
3352 } 3357 }
3353 3358
3354 } // namespace WebCore 3359 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/svg/SVGElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698