Changeset 87770 in webkit
- Timestamp:
- May 31, 2011 7:25:47 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87762 r87770 1 2011-05-31 Hironori Bono <hbono@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Send an input event when we change the text direction. 6 https://bugs.webkit.org/show_bug.cgi?id=50952 7 8 This adds a new layout test to verify that we can receive input events 9 when we change the text direction of a <textarea> element and an <input> 10 element. 11 12 * fast/html/set-text-direction-expected.txt: Added. 13 * fast/html/set-text-direction.html: Added. 14 * platform/gtk/Skipped: 15 * platform/mac-leopard/Skipped: 16 * platform/mac-tiger/Skipped: 17 * platform/qt/Skipped: 18 * platform/win/Skipped: 19 1 20 2011-05-27 Adrienne Walker <enne@google.com> 2 21 -
trunk/LayoutTests/platform/gtk/Skipped
r87696 r87770 1410 1410 editing/spelling/grammar.html 1411 1411 1412 # layoutTestController::setTextDirection() is not implemented. 1413 fast/html/set-text-direction.html 1414 1412 1415 # https://bugs.webkit.org/show_bug.cgi?id=57160 1413 1416 # [GTK] layoutTestController.overridePreference("WebKitDefaultFontSize"...) does not take into account screen DPI -
trunk/LayoutTests/platform/mac-leopard/Skipped
r87326 r87770 95 95 # Available 10.6 or later 96 96 editing/spelling/spellcheck-paste.html 97 fast/html/set-text-direction.html 97 98 98 99 # Disable tests which started failing after r66961 -
trunk/LayoutTests/platform/qt/Skipped
r87691 r87770 2519 2519 fast/events/selectstart-by-drag.html 2520 2520 2521 # LayoutTestController::setTextDirection is not implemented. 2522 fast/html/set-text-direction.html 2523 2521 2524 # JSC does not support setIsolatedWorldSecurityOrigin (http://webkit.org/b/61540) 2522 2525 http/tests/security/isolatedWorld/cross-origin-xhr.html -
trunk/LayoutTests/platform/win/Skipped
r87691 r87770 991 991 editing/spelling/spellcheck-paste.html 992 992 993 # layoutTestController::setTextDirection() is not implemented 994 fast/html/set-text-direction.html 995 993 996 # IndexedDB is not yet enabled. 994 997 storage/indexeddb -
trunk/Source/WebCore/ChangeLog
r87768 r87770 1 2011-05-31 Hironori Bono <hbono@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Send an input event when we change the text direction. 6 https://bugs.webkit.org/show_bug.cgi?id=50952 7 8 Both Safari and Chrome call Editor::setBaseWritingDirection() to change 9 the text direction of an editable element with their UIs. This change 10 calls dispatchInputEvent() to send an input event when the function 11 actually changes the "dir" attribute so we can send an input event as 12 written in the HTML5 spec. 13 14 Test: fast/html/set-text-direction.html 15 16 * editing/Editor.cpp: 17 (WebCore::Editor::setBaseWritingDirection): 18 1 19 2011-05-31 Jer Noble <jer.noble@apple.com> 2 20 -
trunk/Source/WebCore/editing/Editor.cpp
r87483 r87770 1448 1448 return; 1449 1449 toHTMLElement(focusedNode)->setAttribute(dirAttr, direction == LeftToRightWritingDirection ? "ltr" : "rtl"); 1450 focusedNode->dispatchInputEvent(); 1450 1451 frame()->document()->updateStyleIfNeeded(); 1451 1452 return; -
trunk/Tools/ChangeLog
r87763 r87770 1 2011-05-31 Hironori Bono <hbono@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 Add a JavaScript function layoutTestController.setTextDirection(). 6 https://bugs.webkit.org/show_bug.cgi?id=50952 7 8 This change adds a new JavaScript function setTextDirection() to the 9 LayoutTestController class of Safari and Chrome to write layout tests 10 that changes the text direction of an editable element. 11 12 * DumpRenderTree/LayoutTestController.cpp: 13 (setTextDirectionCallback): 14 (LayoutTestController::staticFunctions): 15 * DumpRenderTree/LayoutTestController.h: 16 * DumpRenderTree/chromium/LayoutTestController.cpp: 17 (LayoutTestController::LayoutTestController): 18 (LayoutTestController::setTextDirection): 19 * DumpRenderTree/chromium/LayoutTestController.h: 20 * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: 21 (LayoutTestController::setTextDirection): 22 * DumpRenderTree/mac/LayoutTestControllerMac.mm: 23 (LayoutTestController::setTextDirection): 24 * DumpRenderTree/win/LayoutTestControllerWin.cpp: 25 (LayoutTestController::setTextDirection): 26 1 27 2011-05-31 Ademar de Souza Reis Jr <ademar.reis@openbossa.org> 2 28 -
trunk/Tools/DumpRenderTree/LayoutTestController.cpp
r86644 r87770 2210 2210 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 2211 2211 controller->setMinimumTimerInterval(minimum); 2212 2213 return JSValueMakeUndefined(context); 2214 } 2215 2216 static JSValueRef setTextDirectionCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 2217 { 2218 if (argumentCount == 1) { 2219 JSRetainPtr<JSStringRef> direction(Adopt, JSValueToStringCopy(context, arguments[0], exception)); 2220 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 2221 controller->setTextDirection(direction.get()); 2222 } 2212 2223 2213 2224 return JSValueMakeUndefined(context); … … 2423 2434 { "originsWithLocalStorage", originsWithLocalStorageCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2424 2435 { "setShouldPaintBrokenImage", setShouldPaintBrokenImageCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2436 { "setTextDirection", setTextDirectionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2425 2437 { "shadowPseudoId", shadowPseudoIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2426 2438 { 0, 0, 0 } -
trunk/Tools/DumpRenderTree/LayoutTestController.h
r87469 r87770 346 346 void setMinimumTimerInterval(double); 347 347 348 void setTextDirection(JSStringRef); 349 348 350 private: 349 351 LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash); -
trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
r87597 r87770 191 191 bindMethod("waitUntilDone", &LayoutTestController::waitUntilDone); 192 192 bindMethod("windowCount", &LayoutTestController::windowCount); 193 bindMethod("setTextDirection", &LayoutTestController::setTextDirection); 193 194 194 195 // The following are stubs. … … 1854 1855 } 1855 1856 } 1857 1858 void LayoutTestController::setTextDirection(const CppArgumentList& arguments, CppVariant* result) 1859 { 1860 result->setNull(); 1861 if (arguments.size() != 1 || !arguments[0].isString()) 1862 return; 1863 1864 // Map a direction name to a WebTextDirection value. 1865 std::string directionName = arguments[0].toString(); 1866 WebKit::WebTextDirection direction; 1867 if (directionName == "auto") 1868 direction = WebKit::WebTextDirectionDefault; 1869 else if (directionName == "rtl") 1870 direction = WebKit::WebTextDirectionRightToLeft; 1871 else if (directionName == "ltr") 1872 direction = WebKit::WebTextDirectionLeftToRight; 1873 else 1874 return; 1875 1876 m_shell->webView()->setTextDirection(direction); 1877 } -
trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h
r87597 r87770 379 379 void resetPageVisibility(const CppArgumentList&, CppVariant*); 380 380 381 // Changes the direction of the focused element. 382 void setTextDirection(const CppArgumentList&, CppVariant*); 383 381 384 public: 382 385 // The following methods are not exposed to JavaScript. -
trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
r86644 r87770 1001 1001 DumpRenderTreeSupportGtk::setMinimumTimerInterval(webView, minimumTimerInterval); 1002 1002 } 1003 1004 void LayoutTestController::setTextDirection(JSStringRef direction) 1005 { 1006 // FIXME: Implement. 1007 } -
trunk/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm
r86644 r87770 1154 1154 [[mainFrame webView] _setMinimumTimerInterval:minimumTimerInterval]; 1155 1155 } 1156 1157 void LayoutTestController::setTextDirection(JSStringRef directionName) 1158 { 1159 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) 1160 if (JSStringIsEqualToUTF8CString(directionName, "ltr")) 1161 [[mainFrame webView] makeBaseWritingDirectionLeftToRight:0]; 1162 else if (JSStringIsEqualToUTF8CString(directionName, "rtl")) 1163 [[mainFrame webView] makeBaseWritingDirectionRightToLeft:0]; 1164 else 1165 ASSERT_NOT_REACHED(); 1166 #endif 1167 } -
trunk/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp
r86644 r87770 1578 1578 } 1579 1579 1580 1580 void LayoutTestController::setTextDirection(JSStringRef direction) 1581 { 1582 // FIXME: Implement. 1583 }
Note: See TracChangeset
for help on using the changeset viewer.