Changeset 50233 in webkit
- Timestamp:
- Oct 28, 2009 1:14:13 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r50226 r50233 1 2009-10-27 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Provide a way to get counter values with layoutTestContoller 6 https://bugs.webkit.org/show_bug.cgi?id=30555 7 8 Convert two pixel tests to dumpAsText tests using counterValueForElementById. 9 10 * fast/css/counters/t1204-increment-00-c-o-expected.txt: Added. 11 * fast/css/counters/t1204-increment-00-c-o.html: 12 * fast/css/counters/t1204-increment-01-c-o-expected.txt: Added. 13 * fast/css/counters/t1204-increment-01-c-o.html: 14 * platform/mac/fast/css/counters/t1204-increment-00-c-o-expected.checksum: Removed. 15 * platform/mac/fast/css/counters/t1204-increment-00-c-o-expected.png: Removed. 16 * platform/mac/fast/css/counters/t1204-increment-00-c-o-expected.txt: Removed. 17 * platform/mac/fast/css/counters/t1204-increment-01-c-o-expected.checksum: Removed. 18 * platform/mac/fast/css/counters/t1204-increment-01-c-o-expected.png: Removed. 19 * platform/mac/fast/css/counters/t1204-increment-01-c-o-expected.txt: Removed. 20 * platform/qt/fast/css/counters/t1204-increment-00-c-o-expected.txt: Removed. 21 * platform/qt/fast/css/counters/t1204-increment-01-c-o-expected.txt: Removed. 22 1 23 2009-10-28 Alexey Proskuryakov <ap@apple.com> 2 24 -
trunk/LayoutTests/fast/css/counters/t1204-increment-00-c-o.html
r49225 r50233 10 10 11 11 </style> 12 <script src="../../js/resources/js-test-pre.js"></script> 12 13 <script type="text/javascript"> 13 14 14 if (window.layoutTestController) 15 if (window.layoutTestController) { 15 16 layoutTestController.waitUntilDone(); 17 layoutTestController.dumpAsText(); 18 } 16 19 17 function run() { 20 function checkCounterValuesBeforeChange() 21 { 22 debug('Before the dynamic change:'); 23 shouldBe("layoutTestController.counterValueForElementById('one')", "'1'"); 24 shouldBe("layoutTestController.counterValueForElementById('three')", "'2'"); 25 shouldBe("layoutTestController.counterValueForElementById('four')", "'3'"); 26 } 27 28 function checkCounterValuesAfterChange() 29 { 30 debug('After the dynamic change:'); 31 shouldBe("layoutTestController.counterValueForElementById('one')", "'1'"); 32 shouldBe("layoutTestController.counterValueForElementById('two')", "'2'"); 33 shouldBe("layoutTestController.counterValueForElementById('three')", "'3'"); 34 shouldBe("layoutTestController.counterValueForElementById('four')", "'4'"); 35 36 debug(''); 37 debug('TEST COMPLETE'); 38 // Eliminate confusing messages (counter values won't be dumped by dumpAsText). 39 var viewElement = document.getElementById("view"); 40 viewElement.parentNode.removeChild(viewElement); 41 layoutTestController.notifyDone(); 42 } 43 44 function run() 45 { 46 if (window.layoutTestController) 47 checkCounterValuesBeforeChange(); 48 18 49 var t = document.getElementById("test"); 19 50 var s = document.createElement("span"); 20 51 s.setAttribute("class", "increment"); 52 s.setAttribute("id", "two"); 21 53 s.appendChild(document.createTextNode("new-")); 22 54 t.insertBefore(s, t.childNodes.item(1)); 23 55 24 56 if (window.layoutTestController) 25 layoutTestController.notifyDone();57 checkCounterValuesAfterChange(); 26 58 } 27 28 // We cannot use dumpAsText() because the counters are CSS properties and29 // they aren't dumped by the function. Let's use render tree...30 59 </script> 31 60 </head> 32 61 33 <!-- This test checks if the counters work properly when some elements are 34 added/removed *after* the first rendering finishes. If we put the script in 35 <body>, this only checks the results of first rendering and this isn't 36 the purpose of this test. That's why we use timeout for this test. --> 37 <body onload="setTimeout('run()', 0)"> 62 <body onload="run();"> 38 63 64 <p>This is the WebKit version of <a href="http://www.w3.org/Style/CSS/Test/CSS2.1/20061011/html4/t1204-increment-00-c-o.htm">CSS 2.1 Test Suite: dynamic changes to 'counter-increment'</a>.</p> 65 66 <div id="view"> 39 67 <p>The following two lines should be the same:</p> 68 <div id="test"><span id="one" class="increment"></span><span id="three" class="increment"></span><span id="four" class="increment"></span></div> 69 <div id="reference">1-2-new-3-4-</div> 70 </div> 40 71 41 <div id="test"><span class="increment"></span><span class="increment"></span><span class="increment"></span></div> 42 43 <div id="reference">1-2-new-3-4-</div> 72 <div id="console"></div> 44 73 45 74 </body> -
trunk/LayoutTests/fast/css/counters/t1204-increment-01-c-o.html
r49225 r50233 10 10 11 11 </style> 12 <script src="../../js/resources/js-test-pre.js"></script> 12 13 <script type="text/javascript"> 13 14 14 if (window.layoutTestController) 15 if (window.layoutTestController) { 15 16 layoutTestController.waitUntilDone(); 17 layoutTestController.dumpAsText(); 18 } 16 19 17 function run() { 20 function checkCounterValuesBeforeChange() 21 { 22 debug('Before the dynamic change:'); 23 shouldBe("layoutTestController.counterValueForElementById('one')", "'1'"); 24 shouldBe("layoutTestController.counterValueForElementById('two')", "'3'"); 25 shouldBe("layoutTestController.counterValueForElementById('three')", "'4'"); 26 } 27 28 function checkCounterValuesAfterChange() 29 { 30 debug('After the dynamic change:'); 31 shouldBe("layoutTestController.counterValueForElementById('one')", "'1'"); 32 shouldBe("layoutTestController.counterValueForElementById('two')", "'2'"); 33 shouldBe("layoutTestController.counterValueForElementById('three')", "'3'"); 34 35 debug(''); 36 debug('TEST COMPLETE'); 37 // Eliminate confusing messages (counter values won't be dumped by dumpAsText). 38 var viewElement = document.getElementById("view"); 39 viewElement.parentNode.removeChild(viewElement); 40 layoutTestController.notifyDone(); 41 } 42 43 function run() 44 { 45 if (window.layoutTestController) 46 checkCounterValuesBeforeChange(); 47 18 48 var t = document.getElementById("test"); 19 49 t.removeChild(t.childNodes.item(1)); 20 50 21 51 if (window.layoutTestController) 22 layoutTestController.notifyDone();52 checkCounterValuesAfterChange(); 23 53 } 24 25 // We cannot use dumpAsText() because the counters are CSS properties and26 // they aren't dumped by the function. Let's use render tree...27 54 </script> 28 55 </head> 29 56 30 <!-- This test checks if the counters work properly when some elements are 31 added/removed *after* the first rendering finishes. If we put the script in 32 <body>, this only checks the results of first rendering and this isn't 33 the purpose of this test. That's why we use timeout for this test. --> 34 <body onload="setTimeout('run()', 0)"> 57 <body onload="run();"> 35 58 59 <p>This is the WebKit version of <a href="http://www.w3.org/Style/CSS/Test/CSS2.1/20061011/html4/t1204-increment-01-c-o.htm">CSS 2.1 Test Suite: dynamic changes to 'counter-increment'</a>.</p> 60 61 <div id="view"> 36 62 <p>The following two lines should be the same:</p> 63 <div id="test"><span id="one" class="increment"></span><span class="increment">FAIL-</span><span id="two" class="increment"></span><span id="three" class="increment"></span></div> 64 <div id="reference">1-2-3-</div> 65 </div> 37 66 38 <div id="test"><span class="increment"></span><span class="increment">FAIL-</span><span class="increment"></span><span class="increment"></span></div> 39 40 <div id="reference">1-2-3-</div> 67 <div id="console"></div> 41 68 42 69 </body> -
trunk/WebCore/ChangeLog
r50231 r50233 1 2009-10-27 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Provide a way to get counter values with layoutTestContoller 6 https://bugs.webkit.org/show_bug.cgi?id=30555 7 8 Expose WebCore::counterValueForElement as a WebCore API. 9 10 * WebCore.base.exp: 11 * rendering/RenderTreeAsText.cpp: 12 (WebCore::writeCounterValuesFromChildren): 13 (WebCore::counterValueForElement): 14 * rendering/RenderTreeAsText.h: 15 1 16 2009-10-28 Nate Chapin <japhet@chromium.org> 2 17 -
trunk/WebCore/WebCore.base.exp
r50012 r50233 423 423 __ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv 424 424 __ZN7WebCore22applicationIsAppleMailEv 425 __ZN7WebCore22counterValueForElementEPNS_7ElementE 425 426 __ZN7WebCore22createFragmentFromTextEPNS_5RangeERKNS_6StringE 426 427 __ZN7WebCore22externalRepresentationEPNS_12RenderObjectE -
trunk/WebCore/rendering/RenderTreeAsText.cpp
r46815 r50233 29 29 #include "CSSMutableStyleDeclaration.h" 30 30 #include "CharacterNames.h" 31 #include "CString.h" 31 32 #include "Document.h" 32 33 #include "Frame.h" … … 554 555 } 555 556 557 static void writeCounterValuesFromChildren(TextStream& stream, RenderObject* parent) 558 { 559 for (RenderObject* child = parent->firstChild(); child; child = child->nextSibling()) { 560 if (child->isCounter()) { 561 String str(toRenderText(child)->text()); 562 stream << str; 563 } 564 } 565 } 566 567 String counterValueForElement(Element* element) 568 { 569 // Make sure the element is not freed during the layout. 570 RefPtr<Element> elementRef(element); 571 element->document()->updateLayout(); 572 TextStream stream; 573 // The counter renderers should be children of anonymous children 574 // (i.e., :before or :after pseudo-elements). 575 if (RenderObject* renderer = element->renderer()) { 576 for (RenderObject* child = renderer->firstChild(); child; child = child->nextSibling()) { 577 if (child->isAnonymous()) 578 writeCounterValuesFromChildren(stream, child); 579 } 580 } 581 return stream.release(); 582 } 583 556 584 } // namespace WebCore -
trunk/WebCore/rendering/RenderTreeAsText.h
r30418 r50233 29 29 namespace WebCore { 30 30 31 class RenderObject; 32 class String; 33 class TextStream; 31 class Element; 32 class RenderObject; 33 class String; 34 class TextStream; 34 35 35 36 36 String externalRepresentation(RenderObject*); 37 void write(TextStream&, const RenderObject&, int indent = 0); 37 38 38 // Helper function shared with SVGRenderTreeAsText 39 String quoteAndEscapeNonPrintables(const String&); 39 // Helper function shared with SVGRenderTreeAsText 40 String quoteAndEscapeNonPrintables(const String&); 41 42 String counterValueForElement(Element*); 40 43 41 44 } // namespace WebCore -
trunk/WebKit/gtk/ChangeLog
r50225 r50233 1 2009-10-27 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Provide a way to get counter values with layoutTestContoller 6 https://bugs.webkit.org/show_bug.cgi?id=30555 7 8 * webkit/webkitprivate.h: 9 * webkit/webkitwebframe.cpp: 10 (webkit_web_frame_counter_value_for_element_by_id): 11 1 12 2009-10-28 Joe Mason <jmason@rim.com> 2 13 -
trunk/WebKit/gtk/webkit/webkitprivate.h
r49168 r50233 286 286 webkit_web_frame_dump_render_tree (WebKitWebFrame* frame); 287 287 288 WEBKIT_API gchar* 289 webkit_web_frame_counter_value_for_element_by_id (WebKitWebFrame* frame, const gchar* id); 290 288 291 WEBKIT_API guint 289 292 webkit_web_frame_get_pending_unload_event_count(WebKitWebFrame* frame); -
trunk/WebKit/gtk/webkit/webkitwebframe.cpp
r49964 r50233 800 800 801 801 /** 802 * webkit_web_frame_counter_value_for_element_by_id: 803 * @frame: a #WebKitWebFrame 804 * @id: an element ID string 805 * 806 * Return value: The counter value of element @id in @frame 807 */ 808 gchar* webkit_web_frame_counter_value_for_element_by_id(WebKitWebFrame* frame, const gchar* id) 809 { 810 g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL); 811 812 Frame* coreFrame = core(frame); 813 if (!coreFrame) 814 return 0; 815 816 Element* coreElement = coreFrame->document()->getElementById(AtomicString(id)); 817 if (!coreElement) 818 return 0; 819 String counterValue = counterValueForElement(coreElement); 820 return g_strdup(counterValue.utf8().data()); 821 } 822 823 /** 802 824 * webkit_web_frame_get_pending_unload_event_count: 803 825 * @frame: a #WebKitWebFrame -
trunk/WebKit/mac/ChangeLog
r50183 r50233 1 2009-10-27 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Provide a way to get counter values with layoutTestContoller 6 https://bugs.webkit.org/show_bug.cgi?id=30555 7 8 Add counterValueForElement in WebFrame to call WebCore::counterValueForElement. 9 10 * Misc/WebCoreStatistics.h: 11 * Misc/WebCoreStatistics.mm: 12 (-[WebFrame counterValueForElement:]): 13 1 14 2009-10-27 Geoffrey Garen <ggaren@apple.com> 2 15 -
trunk/WebKit/mac/Misc/WebCoreStatistics.h
r45923 r50233 30 30 31 31 #import <WebKit/WebFrame.h> 32 33 @class DOMElement; 32 34 33 35 @interface WebCoreStatistics : NSObject … … 82 84 @interface WebFrame (WebKitDebug) 83 85 - (NSString *)renderTreeAsExternalRepresentation; 86 - (NSString *)counterValueForElement:(DOMElement*)element; 84 87 @end -
trunk/WebKit/mac/Misc/WebCoreStatistics.mm
r46431 r50233 29 29 #import "WebCoreStatistics.h" 30 30 31 #import "DOMElementInternal.h" 31 32 #import "WebCache.h" 32 33 #import "WebFrameInternal.h" … … 245 246 } 246 247 248 - (NSString *)counterValueForElement:(DOMElement*)element 249 { 250 return counterValueForElement(core(element)); 251 } 252 247 253 @end -
trunk/WebKit/qt/Api/qwebframe.cpp
r50207 r50233 477 477 478 478 /*! 479 Returns the value of counter in the element specified by \a id. 480 */ 481 QString QWebFrame::counterValueForElementById(const QString &id) const 482 { 483 if (Document *document = d->frame->document()) { 484 Element *element = document->getElementById(id); 485 return WebCore::counterValueForElement(element); 486 } 487 return QString(); 488 489 } 490 491 /*! 479 492 \property QWebFrame::title 480 493 \brief the title of the frame as defined by the HTML <title> element … … 1687 1700 return d->frame; 1688 1701 } 1689 -
trunk/WebKit/qt/Api/qwebframe.h
r50058 r50233 139 139 QString toPlainText() const; 140 140 QString renderTreeDump() const; 141 QString counterValueForElementById(const QString &id) const; 141 142 142 143 QString title() const; -
trunk/WebKit/qt/ChangeLog
r50224 r50233 1 2009-10-27 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Provide a way to get counter values with layoutTestContoller 6 https://bugs.webkit.org/show_bug.cgi?id=30555 7 8 * Api/qwebframe.cpp: 9 (QWebFrame::counterValueForElementById): 10 (QWebHitTestResult::frame): 11 * Api/qwebframe.h: 12 1 13 2009-10-28 Antonio Gomes <tonikitoo@webkit.org> 2 14 -
trunk/WebKit/win/ChangeLog
r50225 r50233 1 2009-10-27 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Provide a way to get counter values with layoutTestContoller 6 https://bugs.webkit.org/show_bug.cgi?id=30555 7 8 * Interfaces/IWebFramePrivate.idl: 9 * WebFrame.cpp: 10 (WebFrame::counterValueForElementById): 11 * WebFrame.h: 12 1 13 2009-10-28 Joe Mason <jmason@rim.com> 2 14 -
trunk/WebKit/win/Interfaces/IWebFramePrivate.idl
r50045 r50233 58 58 { 59 59 HRESULT renderTreeAsExternalRepresentation([out, retval] BSTR* result); 60 HRESULT counterValueForElementById([in] BSTR id, [out, retval] BSTR* result); 60 61 HRESULT scrollOffset([out, retval] SIZE* offset); 61 62 -
trunk/WebKit/win/WebFrame.cpp
r50227 r50233 825 825 } 826 826 827 HRESULT STDMETHODCALLTYPE WebFrame::counterValueForElementById( 828 /* [in] */ BSTR id, /* [retval][out] */ BSTR *result) 829 { 830 if (!result) 831 return E_POINTER; 832 833 Frame* coreFrame = core(this); 834 if (!coreFrame) 835 return E_FAIL; 836 837 String coreId = String(id, SysStringLen(id)); 838 839 Element* element = coreFrame->document()->getElementById(coreId); 840 if (!element) 841 return E_FAIL; 842 *result = BString(counterValueForElement(element)).release(); 843 return S_OK; 844 } 845 827 846 HRESULT STDMETHODCALLTYPE WebFrame::scrollOffset( 828 847 /* [retval][out] */ SIZE* offset) -
trunk/WebKit/win/WebFrame.h
r50045 r50233 157 157 // IWebFramePrivate 158 158 virtual HRESULT STDMETHODCALLTYPE renderTreeAsExternalRepresentation( 159 /* [retval][out] */ BSTR *result); 160 161 virtual HRESULT STDMETHODCALLTYPE counterValueForElementById( 162 /* [in] */ BSTR id, 159 163 /* [retval][out] */ BSTR *result); 160 164 -
trunk/WebKitTools/ChangeLog
r50166 r50233 1 2009-10-27 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Provide a way to get counter values with layoutTestContoller 6 https://bugs.webkit.org/show_bug.cgi?id=30555 7 8 Define layoutTestContoller.counterValueForElementById. 9 10 * DumpRenderTree/LayoutTestController.cpp: 11 (counterValueForElementByIdCallback): 12 (LayoutTestController::staticFunctions): 13 * DumpRenderTree/LayoutTestController.h: 14 * DumpRenderTree/mac/LayoutTestControllerMac.mm: 15 (LayoutTestController::counterValueForElementById): 16 1 17 2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 18 -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp
r49963 r50233 386 386 } 387 387 388 static JSValueRef counterValueForElementByIdCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 389 { 390 if (argumentCount < 1) 391 return JSValueMakeUndefined(context); 392 393 JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[0], exception)); 394 if (*exception) 395 return JSValueMakeUndefined(context); 396 397 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 398 JSRetainPtr<JSStringRef> counterValue(controller->counterValueForElementById(elementId.get())); 399 if (!counterValue.get()) 400 return JSValueMakeUndefined(context); 401 return JSValueMakeString(context, counterValue.get()); 402 } 403 388 404 static JSValueRef grantDesktopNotificationPermissionCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 389 405 { … … 1202 1218 { "evaluateScriptInIsolatedWorld", evaluateScriptInIsolatedWorldCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1203 1219 { "execCommand", execCommandCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1220 { "counterValueForElementById", counterValueForElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1204 1221 { "grantDesktopNotificationPermission", grantDesktopNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1205 1222 { "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.h
r49963 r50233 31 31 32 32 #include <JavaScriptCore/JSObjectRef.h> 33 #include <JavaScriptCore/JSRetainPtr.h> 33 34 #include <wtf/RefCounted.h> 34 35 #include <string> … … 52 53 void display(); 53 54 void execCommand(JSStringRef name, JSStringRef value); 55 JSRetainPtr<JSStringRef> counterValueForElementById(JSStringRef id); 54 56 bool isCommandEnabled(JSStringRef name); 55 57 void keepWebHistory(); -
trunk/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
r49968 r50233 53 53 unsigned int webkit_worker_thread_count(void); 54 54 void webkit_white_list_access_from_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains); 55 gchar* webkit_web_frame_counter_value_for_element_by_id(WebKitWebFrame* frame, const gchar* id); 55 56 } 56 57 … … 117 118 { 118 119 displayWebView(); 120 } 121 122 JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef id) 123 { 124 gchar* idGChar = JSStringCopyUTF8CString(id); 125 gchar* counterValueGChar = webkit_web_frame_counter_value_for_element_by_id(mainFrame, idGChar); 126 g_free(idGChar); 127 if (!counterValueGChar) 128 return 0; 129 JSRetainPtr<JSStringRef> counterValue(Adopt, JSStringCreateWithUTF8CString(counterValueGChar)); 130 return counterValue; 119 131 } 120 132 -
trunk/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
r49963 r50233 43 43 #import <WebKit/WebApplicationCache.h> 44 44 #import <WebKit/WebBackForwardList.h> 45 #import <WebKit/WebCoreStatistics.h> 45 46 #import <WebKit/WebDatabaseManagerPrivate.h> 46 47 #import <WebKit/WebDataSource.h> … … 152 153 } 153 154 155 JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef id) 156 { 157 RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, id)); 158 NSString *idNS = (NSString *)idCF.get(); 159 160 DOMElement *element = [[mainFrame DOMDocument] getElementById:idNS]; 161 if (!element) 162 return 0; 163 164 JSRetainPtr<JSStringRef> counterValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame counterValueForElement:element])); 165 return counterValue; 166 } 167 154 168 void LayoutTestController::keepWebHistory() 155 169 { -
trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
r50166 r50233 110 110 } 111 111 112 QString LayoutTestController::counterValueForElementById(const QString& id) 113 { 114 return m_drt->webPage()->mainFrame()->counterValueForElementById(id); 115 } 116 112 117 void LayoutTestController::keepWebHistory() 113 118 { … … 309 314 settings->setFontSize(QWebSettings::DefaultFontSize, value.toInt()); 310 315 } 311 -
trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
r49915 r50233 84 84 void setCanOpenWindows() { m_canOpenWindows = true; } 85 85 void waitUntilDone(); 86 QString counterValueForElementById(const QString& id); 86 87 void keepWebHistory(); 87 88 void notifyDone(); -
trunk/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
r49963 r50233 976 976 sharedHistoryPrivate->removeAllVisitedLinks(); 977 977 } 978 979 JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef id) 980 { 981 COMPtr<IWebFramePrivate> framePrivate(Query, frame); 982 if (!framePrivate) 983 return 0; 984 985 wstring idWstring = jsStringRefToWString(id); 986 BSTR idBSTR = SysAllocStringLen((OLECHAR*)idWstring.c_str(), idWstring.length()); 987 BSTR counterValueBSTR; 988 if (FAILED(framePrivate->counterValueForElementById(idBSTR, &counterValueBSTR))) 989 return 0; 990 991 wstring counterValue(counterValueBSTR, SysStringLen(counterValueBSTR)); 992 SysFreeString(idBSTR); 993 SysFreeString(counterValueBSTR); 994 JSRetainPtr<JSStringRef> counterValueJS(Adopt, JSStringCreateWithCharacters(counterValue.data(), counterValue.length())); 995 return counterValueJS; 996 } 997
Note: See TracChangeset
for help on using the changeset viewer.