Hook up UIScriptController in DumpRenderTree
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Aug 2016 02:03:43 +0000 (02:03 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Aug 2016 02:03:43 +0000 (02:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=161064

Reviewed by Sam Weinig.

Tools:

Add a skeleton implementation of UIScriptController to DumpRenderTree, building for both
Mac and iOS. Currently this is sufficient to test doAsyncTask(), enabling two tests
in fast/harness which test this.

Add a DerivedSources target to DumpRenderTree to invoke DerivedSources.make.

Move related code shared between WTR and DRT into Tools/TestRunnerShared, and cleanse it of
WK2-isms. Fix the makefiles to refer to the new location.

Hook up TestRunner::runUIScript() for DumpRenderTree, which requires keeping track of callbacks
by ID and firing them once they are complete.

* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm: Added (copied from WTR).
* DumpRenderTree/CMakeLists.txt:
* DumpRenderTree/DerivedSources.make: Copied from Tools/WebKitTestRunner/DerivedSources.make.
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/TestRunner.cpp:
(runUIScriptCallback):
(TestRunner::staticFunctions):
(TestRunner::cacheTestRunnerCallback):
(TestRunner::callTestRunnerCallback):
(TestRunner::clearTestRunnerCallbacks):
(nextUIScriptCallbackID):
(TestRunner::runUIScript):
(TestRunner::callUIScriptCallback):
(TestRunner::uiScriptDidComplete):
(TestRunner::cleanup):
* DumpRenderTree/TestRunner.h:
* DumpRenderTree/ios/UIScriptControllerIOS.mm: Added.
* DumpRenderTree/mac/Configurations/Base.xcconfig: DerivedSources.make needs WEBCORE_PRIVATE_HEADERS_DIR to be defined.
* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::mainFrameJSContext):
* DumpRenderTree/mac/UIScriptControllerMac.mm: Copied from Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h.
(WTR::UIScriptController::doAsyncTask):
* DumpRenderTree/win/DumpRenderTree.cpp:
* TestRunnerShared/Bindings/JSWrappable.h: Renamed from Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h.
(WTR::JSWrappable::~JSWrappable):
(WTR::JSValueMakeStringOrNull):
* TestRunnerShared/Bindings/JSWrapper.cpp: Renamed from Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp.
(WTR::JSWrapper::wrap):
(WTR::JSWrapper::unwrap):
(WTR::unwrapObject):
(WTR::JSWrapper::initialize):
(WTR::JSWrapper::finalize):
* TestRunnerShared/Bindings/JSWrapper.h: Renamed from Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h.
(WTR::toJS):
(WTR::setProperty):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: Renamed from Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl.
* TestRunnerShared/UIScriptContext/UIScriptContext.cpp: Renamed from Tools/WebKitTestRunner/UIScriptContext/UIScriptContext.cpp.
* TestRunnerShared/UIScriptContext/UIScriptContext.h: Renamed from Tools/WebKitTestRunner/UIScriptContext/UIScriptContext.h.
(WTR::UIScriptContext::currentParentCallbackIsPendingCompletion):
* TestRunnerShared/UIScriptContext/UIScriptController.cpp: Renamed from Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp.
* TestRunnerShared/UIScriptContext/UIScriptController.h: Renamed from Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h.
* WebKitTestRunner/CMakeLists.txt:
* WebKitTestRunner/DerivedSources.make:
* WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h:
(WTR::JSWrappable::~JSWrappable): Deleted.
(WTR::JSValueMakeStringOrNull): Deleted.
* WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp:
(WTR::JSWrapper::wrap): Deleted.
(WTR::JSWrapper::unwrap): Deleted.
(WTR::unwrapObject): Deleted.
(WTR::JSWrapper::initialize): Deleted.
(WTR::JSWrapper::finalize): Deleted.
* WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h:
(WTR::toJS): Deleted.
(WTR::setProperty): Deleted.
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::runUISideScript):
(WTR::TestInvocation::uiScriptDidComplete):
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/UIScriptContext/UIScriptContext.cpp: Moved
* WebKitTestRunner/UIScriptContext/UIScriptContext.h: Moved
* WebKitTestRunner/UIScriptContext/UIScriptController.cpp: Moved
* WebKitTestRunner/UIScriptContext/UIScriptController.h: Moved
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/config.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::contentVisibleRect):

LayoutTests:

fast/harness/ui-side-scripts.html and fast/harness/concurrent-ui-side-scripts.html
pass in DumpRenderTree now.

* platform/ios-simulator-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204877 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/ios-simulator-wk2/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/mac/TestExpectations
Tools/ChangeLog
Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm [new file with mode: 0644]
Tools/DumpRenderTree/CMakeLists.txt
Tools/DumpRenderTree/DerivedSources.make [new file with mode: 0644]
Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
Tools/DumpRenderTree/TestRunner.cpp
Tools/DumpRenderTree/TestRunner.h
Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm [new file with mode: 0644]
Tools/DumpRenderTree/mac/Configurations/Base.xcconfig
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/mac/TestRunnerMac.mm
Tools/DumpRenderTree/mac/UIScriptControllerMac.mm [new file with mode: 0644]
Tools/DumpRenderTree/win/DumpRenderTree.cpp
Tools/DumpRenderTree/win/TestRunnerWin.cpp
Tools/TestRunnerShared/Bindings/JSWrappable.h [moved from Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h with 100% similarity]
Tools/TestRunnerShared/Bindings/JSWrapper.cpp [moved from Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp with 100% similarity]
Tools/TestRunnerShared/Bindings/JSWrapper.h [moved from Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h with 93% similarity]
Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl [moved from Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl with 100% similarity]
Tools/TestRunnerShared/UIScriptContext/UIScriptContext.cpp [moved from Tools/WebKitTestRunner/UIScriptContext/UIScriptContext.cpp with 89% similarity]
Tools/TestRunnerShared/UIScriptContext/UIScriptContext.h [moved from Tools/WebKitTestRunner/UIScriptContext/UIScriptContext.h with 91% similarity]
Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp [moved from Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp with 100% similarity]
Tools/TestRunnerShared/UIScriptContext/UIScriptController.h [moved from Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h with 97% similarity]
Tools/WebKitTestRunner/CMakeLists.txt
Tools/WebKitTestRunner/DerivedSources.make
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/TestInvocation.h
Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
Tools/WebKitTestRunner/config.h
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm

index c000ced..efb4ad4 100644 (file)
@@ -1,3 +1,17 @@
+2016-08-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Hook up UIScriptController in DumpRenderTree
+        https://bugs.webkit.org/show_bug.cgi?id=161064
+
+        Reviewed by Sam Weinig.
+
+        fast/harness/ui-side-scripts.html and fast/harness/concurrent-ui-side-scripts.html
+        pass in DumpRenderTree now.
+
+        * platform/ios-simulator-wk2/TestExpectations:
+        * platform/mac-wk2/TestExpectations:
+        * platform/mac/TestExpectations:
+
 2016-08-23  Dean Jackson  <dino@apple.com>
 
         fast/canvas/canvas-alphaImageData-behavior.html doesn't appear to be flakey any
index 75eaa10..fc2d99e 100644 (file)
@@ -6,8 +6,6 @@
 # Platform-specific directories. Skipped globally, then re-enabled here.
 #//////////////////////////////////////////////////////////////////////////////////////////
 
-fast/harness/ui-side-scripts.html [ Pass ]
-fast/harness/concurrent-ui-side-scripts.html [ Pass ]
 fast/scrolling/ios [ Pass ]
 fast/viewport/ios [ Pass ]
 fast/zooming/ios [ Pass ]
index 730437a..e90d0c4 100644 (file)
@@ -15,9 +15,6 @@ fast/events/force-click-link-selection-behavior.html [ Pass ]
 fast/events/force-click-on-link-navigation.html [ Pass ]
 fast/events/force-click-text-selection-behavior.html [ Failure ]
 
-fast/harness/ui-side-scripts.html [ Pass ]
-fast/harness/concurrent-ui-side-scripts.html [ Pass ]
-
 #//////////////////////////////////////////////////////////////////////////////////////////
 # End platform-specific directories.
 #//////////////////////////////////////////////////////////////////////////////////////////
index 3a205c6..8a0f26b 100644 (file)
@@ -22,6 +22,9 @@ fast/text-autosizing/mac [ Pass ]
 
 fast/attachment/attachment-subtitle-resize.html [ Pass ]
 
+fast/harness/ui-side-scripts.html [ Pass ]
+fast/harness/concurrent-ui-side-scripts.html [ Pass ]
+
 #//////////////////////////////////////////////////////////////////////////////////////////
 # End platform-specific directories.
 #//////////////////////////////////////////////////////////////////////////////////////////
index 5b14c3a..825cea5 100644 (file)
@@ -1,3 +1,92 @@
+2016-08-23  Simon Fraser  <simon.fraser@apple.com>
+
+        Hook up UIScriptController in DumpRenderTree
+        https://bugs.webkit.org/show_bug.cgi?id=161064
+
+        Reviewed by Sam Weinig.
+
+        Add a skeleton implementation of UIScriptController to DumpRenderTree, building for both
+        Mac and iOS. Currently this is sufficient to test doAsyncTask(), enabling two tests
+        in fast/harness which test this.
+
+        Add a DerivedSources target to DumpRenderTree to invoke DerivedSources.make.
+
+        Move related code shared between WTR and DRT into Tools/TestRunnerShared, and cleanse it of
+        WK2-isms. Fix the makefiles to refer to the new location.
+
+        Hook up TestRunner::runUIScript() for DumpRenderTree, which requires keeping track of callbacks
+        by ID and firing them once they are complete.
+
+        * DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm: Added (copied from WTR).
+        * DumpRenderTree/CMakeLists.txt:
+        * DumpRenderTree/DerivedSources.make: Copied from Tools/WebKitTestRunner/DerivedSources.make.
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+        * DumpRenderTree/TestRunner.cpp:
+        (runUIScriptCallback):
+        (TestRunner::staticFunctions):
+        (TestRunner::cacheTestRunnerCallback):
+        (TestRunner::callTestRunnerCallback):
+        (TestRunner::clearTestRunnerCallbacks):
+        (nextUIScriptCallbackID):
+        (TestRunner::runUIScript):
+        (TestRunner::callUIScriptCallback):
+        (TestRunner::uiScriptDidComplete):
+        (TestRunner::cleanup):
+        * DumpRenderTree/TestRunner.h:
+        * DumpRenderTree/ios/UIScriptControllerIOS.mm: Added.
+        * DumpRenderTree/mac/Configurations/Base.xcconfig: DerivedSources.make needs WEBCORE_PRIVATE_HEADERS_DIR to be defined.
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (runTest):
+        * DumpRenderTree/mac/TestRunnerMac.mm:
+        (TestRunner::mainFrameJSContext):
+        * DumpRenderTree/mac/UIScriptControllerMac.mm: Copied from Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h.
+        (WTR::UIScriptController::doAsyncTask):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        * TestRunnerShared/Bindings/JSWrappable.h: Renamed from Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h.
+        (WTR::JSWrappable::~JSWrappable):
+        (WTR::JSValueMakeStringOrNull):
+        * TestRunnerShared/Bindings/JSWrapper.cpp: Renamed from Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp.
+        (WTR::JSWrapper::wrap):
+        (WTR::JSWrapper::unwrap):
+        (WTR::unwrapObject):
+        (WTR::JSWrapper::initialize):
+        (WTR::JSWrapper::finalize):
+        * TestRunnerShared/Bindings/JSWrapper.h: Renamed from Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h.
+        (WTR::toJS):
+        (WTR::setProperty):
+        * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: Renamed from Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl.
+        * TestRunnerShared/UIScriptContext/UIScriptContext.cpp: Renamed from Tools/WebKitTestRunner/UIScriptContext/UIScriptContext.cpp.
+        * TestRunnerShared/UIScriptContext/UIScriptContext.h: Renamed from Tools/WebKitTestRunner/UIScriptContext/UIScriptContext.h.
+        (WTR::UIScriptContext::currentParentCallbackIsPendingCompletion):
+        * TestRunnerShared/UIScriptContext/UIScriptController.cpp: Renamed from Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp.
+        * TestRunnerShared/UIScriptContext/UIScriptController.h: Renamed from Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h.
+        * WebKitTestRunner/CMakeLists.txt:
+        * WebKitTestRunner/DerivedSources.make:
+        * WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h:
+        (WTR::JSWrappable::~JSWrappable): Deleted.
+        (WTR::JSValueMakeStringOrNull): Deleted.
+        * WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp:
+        (WTR::JSWrapper::wrap): Deleted.
+        (WTR::JSWrapper::unwrap): Deleted.
+        (WTR::unwrapObject): Deleted.
+        (WTR::JSWrapper::initialize): Deleted.
+        (WTR::JSWrapper::finalize): Deleted.
+        * WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h:
+        (WTR::toJS): Deleted.
+        (WTR::setProperty): Deleted.
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::runUISideScript):
+        (WTR::TestInvocation::uiScriptDidComplete):
+        * WebKitTestRunner/TestInvocation.h:
+        * WebKitTestRunner/UIScriptContext/UIScriptContext.cpp: Moved
+        * WebKitTestRunner/UIScriptContext/UIScriptContext.h: Moved
+        * WebKitTestRunner/UIScriptContext/UIScriptController.cpp: Moved
+        * WebKitTestRunner/UIScriptContext/UIScriptController.h: Moved
+        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+        * WebKitTestRunner/config.h:
+        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+        (WTR::UIScriptController::contentVisibleRect):
+
 2016-08-23  Saam Barati  <sbarati@apple.com>
 
         JSC should have a "microbenchmarks" directory instead of "regress" directory
diff --git a/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm b/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm
new file mode 100644 (file)
index 0000000..e098835
--- /dev/null
@@ -0,0 +1,569 @@
+# Copyright (C) 2016 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use warnings;
+use File::Spec;
+
+package CodeGeneratorDumpRenderTree;
+
+sub new
+{
+    my ($class, $codeGenerator, $writeDependencies, $verbose, $idlFilePath) = @_;
+
+    my $reference = {
+        codeGenerator => $codeGenerator,
+        idlFilePath => $idlFilePath,
+    };
+
+    bless($reference, $class);
+    return $reference;
+}
+
+sub GenerateInterface
+{
+}
+
+sub WriteData
+{
+    my ($self, $interface, $outputDir) = @_;
+
+    foreach my $file ($self->_generateHeaderFile($interface), $self->_generateImplementationFile($interface)) {
+        open(FILE, ">", File::Spec->catfile($outputDir, $$file{name})) or die "Failed to open $$file{name} for writing: $!";
+        print FILE @{$$file{contents}};
+        close(FILE) or die "Failed to close $$file{name} after writing: $!";
+    }
+}
+
+sub _className
+{
+    my ($idlType) = @_;
+
+    return "JS" . _implementationClassName($idlType);
+}
+
+sub _classRefGetter
+{
+    my ($self, $idlType) = @_;
+    return $$self{codeGenerator}->WK_lcfirst(_implementationClassName($idlType)) . "Class";
+}
+
+sub _parseLicenseBlock
+{
+    my ($fileHandle) = @_;
+
+    my ($copyright, $readCount, $buffer, $currentCharacter, $previousCharacter);
+    my $startSentinel = "/*";
+    my $lengthOfStartSentinel = length($startSentinel);
+    $readCount = read($fileHandle, $buffer, $lengthOfStartSentinel);
+    return "" if ($readCount < $lengthOfStartSentinel || $buffer ne $startSentinel);
+    $copyright = $buffer;
+
+    while ($readCount = read($fileHandle, $currentCharacter, 1)) {
+        $copyright .= $currentCharacter;
+        return $copyright if $currentCharacter eq "/" && $previousCharacter eq "*";
+        $previousCharacter = $currentCharacter;
+    }
+
+    return "";
+}
+
+sub _parseLicenseBlockFromFile
+{
+    my ($path) = @_;
+    open my $fileHandle, "<", $path or die "Failed to open $path for reading: $!";
+    my $licenseBlock = _parseLicenseBlock($fileHandle);
+    close($fileHandle);
+    return $licenseBlock;
+}
+
+sub _defaultLicenseBlock
+{
+    return <<EOF;
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+EOF
+}
+
+sub _licenseBlock
+{
+    my ($self) = @_;
+    return $self->{licenseBlock} if $self->{licenseBlock};
+
+    my $licenseBlock = _parseLicenseBlockFromFile($self->{idlFilePath}) || _defaultLicenseBlock();
+    $self->{licenseBlock} = $licenseBlock;
+    return $licenseBlock;
+}
+
+sub _generateHeaderFile
+{
+    my ($self, $interface) = @_;
+
+    my @contents = ();
+
+    my $idlType = $interface->name;
+    my $className = _className($idlType);
+    my $implementationClassName = _implementationClassName($idlType);
+    my $filename = $className . ".h";
+
+    push(@contents, $self->_licenseBlock());
+
+    my $parentClassName = _parentClassName($interface);
+
+    push(@contents, <<EOF);
+
+#ifndef ${className}_h
+#define ${className}_h
+
+#include "${parentClassName}.h"
+EOF
+    push(@contents, <<EOF);
+
+namespace WTR {
+
+class ${implementationClassName};
+
+class ${className} : public ${parentClassName} {
+public:
+    static JSClassRef @{[$self->_classRefGetter($idlType)]}();
+
+private:
+    static const JSStaticFunction* staticFunctions();
+    static const JSStaticValue* staticValues();
+EOF
+
+    if (my @functions = @{$interface->functions}) {
+        push(@contents, "\n    // Functions\n\n");
+        foreach my $function (@functions) {
+            push(@contents, "    static JSValueRef @{[$function->signature->name]}(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*);\n");
+        }
+    }
+
+    if (my @attributes = @{$interface->attributes}) {
+        push(@contents, "\n    // Attributes\n\n");
+        foreach my $attribute (@attributes) {
+            push(@contents, "    static JSValueRef @{[$self->_getterName($attribute)]}(JSContextRef, JSObjectRef, JSStringRef, JSValueRef*);\n");
+            push(@contents, "    static bool @{[$self->_setterName($attribute)]}(JSContextRef, JSObjectRef, JSStringRef, JSValueRef, JSValueRef*);\n") unless $attribute->isReadOnly;
+        }
+    }
+
+    push(@contents, <<EOF);
+};
+    
+${implementationClassName}* to${implementationClassName}(JSContextRef, JSValueRef);
+
+} // namespace WTR
+
+#endif // ${className}_h
+EOF
+
+    return { name => $filename, contents => \@contents };
+}
+
+sub _generateImplementationFile
+{
+    my ($self, $interface) = @_;
+
+    my @contentsPrefix = ();
+    my %contentsIncludes = ();
+    my @contents = ();
+
+    my $idlType = $interface->name;
+    my $className = _className($idlType);
+    my $implementationClassName = _implementationClassName($idlType);
+    my $filename = $className . ".cpp";
+
+    push(@contentsPrefix, $self->_licenseBlock());
+
+    my $classRefGetter = $self->_classRefGetter($idlType);
+    my $parentClassName = _parentClassName($interface);
+
+    $contentsIncludes{"${className}.h"} = 1;
+    $contentsIncludes{"${implementationClassName}.h"} = 1;
+
+    push(@contentsPrefix, <<EOF);
+
+EOF
+
+    push(@contents, <<EOF);
+#include <JavaScriptCore/JSRetainPtr.h>
+#include <wtf/GetPtr.h>
+
+namespace WTR {
+
+${implementationClassName}* to${implementationClassName}(JSContextRef context, JSValueRef value)
+{
+    if (!context || !value || !${className}::${classRefGetter}() || !JSValueIsObjectOfClass(context, value, ${className}::${classRefGetter}()))
+        return 0;
+    return static_cast<${implementationClassName}*>(JSWrapper::unwrap(context, value));
+}
+
+JSClassRef ${className}::${classRefGetter}()
+{
+    static JSClassRef jsClass;
+    if (!jsClass) {
+        JSClassDefinition definition = kJSClassDefinitionEmpty;
+        definition.className = "${idlType}";
+        definition.parentClass = @{[$self->_parentClassRefGetterExpression($interface)]};
+        definition.staticValues = staticValues();
+        definition.staticFunctions = staticFunctions();
+EOF
+
+    push(@contents, "        definition.initialize = initialize;\n") unless _parentInterface($interface);
+    push(@contents, "        definition.finalize = finalize;\n") unless _parentInterface($interface);
+
+    push(@contents, <<EOF);
+        jsClass = JSClassCreate(&definition);
+    }
+    return jsClass;
+}
+
+EOF
+
+    push(@contents, $self->_staticFunctionsGetterImplementation($interface), "\n");
+    push(@contents, $self->_staticValuesGetterImplementation($interface));
+
+    if (my @functions = @{$interface->functions}) {
+        push(@contents, "\n// Functions\n");
+
+        foreach my $function (@functions) {
+            push(@contents, <<EOF);
+
+JSValueRef ${className}::@{[$function->signature->name]}(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    ${implementationClassName}* impl = to${implementationClassName}(context, thisObject);
+    if (!impl)
+        return JSValueMakeUndefined(context);
+
+EOF
+            my $functionCall;
+            if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
+                $functionCall = "impl->" . $function->signature->name . "(context, argumentCount, arguments, exception)";
+            } else {
+                my @parameters = ();
+                my @specifiedParameters = @{$function->parameters};
+
+                $self->_includeHeaders(\%contentsIncludes, $function->signature->type, $function->signature);
+
+                if ($function->signature->extendedAttributes->{"PassContext"}) {
+                    push(@parameters, "context");
+                }
+
+                foreach my $i (0..$#specifiedParameters) {
+                    my $parameter = $specifiedParameters[$i];
+
+                    $self->_includeHeaders(\%contentsIncludes, $idlType, $parameter);
+
+                    push(@contents, "    " . $self->_platformTypeVariableDeclaration($parameter, $parameter->name, "arguments[$i]", "argumentCount > $i") . "\n");
+                    
+                    push(@parameters, $self->_parameterExpression($parameter));
+                }
+
+                $functionCall = "impl->" . $function->signature->name . "(" . join(", ", @parameters) . ")";
+            }
+            
+            push(@contents, "    ${functionCall};\n\n") if $function->signature->type eq "void";
+            push(@contents, "    return " . $self->_returnExpression($function->signature, $functionCall) . ";\n}\n");
+        }
+    }
+
+    if (my @attributes = @{$interface->attributes}) {
+        push(@contents, "\n// Attributes\n");
+        foreach my $attribute (@attributes) {
+            $self->_includeHeaders(\%contentsIncludes, $attribute->signature->type, $attribute->signature);
+
+            my $getterName = $self->_getterName($attribute);
+            my $getterExpression = "impl->${getterName}()";
+
+            push(@contents, <<EOF);
+
+JSValueRef ${className}::${getterName}(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception)
+{
+    ${implementationClassName}* impl = to${implementationClassName}(context, object);
+    if (!impl)
+        return JSValueMakeUndefined(context);
+
+    return @{[$self->_returnExpression($attribute->signature, $getterExpression)]};
+}
+EOF
+
+            unless ($attribute->isReadOnly) {
+                push(@contents, <<EOF);
+
+bool ${className}::@{[$self->_setterName($attribute)]}(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef value, JSValueRef* exception)
+{
+    ${implementationClassName}* impl = to${implementationClassName}(context, object);
+    if (!impl)
+        return false;
+
+EOF
+
+                my $platformValue = $self->_platformTypeConstructor($attribute->signature, "value");
+
+                push(@contents, <<EOF);
+    impl->@{[$self->_setterName($attribute)]}(${platformValue});
+
+    return true;
+}
+EOF
+            }
+        }
+    }
+
+    push(@contents, <<EOF);
+
+} // namespace WTR
+
+EOF
+
+    unshift(@contents, map { "#include \"$_\"\n" } sort keys(%contentsIncludes));
+    unshift(@contents, "#include \"config.h\"\n");
+    unshift(@contents, @contentsPrefix);
+
+    return { name => $filename, contents => \@contents };
+}
+
+sub _getterName
+{
+    my ($self, $attribute) = @_;
+
+    my $signature = $attribute->signature;
+    my $name = $signature->name;
+
+    return $name;
+}
+
+sub _includeHeaders
+{
+    my ($self, $headers, $idlType, $signature) = @_;
+
+    return unless defined $idlType;
+    return if $idlType eq "boolean";
+    return if $idlType eq "object";
+    return if $$self{codeGenerator}->IsNonPointerType($idlType);
+    return if $$self{codeGenerator}->IsStringType($idlType);
+
+    $$headers{_className($idlType) . ".h"} = 1;
+    $$headers{_implementationClassName($idlType) . ".h"} = 1;
+}
+
+sub _implementationClassName
+{
+    my ($idlType) = @_;
+
+    return $idlType;
+}
+
+sub _parentClassName
+{
+    my ($interface) = @_;
+
+    my $parentInterface = _parentInterface($interface);
+    return $parentInterface ? _className($parentInterface) : "JSWrapper";
+}
+
+sub _parentClassRefGetterExpression
+{
+    my ($self, $interface) = @_;
+
+    my $parentInterface = _parentInterface($interface);
+    return $parentInterface ? $self->_classRefGetter($parentInterface) . "()" : "0";
+}
+
+sub _parentInterface
+{
+    my ($interface) = @_;
+    return $interface->parent;
+}
+
+sub _platformType
+{
+    my ($self, $idlType, $signature) = @_;
+
+    return undef unless defined $idlType;
+
+    return "bool" if $idlType eq "boolean";
+    return "JSValueRef" if $idlType eq "object";
+    return "JSRetainPtr<JSStringRef>" if $$self{codeGenerator}->IsStringType($idlType);
+    return "double" if $$self{codeGenerator}->IsNonPointerType($idlType);
+    return _implementationClassName($idlType);
+}
+
+sub _platformTypeConstructor
+{
+    my ($self, $signature, $argumentName) = @_;
+
+    my $idlType = $signature->type;
+
+    return "JSValueToBoolean(context, $argumentName)" if $idlType eq "boolean";
+    return "$argumentName" if $idlType eq "object";
+    return "JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, $argumentName, 0))" if $$self{codeGenerator}->IsStringType($idlType);
+    return "JSValueToNumber(context, $argumentName, 0)" if $$self{codeGenerator}->IsNonPointerType($idlType);
+    return "to" . _implementationClassName($idlType) . "(context, $argumentName)";
+}
+
+sub _platformTypeVariableDeclaration
+{
+    my ($self, $signature, $variableName, $argumentName, $condition) = @_;
+
+    my $platformType = $self->_platformType($signature->type, $signature);
+    my $constructor = $self->_platformTypeConstructor($signature, $argumentName);
+
+    my %nonPointerTypes = (
+        "bool" => 1,
+        "double" => 1,
+        "JSRetainPtr<JSStringRef>" => 1,
+        "JSValueRef" => 1,
+    );
+
+    my $nullValue = "0";
+    if ($platformType eq "JSValueRef") {
+        $nullValue = "JSValueMakeUndefined(context)";
+    } elsif (defined $nonPointerTypes{$platformType} && $platformType ne "double") {
+        $nullValue = "$platformType()";
+    }
+
+    $platformType .= "*" unless defined $nonPointerTypes{$platformType};
+
+    return "$platformType $variableName = $condition && $constructor;" if $condition && $platformType eq "bool";
+    return "$platformType $variableName = $condition ? $constructor : $nullValue;" if $condition;
+    return "$platformType $variableName = $constructor;";
+}
+
+sub _returnExpression
+{
+    my ($self, $signature, $expression) = @_;
+
+    my $returnIDLType = $signature->type;
+
+    return "JSValueMakeUndefined(context)" if $returnIDLType eq "void";
+    return "JSValueMakeBoolean(context, ${expression})" if $returnIDLType eq "boolean";
+    return "${expression}" if $returnIDLType eq "object";
+    return "JSValueMakeNumber(context, ${expression})" if $$self{codeGenerator}->IsNonPointerType($returnIDLType);
+    return "JSValueMakeStringOrNull(context, ${expression}.get())" if $$self{codeGenerator}->IsStringType($returnIDLType);
+    return "toJS(context, WTF::getPtr(${expression}))";
+}
+
+sub _parameterExpression
+{
+    my ($self, $parameter) = @_;
+
+    my $idlType = $parameter->type;
+    my $name = $parameter->name;
+
+    return "${name}.get()" if $$self{codeGenerator}->IsStringType($idlType);
+    return $name;
+}
+
+sub _setterName
+{
+    my ($self, $attribute) = @_;
+
+    my $name = $attribute->signature->name;
+
+    return "set" . $$self{codeGenerator}->WK_ucfirst($name);
+}
+
+sub _staticFunctionsGetterImplementation
+{
+    my ($self, $interface) = @_;
+
+    my $mapFunction = sub {
+        my $name = $_->signature->name;
+        my @attributes = qw(kJSPropertyAttributeDontDelete kJSPropertyAttributeReadOnly);
+        push(@attributes, "kJSPropertyAttributeDontEnum") if $_->signature->extendedAttributes->{"DontEnum"};
+
+        return  "{ \"$name\", $name, " . join(" | ", @attributes) . " }";
+    };
+
+    return $self->_staticFunctionsOrValuesGetterImplementation($interface, "function", "{ 0, 0, 0 }", $mapFunction, $interface->functions);
+}
+
+sub _staticFunctionsOrValuesGetterImplementation
+{
+    my ($self, $interface, $functionOrValue, $arrayTerminator, $mapFunction, $functionsOrAttributes) = @_;
+
+    my $className = _className($interface->name);
+    my $uppercaseFunctionOrValue = $$self{codeGenerator}->WK_ucfirst($functionOrValue);
+
+    my $result = <<EOF;
+const JSStatic${uppercaseFunctionOrValue}* ${className}::static${uppercaseFunctionOrValue}s()
+{
+EOF
+
+    my @initializers = map(&$mapFunction, @{$functionsOrAttributes});
+    return $result . "    return 0;\n}\n" unless @initializers;
+
+    $result .= <<EOF
+    static const JSStatic${uppercaseFunctionOrValue} ${functionOrValue}s[] = {
+        @{[join(",\n        ", @initializers)]},
+        ${arrayTerminator}
+    };
+    return ${functionOrValue}s;
+}
+EOF
+}
+
+sub _staticValuesGetterImplementation
+{
+    my ($self, $interface) = @_;
+
+    my $mapFunction = sub {
+        return if $_->signature->extendedAttributes->{"NoImplementation"};
+
+        my $attributeName = $_->signature->name;
+        my $getterName = $self->_getterName($_);
+        my $setterName = $_->isReadOnly ? "0" : $self->_setterName($_);
+        my @attributes = qw(kJSPropertyAttributeDontDelete);
+        push(@attributes, "kJSPropertyAttributeReadOnly") if $_->isReadOnly;
+        push(@attributes, "kJSPropertyAttributeDontEnum") if $_->signature->extendedAttributes->{"DontEnum"};
+
+        return "{ \"$attributeName\", $getterName, $setterName, " . join(" | ", @attributes) . " }";
+    };
+
+    return $self->_staticFunctionsOrValuesGetterImplementation($interface, "value", "{ 0, 0, 0, 0 }", $mapFunction, $interface->attributes);
+}
+
+1;
index d345ccc..06caa28 100644 (file)
@@ -1,3 +1,8 @@
+set(WEBKIT_TESTRUNNER_SHARED_DIR "${TOOLS_DIR}/TestRunnerShared/")
+set(WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR "${TOOLS_DIR}/TestRunnerShared/UIScriptContext")
+
+file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/DumpRenderTree)
+
 set(DumpRenderTree_SOURCES
     AccessibilityController.cpp
     AccessibilityTextMarker.cpp
@@ -9,6 +14,9 @@ set(DumpRenderTree_SOURCES
     PixelDumpSupport.cpp
     TestRunner.cpp
     WorkQueue.cpp
+    ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/UIScriptContext.cpp
+    ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/UIScriptController.cpp
+    ${WEBKIT_TESTRUNNER_SHARED_DIR}/Bindings/JSWrapper.cpp
 )
 
 set(DumpRenderTree_LIBRARIES
@@ -58,6 +66,9 @@ set(DumpRenderTree_INCLUDE_DIRECTORIES
     ${JAVASCRIPTCORE_DIR}/ForwardingHeaders
     ${DERIVED_SOURCES_DIR}/ForwardingHeaders
     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
+    ${DERIVED_SOURCES_DIR}/DumpRenderTree
+    ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}
+    ${WEBKIT_TESTRUNNER_SHARED_DIR}/Bindings
     ${TOOLS_DIR}/DumpRenderTree
     ${WTF_DIR}
     ${CMAKE_SOURCE_DIR}/Source
@@ -103,6 +114,18 @@ set(TestNetscapePlugin_LIBRARIES
     WebCoreTestSupport
 )
 
+set(DumpRenderTree_IDL_FILES
+    "${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/Bindings/UIScriptController.idl"
+)
+
+GENERATE_BINDINGS(DumpRenderTree_SOURCES
+    "${DumpRenderTree_IDL_FILES}"
+    "${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/Bindings"
+    "--include=${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/Bindings"
+    "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}"
+    ${DERIVED_SOURCES_DIR}/DumpRenderTree JS DumpRenderTree cpp
+    ${WEBCORE_DIR}/bindings/scripts/IDLAttributes.txt)
+
 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
 
 include_directories(${DumpRenderTree_INCLUDE_DIRECTORIES})
diff --git a/Tools/DumpRenderTree/DerivedSources.make b/Tools/DumpRenderTree/DerivedSources.make
new file mode 100644 (file)
index 0000000..05bffef
--- /dev/null
@@ -0,0 +1,50 @@
+# Copyright (C) 2016 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+UISCRIPTCONTEXT_DIR = $(DumpRenderTree)/../TestRunnerShared/UIScriptContext/Bindings
+
+VPATH = \
+    $(UISCRIPTCONTEXT_DIR) \
+#
+
+UICONTEXT_INTERFACES = \
+    UIScriptController \
+#
+
+SCRIPTS = \
+    $(WebCoreScripts)/CodeGenerator.pm \
+    $(DumpRenderTree)/Bindings/CodeGeneratorDumpRenderTree.pm \
+    $(WebCoreScripts)/IDLParser.pm \
+    $(WebCoreScripts)/generate-bindings.pl \
+#
+
+.PHONY : all
+
+JS%.h JS%.cpp : %.idl $(SCRIPTS)
+       @echo Generating bindings for $*...
+       @perl -I $(WebCoreScripts) -I $(UISCRIPTCONTEXT_DIR) -I $(DumpRenderTree)/Bindings $(WebCoreScripts)/generate-bindings.pl --defines "" --include $(UISCRIPTCONTEXT_DIR) --outputDir . --generator DumpRenderTree $<
+
+all : \
+    $(UICONTEXT_INTERFACES:%=JS%.h) \
+    $(UICONTEXT_INTERFACES:%=JS%.cpp) \
+#
index a802893..3a3d100 100644 (file)
@@ -7,6 +7,17 @@
        objects = {
 
 /* Begin PBXAggregateTarget section */
+               0F18E6F21D6B9CAE0027E547 /* Derived Sources */ = {
+                       isa = PBXAggregateTarget;
+                       buildConfigurationList = 0F18E6FD1D6B9CAE0027E547 /* Build configuration list for PBXAggregateTarget "Derived Sources" */;
+                       buildPhases = (
+                               0F18E7011D6B9CC60027E547 /* ShellScript */,
+                       );
+                       dependencies = (
+                       );
+                       name = "Derived Sources";
+                       productName = All;
+               };
                A84F608D08B1370600E9745F /* All */ = {
                        isa = PBXAggregateTarget;
                        buildConfigurationList = A84F609208B1371400E9745F /* Build configuration list for PBXAggregateTarget "All" */;
 
 /* Begin PBXBuildFile section */
                00F048541A0C3C9A000244DB /* URLRedirect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 00F048531A0C3C9A000244DB /* URLRedirect.cpp */; };
+               0F18E6EC1D6B9C070027E547 /* UIScriptContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F18E6E81D6B9C070027E547 /* UIScriptContext.cpp */; };
+               0F18E6ED1D6B9C070027E547 /* UIScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F18E6EA1D6B9C070027E547 /* UIScriptController.cpp */; };
+               0F18E7061D6BA0230027E547 /* JSUIScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F18E7041D6BA0230027E547 /* JSUIScriptController.cpp */; };
+               0F18E70D1D6BAC8C0027E547 /* UIScriptControllerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F18E70C1D6BAC8C0027E547 /* UIScriptControllerIOS.mm */; };
+               0F18E70F1D6BACB60027E547 /* UIScriptControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F18E70E1D6BACB60027E547 /* UIScriptControllerMac.mm */; };
+               0F18E7131D6BC43A0027E547 /* JSWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F18E7111D6BC43A0027E547 /* JSWrapper.cpp */; };
                0F37A4A711E6628700275F54 /* PluginObjectMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F37A4A611E6628700275F54 /* PluginObjectMac.mm */; };
                0F37A4AA11E6629100275F54 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A752A108AF5D1F00138E45 /* QuartzCore.framework */; };
                0F4E43E31D5C2BAF008EBA5C /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0F4E43E11D5C037A008EBA5C /* Launch.storyboard */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
+               0F18E7021D6B9CFE0027E547 /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = 0F18E6F21D6B9CAE0027E547;
+                       remoteInfo = "Derived Sources";
+               };
                141BF237096A451E00E0753C /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                        containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
                        dstPath = DumpRenderTree.resources;
                        dstSubfolderSpec = 7;
                        files = (
+                               5DB9AC970F722C3600684641 /* AHEM____.TTF in Copy Font Files */,
                                C23EA2081BC9F05100C980B7 /* FontWithFeatures.otf in Copy Font Files */,
                                C23EA2091BC9F05100C980B7 /* FontWithFeatures.ttf in Copy Font Files */,
-                               5DB9AC970F722C3600684641 /* AHEM____.TTF in Copy Font Files */,
                                5DB9AC980F722C3600684641 /* WebKitWeightWatcher100.ttf in Copy Font Files */,
                                5DB9AC990F722C3600684641 /* WebKitWeightWatcher200.ttf in Copy Font Files */,
                                5DB9AC9A0F722C3600684641 /* WebKitWeightWatcher300.ttf in Copy Font Files */,
 
 /* Begin PBXFileReference section */
                00F048531A0C3C9A000244DB /* URLRedirect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = URLRedirect.cpp; sourceTree = "<group>"; };
+               0F18E6E81D6B9C070027E547 /* UIScriptContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UIScriptContext.cpp; path = ../TestRunnerShared/UIScriptContext/UIScriptContext.cpp; sourceTree = "<group>"; };
+               0F18E6E91D6B9C070027E547 /* UIScriptContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIScriptContext.h; path = ../TestRunnerShared/UIScriptContext/UIScriptContext.h; sourceTree = "<group>"; };
+               0F18E6EA1D6B9C070027E547 /* UIScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UIScriptController.cpp; path = ../TestRunnerShared/UIScriptContext/UIScriptController.cpp; sourceTree = "<group>"; };
+               0F18E6EB1D6B9C070027E547 /* UIScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIScriptController.h; path = ../TestRunnerShared/UIScriptContext/UIScriptController.h; sourceTree = "<group>"; };
+               0F18E6F01D6B9C240027E547 /* UIScriptController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = UIScriptController.idl; path = ../TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl; sourceTree = "<group>"; };
+               0F18E6F11D6B9C640027E547 /* DerivedSources.make */ = {isa = PBXFileReference; lastKnownFileType = text; path = DerivedSources.make; sourceTree = "<group>"; };
+               0F18E7041D6BA0230027E547 /* JSUIScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUIScriptController.cpp; sourceTree = "<group>"; };
+               0F18E7051D6BA0230027E547 /* JSUIScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSUIScriptController.h; sourceTree = "<group>"; };
+               0F18E7071D6BA4140027E547 /* CodeGeneratorDumpRenderTree.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = CodeGeneratorDumpRenderTree.pm; path = Bindings/CodeGeneratorDumpRenderTree.pm; sourceTree = "<group>"; };
+               0F18E70C1D6BAC8C0027E547 /* UIScriptControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = UIScriptControllerIOS.mm; path = ios/UIScriptControllerIOS.mm; sourceTree = "<group>"; };
+               0F18E70E1D6BACB60027E547 /* UIScriptControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = UIScriptControllerMac.mm; path = mac/UIScriptControllerMac.mm; sourceTree = "<group>"; };
+               0F18E7101D6BC43A0027E547 /* JSWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWrappable.h; path = ../TestRunnerShared/Bindings/JSWrappable.h; sourceTree = "<group>"; };
+               0F18E7111D6BC43A0027E547 /* JSWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWrapper.cpp; path = ../TestRunnerShared/Bindings/JSWrapper.cpp; sourceTree = "<group>"; };
+               0F18E7121D6BC43A0027E547 /* JSWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWrapper.h; path = ../TestRunnerShared/Bindings/JSWrapper.h; sourceTree = "<group>"; };
                0F37A4A611E6628700275F54 /* PluginObjectMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginObjectMac.mm; sourceTree = "<group>"; };
                0F4E43E11D5C037A008EBA5C /* Launch.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Launch.storyboard; path = ios/Launch.storyboard; sourceTree = "<group>"; };
                141BF233096A44CF00E0753C /* TestNetscapePlugIn.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestNetscapePlugIn.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
                08FB7794FE84155DC02AAC07 /* DumpRenderTree */ = {
                        isa = PBXGroup;
                        children = (
+                               0F18E6F11D6B9C640027E547 /* DerivedSources.make */,
+                               0F18E6E71D6B9BF50027E547 /* UIScriptContext */,
                                A1158D6A18927CE10088C17B /* ios */,
                                A134E53418905E6C00901D06 /* config.h */,
                                1A2FB84C178C80920059FD96 /* DefaultPolicyDelegate.h */,
                                A8D79CE80FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h */,
                                A8D79CE90FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m */,
                                2CE88FA117124CEE00734FC0 /* JavaScriptThreading.cpp */,
+                               0F18E70E1D6BACB60027E547 /* UIScriptControllerMac.mm */,
                                44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */,
                                44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */,
                                440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */,
                        name = DumpRenderTree;
                        sourceTree = "<group>";
                };
+               0F18E6E71D6B9BF50027E547 /* UIScriptContext */ = {
+                       isa = PBXGroup;
+                       children = (
+                               0F18E6EE1D6B9C0C0027E547 /* Bindings */,
+                               0F18E6EF1D6B9C120027E547 /* Derived Sources */,
+                               0F18E6E81D6B9C070027E547 /* UIScriptContext.cpp */,
+                               0F18E6E91D6B9C070027E547 /* UIScriptContext.h */,
+                               0F18E6EA1D6B9C070027E547 /* UIScriptController.cpp */,
+                               0F18E6EB1D6B9C070027E547 /* UIScriptController.h */,
+                       );
+                       name = UIScriptContext;
+                       sourceTree = "<group>";
+               };
+               0F18E6EE1D6B9C0C0027E547 /* Bindings */ = {
+                       isa = PBXGroup;
+                       children = (
+                               0F18E7071D6BA4140027E547 /* CodeGeneratorDumpRenderTree.pm */,
+                               0F18E7101D6BC43A0027E547 /* JSWrappable.h */,
+                               0F18E7111D6BC43A0027E547 /* JSWrapper.cpp */,
+                               0F18E7121D6BC43A0027E547 /* JSWrapper.h */,
+                               0F18E6F01D6B9C240027E547 /* UIScriptController.idl */,
+                       );
+                       name = Bindings;
+                       sourceTree = "<group>";
+               };
+               0F18E6EF1D6B9C120027E547 /* Derived Sources */ = {
+                       isa = PBXGroup;
+                       children = (
+                               0F18E7041D6BA0230027E547 /* JSUIScriptController.cpp */,
+                               0F18E7051D6BA0230027E547 /* JSUIScriptController.h */,
+                       );
+                       name = "Derived Sources";
+                       path = DerivedSources/DumpRenderTree;
+                       sourceTree = BUILT_PRODUCTS_DIR;
+               };
                141BF1F5096A439800E0753C /* TestNetscapePlugIn */ = {
                        isa = PBXGroup;
                        children = (
                                9340995408540CAF007F3BC8 /* DumpRenderTree */,
                                B5A7526708AF4A4A00138E45 /* ImageDiff */,
                                2D403F19150871F9005358D2 /* LayoutTestHelper */,
-                               141BF233096A44CF00E0753C /* TestNetscapePlugIn.plugin */,
-                               A1321C9E188F9A3600125434 /* libDumpRenderTree.a */,
                                A1158D7F18927E7A0088C17B /* DumpRenderTree.app */,
+                               A1321C9E188F9A3600125434 /* libDumpRenderTree.a */,
+                               141BF233096A44CF00E0753C /* TestNetscapePlugIn.plugin */,
                        );
                        name = Products;
                        sourceTree = "<group>";
                        isa = PBXGroup;
                        children = (
                                AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */,
+                               C23EA2061BC9EABA00C980B7 /* FontWithFeatures.otf */,
+                               C23EA2071BC9EABA00C980B7 /* FontWithFeatures.ttf */,
                                375F09710DAC3CB600C8B4E5 /* WebKitWeightWatcher100.ttf */,
                                375F09720DAC3CB600C8B4E5 /* WebKitWeightWatcher200.ttf */,
                                375F09730DAC3CB600C8B4E5 /* WebKitWeightWatcher300.ttf */,
                                375F09770DAC3CB600C8B4E5 /* WebKitWeightWatcher700.ttf */,
                                375F09780DAC3CB600C8B4E5 /* WebKitWeightWatcher800.ttf */,
                                375F09790DAC3CB600C8B4E5 /* WebKitWeightWatcher900.ttf */,
-                               C23EA2061BC9EABA00C980B7 /* FontWithFeatures.otf */,
-                               C23EA2071BC9EABA00C980B7 /* FontWithFeatures.ttf */,
                        );
                        name = Resources;
                        sourceTree = "<group>";
                A1158D6A18927CE10088C17B /* ios */ = {
                        isa = PBXGroup;
                        children = (
-                               0F4E43E11D5C037A008EBA5C /* Launch.storyboard */,
                                4464CABD1C20A07000E5BB55 /* DumpRenderTreeAppMain.mm */,
                                A1158D55189273EB0088C17B /* DumpRenderTreeBrowserView.h */,
                                A1158D56189273EB0088C17B /* DumpRenderTreeBrowserView.mm */,
                                A19317FC1892855F001C52B1 /* Info.plist */,
+                               0F4E43E11D5C037A008EBA5C /* Launch.storyboard */,
+                               0F18E70C1D6BAC8C0027E547 /* UIScriptControllerIOS.mm */,
                        );
                        name = ios;
                        sourceTree = "<group>";
                A803FF6409CAACC1009B2A37 /* Frameworks */ = {
                        isa = PBXGroup;
                        children = (
-                               1CB6741F195BAE7B000F35B5 /* CoreText.framework */,
-                               1A7961061803454C00FE42CD /* IOKit.framework */,
                                BCB284B20CFA82CB007E533E /* ApplicationServices.framework */,
                                AE8257EF08D22389000507AB /* Carbon.framework */,
                                A84F608908B136DA00E9745F /* Cocoa.framework */,
+                               1CB6741F195BAE7B000F35B5 /* CoreText.framework */,
+                               1A7961061803454C00FE42CD /* IOKit.framework */,
                                A817090308B164D300CCB9FB /* JavaScriptCore.framework */,
                                5DE8AE4313A2C15800D6A37D /* libWebCoreTestSupport.dylib */,
                                23BCB88F0EA57623003C6289 /* OpenGL.framework */,
                        buildRules = (
                        );
                        dependencies = (
+                               0F18E7031D6B9CFE0027E547 /* PBXTargetDependency */,
                        );
                        name = "DumpRenderTree (Library)";
                        productName = DumpRenderTree;
                        projectRoot = "";
                        targets = (
                                A84F608D08B1370600E9745F /* All */,
+                               0F18E6F21D6B9CAE0027E547 /* Derived Sources */,
                                A1321C9D188F9A3600125434 /* DumpRenderTree (Library) */,
                                9340994A08540CAE007F3BC8 /* DumpRenderTree */,
                                A1158D7E18927E7A0088C17B /* DumpRenderTree.app */,
                };
 /* End PBXResourcesBuildPhase section */
 
+/* Begin PBXShellScriptBuildPhase section */
+               0F18E7011D6B9CC60027E547 /* ShellScript */ = {
+                       isa = PBXShellScriptBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       inputPaths = (
+                       );
+                       outputPaths = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+                       shellPath = /bin/sh;
+                       shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/DumpRenderTree\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/DumpRenderTree\"\n\nexport DumpRenderTree=\"${SRCROOT}\"\nexport WebCoreScripts=\"${WEBCORE_PRIVATE_HEADERS_DIR}\"\n\nif [ ! $CC ]; then\n    export CC=\"`xcrun -find clang`\"\nfi\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" ]; then\n    make -f \"${DumpRenderTree}/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.activecpu`\nfi\n";
+               };
+/* End PBXShellScriptBuildPhase section */
+
 /* Begin PBXSourcesBuildPhase section */
                141BF21C096A441D00E0753C /* Sources */ = {
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
                                1A66C35114576A920099A115 /* ContentsScaleFactor.cpp in Sources */,
-                               1A4CCD4F171375A300981040 /* ToStringAndValueOfObject.cpp in Sources */,
                                1A31EB3813466AC100017372 /* ConvertPoint.cpp in Sources */,
                                1A215BE711F27658008AD0F5 /* DocumentOpenInDestroyStream.cpp in Sources */,
                                C0E720751281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp in Sources */,
                                51CACBD815D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp in Sources */,
                                4AD6A11413C8124000EA9737 /* FormValue.cpp in Sources */,
                                1AFF66BC137DEFD200791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp in Sources */,
-                               520206CF1A0ADA5900AD5154 /* SetMuted.cpp in Sources */,
                                1A5CC1F5137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp in Sources */,
                                1A3E28AA1311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp in Sources */,
                                1AD4CB2212A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp in Sources */,
                                515F429C15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp in Sources */,
                                1A215A8111F2609C008AD0F5 /* PluginTest.cpp in Sources */,
                                1A1E4298141141C400388758 /* PrivateBrowsing.cpp in Sources */,
+                               520206CF1A0ADA5900AD5154 /* SetMuted.cpp in Sources */,
                                5106803E15CC7B10001A8A23 /* SlowNPPNew.cpp in Sources */,
                                1A14C8A51406DE0400B254F7 /* SupportsCarbonEventModel.cpp in Sources */,
                                1AC6C84B0D07638600CD3161 /* TestObject.cpp in Sources */,
+                               1A4CCD4F171375A300981040 /* ToStringAndValueOfObject.cpp in Sources */,
                                00F048541A0C3C9A000244DB /* URLRedirect.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        isa = PBXSourcesBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               A134E53618905EFF00901D06 /* AccessibilityCommonMac.mm in Sources */,
                                BCD08B3A0E1057EF00A7D0C1 /* AccessibilityController.cpp in Sources */,
                                AA5A15EF16E15CD000F7C561 /* AccessibilityControllerIOS.mm in Sources */,
                                BCD08B710E1059D200A7D0C1 /* AccessibilityControllerMac.mm in Sources */,
                                80045AEE147718E7008290A8 /* AccessibilityNotificationHandler.mm in Sources */,
                                29CFBA11122736E600BC30C0 /* AccessibilityTextMarker.cpp in Sources */,
+                               A9BB7C5C1C505278002C525B /* AccessibilityTextMarkerIOS.mm in Sources */,
                                29CFBA2E12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm in Sources */,
                                BC0E24E10E2D9451001B6BC2 /* AccessibilityUIElement.cpp in Sources */,
                                AA5A15F016E15CD000F7C561 /* AccessibilityUIElementIOS.mm in Sources */,
-                               A134E53618905EFF00901D06 /* AccessibilityCommonMac.mm in Sources */,
                                BC0E26150E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm in Sources */,
                                BCA18B390C9B021900114369 /* AppleScriptController.m in Sources */,
                                A8B91BFD0CF522B4008F91FF /* CheckedMalloc.cpp in Sources */,
                                53CBB832134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp in Sources */,
                                1A2FB84F178C80930059FD96 /* DefaultPolicyDelegate.m in Sources */,
                                BCA18C470C9B5B9400114369 /* DumpRenderTree.mm in Sources */,
+                               A1158D581892740C0088C17B /* DumpRenderTreeBrowserView.mm in Sources */,
                                9830F31F15C81181005AB206 /* DumpRenderTreeCommon.cpp in Sources */,
                                BCA18B7B0C9B08F100114369 /* DumpRenderTreeDraggingInfo.mm in Sources */,
-                               A9BB7C5C1C505278002C525B /* AccessibilityTextMarkerIOS.mm in Sources */,
                                A8D79CEB0FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m in Sources */,
                                A8B91ADA0CF3B32F008F91FF /* DumpRenderTreePasteboard.m in Sources */,
                                A8B91ADC0CF3B32F008F91FF /* DumpRenderTreeWindow.mm in Sources */,
                                BCA18B640C9B08C200114369 /* FrameLoadDelegate.mm in Sources */,
                                BCF6C6500C98E9C000AC063E /* GCController.cpp in Sources */,
                                BCA18B230C9B014B00114369 /* GCControllerMac.mm in Sources */,
-                               A1158D581892740C0088C17B /* DumpRenderTreeBrowserView.mm in Sources */,
                                5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */,
                                2CE88FA217124D8C00734FC0 /* JavaScriptThreading.cpp in Sources */,
+                               0F18E7061D6BA0230027E547 /* JSUIScriptController.cpp in Sources */,
+                               0F18E7131D6BC43A0027E547 /* JSWrapper.cpp in Sources */,
                                E1B7816511AF31B7007E1BC2 /* MockGeolocationProvider.mm in Sources */,
                                31117B3D15D9A56A00163BC8 /* MockWebNotificationProvider.mm in Sources */,
                                BCA18B720C9B08DB00114369 /* NavigationController.m in Sources */,
                                BCA18B320C9B01B400114369 /* ObjCController.m in Sources */,
                                BCA18B7E0C9B08F100114369 /* ObjCPlugin.m in Sources */,
                                BCA18B800C9B08F100114369 /* ObjCPluginFunction.m in Sources */,
-                               A1158D59189274360088C17B /* PixelDumpSupportIOS.mm in Sources */,
                                8465E2C70FFA8DF2003B8342 /* PixelDumpSupport.cpp in Sources */,
                                BCB284CD0CFA83C8007E533E /* PixelDumpSupportCG.cpp in Sources */,
+                               A1158D59189274360088C17B /* PixelDumpSupportIOS.mm in Sources */,
                                BCB284D60CFA83D1007E533E /* PixelDumpSupportMac.mm in Sources */,
                                BCA18B660C9B08C200114369 /* PolicyDelegate.mm in Sources */,
                                BCA18B680C9B08C200114369 /* ResourceLoadDelegate.mm in Sources */,
                                BCA18B240C9B014B00114369 /* TestRunnerMac.mm in Sources */,
                                BCA18B490C9B02C400114369 /* TextInputController.m in Sources */,
                                BCA18B6A0C9B08C200114369 /* UIDelegate.mm in Sources */,
+                               0F18E6EC1D6B9C070027E547 /* UIScriptContext.cpp in Sources */,
+                               0F18E6ED1D6B9C070027E547 /* UIScriptController.cpp in Sources */,
+                               0F18E70D1D6BAC8C0027E547 /* UIScriptControllerIOS.mm in Sources */,
+                               0F18E70F1D6BACB60027E547 /* UIScriptControllerMac.mm in Sources */,
                                4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.cpp in Sources */,
                                440590711268453800CFD48D /* WebArchiveDumpSupportMac.mm in Sources */,
                                BC9D90240C97472E0099A4A3 /* WorkQueue.cpp in Sources */,
 /* End PBXSourcesBuildPhase section */
 
 /* Begin PBXTargetDependency section */
+               0F18E7031D6B9CFE0027E547 /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = 0F18E6F21D6B9CAE0027E547 /* Derived Sources */;
+                       targetProxy = 0F18E7021D6B9CFE0027E547 /* PBXContainerItemProxy */;
+               };
                141BF238096A451E00E0753C /* PBXTargetDependency */ = {
                        isa = PBXTargetDependency;
                        target = 141BF21E096A441D00E0753C /* TestNetscapePlugIn */;
 /* End PBXTargetDependency section */
 
 /* Begin XCBuildConfiguration section */
+               0F18E6FE1D6B9CAE0027E547 /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                       };
+                       name = Debug;
+               };
+               0F18E6FF1D6B9CAE0027E547 /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                       };
+                       name = Release;
+               };
+               0F18E7001D6B9CAE0027E547 /* Production */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                       };
+                       name = Production;
+               };
                141BF222096A441E00E0753C /* Debug */ = {
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BCB283DE0CFA7C20007E533E /* TestNetscapePlugIn.xcconfig */;
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
+               0F18E6FD1D6B9CAE0027E547 /* Build configuration list for PBXAggregateTarget "Derived Sources" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               0F18E6FE1D6B9CAE0027E547 /* Debug */,
+                               0F18E6FF1D6B9CAE0027E547 /* Release */,
+                               0F18E7001D6B9CAE0027E547 /* Production */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Production;
+               };
                141BF221096A441E00E0753C /* Build configuration list for PBXNativeTarget "TestNetscapePlugIn" */ = {
                        isa = XCConfigurationList;
                        buildConfigurations = (
index bd0d208..b7490a1 100644 (file)
@@ -2004,6 +2004,20 @@ static JSValueRef accummulateLogsForChannel(JSContextRef context, JSObjectRef fu
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef runUIScriptCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount < 1)
+        return JSValueMakeUndefined(context);
+
+    JSRetainPtr<JSStringRef> script = argumentCount > 0 ? JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, arguments[0], 0)) : JSRetainPtr<JSStringRef>();
+    JSValueRef callback = argumentCount > 1 ? arguments[1] : JSValueMakeUndefined(context);
+
+    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
+    controller->runUIScript(context, script.get(), callback);
+
+    return JSValueMakeUndefined(context);
+}
+
 static void testRunnerObjectFinalize(JSObjectRef object)
 {
     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(object));
@@ -2208,6 +2222,7 @@ JSStaticFunction* TestRunner::staticFunctions()
         { "numberOfDFGCompiles", numberOfDFGCompiles, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "neverInlineFunction", neverInlineFunction, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "accummulateLogsForChannel", accummulateLogsForChannel, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "runUIScript", runUIScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "imageCountInGeneralPasteboard", imageCountInGeneralPasteboardCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { 0, 0, 0 }
     };
@@ -2306,7 +2321,95 @@ void TestRunner::setAccummulateLogsForChannel(JSStringRef channel)
     WebCoreTestSupport::setLogChannelToAccumulate({ buffer.get() });
 }
 
+typedef WTF::HashMap<unsigned, JSValueRef> CallbackMap;
+static CallbackMap& callbackMap()
+{
+    static CallbackMap& map = *new CallbackMap;
+    return map;
+}
+
+void TestRunner::cacheTestRunnerCallback(unsigned index, JSValueRef callback)
+{
+    if (!callback)
+        return;
+
+    if (callbackMap().contains(index)) {
+        fprintf(stderr, "FAIL: Tried to install a second TestRunner callback for the same event (id %d)\n", index);
+        return;
+    }
+
+    JSContextRef context = mainFrameJSContext();
+    JSValueProtect(context, callback);
+    callbackMap().add(index, callback);
+}
+
+void TestRunner::callTestRunnerCallback(unsigned index, size_t argumentCount, const JSValueRef arguments[])
+{
+    if (!callbackMap().contains(index))
+        return;
+
+    JSContextRef context = mainFrameJSContext();
+    if (JSObjectRef callback = JSValueToObject(context, callbackMap().take(index), 0)) {
+        JSObjectCallAsFunction(context, callback, JSContextGetGlobalObject(context), argumentCount, arguments, 0);
+        JSValueUnprotect(context, callback);
+    }
+}
+
+void TestRunner::clearTestRunnerCallbacks()
+{
+    JSContextRef context = mainFrameJSContext();
+
+    for (auto& iter : callbackMap()) {
+        if (JSObjectRef callback = JSValueToObject(context, iter.value, 0))
+            JSValueUnprotect(context, callback);
+    }
+
+    callbackMap().clear();
+}
+
+enum {
+    FirstUIScriptCallbackID = 100
+};
+
+static unsigned nextUIScriptCallbackID()
+{
+    static unsigned callbackID = FirstUIScriptCallbackID;
+    return callbackID++;
+}
+
+void TestRunner::runUIScript(JSContextRef context, JSStringRef script, JSValueRef callback)
+{
+    m_pendingUIScriptInvocationData = nullptr;
+
+    unsigned callbackID = nextUIScriptCallbackID();
+    cacheTestRunnerCallback(callbackID, callback);
+
+    if (!m_UIScriptContext)
+        m_UIScriptContext = std::make_unique<WTR::UIScriptContext>(*this);
+
+    String scriptString(JSStringGetCharactersPtr(script), JSStringGetLength(script));
+    m_UIScriptContext->runUIScript(scriptString, callbackID);
+}
+
+void TestRunner::callUIScriptCallback(unsigned callbackID, JSStringRef result)
+{
+    JSContextRef context = mainFrameJSContext();
+    JSValueRef resultValue = JSValueMakeString(context, result);
+    callTestRunnerCallback(callbackID, 1, &resultValue);
+}
+
+void TestRunner::uiScriptDidComplete(const String& result, unsigned callbackID)
+{
+    JSRetainPtr<JSStringRef> stringRef(Adopt, JSStringCreateWithCharacters(result.characters16(), result.length()));
+    callUIScriptCallback(callbackID, stringRef.get());
+}
+
 void TestRunner::setAllowsAnySSLCertificate(bool allowsAnySSLCertificate)
 {
     WebCoreTestSupport::setAllowsAnySSLCertificate(allowsAnySSLCertificate);
 }
+
+void TestRunner::cleanup()
+{
+    clearTestRunnerCallbacks();
+}
index 9c29e03..854ec28 100644 (file)
@@ -29,6 +29,7 @@
 #ifndef TestRunner_h
 #define TestRunner_h
 
+#include "UIScriptContext.h"
 #include <JavaScriptCore/JSObjectRef.h>
 #include <map>
 #include <set>
@@ -37,7 +38,8 @@
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
-class TestRunner : public RefCounted<TestRunner> {
+class TestRunner : public WTR::UIScriptContextDelegate, public RefCounted<TestRunner> {
+    WTF_MAKE_NONCOPYABLE(TestRunner);
 public:
     static PassRefPtr<TestRunner> create(const std::string& testURL, const std::string& expectedPixelHash);
 
@@ -47,7 +49,9 @@ public:
     static const unsigned w3cSVGViewWidth;
     static const unsigned w3cSVGViewHeight;
 
-    ~TestRunner();
+    virtual ~TestRunner();
+    
+    void cleanup();
 
     void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
 
@@ -139,6 +143,8 @@ public:
 
     void setAccummulateLogsForChannel(JSStringRef);
 
+    void runUIScript(JSContextRef, JSStringRef, JSValueRef callback);
+
     // Legacy here refers to the old TestRunner API for handling web notifications, not the legacy web notification API.
     void ignoreLegacyWebNotificationPermissionRequests();
     // Legacy here refers to the old TestRunner API for handling web notifications, not the legacy web notification API.
@@ -366,9 +372,20 @@ public:
 
     unsigned imageCountInGeneralPasteboard() const;
     
+    void callUIScriptCallback(unsigned callbackID, JSStringRef result);
+
 private:
     TestRunner(const std::string& testURL, const std::string& expectedPixelHash);
 
+    JSContextRef mainFrameJSContext();
+
+    // UIScriptContextDelegate
+    void uiScriptDidComplete(const String&, unsigned callbackID) override;
+    
+    void cacheTestRunnerCallback(unsigned index, JSValueRef);
+    void callTestRunnerCallback(unsigned index, size_t argumentCount = 0, const JSValueRef arguments[] = nullptr);
+    void clearTestRunnerCallbacks();
+
     void setGeolocationPermissionCommon(bool allow);
 
     bool m_disallowIncreaseForApplicationCacheQuota;
@@ -439,6 +456,14 @@ private:
 
     std::map<std::string, std::string> m_URLsToRedirect;
 
+    struct UIScriptInvocationData {
+        unsigned callbackID;
+        String scriptString;
+    };
+
+    std::unique_ptr<WTR::UIScriptContext> m_UIScriptContext;
+    UIScriptInvocationData* m_pendingUIScriptInvocationData { nullptr };
+
     static JSClassRef getJSClass();
     static JSStaticValue* staticValues();
     static JSStaticFunction* staticFunctions();
diff --git a/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm b/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm
new file mode 100644 (file)
index 0000000..81501ae
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "UIScriptController.h"
+
+#if PLATFORM(IOS)
+
+#import "UIScriptContext.h"
+
+namespace WTR {
+
+void UIScriptController::doAsyncTask(JSValueRef callback)
+{
+    unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
+
+    dispatch_async(dispatch_get_main_queue(), ^{
+        if (!m_context)
+            return;
+        m_context->asyncTaskComplete(callbackID);
+    });
+}
+
+void UIScriptController::zoomToScale(double scale, JSValueRef callback)
+{
+}
+
+double UIScriptController::zoomScale() const
+{
+    return 1;
+}
+
+void UIScriptController::touchDownAtPoint(long x, long y, long touchCount, JSValueRef callback)
+{
+}
+
+void UIScriptController::liftUpAtPoint(long x, long y, long touchCount, JSValueRef callback)
+{
+}
+
+void UIScriptController::singleTapAtPoint(long x, long y, JSValueRef callback)
+{
+}
+
+void UIScriptController::doubleTapAtPoint(long x, long y, JSValueRef callback)
+{
+}
+
+void UIScriptController::dragFromPointToPoint(long startX, long startY, long endX, long endY, double durationSeconds, JSValueRef callback)
+{
+}
+
+void UIScriptController::typeCharacterUsingHardwareKeyboard(JSStringRef character, JSValueRef callback)
+{
+}
+
+void UIScriptController::keyDownUsingHardwareKeyboard(JSStringRef character, JSValueRef callback)
+{
+}
+
+void UIScriptController::keyUpUsingHardwareKeyboard(JSStringRef character, JSValueRef callback)
+{
+}
+
+void UIScriptController::dismissFormAccessoryView()
+{
+}
+
+void UIScriptController::selectFormAccessoryPickerRow(long rowIndex)
+{
+}
+
+void UIScriptController::scrollToOffset(long, long)
+{
+}
+
+void UIScriptController::keyboardAccessoryBarNext()
+{
+}
+
+void UIScriptController::keyboardAccessoryBarPrevious()
+{
+}
+
+double UIScriptController::minimumZoomScale() const
+{
+    return 1;
+}
+
+double UIScriptController::maximumZoomScale() const
+{
+    return 1;
+}
+
+JSObjectRef UIScriptController::contentVisibleRect() const
+{
+    return nullptr;
+}
+
+void UIScriptController::platformSetDidStartFormControlInteractionCallback()
+{
+}
+
+void UIScriptController::platformSetDidEndFormControlInteractionCallback()
+{
+}
+
+void UIScriptController::platformSetWillBeginZoomingCallback()
+{
+}
+
+void UIScriptController::platformSetDidEndZoomingCallback()
+{
+}
+
+void UIScriptController::platformSetDidShowKeyboardCallback()
+{
+}
+
+void UIScriptController::platformSetDidHideKeyboardCallback()
+{
+}
+
+void UIScriptController::platformSetDidEndScrollingCallback()
+{
+}
+
+void UIScriptController::platformClearAllCallbacks()
+{
+}
+
+}
+
+#endif // PLATFORM(IOS)
index 9eae9aa..fe19db8 100644 (file)
@@ -87,6 +87,12 @@ TARGET_MAC_OS_X_VERSION_MAJOR_13 = 101300;
 
 SDKROOT = macosx.internal;
 
+WEBCORE_PRIVATE_HEADERS_DIR = $(WEBCORE_PRIVATE_HEADERS_DIR_$(CONFIGURATION));
+WEBCORE_PRIVATE_HEADERS_DIR_Release = $(WEBCORE_PRIVATE_HEADERS_DIR_engineering);
+WEBCORE_PRIVATE_HEADERS_DIR_Debug = $(WEBCORE_PRIVATE_HEADERS_DIR_engineering);
+WEBCORE_PRIVATE_HEADERS_DIR_Production = $(PRODUCTION_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders;
+WEBCORE_PRIVATE_HEADERS_DIR_engineering = $(BUILT_PRODUCTS_DIR)/WebCore.framework/PrivateHeaders;
+
 WEBKIT_SYSTEM_INTERFACE_LIBRARY = WebKitSystemInterface
 
 SUPPORTED_PLATFORMS = iphoneos iphonesimulator macosx tvos tvsimulator watchos watchsimulator;
index d4e750c..99757ee 100644 (file)
@@ -2101,6 +2101,7 @@ static void runTest(const string& inputLine)
     ASSERT(CFArrayGetCount(openWindowsRef) == 1);
     ASSERT(CFArrayGetValueAtIndex(openWindowsRef, 0) == [[mainFrame webView] window]);
 
+    gTestRunner->cleanup();
     gTestRunner = nullptr;
 
     if (ignoreWebCoreNodeLeaks)
index 445f449..76dd6e4 100644 (file)
@@ -132,6 +132,11 @@ TestRunner::~TestRunner()
 {
 }
 
+JSContextRef TestRunner::mainFrameJSContext()
+{
+    return [mainFrame globalContext];
+}
+
 void TestRunner::addDisallowedURL(JSStringRef url)
 {
     RetainPtr<CFStringRef> urlCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, url));
diff --git a/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm b/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm
new file mode 100644 (file)
index 0000000..56e2077
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "UIScriptController.h"
+
+#import "UIScriptContext.h"
+
+#if PLATFORM(MAC)
+
+namespace WTR {
+
+void UIScriptController::doAsyncTask(JSValueRef callback)
+{
+    unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
+
+    dispatch_async(dispatch_get_main_queue(), ^{
+        if (!m_context)
+            return;
+        m_context->asyncTaskComplete(callbackID);
+    });
+}
+
+}
+
+#endif // PLATFORM(MAC)
index e6b3e32..f3bcd5f 100644 (file)
@@ -1197,6 +1197,7 @@ static void runTest(const string& inputLine)
 
 exit:
     removeFontFallbackIfPresent(fallbackPath);
+    ::gTestRunner->cleanup();
     ::gTestRunner = nullptr;
 
     fputs("#EOF\n", stderr);
index 511af31..3eef5a8 100644 (file)
@@ -74,6 +74,15 @@ TestRunner::~TestRunner()
         editingDelegate->setAcceptsEditing(TRUE);
 }
 
+JSContextRef TestRunner::mainFrameJSContext()
+{
+    COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+    if (!framePrivate)
+        return;
+
+    return framePrivate->globalContext();
+}
+
 void TestRunner::addDisallowedURL(JSStringRef url)
 {
     // FIXME: Implement!
@@ -34,8 +34,8 @@ namespace WTR {
 // FIXME: If necessary, we can do wrapper caching here.
 class JSWrapper {
 public:
-    static JSValueRef wrap(JSContextRef context, JSWrappable* object);
-    static JSWrappable* unwrap(JSContextRef context, JSValueRef value);
+    static JSValueRef wrap(JSContextRef, JSWrappable*);
+    static JSWrappable* unwrap(JSContextRef, JSValueRef);
 
     static void initialize(JSContextRef, JSObjectRef);
     static void finalize(JSObjectRef);
 #include "config.h"
 #include "UIScriptContext.h"
 
-#include "StringFunctions.h"
 #include "UIScriptController.h"
 #include <JavaScriptCore/JSContextRef.h>
 #include <JavaScriptCore/JSValueRef.h>
-#include <WebKit/WKRetainPtr.h>
-#include <WebKit/WKString.h>
-#include <WebKit/WKStringPrivate.h>
+#include <WebCore/FloatRect.h>
 
 using namespace WTR;
 
@@ -58,14 +55,14 @@ UIScriptContext::~UIScriptContext()
     m_controller->contextDestroyed();
 }
 
-void UIScriptContext::runUIScript(WKStringRef script, unsigned scriptCallbackID)
+void UIScriptContext::runUIScript(const String& script, unsigned scriptCallbackID)
 {
     m_currentScriptCallbackID = scriptCallbackID;
 
-    auto scriptRef = toJS(script);
-    
+    JSRetainPtr<JSStringRef> stringRef(Adopt, JSStringCreateWithUTF8CString(script.utf8().data()));
+
     JSValueRef exception = nullptr;
-    JSValueRef result = JSEvaluateScript(m_context.get(), scriptRef.get(), 0, 0, 1, &exception);
+    JSValueRef result = JSEvaluateScript(m_context.get(), stringRef.get(), 0, 0, 1, &exception);
     
     if (!hasOutstandingAsyncTasks()) {
         JSValueRef stringifyException = nullptr;
@@ -169,21 +166,22 @@ void UIScriptContext::tryToCompleteUIScriptForCurrentParentCallback()
         return;
 
     JSStringRef result = m_uiScriptResultsPendingCompletion.take(m_currentScriptCallbackID);
-    WKRetainPtr<WKStringRef> uiScriptResult = adoptWK(WKStringCreateWithJSString(result));
-    m_delegate.uiScriptDidComplete(uiScriptResult.get(), m_currentScriptCallbackID);
+    String scriptResult(JSStringGetCharactersPtr(result), JSStringGetLength(result));
+
+    m_delegate.uiScriptDidComplete(scriptResult, m_currentScriptCallbackID);
     m_currentScriptCallbackID = 0;
     if (result)
         JSStringRelease(result);
 }
 
-JSObjectRef UIScriptContext::objectFromRect(const WKRect& rect) const
+JSObjectRef UIScriptContext::objectFromRect(const WebCore::FloatRect& rect) const
 {
     JSObjectRef object = JSObjectMake(m_context.get(), nullptr, nullptr);
 
-    JSObjectSetProperty(m_context.get(), object, adopt(JSStringCreateWithUTF8CString("left")).get(), JSValueMakeNumber(m_context.get(), rect.origin.x), kJSPropertyAttributeNone, nullptr);
-    JSObjectSetProperty(m_context.get(), object, adopt(JSStringCreateWithUTF8CString("top")).get(), JSValueMakeNumber(m_context.get(), rect.origin.y), kJSPropertyAttributeNone, nullptr);
-    JSObjectSetProperty(m_context.get(), object, adopt(JSStringCreateWithUTF8CString("width")).get(), JSValueMakeNumber(m_context.get(), rect.size.width), kJSPropertyAttributeNone, nullptr);
-    JSObjectSetProperty(m_context.get(), object, adopt(JSStringCreateWithUTF8CString("height")).get(), JSValueMakeNumber(m_context.get(), rect.size.height), kJSPropertyAttributeNone, nullptr);
+    JSObjectSetProperty(m_context.get(), object, adopt(JSStringCreateWithUTF8CString("left")).get(), JSValueMakeNumber(m_context.get(), rect.x()), kJSPropertyAttributeNone, nullptr);
+    JSObjectSetProperty(m_context.get(), object, adopt(JSStringCreateWithUTF8CString("top")).get(), JSValueMakeNumber(m_context.get(), rect.y()), kJSPropertyAttributeNone, nullptr);
+    JSObjectSetProperty(m_context.get(), object, adopt(JSStringCreateWithUTF8CString("width")).get(), JSValueMakeNumber(m_context.get(), rect.width()), kJSPropertyAttributeNone, nullptr);
+    JSObjectSetProperty(m_context.get(), object, adopt(JSStringCreateWithUTF8CString("height")).get(), JSValueMakeNumber(m_context.get(), rect.height()), kJSPropertyAttributeNone, nullptr);
     
     return object;
 }
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#pragma once
+
 #ifndef UIScriptContext_h
 #define UIScriptContext_h
 
 #include <JavaScriptCore/JSRetainPtr.h>
 #include <wtf/HashMap.h>
 #include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+class FloatRect;
+}
 
 namespace WTR {
 
@@ -36,7 +43,7 @@ class UIScriptController;
 
 class UIScriptContextDelegate {
 public:
-    virtual void uiScriptDidComplete(WKStringRef result, unsigned callbackID) = 0;
+    virtual void uiScriptDidComplete(const String& result, unsigned callbackID) = 0;
 };
 
 const unsigned firstNonPersistentCallbackID = 1000;
@@ -58,7 +65,7 @@ public:
     UIScriptContext(UIScriptContextDelegate&);
     ~UIScriptContext();
 
-    void runUIScript(WKStringRef script, unsigned scriptCallbackID);
+    void runUIScript(const String& script, unsigned scriptCallbackID);
     void requestUIScriptCompletion(JSStringRef);
 
     // For one-shot tasks callbacks.
@@ -73,7 +80,7 @@ public:
 
     unsigned nextTaskCallbackID(CallbackType);
 
-    JSObjectRef objectFromRect(const WKRect&) const;
+    JSObjectRef objectFromRect(const WebCore::FloatRect&) const;
 
 private:
     JSRetainPtr<JSGlobalContextRef> m_context;
 #include "JSWrappable.h"
 #include <wtf/Ref.h>
 
+namespace WebCore {
+class FloatRect;
+}
+
 namespace WTR {
 
 class UIScriptContext;
@@ -108,7 +112,7 @@ private:
 
     JSClassRef wrapperClass() final;
 
-    JSObjectRef objectFromRect(const WKRect&) const;
+    JSObjectRef objectFromRect(const WebCore::FloatRect&) const;
 
     UIScriptContext* m_context;
 };
index 68fa2af..7db90f2 100644 (file)
@@ -1,6 +1,8 @@
 set(WEBKIT_TESTRUNNER_DIR "${TOOLS_DIR}/WebKitTestRunner")
 set(WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR "${TOOLS_DIR}/WebKitTestRunner/InjectedBundle")
-set(WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR "${TOOLS_DIR}/WebKitTestRunner/UIScriptContext")
+set(WEBKIT_TESTRUNNER_SHARED_DIR "${TOOLS_DIR}/TestRunnerShared/")
+set(WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR "${WEBKIT_TESTRUNNER_SHARED_DIR}/UIScriptContext")
+set(WEBKIT_TESTRUNNER_BINDINGS_DIR "${WEBKIT_TESTRUNNER_SHARED_DIR}/Bindings")
 
 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/InjectedBundle)
 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/UIScriptContext)
@@ -17,8 +19,7 @@ set(WebKitTestRunner_SOURCES
     ${WEBKIT_TESTRUNNER_DIR}/WorkQueueManager.cpp
     ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/UIScriptContext.cpp
     ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/UIScriptController.cpp
-
-    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/JSWrapper.cpp
+    ${WEBKIT_TESTRUNNER_BINDINGS_DIR}/JSWrapper.cpp
 )
 
 set(WebKitTestRunner_LIBRARIES
@@ -33,7 +34,7 @@ set(WebKitTestRunner_INCLUDE_DIRECTORIES
     ${WEBKIT_TESTRUNNER_DIR}/InjectedBundle/Bindings
     ${WEBKIT_TESTRUNNER_DIR}/InjectedBundle/atk
     ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}
-    ${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/Bindings
+    ${WEBKIT_TESTRUNNER_BINDINGS_DIR}
     ${JAVASCRIPTCORE_DIR}
     ${JAVASCRIPTCORE_DIR}/ForwardingHeaders
     ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}
@@ -78,7 +79,7 @@ set(WebKitTestRunnerInjectedBundle_SOURCES
     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TestRunner.cpp
     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/TextInputController.cpp
 
-    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/Bindings/JSWrapper.cpp
+    ${WEBKIT_TESTRUNNER_BINDINGS_DIR}/JSWrapper.cpp
 )
 
 set(WebKitTestRunnerInjectedBundle_IDL_FILES
@@ -93,7 +94,7 @@ set(WebKitTestRunnerInjectedBundle_IDL_FILES
 )
 
 set(WebKitTestRunner_IDL_FILES
-    "${WEBKIT_TESTRUNNER_DIR}/UIScriptContext/Bindings/UIScriptController.idl"
+    "${WEBKIT_TESTRUNNER_UISCRIPTCONTEXT_DIR}/Bindings/UIScriptController.idl"
 )
 
 GENERATE_BINDINGS(WebKitTestRunnerInjectedBundle_SOURCES
index fe9a077..4a2b179 100644 (file)
@@ -23,7 +23,7 @@
 
 VPATH = \
     $(WebKitTestRunner)/InjectedBundle/Bindings \
-    $(WebKitTestRunner)/UIScriptContext/Bindings \
+    $(WebKitTestRunner)/../TestRunnerShared/UIScriptContext/Bindings \
 #
 
 INJECTED_BUNDLE_INTERFACES = \
index 07b5ea9..d94006e 100644 (file)
@@ -846,10 +846,10 @@ void TestInvocation::runUISideScript(WKStringRef script, unsigned scriptCallback
     if (!m_UIScriptContext)
         m_UIScriptContext = std::make_unique<UIScriptContext>(*this);
     
-    m_UIScriptContext->runUIScript(script, scriptCallbackID);
+    m_UIScriptContext->runUIScript(toWTFString(script), scriptCallbackID);
 }
 
-void TestInvocation::uiScriptDidComplete(WKStringRef result, unsigned scriptCallbackID)
+void TestInvocation::uiScriptDidComplete(const String& result, unsigned scriptCallbackID)
 {
     WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("CallUISideScriptCallback"));
 
@@ -858,7 +858,7 @@ void TestInvocation::uiScriptDidComplete(WKStringRef result, unsigned scriptCall
     WKRetainPtr<WKStringRef> callbackIDKey(AdoptWK, WKStringCreateWithUTF8CString("CallbackID"));
     WKRetainPtr<WKUInt64Ref> callbackIDValue = adoptWK(WKUInt64Create(scriptCallbackID));
 
-    WKDictionarySetItem(messageBody.get(), resultKey.get(), result);
+    WKDictionarySetItem(messageBody.get(), resultKey.get(), toWK(result).get());
     WKDictionarySetItem(messageBody.get(), callbackIDKey.get(), callbackIDValue.get());
 
     WKPagePostMessageToInjectedBundle(TestController::singleton().mainWebView()->page(), messageName.get(), messageBody.get());
index 2ad130d..6ab162f 100644 (file)
@@ -89,7 +89,7 @@ private:
 
     void runUISideScript(WKStringRef, unsigned callbackID);
     // UIScriptContextDelegate
-    void uiScriptDidComplete(WKStringRef result, unsigned callbackID) override;
+    void uiScriptDidComplete(const String& result, unsigned callbackID) override;
 
     const TestOptions m_options;
     
index fc17fff..9db98ea 100644 (file)
 /* End PBXAggregateTarget section */
 
 /* Begin PBXBuildFile section */
+               0F18E6E41D6B9ABF0027E547 /* UIScriptController.idl in Resources */ = {isa = PBXBuildFile; fileRef = 0F18E6E31D6B9ABF0027E547 /* UIScriptController.idl */; };
+               0F18E6E51D6B9B9E0027E547 /* UIScriptContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F18E6DD1D6B9AAF0027E547 /* UIScriptContext.cpp */; };
+               0F18E6E61D6B9BA20027E547 /* UIScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F18E6DF1D6B9AAF0027E547 /* UIScriptController.cpp */; };
+               0F18E7181D6BC4560027E547 /* JSWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F18E7151D6BC4560027E547 /* JSWrapper.cpp */; };
                0F4B08731D5BE88D00EC1B78 /* Launch.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0F4B08721D5BE88D00EC1B78 /* Launch.storyboard */; };
                0F5169CC1445222D00E0A9D7 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5169CA1445222D00E0A9D7 /* WebKit.framework */; };
                0F622CE91BBB3A1A00838AD3 /* TestOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F622CE81BBB3A1A00838AD3 /* TestOptions.cpp */; };
+               0F6E89031D6BC5A2008ED0FA /* JSWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F18E7151D6BC4560027E547 /* JSWrapper.cpp */; };
                0F73B5511BA78968004B3EF4 /* JSUIScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F73B54F1BA78968004B3EF4 /* JSUIScriptController.cpp */; };
                0F73B5521BA78968004B3EF4 /* JSUIScriptController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F73B5501BA78968004B3EF4 /* JSUIScriptController.h */; };
-               0F73B55A1BA792FF004B3EF4 /* JSWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952C0C11F3B965003398B4 /* JSWrapper.cpp */; };
                0F73B55C1BA89042004B3EF4 /* UIScriptControllerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F73B55B1BA89042004B3EF4 /* UIScriptControllerIOS.mm */; };
                0F87B6131BACAD82004EC572 /* UIScriptControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F87B6111BACAD6F004EC572 /* UIScriptControllerMac.mm */; };
                0F87B6171BACC4C0004EC572 /* TestRunnerWKWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F87B6151BACC4B9004EC572 /* TestRunnerWKWebView.mm */; };
-               0F87B61E1BACDA93004EC572 /* UIScriptContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F87B61A1BACDA93004EC572 /* UIScriptContext.cpp */; };
-               0F87B6201BACDA93004EC572 /* UIScriptController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F87B61C1BACDA93004EC572 /* UIScriptController.cpp */; };
                0FEB90A01905A834000FDBF3 /* InjectedBundlePageCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FEB909E1905A776000FDBF3 /* InjectedBundlePageCocoa.mm */; };
                0FEB90A51905C016000FDBF3 /* CrashReporterInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FEB90A31905BC6A000FDBF3 /* CrashReporterInfo.mm */; };
                0FEBF85A1BB61DF20028722D /* HIDEventGenerator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FEBF8591BB61DF20028722D /* HIDEventGenerator.mm */; };
                BC8DAD7B1316D91000EC96FC /* InjectedBundleMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC8DAD771316D7B900EC96FC /* InjectedBundleMac.mm */; };
                BC8FD8CA120E527F00F3E71A /* EventSendingController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8FD8C9120E527F00F3E71A /* EventSendingController.cpp */; };
                BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8FD8D0120E545B00F3E71A /* JSEventSendingController.cpp */; };
-               BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952C0C11F3B965003398B4 /* JSWrapper.cpp */; };
                BC952F1F11F3C652003398B4 /* JSTestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */; };
                BCC997A411D3C8F60017BCA2 /* InjectedBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */; };
                BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */; };
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
+               0F18E6DD1D6B9AAF0027E547 /* UIScriptContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UIScriptContext.cpp; path = ../TestRunnerShared/UIScriptContext/UIScriptContext.cpp; sourceTree = "<group>"; };
+               0F18E6DE1D6B9AAF0027E547 /* UIScriptContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIScriptContext.h; path = ../TestRunnerShared/UIScriptContext/UIScriptContext.h; sourceTree = "<group>"; };
+               0F18E6DF1D6B9AAF0027E547 /* UIScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UIScriptController.cpp; path = ../TestRunnerShared/UIScriptContext/UIScriptController.cpp; sourceTree = "<group>"; };
+               0F18E6E01D6B9AAF0027E547 /* UIScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIScriptController.h; path = ../TestRunnerShared/UIScriptContext/UIScriptController.h; sourceTree = "<group>"; };
+               0F18E6E31D6B9ABF0027E547 /* UIScriptController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = UIScriptController.idl; path = ../TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl; sourceTree = "<group>"; };
+               0F18E7141D6BC4560027E547 /* JSWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWrappable.h; path = ../TestRunnerShared/Bindings/JSWrappable.h; sourceTree = "<group>"; };
+               0F18E7151D6BC4560027E547 /* JSWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSWrapper.cpp; path = ../TestRunnerShared/Bindings/JSWrapper.cpp; sourceTree = "<group>"; };
+               0F18E7161D6BC4560027E547 /* JSWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSWrapper.h; path = ../TestRunnerShared/Bindings/JSWrapper.h; sourceTree = "<group>"; };
                0F2109C7189C650D00F879A3 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; };
                0F4B08721D5BE88D00EC1B78 /* Launch.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Launch.storyboard; path = ios/Launch.storyboard; sourceTree = SOURCE_ROOT; };
                0F5169CA1445222D00E0A9D7 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                0F622CE81BBB3A1A00838AD3 /* TestOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestOptions.cpp; sourceTree = "<group>"; };
-               0F73B54F1BA78968004B3EF4 /* JSUIScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSUIScriptController.cpp; path = DerivedSources/WebKitTestRunner/JSUIScriptController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
-               0F73B5501BA78968004B3EF4 /* JSUIScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSUIScriptController.h; path = DerivedSources/WebKitTestRunner/JSUIScriptController.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               0F73B54F1BA78968004B3EF4 /* JSUIScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUIScriptController.cpp; sourceTree = "<group>"; };
+               0F73B5501BA78968004B3EF4 /* JSUIScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSUIScriptController.h; sourceTree = "<group>"; };
                0F73B5571BA7929E004B3EF4 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
                0F73B55B1BA89042004B3EF4 /* UIScriptControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIScriptControllerIOS.mm; sourceTree = "<group>"; };
                0F87B6111BACAD6F004EC572 /* UIScriptControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIScriptControllerMac.mm; sourceTree = "<group>"; };
                0F87B6141BACC4B9004EC572 /* TestRunnerWKWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestRunnerWKWebView.h; path = cocoa/TestRunnerWKWebView.h; sourceTree = "<group>"; };
                0F87B6151BACC4B9004EC572 /* TestRunnerWKWebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestRunnerWKWebView.mm; path = cocoa/TestRunnerWKWebView.mm; sourceTree = "<group>"; };
-               0F87B61A1BACDA93004EC572 /* UIScriptContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UIScriptContext.cpp; path = UIScriptContext/UIScriptContext.cpp; sourceTree = "<group>"; };
-               0F87B61B1BACDA93004EC572 /* UIScriptContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIScriptContext.h; path = UIScriptContext/UIScriptContext.h; sourceTree = "<group>"; };
-               0F87B61C1BACDA93004EC572 /* UIScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UIScriptController.cpp; path = UIScriptContext/UIScriptController.cpp; sourceTree = "<group>"; };
-               0F87B61D1BACDA93004EC572 /* UIScriptController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIScriptController.h; path = UIScriptContext/UIScriptController.h; sourceTree = "<group>"; };
-               0F87B6221BACDAA2004EC572 /* UIScriptController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = UIScriptController.idl; path = UIScriptContext/Bindings/UIScriptController.idl; sourceTree = "<group>"; };
                0FEB909E1905A776000FDBF3 /* InjectedBundlePageCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InjectedBundlePageCocoa.mm; sourceTree = "<group>"; };
                0FEB90A21905BC6A000FDBF3 /* CrashReporterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CrashReporterInfo.h; path = cocoa/CrashReporterInfo.h; sourceTree = "<group>"; };
                0FEB90A31905BC6A000FDBF3 /* CrashReporterInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = CrashReporterInfo.mm; path = cocoa/CrashReporterInfo.mm; sourceTree = "<group>"; };
                29210EB1144CACD400835BB5 /* AccessibilityTextMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityTextMarker.cpp; sourceTree = "<group>"; };
                29210EB2144CACD400835BB5 /* AccessibilityTextMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTextMarker.h; sourceTree = "<group>"; };
                29210EB3144CACD400835BB5 /* AccessibilityTextMarkerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityTextMarkerMac.mm; path = mac/AccessibilityTextMarkerMac.mm; sourceTree = "<group>"; };
-               29210EDB146727E711835BB5 /* JSAccessibilityUIElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSAccessibilityUIElement.cpp; path = DerivedSources/WebKitTestRunner/JSAccessibilityUIElement.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
-               29210EDB146727E811835BB5 /* JSAccessibilityUIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityUIElement.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityUIElement.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               29210EDB146727E711835BB5 /* JSAccessibilityUIElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAccessibilityUIElement.cpp; sourceTree = "<group>"; };
+               29210EDB146727E811835BB5 /* JSAccessibilityUIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAccessibilityUIElement.h; sourceTree = "<group>"; };
                29210EDC144CD56E00835BB5 /* AccessibilityUIElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AccessibilityUIElement.idl; sourceTree = "<group>"; };
-               29210EE1144CDE6789815EE5 /* JSAccessibilityTextMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSAccessibilityTextMarker.cpp; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarker.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
-               29210EE1145CDE6789815EE5 /* JSAccessibilityTextMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityTextMarker.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarker.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               29210EE1144CDE6789815EE5 /* JSAccessibilityTextMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAccessibilityTextMarker.cpp; sourceTree = "<group>"; };
+               29210EE1145CDE6789815EE5 /* JSAccessibilityTextMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAccessibilityTextMarker.h; sourceTree = "<group>"; };
                29A8FCC5145B93C6009045A6 /* AccessibilityTextMarker.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AccessibilityTextMarker.idl; sourceTree = "<group>"; };
                29A8FCD2145EF8F2009045A6 /* AccessibilityTextMarkerRange.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = AccessibilityTextMarkerRange.idl; sourceTree = "<group>"; };
                29A8FCDF145F0358009045A6 /* AccessibilityTextMarkerRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTextMarkerRange.h; sourceTree = "<group>"; };
                29A8FCE1145F037B009045A6 /* AccessibilityTextMarkerRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityTextMarkerRange.cpp; sourceTree = "<group>"; };
-               29A8FCE1345E7021006AA5A6 /* JSAccessibilityTextMarkerRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSAccessibilityTextMarkerRange.cpp; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarkerRange.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
-               29A8FCE1345E7021006AA5A7 /* JSAccessibilityTextMarkerRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityTextMarkerRange.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarkerRange.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               29A8FCE1345E7021006AA5A6 /* JSAccessibilityTextMarkerRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAccessibilityTextMarkerRange.cpp; sourceTree = "<group>"; };
+               29A8FCE1345E7021006AA5A7 /* JSAccessibilityTextMarkerRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAccessibilityTextMarkerRange.h; sourceTree = "<group>"; };
                29A8FCE4145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityTextMarkerRangeMac.mm; sourceTree = "<group>"; };
                2DCE2CD11B84524500C7F832 /* TestControllerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestControllerCocoa.mm; path = cocoa/TestControllerCocoa.mm; sourceTree = "<group>"; };
                2E63ED751891ACE9002A7AFC /* AccessibilityControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityControllerIOS.mm; sourceTree = "<group>"; };
                5322FB4213FDA0CD0041ABCC /* CyclicRedundancyCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CyclicRedundancyCheck.h; sourceTree = "<group>"; };
                5322FB4413FDA0EA0041ABCC /* PixelDumpSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PixelDumpSupport.cpp; sourceTree = "<group>"; };
                5322FB4513FDA0EA0041ABCC /* PixelDumpSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PixelDumpSupport.h; sourceTree = "<group>"; };
-               5641E2CE14335E95008307E5 /* JSTextInputController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSTextInputController.cpp; path = DerivedSources/WebKitTestRunner/JSTextInputController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
-               5641E2CF14335E95008307E5 /* JSTextInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTextInputController.h; path = DerivedSources/WebKitTestRunner/JSTextInputController.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               5641E2CE14335E95008307E5 /* JSTextInputController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextInputController.cpp; sourceTree = "<group>"; };
+               5641E2CF14335E95008307E5 /* JSTextInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTextInputController.h; sourceTree = "<group>"; };
                5664A49614326377008881BE /* TextInputController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TextInputController.idl; sourceTree = "<group>"; };
                5664A49814326384008881BE /* TextInputController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextInputController.cpp; sourceTree = "<group>"; };
                5664A49914326384008881BE /* TextInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInputController.h; sourceTree = "<group>"; };
                5670B8261386FC13002EB355 /* EventSenderProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSenderProxy.h; sourceTree = "<group>"; };
                5670B8271386FCA5002EB355 /* EventSenderProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventSenderProxy.mm; sourceTree = "<group>"; };
-               583913D014335E95008307E5 /* JSAccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSAccessibilityController.cpp; path = DerivedSources/WebKitTestRunner/JSAccessibilityController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
-               583913D114335E95008307E5 /* JSAccessibilityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityController.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityController.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               583913D014335E95008307E5 /* JSAccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAccessibilityController.cpp; sourceTree = "<group>"; };
+               583913D114335E95008307E5 /* JSAccessibilityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAccessibilityController.h; sourceTree = "<group>"; };
                5C45C30E17398E290079714E /* WebArchiveDumpSupportMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebArchiveDumpSupportMac.mm; path = mac/WebArchiveDumpSupportMac.mm; sourceTree = SOURCE_ROOT; };
                5C45C31117398E480079714E /* WebArchiveDumpSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebArchiveDumpSupport.cpp; path = cf/WebArchiveDumpSupport.cpp; sourceTree = SOURCE_ROOT; };
                5C45C31217398E480079714E /* WebArchiveDumpSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebArchiveDumpSupport.h; path = cf/WebArchiveDumpSupport.h; sourceTree = SOURCE_ROOT; };
                BC14E4D8120E02D000826C0C /* GCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCController.h; sourceTree = "<group>"; };
                BC14E4D9120E02D000826C0C /* GCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GCController.cpp; sourceTree = "<group>"; };
                BC14E4E1120E032000826C0C /* GCController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GCController.idl; sourceTree = "<group>"; };
-               BC14E4E8120E03D800826C0C /* JSGCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSGCController.cpp; path = DerivedSources/WebKitTestRunner/JSGCController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
-               BC14E4E9120E03D800826C0C /* JSGCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSGCController.h; path = DerivedSources/WebKitTestRunner/JSGCController.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               BC14E4E8120E03D800826C0C /* JSGCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGCController.cpp; sourceTree = "<group>"; };
+               BC14E4E9120E03D800826C0C /* JSGCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGCController.h; sourceTree = "<group>"; };
                BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMain.cpp; sourceTree = "<group>"; };
                BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebKitTestRunnerInjectedBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
                BC25186311D15D54002EBC01 /* InjectedBundle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "InjectedBundle-Info.plist"; sourceTree = "<group>"; };
                BC8FD8C8120E527F00F3E71A /* EventSendingController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSendingController.h; sourceTree = "<group>"; };
                BC8FD8C9120E527F00F3E71A /* EventSendingController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventSendingController.cpp; sourceTree = "<group>"; };
                BC8FD8CB120E52B000F3E71A /* EventSendingController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EventSendingController.idl; sourceTree = "<group>"; };
-               BC8FD8D0120E545B00F3E71A /* JSEventSendingController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSEventSendingController.cpp; path = DerivedSources/WebKitTestRunner/JSEventSendingController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
-               BC8FD8D1120E545B00F3E71A /* JSEventSendingController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSEventSendingController.h; path = DerivedSources/WebKitTestRunner/JSEventSendingController.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               BC8FD8D0120E545B00F3E71A /* JSEventSendingController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventSendingController.cpp; sourceTree = "<group>"; };
+               BC8FD8D1120E545B00F3E71A /* JSEventSendingController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEventSendingController.h; sourceTree = "<group>"; };
                BC9192041333E4F8003011DC /* TestInvocationCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestInvocationCG.cpp; path = cg/TestInvocationCG.cpp; sourceTree = "<group>"; };
-               BC952C0B11F3B965003398B4 /* JSWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWrapper.h; sourceTree = "<group>"; };
-               BC952C0C11F3B965003398B4 /* JSWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWrapper.cpp; sourceTree = "<group>"; };
-               BC952C0E11F3B97B003398B4 /* JSWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWrappable.h; sourceTree = "<group>"; };
                BC952EC511F3C10F003398B4 /* DerivedSources.make */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DerivedSources.make; sourceTree = "<group>"; };
                BC952ED211F3C29F003398B4 /* TestRunner.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TestRunner.idl; sourceTree = "<group>"; };
                BC952ED311F3C318003398B4 /* CodeGeneratorTestRunner.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = CodeGeneratorTestRunner.pm; sourceTree = "<group>"; };
-               BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSTestRunner.cpp; path = DerivedSources/WebKitTestRunner/JSTestRunner.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
-               BC952F1E11F3C652003398B4 /* JSTestRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTestRunner.h; path = DerivedSources/WebKitTestRunner/JSTestRunner.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               BC952F1D11F3C652003398B4 /* JSTestRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTestRunner.cpp; sourceTree = "<group>"; };
+               BC952F1E11F3C652003398B4 /* JSTestRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTestRunner.h; sourceTree = "<group>"; };
                BC99A4841208901A007E9F08 /* StringFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringFunctions.h; sourceTree = "<group>"; };
                BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundle.cpp; sourceTree = "<group>"; };
                BCC997A111D3C8F60017BCA2 /* InjectedBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundle.h; sourceTree = "<group>"; };
                08FB7794FE84155DC02AAC07 /* WebKitTestRunner */ = {
                        isa = PBXGroup;
                        children = (
+                               0F18E71A1D6BC4BC0027E547 /* TestRunnerShared */,
                                BC952EC511F3C10F003398B4 /* DerivedSources.make */,
                                2EE52CEA1890A9A80010ED21 /* WebKitTestRunnerApp-Info.plist */,
                                BC99CBF11207642D00FDEE76 /* Shared */,
                                0FEB90A11905BC4A000FDBF3 /* cocoa */,
                                2EE52D121890A9FB0010ED21 /* ios */,
                                BC7933FE118F7C74005EA8E2 /* mac */,
-                               0F73B5471BA782FE004B3EF4 /* UIScriptContext */,
                                5322FB4113FDA0CD0041ABCC /* CyclicRedundancyCheck.cpp */,
                                5322FB4213FDA0CD0041ABCC /* CyclicRedundancyCheck.h */,
                                5670B8261386FC13002EB355 /* EventSenderProxy.h */,
                        name = "External Frameworks and Libraries";
                        sourceTree = "<group>";
                };
+               0F18E71A1D6BC4BC0027E547 /* TestRunnerShared */ = {
+                       isa = PBXGroup;
+                       children = (
+                               0F18E71B1D6BC4E60027E547 /* Bindings */,
+                               0F73B5471BA782FE004B3EF4 /* UIScriptContext */,
+                       );
+                       name = TestRunnerShared;
+                       sourceTree = "<group>";
+               };
+               0F18E71B1D6BC4E60027E547 /* Bindings */ = {
+                       isa = PBXGroup;
+                       children = (
+                               0F18E7141D6BC4560027E547 /* JSWrappable.h */,
+                               0F18E7151D6BC4560027E547 /* JSWrapper.cpp */,
+                               0F18E7161D6BC4560027E547 /* JSWrapper.h */,
+                       );
+                       name = Bindings;
+                       sourceTree = "<group>";
+               };
                0F73B5471BA782FE004B3EF4 /* UIScriptContext */ = {
                        isa = PBXGroup;
                        children = (
                                0F73B54B1BA78350004B3EF4 /* Bindings */,
                                0F73B54E1BA78954004B3EF4 /* Derived Sources */,
-                               0F87B61A1BACDA93004EC572 /* UIScriptContext.cpp */,
-                               0F87B61B1BACDA93004EC572 /* UIScriptContext.h */,
-                               0F87B61C1BACDA93004EC572 /* UIScriptController.cpp */,
-                               0F87B61D1BACDA93004EC572 /* UIScriptController.h */,
+                               0F18E6DD1D6B9AAF0027E547 /* UIScriptContext.cpp */,
+                               0F18E6DE1D6B9AAF0027E547 /* UIScriptContext.h */,
+                               0F18E6DF1D6B9AAF0027E547 /* UIScriptController.cpp */,
+                               0F18E6E01D6B9AAF0027E547 /* UIScriptController.h */,
                        );
                        name = UIScriptContext;
                        sourceTree = "<group>";
                0F73B54B1BA78350004B3EF4 /* Bindings */ = {
                        isa = PBXGroup;
                        children = (
-                               0F87B6221BACDAA2004EC572 /* UIScriptController.idl */,
+                               0F18E6E31D6B9ABF0027E547 /* UIScriptController.idl */,
                        );
                        name = Bindings;
                        sourceTree = "<group>";
                                0F73B5501BA78968004B3EF4 /* JSUIScriptController.h */,
                        );
                        name = "Derived Sources";
-                       sourceTree = "<group>";
+                       path = DerivedSources/WebKitTestRunner;
+                       sourceTree = BUILT_PRODUCTS_DIR;
                };
                0FEB909D1905A75D000FDBF3 /* cocoa */ = {
                        isa = PBXGroup;
                                BC952ED311F3C318003398B4 /* CodeGeneratorTestRunner.pm */,
                                BC8FD8CB120E52B000F3E71A /* EventSendingController.idl */,
                                BC14E4E1120E032000826C0C /* GCController.idl */,
-                               BC952C0E11F3B97B003398B4 /* JSWrappable.h */,
-                               BC952C0C11F3B965003398B4 /* JSWrapper.cpp */,
-                               BC952C0B11F3B965003398B4 /* JSWrapper.h */,
                                BC952ED211F3C29F003398B4 /* TestRunner.idl */,
                                5664A49614326377008881BE /* TextInputController.idl */,
                        );
                                5641E2CF14335E95008307E5 /* JSTextInputController.h */,
                        );
                        name = "Derived Sources";
-                       sourceTree = "<group>";
+                       path = DerivedSources/WebKitTestRunner;
+                       sourceTree = BUILT_PRODUCTS_DIR;
                };
                BC99CBF11207642D00FDEE76 /* Shared */ = {
                        isa = PBXGroup;
                        buildActionMask = 2147483647;
                        files = (
                                0F4B08731D5BE88D00EC1B78 /* Launch.storyboard in Resources */,
+                               0F18E6E41D6B9ABF0027E547 /* UIScriptController.idl in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                A185103E1B9AE12200744AEB /* CyclicRedundancyCheck.cpp in Sources */,
                                A185103F1B9AE12900744AEB /* GeolocationProviderMock.cpp in Sources */,
                                0F73B5511BA78968004B3EF4 /* JSUIScriptController.cpp in Sources */,
-                               0F73B55A1BA792FF004B3EF4 /* JSWrapper.cpp in Sources */,
+                               0F18E7181D6BC4560027E547 /* JSWrapper.cpp in Sources */,
                                A185103C1B9AE0FE00744AEB /* Options.cpp in Sources */,
                                A18510401B9AE13100744AEB /* PixelDumpSupport.cpp in Sources */,
                                A18510411B9AE13800744AEB /* TestController.cpp in Sources */,
                                A185103D1B9AE10600744AEB /* TestInvocationCG.cpp in Sources */,
                                0F622CE91BBB3A1A00838AD3 /* TestOptions.cpp in Sources */,
                                0F87B6171BACC4C0004EC572 /* TestRunnerWKWebView.mm in Sources */,
-                               0F87B61E1BACDA93004EC572 /* UIScriptContext.cpp in Sources */,
-                               0F87B6201BACDA93004EC572 /* UIScriptController.cpp in Sources */,
+                               0F18E6E51D6B9B9E0027E547 /* UIScriptContext.cpp in Sources */,
+                               0F18E6E61D6B9BA20027E547 /* UIScriptController.cpp in Sources */,
                                0F73B55C1BA89042004B3EF4 /* UIScriptControllerIOS.mm in Sources */,
                                A18510431B9AE14500744AEB /* WebNotificationProvider.cpp in Sources */,
                                A18510441B9AE14A00744AEB /* WorkQueueManager.cpp in Sources */,
                                BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */,
                                BC952F1F11F3C652003398B4 /* JSTestRunner.cpp in Sources */,
                                5641E2D014335E95008307E5 /* JSTextInputController.cpp in Sources */,
-                               BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */,
+                               0F6E89031D6BC5A2008ED0FA /* JSWrapper.cpp in Sources */,
                                2E63EDA61891BDC0002A7AFC /* TestRunner.cpp in Sources */,
                                C0CE720B1247C93300BC0EC4 /* TestRunnerMac.mm in Sources */,
                                5664A49A14326384008881BE /* TextInputController.cpp in Sources */,
index 4fb2a4b..4042b71 100644 (file)
 #include "cmakeconfig.h"
 #endif
 
+#include <WebCore/PlatformExportMacros.h>
 #include <WebKit/WebKit2_C.h>
 #include <wtf/Platform.h>
 #include <wtf/ExportMacros.h>
 #include <runtime/JSExportMacros.h>
 
-// This is needed because we include WebCore's headers.
-// FIXME: We should include <WebCore/PlatformExportMacros.h> instead.
-#define WEBCORE_EXPORT
-
 #endif
index c5c619d..4f70ae6 100644 (file)
@@ -35,6 +35,7 @@
 #import "TestRunnerWKWebView.h"
 #import "UIScriptContext.h"
 #import <UIKit/UIKit.h>
+#import <WebCore/FloatRect.h>
 #import <WebKit/WKWebViewPrivate.h>
 #import <WebKit/WebKit.h>
 
@@ -239,8 +240,8 @@ JSObjectRef UIScriptController::contentVisibleRect() const
 
     CGRect contentVisibleRect = webView._contentVisibleRect;
     
-    WKRect wkRect = WKRectMake(contentVisibleRect.origin.x, contentVisibleRect.origin.y, contentVisibleRect.size.width, contentVisibleRect.size.height);
-    return m_context->objectFromRect(wkRect);
+    WebCore::FloatRect rect(contentVisibleRect.origin.x, contentVisibleRect.origin.y, contentVisibleRect.size.width, contentVisibleRect.size.height);
+    return m_context->objectFromRect(rect);
 }
 
 void UIScriptController::platformSetDidStartFormControlInteractionCallback()