Changeset 64029 in webkit
- Timestamp:
- Jul 25, 2010 11:03:36 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r64024 r64029 1 2010-07-25 Darin Adler <darin@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 WebKitTestRunner needs to support layoutTestController.keepWebHistory 6 https://bugs.webkit.org/show_bug.cgi?id=42323 7 8 * platform/mac-wk2/Skipped: Removed the tests that needed only keepWebHistory 9 and computedStyleIncludingVisitedInfo. Moved the other tests in the 10 keepWebHistory section of the file into the other appropriate lists. 11 1 12 2010-07-25 Adam Barth <abarth@webkit.org> 2 13 -
trunk/LayoutTests/platform/mac-wk2/Skipped
r64020 r64029 1638 1638 fast/harness/show-modal-dialog.html 1639 1639 fast/history/history_reload.html 1640 fast/history/window-open.html 1640 1641 fast/loader/cancel-load-during-port-block-timer.html 1641 1642 fast/loader/crash-copying-backforwardlist.html … … 1693 1694 fast/loader/stateobjects/pushstate-object-types.html 1694 1695 fast/loader/subframe-navigate-during-main-frame-load.html 1696 http/tests/history/redirect-200-refresh-0-seconds.pl 1695 1697 http/tests/history/redirect-200-refresh-2-seconds.pl 1696 1698 http/tests/history/redirect-301.pl … … 1698 1700 http/tests/history/redirect-303.pl 1699 1701 http/tests/history/redirect-307.pl 1702 http/tests/history/redirect-js-document-location-0-seconds.html 1703 http/tests/history/redirect-js-document-location-2-seconds.html 1704 http/tests/history/redirect-js-document-location-before-load.html 1705 http/tests/history/redirect-js-form-submit-0-seconds.html 1706 http/tests/history/redirect-js-form-submit-2-seconds.html 1707 http/tests/history/redirect-js-form-submit-before-load.html 1708 http/tests/history/redirect-js-location-0-seconds.html 1700 1709 http/tests/history/redirect-js-location-2-seconds.html 1710 http/tests/history/redirect-js-location-assign-0-seconds.html 1711 http/tests/history/redirect-js-location-assign-2-seconds.html 1712 http/tests/history/redirect-js-location-assign-before-load.html 1713 http/tests/history/redirect-js-location-before-load.html 1714 http/tests/history/redirect-js-location-href-0-seconds.html 1715 http/tests/history/redirect-js-location-href-2-seconds.html 1716 http/tests/history/redirect-js-location-href-before-load.html 1717 http/tests/history/redirect-js-location-replace-0-seconds.html 1718 http/tests/history/redirect-js-location-replace-2-seconds.html 1719 http/tests/history/redirect-js-location-replace-before-load.html 1720 http/tests/history/redirect-meta-refresh-0-seconds.html 1721 http/tests/history/redirect-meta-refresh-2-seconds.html 1701 1722 http/tests/incremental/frame-focus-before-load.html 1702 1723 http/tests/navigation/anchor-basic.html … … 1767 1788 http/tests/navigation/window-open-adds-history-item2.html 1768 1789 1769 # WebKitTestRunner needs to support layoutTestController.keepWebHistory1770 # <https://bugs.webkit.org/show_bug.cgi?id=42323>1771 fast/history/multiple-classes-visited.html1772 fast/history/nested-visited-test.html1773 fast/history/self-is-visited.html1774 fast/history/sibling-visited-test.html1775 fast/history/window-open.html1776 http/tests/history/redirect-200-refresh-0-seconds.pl1777 http/tests/history/redirect-js-document-location-0-seconds.html1778 http/tests/history/redirect-js-document-location-2-seconds.html1779 http/tests/history/redirect-js-document-location-before-load.html1780 http/tests/history/redirect-js-form-submit-0-seconds.html1781 http/tests/history/redirect-js-form-submit-before-load.html1782 http/tests/history/redirect-js-location-0-seconds.html1783 http/tests/history/redirect-js-location-assign-0-seconds.html1784 http/tests/history/redirect-js-location-assign-2-seconds.html1785 http/tests/history/redirect-js-location-assign-before-load.html1786 http/tests/history/redirect-js-location-before-load.html1787 http/tests/history/redirect-js-location-href-0-seconds.html1788 http/tests/history/redirect-js-location-href-2-seconds.html1789 http/tests/history/redirect-js-location-href-before-load.html1790 http/tests/history/redirect-js-location-replace-0-seconds.html1791 http/tests/history/redirect-js-location-replace-2-seconds.html1792 http/tests/history/redirect-js-location-replace-before-load.html1793 http/tests/history/redirect-meta-refresh-0-seconds.html1794 http/tests/history/redirect-meta-refresh-2-seconds.html1795 http/tests/history/redirect-js-form-submit-2-seconds.html1796 1797 1790 # WebKitTestRunner needs to support layoutTestController.dumpDOMAsWebArchive 1798 1791 # <https://bugs.webkit.org/show_bug.cgi?id=42324> -
trunk/WebKit2/ChangeLog
r64020 r64029 1 2010-07-25 Darin Adler <darin@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 WebKitTestRunner needs to support layoutTestController.keepWebHistory 6 https://bugs.webkit.org/show_bug.cgi?id=42323 7 8 Added WKBundleSetShouldTrackVisitedLinks, WKBundleRemoveAllVisitedLinks, 9 and WKBundleFrameGetComputedStyleIncludingVisitedInfo. 10 11 Also fixed misspellings of the word "receive". 12 13 * WebProcess/InjectedBundle/API/c/WKBundle.cpp: 14 (WKBundleSetShouldTrackVisitedLinks): Added. 15 (WKBundleRemoveAllVisitedLinks): Added. 16 * WebProcess/InjectedBundle/API/c/WKBundle.h: Added functions and 17 fixed mispellings of receive. 18 19 * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: 20 (WKBundleFrameGetJavaScriptContext): Moved the code from here into WebFrame, 21 to be consistent with the rest of the functions in this file. 22 (WKBundleFrameGetComputedStyleIncludingVisitedInfo): Added. 23 * WebProcess/InjectedBundle/API/c/WKBundleFrame.h: Added 24 WKBundleFrameGetComputedStyleIncludingVisitedInfo and tried to rearrange the 25 file to be more logically ordered and grouped. 26 27 * WebProcess/InjectedBundle/InjectedBundle.cpp: 28 (WebKit::InjectedBundle::setShouldTrackVisitedLinks): Added. 29 (WebKit::InjectedBundle::removeAllVisitedLinks): Added. 30 (WebKit::InjectedBundle::didReceiveMessage): Fixed mispellings of receive. 31 * WebProcess/InjectedBundle/InjectedBundle.h: Ditto. 32 33 * WebProcess/WebPage/WebFrame.cpp: 34 (WebKit::WebFrame::jsContext): Added. Contains the code that used to be in 35 WKBundleFrameGetJavaScriptContext. 36 (WebKit::WebFrame::computedStyleIncludingVisitedInfo): Added. 37 * WebProcess/WebPage/WebFrame.h: Ditto. 38 39 * UIProcess/API/C/WKContext.h: Fixed misspellings of receive. 40 * UIProcess/WebContext.cpp: 41 (WebKit::WebContext::didReceiveMessageFromInjectedBundle): Ditto. 42 * UIProcess/WebContext.h: Ditto. 43 * UIProcess/WebContextInjectedBundleClient.cpp: 44 (WebKit::WebContextInjectedBundleClient::didReceiveMessageFromInjectedBundle): Ditto. 45 * UIProcess/WebContextInjectedBundleClient.h: Ditto. 46 * UIProcess/WebProcessProxy.cpp: 47 (WebKit::WebProcessProxy::forwardMessageToWebContext): Ditto. 48 * WebProcess/WebProcess.cpp: 49 (WebKit::WebProcess::forwardMessageToInjectedBundle): Ditto. 50 1 51 2010-07-25 Alexey Proskuryakov <ap@apple.com> 2 52 -
trunk/WebKit2/UIProcess/API/C/WKContext.h
r61579 r64029 34 34 35 35 // Policy Client. 36 typedef void (*WKContextDidRec ieveMessageFromInjectedBundleCallback)(WKContextRef page, WKStringRef message, const void *clientInfo);36 typedef void (*WKContextDidReceiveMessageFromInjectedBundleCallback)(WKContextRef page, WKStringRef message, const void *clientInfo); 37 37 38 38 struct WKContextInjectedBundleClient { 39 39 int version; 40 40 const void * clientInfo; 41 WKContextDidRec ieveMessageFromInjectedBundleCallback didRecieveMessageFromInjectedBundle;41 WKContextDidReceiveMessageFromInjectedBundleCallback didReceiveMessageFromInjectedBundle; 42 42 }; 43 43 typedef struct WKContextInjectedBundleClient WKContextInjectedBundleClient; -
trunk/WebKit2/UIProcess/WebContext.cpp
r63621 r64029 150 150 // InjectedBundle client 151 151 152 void WebContext::didRec ieveMessageFromInjectedBundle(const WebCore::String& message)152 void WebContext::didReceiveMessageFromInjectedBundle(const WebCore::String& message) 153 153 { 154 m_injectedBundleClient.didRec ieveMessageFromInjectedBundle(this, message);154 m_injectedBundleClient.didReceiveMessageFromInjectedBundle(this, message); 155 155 } 156 156 -
trunk/WebKit2/UIProcess/WebContext.h
r63664 r64029 77 77 78 78 // InjectedBundle client 79 void didRec ieveMessageFromInjectedBundle(const WebCore::String&);79 void didReceiveMessageFromInjectedBundle(const WebCore::String&); 80 80 81 81 void postMessageToInjectedBundle(WebCore::StringImpl*); -
trunk/WebKit2/UIProcess/WebContextInjectedBundleClient.cpp
r61579 r64029 46 46 } 47 47 48 void WebContextInjectedBundleClient::didRec ieveMessageFromInjectedBundle(WebContext* context, const String& message)48 void WebContextInjectedBundleClient::didReceiveMessageFromInjectedBundle(WebContext* context, const String& message) 49 49 { 50 if (!m_client.didRec ieveMessageFromInjectedBundle)50 if (!m_client.didReceiveMessageFromInjectedBundle) 51 51 return; 52 52 53 m_client.didRec ieveMessageFromInjectedBundle(toRef(context), toRef(message.impl()), m_client.clientInfo);53 m_client.didReceiveMessageFromInjectedBundle(toRef(context), toRef(message.impl()), m_client.clientInfo); 54 54 } 55 55 -
trunk/WebKit2/UIProcess/WebContextInjectedBundleClient.h
r61579 r64029 42 42 void initialize(WKContextInjectedBundleClient*); 43 43 44 void didRec ieveMessageFromInjectedBundle(WebContext*, const WebCore::String&);44 void didReceiveMessageFromInjectedBundle(WebContext*, const WebCore::String&); 45 45 46 46 private: -
trunk/WebKit2/UIProcess/WebProcessProxy.cpp
r63825 r64029 185 185 void WebProcessProxy::forwardMessageToWebContext(const String& message) 186 186 { 187 m_context->didRec ieveMessageFromInjectedBundle(message);187 m_context->didReceiveMessageFromInjectedBundle(message); 188 188 } 189 189 -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
r61579 r64029 42 42 toWK(bundleRef)->postMessage(toWK(messageRef)); 43 43 } 44 45 void WKBundleSetShouldTrackVisitedLinks(WKBundleRef bundleRef, bool shouldTrackVisitedLinks) 46 { 47 toWK(bundleRef)->setShouldTrackVisitedLinks(shouldTrackVisitedLinks); 48 } 49 50 void WKBundleRemoveAllVisitedLinks(WKBundleRef bundleRef) 51 { 52 toWK(bundleRef)->removeAllVisitedLinks(); 53 } -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h
r61689 r64029 37 37 typedef void (*WKBundleDidCreatePageCallback)(WKBundleRef bundle, WKBundlePageRef page, const void *clientInfo); 38 38 typedef void (*WKBundleWillDestroyPageCallback)(WKBundleRef bundle, WKBundlePageRef page, const void *clientInfo); 39 typedef void (*WKBundleDidRec ieveMessageCallback)(WKBundleRef bundle, WKStringRef message, const void *clientInfo);39 typedef void (*WKBundleDidReceiveMessageCallback)(WKBundleRef bundle, WKStringRef message, const void *clientInfo); 40 40 41 41 struct WKBundleClient { … … 44 44 WKBundleDidCreatePageCallback didCreatePage; 45 45 WKBundleWillDestroyPageCallback willDestroyPage; 46 WKBundleDidRec ieveMessageCallback didRecieveMessage;46 WKBundleDidReceiveMessageCallback didReceiveMessage; 47 47 }; 48 48 typedef struct WKBundleClient WKBundleClient; … … 52 52 WK_EXPORT void WKBundlePostMessage(WKBundleRef bundle, WKStringRef message); 53 53 54 WK_EXPORT void WKBundleSetShouldTrackVisitedLinks(WKBundleRef bundle, bool shouldTrackVisitedLinks); 55 WK_EXPORT void WKBundleRemoveAllVisitedLinks(WKBundleRef bundle); 56 54 57 #ifdef __cplusplus 55 58 } -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
r63949 r64029 29 29 #include "WKBundleAPICast.h" 30 30 #include "WebFrame.h" 31 #include <JavaScriptCore/APICast.h>32 31 #include <WebCore/Frame.h> 33 32 … … 62 61 JSGlobalContextRef WKBundleFrameGetJavaScriptContext(WKBundleFrameRef frameRef) 63 62 { 64 // FIXME: Is there a way to get this and know that it's a JSGlobalContextRef? 65 // The const_cast here is a bit ugly. 66 return const_cast<JSGlobalContextRef>(toRef(toWK(frameRef)->coreFrame()->script()->globalObject(mainThreadNormalWorld())->globalExec())); 63 return toWK(frameRef)->jsContext(); 67 64 } 68 65 … … 73 70 return toRef(string.impl()); 74 71 } 72 73 JSValueRef WKBundleFrameGetComputedStyleIncludingVisitedInfo(WKBundleFrameRef frameRef, JSObjectRef element) 74 { 75 return toWK(frameRef)->computedStyleIncludingVisitedInfo(element); 76 } -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h
r63949 r64029 40 40 41 41 WK_EXPORT bool WKBundleFrameIsMainFrame(WKBundleFrameRef frame); 42 WK_EXPORT WKArrayRef WKBundleFrameCopyChildFrames(WKBundleFrameRef frame); 43 44 WK_EXPORT WKStringRef WKBundleFrameCopyName(WKBundleFrameRef frame); 45 WK_EXPORT WKURLRef WKBundleFrameGetURL(WKBundleFrameRef frame); 42 46 43 47 WK_EXPORT JSGlobalContextRef WKBundleFrameGetJavaScriptContext(WKBundleFrameRef frame); 44 45 WK_EXPORT WKURLRef WKBundleFrameGetURL(WKBundleFrameRef frame); 46 47 WK_EXPORT WKArrayRef WKBundleFrameCopyChildFrames(WKBundleFrameRef frame); 48 WK_EXPORT JSValueRef WKBundleFrameGetComputedStyleIncludingVisitedInfo(WKBundleFrameRef frame, JSObjectRef element); 48 49 49 50 WK_EXPORT unsigned WKBundleFrameGetNumberOfActiveAnimations(WKBundleFrameRef frame); 50 51 51 WK_EXPORT bool WKBundleFramePauseAnimationOnElementWithId(WKBundleFrameRef frame, WKStringRef name, WKStringRef elementID, double time); 52 53 WK_EXPORT WKStringRef WKBundleFrameCopyName(WKBundleFrameRef frame);54 52 55 53 #ifdef __cplusplus -
trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
r61719 r64029 31 31 #include "WebProcess.h" 32 32 #include "WebProcessProxyMessageKinds.h" 33 #include <WebCore/PageGroup.h> 33 34 34 35 using namespace WebCore; … … 60 61 } 61 62 63 void InjectedBundle::setShouldTrackVisitedLinks(bool shouldTrackVisitedLinks) 64 { 65 PageGroup::setShouldTrackVisitedLinks(shouldTrackVisitedLinks); 66 } 67 68 void InjectedBundle::removeAllVisitedLinks() 69 { 70 PageGroup::removeAllVisitedLinks(); 71 } 72 62 73 void InjectedBundle::didCreatePage(WebPage* page) 63 74 { … … 72 83 } 73 84 74 void InjectedBundle::didRec ieveMessage(const WebCore::String& message)85 void InjectedBundle::didReceiveMessage(const WebCore::String& message) 75 86 { 76 if (m_client.didRec ieveMessage)77 m_client.didRec ieveMessage(toRef(this), toRef(message.impl()), m_client.clientInfo);87 if (m_client.didReceiveMessage) 88 m_client.didReceiveMessage(toRef(this), toRef(message.impl()), m_client.clientInfo); 78 89 } 79 90 -
trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
r63825 r64029 61 61 void initializeClient(WKBundleClient*); 62 62 void postMessage(WebCore::StringImpl*); 63 void setShouldTrackVisitedLinks(bool); 64 void removeAllVisitedLinks(); 63 65 64 66 // Callback hooks 65 67 void didCreatePage(WebPage*); 66 68 void willDestroyPage(WebPage*); 67 void didRec ieveMessage(const WebCore::String&);69 void didReceiveMessage(const WebCore::String&); 68 70 69 71 private: -
trunk/WebKit2/WebProcess/WebPage/WebFrame.cpp
r63949 r64029 27 27 28 28 #include "WebPage.h" 29 #include <JavaScriptCore/APICast.h> 30 #include <JavaScriptCore/JSLock.h> 29 31 #include <WebCore/AnimationController.h> 32 #include <WebCore/CSSComputedStyleDeclaration.h> 30 33 #include <WebCore/Frame.h> 31 34 #include <WebCore/HTMLFrameOwnerElement.h> 35 #include <WebCore/JSCSSStyleDeclaration.h> 36 #include <WebCore/JSElement.h> 32 37 #include <WebCore/PlatformString.h> 33 38 … … 36 41 #endif 37 42 43 using namespace JSC; 38 44 using namespace WebCore; 39 45 … … 245 251 } 246 252 253 JSGlobalContextRef WebFrame::jsContext() 254 { 255 // FIXME: Is there a way to get this and know that it's a JSGlobalContextRef? 256 // The const_cast here is a bit ugly. 257 return const_cast<JSGlobalContextRef>(toRef(m_coreFrame->script()->globalObject(mainThreadNormalWorld())->globalExec())); 258 } 259 260 JSValueRef WebFrame::computedStyleIncludingVisitedInfo(JSObjectRef elementJSObject) 261 { 262 if (!m_coreFrame) 263 return 0; 264 265 JSDOMWindow* globalObject = m_coreFrame->script()->globalObject(mainThreadNormalWorld()); 266 ExecState* exec = globalObject->globalExec(); 267 268 if (!toJS(elementJSObject)->inherits(&JSElement::s_info)) 269 return JSValueMakeUndefined(toRef(exec)); 270 271 RefPtr<CSSComputedStyleDeclaration> style = computedStyle(static_cast<JSElement*>(toJS(elementJSObject))->impl(), true); 272 273 JSLock lock(SilenceAssertionsOnly); 274 return toRef(exec, toJS(exec, globalObject, style.get())); 275 } 247 276 248 277 } // namespace WebKit -
trunk/WebKit2/WebProcess/WebPage/WebFrame.h
r63949 r64029 29 29 #include "ImmutableArray.h" 30 30 #include "WebFrameLoaderClient.h" 31 #include <JavaScriptCore/JSBase.h> 31 32 #include <WebCore/FrameLoaderClient.h> 32 33 #include <WebCore/FrameLoaderTypes.h> … … 69 70 WebCore::String url() const; 70 71 PassRefPtr<ImmutableArray> childFrames(); 72 JSValueRef computedStyleIncludingVisitedInfo(JSObjectRef element); 73 JSGlobalContextRef jsContext(); 71 74 72 75 unsigned numberOfActiveAnimations(); -
trunk/WebKit2/WebProcess/WebProcess.cpp
r63825 r64029 107 107 return; 108 108 109 m_injectedBundle->didRec ieveMessage(message);109 m_injectedBundle->didReceiveMessage(message); 110 110 } 111 111 -
trunk/WebKitTools/ChangeLog
r64020 r64029 1 2010-07-25 Darin Adler <darin@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 WebKitTestRunner needs to support layoutTestController.keepWebHistory 6 https://bugs.webkit.org/show_bug.cgi?id=42323 7 8 Added keepWebHistory and computedStyleIncludingVisitedInfo. 9 10 Also fixed misspellings of the word "receive". 11 12 Also tweaked the names of some of the LayoutTestController members. 13 14 * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm: 15 Added support for a type named "object" that is passed and returns as 16 a JSValueRef. 17 18 * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl: 19 Added keepWebHistory and computedStyleIncludingVisitedInfo. Also 20 put setAcceptsEditing up nearer the top. 21 22 * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: 23 (WTR::InjectedBundle::_didReceiveMessage): Fixed mispellings of receive. 24 (WTR::InjectedBundle::initialize): Ditto. 25 (WTR::InjectedBundle::didReceiveMessage): Ditto. 26 (WTR::InjectedBundle::reset): Reset the state of visited links between 27 tests. Also eliminated the unused argument to the LayoutTestController 28 create function. 29 (WTR::InjectedBundle::setShouldTrackVisitedLinks): Added. 30 * WebKitTestRunner/InjectedBundle/InjectedBundle.h: Ditto. 31 32 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: 33 (WTR::InjectedBundlePage::shouldBeginEditing): Call shouldAllowEditing 34 instead of acceptsEditing. 35 (WTR::InjectedBundlePage::shouldEndEditing): Ditto. 36 (WTR::InjectedBundlePage::shouldInsertNode): Ditto. 37 (WTR::InjectedBundlePage::shouldInsertText): Ditto. 38 (WTR::InjectedBundlePage::shouldDeleteRange): Ditto. 39 (WTR::InjectedBundlePage::shouldChangeSelectedRange): Ditto. 40 (WTR::InjectedBundlePage::shouldApplyStyle): Ditto. 41 42 * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: 43 (WTR::LayoutTestController::create): Removed uneeded argument. 44 (WTR::LayoutTestController::LayoutTestController): Removed unneeded 45 argument. Updated for rename of m_acceptsEditing to m_shouldAllowEditing. 46 (WTR::LayoutTestController::numberOfActiveAnimations): Added some FIXMEs 47 about the fact that this works on the main frame. 48 (WTR::LayoutTestController::pauseAnimationAtTimeOnElementWithId): Ditto. 49 (WTR::LayoutTestController::keepWebHistory): Added. 50 (WTR::LayoutTestController::computedStyleIncludingVisitedInfo): Added. 51 (WTR::JSObjectSetProperty): Added. Helper to make the function below 52 cleaner. 53 (WTR::LayoutTestController::makeWindowObject): Changed to use the 54 overload of JSObjectSetProperty above. 55 56 * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Changes to 57 match above. 58 59 * WebKitTestRunner/TestController.cpp: 60 (WTR::TestController::initialize): Fixed mispellings of receive. 61 (WTR::TestController::_didReceiveMessageFromInjectedBundle): Ditto. 62 (WTR::TestController::didReceiveMessageFromInjectedBundle): Ditto. 63 * WebKitTestRunner/TestController.h: Ditto. 64 * WebKitTestRunner/TestInvocation.cpp: 65 (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): Ditto. 66 * WebKitTestRunner/TestInvocation.h: Ditto. 67 1 68 2010-07-25 Alexey Proskuryakov <ap@apple.com> 2 69 -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
r63693 r64029 344 344 345 345 return unless defined $idlType; 346 return if $idlType eq "boolean" or $$self{codeGenerator}->IsNonPointerType($idlType); 346 return if $idlType eq "boolean"; 347 return if $idlType eq "object"; 348 return if $$self{codeGenerator}->IsNonPointerType($idlType); 347 349 348 350 $$headers{_className($idlType) . ".h"} = 1; … … 386 388 387 389 return "bool" if $idlType eq "boolean"; 390 return "JSValueRef" if $idlType eq "object"; 388 391 return "JSRetainPtr<JSStringRef>" if $$self{codeGenerator}->IsStringType($idlType); 389 392 return "double" if $$self{codeGenerator}->IsNonPointerType($idlType); … … 397 400 my $idlType = $signature->type; 398 401 402 return "JSValueToBoolean(context, $argumentName)" if $idlType eq "boolean"; 403 return "$argumentName" if $idlType eq "object"; 399 404 return "JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, $argumentName, 0))" if $$self{codeGenerator}->IsStringType($idlType); 400 return "JSValueToBoolean(context, $argumentName)" if $idlType eq "boolean";401 405 return "JSValueToNumber(context, $argumentName, 0)" if $$self{codeGenerator}->IsNonPointerType($idlType); 402 406 return "to" . _implementationClassName($idlType) . "(context, $argumentName)"; … … 414 418 "double" => 1, 415 419 "JSRetainPtr<JSStringRef>" => 1, 420 "JSValueRef" => 1, 416 421 ); 417 422 … … 438 443 return "JSValueMakeUndefined(context)" if $returnIDLType eq "void"; 439 444 return "JSValueMakeBoolean(context, ${expression})" if $returnIDLType eq "boolean"; 445 return "${expression}" if $returnIDLType eq "object"; 440 446 return "JSValueMakeNumber(context, ${expression})" if $$self{codeGenerator}->IsNonPointerType($returnIDLType); 441 447 return "toJS(context, WTF::getPtr(${expression}))"; -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
r63930 r64029 38 38 void dumpStatusCallbacks(); 39 39 40 // Special options. 41 void keepWebHistory(); 42 void setAcceptsEditing(in boolean value); 43 44 // Special DOM functions. 45 object computedStyleIncludingVisitedInfo(in object element); 46 40 47 // Repaint testing. 41 48 void testRepaint(); … … 46 53 int numberOfActiveAnimations(); 47 54 boolean pauseAnimationAtTimeOnElementWithId(in DOMString animationName, in double time, in DOMString elementId); 48 49 void setAcceptsEditing(in boolean value);50 55 }; 51 56 -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
r63187 r64029 58 58 } 59 59 60 void InjectedBundle::_didRec ieveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo)60 void InjectedBundle::_didReceiveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo) 61 61 { 62 static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didRec ieveMessage(message);62 static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didReceiveMessage(message); 63 63 } 64 64 … … 72 72 _didCreatePage, 73 73 _willDestroyPage, 74 _didRec ieveMessage74 _didReceiveMessage 75 75 }; 76 76 WKBundleSetClient(m_bundle, &client); … … 99 99 } 100 100 101 void InjectedBundle::didRec ieveMessage(WKStringRef message)101 void InjectedBundle::didReceiveMessage(WKStringRef message) 102 102 { 103 103 CFStringRef cfMessage = WKStringCopyCFString(0, message); … … 117 117 { 118 118 m_outputStream.str(""); 119 m_layoutTestController = LayoutTestController::create(std::string("")); 119 m_layoutTestController = LayoutTestController::create(); 120 WKBundleSetShouldTrackVisitedLinks(m_bundle, false); 121 WKBundleRemoveAllVisitedLinks(m_bundle); 122 } 123 124 void InjectedBundle::setShouldTrackVisitedLinks() 125 { 126 WKBundleSetShouldTrackVisitedLinks(m_bundle, true); 120 127 } 121 128 -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
r63061 r64029 53 53 std::ostringstream& os() { return m_outputStream; } 54 54 55 void setShouldTrackVisitedLinks(); 56 55 57 private: 56 58 InjectedBundle(); … … 59 61 static void _didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo); 60 62 static void _willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo); 61 static void _didRec ieveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo);63 static void _didReceiveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo); 62 64 63 65 void didCreatePage(WKBundlePageRef page); 64 66 void willDestroyPage(WKBundlePageRef page); 65 void didRec ieveMessage(WKStringRef message);67 void didReceiveMessage(WKStringRef message); 66 68 67 69 void reset(); -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
r64020 r64029 505 505 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 506 506 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldBeginEditingInDOMRange:" << range << "\n"; 507 return InjectedBundle::shared().layoutTestController()-> acceptsEditing();507 return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); 508 508 } 509 509 … … 512 512 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 513 513 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldEndEditingInDOMRange:" << range << "\n"; 514 return InjectedBundle::shared().layoutTestController()-> acceptsEditing();514 return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); 515 515 } 516 516 … … 525 525 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 526 526 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertNode:" << dumpPath(node) << " replacingDOMRange:" << rangeToReplace << " givenAction:" << insertactionstring[action] << "\n"; 527 return InjectedBundle::shared().layoutTestController()-> acceptsEditing();527 return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); 528 528 } 529 529 … … 538 538 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 539 539 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertText:" << text << " replacingDOMRange:" << rangeToReplace << " givenAction:" << insertactionstring[action] << "\n"; 540 return InjectedBundle::shared().layoutTestController()-> acceptsEditing();540 return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); 541 541 } 542 542 … … 545 545 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 546 546 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldDeleteDOMRange:" << range << "\n"; 547 return InjectedBundle::shared().layoutTestController()-> acceptsEditing();547 return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); 548 548 } 549 549 … … 561 561 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 562 562 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldChangeSelectedDOMRange:" << fromRange << " toDOMRange:" << toRange << " affinity:" << affinitystring[affinity] << " stillSelecting:" << boolstring[stillSelecting] << "\n"; 563 return InjectedBundle::shared().layoutTestController()-> acceptsEditing();563 return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); 564 564 } 565 565 … … 568 568 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 569 569 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldApplyStyle:" << style << " toElementsInDOMRange:" << range << "\n"; 570 return InjectedBundle::shared().layoutTestController()-> acceptsEditing();570 return InjectedBundle::shared().layoutTestController()->shouldAllowEditing(); 571 571 } 572 572 -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
r63930 r64029 37 37 namespace WTR { 38 38 39 PassRefPtr<LayoutTestController> LayoutTestController::create( const std::string& testPathOrURL)39 PassRefPtr<LayoutTestController> LayoutTestController::create() 40 40 { 41 return adoptRef(new LayoutTestController (testPathOrURL));41 return adoptRef(new LayoutTestController); 42 42 } 43 43 44 LayoutTestController::LayoutTestController( const std::string& testPathOrURL)44 LayoutTestController::LayoutTestController() 45 45 : m_whatToDump(RenderTree) 46 46 , m_shouldDumpAllFrameScrollPositions(false) 47 , m_ acceptsEditing(true)47 , m_shouldAllowEditing(true) 48 48 , m_dumpEditingCallbacks(false) 49 49 , m_dumpStatusCallbacks(false) … … 51 51 , m_testRepaint(false) 52 52 , m_testRepaintSweepHorizontally(false) 53 , m_testPathOrURL(testPathOrURL)54 53 { 55 54 } … … 113 112 unsigned LayoutTestController::numberOfActiveAnimations() const 114 113 { 114 // FIXME: Is it OK this works only for the main frame? 115 // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage? 115 116 WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); 116 117 return WKBundleFrameGetNumberOfActiveAnimations(mainFrame); … … 119 120 bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) 120 121 { 122 // FIXME: Is it OK this works only for the main frame? 123 // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage? 124 121 125 RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, elementId)); 122 126 WKRetainPtr<WKStringRef> idWK(AdoptWK, WKStringCreateWithCFString(idCF.get())); … … 128 132 } 129 133 134 void LayoutTestController::keepWebHistory() 135 { 136 InjectedBundle::shared().setShouldTrackVisitedLinks(); 137 } 138 139 JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSValueRef element) 140 { 141 // FIXME: Is it OK this works only for the main frame? 142 WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page()); 143 JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame); 144 if (!JSValueIsObject(context, element)) 145 return JSValueMakeUndefined(context); 146 JSValueRef value = WKBundleFrameGetComputedStyleIncludingVisitedInfo(mainFrame, const_cast<JSObjectRef>(element)); 147 if (!value) 148 return JSValueMakeUndefined(context); 149 return value; 150 } 151 130 152 // Object Creation 153 154 static void JSObjectSetProperty(JSContextRef context, JSObjectRef object, const char* propertyName, JSWrappable* value, JSPropertyAttributes attributes, JSValueRef* exception) 155 { 156 JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName)); 157 JSObjectSetProperty(context, object, propertyNameString.get(), JSWrapper::wrap(context, value), attributes, exception); 158 } 131 159 132 160 void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) 133 161 { 134 JSRetainPtr<JSStringRef> layoutTestContollerStr(Adopt, JSStringCreateWithUTF8CString("layoutTestController")); 135 JSObjectSetProperty(context, windowObject, layoutTestContollerStr.get(), JSWrapper::wrap(context, this), kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); 162 JSObjectSetProperty(context, windowObject, "layoutTestController", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); 136 163 } 137 164 -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
r63930 r64029 37 37 class LayoutTestController : public JSWrappable { 38 38 public: 39 static PassRefPtr<LayoutTestController> create( const std::string& testPathOrURL);39 static PassRefPtr<LayoutTestController> create(); 40 40 virtual ~LayoutTestController(); 41 41 … … 56 56 void dumpStatusCallbacks() { m_dumpStatusCallbacks = true; } 57 57 58 // Special options. 59 void keepWebHistory(); 60 void setAcceptsEditing(bool value) { m_shouldAllowEditing = value; } 61 62 // Special DOM functions. 63 JSValueRef computedStyleIncludingVisitedInfo(JSValueRef); 64 58 65 // Repaint testing. 59 66 void testRepaint() { m_testRepaint = true; } … … 64 71 unsigned numberOfActiveAnimations() const; 65 72 bool pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId); 66 67 void setAcceptsEditing(bool value) { m_acceptsEditing = value; }68 bool acceptsEditing() const { return m_acceptsEditing; }69 73 70 74 enum WhatToDump { RenderTree, MainFrameText, AllFramesText }; … … 81 85 void invalidateWaitToDumpWatchdog(); 82 86 87 bool shouldAllowEditing() const { return m_shouldAllowEditing; } 88 83 89 private: 84 LayoutTestController( const std::string& testPathOrURL);90 LayoutTestController(); 85 91 86 92 WhatToDump m_whatToDump; 87 93 bool m_shouldDumpAllFrameScrollPositions; 88 bool m_ acceptsEditing;94 bool m_shouldAllowEditing; 89 95 bool m_dumpEditingCallbacks; 90 96 bool m_dumpStatusCallbacks; … … 93 99 bool m_testRepaintSweepHorizontally; 94 100 95 std::string m_testPathOrURL;96 97 101 RetainPtr<CFRunLoopTimerRef> m_waitToDumpWatchdog; 98 102 }; -
trunk/WebKitTools/WebKitTestRunner/TestController.cpp
r63700 r64029 83 83 0, 84 84 this, 85 _didRec ieveMessageFromInjectedBundle85 _didReceiveMessageFromInjectedBundle 86 86 }; 87 87 WKContextSetInjectedBundleClient(m_context.get(), &injectedBundlePathClient); … … 127 127 } 128 128 129 void TestController::_didRec ieveMessageFromInjectedBundle(WKContextRef context, WKStringRef message, const void *clientInfo)129 void TestController::_didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef message, const void *clientInfo) 130 130 { 131 static_cast<TestController*>(const_cast<void*>(clientInfo))->didRec ieveMessageFromInjectedBundle(message);131 static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveMessageFromInjectedBundle(message); 132 132 } 133 133 134 void TestController::didRec ieveMessageFromInjectedBundle(WKStringRef message)134 void TestController::didReceiveMessageFromInjectedBundle(WKStringRef message) 135 135 { 136 m_currentInvocation->didRec ieveMessageFromInjectedBundle(message);136 m_currentInvocation->didReceiveMessageFromInjectedBundle(message); 137 137 } 138 138 -
trunk/WebKitTools/WebKitTestRunner/TestController.h
r63700 r64029 68 68 69 69 // WKContextInjectedBundleClient 70 static void _didRec ieveMessageFromInjectedBundle(WKContextRef context, WKStringRef message, const void*);71 void didRec ieveMessageFromInjectedBundle(WKStringRef message);70 static void _didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef message, const void*); 71 void didReceiveMessageFromInjectedBundle(WKStringRef message); 72 72 73 73 OwnPtr<TestInvocation> m_currentInvocation; -
trunk/WebKitTools/WebKitTestRunner/TestInvocation.cpp
r63664 r64029 140 140 } 141 141 142 void TestInvocation::didRec ieveMessageFromInjectedBundle(WKStringRef message)142 void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef message) 143 143 { 144 144 RetainPtr<CFStringRef> cfMessage(AdoptCF, WKStringCopyCFString(0, message)); -
trunk/WebKitTools/WebKitTestRunner/TestInvocation.h
r63664 r64029 38 38 39 39 void invoke(); 40 void didRec ieveMessageFromInjectedBundle(WKStringRef message);40 void didReceiveMessageFromInjectedBundle(WKStringRef message); 41 41 42 42 private:
Note: See TracChangeset
for help on using the changeset viewer.