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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 660343003: Fixed the insertion handle showing issue on readonly element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the review comments. Created 6 years, 2 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 | « content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2502 matching lines...) Expand 10 before | Expand all | Expand 10 after
2513 2513
2514 bool RenderViewImpl::IsEditableNode(const WebNode& node) const { 2514 bool RenderViewImpl::IsEditableNode(const WebNode& node) const {
2515 if (node.isNull()) 2515 if (node.isNull())
2516 return false; 2516 return false;
2517 2517
2518 if (node.isContentEditable()) 2518 if (node.isContentEditable())
2519 return true; 2519 return true;
2520 2520
2521 if (node.isElementNode()) { 2521 if (node.isElementNode()) {
2522 const WebElement& element = node.toConst<WebElement>(); 2522 const WebElement& element = node.toConst<WebElement>();
2523 if (element.isTextFormControlElement()) 2523 if (element.isTextFormControlElement()) {
2524 return true; 2524 if (!(element.hasAttribute("readonly") ||
2525 element.hasAttribute("disabled")))
2526 return true;
2527 }
2525 2528
2526 // Also return true if it has an ARIA role of 'textbox'. 2529 // Also return true if it has an ARIA role of 'textbox'.
2527 for (unsigned i = 0; i < element.attributeCount(); ++i) { 2530 for (unsigned i = 0; i < element.attributeCount(); ++i) {
2528 if (LowerCaseEqualsASCII(element.attributeLocalName(i), "role")) { 2531 if (LowerCaseEqualsASCII(element.attributeLocalName(i), "role")) {
2529 if (LowerCaseEqualsASCII(element.attributeValue(i), "textbox")) 2532 if (LowerCaseEqualsASCII(element.attributeValue(i), "textbox"))
2530 return true; 2533 return true;
2531 break; 2534 break;
2532 } 2535 }
2533 } 2536 }
2534 } 2537 }
(...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after
4190 std::vector<gfx::Size> sizes; 4193 std::vector<gfx::Size> sizes;
4191 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4194 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4192 if (!url.isEmpty()) 4195 if (!url.isEmpty())
4193 urls.push_back( 4196 urls.push_back(
4194 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4197 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4195 } 4198 }
4196 SendUpdateFaviconURL(urls); 4199 SendUpdateFaviconURL(urls);
4197 } 4200 }
4198 4201
4199 } // namespace content 4202 } // namespace content
OLDNEW
« no previous file with comments | « content/public/android/javatests/src/org/chromium/content/browser/ContentViewCoreSelectionTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698