|
Lines 313-333
void EditorClient::toggleGrammarChecking
WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp_sec1
|
| 313 |
void EditorClient::handleKeyboardEvent(KeyboardEvent* event) |
313 |
void EditorClient::handleKeyboardEvent(KeyboardEvent* event) |
| 314 |
{ |
314 |
{ |
| 315 |
Frame* frame = core(m_webView)->focusController()->focusedOrMainFrame(); |
315 |
Frame* frame = core(m_webView)->focusController()->focusedOrMainFrame(); |
| 316 |
if (!frame || !frame->document()->focusedNode()) |
316 |
//if (!frame || !frame->document()->focusedNode()) |
|
|
317 |
// return; |
| 318 |
if (!frame) |
| 317 |
return; |
319 |
return; |
| 318 |
|
320 |
|
| 319 |
const PlatformKeyboardEvent* kevent = event->keyEvent(); |
321 |
const PlatformKeyboardEvent* kevent = event->keyEvent(); |
| 320 |
if (!kevent || kevent->type() == PlatformKeyboardEvent::KeyUp) |
322 |
if (!kevent || kevent->type() == PlatformKeyboardEvent::KeyUp) |
| 321 |
return; |
323 |
return; |
| 322 |
|
324 |
|
| 323 |
Node* start = frame->selection()->start().node(); |
325 |
//Node* start = frame->selection()->start().node(); |
| 324 |
if (!start) |
326 |
//if (!start) |
| 325 |
return; |
327 |
// return; |
| 326 |
|
328 |
|
| 327 |
// FIXME: Use GtkBindingSet instead of this hard-coded switch |
329 |
// FIXME: Use GtkBindingSet instead of this hard-coded switch |
| 328 |
// http://bugs.webkit.org/show_bug.cgi?id=15911 |
330 |
// http://bugs.webkit.org/show_bug.cgi?id=15911 |
| 329 |
|
331 |
|
| 330 |
if (start->isContentEditable()) { |
332 |
//if (true || start->isContentEditable()) { |
|
|
333 |
if (true) { |
| 331 |
switch (kevent->windowsVirtualKeyCode()) { |
334 |
switch (kevent->windowsVirtualKeyCode()) { |
| 332 |
case VK_BACK: |
335 |
case VK_BACK: |
| 333 |
frame->editor()->deleteWithDirection(SelectionController::BACKWARD, |
336 |
frame->editor()->deleteWithDirection(SelectionController::BACKWARD, |