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

Unified Diff: Source/core/page/FocusController.cpp

Issue 190953009: Use new is*Element() helper functions in page/ code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/core/page/PageSerializer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/FocusController.cpp
diff --git a/Source/core/page/FocusController.cpp b/Source/core/page/FocusController.cpp
index 9613ff74add7d90552169e637cfb3aad1c36665d..4e3fe5334a4734460b9e0803480ca0cb1983bdff 100644
--- a/Source/core/page/FocusController.cpp
+++ b/Source/core/page/FocusController.cpp
@@ -616,7 +616,7 @@ static void clearSelectionIfNeeded(LocalFrame* oldFocusedFrame, LocalFrame* newF
return;
if (Node* shadowAncestorNode = root->deprecatedShadowAncestorNode()) {
- if (!shadowAncestorNode->hasTagName(inputTag) && !shadowAncestorNode->hasTagName(textareaTag))
+ if (!isHTMLInputElement(*shadowAncestorNode) && !isHTMLTextAreaElement(*shadowAncestorNode))
return;
}
}
@@ -891,9 +891,9 @@ bool FocusController::advanceFocusDirectionally(FocusType type)
if (!hasOffscreenRect(focusedElement)) {
container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type, focusedElement);
startingRect = nodeRectInAbsoluteCoordinates(focusedElement, true /* ignore border */);
- } else if (focusedElement->hasTagName(areaTag)) {
- HTMLAreaElement* area = toHTMLAreaElement(focusedElement);
- container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type, area->imageElement());
+ } else if (isHTMLAreaElement(*focusedElement)) {
+ HTMLAreaElement& area = toHTMLAreaElement(*focusedElement);
+ container = scrollableEnclosingBoxOrParentFrameForNodeInDirection(type, area.imageElement());
startingRect = virtualRectForAreaElementAndDirection(area, type);
}
}
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/core/page/PageSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698