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

Unified Diff: content/renderer/render_view_impl.cc

Issue 442433002: Not allowing user to type more chars than max length value for text field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: few nits resolved Created 6 years, 4 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 | « content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index aeb07c5e1f6aa8c895fcdcebdf0fcaa7fe6cdb36..e8a8e0b3e694b08dc1c87962f3d3320c982cec6d 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -2019,8 +2019,14 @@ void RenderViewImpl::focusPrevious() {
void RenderViewImpl::focusedNodeChanged(const WebNode& node) {
has_scrolled_focused_editable_node_into_rect_ = false;
-
- Send(new ViewHostMsg_FocusedNodeChanged(routing_id_, IsEditableNode(node)));
+ int max_length_;
+ if (IsEditableNode(node)) {
+ const WebElement& element = node.toConst<WebElement>();
+ if (toWebInputElement(&element))
+ max_length_ = toWebInputElement(&element)->maxLength();
+ }
+ Send(new ViewHostMsg_FocusedNodeChanged(
+ routing_id_, IsEditableNode(node), max_length_));
FOR_EACH_OBSERVER(RenderViewObserver, observers_, FocusedNodeChanged(node));
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698