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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLButtonElement.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 event->setDefaultHandled(); 119 event->setDefaultHandled();
120 m_isActivatedSubmit = false; // Do this in case submission was cance led. 120 m_isActivatedSubmit = false; // Do this in case submission was cance led.
121 } 121 }
122 if (form() && m_type == RESET) { 122 if (form() && m_type == RESET) {
123 form()->reset(); 123 form()->reset();
124 event->setDefaultHandled(); 124 event->setDefaultHandled();
125 } 125 }
126 } 126 }
127 127
128 if (event->isKeyboardEvent()) { 128 if (event->isKeyboardEvent()) {
129 if (event->type() == EventTypeNames::keydown && toKeyboardEvent(event)-> keyIdentifier() == "U+0020") { 129 if (event->type() == EventTypeNames::keydown && toKeyboardEvent(event)-> key() == " ") {
130 setActive(true); 130 setActive(true);
131 // No setDefaultHandled() - IE dispatches a keypress in this case. 131 // No setDefaultHandled() - IE dispatches a keypress in this case.
132 return; 132 return;
133 } 133 }
134 if (event->type() == EventTypeNames::keypress) { 134 if (event->type() == EventTypeNames::keypress) {
135 switch (toKeyboardEvent(event)->charCode()) { 135 switch (toKeyboardEvent(event)->charCode()) {
136 case '\r': 136 case '\r':
137 dispatchSimulatedClick(event); 137 dispatchSimulatedClick(event);
138 event->setDefaultHandled(); 138 event->setDefaultHandled();
139 return; 139 return;
140 case ' ': 140 case ' ':
141 // Prevent scrolling down the page. 141 // Prevent scrolling down the page.
142 event->setDefaultHandled(); 142 event->setDefaultHandled();
143 return; 143 return;
144 } 144 }
145 } 145 }
146 if (event->type() == EventTypeNames::keyup && toKeyboardEvent(event)->ke yIdentifier() == "U+0020") { 146 if (event->type() == EventTypeNames::keyup && toKeyboardEvent(event)->ke y() == " ") {
147 if (active()) 147 if (active())
148 dispatchSimulatedClick(event); 148 dispatchSimulatedClick(event);
149 event->setDefaultHandled(); 149 event->setDefaultHandled();
150 return; 150 return;
151 } 151 }
152 } 152 }
153 153
154 HTMLFormControlElement::defaultEventHandler(event); 154 HTMLFormControlElement::defaultEventHandler(event);
155 } 155 }
156 156
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } 222 }
223 223
224 Node::InsertionNotificationRequest HTMLButtonElement::insertedInto(ContainerNode * insertionPoint) 224 Node::InsertionNotificationRequest HTMLButtonElement::insertedInto(ContainerNode * insertionPoint)
225 { 225 {
226 InsertionNotificationRequest request = HTMLFormControlElement::insertedInto( insertionPoint); 226 InsertionNotificationRequest request = HTMLFormControlElement::insertedInto( insertionPoint);
227 logAddElementIfIsolatedWorldAndInDocument("button", typeAttr, formmethodAttr , formactionAttr); 227 logAddElementIfIsolatedWorldAndInDocument("button", typeAttr, formmethodAttr , formactionAttr);
228 return request; 228 return request;
229 } 229 }
230 230
231 } // namespace blink 231 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698