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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSummaryElement.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) 2011 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 { 104 {
105 if (isMainSummary() && layoutObject()) { 105 if (isMainSummary() && layoutObject()) {
106 if (event->type() == EventTypeNames::DOMActivate && !isClickableControl( event->target()->toNode())) { 106 if (event->type() == EventTypeNames::DOMActivate && !isClickableControl( event->target()->toNode())) {
107 if (HTMLDetailsElement* details = detailsElement()) 107 if (HTMLDetailsElement* details = detailsElement())
108 details->toggleOpen(); 108 details->toggleOpen();
109 event->setDefaultHandled(); 109 event->setDefaultHandled();
110 return; 110 return;
111 } 111 }
112 112
113 if (event->isKeyboardEvent()) { 113 if (event->isKeyboardEvent()) {
114 if (event->type() == EventTypeNames::keydown && toKeyboardEvent(even t)->keyIdentifier() == "U+0020") { 114 if (event->type() == EventTypeNames::keydown && toKeyboardEvent(even t)->key() == " ") {
115 setActive(true); 115 setActive(true);
116 // No setDefaultHandled() - IE dispatches a keypress in this cas e. 116 // No setDefaultHandled() - IE dispatches a keypress in this cas e.
117 return; 117 return;
118 } 118 }
119 if (event->type() == EventTypeNames::keypress) { 119 if (event->type() == EventTypeNames::keypress) {
120 switch (toKeyboardEvent(event)->charCode()) { 120 switch (toKeyboardEvent(event)->charCode()) {
121 case '\r': 121 case '\r':
122 dispatchSimulatedClick(event); 122 dispatchSimulatedClick(event);
123 event->setDefaultHandled(); 123 event->setDefaultHandled();
124 return; 124 return;
125 case ' ': 125 case ' ':
126 // Prevent scrolling down the page. 126 // Prevent scrolling down the page.
127 event->setDefaultHandled(); 127 event->setDefaultHandled();
128 return; 128 return;
129 } 129 }
130 } 130 }
131 if (event->type() == EventTypeNames::keyup && toKeyboardEvent(event) ->keyIdentifier() == "U+0020") { 131 if (event->type() == EventTypeNames::keyup && toKeyboardEvent(event) ->key() == " ") {
132 if (active()) 132 if (active())
133 dispatchSimulatedClick(event); 133 dispatchSimulatedClick(event);
134 event->setDefaultHandled(); 134 event->setDefaultHandled();
135 return; 135 return;
136 } 136 }
137 } 137 }
138 } 138 }
139 139
140 HTMLElement::defaultEventHandler(event); 140 HTMLElement::defaultEventHandler(event);
141 } 141 }
142 142
143 bool HTMLSummaryElement::willRespondToMouseClickEvents() 143 bool HTMLSummaryElement::willRespondToMouseClickEvents()
144 { 144 {
145 if (isMainSummary() && layoutObject()) 145 if (isMainSummary() && layoutObject())
146 return true; 146 return true;
147 147
148 return HTMLElement::willRespondToMouseClickEvents(); 148 return HTMLElement::willRespondToMouseClickEvents();
149 } 149 }
150 150
151 } // namespace blink 151 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLSelectElement.cpp ('k') | third_party/WebKit/Source/core/html/MediaDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698