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

Side by Side Diff: Source/web/WebFrameImpl.cpp

Issue 19096009: Use isHTMLTextAreaElement and toHTMLTextAreaElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 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/testing/Internals.cpp ('k') | Source/web/WebSearchableFormData.cpp » ('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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 #include "core/editing/htmlediting.h" 126 #include "core/editing/htmlediting.h"
127 #include "core/editing/markup.h" 127 #include "core/editing/markup.h"
128 #include "core/history/BackForwardController.h" 128 #include "core/history/BackForwardController.h"
129 #include "core/history/HistoryItem.h" 129 #include "core/history/HistoryItem.h"
130 #include "core/html/HTMLCollection.h" 130 #include "core/html/HTMLCollection.h"
131 #include "core/html/HTMLFormElement.h" 131 #include "core/html/HTMLFormElement.h"
132 #include "core/html/HTMLFrameOwnerElement.h" 132 #include "core/html/HTMLFrameOwnerElement.h"
133 #include "core/html/HTMLHeadElement.h" 133 #include "core/html/HTMLHeadElement.h"
134 #include "core/html/HTMLInputElement.h" 134 #include "core/html/HTMLInputElement.h"
135 #include "core/html/HTMLLinkElement.h" 135 #include "core/html/HTMLLinkElement.h"
136 #include "core/html/HTMLTextAreaElement.h"
136 #include "core/html/PluginDocument.h" 137 #include "core/html/PluginDocument.h"
137 #include "core/inspector/InspectorController.h" 138 #include "core/inspector/InspectorController.h"
138 #include "core/inspector/ScriptCallStack.h" 139 #include "core/inspector/ScriptCallStack.h"
139 #include "core/loader/DocumentLoader.h" 140 #include "core/loader/DocumentLoader.h"
140 #include "core/loader/FormState.h" 141 #include "core/loader/FormState.h"
141 #include "core/loader/FrameLoadRequest.h" 142 #include "core/loader/FrameLoadRequest.h"
142 #include "core/loader/FrameLoader.h" 143 #include "core/loader/FrameLoader.h"
143 #include "core/loader/IconController.h" 144 #include "core/loader/IconController.h"
144 #include "core/loader/SubstituteData.h" 145 #include "core/loader/SubstituteData.h"
145 #include "core/page/Chrome.h" 146 #include "core/page/Chrome.h"
(...skipping 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2285 // don't focus anything. 2286 // don't focus anything.
2286 VisibleSelection selection(frame()->selection()->selection()); 2287 VisibleSelection selection(frame()->selection()->selection());
2287 if (!selection.isNone()) 2288 if (!selection.isNone())
2288 return; 2289 return;
2289 2290
2290 // Try to find the first focusable node up the chain, which will, for 2291 // Try to find the first focusable node up the chain, which will, for
2291 // example, focus links if we have found text within the link. 2292 // example, focus links if we have found text within the link.
2292 Node* node = m_activeMatch->firstNode(); 2293 Node* node = m_activeMatch->firstNode();
2293 if (node && node->isInShadowTree()) { 2294 if (node && node->isInShadowTree()) {
2294 Node* host = node->deprecatedShadowAncestorNode(); 2295 Node* host = node->deprecatedShadowAncestorNode();
2295 if (host->hasTagName(HTMLNames::inputTag) || host->hasTagName(HTMLNa mes::textareaTag)) 2296 if (host->hasTagName(HTMLNames::inputTag) || isHTMLTextAreaElement(h ost))
2296 node = host; 2297 node = host;
2297 } 2298 }
2298 for (; node; node = node->parentNode()) { 2299 for (; node; node = node->parentNode()) {
2299 if (node->isElementNode() && node->isFocusable()) { 2300 if (node->isElementNode() && node->isFocusable()) {
2300 // Found a focusable parent node. Set the active match as the 2301 // Found a focusable parent node. Set the active match as the
2301 // selection and focus to the focusable node. 2302 // selection and focus to the focusable node.
2302 frame()->selection()->setSelection(m_activeMatch.get()); 2303 frame()->selection()->setSelection(m_activeMatch.get());
2303 frame()->document()->setFocusedElement(toElement(node)); 2304 frame()->document()->setFocusedElement(toElement(node));
2304 return; 2305 return;
2305 } 2306 }
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2502 2503
2503 // There is a possibility that the frame being detached was the only 2504 // There is a possibility that the frame being detached was the only
2504 // pending one. We need to make sure final replies can be sent. 2505 // pending one. We need to make sure final replies can be sent.
2505 flushCurrentScopingEffort(m_findRequestIdentifier); 2506 flushCurrentScopingEffort(m_findRequestIdentifier);
2506 2507
2507 cancelPendingScopingEffort(); 2508 cancelPendingScopingEffort();
2508 } 2509 }
2509 } 2510 }
2510 2511
2511 } // namespace WebKit 2512 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | Source/web/WebSearchableFormData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698