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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/BaseCheckableInputType.cpp

Issue 2045603002: Handle the "key" field as opposed to keyIdentifier field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove initialization of the view Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 void BaseCheckableInputType::appendToFormData(FormData& formData) const 65 void BaseCheckableInputType::appendToFormData(FormData& formData) const
66 { 66 {
67 if (element().checked()) 67 if (element().checked())
68 formData.append(element().name(), element().value()); 68 formData.append(element().name(), element().value());
69 } 69 }
70 70
71 void BaseCheckableInputType::handleKeydownEvent(KeyboardEvent* event) 71 void BaseCheckableInputType::handleKeydownEvent(KeyboardEvent* event)
72 { 72 {
73 const String& key = event->keyIdentifier(); 73 const String& key = event->key();
74 if (key == "U+0020") { 74 if (key == " ") {
75 element().setActive(true); 75 element().setActive(true);
76 // No setDefaultHandled(), because IE dispatches a keypress in this case 76 // No setDefaultHandled(), because IE dispatches a keypress in this case
77 // and the caller will only dispatch a keypress if we don't call setDefa ultHandled(). 77 // and the caller will only dispatch a keypress if we don't call setDefa ultHandled().
78 } 78 }
79 } 79 }
80 80
81 void BaseCheckableInputType::handleKeypressEvent(KeyboardEvent* event) 81 void BaseCheckableInputType::handleKeypressEvent(KeyboardEvent* event)
82 { 82 {
83 if (event->charCode() == ' ') { 83 if (event->charCode() == ' ') {
84 // Prevent scrolling down the page. 84 // Prevent scrolling down the page.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 { 130 {
131 return true; 131 return true;
132 } 132 }
133 133
134 bool BaseCheckableInputType::shouldDispatchFormControlChangeEvent(String& oldVal ue, String& newValue) 134 bool BaseCheckableInputType::shouldDispatchFormControlChangeEvent(String& oldVal ue, String& newValue)
135 { 135 {
136 return oldValue != newValue; 136 return oldValue != newValue;
137 } 137 }
138 138
139 } // namespace blink 139 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/MediaDocument.cpp ('k') | third_party/WebKit/Source/core/html/forms/CheckboxInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698