Changeset 68312 in webkit
- Timestamp:
- Sep 24, 2010 4:22:02 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r68311 r68312 1 2010-09-24 Ryosuke Niwa <rniwa@webkit.org> 2 3 Reviewed by Tony Chang. 4 5 [chromium] Implement TextInputController::firstRectForCharacterRange 6 https://bugs.webkit.org/show_bug.cgi?id=38100 7 8 The following test now passes on chromium DumpRenderTree: 9 platform/mac/editing/input/caret-primary-bidi.html 10 platform/mac/editing/input/firstrectforcharacterrange-plain.html 11 platform/mac/editing/input/range-for-empty-document.html 12 editing/inserting/caret-position.html 13 14 * platform/chromium/test_expectations.txt: 15 1 16 2010-09-24 Tony Chang <tony@chromium.org> 2 17 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r68311 r68312 965 965 // Issue 3273: TextInputController::firstRectForCharacterRange not implemented. 966 966 BUG3273 : editing/selection/move-left-right.html = FAIL 967 BUG3273 MAC : platform/mac/editing/input/caret-primary-bidi.html = FAIL 968 BUG3273 MAC : platform/mac/editing/input/firstrectforcharacterrange-plain.html = FAIL 969 BUG3273 MAC : platform/mac/editing/input/range-for-empty-document.html = FAIL 967 BUG3273 MAC : platform/mac/editing/input/caret-primary-bidi.html = FAIL PASS 968 BUG3273 MAC : platform/mac/editing/input/firstrectforcharacterrange-plain.html = FAIL PASS 969 BUG3273 MAC : platform/mac/editing/input/range-for-empty-document.html = FAIL PASS 970 BUGWK38100 : editing/inserting/caret-position.html = TEXT PASS 971 970 972 // WebKit 50358:50395 971 973 BUG3273 : fast/text/international/thai-cursor-position.html = TEXT … … 2456 2458 BUGWK38038 WIN LINUX MAC : fast/url/file-http-base.html = TEXT 2457 2459 2458 // Started failing at r581912459 BUGWK38100 WIN LINUX MAC : editing/inserting/caret-position.html = TEXT2460 2461 2460 // New test, may be safe to just rebaseline. 2462 2461 -
trunk/WebKit/chromium/ChangeLog
r68279 r68312 1 2010-09-24 Ryosuke Niwa <rniwa@webkit.org> 2 3 Reviewed by Tony Chang. 4 5 [chromium] Implement TextInputController::firstRectForCharacterRange 6 https://bugs.webkit.org/show_bug.cgi?id=38100 7 8 Implemented TextInputController::firstRectForCharacterRange for chromium platform. 9 Because the function needs to return an array of integers, added makeIntArray to WebBindings. 10 makeIntArray does not take Vector because WebBindings.h is included in plugin glue code 11 where it cannot find wtf/Vector.h. 12 13 No new tests are added since we need to implement the same feature in chromium side 14 in order to enable any tests that uses this function. 15 16 * public/WebBindings.h: 17 * public/WebFrame.h: 18 * src/WebBindings.cpp: 19 (WebKit::makeIntArrayImpl): Added. 20 (WebKit::WebBindings::makeIntArray): Added. 21 * src/WebFrameImpl.cpp: 22 (WebKit::WebFrameImpl::firstRectForCharacterRange): Added. 23 * src/WebFrameImpl.h: 24 1 25 2010-09-24 Tony Chang <tony@chromium.org> 2 26 -
trunk/WebKit/chromium/public/WebBindings.h
r66176 r68312 33 33 34 34 #include "WebCommon.h" 35 #include "WebVector.h" 35 36 #include <bindings/npruntime.h> 36 37 … … 145 146 WEBKIT_API static bool getElement(NPObject* element, WebElement*); 146 147 148 WEBKIT_API static NPObject* makeIntArray(const WebVector<int>&); 149 147 150 // Exceptions ------------------------------------------------------------- 148 151 -
trunk/WebKit/chromium/public/WebFrame.h
r68216 r68312 356 356 virtual WebRange markedRange() const = 0; 357 357 358 virtual bool firstRectForCharacterRange(unsigned location, unsigned length, WebRect&) const = 0; 359 358 360 // Supports commands like Undo, Redo, Cut, Copy, Paste, SelectAll, 359 361 // Unselect, etc. See EditorCommand.cpp for the full list of supported -
trunk/WebKit/chromium/src/WebBindings.cpp
r66176 r68312 313 313 } 314 314 315 static NPObject* makeIntArrayImpl(const WebVector<int>& data) 316 { 317 v8::HandleScope handleScope; 318 v8::Handle<v8::Array> result = v8::Array::New(data.size()); 319 for (size_t i = 0; i < data.size(); i++) 320 result->Set(i, v8::Number::New(data[i])); 321 322 WebCore::DOMWindow* window = WebCore::V8Proxy::retrieveWindow(WebCore::V8Proxy::currentContext()); 323 return npCreateV8ScriptObject(0, result, window); 324 } 325 315 326 #endif 316 327 … … 351 362 } 352 363 364 NPObject* WebBindings::makeIntArray(const WebVector<int> & data) 365 { 366 #if USE(V8) 367 return makeIntArrayImpl(data); 368 #else 369 // Not supported on other ports (JSC, etc.). 370 return 0; 371 #endif 372 } 373 353 374 void WebBindings::pushExceptionHandler(ExceptionHandler handler, void* data) 354 375 { -
trunk/WebKit/chromium/src/WebFrameImpl.cpp
r68279 r68312 1083 1083 } 1084 1084 1085 bool WebFrameImpl::firstRectForCharacterRange(unsigned location, unsigned length, WebRect& rect) const 1086 { 1087 if ((location + length < location) && (location + length)) 1088 length = 0; 1089 1090 Element* selectionRoot = frame()->selection()->rootEditableElement(); 1091 Element* scope = selectionRoot ? selectionRoot : frame()->document()->documentElement(); 1092 RefPtr<Range> range = TextIterator::rangeFromLocationAndLength(scope, location, length); 1093 if (!range) 1094 return false; 1095 IntRect intRect = frame()->editor()->firstRectForRange(range.get()); 1096 rect = WebRect(intRect.x(), intRect.y(), intRect.width(), intRect.height()); 1097 1098 return true; 1099 } 1100 1085 1101 bool WebFrameImpl::executeCommand(const WebString& name) 1086 1102 { -
trunk/WebKit/chromium/src/WebFrameImpl.h
r68216 r68312 138 138 virtual bool hasMarkedText() const; 139 139 virtual WebRange markedRange() const; 140 virtual bool firstRectForCharacterRange(unsigned location, unsigned length, WebRect&) const; 140 141 virtual bool executeCommand(const WebString&); 141 142 virtual bool executeCommand(const WebString&, const WebString& value); -
trunk/WebKitTools/ChangeLog
r68308 r68312 1 2010-09-24 Ryosuke Niwa <rniwa@webkit.org> 2 3 Reviewed by Tony Chang. 4 5 [chromium] Implement TextInputController::firstRectForCharacterRange 6 https://bugs.webkit.org/show_bug.cgi?id=38100 7 8 Implemented TextInputController::firstRectForCharacterRange for chromium platform. 9 No new tests are added since we need to implement the same feature in chromium side 10 in order to enable any tests that uses this function. 11 12 * DumpRenderTree/chromium/TextInputController.cpp: 13 (TextInputController::firstRectForCharacterRange): Added. 14 1 15 2010-09-24 Adam Barth <abarth@webkit.org> 2 16 -
trunk/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
r67585 r68312 33 33 34 34 #include "TestShell.h" 35 #include "public/WebBindings.h" 35 36 #include "public/WebFrame.h" 36 37 #include "public/WebRange.h" … … 187 188 } 188 189 189 void TextInputController::firstRectForCharacterRange(const CppArgumentList&, CppVariant* result) 190 { 191 // FIXME: Implement this. 192 result->setNull(); 190 void TextInputController::firstRectForCharacterRange(const CppArgumentList& arguments, CppVariant* result) 191 { 192 result->setNull(); 193 194 WebFrame* mainFrame = getMainFrame(); 195 if (!mainFrame) 196 return; 197 198 if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber()) 199 return; 200 201 WebRect rect; 202 if (!mainFrame->firstRectForCharacterRange(arguments[0].toInt32(), arguments[1].toInt32(), rect)) 203 return; 204 205 Vector<int> intArray(4); 206 intArray[0] = rect.x; 207 intArray[1] = rect.y; 208 intArray[2] = rect.width; 209 intArray[3] = rect.height; 210 result->set(WebBindings::makeIntArray(intArray)); 193 211 } 194 212
Note: See TracChangeset
for help on using the changeset viewer.