Changeset 77917 in webkit
- Timestamp:
- Feb 8, 2011 2:20:51 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r77914 r77917 1 2011-02-08 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Reviewed by Martin Robinson. 4 5 [GTK] DRT's TextInputController is unimplemented on GTK 6 https://bugs.webkit.org/show_bug.cgi?id=52997 7 8 * platform/gtk/Skipped: Unskip several tests that pass now that we 9 have TextInputController. 10 1 11 2011-02-07 Cris Neckar <cdn@chromium.org> 2 12 -
trunk/LayoutTests/platform/gtk/Skipped
r77885 r77917 3773 3773 fast/loader/opaque-base-url.html 3774 3774 3775 # No TextInputController support 3776 # https://bugs.webkit.org/show_bug.cgi?id=52997 3777 fast/forms/input-maxlength-ime-completed.html 3778 fast/forms/input-maxlength-ime-preedit.html 3779 fast/text/international/thai-cursor-position.html 3780 fast/events/ime-composition-events-001.html 3781 fast/dom/tab-in-right-alignment.html 3782 editing/input/ime-composition-clearpreedit.html 3775 # https://bugs.webkit.org/show_bug.cgi?id=53986 3783 3776 svg/text/caret-in-svg-text.xhtml 3784 editing/inserting/insert-composition-whitespace.html3785 3777 3786 3778 # No User Scripts -
trunk/Source/WebKit/gtk/ChangeLog
r77870 r77917 1 2011-02-08 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Reviewed by Martin Robinson. 4 5 [GTK] DRT's TextInputController is unimplemented on GTK 6 https://bugs.webkit.org/show_bug.cgi?id=52997 7 8 * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: 9 (DumpRenderTreeSupportGtk::setComposition): 10 (DumpRenderTreeSupportGtk::confirmComposition): 11 (DumpRenderTreeSupportGtk::firstRectForCharacterRange): 12 (DumpRenderTreeSupportGtk::selectedRange): New methods needed by 13 TextInputController. 14 * WebCoreSupport/DumpRenderTreeSupportGtk.h: 15 1 16 2011-02-07 Enrica Casucci <enrica@apple.com> 2 17 -
trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
r77868 r77917 3 3 * Copyright (C) 2010 Joone Hur <joone@kldp.org> 4 4 * Copyright (C) 2009 Google Inc. All rights reserved. 5 * Copyright (C) 2011 Igalia S.L. 5 6 * 6 7 * This library is free software; you can redistribute it and/or … … 48 49 #include "RenderView.h" 49 50 #include "SecurityOrigin.h" 51 #include "TextIterator.h" 50 52 #include "WorkerThread.h" 51 53 #include "webkitwebframe.h" … … 467 469 } 468 470 471 void DumpRenderTreeSupportGtk::setComposition(WebKitWebView* webView, const char* text, int start, int end) 472 { 473 g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); 474 g_return_if_fail(text); 475 476 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 477 if (!frame) 478 return; 479 480 Editor* editor = frame->editor(); 481 if (!editor) 482 return; 483 if (!editor->canEdit() && !editor->hasComposition()) 484 return; 485 486 String compositionString = String::fromUTF8(text); 487 Vector<CompositionUnderline> underlines; 488 underlines.append(CompositionUnderline(0, compositionString.length(), Color(0, 0, 0), false)); 489 editor->setComposition(compositionString, underlines, start, end); 490 } 491 492 void DumpRenderTreeSupportGtk::confirmComposition(WebKitWebView* webView, const char* text) 493 { 494 g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); 495 496 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 497 if (!frame) 498 return; 499 500 Editor* editor = frame->editor(); 501 if (!editor || (!editor->hasComposition() && !text)) 502 return; 503 504 if (editor->hasComposition()) { 505 if (text) 506 editor->confirmComposition(String::fromUTF8(text)); 507 else 508 editor->confirmComposition(); 509 } else 510 editor->insertText(String::fromUTF8(text), 0); 511 } 512 513 bool DumpRenderTreeSupportGtk::firstRectForCharacterRange(WebKitWebView* webView, int location, int length, GdkRectangle* rect) 514 { 515 g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false); 516 g_return_val_if_fail(rect, false); 517 518 if ((location + length < location) && (location + length)) 519 length = 0; 520 521 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 522 if (!frame) 523 return false; 524 525 Editor* editor = frame->editor(); 526 if (!editor) 527 return false; 528 529 Element* selectionRoot = frame->selection()->rootEditableElement(); 530 Element* scope = selectionRoot ? selectionRoot : frame->document()->documentElement(); 531 RefPtr<Range> range = TextIterator::rangeFromLocationAndLength(scope, location, length); 532 if (!range) 533 return false; 534 535 *rect = editor->firstRectForRange(range.get()); 536 537 return true; 538 } 539 540 bool DumpRenderTreeSupportGtk::selectedRange(WebKitWebView* webView, int* start, int* end) 541 { 542 g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), false); 543 g_return_val_if_fail(start, false); 544 g_return_val_if_fail(end, false); 545 546 Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); 547 if (!frame) 548 return false; 549 550 RefPtr<Range> range = frame->selection()->toNormalizedRange().get(); 551 552 Element* selectionRoot = frame->selection()->rootEditableElement(); 553 Element* scope = selectionRoot ? selectionRoot : frame->document()->documentElement(); 554 555 RefPtr<Range> testRange = Range::create(scope->document(), scope, 0, range->startContainer(), range->startOffset()); 556 ASSERT(testRange->startContainer() == scope); 557 *start = TextIterator::rangeLength(testRange.get()); 558 559 ExceptionCode ec; 560 testRange->setEnd(range->endContainer(), range->endOffset(), ec); 561 ASSERT(testRange->startContainer() == scope); 562 *end = TextIterator::rangeLength(testRange.get()); 563 564 return true; 565 } 566 469 567 void DumpRenderTreeSupportGtk::whiteListAccessFromOrigin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains) 470 568 { -
trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
r77868 r77917 85 85 static bool isCommandEnabled(WebKitWebView*, const gchar* name); 86 86 static bool findString(WebKitWebView*, const gchar*, WebKitFindOptions); 87 static void setComposition(WebKitWebView*, const char* text, int start, int end); 88 static void confirmComposition(WebKitWebView*, const char* text); 89 static bool firstRectForCharacterRange(WebKitWebView*, int location, int length, GdkRectangle*); 90 static bool selectedRange(WebKitWebView*, int* start, int* end); 87 91 88 92 // GC -
trunk/Tools/ChangeLog
r77913 r77917 1 2011-02-08 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Reviewed by Martin Robinson. 4 5 [GTK] DRT's TextInputController is unimplemented on GTK 6 https://bugs.webkit.org/show_bug.cgi?id=52997 7 8 Initial implementation of TextInputController for GTK port. 9 10 * DumpRenderTree/gtk/DumpRenderTree.cpp: 11 (webViewWindowObjectCleared): 12 * DumpRenderTree/gtk/TextInputController.cpp: Added. 13 (setMarkedTextCallback): 14 (insertTextCallback): 15 (unmarkTextCallback): 16 (firstRectForCharacterRangeCallback): 17 (selectedRangeCallback): 18 (getClass): 19 (makeTextInputController): 20 * DumpRenderTree/gtk/TextInputController.h: Added. 21 * GNUmakefile.am: 22 1 23 2011-02-07 Tony Chang <tony@chromium.org> 2 24 -
trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
r77710 r77917 40 40 #include "LayoutTestController.h" 41 41 #include "PixelDumpSupport.h" 42 #include "TextInputController.h" 42 43 #include "WebCoreSupport/DumpRenderTreeSupportGtk.h" 43 44 #include "WorkQueue.h" … … 781 782 JSObjectSetProperty(context, windowObject, eventSenderStr, eventSender, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, 0); 782 783 JSStringRelease(eventSenderStr); 784 785 JSStringRef textInputControllerStr = JSStringCreateWithUTF8CString("textInputController"); 786 JSValueRef textInputController = makeTextInputController(context); 787 JSObjectSetProperty(context, windowObject, textInputControllerStr, textInputController, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, 0); 788 JSStringRelease(textInputControllerStr); 783 789 } 784 790 -
trunk/Tools/GNUmakefile.am
r75911 r77917 81 81 Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp \ 82 82 Tools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp \ 83 Tools/DumpRenderTree/gtk/TextInputController.h \ 84 Tools/DumpRenderTree/gtk/TextInputController.cpp \ 83 85 Tools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp \ 84 86 Source/WebCore/platform/gtk/GtkVersioning.c
Note: See TracChangeset
for help on using the changeset viewer.