diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
commit | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch) | |
tree | 4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebKitTools | |
parent | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff) | |
download | external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebKitTools')
264 files changed, 12272 insertions, 10064 deletions
diff --git a/WebKitTools/BuildSlaveSupport/build-launcher-app b/WebKitTools/BuildSlaveSupport/build-launcher-app index 19b55c9..117b008 100755 --- a/WebKitTools/BuildSlaveSupport/build-launcher-app +++ b/WebKitTools/BuildSlaveSupport/build-launcher-app @@ -38,8 +38,6 @@ use webkitdirs; my @xcodeBuildArguments = XcodeOptions(); my $nightlyLauncherTemplatePath = "$FindBin::Bin/../WebKitLauncher"; my $nightlyLauncherStagingPath = productDir() . "/WebKit.app"; -my $droseraProjectPath = "$FindBin::Bin/../Drosera/mac"; -my $droseraStagingPath = productDir() . "/DroseraLauncher.app"; sub buildNightlyLauncher { @@ -49,21 +47,40 @@ sub buildNightlyLauncher chdirWebKit(); } -sub currentSVNBranch +sub currentRevision { my $sourceDir = sourceDir(); - my $svnInfo = `LC_ALL=C svn info $sourceDir | grep URL:`; - (my $url) = ($svnInfo =~ m/URL: (.+)/g); - (my $branch) = ($url =~ m/\/svn\/webkit\/(trunk|branches\/[^\/]+)/); + if (isSVNDirectory($sourceDir)) { + return currentSVNRevision(); + } elsif (isGitDirectory($sourceDir)) { + my $gitLog = `cd $sourceDir && LC_ALL=C git log --grep='git-svn-id: ' -n 1 | grep git-svn-id:`; + (my $revision) = ($gitLog =~ m/ +git-svn-id: .+@(\d+) /g); + return $revision; + } +} + +sub currentBranch +{ + my $sourceDir = sourceDir(); + my ($url, $branch); + if (isSVNDirectory($sourceDir)) { + my $svnInfo = `LC_ALL=C svn info $sourceDir | grep URL:`; + ($url) = ($svnInfo =~ m/URL: (.+)/g); + } elsif (isGitDirectory($sourceDir)) { + my $gitLog = `cd $sourceDir && LC_ALL=C git log --grep='git-svn-id: ' -n 1 | grep git-svn-id:`; + ($url) = ($gitLog =~ m/ +git-svn-id: (.+)@\d+ /g); + } + ($branch) = ($url =~ m/\/webkit\/(trunk|branches\/[^\/]+)/); die "Unable to determine current SVN branch in $sourceDir" unless (defined $branch); $branch =~ s/^branches\///; - return $branch + return $branch; } sub copyNightlyLauncher { - my $revision = currentSVNRevision(); - my $branch = currentSVNBranch(); + my $revision = currentRevision(); + my $branch = currentBranch(); + my $infoPlist = "$nightlyLauncherStagingPath/Contents/Info.plist"; my $versionFile = "$nightlyLauncherStagingPath/Contents/Resources/VERSION"; my $branchFile = "$nightlyLauncherStagingPath/Contents/Resources/BRANCH"; @@ -93,35 +110,11 @@ sub copyNightlyLauncher } } -sub buildDroseraLauncher -{ - chdir($droseraProjectPath); - system("xcodebuild", "clean", "-alltargets", @xcodeBuildArguments, @ARGV) == 0 or die "Failed cleaning Drosera project"; - # Build native platform only right now, as building universal with the 10.4u SDK cause Xcode to look for WebKit, - # WebCore & JavaScriptCore in the SDK under /Developer/SDKs/MacOSX10.4u.sdk/$(BUILT_PRODUCTS_DIR) where they do not exist - system("xcodebuild", "-alltargets", @xcodeBuildArguments, @ARGV) == 0 or die "Failed building Drosera project"; - chdirWebKit(); -} - -sub setDroseraLauncherVersion -{ - my $revision = currentSVNRevision(); - my $infoPlist = "$droseraStagingPath/Contents/Info.plist"; - my $data; - open(IN, $infoPlist) or die "Couldn't open Info.plist in built application for reading"; - { - undef $/; - $data = <IN>; - } - close(IN); - open(OUT, ">$infoPlist") or die "Couldn't open Info.plist in built application for writing"; - $data =~ s/VERSION/$revision/g; - print OUT $data; - close(OUT); -} +my $b = currentBranch(); +my $r = currentRevision(); +print "Branch: ", $b, "\n"; +print "Revision: ", $r, "\n"; chdirWebKit(); buildNightlyLauncher(); copyNightlyLauncher(); -buildDroseraLauncher(); -setDroseraLauncherVersion(); diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog index 603c56e..683724c 100644 --- a/WebKitTools/ChangeLog +++ b/WebKitTools/ChangeLog @@ -1,3 +1,4183 @@ +2008-11-03 Pierre-Olivier Latour <pol@apple.com> + + Reviewed by Dan Bernstein. + + Fixed the override of the "AppleScrollBarVariant" system setting to also work with HIToolbox. + + https://bugs.webkit.org/show_bug.cgi?id=22054 + + * DumpRenderTree/mac/DumpRenderTree.mm: + (setDefaultsToConsistentValuesForTesting): + +2008-10-31 Cameron Zwarich <zwarich@apple.com> + + Not reviewed. + + * Scripts/do-webcore-rename: + + Add some renames to contemplate for the future. + +2008-10-31 Darin Adler <darin@apple.com> + + Requested by Mark Rowe. + + * Scripts/check-for-global-initializers: s/Web Kit/WebKit/. + +2008-10-31 David Kilzer <ddkilzer@apple.com> + + Bug 21997: prepare-ChangeLog should filter out ChangeLog files + + <https://bugs.webkit.org/show_bug.cgi?id=21997> + + Reviewed by Darin Adler. + + * Scripts/prepare-ChangeLog: + (generateFileList): Don't add ChangeLog files to %{$functionLists}. + This prevents them from showing up in the new ChangeLog entry. They + were already excluded from @{$changedFiles}. + +2008-10-30 Mark Rowe <mrowe@apple.com> + + Reviewed by Jon Homeycutt. + + Explicitly default to building for only the native architecture in debug and release builds. + + * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: + +2008-10-30 Pierre-Olivier Latour <pol@apple.com> + + Reviewed by Dan Bernstein. + + Fixed 64 bit build failure. + + * DumpRenderTree/mac/PixelDumpSupportMac.mm: + (setupMainDisplayColorProfile): + (createBitmapContextFromWebView): + +2008-10-28 Alp Toker <alp@nuanti.com> + + Fix GTK DRT following build breakage in r37928. + + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (dump): + (runTest): + (main): + +2008-10-28 Alp Toker <alp@nuanti.com> + + Reviewed by Mark Rowe. + + Fix recently introduced double-free crashes in GTK DRT. + + LayoutTestController was made ref-counted in r36606 and Mac/Win DRT + were updated to call ->deref() but GTK DRT was still deleting + gLayoutTestController manually. This patch updates GTK to match the + other ports and resolves the memory allocation issues. + + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (runTest): + +2008-10-28 Alp Toker <alp@nuanti.com> + + Reviewed by Mark Rowe. + + Fix GTK DRT hang when running the tests. + + Update output from the DRT tool to print an additional '#EOF' to match + breaking changes that were made in r37434. + + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (dump): + +2008-10-28 Adele Peterson <adele@apple.com> + + Reviewed by Sam Weinig. + + Specify which Localizable.strings to update since we don't always want to update the file in the same + directory where we're searching for the strings to localize. + + * Scripts/extract-localizable-strings: + * Scripts/update-webkit-localizable-strings: + +2008-10-28 Timothy Hatcher <timothy@apple.com> + + Add support for enabling the profiler, so the profiling tests can continue + work now that the profiler is not always enabled. + + https://bugs.webkit.org/show_bug.cgi?id=21927 + + <rdar://problem/6211578> Make the JavaScript profiler opt-in, so it does + not slow down JavaScript all the time + + Reviewed by Darin Adler and Kevin McCullough. + + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Make the editor use spaces. + * DumpRenderTree/LayoutTestController.cpp: + (setJavaScriptProfilingEnabledCallback): Added. Calls LayoutTestController::setJavaScriptProfilingEnabled. + (LayoutTestController::staticFunctions): Added setJavaScriptProfilingEnabled to the script class. + * DumpRenderTree/LayoutTestController.h: + * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: + (LayoutTestController::setJavaScriptProfilingEnabled): Stubbed out with a FIXME. + * DumpRenderTree/mac/DumpRenderTree.mm: + (resetWebViewToConsistentStateBeforeTesting): Disables the developer extras and disables the profiler. + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (LayoutTestController::setJavaScriptProfilingEnabled): Toggles the developer extras and profiler. + * DumpRenderTree/win/DumpRenderTree.cpp: + (resetWebViewToConsistentStateBeforeTesting): Disables the developer extras and disables the profiler. + * DumpRenderTree/win/LayoutTestControllerWin.cpp: + (LayoutTestController::setJavaScriptProfilingEnabled): Toggles the developer extras and profiler. + +2008-10-28 Pierre-Olivier Latour <pol@apple.com> + + Reviewed by Dan Bernstein + + Primary changes in DumpRenderTree: + - Ensure font smoothing is disabled (this is also called LCD anti-aliasing and + is different from regular font CG anti-aliasing) as font-smoothing settings + depends on the display and can also be changed by the user + - Use a new cleared buffer for each test instead of the reusing same one to + avoid potential result corruption across tests + - Can now receive the expected pixel hash as a suffix to the test path or + url as "path'hash" + - Make sure hash is computed in a endian-independent way + - Improve the code that sets/restores the screen color profile + - Make the code more cross-platformy with std::string goodness + - Added an "on-screen" mode where the snapshot will take into account surfaces + on the window (like OpenGL content): this uses the new CG APIs on 10.5 or + reading from the display framebuffer on 10.4. This mode is not active by + default for performance reason, but must be explicitly activated from the test + file using the new "testOnscreen()" JS API. + + Primary changes in ImageDiff: + - Provide a new comparison algorithm that is more tolerant to "acceptable" + failures (i.e. very small differences in font rendering, which --threshold is + not really good at handling) + - Generate normalized intensity-only diff images + + Primary changes in run-webkit-tests: + - Take advantage of hashes for pixel tests which makes them much faster by + minimizing image comparisons + - Removed repaint options as these should be set from within test files using + JS API + - Replaced "threshold" option in by "tolerance" expressed in percents + - Added more logging when in "verbose" mode + + https://bugs.webkit.org/show_bug.cgi?id=21322 + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: + * DumpRenderTree/ForwardingHeaders/wtf/PassRefPtr.h: Copied from JavaScriptGlue/ForwardingHeaders/wtf/PassRefPtr.h. + * DumpRenderTree/ForwardingHeaders/wtf/RefPtr.h: Copied from JavaScriptGlue/ForwardingHeaders/wtf/RefPtr.h. + * DumpRenderTree/LayoutTestController.cpp: + (LayoutTestController::LayoutTestController): + (testOnscreenCallback): + (LayoutTestController::staticFunctions): + * DumpRenderTree/LayoutTestController.h: + (LayoutTestController::testOnscreen): + (LayoutTestController::setTestOnscreen): + (LayoutTestController::testPathOrURL): + (LayoutTestController::expectedPixelHash): + * DumpRenderTree/PixelDumpSupport.h: + * DumpRenderTree/cg/ImageDiffCG.cpp: + (strtof): + (releaseMallocBuffer): + (createDifferenceImage): + (imageHasAlpha): + (main): + * DumpRenderTree/cg/PixelDumpSupportCG.cpp: + (computeMD5HashStringForBitmapContext): + (dumpWebViewAsPixelsAndCompareWithExpected): + * DumpRenderTree/cg/PixelDumpSupportCG.h: + (BitmapContext::createByAdoptingBitmapAndContext): + (BitmapContext::~BitmapContext): + (BitmapContext::cgContext): + (BitmapContext::BitmapContext): + * DumpRenderTree/mac/DumpRenderTree.mm: + (shouldIgnoreWebCoreNodeLeaks): + (setDefaultsToConsistentValuesForTesting): + (crashHandler): + (initializeGlobalsFromCommandLineOptions): + (prepareConsistentTestingEnvironment): + (dumpRenderTree): + (sizeWebViewForCurrentTest): + (dump): + (runTest): + * DumpRenderTree/mac/PixelDumpSupportMac.mm: + (restoreMainDisplayColorProfile): + (setupMainDisplayColorProfile): + (createBitmapContextFromWebView): + * DumpRenderTree/win/DumpRenderTree.cpp: + (dump): + (runTest): + * DumpRenderTree/win/PixelDumpSupportWin.cpp: + (getBitmapContextFromWebView): + * Scripts/run-webkit-tests: + +2008-10-27 Kevin Ollivier <kevino@theolliviers.com> + + wx build fix on Linux/GTK. Enable support for #include <JavaScriptCore/XYZ.h> style includes. + + * wx/build-wxwebkit: + +2008-10-24 Anders Carlsson <andersca@apple.com> + + Try fixing the 64-bit build. + + * DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp: + (testGetProperty): + +2008-10-24 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + <rdar://problem/5440917> Support NPN_Construct + + * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: + (testCallback): + Fix a memory leak. + + (testConstruct): + New test method that treats it first argument as a constructor and invokes it with the rest of the arguments. + + (pluginInvoke): + Handle testConstruct. + + * DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp: + (testGetProperty): + Add objectPointer property. + + (testEnumerate): + Only enumerate the two first properties. + + (testConstruct): + Add a simple construct implementation that just returns the test object. + +2008-10-24 David Kilzer <ddkilzer@apple.com> + + Bug 21850: svn-apply and svn-unapply should preserve patch line endings + + <https://bugs.webkit.org/show_bug.cgi?id=21850> + + Reviewed by Adam Roben. + + * Scripts/svn-apply: Save end-of-line characters when stripping them + off each line of a patch so that they may be restored after + processing the line. + * Scripts/svn-unapply: Ditto. + +2008-10-23 David Kilzer <ddkilzer@apple.com> + + Bug 21832: Fix scripts using 'new File::Temp' for Perl 5.10 + + <https://bugs.webkit.org/show_bug.cgi?id=21832> + + Reviewed by Sam Weinig. + + * Scripts/bisect-builds: Use imported tempfile() from File::Temp + instead of 'new File::Temp' to make the script work with Perl 5.10. + * Scripts/sort-Xcode-project-file: Ditto. + +2008-10-22 Brady Eidson <beidson@apple.com> + + Reviewed by Adam Roben + + <rdar://6261773> - autocomplete="off" doesn't work on Windows + + Implement LayoutTestController::elementDoesAutoCompleteForElementWithId() on Windows + + * DumpRenderTree/win/LayoutTestControllerWin.cpp: + +2008-10-22 Darin Adler <darin@apple.com> + + * Scripts/do-webcore-rename: More renaming plans. + +2008-10-21 Steve Falkenburg <sfalken@apple.com> + + Exclude strings marked with UNLOCALIZED_STRING or UNLOCALIZED_LPCTSTR. + + * Scripts/extract-localizable-strings: + +2008-10-17 Maciej Stachowiak <mjs@apple.com> + + Reviewed by Mark Rowe. + + - default to 1000 tests per dump tool instance again, now that CTI no longer causes + excess different stack logs. + + (Also fix a small bug in my last change.) + + * Scripts/run-webkit-tests: + +2008-10-17 Stephanie Lewis <slewis@apple.com> + + Reviewed by Mark Rowe. + + Fix layout tests that use prologues and epilogues. + + * Scripts/run-webkit-tests: + +2008-10-17 Maciej Stachowiak <mjs@apple.com> + + Reviewed by Mark Rowe. + + - make sure MallocStackLogging is only on for tools we want to + leak check, not other random stuff as well. + + * Scripts/run-webkit-tests: + +2008-10-17 Maciej Stachowiak <mjs@apple.com> + + Reviewed by Stephanie Lewis. + + - make run-webkit-tests --leaks default to 100 tests per run instead of 1000 + + This should reduce or eliminate crashes on the buildbot due to + running out of memory while stack logging. + + * Scripts/run-webkit-tests: + +2008-10-16 Jan Michael Alonzo <jmalonzo@webkit.org> + + Gtk build fix. Not reviewed. + + * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: + (LayoutTestController::setSmartInsertDeleteEnabled): + +2008-10-15 Glenn Wilson <gwilson@google.com> + + Added new method to allow tests to disable smart editing in the course of a test. + This is a possible solution to bug .20655 + + Reviewed by Tim Hatcher. + + * DumpRenderTree/LayoutTestController.cpp: + (setSmartInsertDeleteEnabledCallback): new method + (LayoutTestController::staticFunctions): added new method to static list of callbacks + * DumpRenderTree/LayoutTestController.h: added signature of new method + * DumpRenderTree/mac/DumpRenderTree.mm: + (resetWebViewToConsistentStateBeforeTesting): added state resetting + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (LayoutTestController::setSmartInsertDeleteEnabled): added new method + * DumpRenderTree/win/DumpRenderTree.cpp: + (resetWebViewToConsistentStateBeforeTesting): added state resetting + * DumpRenderTree/win/LayoutTestControllerWin.cpp: + (LayoutTestController::setSmartInsertDeleteEnabled): added new method + +2008-10-14 Ada Chan <adachan@apple.com> + + Fix windows build. + + Reviewed by Sam Weinig. + + * DumpRenderTree/cg/PixelDumpSupportCG.cpp: + * DumpRenderTree/config.h: + * DumpRenderTree/win/DumpRenderTreeWin.h: + * DumpRenderTree/win/LayoutTestControllerWin.cpp: + * DumpRenderTree/win/UIDelegate.cpp: + +2008-10-13 Timothy Hatcher <timothy@apple.com> + + Make prepare-ChangeLog populate the changed functions for JavaScript files. + + https://bugs.webkit.org/show_bug.cgi?id=21567 + + Reviewed by David Kilzer. + + * Scripts/prepare-ChangeLog: + (get_function_line_ranges): Call get_function_line_ranges_for_javascript for + files that end with ".js". + (get_function_line_ranges_for_javascript): Find functions, anonymous functions + and getters/setters. + +2008-10-14 Alp Toker <alp@nuanti.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=16299 + Add a config.h file to DRT + + Add a config.h to DumpRenderTree and reduce use of DumpRenderTree.h as + an ad-hoc config header. + + * DumpRenderTree/AccessibilityController.cpp: + * DumpRenderTree/AccessibilityUIElement.cpp: + * DumpRenderTree/AccessibilityUIElement.h: + * DumpRenderTree/DumpRenderTree.h: + * DumpRenderTree/GCController.cpp: + * DumpRenderTree/LayoutTestController.cpp: + * DumpRenderTree/WorkQueue.cpp: + * DumpRenderTree/config.h: Added. + * DumpRenderTree/gtk/DumpRenderTree.cpp: + * DumpRenderTree/gtk/GCControllerGtk.cpp: + * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: + * DumpRenderTree/gtk/WorkQueueItemGtk.cpp: + * DumpRenderTree/win/AccessibilityControllerWin.cpp: + * DumpRenderTree/win/AccessibilityUIElementWin.cpp: + * DumpRenderTree/win/DumpRenderTree.cpp: + * DumpRenderTree/win/DumpRenderTreeWin.h: + * DumpRenderTree/win/EditingDelegate.cpp: + * DumpRenderTree/win/EventSender.cpp: + * DumpRenderTree/win/FrameLoadDelegate.cpp: + * DumpRenderTree/win/GCControllerWin.cpp: + * DumpRenderTree/win/MD5.cpp: + * DumpRenderTree/win/PixelDumpSupportWin.cpp: + * DumpRenderTree/win/PolicyDelegate.cpp: + * DumpRenderTree/win/ResourceLoadDelegate.cpp: + * DumpRenderTree/win/WorkQueueItemWin.cpp: + * GNUmakefile.am: + +2008-10-13 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Beth Dakin. + + Added a method to get the links in a webpage + + * DumpRenderTree/AccessibilityUIElement.cpp: + (attributesOfDocumentLinksCallback): + (AccessibilityUIElement::getJSClass): + * DumpRenderTree/AccessibilityUIElement.h: + * DumpRenderTree/mac/AccessibilityUIElementMac.mm: + (AccessibilityUIElement::getDocumentLinks): + (AccessibilityUIElement::attributesOfDocumentLinks): + * DumpRenderTree/win/AccessibilityUIElementWin.cpp: + (AccessibilityUIElement::getDocumentLinks): + (AccessibilityUIElement::attributesOfDocumentLinks): + +2008-10-13 David Kilzer <ddkilzer@apple.com> + + Bug 21457: resolve-ChangeLogs should be able to operate on a git revision range + + <https://bugs.webkit.org/show_bug.cgi?id=21457> + + Reviewed by Adam. + + * Scripts/resolve-ChangeLogs: Added optional parameter to + -f|--fix-merged switch to run the script on a revision range. + Updated command-line validation checks. + (findChangeLog): Fixed long-standing bug that should have used + $_[0] instead of $_. + (fixMergedChangeLog): Renamed to fixOneMergedChangeLog($). Updated + to work when called from git filter-branch. It always restores a + copy of the previous revision before reapplying the patch. + (fixMergedChangeLogs): Added. Calls itself through git filter-branch + to re-merge ChangeLog files across a revision range. Removes + .git/refs/original directory on success. + (parseFixMerged): Added. Custom method to parse the -f|--fix-merged + switch. + (removeChangeLogArguments): Added. Removes items from @ARGV when + they are ChangeLog paths, and return a list of paths. This makes it + easier to validate the command-line. + (resolveChangeLog): Added. Extracted from main code block. Runs + the traditional single-file merge algorithm. + (usageAndExit): Added. Extracted from main code block. Prints + usage statement and exits with error status. + +2008-10-12 Darin Adler <darin@apple.com> + + * Scripts/make-js-test-wrappers: Update exceptions list so the script + won't overwrite files and mangle tests. + +2008-10-11 Dan Bernstein <mitz@apple.com> + + Reviewed by Sam Weinig and Anders Carlsson. + + - update Mac DumpRenderTree to use the new WebView SPI for forcing the + complex text code path + - add --complex-text support to Windows DumpRenderTree + + * DumpRenderTree/mac/DumpRenderTree.mm: + (dumpRenderTree): + * DumpRenderTree/win/DumpRenderTree.cpp: + (createWebViewAndOffscreenWindow): + (main): + * Scripts/run-webkit-tests: + +2008-10-09 Eric Seidel <eric@webkit.org> + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=21498 + + * Scripts/make-js-test-wrappers: ignore resources/shadow-offset.js + +2008-10-09 Cameron Zwarich <zwarich@apple.com> + + Not reviewed. + + Add StructureID.o to the exclusion list in the global initializers + script to fix the Debug build. + + * Scripts/check-for-global-initializers: + +2008-10-08 Mark Rowe <mrowe@apple.com> + + Fix the Windows build after r37434. + + * DumpRenderTree/win/DumpRenderTree.cpp: + (dump): Update code to approximate valid C++ syntax. + +2008-10-08 Timothy Hatcher <timothy@apple.com> + + Add SVGElementInstance to the list of exceptions that have + global initializers in debug builds. + + Rubber-stamped by Mark Rowe. + + * Scripts/check-for-global-initializers: Add SVGElementInstance.o. + +2008-10-08 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Dan Bernstein + + Avoid disconnect between DRT and run-webkit-tests + about whether to expect PNG dumps by having DRT always + print two blocks terminated by #EOF, the second of which + may be empty. + + https://bugs.webkit.org/show_bug.cgi?id=21483 + + * DumpRenderTree/cg/PixelDumpSupportCG.cpp: + (printPNG): + (dumpWebViewAsPixelsAndCompareWithExpected): + * DumpRenderTree/mac/DumpRenderTree.mm: + (dump): + * DumpRenderTree/win/DumpRenderTree.cpp: + (dump): + * Scripts/run-webkit-tests: + +2008-10-07 Adam Roben <aroben@apple.com> + + Make sure short functions get included in ChangeLog output for git + repositories + + Reviewed by Dave Kilzer. + + * Scripts/prepare-ChangeLog: + (sub diffCommand): Pass -U0 to git diff so that each contiguous change + will get its own chunk without any surrounding context. + (sub extractLineRange): Use the line numbers from the chunk header + without modifying them now that they're accurate. + +2008-10-04 Mark Rowe <mrowe@apple.com> + + Reviewed by Tim Hatcher. + + Update check-for-weak-vtables to check only the final linked image for weak vtables. + This gives more useful results than checking each object file independently. + + * Scripts/check-for-weak-vtables: + +2008-10-03 Pierre-Olivier Latour <pol@apple.com> + + Reviewed by Darin Adler + + Render images to RGBA8 bitmaps independently of platform endianness. + + Create image difference bitmap in reference image colorspace instead of device colorspace + (which depends on the main display profile), so that no color matching happens. + + https://bugs.webkit.org/show_bug.cgi?id=21336 + + * DumpRenderTree/cg/ImageDiffCG.cpp: + (createDifferenceBitmap): + (computePercentageDifferent): + (compareImages): + +2008-10-02 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Darin Adler + + Fix hang when running with --pixel --reset, which occurs + because DRT spews PNG data when the script does not expect it. + + https://bugs.webkit.org/show_bug.cgi?id=21323 + + * Scripts/run-webkit-tests: + +2008-09-30 Mark Rowe <mrowe@apple.com> + + Reviewed by Dan Bernstein. + + Add a leak counter for CachedResources since we've had two recent leaks involving them. + + * Scripts/check-for-global-initializers: + +2008-09-30 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Dan Bernstein. + + Fix many leaks seen on fast/backgrounds/svg-as-background-1.html. + + JavaScript wrappers were keeping DOM objects alive, which was leading to the SVG background image + being kept alive in the memory cache past our last attempt to empty the cache prior to quitting. + We need to empty the memory cache after forcing a JavaScript garbage collection to ensure that + any live JavaScript wrappers are collected and their corresponding DOM objects have a chance to be + torn down before we exit. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (dumpRenderTree): + (main): + +2008-09-30 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Dan Bernstein + + Don't run pixel comparison for text-only tests. + https://bugs.webkit.org/show_bug.cgi?id=21124 + + * DumpRenderTree/mac/DumpRenderTree.mm: + (dump): + * Scripts/run-webkit-tests: + +2008-09-29 Thiago Macieira <thiago.macieira@nokia.com> + + Reviewed by Simon. + + Changed copyright from Trolltech ASA to Nokia. + + Nokia acquired Trolltech ASA, assets were transferred on September 26th 2008. + + + * DumpRenderTree/qt/DumpRenderTree.cpp: + * DumpRenderTree/qt/jsobjects.cpp: + * DumpRenderTree/qt/jsobjects.h: + * DumpRenderTree/qt/main.cpp: + * DumpRenderTree/qt/testplugin.cpp: + * DumpRenderTree/qt/testplugin.h: + +2008-09-28 David Kilzer <ddkilzer@apple.com> + + Bug 21185: resolve-ChangeLogs should be able to fix poorly merged ChangeLog entries after a git svn rebase + + <https://bugs.webkit.org/show_bug.cgi?id=21185> + + Reviewed by Adam. + + * Scripts/resolve-ChangeLogs: Added new -f|--fix-merge switch that + will attempt to reapply the last commit to a ChangeLog file such + that the ChangeLog entry appears at the top of the file. + (findChangeLog): Added prototype and moved method below the exit + statement. + (fixMergedChangeLog): Added. Method to fix incorrectly merged + ChangeLog entries. + +2008-09-27 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=21178 + <rdar://problem/6248651> + + Return the result value from getURL. + + * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: + (getURL): + +2008-09-26 Matt Lilek <webkit@mattlilek.com> + + Reviewed by Tim Hatcher. + + Update FEATURE_DEFINES after ENABLE_CROSS_DOCUMENT_MESSAGING was removed. + + * Scripts/build-webkit: + +2008-09-26 Alice Liu <alice.liu@apple.com> + + Remove usage of atlstr.h and CString for VCExpress compatibility + + Reviewed by Stephanie Lewis. + + * record-memory-win/main.cpp: + (ProcessArgs): + (UseImage): + (QueryContinuously): + (OneQuery): + (OneQueryMP): + +2008-09-26 Kevin Ollivier <kevino@theolliviers.com> + + wx build fix. Update the version of libpng. + + * wx/install-unix-extras: + +2008-09-24 Sam Weinig <sam@webkit.org> + + Reviewed by Darin Adler. + + Fix for https://bugs.webkit.org/show_bug.cgi?id=21080 + <rdar://problem/6243534> + Crash below Function.apply when using a runtime array as the argument list + + Add method to ObjCController to return a runtime array. + + * DumpRenderTree/mac/ObjCController.m: + (+[ObjCController isSelectorExcludedFromWebScript:]): + (+[ObjCController webScriptNameForSelector:]): + (-[ObjCController testArray]): + +2008-09-24 Beth Dakin <bdakin@apple.com> + + Reviewed by Sam Weinig. + + Speculative build fix. + + * DumpRenderTree/win/AccessibilityUIElementWin.cpp: + (AccessibilityUIElement::supportsPressAction): + +2008-09-23 Beth Dakin <bdakin@apple.com> + + Reviewed by Sam Weinig. + + This patch extends DumpRenderTree's AccessibilityController to ask + if the focused element supports the press action. + + * DumpRenderTree/AccessibilityUIElement.cpp: + (getSupportsPressActionCallback): + (AccessibilityUIElement::getJSClass): + * DumpRenderTree/AccessibilityUIElement.h: + * DumpRenderTree/mac/AccessibilityUIElementMac.mm: + (AccessibilityUIElement::supportsPressAction): + +2008-09-22 Alice Liu <alice.liu@apple.com> + + Adding a stand-alone Windows console application to record a process's memory usage + + Reviewed by Steve Falkenburg. + + * record-memory-win: Added. + * record-memory-win/main.cpp: Added. + * record-memory-win/record-memory-win.vcproj: Added. + +2008-09-22 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Darin Adler. + + Support ability to get/set selected text ranges for text controls through AX. + + * DumpRenderTree/AccessibilityUIElement.cpp: + (setSelectedTextRangeCallback): + (getSelectedTextRangeCallback): + (AccessibilityUIElement::getJSClass): + * DumpRenderTree/AccessibilityUIElement.h: + * DumpRenderTree/mac/AccessibilityUIElementMac.mm: + (AccessibilityUIElement::attributesOfRowHeaders): + (AccessibilityUIElement::attributesOfVisibleCells): + (AccessibilityUIElement::rowIndexRange): + (AccessibilityUIElement::columnIndexRange): + (AccessibilityUIElement::cellForColumnAndRow): + (AccessibilityUIElement::selectedTextRange): + (AccessibilityUIElement::setSelectedTextRange): + * DumpRenderTree/win/AccessibilityUIElementWin.cpp: + (AccessibilityUIElement::selectedTextRange): + (AccessibilityUIElement::setSelectedTextRange): + +2008-09-20 Darin Adler <darin@apple.com> + + * DumpRenderTree/mac/DumpRenderTree.mm: + (convertMIMEType): Turn on Stephanie's workaround for Tiger too. + +2008-09-19 Alp Toker <alp@nuanti.com> + + Build fix for the 'gold' linker and recent binutils. New behaviour + requires that we link to used libraries explicitly. + + * GNUmakefile.am: + +2008-09-19 Stephanie Lewis <slewis@apple.com> + + Reviewed by Oliver Hunt. + + Implement a workaround for an incorrect mime-type on machines with + Dashcode 2.0.1. Dashcode is overriding the UTI type for .js files. + See radar <rdar://problem/6234318>. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (convertMIMEType): + +2008-09-19 Chris Fleizach <cfleizach@apple.com> + + Fixed Windows bustage + + * DumpRenderTree/win/AccessibilityUIElementWin.cpp: + (AccessibilityUIElement::titleUIElement): + +2008-09-18 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Darin Adler. + + Expose titleUIElement call for DumpRenderTree + + * ChangeLog: + * DumpRenderTree/AccessibilityUIElement.cpp: + (titleUIElementCallback): + (AccessibilityUIElement::getJSClass): + * DumpRenderTree/AccessibilityUIElement.h: + * DumpRenderTree/mac/AccessibilityUIElementMac.mm: + (AccessibilityUIElement::titleUIElement): + +2008-09-18 Darin Adler <darin@apple.com> + + * Scripts/do-webcore-rename: More renaming plans. + +2008-09-18 Mark Rowe <mrowe@apple.com> + + Reviewed by Dan Bernstein. + + Clear the main frame's name between tests to get more consistent test results + when running the WebKit tests with --nthly. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (resetWebViewToConsistentStateBeforeTesting): + * DumpRenderTree/win/DumpRenderTree.cpp: + (resetWebViewToConsistentStateBeforeTesting): + +2008-09-18 Stephanie Lewis <slewis@apple.com> + + Really fix tiger jsc tests. + + * Scripts/run-javascriptcore-tests: + +2008-09-18 Stephanie Lewis <slewis@apple.com> + + Reviewed by Maciej Stachowiak. + + Fix jsc tests on Tiger. Make jsc tests smarter about when to use the arch flag. + + * Scripts/run-javascriptcore-tests: + * Scripts/webkitdirs.pm: + +2008-09-18 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Sam Weinig. + + Print warning to stdout rather than stderr when a test attempts to access a remote resource. + This should make it more obvious when a test does this, as stderr output tends to be obscured + by noise in the test results. + + Also fixes some coding style issues in ResourceLoadDelegate.mm. + + * DumpRenderTree/mac/ResourceLoadDelegate.mm: + (-[NSError _drt_descriptionSuitableForTestResult]): + (-[NSURL _drt_descriptionSuitableForTestResult]): + (-[ResourceLoadDelegate webView:identifierForInitialRequest:fromDataSource:]): + (-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]): + (-[ResourceLoadDelegate webView:resource:didReceiveResponse:fromDataSource:]): + (-[ResourceLoadDelegate webView:resource:didFinishLoadingFromDataSource:]): + (-[ResourceLoadDelegate webView:resource:didFailLoadingWithError:fromDataSource:]): + (-[ResourceLoadDelegate webView:resource:willCacheResponse:fromDataSource:]): + +2008-09-18 Stephanie Lewis <slewis@apple.com> + + Reviewed by Mark Rowe and Maciej Stachowiak.. + + add a --64-bit option and specify which architecture to run on Mac. + + * Scripts/run-javascriptcore-tests: + +2008-09-17 Mark Rowe <mrowe@apple.com> + + Reviewed by Sam Weinig. + + Fix a crash seen running DumpRenderTree on fast/dom/null-document-window-open-crash.html under guard malloc. + + The JS wrapper for LayoutTestController could outlive the wrapped instance, and would crash when + attempting to access the wrapped instance within layoutTestControllerObjectFinalize. We fix this by making + LayoutTestController ref-counted to ensure that it is not outlived by the JS wrapper. + + * DumpRenderTree/ForwardingHeaders/wtf/RefCounted.h: Copied from JavaScriptGlue/ForwardingHeaders/wtf/RefCounted.h. + * DumpRenderTree/LayoutTestController.cpp: + (LayoutTestController::LayoutTestController): + (notifyDoneCallback): Remove code that is no longer needed now that we must always have a wrapped instance. + (layoutTestControllerObjectFinalize): Deref the wrapped object. + (LayoutTestController::makeWindowObject): Ref the wrapped object. + * DumpRenderTree/LayoutTestController.h: Make LayoutTestController RefCounted. + * DumpRenderTree/mac/DumpRenderTree.mm: + (runTest): Deref the LayoutTestController object rather than explicitly deleting it. + * DumpRenderTree/mac/LayoutTestControllerMac.mm: Remove code that is no longer needed. + * DumpRenderTree/win/DumpRenderTree.cpp: + (runTest): Deref the LayoutTestController object rather than explicitly deleting it. + +2008-09-16 Sam Weinig <sam@webkit.org> + + Reviewed by Mark Rowe. + + Add flag to disable running sample on tests that timeout. + + * Scripts/run-webkit-tests: + +2008-09-16 Adam Roben <aroben@apple.com> + + Windows build fix after r36511 + + Update for rename of layoutTestController to gLayoutTestController. + + * DumpRenderTree/LayoutTestController.cpp: + * DumpRenderTree/win/EditingDelegate.cpp: + * DumpRenderTree/win/FrameLoadDelegate.cpp: + * DumpRenderTree/win/ResourceLoadDelegate.cpp: + * DumpRenderTree/win/UIDelegate.cpp: + +2008-09-16 Adam Roben <aroben@apple.com> + + Add a script to print out the dependency tree of a Visual Studio + solution file + + * Scripts/print-msvc-project-dependencies: Added. + +2008-09-16 Mark Rowe <mrowe@apple.com> + + Fix the build. + + * DumpRenderTree/LayoutTestController.cpp: + (notifyDoneCallback): Call fprintf in a safer manner. + +2008-09-16 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Eric Seidel + + Protect against tests that call layoutTestController.notifyDone() + more than once, which would lead to memory corruption, by nulling + out the LayoutTestController on the JSObjectRef on destruction. Also + add a finalize callback on the class so that if the LTC outlives + the JSObjectRef, the JSObjectRef backpointer on the LTC can be + nulled out. + + https://bugs.webkit.org/show_bug.cgi?id=20875 + + * DumpRenderTree/LayoutTestController.cpp: + (LayoutTestController::LayoutTestController): + (notifyDoneCallback): + (layoutTestControllerObjectFinalize): + (LayoutTestController::makeWindowObject): + (LayoutTestController::getJSClass): + * DumpRenderTree/LayoutTestController.h: + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (LayoutTestController::~LayoutTestController): + +2008-09-16 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Eric Seidel + + Step 1 patch: rename global variable for clarity. + https://bugs.webkit.org/show_bug.cgi?id=20875 + + * DumpRenderTree/DumpRenderTree.h: + * DumpRenderTree/cg/PixelDumpSupportCG.cpp: + (dumpWebViewAsPixelsAndCompareWithExpected): + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (dumpFramesAsText): + (dump): + (runTest): + (processWork): + (webViewLoadFinished): + (webViewWindowObjectCleared): + * DumpRenderTree/mac/DumpRenderTree.mm: + (allocateGlobalControllers): + (dumpFrameScrollPosition): + (dumpFramesAsText): + (methodNameStringForFailedTest): + (dump): + (runTest): + * DumpRenderTree/mac/DumpRenderTreeMac.h: + * DumpRenderTree/mac/DumpRenderTreeWindow.mm: + * DumpRenderTree/mac/EditingDelegate.mm: + (-[EditingDelegate webView:shouldBeginEditingInDOMRange:]): + (-[EditingDelegate webView:shouldInsertNode:replacingDOMRange:givenAction:]): + (-[EditingDelegate webView:shouldInsertText:replacingDOMRange:givenAction:]): + (-[EditingDelegate webView:shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting:]): + (-[EditingDelegate webView:shouldApplyStyle:toElementsInDOMRange:]): + (-[EditingDelegate webView:shouldChangeTypingStyle:toStyle:]): + (-[EditingDelegate webViewDidBeginEditing:]): + (-[EditingDelegate webViewDidChange:]): + (-[EditingDelegate webViewDidEndEditing:]): + (-[EditingDelegate webViewDidChangeTypingStyle:]): + * DumpRenderTree/mac/FrameLoadDelegate.mm: + (-[FrameLoadDelegate processWork:]): + (-[FrameLoadDelegate webView:locationChangeDone:forDataSource:]): + (-[FrameLoadDelegate webView:didStartProvisionalLoadForFrame:]): + (-[FrameLoadDelegate webView:didCommitLoadForFrame:]): + (-[FrameLoadDelegate webView:didFinishLoadForFrame:]): + (-[FrameLoadDelegate webView:didClearWindowObject:forFrame:]): + (-[FrameLoadDelegate webView:didReceiveTitle:forFrame:]): + * DumpRenderTree/mac/ResourceLoadDelegate.mm: + (-[ResourceLoadDelegate webView:identifierForInitialRequest:fromDataSource:]): + * DumpRenderTree/mac/UIDelegate.mm: + (-[UIDelegate webView:dragImage:at:offset:event:pasteboard:source:slideBack:forView:]): + (-[UIDelegate webViewFocus:]): + (-[UIDelegate webViewUnfocus:]): + (-[UIDelegate webView:createWebViewWithRequest:]): + (-[UIDelegate webViewClose:]): + * DumpRenderTree/win/DumpRenderTree.cpp: + (dumpFrameScrollPosition): + (dumpFramesAsText): + (dump): + (runTest): + +2008-09-15 Alice Liu <alice.liu@apple.com> + + A change needed to make PPC bots pass accessibility/table-cell-spans.html layout test + + Reviewed by Stephanie Lewis. + + * DumpRenderTree/mac/AccessibilityUIElementMac.mm: + Calling -[NSValue rangeValue] on nil object was returning bogus results on PPC, + but not Intel. Add a check for nil before calling. + (AccessibilityUIElement::rowIndexRange): + (AccessibilityUIElement::columnIndexRange): + +2008-09-14 Mark Rowe <mrowe@apple.com> + + Build fix. + + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (waitUntilDoneWatchdogFired): + * DumpRenderTree/mac/ObjCPlugin.m: + +2008-09-08 Dan Bernstein <mitz@apple.com> + + Reviewed by Mark Rowe. + + - add an option to run-webkit-tests to always use the complex text code path + + * DumpRenderTree/mac/DumpRenderTree.mm: + (initializeGlobalsFromCommandLineOptions): + (dumpRenderTree): + * Scripts/run-webkit-tests: + +2008-09-08 Steve Falkenburg <sfalken@apple.com> + + Another Windows nightly build fix. + + Reviewed by Sam Weinig. + + * FindSafari/FindSafari.cpp: + (_tmain): Delete existing WebKitNightly directory in temp. + * FindSafari/Safari.exe.manifest: Add PROGIDs for each COM class. Remove non-production classes. + +2008-09-07 Stephanie Lewis <slewis@apple.com> + + Reviewed by Mark Rowe. + + Fix DRT build + + * DumpRenderTree/DumpRenderTreePrefix.h: + * DumpRenderTree/win/DumpRenderTree.vcproj: + +2008-09-06 Steve Falkenburg <sfalken@apple.com> + + Fix Windows nightlies. + + Copy WebKit.dll alongside application so registry-free COM can find it. + Update embedded manifest to force use registry-free COM. + + Reviewed by Dave Hyatt. + + * FindSafari/FindSafari.cpp: + (copyManifest): + (replaceManifest): + (_tmain): + * FindSafari/FindSafari.rc: Added. + * FindSafari/FindSafari.vcproj: + * FindSafari/Safari.exe.manifest: Added. + * FindSafari/resource.h: Added. + +=== End merge of squirrelfish-extreme === + +2008-08-31 Mark Rowe <mrowe@apple.com> + + Reviewed by Maciej Stachowiak. + + Add a --profile flag to run-sunspider. + + * Scripts/webkitdirs.pm: Detect --profile or --profiling passed as a command-line argument + to build scripts as indicating that we should use the "Profiling" configuration. At present + this is only supported by JavaScriptCore, so using this argument to build any other project + will likely result in unexpected behaviour. + +2008-08-27 Mark Rowe <mrowe@apple.com> + + Reviewed by Oliver Hunt. + + Fix run-webkit-tests to handle DRT exiting early. + + * Scripts/run-webkit-tests: Initialize $expectedResultPaths{$base} before it will be used. + +=== Start merge of squirrelfish-extreme === + +2008-09-04 Mark Rowe <mrowe@apple.com> + + Reviewed by Eric Seidel. + + Fix https://bugs.webkit.org/show_bug.cgi?id=20639. + Bug 20639: ENABLE_DASHBOARD_SUPPORT does not need to be a FEATURE_DEFINE + + * Scripts/build-webkit: Remove ENABLE_DASHBOARD_SUPPORT-related code. + +2008-09-04 Cameron Zwarich <cwzwarich@uwaterloo.ca> + + Reviewed by Oliver Hunt. + + Bug 20616: Incorporate V8 benchmarks in testing + <https://bugs.webkit.org/show_bug.cgi?id=20616> + + Add support for the --v8 option to run-sunspider. + + * Scripts/run-sunspider: + +2008-09-04 Kevin Ollivier <kevino@theolliviers.com> + + wx buildbot fix. More robust handling of clean when makefiles are not built or + are not completely made. + + * wx/build-wxwebkit: + +2008-09-03 Mark Rowe <mrowe@apple.com> + + More Mac build fixes. + + Set ENABLE_DASHBOARD_SUPPORT when building for Mac via build-webkit. + Also set ENABLE_CROSS_DOCUMENT_MESSAGING in order to match the + default configuration specified in the .xcconfig files. + + * Scripts/build-webkit: + +2008-09-03 Mark Rowe <mrowe@apple.com> + + Mac build fix. Ensure that dashboard support is enabled. + + * DumpRenderTree/mac/Configurations/Base.xcconfig: + +2008-08-25 Steve Falkenburg <sfalken@apple.com> + + Build fix. Copy correct version of ICU. + + * DumpRenderTree/win/DumpRenderTree.vcproj: + +2008-08-25 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Simon. + + [run-webkit-tests] Use QtLauncher to show the results of the tests + konqueror might not be installed, xdg-open might not be installed but the + QtLauncher should be present. + + * Scripts/run-webkit-tests: + +2008-08-24 Jon Honeycutt <jhoneycutt@apple.com> + + Initial support for accessibility layout tests on Windows. + https://bugs.webkit.org/show_bug.cgi?id=20497 + + Reviewed by Sam Weinig. + + * DumpRenderTree/AccessibilityController.h: Fix typos. + * DumpRenderTree/AccessibilityUIElement.cpp: Change #import to #include. + * DumpRenderTree/AccessibilityUIElement.h: Define _WINSOCKAPI_ to + prevent oleacc.h, which includes windows.h, from including winsock.h. + Fixed typos. + * DumpRenderTree/win/AccessibilityControllerWin.cpp: Added. + (AccessibilityController::AccessibilityController): + (AccessibilityController::~AccessibilityController): + (AccessibilityController::focusedElement): Get the root element, and + request its focused object. + (AccessibilityController::rootElement): Query Windows for the + accessible client object for the WebView's window. + * DumpRenderTree/win/AccessibilityUIElementWin.cpp: Added. + (AccessibilityUIElement::AccessibilityUIElement): + (AccessibilityUIElement::~AccessibilityUIElement): + (AccessibilityUIElement::getLinkedUIElements): Not implemented. + (AccessibilityUIElement::getChildren): Get the child count, and append + each child. + (AccessibilityUIElement::getChildAtIndex): Get the child at the given + index offset by 1. In MSAA, child 0 is the object itself. + (AccessibilityUIElement::allAttributes): Not implemented. + (AccessibilityUIElement::attributesOfLinkedUIElements): Same. + (AccessibilityUIElement::attributesOfChildren): Same. + (AccessibilityUIElement::parameterizedAttributeNames): Same. + (self): Return a VARIANT representing the "self" object. This is used + when calling methods that require a child variant. + (AccessibilityUIElement::role): Get the MSAA role, a long value, and + convert it into a string with GetRoleText(). + (AccessibilityUIElement::title): Get the element's title, and convert + it to a JS String. + (AccessibilityUIElement::description): Same, for description. + (AccessibilityUIElement::width): + (AccessibilityUIElement::height): + (AccessibilityUIElement::intValue): Get the object's value as a string, + and convert the string to a double. + (AccessibilityUIElement::minValue): Not implemented. + (AccessibilityUIElement::maxValue): Same. + (AccessibilityUIElement::insertionPointLineNumber): Same. + (AccessibilityUIElement::attributesOfColumnHeaders): Same. + (AccessibilityUIElement::attributesOfRowHeaders): Same. + (AccessibilityUIElement::attributesOfColumns): Same. + (AccessibilityUIElement::attributesOfRows): Same. + (AccessibilityUIElement::attributesOfVisibleCells): Same. + (AccessibilityUIElement::attributesOfHeader): Same. + (AccessibilityUIElement::indexInTable): Same. + (AccessibilityUIElement::rowIndexRange): Same. + (AccessibilityUIElement::columnIndexRange): Same. + (AccessibilityUIElement::lineForIndex): Same. + (AccessibilityUIElement::boundsForRange): Same. + (AccessibilityUIElement::cellForColumnAndRow): Same. + * DumpRenderTree/win/DumpRenderTree.vcproj: Add accessibility files to + project. Link to oleacc.lib, the MSAA library. + * DumpRenderTree/win/FrameLoadDelegate.cpp: + (FrameLoadDelegate::FrameLoadDelegate): Initialize the accessibility + controller. + (FrameLoadDelegate::didClearWindowObject): Create a new window object + for the accessibility controller. + * DumpRenderTree/win/FrameLoadDelegate.h: + +2008-08-21 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Mark Rowe + + Make build-launcher-app work when run from a git repository. + https://bugs.webkit.org/show_bug.cgi?id=20478 + + * BuildSlaveSupport/build-launcher-app: + +2008-08-20 Maxime Britto <britto@apple.com> + + Reviewed by Ada Chan. + + rdar://5259746 + Mouse events are sent to page while resizing window (affects Gmail) + + * DumpRenderTree/win/UIDelegate.h: + (UIDelegate::webViewSendResizeMessage): Add the new interface method, not implemented. + +2008-08-19 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Beth Dakin. + + Add snowleopard platform in layout tests + + Added support for accessing the attributes of + accessibility tables through the accessibility controller + in DumpRenderTree + + * DumpRenderTree/AccessibilityUIElement.cpp: + (attributesOfColumnHeadersCallback): + (attributesOfRowHeadersCallback): + (attributesOfColumnsCallback): + (attributesOfRowsCallback): + (attributesOfVisibleCellsCallback): + (attributesOfHeaderCallback): + (indexInTableCallback): + (rowIndexRangeCallback): + (columnIndexRangeCallback): + (childAtIndexCallback): + (cellForColumnAndRowCallback): + (AccessibilityUIElement::getJSClass): + * DumpRenderTree/AccessibilityUIElement.h: + * DumpRenderTree/mac/AccessibilityUIElementMac.mm: + (convertNSArrayToVector): + (descriptionOfElements): + (AccessibilityUIElement::getLinkedUIElements): + (AccessibilityUIElement::getChildren): + (AccessibilityUIElement::attributesOfLinkedUIElements): + (AccessibilityUIElement::attributesOfChildren): + (AccessibilityUIElement::attributesOfColumnHeaders): + (AccessibilityUIElement::attributesOfRowHeaders): + (AccessibilityUIElement::attributesOfColumns): + (AccessibilityUIElement::attributesOfRows): + (AccessibilityUIElement::attributesOfVisibleCells): + (AccessibilityUIElement::attributesOfHeader): + (AccessibilityUIElement::indexInTable): + (AccessibilityUIElement::rowIndexRange): + (AccessibilityUIElement::columnIndexRange): + (AccessibilityUIElement::cellForColumnAndRow): + * Scripts/run-webkit-tests: + +2008-08-19 Alexey Proskuryakov <ap@webkit.org> + + Reviewed by Darin Adler. + + Fix run-webkit-tests misreporting crashed tests as timed out ones because DumpRenderTree + is waiting for crash reporter to let it exit. + + The fix does not work on Tiger, because the state of the process is indistinguishable from + other waiting processes, at least not with this technique. + + * Scripts/run-webkit-tests: + +2008-08-18 Alp Toker <alp@nuanti.com> + + Reviewed by Holger Freyther. + + https://bugs.webkit.org/show_bug.cgi?id=20350 + [GTK] Get DumpRenderTree working + + Fixes and enhancements to DumpRenderTree. With these changes, the test + suite can now complete a run producing text and render tree dumps. + + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (dumpFramesAsText): + (dump): + (runTest): + (webViewLoadFinished): + (webViewWindowObjectCleared): + (webViewConsoleMessage): + (webViewScriptAlert): + (webViewScriptPrompt): + (webViewScriptConfirm): + (webViewTitleChanged): + (main): + * DumpRenderTree/gtk/DumpRenderTreeGtk.h: + * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: + (LayoutTestController::clearBackForwardList): + (LayoutTestController::pathToLocalResource): + (LayoutTestController::setAcceptsEditing): + (LayoutTestController::setUserStyleSheetEnabled): + (LayoutTestController::setUserStyleSheetLocation): + (waitToDumpWatchdogFired): + (LayoutTestController::windowCount): + * DumpRenderTree/gtk/WorkQueueItemGtk.cpp: + (JSStringCopyUTF8CString): + (ScriptItem::invoke): + +2008-08-17 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Cameron Zwarich. + + Updated project files to XCode 3.1. + + * DrawTest/DrawTest.xcodeproj/project.pbxproj: + * WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj: + +2008-08-15 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Geoff Garen. + + <rdar://problem/6139914> Please include a _debug version of JavaScriptCore framework + + * Scripts/check-for-global-initializers: Ignore initializers when building the debug variant. + +2008-08-13 Simon Hausmann <hausmann@webkit.org> + + Rubber-stamped by Holger. + + Revert r31585 and disable http tests for the Qt build again unless + explicitly enabled. + + Running the http tests unfortunately currently still triggers + failures in non-http tests due to side-effects. Disable them by default for + now, for more reliable results. + + * Scripts/run-webkit-tests: + +2008-08-10 Jan Michael Alonzo <jmalonzo@webkit.org> + + Reviewed (and updated) by Alp Toker. + + https://bugs.webkit.org/show_bug.cgi?id=16620 + [GTK] Autotools make dist and make check support + + Get make dist working. + + Note that not all possible configurations have been tested yet. + + * GNUmakefile.am: + +2008-08-10 Alp Toker <alp@nuanti.com> + + Remove leftover qmake/GTK+ build files. + + * DumpRenderTree/gtk/DumpRenderTree.pro: Removed. + * GtkLauncher/GtkLauncher.pro: Removed. + +2008-08-06 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Beth Dakin + + AX functions shouldn't return position information because it changes + based on the platform + + * DumpRenderTree/mac/AccessibilityUIElementMac.mm: + (AccessibilityUIElement::boundsForRange): + +2008-08-06 Eric Seidel <eric@webkit.org> + + Reviewed by darin. + + Fix leaks seen on build-bot by fixing memory management of AccessibilityUIElement. + <https://bugs.webkit.org/show_bug.cgi?id=20297> + <rdar://problem/6093153> + + I've made AccessibilityUIElement a stack object for now. It could be + made RefCounted, but I figured that might be overkill for the moment. + Essentially it's just a RefPtr itself. :) + + I also fixed a few typos, such as AccessibilityUIElement() instead of ~AccessibilityUIElement() + which was causing additional leaks. :) + + I added toAXElement to remove a bunch of copy/paste code. + + * DumpRenderTree/AccessibilityController.h: + * DumpRenderTree/AccessibilityUIElement.cpp: + (toAXElement): + (allAttributesCallback): + (attributesOfLinkedUIElementsCallback): + (attributesOfChildrenCallback): + (lineForIndexCallback): + (boundsForRangeCallback): + (childAtIndexCallback): + (getRoleCallback): + (getTitleCallback): + (getDescriptionCallback): + (getWidthCallback): + (getHeightCallback): + (getIntValueCallback): + (getMinValueCallback): + (getMaxValueCallback): + (getInsertionPointLineNumberCallback): + (finalize): + * DumpRenderTree/AccessibilityUIElement.h: + (AccessibilityUIElement::platformUIElement): + * DumpRenderTree/mac/AccessibilityControllerMac.mm: + (AccessibilityController::focusedElement): + * DumpRenderTree/mac/AccessibilityUIElementMac.mm: + (AccessibilityUIElement::AccessibilityUIElement): + (AccessibilityUIElement::getLinkedUIElements): + (AccessibilityUIElement::getChildren): + (AccessibilityUIElement::getChildAtIndex): + (AccessibilityUIElement::attributesOfLinkedUIElements): + (AccessibilityUIElement::attributesOfChildren): + +2008-08-06 Eric Seidel <eric@webkit.org> + + Reviewed by Cameron Zwarich. + + Speculative fix for an error I keep seeing in my Cygwin build + + * Scripts/webkitdirs.pm: make determineConfigurationProductDir() always call determineConfiguration() even on cygwin + +2008-08-02 Kevin Ollivier <kevino@theolliviers.com> + + Forgot to commit licensing correction in last commit. + + * wx/packaging/wxWebKitInstaller.iss.in: + +2008-08-02 Kevin Ollivier <kevino@theolliviers.com> + + Reviewed by Eric Seidel. + + Scripts for building a wxWebKit installer for wxPython on Win, eventually will + be used for nightlies. + + https://bugs.webkit.org/show_bug.cgi?id=20036 + + * wx/packaging: Added. + * wx/packaging/build-win-installer.py: Added. + * wx/packaging/wxWebKitInstaller.iss.in: Added. + +2008-07-31 Adam Roben <aroben@apple.com> + + Follow-up to r35500 + + * WinLauncher/WinLauncher.vcproj: Set the manifest properties for the + Release configuration, too. + +2008-07-31 Stefan Landvogt <stefan.landvogt@gmail.com> + + Fix Bug 20245: WinLauncher does not start in WebKit-debug right out of + the box + + <https://bugs.webkit.org/show_bug.cgi?id=20245> + + Reviewed by Adam Roben. + + * WinLauncher/WinLauncher.vcproj: adding the following properties to + WinLauncher > Properties > Manifest Tool > Isolated COM + Type Library File: $(WebKitOutputDir)\lib\WebKit.tlb + Component File Name: WebKit$(WebKitDLLConfigSuffix) + Doing the change on "All Configurations" + +2008-07-31 Adam Roben <aroben@apple.com> + + Windows build bot fix + + * DumpRenderTree/win/ImageDiff.vcproj: Don't fail if files that only + exist for people at Apple can't be found. Also updated the ICU version + to 3.8. + +2008-07-31 David Kilzer <ddkilzer@apple.com> + + Fix layout test results for webarchive/test-xml-stylesheet.xml + + Reviewed by Darin Adler. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (convertMIMEType): Work around the "text/xml" local file type + regression in Leopard using the BUILDING_ON_LEOPARD macro. Also + stop mangling "application/x-javascript" into "text/javascript". + (convertWebResourceDataToString): When checking whether to dump a + resource as text, also check to see if the MIME type is in the + -[WebHTMLRepresentation supportedNonImageMIMETypes] array. + * DumpRenderTree/mac/DumpRenderTreeMac.h: Added BUILDING_ON_LEOPARD + macro. + +2008-07-31 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Alice Liu + + Add AX support to get the bounds for a range of text + Add AX support to get the child of an element + Add AX support to get all the parameterized attribute names of an element + + * DumpRenderTree/AccessibilityUIElement.cpp: + (parameterizedAttributeNamesCallback): + (boundsForRangeCallback): + (childAtIndexCallback): + (AccessibilityUIElement::getJSClass): + * DumpRenderTree/AccessibilityUIElement.h: + * DumpRenderTree/mac/AccessibilityUIElementMac.mm: + (AccessibilityUIElement::getChildAtIndex): + (AccessibilityUIElement::parameterizedAttributeNames): + (AccessibilityUIElement::boundsForRange): + +2008-07-31 Erik Bunce <elbunce@thehive.com> + + Reviewed by Simon. + + Make run-launcher set DYLD_LIBRARY_PATH to make things work on Mac OS X. + + * Scripts/run-launcher: + +2008-07-30 Jessica Kahn <jess@apple.com> + + Reviewed by Adam Roben. + + Slightly stricter checking for previous change, suggested by Adam. + + * Scripts/extract-localizable-strings: + +2008-07-30 Jessica Kahn <jess@apple.com> + + Reviewed by Darin Adler. + + Added support for UI_STRING and UI_STRING_KEY macros with flexible prefixes. + + * Scripts/extract-localizable-strings: + +2008-07-30 Anders Carlsson <andersca@apple.com> + + Reviewed by Adam. + + Copy icu38* files instead of icu36* files. + + * DumpRenderTree/win/DumpRenderTree.vcproj: + +2008-07-25 Jan Michael Alonzo <jmalonzo@webkit.org> + + DRT/Gtk build fix for r35362 + + * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: + (LayoutTestController::elementDoesAutoCompleteForElementWithId): + +2008-07-25 Brady Eidson <beidson@apple.com> + + Reviewed by Sam + + Add the ability to dump whether-or-not an element should have autocomplete enabled, + from the perspective of the WebKit API + + * DumpRenderTree/LayoutTestController.cpp: + (elementDoesAutoCompleteForElementWithIdCallback): + (LayoutTestController::staticFunctions): + + * DumpRenderTree/LayoutTestController.h: + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (LayoutTestController::elementDoesAutoCompleteForElementWithId): + * DumpRenderTree/win/LayoutTestControllerWin.cpp: + (LayoutTestController::elementDoesAutoCompleteForElementWithId): Stub for now until I can get on Windows + +2008-07-25 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Beth Dakin + + Add support for AXLineForIndex and AXInsertionPointIndex through the + accessibility controller + + * DumpRenderTree/AccessibilityUIElement.cpp: + (lineForIndexCallback): + (getInsertionPointLineNumberCallback): + (AccessibilityUIElement::getJSClass): + * DumpRenderTree/AccessibilityUIElement.h: + * DumpRenderTree/mac/AccessibilityUIElementMac.mm: + (AccessibilityUIElement::insertionPointLineNumber): + (AccessibilityUIElement::lineForIndex): + +2008-07-25 Adam Roben <aroben@apple.com> + + Try to fix the Windows build bot + + * DumpRenderTree/win/DumpRenderTree.vcproj: Don't try to copy files + that don't exist for people outside of Apple. + +2008-07-18 Landry Breuil <landry@openbsd.org> + + Bug 19975: [OpenBSD] Patches to enable build of WebKit + + <https://bugs.webkit.org/show_bug.cgi?id=19975> + + Reviewed by David Kilzer. + + * DumpRenderTree/DumpRenderTree.h: OpenBSD doesn't support wide characters. + +2008-07-16 Jon Honeycutt <jhoneycutt@apple.com> + + CygwinDownloader fails to install necessary packages + https://bugs.webkit.org/show_bug.cgi?id=20075 + + Reviewed by Mark Rowe. + + * CygwinDownloader/cygwin-downloader.zip: Rebuilt after two broken + mirrors removed in r34116. Set MIME type to application/octet-stream. + +2008-07-16 Jon Honeycutt <jhoneycutt@apple.com> + + CygwinDownloader's make-zip.sh script fails + https://bugs.webkit.org/show_bug.cgi?id=20074 + + Reviewed by Mark Rowe. + + * CygwinDownloader/cygwin-downloader.py: + +2008-07-15 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Refactor accessibility testing code. + + We now have: + - AccessibilityController + Controller which has access to the WebView and can provide the focused element, root element + and in the future, elementAtPoint. + + - AccessibilityUIElement + Object which provides access to the data provided by the Accessibility APIs. + + * DumpRenderTree/AccessibilityController.cpp: + (getFocusedElementCallback): + (getRootElementCallback): + (AccessibilityController::getJSClass): + * DumpRenderTree/AccessibilityController.h: + * DumpRenderTree/AccessibilityUIElement.cpp: Added. + (allAttributesCallback): + (attributesOfLinkedUIElementsCallback): + (attributesOfChildrenCallback): + (getRoleCallback): + (getTitleCallback): + (getDescriptionCallback): + (getWidthCallback): + (getHeightCallback): + (getIntValueCallback): + (getMinValueCallback): + (getMaxValueCallback): + (finalize): + (AccessibilityUIElement::makeJSAccessibilityUIElement): + (AccessibilityUIElement::getJSClass): + * DumpRenderTree/AccessibilityUIElement.h: Added. + (AccessibilityUIElement::platformUIElement): + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: + * DumpRenderTree/mac/AccessibilityControllerMac.mm: + (AccessibilityController::AccessibilityController): + (AccessibilityController::~AccessibilityController): + (AccessibilityController::focusedElement): + (AccessibilityController::rootElement): + * DumpRenderTree/mac/AccessibilityUIElementMac.mm: Added. + (AccessibilityUIElement::AccessibilityUIElement): + (descriptionOfValue): + (attributesOfElement): + (nsStringToJSStringRef): + (concatenateAttributeAndValue): + (AccessibilityUIElement::getLinkedUIElements): + (AccessibilityUIElement::getChildren): + (AccessibilityUIElement::attributesOfLinkedUIElements): + (AccessibilityUIElement::attributesOfChildren): + (AccessibilityUIElement::allAttributes): + (AccessibilityUIElement::role): + (AccessibilityUIElement::title): + (AccessibilityUIElement::description): + (AccessibilityUIElement::width): + (AccessibilityUIElement::height): + (AccessibilityUIElement::intValue): + (AccessibilityUIElement::minValue): + (AccessibilityUIElement::maxValue): + +2008-07-14 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Beth Dakin + + Add support to get attributes of the AXChildren of an objecty + + * DumpRenderTree/AccessibilityController.cpp: + (attributesOfChildrenForFocusedElementCallback): + (AccessibilityController::staticFunctions): + * DumpRenderTree/AccessibilityController.h: + * DumpRenderTree/mac/AccessibilityControllerMac.mm: + (descriptionOfValue): + (AccessibilityController::attributesOfChildrenForFocusedElement): + +2008-07-14 Steve Falkenburg <sfalken@apple.com> + + Build fix. + + * DumpRenderTree/win/DumpRenderTree.vcproj: + +2008-07-14 Adam Roben <aroben@apple.com> + + Attempted Windows build fix + + * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj: Add + CoreFoundation/OSXCompatibilityHeaders[/GNUCompatibility] to the + include path. + +2008-07-14 Alexey Proskuryakov <ap@webkit.org> + + Reviewed by Geoff Garen. + + Eliminate per-thread JavaScript global data instance support and make arbitrary + global data/global object combinations possible. + + * DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp: + (runJavaScriptThread): Don't pass a released context reference to JSGarbageCollect. + In this scenario, it was causing crashes after each 10-20 tests, because there was a large + chance for a different thread to cause GC after the context was released. + +2008-07-11 Stephanie Lewis <slewis@apple.com> + + Reviewed by Darin Adler. + + Make sure we read WebCore Leak messages. Force full document teardown for DumpRenderTree. + + Up timeout limit, some slower machines were timing out before crashtracer finished writing out to disk and quitting DRT. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (setDefaultsToConsistentValuesForTesting): + (resetWebViewToConsistentStateBeforeTesting): + * Scripts/run-webkit-tests: + +2008-07-10 Steve Falkenburg <sfalken@apple.com> + + Build fix. + + * DumpRenderTree/win/DumpRenderTree.vcproj: + +2008-07-09 Eric Seidel <eric@webkit.org> + + Reviewed by Mark Rowe. + + Print <div> backgrounds when printing from DRT. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (setDefaultsToConsistentValuesForTesting): + +2008-07-09 Eric Seidel <eric@webkit.org> + + Reviewed by Mark Rowe. + + Fix copying of expected results to correct location + + * Scripts/run-webkit-tests: + +2008-07-09 Eric Seidel <eric@webkit.org> + + Reviewed by aroben. + + * DumpRenderTree/LayoutTestController.cpp: + (LayoutTestController::LayoutTestController): + (dumpAsPDFCallback): + (LayoutTestController::staticFunctions): + * DumpRenderTree/LayoutTestController.h: + (LayoutTestController::dumpAsPDF): + (LayoutTestController::setDumpAsPDF): + * DumpRenderTree/mac/DumpRenderTree.mm: + (dumpFrameAsPDF): + (dump): + +2008-07-09 Eric Seidel <eric@webkit.org> + + Reviewed by weinig. + + Add Content-Type support to DumpRenderTree and run-webkit-tests + and move expected.txt files to expected.webarchive + + https://bugs.webkit.org/show_bug.cgi?id=15565 + + * DumpRenderTree/cg/ImageDiffCG.cpp: + (compareImages): + (main): + * DumpRenderTree/cg/PixelDumpSupportCG.cpp: + (printPNG): + * DumpRenderTree/mac/DumpRenderTree.mm: + (dump): + * Scripts/run-webkit-tests: + +2008-07-08 Jon Honeycutt <jhoneycutt@apple.com> + + Reviewed by Anders. + + Port r34988 to Mac: allow tests to define JavaScript to execute when + NPP_DestroyStream or NPP_URLNotify is called. + + * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp: + (NPP_New): Remove initialization that happens in pluginAllocate. Look + for new arguments onStreamDestroy and onURLNotify. + (NPP_Destroy): Free onStreamDestroy and onURLNotify. + (executeScript): Code moved from onStreamLoad. + (NPP_NewStream): Call executeScript. + (NPP_DestroyStream): Same. + (NPP_URLNotify): Same. + +2008-07-07 Beth Dakin <bdakin@apple.com> + + Reviewed by Anders. + + This patch extends DRT accessibility tests to add the ability to + query the intValue, minValue, and maxValue of the focused element. + + * DumpRenderTree/AccessibilityController.cpp: + (intValueOfFocusedElementCallback): + (minValueOfFocusedElementCallback): + (maxValueOfFocusedElementCallback): + (AccessibilityController::staticFunctions): + * DumpRenderTree/AccessibilityController.h: + * DumpRenderTree/mac/AccessibilityControllerMac.mm: + (AccessibilityController::intValueOfFocusedElement): + (AccessibilityController::minValueOfFocusedElement): + (AccessibilityController::maxValueOfFocusedElement): + +2008-07-07 Steve Falkenburg <sfalken@apple.com> + + Fix build. + + * DumpRenderTree/win/ImageDiff.vcproj: + +2008-07-02 Jon Honeycutt <jhoneycutt@apple.com> + + Allow tests to define JavaScript to execute when NPP_DestroyStream or + NPP_URLNotify is called. + + Reviewed by Anders. + + * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: Add a new + property, "returnErrorFromNewStream." This is to support the test for + <rdar://5983747> Safari crashes trying to load the SilverLight plugin, + caused by WebKit calling NPP_DestroyStream after a plug-in returns an + error from NPP_NewStream. + (pluginGetProperty): + (pluginSetProperty): + (pluginAllocate): + * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: Added new + members, onStreamDestroy and onURLNotify. + * DumpRenderTree/win/TestNetscapePlugin/main.cpp: + (NPP_New): Remove initialization of onStreamLoad; this was moved to + pluginAllocate. Look for new arguments onStreamDestroy and + onURLNotify, and store their values. + (NPP_Destroy): Free new members. + (executeScript): Code moved from onStreamLoad + (NPP_NewStream): If returnErrorFromNewStream has been set to true, + return a generic error code. If onStreamLoad is set, execute it as + JavaScript. + (NPP_DestroyStream): If onStreamDestroy is set, execute it as JS. + (NPP_URLNotify): Same, for onURLNotify. + +2008-07-02 Brady Eidson <beidson@apple.com> + + Reviewed by Mitz Pettel and John Sullivan + + Add the ability to tell DRT to call stopLoading on a WebFrame inside of a didStartProvisionalLoadForFrame + load delegate. + + Required to add a layout test for the fix for <rdar://problem/5549871> + + * DumpRenderTree/mac/FrameLoadDelegate.mm: + (-[FrameLoadDelegate webView:didStartProvisionalLoadForFrame:]): If stopProvisionalFrameLoads is set, call + [WebFrame stopLoading] to test for the crash reflected in 5549871 + + All of the following are infrastructure to add the layoutTestController.setStopProvisionalFrameLoads() call: + * DumpRenderTree/LayoutTestController.cpp: + (LayoutTestController::LayoutTestController): + (setStopProvisionalFrameLoadsCallback): + (LayoutTestController::staticFunctions): + * DumpRenderTree/LayoutTestController.h: + (LayoutTestController::stopProvisionalFrameLoads): + (LayoutTestController::setStopProvisionalFrameLoads): + +2008-07-01 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Beth Dakin + + Support ability to get width and height of an element through accessibility + + * DumpRenderTree/AccessibilityController.cpp: + (widthOfFocusedElementCallback): + (heightOfFocusedElementCallback): + (AccessibilityController::staticFunctions): + * DumpRenderTree/AccessibilityController.h: + * DumpRenderTree/mac/AccessibilityControllerMac.mm: + (AccessibilityController::widthOfFocusedElement): + (AccessibilityController::heightOfFocusedElement): + +2008-06-30 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Beth Dakin + + Support the ability to get the linked ui elements of an object + + * DumpRenderTree/AccessibilityController.cpp: + (attributesOfLinkedUIElementsForFocusedElementCallback): + (AccessibilityController::staticFunctions): + * DumpRenderTree/AccessibilityController.h: + * DumpRenderTree/mac/AccessibilityControllerMac.mm: + (AccessibilityController::attributesOfLinkedUIElementsForFocusedElement): + (AccessibilityController::allAttributesOfFocusedElement): + (attributesOfElement): + (nsStringToJSStringRef): + +2008-06-29 Sam Weinig <sam@webkit.org> + + Fix Tiger build. + + * DumpRenderTree/mac/EventSendingController.mm: + (eventTypeForMouseButtonAndAction): + +2008-06-27 Eric Seidel <eric@webkit.org> + + Reviewed by darin. + + Add multi-button mouseevent support to DRT + https://bugs.webkit.org/show_bug.cgi?id=15173 + + It's now possible to specify the mouse button with: + eventSender.mouseDown(1); eventSender.mouseUp(1); etc. + + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: + * DumpRenderTree/mac/EventSendingController.h: + * DumpRenderTree/mac/EventSendingController.mm: + (+[EventSendingController isSelectorExcludedFromWebScript:]): + (+[EventSendingController webScriptNameForSelector:]): + (eventTypeForMouseButtonAndAction): + (-[EventSendingController updateClickCountForButton:]): + (-[EventSendingController mouseDown:]): + (-[EventSendingController mouseUp:]): + (-[EventSendingController mouseMoveToX:Y:]): + (-[EventSendingController contextClick]): + +2008-06-28 Nikolas Zimmermann <zimmermann@kde.org> + + Reviewed by Oliver. + + Copy <test>-expected.png from the right location to /tmp/layout-test-results. + Use $expectedPixelDir instead of $expectedDir. Allows using SVG pixel tests again. + + * Scripts/run-webkit-tests: + +2008-06-27 Jan Michael Alonzo <jmalonzo@webkit.org> + + Reviewed by Christian Dywan. + + [Gtk] Initialize webview settings before running DRT tests + http://bugs.webkit.org/show_bug.cgi?id=19778 + + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (setDefaultsToConsistentStateValuesForTesting): + (main): + +2008-06-26 Darin Adler <darin@apple.com> + + * Scripts/check-for-weak-vtables: Fixed comment. + +2008-06-26 Darin Adler <darin@apple.com> + + * Scripts/check-for-weak-vtables: Added. + +2008-06-26 Beth Dakin <bdakin@apple.com> + + Reviewed by Sam. + + Do not include AXPosition in the dump of all of the accessibility + attributes since it is screen-specific. + + * DumpRenderTree/mac/AccessibilityControllerMac.mm: + (AccessibilityController::allAttributesOfFocusedElement): + +2008-06-26 Beth Dakin <bdakin@apple.com> + + Reviewed by Anders. + + This is a speculative fix for the failing layout test on the build + bot. It seems that the problem that the Build Bot is having is + Tiger-specific. On Tiger, [NSValue description] was not very smart. + So I replaced our call to description with a hand-rolled equivalent + that will match on both platforms. + + * DumpRenderTree/mac/AccessibilityControllerMac.mm: + (descriptionOfValue): + +2008-06-25 Beth Dakin <bdakin@apple.com> + + Reviewed by Sam Weinig. + + This patch adds support to the AccessibilityController to query the + following attributes specifically, without a full attribute dump: + AXRole, AXTitle, and AXDescription. + + * DumpRenderTree/AccessibilityController.cpp: + (allAttributesForFocusedElementCallback): + (roleOfFocusedElementCallback): + (titleOfFocusedElementCallback): + (descriptionOfFocusedElementCallback): + (AccessibilityController::staticFunctions): + * DumpRenderTree/AccessibilityController.h: + * DumpRenderTree/mac/AccessibilityControllerMac.mm: + (AccessibilityController::allAttributesForFocusedElement): + (concatenateAttributeAndValue): + (AccessibilityController::roleOfFocusedElement): + (AccessibilityController::titleOfFocusedElement): + (AccessibilityController::descriptionOfFocusedElement): + +2008-06-24 Dan Bernstein <mitz@apple.com> + + Reviewed by Stephanie Lewis. + + - move the linker flags from the debug configuration in the project + to the shared configuration + + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: + * DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig: + +2008-06-24 Dan Bernstein <mitz@apple.com> + + - try to fix the Tiger build + + * DumpRenderTree/mac/AccessibilityControllerMac.mm: + +2008-06-24 Sam Weinig and Beth Dakin <bdakin@apple.com and sam@webkit.org> + + Reviewed by Darin Adler. + + Fix for <rdar://problem/5884881> Make DumpRenderTree support + accessibility tests + + This patch adds some basic support for accessibility layout tests + on the Mac. + + * DumpRenderTree/AccessibilityController.cpp: Added. + (AccessibilityController::AccessibilityController): + (AccessibilityController::~AccessibilityController): + (dumpCurrentAttributesCallback): + (AccessibilityController::makeWindowObject): + (AccessibilityController::getJSClass): + (AccessibilityController::staticFunctions): + * DumpRenderTree/AccessibilityController.h: Added. + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: + * DumpRenderTree/mac/AccessibilityControllerMac.mm: Added. + (descriptionOfValue): + (AccessibilityController::dumpCurrentAttributes): + * DumpRenderTree/mac/DumpRenderTree.mm: + * DumpRenderTree/mac/FrameLoadDelegate.h: + * DumpRenderTree/mac/FrameLoadDelegate.mm: + (-[FrameLoadDelegate init]): + (-[FrameLoadDelegate webView:didClearWindowObject:forFrame:]): + +2008-06-24 John Sullivan <sullivan@apple.com> + + Reviewed by Dan Bernstein + + * Scripts/extract-localizable-strings: + add UI_STRING_LOCALIZE_LATER, LPCTSTR_UI_STRING_LOCALIZE_LATER, and LOG_WARNING to the + list of debugging macros, to avoid noise when keeping the list of localized string + exceptions up to date + +2008-06-24 Dan Bernstein <mitz@apple.com> + + Rubber-stamped by Darin Adler. + + - add a font family for testing font-weight + + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added linker + flags to create data sections for the WeightWatcher fonts. + * DumpRenderTree/fonts: Added. + * DumpRenderTree/fonts/WebKitWeightWatcher100.ttf: Added. + * DumpRenderTree/fonts/WebKitWeightWatcher200.ttf: Added. + * DumpRenderTree/fonts/WebKitWeightWatcher300.ttf: Added. + * DumpRenderTree/fonts/WebKitWeightWatcher400.ttf: Added. + * DumpRenderTree/fonts/WebKitWeightWatcher500.ttf: Added. + * DumpRenderTree/fonts/WebKitWeightWatcher600.ttf: Added. + * DumpRenderTree/fonts/WebKitWeightWatcher700.ttf: Added. + * DumpRenderTree/fonts/WebKitWeightWatcher800.ttf: Added. + * DumpRenderTree/fonts/WebKitWeightWatcher900.ttf: Added. + * DumpRenderTree/mac/DumpRenderTree.mm: + (activateFonts): Renamed activateAhemFont to this and made it activate + the WeightWatcher fonts in addition to Ahem. + (prepareConsistentTestingEnvironment): Adjusted for the name change. + * DumpRenderTree/win/DumpRenderTree.cpp: + (initialize): Added the WeightWatcher fonts. + +2008-06-20 Brent Fulgham <bfulgham@gmail.com> + + Reviewed by Darin Adler. + + Extend the build-webkit (and set-webkit-configuration) script to + support Cairo-based webkit builds. (see http://bugs.webkit.org/show_bug.cgi?17952) + + * Scripts/build-webkit: Add --cairo-win32 to the help message + * Scripts/webkitdirs.pm: Extend the 'determinePassedConfiguration + subroutine to recognize the --cairo-win32 flag. When present, + the build configuration is changed from Debug/Release to + Debug_Cairo/Release_Cairo. This flag is only active when the + isCygwin() test is true. + +2008-06-17 Dan Bernstein <mitz@apple.com> + + Reviewed by Justin Garcia. + + - prefer Leopard results when running on Snow Leopard. + + * Scripts/run-webkit-tests: Added a mapping of Snow Leopard to + mac-leopard. + * Scripts/webkitdirs.pm: Added isSnowLeopard(). + +2008-06-15 Darin Adler <darin@apple.com> + + * Scripts/do-webcore-rename: Updated for the latest round of renaming. + +2008-06-15 Darin Adler <darin@apple.com> + + * Scripts/do-webcore-rename: Updated for the latest round of renaming. + +2008-06-15 Darin Adler <darin@apple.com> + + * Scripts/do-webcore-rename: Updated for the latest round of renaming. + +2008-06-15 Darin Adler <darin@apple.com> + + * Scripts/do-webcore-rename: Updated for the latest round of renaming. + +2008-06-15 Darin Adler <darin@apple.com> + + * Scripts/do-file-rename: Updated. + * Scripts/do-webcore-rename: Updated for the latest round of renaming. + +2008-06-15 Darin Adler <darin@apple.com> + + * Scripts/do-file-rename: Updated for the latest round of renaming. + * Scripts/do-webcore-rename: Tweaked and reorganized a bit. + +2008-06-15 Darin Adler <darin@apple.com> + + * Scripts/create-exports: Added. + * Scripts/do-file-rename: Added some planned renames. + * Scripts/do-webcore-rename: Updated for the latest round of renaming. + +2008-06-15 Darin Adler <darin@apple.com> + + * Scripts/do-webcore-rename: Updated for the latest round of renaming. + +2008-06-15 Maciej Stachowiak <mjs@apple.com> + + Reviewed by Oliver. + + - rename testkjs to jsc + + * Scripts/build-jsc: Copied from Scripts/build-testkjs. + * Scripts/build-testkjs: Removed. + * Scripts/run-javascriptcore-tests: + * Scripts/run-jsc: Copied from Scripts/run-testkjs. + * Scripts/run-sunspider: + * Scripts/run-testkjs: Removed. + * Scripts/sunspider-compare-results: + +2008-06-14 Darin Adler <darin@apple.com> + + * Scripts/do-webcore-rename: Moved planned renames into a separate hash + from the actual renames. Removed many renames that are either done or + no longer planned. + +2008-06-14 Darin Adler <darin@apple.com> + + * Scripts/do-webcore-rename: Fixed obvious typo. + +2008-06-13 Darin Adler <darin@apple.com> + + * Scripts/make-js-test-wrappers: Added three more exceptions. + +2008-06-10 Joerg Bornemann <joerg.bornemann@trolltech.com> + + Reviewed by Simon. + + For the qmake based build make it possible to build against makespecs where + QMAKE_CC is defined in a configuration file included from qmake.conf. + + * Scripts/webkitdirs.pm: Added support for include() statements in + qmake.conf. + +2008-06-09 Alp Toker <alp@nuanti.com> + + gcc3/autotools build fix. Add explicit -O2 -fno-strict-aliasing to + each of the tools since these are no longer set globally. + + * GNUmakefile.am: + +2008-06-08 Darin Adler <darin@apple.com> + + * Scripts/make-js-test-wrappers: Added another exception. + +2008-06-07 Cameron Zwarich <cwzwarich@uwaterloo.ca> + + Reviewed by Timothy. + + Remove the --squirrelfish option from SunSpider, as it is no longer needed. + + * Scripts/run-sunspider: + +2008-06-05 Alp Toker <alp@nuanti.com> + + Build fix for r34387. + + * GNUmakefile.am: + +2008-06-04 Cameron Zwarich <cwzwarich@uwaterloo.ca> + + Reviewed by Oliver. + + Add an exception for Opcode.o to the global initializers check so that + we can dump instruction statistics in the JavaScript virtual machine. + + * Scripts/check-for-global-initializers: + +2008-05-30 Steve Falkenburg <sfalken@apple.com> + + Generate an isolated COM manifest for registry free COM. + + * DumpRenderTree/win/DumpRenderTree.vcproj: + +2008-06-02 Anders Carlsson <andersca@apple.com> + + Reviewed by David Hyatt and Mitz. + + <rdar://problem/5704119> + repro crash in WebCore::RenderPart::setWidget (plugin-related?) + + Call -[WebView display] in the "plug-in" failed delegate method, simulating + the sheet that Safari puts up. + + * DumpRenderTree/mac/ResourceLoadDelegate.mm: + (-[ResourceLoadDelegate webView:plugInFailedWithError:dataSource:]): + +2008-05-30 Timothy Hatcher <timothy@apple.com> + + Made the starting line number of scripts be 1-based throughout the engine. + This cleans up script line numbers so they are all consistent now. + + Reviewed by Oliver Hunt. + + * DumpRenderTree/mac/ObjCController.m: + (runJavaScriptThread): Pass a line number of 1 instead of 0 to JSEvaluateScript. + * DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp: + (runJavaScriptThread): Ditto. + * DumpRenderTree/win/DumpRenderTree.cpp: + (runJavaScriptThread): Ditto. + +2008-05-29 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Adam Roben. + + Fixed VCSUtils.pm to work with git repositories inside symlinks. + + * Scripts/VCSUtils.pm: Compute a relative path from the git repository + root, instead of the root of the filesystem, to work around a bug in + abs2rel when traversing symlinked home directories. + +2008-05-29 Kevin Ollivier <kevino@theolliviers.com> + + Reviewed by Darin Adler. + + Restore original behavior of isOSX() referring to the Mac port, not the OS itself. + + https://bugs.webkit.org/show_bug.cgi?id=19311 + + * Scripts/webkitdirs.pm: + +2008-05-29 Alexey Proskuryakov <ap@webkit.org> + + Reviewed by Adam Roben. + + Fix run-iexploder-tests and run-mangleme-tests to work with updated shared scripts and + configuration files. + + * Scripts/run-iexploder-tests: + * Scripts/run-mangleme-tests: + Renamed runSafari to not conflict with the one in webkitdirs. + Added SSLCertificateFile option for httpd, as now needed. + +2008-05-27 Kevin Ollivier <kevino@theolliviers.com> + + wx build fix. Update the sample app after wxWebFrame->wxWebBrowserShell rename. + + * wx/browser/browser.cpp: + (MyApp::OnInit): + +2008-05-24 Andreia Gaita <shana@isninja.com> + + Reviewed by Alp Toker. + + cygwin-downloader.py fixes. + + Remove two non-working mirrors. Add a check for missing dependency + packages to avoid bailing out on an inconsistent Cygwin package list. + + * CygwinDownloader/cygwin-downloader.py: + +2008-05-24 Jan Michael Alonzo <jmalonzo@webkit.org> + + Reviewed by Darin Adler. + + Remove useQmake usage. QMake build doesn't support Gtk port + anymore. + + Also fix 2 occurences of "Web Kit". Should be WebKit. + + * Scripts/build-webkit: + * Scripts/run-javascriptcore-tests: + * Scripts/run-launcher: + * Scripts/run-webkit-tests: + * Scripts/webkitdirs.pm: + +2008-05-22 Stephanie Lewis <slewis@apple.com> + + Reviewed by Dan. + + implement the beforeUnload UI delegate so that DRT will dispatch beforeunload events. + + * DumpRenderTree/mac/UIDelegate.mm: + (-[UIDelegate webView:runBeforeUnloadConfirmPanelWithMessage:initiatedByFrame:]): + * DumpRenderTree/win/UIDelegate.cpp: + (SearchableWebViewHost::runBeforeUnloadConfirmPanelWithMessage): + +2008-05-21 Adele Peterson <adele@apple.com> + + Reviewed by Adam. + + DumpRenderTree support for <rdar://problem/5787733> fast/dom/HTMLDocument/hasFocus.html fails on Windows + + * DumpRenderTree/win/UIDelegate.cpp: + (UIDelegate::webViewFocus): Added. + (UIDelegate::webViewUnfocus): Added. + * DumpRenderTree/win/UIDelegate.h: + +2008-05-21 Mark Rowe <mrowe@apple.com> + + Rubber-stamped by Stephanie Lewis. + + Set the pass_through flag on Getopt so that extra arguments can be passed through to Safari, + rather than trigger an unknown argument message. This allows run-webkit-tests to display results + once more. + + * Scripts/run-safari: + +2008-05-21 Stephanie Lewis <slewis@apple.com> + + Reviewed by Maciej, Mark. + + arch doesn't take arguments on tiger. expand DRT timeout for guardMalloc. + + * Scripts/run-webkit-tests: + * Scripts/webkitdirs.pm: + +2008-05-20 Mark Rowe <mrowe@apple.com> + + Reviewed by Stephanie Lewis. + + Improve the behavior of run-webkit-tests with 64-bit WebKit by automatically inferring whether to run 64-bit. + + If --64-bit is not passed to run-webkit-tests, attempt to guess whether we should run 64-bit. + This decision is made based on the 64-bitness of the built WebKit framework if it exists, and + can be manually overridden by passing --64-bit or --no-64-bit. This removes the need to always + pass an argument to run-webkit-tests after having built with "make x86_64". + + * Scripts/gdb-safari: + * Scripts/run-safari: + * Scripts/run-webkit-tests: + * Scripts/webkitdirs.pm: Split the setting of the 64-bit flag, the determination of the + preferred architecture, and exporting of the environment variables for 'arch' out into + separate subroutines. + +2008-05-20 Mark Rowe <mrowe@apple.com> + + Fix "make x86_64" by adding x86_64 target to WebKitTools Makefile. + + * Makefile: + +=== End merge of squirrelfish === + +2008-04-14 Maciej Stachowiak <mjs@apple.com> + + Reviewed by Oliver. + + - added support for --ubench mode + + * Scripts/run-sunspider: + +2008-03-26 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Oliver Hunt. + + --squirrelfish mode: pared down tests for squirrelfish to chew on. + + * Scripts/run-sunspider: + +=== Start merge of squirrelfish === + +2008-05-21 Darin Adler <darin@apple.com> + + * Scripts/make-js-test-wrappers: Added another exception. + +2008-05-19 Stephanie Lewis <slewis@apple.com> + + Reviewed by Adam. + + Explicitly set run mode to 32bit unless overridden to avoid + confusion when running tests + + * Scripts/build-dumprendertree: + * Scripts/gdb-safari: + * Scripts/run-webkit-tests: + * Scripts/webkitdirs.pm: + +2008-05-16 Stephanie Lewis <slewis@apple.com> + + Reviewed by Steve. + + Print out pending unload event count. Also print out main frame name to match Mac. + + * DumpRenderTree/win/FrameLoadDelegate.cpp: + (descriptionSuitableForTestResult): + (FrameLoadDelegate::didFinishDocumentLoadForFrame): + +2008-05-16 Timothy Hatcher <timothy@apple.com> + + Remove the Drosera project, code and resources since it has been + replaced with the Web Inspector's debugger. Removes references to + Drosera in various scripts and makefiles. + + Rubber-stamped by Mark Rowe. + + * BuildSlaveSupport/build-launcher-app: + * Drosera/DebuggerDocument.cpp: Removed. + * Drosera/DebuggerDocument.h: Removed. + * Drosera/Drosera.icns: Removed. + * Drosera/DroseraWin.make: Removed. + * Drosera/English.lproj/Debugger.nib/classes.nib: Removed. + * Drosera/English.lproj/Debugger.nib/info.nib: Removed. + * Drosera/English.lproj/Debugger.nib/keyedobjects.nib: Removed. + * Drosera/English.lproj/MainMenu.nib/classes.nib: Removed. + * Drosera/English.lproj/MainMenu.nib/info.nib: Removed. + * Drosera/English.lproj/MainMenu.nib/keyedobjects.nib: Removed. + * Drosera/ForwardingHeaders/wtf/Assertions.h: Removed. + * Drosera/ForwardingHeaders/wtf/HashTraits.h: Removed. + * Drosera/ForwardingHeaders/wtf/Noncopyable.h: Removed. + * Drosera/ForwardingHeaders/wtf/OwnPtr.h: Removed. + * Drosera/ForwardingHeaders/wtf/Platform.h: Removed. + * Drosera/ForwardingHeaders/wtf/RetainPtr.h: Removed. + * Drosera/Images/Drosera.ico: Removed. + * Drosera/Images/SourceArrow.png: Removed. + * Drosera/Images/SourceArrowBlank.png: Removed. + * Drosera/Images/SourceArrowOpen.png: Removed. + * Drosera/Images/background_stripe.png: Removed. + * Drosera/Images/breakPoint.tif: Removed. + * Drosera/Images/breakPointDisabled.tif: Removed. + * Drosera/Images/breakpointeditor.png: Removed. + * Drosera/Images/close.tif: Removed. + * Drosera/Images/close_active.tif: Removed. + * Drosera/Images/close_hover.tif: Removed. + * Drosera/Images/console.png: Removed. + * Drosera/Images/continue.tif: Removed. + * Drosera/Images/fileIcon.jpg: Removed. + * Drosera/Images/finishFunction.tif: Removed. + * Drosera/Images/glossyFooterFill.tif: Removed. + * Drosera/Images/glossyHeader.png: Removed. + * Drosera/Images/glossyHeaderPressed.png: Removed. + * Drosera/Images/gradientBackground.png: Removed. + * Drosera/Images/gutter.png: Removed. + * Drosera/Images/navLeftDisabled.png: Removed. + * Drosera/Images/navLeftNormal.png: Removed. + * Drosera/Images/navLeftPressed.png: Removed. + * Drosera/Images/navRightDisabled.png: Removed. + * Drosera/Images/navRightNormal.png: Removed. + * Drosera/Images/navRightPressed.png: Removed. + * Drosera/Images/pause.tif: Removed. + * Drosera/Images/popUpArrows.png: Removed. + * Drosera/Images/programCounter.tif: Removed. + * Drosera/Images/programCounterBreakPoint.tif: Removed. + * Drosera/Images/programCounterBreakPointDisabled.tif: Removed. + * Drosera/Images/run.tif: Removed. + * Drosera/Images/siteCollapsed.tif: Removed. + * Drosera/Images/siteExpanded.tif: Removed. + * Drosera/Images/siteIcon.tif: Removed. + * Drosera/Images/small.ico: Removed. + * Drosera/Images/splitterBar.tif: Removed. + * Drosera/Images/splitterDimple.tif: Removed. + * Drosera/Images/step.tif: Removed. + * Drosera/Images/stepOut.tif: Removed. + * Drosera/Images/stepOver.tif: Removed. + * Drosera/Images/stop.tif: Removed. + * Drosera/Images/toolbarBackground.png: Removed. + * Drosera/Images/verticalSplitterBar.tiff: Removed. + * Drosera/Images/verticalSplitterDimple.tiff: Removed. + * Drosera/Makefile: Removed. + * Drosera/breakpointEditor.html: Removed. + * Drosera/config.h: Removed. + * Drosera/console.css: Removed. + * Drosera/console.html: Removed. + * Drosera/console.js: Removed. + * Drosera/debugger.css: Removed. + * Drosera/debugger.html: Removed. + * Drosera/debugger.js: Removed. + * Drosera/mac/DebuggerApplication.h: Removed. + * Drosera/mac/DebuggerApplication.mm: Removed. + * Drosera/mac/DebuggerClient.h: Removed. + * Drosera/mac/DebuggerClient.mm: Removed. + * Drosera/mac/DebuggerDocumentPlatform.mm: Removed. + * Drosera/mac/Drosera.xcodeproj/project.pbxproj: Removed. + * Drosera/mac/Info.plist: Removed. + * Drosera/mac/LauncherInfo.plist: Removed. + * Drosera/mac/Makefile: Removed. + * Drosera/mac/ServerConnection.h: Removed. + * Drosera/mac/ServerConnection.mm: Removed. + * Drosera/mac/launcher.m: Removed. + * Drosera/mac/main.m: Removed. + * Drosera/viewer.css: Removed. + * Drosera/viewer.html: Removed. + * Drosera/win/BaseDelegate.h: Removed. + * Drosera/win/DebuggerClient.cpp: Removed. + * Drosera/win/DebuggerClient.h: Removed. + * Drosera/win/DebuggerDocumentPlatform.cpp: Removed. + * Drosera/win/Drosera.cpp: Removed. + * Drosera/win/Drosera.h: Removed. + * Drosera/win/Drosera.vcproj/Drosera.rc: Removed. + * Drosera/win/Drosera.vcproj/Drosera.vcproj: Removed. + * Drosera/win/DroseraPrefix.cpp: Removed. + * Drosera/win/DroseraPrefix.h: Removed. + * Drosera/win/Info.plist: Removed. + * Drosera/win/ServerConnection.cpp: Removed. + * Drosera/win/ServerConnection.h: Removed. + * Drosera/win/resource.h: Removed. + * Makefile: + * Scripts/build-drosera: Removed. + * Scripts/gdb-drosera: Removed. + * Scripts/run-drosera: Removed. + * Scripts/run-drosera-nightly.cmd: Removed. + * Scripts/run-drosera.cmd: Removed. + * Scripts/webkitdirs.pm: + +2008-05-15 Stephanie Lewis <slewis@apple.com> + + Reviewed by Anders. + + Dump the unload count for a frame after parsing is finished. + + * DumpRenderTree/mac/FrameLoadDelegate.mm: + (-[FrameLoadDelegate webView:didFinishDocumentLoadForFrame:]): + +2008-05-15 Alexey Proskuryakov <ap@webkit.org> + + Reviewed by Dan Bernstein. + + https://bugs.webkit.org/show_bug.cgi?id=10707 + DumpRenderTree should not be able to access non-local resources + + * DumpRenderTree/mac/ResourceLoadDelegate.mm: + (-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]): + Block them, and complain. + +2008-05-15 Kevin Ollivier <kevino@theolliviers.com> + + wx build fix. Update the version of libpng to download and instsall. + + * wx/install-unix-extras: + +2008-05-14 Julien Chaffraix <jchaffraix@webkit.org> + + Reviewed by Eric. + + - isDarwin() and isCygwin() returned an empty string if the platform equality check fails. + We now force the return value to be numeric. + + - Removed platform checks as it was a work around the previous issue. + + - Replaced isDarwin() by isOSX() as they have now the same behaviour. + + * Scripts/build-webkit: + * Scripts/webkitdirs.pm: + +2008-05-12 Adam Roben <aroben@apple.com> + + Support for testing NPN_PostURL + + Reviewed by Anders Carlsson. + + * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: + (toCString): Added this helper function. + (testPostURLFile): Added. Writes the passed-in content to the + passed-in file and calls NPN_PostURL with the passed-in URL and + target. + (pluginInvoke): Added a case for testPostURLFile. + * DumpRenderTree/win/LayoutTestControllerWin.cpp: + (followShortcuts): Changed to allow paths that don't yet exist. + +2008-05-12 Mark Rowe <mrowe@apple.com> + + Reviewed by Sam Weinig. + + Minor cleanup of the DRT Xcode project. + + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Use GCC_OPTIMIZATION_LEVEL rather than + OPTIMIZATION_CFLAGS. Don't include Info.plist in the "Copy Bundle Resources" build phase as it does + not need to be there. + +2008-05-12 Anders Carlsson <andersca@apple.com> + + Reviewed by Adam. + + Add support for testing application caches. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (dumpRenderTree): + Empty the cache. + + (resetWebViewToConsistentStateBeforeTesting): + Turn on support for the application cache. + +2008-05-09 Mark Rowe <mrowe@apple.com> + + Reviewed by Anders Carlsson. + + Update TestNetscapePlugIn to build 64-bit using the Cocoa event model. + + It currently does not attempt to print events which means that plugins/mouse-events.html + will fail when run 64-bit. All other tests that use this plugin pass. + + * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: + (testGetIntIdentifier): + * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp: + (NPP_New): + (NPP_HandleEvent): + +2008-05-09 Brady Eidson <beidson@apple.com> + + Reviewed by Adam Roben + + Explicitly call shutDownWebKit() before quitting. + + * Drosera/win/Drosera.cpp: + (_tWinMain): + + * DumpRenderTree/win/DumpRenderTree.cpp: + (main): + +2008-05-09 Mark Rowe <mrowe@apple.com> + + Fix the Tiger build of Drosera. + + * Drosera/config.h: Define BUILDING_ON_TIGER when building on Tiger. + +2008-05-09 Sam Weinig <sam@webkit.org> + + Rubber-stamped by Mark Rowe. + + Remove the ENABLE_CROSS_DOCUMENT_MESSAGING #ifdefs. + + * Scripts/build-webkit: + +2008-05-08 Mark Rowe <mrowe@apple.com> + + Another attempt at a Tiger build fix. + + Use DumpRenderTreeMac.h rather than DumpRenderTree.h as DumpRenderTreePasteboard is not an Obj-C++ file. + + * DumpRenderTree/mac/DumpRenderTreePasteboard.m: + +2008-05-08 Mark Rowe <mrowe@apple.com> + + Tiger build fix. Include DumpRenderTree.h so that BUILDING_ON_TIGER will be defined. + + * DumpRenderTree/mac/DumpRenderTreePasteboard.m: + +2008-05-08 Mark Rowe <mrowe@apple.com> + + Reviewed by Oliver Hunt and Dan Bernstein. + + Update DumpRenderTree to build 64-bit. + + The three major changes here are: + 1) Use NSInteger in the appropriate places. + 2) Use ColorSync API that is available in 64-bit to switch display profiles. + 3) Use method-swizzling to achieve similar results to class posing when using the Obj-C 2.0 runtime. + + The build of DumpRenderTree will still fail in 64-bit for now as the TestNetscapePlugIn target also + needs updated to successfully build. + + * DumpRenderTree/mac/Configurations/Base.xcconfig: Don't prevent Xcode from building 64-bit. + * DumpRenderTree/mac/DumpRenderTree.mm: + (swizzleAllMethods): + (poseAsClass): + (prepareConsistentTestingEnvironment): + * DumpRenderTree/mac/DumpRenderTreeMac.h: + * DumpRenderTree/mac/DumpRenderTreePasteboard.h: + * DumpRenderTree/mac/DumpRenderTreePasteboard.m: + * DumpRenderTree/mac/DumpRenderTreeWindow.mm: + * DumpRenderTree/mac/PixelDumpSupportMac.mm: + (restoreColorSpace): + (failedGettingCurrentProfile): + (setDefaultColorProfileToRGB): + +2008-05-08 Mark Rowe <mrowe@apple.com> + + Reviewed by Darin Adler. + + Clean up Drosera so that it will build 64-bit. + + * Drosera/mac/DebuggerApplication.mm: + (-[DebuggerApplication numberOfRowsInTableView:]): Use NSInteger rather than int. + (-[DebuggerApplication tableView:objectValueForTableColumn:row:]): Ditto. + * Drosera/mac/Drosera.xcodeproj/project.pbxproj: Use the default value for VALID_ARCHS. + +2008-05-07 David Kilzer <ddkilzer@apple.com> + + Use File::Find and Getopt::Long in make-js-test-wrappers + + Reviewed by Darin Adler. + + * Scripts/make-js-test-wrappers: + - Updated Apple copyright statement. + - Added command-line switch parsing and -h|--help switch. + - Allowed user to pass list of files/directories on which to do + a restricted search for TEMPLATE.html files. The default + behavior is still to search the entire LayoutTests directory. + - Removed duplicate 'use strict' statement. + - Replaced use of `find` statements with File::Find::find(). + - Remove unneeded chomp() calls now that we use File::Find. + (directoryFilter): Added. Filters .svn directories when used + with File::Find::find(). + (findTemplateFiles): Added. Returns a list of TEMPLATE.html + files found. + +2008-05-05 Steve Falkenburg <sfalken@apple.com> + + Copy dependencies of ImageDiff, DumpRenderTree in post-build step. + + * DumpRenderTree/win/DumpRenderTree.vcproj: + * DumpRenderTree/win/ImageDiff.vcproj: + +2008-05-05 Adele Peterson <adele@apple.com> + + Reviewed by Adam. + + Look for the right ImageDiff executable for debug builds. + + * Scripts/run-webkit-tests: + +2008-05-05 Darin Adler <darin@apple.com> + + * Scripts/run-webkit-tests: Ignore a Java leak showing up in the WebKit + leak tests. + +2008-05-05 Ariya Hidayat <ariya.hidayat@trolltech.com> + + Reviewed by Simon. + + In the Qt's DumpRenderTree, adjust the web view properly (because W3C SVG + tests expect to be 480x360) + + * DumpRenderTree/qt/DumpRenderTree.cpp: + (WebCore::DumpRenderTree::open): + +2008-05-02 Dan Bernstein <mitz@apple.com> + + Reviewed by Adam Roben. + + - add an option to svn-apply to set the reviewer name in change logs + + * Scripts/svn-apply: Added a [-r|--reviewer name] option. + +2008-05-01 David Kilzer <ddkilzer@apple.com> + + Clean up configuration usage in run-webkit-tests + + Reviewed by Adam. + + * Scripts/run-webkit-tests: Parse configuration switches using + passedConfiguration() from webkitdirs.pm like every other script. + Note that we must still call setConfiguration() afterwards in + case the --configuration switch was used. Use $configurationOption + when running build-dumprendertree instead of recreating the switch. + +2008-04-29 Adam Roben <aroben@apple.com> + + Restore the beloved COMPtr::operator& + +2008-04-29 Adam Roben <aroben@apple.com> + + Windows build fixes + + Replace COMPtr::operator& with COMPtr::adoptionPointer. + +2008-04-25 Alexey Proskuryakov <ap@webkit.org> + + Reviewed by Darin Adler. + + Fix run-webkit-tests --threading + and provisionally fix <https://bugs.webkit.org/show_bug.cgi?id=18661> + Proxy server issue in Sunday's Nightly + + * DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp: + (runJavaScriptThread): + (startJavaScriptThreads): + (stopJavaScriptThreads): + Spawned threads were immediately detached, unlike the original ones, so joining them + made no sense. Now, all threads are created detached, and stopJavaScriptThreads() just + waits for them all to exit. + +2008-04-28 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Simon. + + Reset dumping resource load callbacks to false for the next test + + + * DumpRenderTree/qt/jsobjects.cpp: + (LayoutTestController::reset): + +2008-04-28 Tor Arne Vestbø <tavestbo@trolltech.com> + + Reviewed by Simon. + + Adapt to the latest API changes in WebKit/qt/Api. + + * DumpRenderTree/qt/DumpRenderTree.cpp: + (WebCore::DumpRenderTree::DumpRenderTree): + * DumpRenderTree/qt/jsobjects.cpp: + +2008-04-26 Robin Dunn <robin@alldunn.com> + + Reviewed by Kevin Ollivier. + + Delete the DerivedSources after make clean has been done so that the DerivedSources + don't get re-created. Also, use the proper extension for the Win wxPython extension. + + https://bugs.webkit.org/show_bug.cgi?id=18756 + + * wx/build-wxwebkit: + +2008-04-26 Adam Barth <hk9565@gmail.com> + + Reviewed by Adam Roben and Sam Weinig. + + Updates LayoutTestController to use host instead of domain. + + Collin Jackson <collinj-webkit@collinjackson.com> also contributed to this patch. + + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (LayoutTestController::setDatabaseQuota): + * DumpRenderTree/mac/UIDelegate.mm: + (-[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]): + +2008-04-26 Kevin Ollivier <kevino@theolliviers.com> + + wx build fix. Need the latest libpng. (Somehow my initial test passed without it.) + + * wx/install-unix-extras: + +2008-04-26 Robin Dunn <robin@alldunn.com> + + Reviewed by Kevin Ollivier. + + Allow the user to set the path to SWIG using an environment variable. + + https://bugs.webkit.org/show_bug.cgi?id=18660 + + * wx/build-wxwebkit: + +2008-04-26 Kevin Ollivier <kevino@theolliviers.com> + + wx build fix. Download the latest libpng version for building the + dependencies. + + * wx/install-unix-extras: + +2008-04-25 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Simon. + + Implement dumping of resource load callbacks to pass http/tests/xmlhttprequest/abort-should-cancel-load.html + + Similar to Editing and Frameloading we do the dumping within WebCore + + + * DumpRenderTree/qt/jsobjects.cpp: + (LayoutTestController::dumpResourceLoadCallbacks): + * DumpRenderTree/qt/jsobjects.h: + +2008-04-24 Jan Michael Alonzo <jmalonzo@unpluggable.com> + + Reviewed by Maciej Stachowiak. + + http://bugs.webkit.org/show_bug.cgi?id=18485 + Typo and documentation fix for build-webkit + + * Scripts/build-webkit: + +2008-04-24 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam. + + Don't call fprintf from the signal handler. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (crashHandler): + +2008-04-23 Adam Roben <aroben@apple.com> + + Make crashes be reported as crashes, not hangs + + Reviewed by David Kilzer. + + * Scripts/run-webkit-tests: + (top level): Use the new status field of the output from + readFromDumpToolWithTimer to determine if the test crashed or hung. + (sub readFromDumpToolWithTimer): + - If we fail to read a line and $! is not EAGAIN, then we've crashed + and should not try to read any more. + - Changed the timedout field to a more general status field. + +2008-04-22 David Kilzer <ddkilzer@apple.com> + + Bug 18683: update-webkit returns 0 even if it fails + + <https://bugs.webkit.org/show_bug.cgi?id=18683> + + Reviewed by Mitz Pettel. + + * Scripts/update-webkit: + (runSvnUpdate): Die if close() fails. + +2008-04-21 Adam Roben <aroben@apple.com> + + Flush stdout/stderr after printing every #EOF separator + + This fixes a hang when running the pixel tests on Windows + + Reviewed by Mitz Pettel. + + * DumpRenderTree/win/DumpRenderTree.cpp: + (dump): + (main): We don't have to flush stdout/stderr in the arguments loop + anymore, as runTest flushes for us. + +2008-04-21 Adam Roben <aroben@apple.com> + + Fix pixel tests + + * Scripts/run-webkit-tests: + (sub readFromDumpToolWithTimer): Use readline instead of read to + ensure that we don't read past the #EOF marker. + +2008-04-21 Holger Hans Peter Freyther <holger.freyther@trolltech.com> + + Reviewed by Simon. + + Build fix for Qt 4.3 + + * When building WebCore/internal make sure the QT_[BEGIN,END]_NAMESPACE is + always defined. Do this by adding defines to the compiler line + + * DumpRenderTree/qt/DumpRenderTree.pro: + +2008-04-19 Mike Hommey <glandium@debian.org> + + Reviewed by Alp Toker. + + Don't build GtkLauncher and DumpRenderTree with rpath. + + * GNUmakefile.am: + +2008-04-18 Jan Michael Alonzo <jmalonzo@unpluggable.com> + + Reviewed by Alp Toker. + + http://bugs.webkit.org/show_bug.cgi?id=16620 + [GTK] Autotools make dist and make check support + + Cleanups. + + * GNUmakefile.am: + +2008-04-18 Adam Roben <aroben@apple.com> + + Drop the hang timer to 30 seconds + + This matches what DRT/mac was using. + + Reviewed by Mitz Pettel. + + * Scripts/run-webkit-tests: + +2008-04-18 Adam Roben <aroben@apple.com> + + Get rid of DRT's Watchdog + + run-webkit-tests now detects hangs and samples DRT as needed. + + Reviewed by Mitz Pettel. + + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Removed + Watchdog* files from the project. + * DumpRenderTree/Watchdog.cpp: Removed. + * DumpRenderTree/Watchdog.h: Removed. + * DumpRenderTree/mac/DumpRenderTree.mm: Removed uses of Watchdog + (dumpRenderTree): + (runTest): + * DumpRenderTree/mac/WatchdogMac.h: Removed. + * DumpRenderTree/mac/WatchdogMac.mm: Removed. + * Scripts/run-webkit-tests: + (sub testCrashedOrTimedOut): Call sampleDumpTool() if we timed out. + (sub sampleDumpTool): Added. Writes a sample report to + ~/Library/Logs/DumpRenderTree/HangReport.txt. + +2008-04-18 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Holger. + + Adapt to the API changes in WebKit/qt + + * DumpRenderTree/qt/DumpRenderTree.cpp: + (WebCore::WebPage::WebPage): + (WebCore::DumpRenderTree::DumpRenderTree): + (WebCore::DumpRenderTree::initJSObjects): + (WebCore::DumpRenderTree::dumpFramesAsText): + (WebCore::DumpRenderTree::dump): + +2008-04-17 Adam Roben <aroben@apple.com> + + Fix many tests on Windows + + * Scripts/run-webkit-tests: + (readFromDumpToolWithTimer): + - Use read instead of sysread to ensure that we don't interfere with + other uses of buffered IO in this script. + (setFileHandleNonBlocking): Actually set the filehandle to blocking + when specified. + +2008-04-17 Adam Roben <aroben@apple.com> + + Fix ~10 tests + + * Scripts/run-webkit-tests: Only remove the newline after #EOF, not + whatever newline happens to be at the end of what we've read. + +2008-04-17 Adam Roben <aroben@apple.com> + + Remove DRT/win's hang timer + + run-webkit-tests takes care of this for us now + + Reviewed by Anders Carlsson. + + * DumpRenderTree/win/DumpRenderTree.cpp: + +2008-04-17 Adam Roben <aroben@apple.com> + + Don't wait for the hang timer twice in the case of a hang + + Previously we'd wait for a hang while reading both stdout and stderr + from DRT. Now we'll only wait for one or the other. + + Reviewed by Anders Carlsson. + + * Scripts/run-webkit-tests: + (top level): Don't wait for stderr to time out if stdout already timed + out. + (readFromDumpToolWithTimer): If $dontWaitForTimeOut is true, quit + after the first read that returns no data. + +2008-04-17 Adam Roben <aroben@apple.com> + + Don't throw away the output from timed out tests + + Reviewed by Anders Carlsson. + + * Scripts/run-webkit-tests: + (top level): Updated for changes to readFromDumpToolWithTimer. + (readFromDumpToolWithTimer): Return a hash that contains both the + output and whether or not the test timed out. + +2008-04-17 Adam Roben <aroben@apple.com> + + Make the hang timer 60 seconds + + * Scripts/run-webkit-tests: + +2008-04-17 Adam Roben <aroben@apple.com> + + Get rid of carriage returns in DRT/win's stderr + + Reviewed by Eric Seidel. + + * DumpRenderTree/win/DumpRenderTree.cpp: + (main): Mark stderr as binary like we already do for stdout. + +2008-04-17 Adam Roben <aroben@apple.com> + + Fix Bug 17678: run-webkit-tests should have a watchdog timer (and + timeout long tests) + + <https://bugs.webkit.org/show_bug.cgi?id=17678> + + We now abort tests that take longer than 60 seconds to produce output. + This matches the watchdog timer in DRT/mac and DRT/win (which we can + now remove). + + Reviewed by Eric Seidel. + + * Scripts/run-webkit-tests: + (top level): Read DRT's output using the new readFromDumpToolWithTimer + subroutine. If readFromDumpToolWithTimer returns undefined it means + the test timed out, so we register the test as a hang and move on. + (sub testCrashedOrTimedOut): Renamed from testCrashed. Now handles + both crashed and timed out tests. If the test timed out, we kill DRT + before returning. + (sub linksForTimedOutTest): Added. We don't have any output to link to for + tests that timed out. + (sub recordActualResultsAndDiff): Don't call length on undefined. + (sub readFromDumpToolWithTimer): Added. Performs non-blocking reads + from a filehandle until an #EOF is reached or + $maximumSecondsWithoutOutput have elapsed. + (sub setFileHandleNonBlocking): Marks a filehandle as blocking or + non-blocking. + +2008-04-17 Adam Roben <aroben@apple.com> + + Refactor test results page generation + + Reviewed by Eric Seidel. + + * Scripts/run-webkit-tests: + (sub htmlForResultsSection): Added. Takes a set of tests, a + description, and a subroutine to generate the links for each test, and + creates a HTML string containing a table of the tests and their + links. + (sub linksForExpectedAndActualResults): Added. Replaces the + htmlForExpectedAndActualResults subroutine. + (sub linksForMismatchTest): Added. + (sub linksForCrashOrErrorTest): Added. + (sub linksForNewTest): Added. + +2008-04-17 Adam Roben <aroben@apple.com> + + Print the extension for all tests in the test results page + + Reviewed by Eric Seidel. + + * Scripts/run-webkit-tests: + +2008-04-17 Adam Roben <aroben@apple.com> + + Move code that counts finished tests into a subroutine + + Reviewed by Eric Seidel. + + * Scripts/run-webkit-tests: + (sub countFinishedTest): Added. + +2008-04-17 Adam Roben <aroben@apple.com> + + Move code that handles a crash into a subroutine + + Reviewed by Eric Seidel. + + * Scripts/run-webkit-tests: + (sub testCrashed): Added. + +2008-04-17 Eric Seidel <eric@webkit.org> + + Reviewed by hyatt. + + Rename RenderView to RenderViewport in the next rename patch. + + * Scripts/do-webcore-rename: + +2008-04-17 Mario Bensi <mbensi@pleyo.com> + + Reviewed by Alp Toker. + + http://bugs.webkit.org/show_bug.cgi?id=18543 + DumpRenderTree gtk freeze + + fix DumpRenderTree gtk freeze + + * DumpRenderTree/gtk/DumpRenderTree.cpp: + (dump): + +2008-04-15 Anders Carlsson <andersca@apple.com> + + Add missing ; + + * Scripts/build-webkit: + +2008-04-15 Anders Carlsson <andersca@apple.com> + + Reviewed by Adam. + + Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES. + + * Scripts/build-webkit: + +2008-04-15 Andre Poenitz <andre.poenitz@trolltech.com> + + Reviewed by Simon. + + Fix compilation with Qt namespaces + + Qt can be configured to have all of its classes inside a specified namespaces. + This is for example used in plugin/component environments like Eclipse. + + This change makes it possible to let the Qt port compile against a namespaced + Qt by the use of macros Qt provides to properly forward declare Qt classes in + the namespace. + + * DumpRenderTree/qt/DumpRenderTree.h: + +2008-04-08 Kevin Ollivier <kevino@theolliviers.com> + + Reviewed by Darin Adler. + + Add a script that propagates any file changes made to the Bakefiles + over to GTK and Qt build systems. Still needs to be wired into + those ports though. + + * Scripts/update-sources-list.py: Added. + +2008-04-08 Mark Rowe <mrowe@apple.com> + + Clean up after Brady. + + * DumpRenderTree/mac/DumpRenderTree.mm: Add an include so that NSInteger can be found. + +2008-04-08 Brady Eidson <beidson@apple.com> + + Reviewed by Mitzpettel + + Fixed http://bugs.webkit.org/show_bug.cgi?id=18302 + -WebArchive subresources dump in random order, intermittent failures + + * DumpRenderTree/mac/DumpRenderTree.mm: + (compareResourceURLs): Sorting function based on the resource URLs + (serializeWebArchiveToXML): Sort the subresource array + +2008-04-07 Brady Eidson <beidson@apple.com> + + OMG, BUILD - please! + + * Scripts/build-webkit: + +2008-04-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com> + + Reviewed by Simon. + + * Enable running http tests for Qt again. Failing tests can be put into the skipped list. + * Running these tests on windows and other platforms might need some work. + + * Scripts/run-webkit-tests: + +2008-04-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com> + + Reviewed by Simon. + + * For the http tests we need the output of the FrameLoaderClient. The QtWebKit API + is not exporting enough to create the output in DRT itself. Settle with the approach + Lars has taken for the Editing support and add branches to our FrameLoaderClient code. + * run-webkit-tests http/tests(/loading) can now be executed. + * For tests in loading/ directories we are going to throw away the dirty + QWebPage to start with something clean. + + + * DumpRenderTree/qt/DumpRenderTree.cpp: + +2008-04-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com> + + Reviewed by Simon. + + * Treat http and https as special URLs as well. Change the main.cpp and + DumpRenderTree.cpp to handle http and https URIs as input. + * I'm not doing the clean up and merging of these two checks now. + + + * DumpRenderTree/qt/DumpRenderTree.cpp: + (WebCore::DumpRenderTree::readStdin): + * DumpRenderTree/qt/main.cpp: + (main): + +2008-04-03 Holger Hans Peter Freyther <holger.freyther@trolltech.com> + + Reviewed by Simon. + + * Remove dumpFrameLoadCallbacks from simple-subframe.html because it is + located in a directory with the name "loading". And this will autoamtically + enable dumping. + * Remove this method from the LayoutTestController as it is unused now and this + avoids adding it to the DRT of the Qt port. + + + * DumpRenderTree/LayoutTestController.cpp: + (setPrivateBrowsingEnabledCallback): + +2008-04-01 Christian Dywan <christian@imendio.com> + + Build fix for GCC 4.3. + + * DumpRenderTree/gtk/WorkQueueItemGtk.cpp: include string.h + +2008-04-01 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Holger. + + Fix Qt DRT run by also printing EOF on stderr, as expected by + run-webkit-tests. + + * DumpRenderTree/qt/DumpRenderTree.cpp: + (WebCore::DumpRenderTree::dump): + +2008-03-31 Julien Chaffraix <julien.chaffraix@gmail.com> + + Reviewed by Darin Adler. + + Bug 17665: determineSourceDir() dies if $sourceDir has a trailing backslash + + Remove trailing '/' in $sourceDir in determineSourceDir(). + + Fix suggested by Dmitriy Kazachkov. + + * Scripts/webkitdirs.pm: + +2008-03-29 Adam Roben <aroben@apple.com> + + Update for rename of an IWebViewPrivate method + + Reviewed by Mitz Pettel. + + * DumpRenderTree/win/DumpRenderTree.cpp: + (createWebViewAndOffscreenWindow): + +2008-03-26 Antti Koivisto <antti@apple.com> + + Reviewed by Anders. + + Enable SVG animation support by default. + + * Scripts/build-webkit: + +2008-03-25 Adam Roben <aroben@apple.com> + + Windows build fix + + * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj: + Add $(WebKitLibrariesDir)\include to the include path so we can find + stdint.h there. + +2008-03-24 Eric Seidel <eric@webkit.org> + + Reviewed by Mark. + + Clean up SVG features message to be less confusing. + + * Scripts/build-webkit: + +2008-03-24 Sam Weinig <sam@webkit.org> + + Reviewed by Dave Hyatt. + + Add EventSender.zoomPageIn/zoomPageOut support to DRT. + + * DumpRenderTree/mac/DumpRenderTree.mm: + (resetWebViewToConsistentStateBeforeTesting): + * DumpRenderTree/mac/EventSendingController.mm: + (+[EventSendingController isSelectorExcludedFromWebScript:]): + (-[EventSendingController zoomPageIn]): + (-[EventSendingController zoomPageOut]): + * DumpRenderTree/win/DumpRenderTree.cpp: + (resetWebViewToConsistentStateBeforeTesting): + * DumpRenderTree/win/EventSender.cpp: + (textZoomInCallback): + (textZoomOutCallback): + (zoomPageInCallback): + (zoomPageOutCallback): + +2008-03-24 Dan Bernstein <mitz@apple.com> + + Reviewed by Mark Rowe. + + - update bisect-builds for Safari 3.1 + + * Scripts/bisect-builds: Added Safari 3.1 and the corresponding minimal + revision, r29711. + +2008-03-21 Rodney Dawes <dobey@wayofthemonkey.com> + + Reviewed by Holger. + + http://bugs.webkit.org/show_bug.cgi?id=17981 + + Add webcore and javascriptcore cppflags to programs' _CPPFLAGS. + + * GNUmakefile.am: + +2008-03-21 Adam Roben <aroben@apple.com> + + Remove a non-working mirror from cygwin-downloader and add the ruby package + + * CygwinDownloader/cygwin-downloader.py: + * CygwinDownloader/cygwin-downloader.zip: Updated. + +2008-03-20 Mark Rowe <mrowe@apple.com> + + Reviewed by Sam Weinig. + + Ensure that the defines generated for FEATURE_DEFINES are sorted so that they will match the default settings of each project. + This will prevent the world from being rebuilt if you happen to switch between building in Xcode and with build-webkit on the + command-line. + + * Scripts/build-webkit: + +2008-03-17 Eric Seidel <eric@webkit.org> + + Reviewed by Dan Bernstein. + + Fix bogus argCount check breaking plugin test. + + * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: + +2008-03-17 Eric Seidel <eric@webkit.org> + + Reviewed by darin. + + Cleanup PluginObject.cpp and add support for testing + converting from int -> identifier -> string + and from string -> identifier -> int + as well as round-tripping ints and stings through identifiers + + * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: + (pluginGetProperty): + (pluginSetProperty): + (testDOMAccess): + (stringVariantToIdentifier): + (int32VariantToIdentifier): + (doubleVariantToIdentifier): + (variantToIdentifier): + (testIdentifierToString): + (testIdentifierToInt): + (testCallback): + (getURL): + (removeDefaultMethod): + (getURLNotify): + (testInvokeDefault): + (destroyStream): + (testEnumerate): + (testGetIntIdentifier): + (testGetProperty): + (testEvaluate): + (testGetPropertyReturnValue): + (pluginInvoke): + (pluginInvokeDefault): + (pluginInvalidate): + (pluginAllocate): + (pluginDeallocate): + (handleCallback): + +2008-03-16 Kevin Ollivier <kevino@theolliviers.com> + + Rubber stamped by Darin Adler. + + Add set-webkit-configuration support for wx port, and centralize + build dir location setting. + + http://bugs.webkit.org/show_bug.cgi?id=17790 + + * wx/browser/browser.bkl: + * wx/build-wxwebkit: + +2008-03-15 Darin Adler <darin@apple.com> + + * Scripts/commit-log-editor: Include the name line of the change log entry. + A long time ago I designed this script to not include the name because I + thought it was redundant (same as the name of the person checking in), but + nowadays it's more common for someone to check something in done by someone + else. + + * Scripts/do-webcore-rename: Added some more planned renames and removed + some that were already done "by hand". + +2008-03-13 Brent Fulgham <bfulgham@gmail.com> + + Reviewed by Darin Adler. + + Correct paths to vsprops files so they use the environment + variable, rather than hard-coded path. + http://bugs.webkit.org/show_bug.cgi?id=17797. + + * WinLauncher/WinLauncher.vcproj: Correct paths to vsprops. + +2008-03-12 Steve Falkenburg <sfalken@apple.com> + + VSExpress build fix + + * WinLauncher/WinLauncher.vcproj: + +2008-03-12 Holger Hans Peter Freyther <zecke@selfish.org> + + Reviewed by Alp Toker. + + Run testkjs in the correct productsDir in the GTK+ port. + + * Scripts/run-javascriptcore-tests: + +2008-03-11 Brent Fulgham <bfulgham@gmail.com> + + Reviewed by Adam Roben. + + Enabled WinLauncher as part of normal Windows build. + http://bugs.webkit.org/show_bug.cgi?id=17715. + + * WinLauncher/WinLauncher.vcproj: Update to use vsprops so that + it can find the proper libraries to link against. + +2008-03-10 Julien Chaffraix <julien.chaffraix@gmail.com> + + Reviewed and landed by Darin Adler. + + http://bugs.webkit.org/show_bug.cgi?id=17581 + Bug 17581: Use of uninitialized value in string ne at WebKitTools/Scripts/run-webkit-tests line 1576. + + Remove the previous warning which occurs when the --random option is used. + + * Scripts/run-webkit-tests: verify that $component[0] is defined before checking for + its inequality + +2008-03-07 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Darin Adler. + + Done with Lars. + + Ported the netscape test plugin to QWebPluginFactory. + + * DumpRenderTree/qt/DumpRenderTree.cpp: + (WebCore::WebPage::WebPage): + * DumpRenderTree/qt/main.cpp: + * DumpRenderTree/qt/testplugin.cpp: + (TestPlugin::plugins): + (TestPlugin::create): + * DumpRenderTree/qt/testplugin.h: + +2008-03-09 Steve Falkenburg <sfalken@apple.com> + + Stop Windows build if an error occurs in a prior project. + + Rubber stamped by Darin Adler. + + * Drosera/win/Drosera.vcproj/Drosera.vcproj: + * DumpRenderTree/win/DumpRenderTree.vcproj: + * DumpRenderTree/win/ImageDiff.vcproj: + * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj: + +2008-03-08 Julien Chaffraix <julien.chaffraix@gmail.com> + + Reviewed by Mark Rowe. + + DRT build fix for Tiger. + + * DumpRenderTree/mac/DumpRenderTreeMac.h: Define BUILDING_ON_TIGER. + +2008-03-07 Mark Rowe <mrowe@apple.com> + + Reviewed by Oliver Hunt. + + Fix WebKit build with GCC 4.2. + + * DumpRenderTree/mac/ResourceLoadDelegate.mm: Use correct argument type in method signature. + +2008-03-07 Stephanie Lewis <slewis@apple.com> + + Reviewed by Oliver. + + Add Windows part of <rdar://problem/5693690> + + * DumpRenderTree/win/DumpRenderTree.cpp: + (dump): + (main): + +2008-03-07 Alp Toker <alp@atoker.com> + + Back out the r30818, r30819 build fix attempts now the GTK+ build + server has been upgraded. + + * Scripts/webkitdirs.pm: + +2008-03-07 Stephanie Lewis <slewis@apple.com> + + Reviewed by Geoff. + + <rdar://problem/5693690> run-webkit-tests swallows STDERR output, including WebCore LEAK messages + + * DumpRenderTree/mac/DumpRenderTree.mm: + (dump): push EOF to stderr after every test + * Scripts/run-webkit-tests: collect stderr output and print it + +2008-03-07 Steve Falkenburg <sfalken@apple.com> + + Get pdevenv working with Visual Studio Express. + + Reviewed by Adam. + + * Scripts/pdevenv: + +2008-03-06 Adele Peterson <adele@apple.com> + + Reviewed by Darin Adler. + + Updated for testing <rdar://problem/5785895> Implement hasFocus() for HTMLDocument (HTML5) + + * DumpRenderTree/mac/UIDelegate.mm: + (-[UIDelegate webViewFocus:]): Remove duplicate code that was also in LayoutTestController::setWindowIsKey + (-[UIDelegate webViewUnfocus:]): Added. In Safari, the default is to focus another window if there is one. + To easily test cases where the window is unfocused, I made this just call setWindowIsKey(false). + +2008-03-06 Matt Lilek <webkit@mattlilek.com> + + Reviewed by Adam Roben. + + Bug 17691: REGRESSION: FindSafari doesn't work + http://bugs.webkit.org/show_bug.cgi?id=17691 + + Swap my change from r30394 to use the Release libraries instead of Debug + since some machines don't have the Debug version. + + * FindSafari/FindSafari.vcproj: + +2008-03-06 Kevin McCullough <kmccullough@apple.com> + + Reviewed by Sam and Tim. + + <rdar://5631450> Drosera: breakpoint indicators disappear after the + script is finished running. + - If there is a pre-existing breakpoint on a line when the file is + updated we need to redraw it. + + * Drosera/debugger.js: + +2008-03-06 Brady Eidson <beidson@apple.com> + + Tiger build fix...? + + * DumpRenderTree/mac/WatchdogMac.mm: + +2008-03-06 Brady Eidson <beidson@apple.com> + + Reviewed by Darin + + Added a cross-platform Watchdog thread to DRT. + + The current watchdog in both DRTWin and DRTMac is Timer based. Therefore, deadlocks and long running + main thread hangs still affect DRT. + + By placing the watchdog on a thread and having DRT "check in" after each test, long-running hangs + and true deadlocks can be caught. + + There is one hook for platform specific code. As I did my development and testing on Mac, and Mac has + `sample` available, the Mac implementation of this hook samples the process before it is killed. + + I arbitrarily chose 30 seconds as the timeout for now - this can be tweaked easily if we find a need. + + * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: + * DumpRenderTree/mac/Configurations/Base.xcconfig: Added LINKER_DISPLAYS_MANGLED_NAMES + + * DumpRenderTree/ForwardingHeaders/wtf/Locker.h: Added. + * DumpRenderTree/ForwardingHeaders/wtf/Threading.h: Added. + + * DumpRenderTree/Watchdog.cpp: Added. + (Watchdog::Watchdog): + (Watchdog::~Watchdog): + (Watchdog::start): + (Watchdog::stop): + (Watchdog::checkIn): + (Watchdog::setWatchdogInterval): + (Watchdog::handleHang): + (Watchdog::watchdogThreadStart): + (Watchdog::watchdogThread): + * DumpRenderTree/Watchdog.h: Added. + + * DumpRenderTree/mac/WatchdogMac.h: Added. + * DumpRenderTree/mac/WatchdogMac.mm: Added. + (WatchdogMac::handleHang): Sample the process and write it out to a file + + * DumpRenderTree/mac/DumpRenderTree.mm: + (dumpRenderTree): Setup and start the watchdog before running any tests + (runTest): Checkin with the watchdog after each test + +2008-03-05 Alp Toker <alp@atoker.com> + + Attempt to get the autotools build working again on the bot with + build-webkit. + + Force the use of /bin/bash since we seem to have bash-isms in the + configure script right now. + + * Scripts/webkitdirs.pm: + +2008-03-05 Alp Toker <alp@atoker.com> + + Re-attempt to switch to the autotools build system for GTK+. + + Change scripts to continue when distclean fails. + + * Scripts/webkitdirs.pm: + +2008-03-05 Alp Toker <alp@atoker.com> + + Force qmake for the GTK+ build until we get the build bot to succeed + with autotools (currently dies at make distclean) + + * Scripts/webkitdirs.pm: + +2008-03-04 Alp Toker <alp@atoker.com> + + Reviewed by Mark Rowe. + + Switch the default GTK+ build system from qmake to autotools. + + qmake can still be used by defining WEBKIT_BUILD_SYSTEM=qmake + + * Scripts/build-webkit: + * Scripts/run-launcher: + * Scripts/run-webkit-tests: + * Scripts/webkitdirs.pm: + +2008-03-04 Sam Weinig <sam@webkit.org> + + Reviewed by Darin Adler. + + * Scripts/do-webcore-rename: Update renaming plan. + +2008-03-02 Brent Fulgham <bfulgham@gmail.com> + + Reviewed by Alp Toker. + + Remove some needless LIBS. + + * GNUmakefile.am: + +2008-03-02 Alp Toker <alp@atoker.com> + + Reviewed by Mark Rowe. + + Split the WebKit GTK+ build out of the WebCore build and change the + shared object name to match the package name. + + * GNUmakefile.am: + +2008-03-01 Mark Rowe <mrowe@apple.com> + + Reviewed by Tim Hatcher. + + Update Xcode configuration to support building debug and release from the mysterious future. + + * DumpRenderTree/mac/Configurations/Base.xcconfig: + +2008-02-29 David Kilzer <ddkilzer@apple.com> + + Pass the correct configuration switch (--Debug|--Release) to build-testkjs. + + Reviewed by Dan. + + Originally broken in r26838. + + * Scripts/run-javascriptcore-tests: Push configuration switch onto @xcodeArgs + not local, unused @args variable. + +2008-02-29 David Kilzer <ddkilzer@apple.com> + + Bug 15754: webarchive layout tests fail when WebKit directory path contains symlinks + + <http://bugs.webkit.org/show_bug.cgi?id=15754> + + Reviewed by Geoff and Darin. + + We were using -[NSFileManager currentDirectoryPath] to get the current working directory, + then removing that path from all file:/// URLs in the WebArchive output so these tests + would pass no matter where they were run. + + The problem was that -[NSFileManager currentDirectoryPath] resolves symlinks in the + current working directory, but the WebArchive does not. This left the current working + directory in all file:/// URLs in the test output, and thus all tests failed, for any + developer that used symlinks to get to their WebKit source directory. + + The fix is to look backwards for "/LayoutTests/" in the URL we're passed, and simply + remove the current working directory path (no matter what it is) after "file://" but + before "/LayoutTests/". + + * DumpRenderTree/mac/DumpRenderTree.mm: + (normalizeWebResourceURL): Removed unused oldURLBase argument. We now replace the + current working directory as described above. + (convertWebResourceResponseToDictionary): Remove unused oldURLBase argument. Update + calls to normalizeWebResourceURL(). + (serializeWebArchiveToXML): Removed now unused cwdURL variable. Update calls to + normalizeWebResourceURL() and convertWebResourceResponseToDictionary(). + +2008-02-26 Robin Dunn <robin@alldunn.com> + + Reviewed by Kevin Ollivier. + + Improvements to the wx build script. + + http://bugs.webkit.org/show_bug.cgi?id=17492 + + * wx/build-wxwebkit: + - Update the Windows dll copying logic to copy dlls inside WebKitLibraries/win + - Allow the build script to properly find wxPython includes under different setups + - Make sure WX_PREFIX is set to WXWIN (wxWindows dir environment var.) if not defined + +2008-02-26 Timothy Hatcher <timothy@apple.com> + + Reviewed by Darin Adler. + + * Scripts/build-webkit: Add --universal and --64-bit flags to make building + 64-bit architectures easy. Combine the two flags to build 4-way universal. + * Makefile: Add "64" and "64u" make rules. Fix the universal rule to return + non-zero when the build failes. + +2008-02-26 Jessica Kahn <jess@apple.com> + + Reviewed by Darin Adler. + + * Scripts/gdb-safari: Set WEBKIT_UNSET_DYLD_FRAMEWORK_PATH in gdb's environment, + so that Safari inherits it when launched. Preexisting code in WebKit checks this + environment variable, and if set, unsets DYLD_FRAMEWORK_PATH, so that applications + launched by Safari continue to use the standard system WebKit. + +2008-02-25 Adam Roben <aroben@apple.com> + + Fix run-webkit-tests after r30394 + + * Scripts/webkitdirs.pm: Never append _debug to FindSafari's + executable name. + +2008-02-24 Darin Adler <darin@apple.com> + + * Scripts/do-webcore-rename: Make some updates based on a trial run of + the renaming script. + +2008-02-24 Darin Adler <darin@apple.com> + + * Scripts/do-webcore-rename: More renaming plans. + +2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com> + + Rubber stamped by Darin Adler. + + Add separator '\' after libJavaScriptCore_la_LIBADD and cleanup + whitespaces introduced in the previous commit. + + * GNUmakefile.am: + +2008-02-23 Jan Michael Alonzo <jmalonzo@unpluggable.com> + + Rubber-stamped by Darin Adler. + + * GNUmakefile.am: Add both GLOBALDEPS and WEBKITDEPS instead of DEPENDENCIES. + +2008-02-23 David Kilzer <ddkilzer@apple.com> + + Please clarify licensing for some files + <http://bugs.webkit.org/show_bug.cgi?id=14970> + + Reviewed by Darin Adler. + + * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: Added + copyright statement. Replaced license with newer Apple BSD-style license. + * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: Ditto. + * DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp: Ditto. + * DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h: Ditto. + * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp: Ditto. + * DumpRenderTree/win/TestNetscapePlugin/main.c: Ditto. + * mangleme/LICENSE: Added (LGPL). + +2008-02-22 Anders Carlsson <andersca@apple.com> + + Reviewed by Adam. + + <rdar://problem/5748781> + https://bugs.webkit.org/show_bug.cgi?id=17413 + REGRESSION: Latest Nightly doesn't load Java plugin w/Safari 3.1b + + Copy the Java plug-in over to the new location. + + * FindSafari/FindSafari.cpp: + (_tmain): + +2008-02-22 Anders Carlsson <andersca@apple.com> + + Reviewed by Adam. + + <rdar://problem/5747325> REGRESSION: HTTP layout tests hang + + * DumpRenderTree/win/DumpRenderTree.cpp: + (runTest): + Init the URL request with the correct timeout. + +2008-02-21 Mike Auty <mike.auty@gmail.com> + + Reviewed by Alp Toker. + + http://bugs.webkit.org/show_bug.cgi?id=17445 + [GTK] WebKit doesn't compile with LDFLAGS="-Wl,--as-needed" + + GTK+/autotools build system improvements + + The GNUmakefile.am files make use of the LDFLAGS variable to include library + additions such as -ljpeg etc. Unfortunately, if these inclusions aren't made + in LIBADD/LDADD variables, then they are mis-ordered during the linking. + + The as-needed flag discards libraries whose functions have not been needed by + earlier libraries, which therefore makes the ordering important. + + This moves all -l library inclusion statements from LDFLAGS variables to + LIBADD/LDADD variables. + + * GNUmakefile.am: + +2008-02-20 Brent Fulgham <bfulgham@gmail.com> + + Reviewed by Alp. + + - http://bugs.webkit.org/show_bug.cgi?id=17428 + Reenable a Windows-based launcher + + This patch reenables the venerable Spinneret application, + changing its name to match the other lanch applications. + + * WinLauncher: Added. + * WinLauncher/WinLauncher.cpp: Added. + (WinLauncherWebHost::updateAddressBar): + (WinLauncherWebHost::QueryInterface): + (WinLauncherWebHost::AddRef): + (WinLauncherWebHost::Release): + (resizeSubViews): + (_tWinMain): + (MyRegisterClass): + (InitInstance): + (WndProc): + (MyEditProc): + (About): + (loadURL): + * WinLauncher/WinLauncher.h: Added. + (WinLauncherWebHost::WinLauncherWebHost): + (WinLauncherWebHost::didStartProvisionalLoadForFrame): + (WinLauncherWebHost::didReceiveServerRedirectForProvisionalLoadForFrame): + (WinLauncherWebHost::didFailProvisionalLoadWithError): + (WinLauncherWebHost::didCommitLoadForFrame): + (WinLauncherWebHost::didReceiveTitle): + (WinLauncherWebHost::didReceiveIcon): + (WinLauncherWebHost::didFinishLoadForFrame): + (WinLauncherWebHost::didFailLoadWithError): + (WinLauncherWebHost::didChangeLocationWithinPageForFrame): + (WinLauncherWebHost::willPerformClientRedirectToURL): + (WinLauncherWebHost::didCancelClientRedirectForFrame): + (WinLauncherWebHost::willCloseFrame): + (WinLauncherWebHost::windowScriptObjectAvailable): + * WinLauncher/WinLauncher.ico: Added. + * WinLauncher/WinLauncher.rc: Added. + * WinLauncher/WinLauncher.vcproj: Added. + * WinLauncher/resource.h: Added. + * WinLauncher/small.ico: Added. + * WinLauncher/stdafx.cpp: Added. + * WinLauncher/stdafx.h: Added. + +2008-02-19 Brady Eidson <beidson@apple.com> + + Reviewed by Geoff + + Fixed a bug in DRT --threaded mode + + * DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp: + (startJavaScriptThreads): Don't detach the newly created thread. The later call to stopJavaScriptThreads() tries + to pthread_join() each thread that had been created, but you can't join a detached thread! + +2008-02-18 Brady Eidson <beidson@apple.com> + + Changes by Geoff Garen, Reviewed by Darin + + Fix for <rdar://5747529> - ObjC Exception can cause JSLock to never be released + + DRT changes for test: platform/mac/plugins/webScriptObject-exception-deadlock.html + + [WebScriptObject valueForKey:] might throw an exception, and previously might have "leaked" the global JSLock + This test calls valueForKey, then runs some arbitrary Javascript on a 2ndary thread. If the lock has leaked, + this series of method calls will deadlock. If things are good, it will complete successfully. + + * DumpRenderTree/mac/ObjCController.m: + (runJavaScriptThread): + (+[ObjCController isSelectorExcludedFromWebScript:]): + (+[ObjCController webScriptNameForSelector:]): + (-[ObjCController testValueForKey]): + +2008-02-18 Matt Lilek <webkit@mattlilek.com> + + Reviewed by Adam. + + Remove FindSafari's Release configuration. + + * FindSafari/FindSafari.vcproj: + +2008-02-15 Adam Roben <aroben@apple.com> + + Fix a typo that broke the Mac build + + Reviewed by Mark. + + * Scripts/build-webkit: + +2008-02-14 Adam Roben <aroben@apple.com> + + Turn on cross-document messaging support by default + + Reviewed by Darin Adler. + + * Scripts/build-webkit: + +2008-02-14 Adam Roben <aroben@apple.com> + + Conditionalize cross-document messaging support + + The cross-document messaging parts of HTML 5 are in flux and we want + ports to be able to turn off the support as needed. + + Note that the support is turned off by default right now. A subsequent + commit will turn it on by default. + + Reviewed by Darin Adler. + + * Scripts/build-webkit: + +2008-02-14 Darin Adler <darin@apple.com> + + - fix Windows build + + * DumpRenderTree/win/UIDelegate.cpp: + (UIDelegate::setStatusText): Update parameter types to match declaration. + +2008-02-14 Oliver Hunt <oliver@apple.com> + + Reviewed by Geoff G and Weinig. + + Add ability for DRT to report tests setting the status text. + + * DumpRenderTree/LayoutTestController.cpp: + (LayoutTestController::LayoutTestController): + (dumpStatusCallbacksCallback): + (LayoutTestController::staticFunctions): + * DumpRenderTree/LayoutTestController.h: + * DumpRenderTree/mac/UIDelegate.mm: + (-[UIDelegate webView:setStatusText:]): + * DumpRenderTree/win/UIDelegate.cpp: + * DumpRenderTree/win/UIDelegate.h: + +2008-02-13 Adam Roben <aroben@apple.com> + + Windows build fix + + * DumpRenderTree/ForwardingHeaders/wtf/MathExtras.h: Added. + +2008-02-13 Adam Roben <aroben@apple.com> + + Windows/GTK+ build fix + + * DumpRenderTree/LayoutTestController.cpp: #include MathExtras.h to + get isnan. + +2008-02-13 Brady Eidson <beidson@apple.com> + + Reviewed by Darin Adler + + Add some much needed Database support to DRT + + * DumpRenderTree/LayoutTestController.cpp: + (LayoutTestController::LayoutTestController): + (dumpDatabaseCallbacksCallback): Flag to control if the UIDelegate methods related to + databases are called + (clearAllDatabasesCallback): Allow a test to delete all databases + (setDatabaseQuotaCallback): Allow a test to set the quota new origins will get + (LayoutTestController::staticFunctions): + + * DumpRenderTree/LayoutTestController.h: + (LayoutTestController::dumpDatabaseCallbacks): + (LayoutTestController::setDumpDatabaseCallbacks): + + * DumpRenderTree/mac/LayoutTestControllerMac.mm: + (LayoutTestController::clearAllDatabases): + (LayoutTestController::setDatabaseQuota): + + * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: + (LayoutTestController::clearAllDatabases): Stubbed out + (LayoutTestController::setDatabaseQuota): Ditto + * DumpRenderTree/win/LayoutTestControllerWin.cpp: + (LayoutTestController::clearAllDatabases): Stubbed out with error message + (LayoutTestController::setDatabaseQuota): Ditto + + * DumpRenderTree/mac/UIDelegate.mm: + (-[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]): Print a + message with details about the event then return a 5mb quota like before + + +2008-02-12 Steve Falkenburg <sfalken@apple.com> + + Changes to support merged MIDL output. + + All COM interfaces are now generated to WebKit.h. + + Reviewed by Sam, Ada. + + * Drosera/win/BaseDelegate.h: + * Drosera/win/DebuggerClient.cpp: + * Drosera/win/DebuggerDocumentPlatform.cpp: + * Drosera/win/Drosera.cpp: + * Drosera/win/ServerConnection.cpp: + * Drosera/win/ServerConnection.h: + * DumpRenderTree/win/DumpRenderTree.cpp: + * DumpRenderTree/win/EditingDelegate.h: + * DumpRenderTree/win/EventSender.cpp: + * DumpRenderTree/win/FrameLoadDelegate.cpp: + * DumpRenderTree/win/FrameLoadDelegate.h: + * DumpRenderTree/win/GCControllerWin.cpp: + * DumpRenderTree/win/LayoutTestControllerWin.cpp: + * DumpRenderTree/win/PolicyDelegate.h: + * DumpRenderTree/win/ResourceLoadDelegate.h: + * DumpRenderTree/win/UIDelegate.cpp: + * DumpRenderTree/win/UIDelegate.h: + * DumpRenderTree/win/WorkQueueItemWin.cpp: + +2008-02-10 Dan Bernstein <mitz@apple.com> + + Reviewed by Oliver Hunt. + + - fix a memory leak + + * DumpRenderTree/cg/ImageDiffCG.cpp: + (getDifferenceBitmap): Use a static CFMutableData instead of allocating + and leaking the buffer each time. + 2008-02-07 Adam Roben <aroben@apple.com> Fix error in bisect-builds when responding "broken" for the first @@ -54,7 +4234,7 @@ 2008-02-05 Holger Freyther <zecke@selfish.org> - Reviewed by Darin. + Reviewed by Darin Adler. In http://bugs.webkit.org/show_bug.cgi?id=16853 it was identified that the the output of the willCloseFrame and didClearWindowObject FrameLoadDelegate @@ -247,7 +4427,7 @@ 2008-01-29 Alexey Proskuryakov <ap@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. <rdar://problem/5710692> All storage tests fail/crash @@ -488,7 +4668,7 @@ <rdar://problem/5695344> check-for-global-initializers script never checks any object files - Reviewed by Darin. + Reviewed by Darin Adler. We now touch a check-for-global-initializers.timestamp file in the TARGET_TEMP_DIR directory to determine when new object files @@ -625,7 +4805,7 @@ Use shared vsprops for most vcproj properties. - Reviewed by Darin. + Reviewed by Darin Adler. * Drosera/win/Drosera.vcproj/Drosera.vcproj: * DumpRenderTree/win/DumpRenderTree.vcproj: @@ -655,7 +4835,7 @@ 2008-01-14 Holger Hans Peter Freyther <holger.freyther@trolltech.com> - Reviewed by Darin. + Reviewed by Darin Adler. * Allow to run the tests in reverse order to spot test cases where the result depends on the order the tests were ran. @@ -665,7 +4845,7 @@ 2008-01-14 Holger Hans Peter Freyther <holger.freyther@trolltech.com> - Reviewed by Darin. + Reviewed by Darin Adler. * Randomize tests array to spot test cases where the results depends on the order the tests are ran. @@ -813,7 +4993,7 @@ Fix a crash when pathToLocalResource fails and a leak - Reviewed by Darin. + Reviewed by Darin Adler. * DumpRenderTree/LayoutTestController.cpp: (pathToLocalResourceCallback): Dont leak the JSStringRef, and make @@ -859,7 +5039,7 @@ Meta key is not the same as Alt key on windows. - Reviewed by Darin. + Reviewed by Darin Adler. * DumpRenderTree/win/EventSender.cpp: (keyDownCallback): @@ -895,7 +5075,7 @@ 2008-01-09 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - add some more renames, adjust some @@ -924,7 +5104,7 @@ 2008-01-04 Kevin McCullough <kmccullough@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - <rdar://problem/5666914> fast/regex/test{1,4}.html are failing DRT did not correctly handle printing the '\0' char. Now it does. @@ -1014,7 +5194,7 @@ 2008-01-03 Alexey Proskuryakov <ap@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. <rdar://problem/5463489> A number of layout tests should be using execCommand instead of textInputController @@ -1146,7 +5326,7 @@ 2008-01-02 Alexey Proskuryakov <ap@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. Fix fast/events/arrow-keys-on-body.html for real. @@ -1154,7 +5334,7 @@ 2008-01-02 Luca Bruno <lethalman88@gmail.com> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=16674 [GTK] run-launcher sets wrong LD_LIBRARY_PATH @@ -1295,7 +5475,7 @@ Make svn-apply/svn-unapply work with patches from git-format-patch. - Reviewed by Darin. + Reviewed by Darin Adler. * Scripts/svn-apply: (patch): If 'Index:' can't be found in the text passed in, print it @@ -1384,7 +5564,7 @@ 2007-12-16 Alexey Proskuryakov <ap@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=16462 REGRESSION: access keys broken on Windows @@ -1499,7 +5679,7 @@ 2007-12-14 Kevin McCullough <kmccullough@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - Layout test fix for mac. When dumped to the console local file paths now only show the name of the resource not the whole path. This is to @@ -1596,7 +5776,7 @@ 2007-12-07 Alexey Proskuryakov <ap@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. <rdar://problem/5535636> Have to press 4 times instead of 2 times to get the expected result of ^^ with german keyboard. @@ -1956,7 +6136,7 @@ 2007-12-03 Stephanie <slewis@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Check to see if we are building a debug root @@ -2264,7 +6444,7 @@ 2007-11-28 Anders Carlsson <andersca@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. <rdar://problem/5132001> contextClick is not implemented in DRT on Windows. @@ -2283,7 +6463,7 @@ 2007-11-27 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Fix DumpRenderTree ObjC bug comparing strings. @@ -3105,7 +7285,7 @@ Fixes fast/history/clicked-link-is-visited.html. - Reviewed by Darin. + Reviewed by Darin Adler. * DumpRenderTree/win/DumpRenderTree.cpp: (runTest): Clear the optionalSharedHistory. @@ -3261,7 +7441,7 @@ by DumpRenderTree reside. The Qt port is already using this, so I'm just following their lead. - Reviewed by Darin. + Reviewed by Darin Adler. * DumpRenderTree/win/DumpRenderTree.cpp: (exePath): Refactored code out of initialize(). @@ -3416,7 +7596,7 @@ Sort files(...); sections of Xcode project files. - Rubber-stamped by Darin. + Rubber-stamped by Darin Adler. * DrawTest/DrawTest.xcodeproj/project.pbxproj: * Drosera/mac/Drosera.xcodeproj/project.pbxproj: @@ -3427,7 +7607,7 @@ Script to sort "files(...);" sections in Xcode project.pbxproj files. - Reviewed by Darin. + Reviewed by Darin Adler. * Scripts/sort-Xcode-project-file: Added. @@ -3696,7 +7876,7 @@ prepare-ChangeLog and update-webkit create needless ChangeLog conflicts <http://bugs.webkit.org/show_bug.cgi?id=15600> - Reviewed by Darin. + Reviewed by Darin Adler. The resolve-ChangeLog script merges conflicted ChangeLogs in svn or git by creating a patch of the local changes and applying it with a fuzz level of 3 to the new file. @@ -4027,7 +8207,7 @@ 2007-10-23 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Don't print a massive pile of setenvs from tools that automatically build testkjs. @@ -4035,7 +8215,7 @@ 2007-10-23 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - add wrapper that finds the right copy of testkjs @@ -4085,7 +8265,7 @@ 2007-10-19 Kevin McCullough <kmccullough@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - Changed the Client so that the DebuggerDocument now own the ServerConnection. This simplifies ownership and cleanup. @@ -4373,7 +8553,7 @@ 2007-10-19 Alice Liu <alice.liu@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Fix for these broken layout tests on Windows: @@ -4543,7 +8723,7 @@ FindSafari simply prints the location of an installed Safari.exe on stdout. - Reviewed by Darin. + Reviewed by Darin Adler. * FindSafari/FindSafari.cpp: Copied from WebKitTools/WebKitInitializer/WebKitInitializer.cpp. (getStringValue): @@ -4659,7 +8839,7 @@ 2007-10-14 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - New JavaScript benchmark http://bugs.webkit.org/show_bug.cgi?id=15515 @@ -4751,7 +8931,7 @@ 2007-10-14 Oleg Sukhodolsky <son.two@gmail.com> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=15006 Refactoring of buildQMakeGdkProject()/buildQMakeQtProject() and isGdk()/isQt() @@ -4856,7 +9036,7 @@ 2007-10-11 Kevin McCullough <kmccullough@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - Updated rational for the leaks list to be more clear. @@ -5510,7 +9690,7 @@ 2007-09-21 Timothy Hatcher <timothy@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. <rdar://problem/5491013> REGRESSION: -[WebView windowScriptObject] returns a dummy object or nil if a page hasn't loaded (breaks EA Sports Online) @@ -6084,7 +10264,7 @@ 2007-09-13 Sam Weinig <sam@webkit.org> - Rubber stamped by Darin. + Rubber stamped by Darin Adler. Make DumpRenderTree more cross platform ready. - Convert GCController to use the JSCore API instead of the WebScriptObject. @@ -6156,7 +10336,7 @@ 2007-09-12 Kevin McCullough <kmccullough@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - Simplified code paths and extracted out functions to increase encapsulation. @@ -6211,7 +10391,7 @@ 2007-09-12 Sam Weinig <sam@webkit.org> - Rubber stamped by Darin. + Rubber stamped by Darin Adler. Convert the LayoutTestController to use the JSCore API instead of WebScriptObject. @@ -6429,7 +10609,7 @@ 2007-09-10 Kevin McCullough <kmccullough@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - Renaming DebuggerDocument[platform] to DebuggerClient to be more clear. @@ -6965,7 +11145,7 @@ 2007-08-14 David Kilzer <ddkilzer@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=14965 svn-create-patch uses deprecated tail switch @@ -7089,7 +11269,7 @@ 2007-08-03 Sam Weinig <sam@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. Recursively dump all frames as text using new layoutTestController.dumpChildFramesAsText() function. @@ -7289,7 +11469,7 @@ 2007-07-22 David Kilzer <ddkilzer@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=14713 Script to update iExploder cssproperties.in file based on CSSPropertyNames.in @@ -7303,7 +11483,7 @@ 2007-07-22 Oliver Hunt <oliver@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=14710 @@ -7545,7 +11725,7 @@ 2007-07-16 Kevin McCullough <kmccullough@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - Continued x-platform modifications. @@ -7659,7 +11839,7 @@ 2007-07-13 David Kilzer <ddkilzer@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Added support for -h|--help argument and verify that all command line arguments parse correctly. @@ -8037,7 +12217,7 @@ Got rid of extract-webkit-localizable-strings because it was trying to do update-webkit-localizable-strings' job. - Rubberstamped by Darin. + Rubberstamped by Darin Adler. * Scripts/extract-webkit-localizable-strings: Removed. * Scripts/update-webkit-localizable-strings: Renamed from @@ -8060,7 +12240,7 @@ 2007-07-03 Adele Peterson <adele@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Extended DumpRenderTree to test encoding and decoding host names. @@ -8072,7 +12252,7 @@ 2007-07-03 Sam Weinig <sam@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. Eleventh round of fixes for implicit 64-32 bit conversion errors. <rdar://problem/5292262> @@ -8355,7 +12535,7 @@ 2007-05-29 David Kilzer <ddkilzer@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=13901 run-pageloadtest does not obey testName on command-line @@ -8366,7 +12546,7 @@ 2007-05-29 David Kilzer <ddkilzer@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=13900 svnStatus($) subroutine in svn-[un]apply does not work properly with directories @@ -8385,7 +12565,7 @@ 2007-05-28 David Kilzer <ddkilzer@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=10342 prepare-ChangeLog only shows removed files but not added files when files are moved @@ -8980,7 +13160,7 @@ 2007-04-21 Mitz Pettel <mitz@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=13350 Build Ahem into DumpRenderTree @@ -8996,7 +13176,7 @@ 2007-04-20 Adam Roben <aroben@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=13421 Bug 13421: prepare-ChangeLog should use svn-create-patch when spewing diffs @@ -9170,7 +13350,7 @@ 2007-04-03 Anders Carlsson <andersca@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Add the notion of a "disallowed URL", which the resource loader won't allow to be loaded. @@ -9439,7 +13619,7 @@ 2007-03-09 Andrew Wellington <proton@wiretapped.net> - Reviewed by Darin. + Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=13007 svn-create-patch doesn't handle UTF files with BOMs as text @@ -9487,7 +13667,7 @@ 2007-03-07 David Kilzer <ddkilzer@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. - WebKitTools part of fix for http://bugs.webkit.org/show_bug.cgi?id=12463 WebArchiver - attempt to insert nil exception when archive empty iframe @@ -9642,7 +13822,7 @@ 2007-02-22 Adele Peterson <adele@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Added option in layoutTestController to setTabKeyCyclesThroughElements, so we can test <rdar://problem/5014970> 9A374: Tabs don't work in the message body @@ -9991,7 +14171,7 @@ 2007-02-06 David Smith <catfish.man@gmail.com> - Reviewed by Darin. + Reviewed by Darin Adler. Patch for http://bugs.webkit.org/show_bug.cgi?id=12566 [Drosera] Console history fixups @@ -10057,7 +14237,7 @@ 2007-02-01 Anders Carlsson <acarlsson@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. * DumpRenderTree/UIDelegate.m: (-[UIDelegate webView:addMessageToConsole:]): @@ -10128,7 +14308,7 @@ 2007-01-30 David Kilzer <ddkilzer@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=11882 Need a way to regression test .webarchive output files @@ -10309,7 +14489,7 @@ 2007-01-21 Sanjay Madhav <sanjay12@gmail.com> - Reviewed by Darin. + Reviewed by Darin Adler. Test support for: <rdar://problem/4928583> Memory usage grows when reloading google.com/ig @@ -10550,7 +14730,7 @@ 2007-01-11 Lars Knoll <lars@trolltech.com> - Reviewed by Darin. + Reviewed by Darin Adler. Adjust to loader changes. @@ -10603,7 +14783,7 @@ 2007-01-01 David Kilzer <ddkilzer@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=12023 svn-create-patch and friends should handle moved/copied files @@ -10643,7 +14823,7 @@ 2006-12-28 David Kilzer <ddkilzer@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=11882 Need a way to regression test .webarchive output files @@ -10875,7 +15055,7 @@ 2006-12-10 Rob Buis <buis@kde.org> - Reviewed by Darin. + Reviewed by Darin Adler. * DumpRenderTree/DumpRenderTree.m: (dump): @@ -10958,7 +15138,7 @@ 2006-12-04 Steve Falkenburg <sfalken@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Make extract-localizable-strings compatible with cpp file extensions. @@ -11164,7 +15344,7 @@ 2006-11-04 Mark Rowe <bdash@webkit.org> - Reviewed by Darin. + Reviewed by Darin Adler. Fix use of uninitialized value in pattern match. @@ -11377,7 +15557,7 @@ 2006-10-30 Stephanie Lewis <slewis@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Change Makefiles to return non-zero when module make fails. Fix bug where if xcode options are not set, modules can build in the @@ -11445,7 +15625,7 @@ 2006-10-26 Nikolas Zimmermann <zimmermann@kde.org> - Reviewed by Darin. + Reviewed by Darin Adler. Fix Qt/Linux build. @@ -11755,7 +15935,7 @@ 2006-10-04 Anders Carlsson <acarlsson@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. * Scripts/run-webkit-tests: Add an environment variable, WebKitExpectedTestResultsDirectory, which controls where expected test @@ -11885,7 +16065,7 @@ 2006-09-28 David Harrison <harrison@apple.com> - Suggested by Darin. + Suggested by Darin Adler. Moved an extern declaration from inside a method to the top of the file. @@ -12003,7 +16183,7 @@ 2006-09-04 Nikolas Zimmermann <zimmermann@kde.org> - Reviewed by Darin. + Reviewed by Darin Adler. Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10644 Adjust DumpRenderTree to the FrameQtClient changes. @@ -12199,7 +16379,7 @@ 2006-08-15 Jonas Witt <jonas.witt@gmail.com> - Reviewed by Darin. + Reviewed by Darin Adler. - added a function to create a few DOMKeyboardEvents and dispatch them to a specified HTML element @@ -12212,7 +16392,7 @@ 2006-08-15 Duncan Wilcox <duncan@mclink.it> - Reviewed and tweaked by Darin. + Reviewed and tweaked by Darin Adler. - added DumpRenderTree support so editing delegate can be made to refuse edits to enable tests for http://bugs.webkit.org/show_bug.cgi?id=10129 @@ -12244,7 +16424,7 @@ 2006-08-03 Mark Rowe <opendarwin.org@bdash.net.nz> - Reviewed by Darin. + Reviewed by Darin Adler. Bug 10224: [Drosera] Drosera icon should be set on DroseraLauncher so it appears in nightly builds http://bugs.webkit.org/show_bug.cgi?id=10224 @@ -12263,7 +16443,7 @@ 2006-08-02 Timothy Hatcher <timothy@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Bug 9632: [Drosera] syntax highlighting is slow (reproducible 40 second hang) http://bugs.webkit.org/show_bug.cgi?id=9632 @@ -12334,7 +16514,7 @@ 2006-07-31 Mark Rowe <opendarwin.org@bdash.net.nz> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=10178 Bug 10178: [Drosera] Selecting a frame in the stack list should take you to that location in the source @@ -12344,7 +16524,7 @@ 2006-07-31 Mark Rowe <opendarwin.org@bdash.net.nz> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=10175 Bug 10175: [Drosera] Anonymous functions show up as "(global scope)" in stack list @@ -12354,7 +16534,7 @@ 2006-07-31 Mark Rowe <opendarwin.org@bdash.net.nz> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=10167 Bug 10167: REGRESSION(r15688): ASSERTION FAILED: _private->mouseDownEvent != nil in layout tests @@ -12378,7 +16558,7 @@ 2006-07-29 Mike Emmel <mike.emmel@gmail.com> - Reviewed by Darin. + Reviewed by Darin Adler. - fixes for Linux build @@ -12387,7 +16567,7 @@ 2006-07-24 Dan Waylonis <waylonis@google.com> - Reviewed and tweaked a bit by Darin. + Reviewed and tweaked a bit by Darin Adler. * DumpRenderTree/ObjCPlugin.m: (+[ObjCPlugin isSelectorExcludedFromWebScript:]): Added "echo:". @@ -12398,7 +16578,7 @@ 2006-07-24 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. Fix http://bugs.webkit.org/show_bug.cgi?id=10060 Improve iExploder results parsing @@ -12417,7 +16597,7 @@ 2006-07-16 David Kilzer <ddkilzer@kilzer.net> - Reviewed by Darin. + Reviewed by Darin Adler. * BuildSlaveSupport/build.webkit.org-config/buildbot.css: Removed "No newline at end of file" that snuck in as part of the "apply patch" process. @@ -12426,7 +16606,7 @@ 2006-07-16 David Kilzer <ddkilzer@kilzer.net> - Reviewed by Darin. + Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=9875 Teach svn-apply and svn-unapply to use patch(1) for additions and deletions @@ -12452,7 +16632,7 @@ 2006-07-12 David Kilzer <ddkilzer@kilzer.net> - Reviewed by Darin. + Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=9848 Teach svn-create-patch and friends to fix ChangeLog patches @@ -12505,7 +16685,7 @@ 2006-07-11 Timothy Hatcher <timothy@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Bug 9598: [Drosera] add a JavaScript evaluator console http://bugs.webkit.org/show_bug.cgi?id=9598 @@ -12572,7 +16752,7 @@ 2006-07-10 Mark Rowe <opendarwin.org@bdash.net.nz> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=9839 Bug 9839: Nightly launcher fails to detect extensions when extension causes crash on load @@ -12606,7 +16786,7 @@ 2006-07-09 David Kilzer <ddkilzer@kilzer.net> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=9693 svn-apply should set ChangeLog date correctly when applying patches @@ -12682,7 +16862,7 @@ 2006-07-04 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=9734 - add support for dumping non-HTML as text - in this case use textContent @@ -12771,7 +16951,7 @@ 2006-06-30 Mike Emmel <mike.emmel@gmail.com> - Reviewed by Darin. + Reviewed by Darin Adler. - first check-in of a Gdk shell for testing WebKit @@ -12779,7 +16959,7 @@ 2006-06-29 Timothy Hatcher <timothy@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Need to call window close so WebView tears-down completly. @@ -12788,7 +16968,7 @@ 2006-06-29 Mark Rowe <opendarwin.org@bdash.net.nz> - Reviewed by Darin. + Reviewed by Darin Adler. Bug 9615: Buildbot configuration should be in SVN repository http://bugs.webkit.org/show_bug.cgi?id=9615 @@ -12811,7 +16991,7 @@ 2006-06-29 Mark Rowe <opendarwin.org@bdash.net.nz> - Reviewed by Darin. + Reviewed by Darin Adler. Bug 9614: Nightly builds should notify user if a newer build is available http://bugs.webkit.org/show_bug.cgi?id=9614 @@ -12827,7 +17007,7 @@ 2006-06-26 Jonas Witt <jonas.witt@gmail.com> - Reviewed by Darin. + Reviewed by Darin Adler. Bug 9579: LayoutTests/fast/events/objc-event-api.html failing due to screenY output http://bugs.webkit.org/show_bug.cgi?id=9579 @@ -12850,7 +17030,7 @@ 2006-06-25 Timothy Hatcher <timothy@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Bug 9568: assertion failure in Safari after quitting Drosera http://bugs.webkit.org/show_bug.cgi?id=9568 @@ -12863,7 +17043,7 @@ 2006-06-25 David Kilzer <ddkilzer@kilzer.net> - Reviewed by Darin. + Reviewed by Darin Adler. * Scripts/svn-apply: Speed up isDirectoryEmptyForRemoval() by returning as soon as we find that the directory is not empty instead of reading in every single file and directory first, @@ -12886,7 +17066,7 @@ 2006-06-25 David Kilzer <ddkilzer@kilzer.net> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=9571 Teach svn-apply and svn-unapply to handle directory adds and removes better @@ -12896,7 +17076,7 @@ 2006-06-25 Timothy Hatcher <timothy@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Bug 9574: Drosera should show inline scripts within the original HTML http://bugs.webkit.org/show_bug.cgi?id=9574 @@ -12918,7 +17098,7 @@ 2006-06-24 David Kilzer <ddkilzer@kilzer.net> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=9570 Teach prepare-ChangeLog to operate on a list of files or directories @@ -12928,7 +17108,7 @@ 2006-06-24 James G. Speth <speth@end.com> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=8843 add a way to build Objective-C test cases in HTML @@ -12985,7 +17165,7 @@ 2006-06-24 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=9564 A bunch of fixes to run-webkit-httpd @@ -13142,7 +17322,7 @@ 2006-06-20 Timothy Hatcher <timothy@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Adds a JavaScript debugger, called Drosera. Named after a genus of bug eating plants. @@ -13374,7 +17554,7 @@ 2006-06-01 Anders Carlsson <acarlsson@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. * DumpRenderTree/DumpRenderTree.m: (+[LayoutTestController isSelectorExcludedFromWebScript:]): @@ -13383,7 +17563,7 @@ 2006-06-01 Anders Carlsson <acarlsson@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. http://bugs.webkit.org/show_bug.cgi?id=8996 slow-utf8-text layout test case failing (no longer deterministic?) @@ -13569,7 +17749,7 @@ 2006-04-28 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=8633 DumpRenderTree should reset the URL cache @@ -13596,7 +17776,7 @@ 2006-04-23 Mitz Pettel <opendarwin.org@mitzpettel.com> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=6905 DumpRenderTree needs a way to force painting (to allow invalidation tests) @@ -13658,7 +17838,7 @@ 2006-04-17 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=8444 Integrate mangleme test script. @@ -13675,7 +17855,7 @@ 2006-04-17 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=8443 An easier way to save iExploder tests. @@ -13684,7 +17864,7 @@ 2006-04-17 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=8421 Integrate iExploder test script. @@ -13724,7 +17904,7 @@ 2006-04-16 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=8412 Restore color profile after a crash @@ -13749,7 +17929,7 @@ 2006-04-13 Mark Rowe <opendarwin.org@bdash.net.nz> - Rubber-stamped by Darin. + Rubber-stamped by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=8348 upload-disk-image stage on buildslaves fail with "No space left on device" @@ -13769,7 +17949,7 @@ 2006-04-10 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=8157 Make HTTP tests using Perl use .pl extension @@ -13974,7 +18154,7 @@ 2006-03-28 Timothy Hatcher <timothy@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Exit gracefully if $ENV{'CURRENT_ARCH'} is undefined. Rolling out my previous change. @@ -14217,7 +18397,7 @@ 2006-03-13 Alexey Proskuryakov <ap@nypop.com> - Fix proposed by Mitz Pettel, reviewed by Darin. + Fix proposed by Mitz Pettel, reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=7718 run-webkit-tests fast/dom/HTMLObjectElement/ hangs @@ -14267,7 +18447,7 @@ Test: fast/events/event-sender-mouse-click.html - Reviewed by Darin. + Reviewed by Darin Adler. - fix http://bugs.webkit.org/show_bug.cgi?id=7583 DRT hangs when doing eventSender.mouseDown on native widgets @@ -14311,7 +18491,7 @@ 2006-03-09 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.c: (pluginInvoke): Added a method to test getURL. @@ -14656,7 +18836,7 @@ 2006-02-23 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. - Turn http tests back on by default. - Wait for Apache to actually start serving requests. @@ -14667,7 +18847,7 @@ 2006-02-23 Alexey Proskuryakov <ap@nypop.com> - Suggested by Mitz Pettel, reviewed by Darin. + Suggested by Mitz Pettel, reviewed by Darin Adler. * Scripts/run-webkit-tests: Pass User and Group directives, so that Apache can run CGIs even if the permissions are 700 or 600. @@ -14767,7 +18947,7 @@ 2006-02-22 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=7409 Some minor fixes to http tests. @@ -14776,7 +18956,7 @@ 2006-02-21 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=6197 Would like to use locally installed Apache for testing. @@ -14805,7 +18985,7 @@ 2006-02-18 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - Added install-win-extras script which installs some extra programs and libraries, and does Windows first-time setup. @@ -14815,7 +18995,7 @@ 2006-02-19 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. + Reviewed by Darin Adler. - http://bugs.webkit.org/show_bug.cgi?id=7308 DumpRenderTree should be able to load files via HTTP @@ -15140,7 +19320,7 @@ 2006-01-12 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - make prepare-ChangeLog way faster by using svn diff instead of svn status to detect if there are any new tests @@ -15380,7 +19560,7 @@ 2006-01-04 Timothy Hatcher <timothy@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. Created by Eric. Tweaked and tested by me. @@ -15524,7 +19704,7 @@ 2005-11-28 Alexey Proskuryakov <ap@nypop.com> - Reviewed by Darin. Committed by Maciej. + Reviewed by Darin Adler. Committed by Maciej. - fixed "DumpRenderTree should test for Ahem before doing anything else" (http://bugs.webkit.org/show_bug.cgi?id=5838) @@ -15575,7 +19755,7 @@ 2005-11-03 John Sullivan <sullivan@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. * Scripts/run-safari: changed message to say "Starting Safari" instead of odd "Start Safari" @@ -15628,7 +19808,7 @@ 2005-10-08 Alexey Proskuryakov <ap@nypop.com> - Reviewed, rearranged and landed by Darin. + Reviewed, rearranged and landed by Darin Adler. - fixed http://bugs.webkit.org/show_bug.cgi?id=4707 Need a way to automatically test for regressions in NSTextInput implementation @@ -15712,7 +19892,7 @@ 2005-09-22 Duncan Wilcox <duncan@mclink.it> Reviewed by Maciej. - Landed by Darin. + Landed by Darin Adler. - patch for <http://bugs.webkit.org/show_bug.cgi?id=4963> "Would like to simulate human interaction with webview" @@ -15788,7 +19968,7 @@ 2005-09-11 Mark Rowe <opendarwin.org@bdash.net.nz> - Reviewed, tweaked, and landed by Darin. + Reviewed, tweaked, and landed by Darin Adler. - fixed http://bugs.webkit.org/show_bug.cgi?id=4286 .Mac prefpane crashes when Safari using CVS WebKit is running @@ -15832,7 +20012,7 @@ 2005-08-31 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - set color variant and font settings to a consistent value. (http://bugs.webkit.org/show_bug.cgi?id=4769) @@ -15865,7 +20045,7 @@ 2005-08-29 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - fixed http://bugs.webkit.org/show_bug.cgi?id=4723 (some pixel tests fail when AA settings are changed) @@ -15893,7 +20073,7 @@ 2005-08-27 Jussi Hagman <juhagman@abo.fi> - Reviewed and landed by Darin. + Reviewed and landed by Darin Adler. - fixed http://bugs.webkit.org/show_bug.cgi?id=4676 output of update-webkit is too verbose @@ -15910,7 +20090,7 @@ 2005-08-25 Ben La Monica <ben.lamonica@gmail.com> - Reviewed, tweaked, and landed by Darin. + Reviewed, tweaked, and landed by Darin Adler. - fixed http://bugs.webkit.org/show_bug.cgi?id=4585 update-webkit doesn't notice when you have SVGSupport and update properly @@ -15919,7 +20099,7 @@ 2005-08-25 Anders Carlsson <andersca@mac.com> - Reviewed and landed by Darin. + Reviewed and landed by Darin Adler. - fixed http://bugs.webkit.org/show_bug.cgi?id=4572 layout test machinery can't handle tests with applets that have code attributes @@ -15989,7 +20169,7 @@ 2005-08-19 Ben La Monica <ben.lamonica@gmail.com> - Reviewed by Darin. + Reviewed by Darin Adler. * Scripts/cvs-create-patch: Add an --include-unknowns option that will cause new files to be included in the patch even without "cvs add". @@ -16052,7 +20232,7 @@ 2005-08-17 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - hacked DumpRenderTree to make the scrollbars appear and disappear properly. @@ -16061,7 +20241,7 @@ 2005-08-14 Oliver Hunt <ojh16@student.canterbury.ac.nz> - Reviewed and landed by Darin. + Reviewed and landed by Darin Adler. - fixed http://bugs.webkit.org/show_bug.cgi?id=4251 Ideally would be able to pass arguments to apps using run-safari and run-webkit-app scripts @@ -16297,7 +20477,7 @@ 2005-07-26 Maciej Stachowiak <mjs@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. - new script to review the DOM layout test results and see where we stand on actual success and failure @@ -16355,7 +20535,7 @@ 2005-07-21 Geoffrey Garen <ggaren@apple.com> - Reviewed by Darin. + Reviewed by Darin Adler. * Scripts/build-dumprendertree: changed XCode 2.0 project file reference to 2.1 diff --git a/WebKitTools/CygwinDownloader/cygwin-downloader.py b/WebKitTools/CygwinDownloader/cygwin-downloader.py index a0e7089..d87e0da 100644 --- a/WebKitTools/CygwinDownloader/cygwin-downloader.py +++ b/WebKitTools/CygwinDownloader/cygwin-downloader.py @@ -36,9 +36,6 @@ mirror_servers = ["http://cygwin.elite-systems.org/", "http://mirror.mcs.anl.gov/cygwin/", "http://cygwin.osuosl.org/", "http://mirrors.kernel.org/sourceware/cygwin/", - "http://cygwin.mirrors.hoobly.com/", - "http://cygwin.rtin.bz/", - "http://mirrors.wikifusion.info/cygwin/", "http://mirrors.xmission.com/cygwin/", "http://sourceware.mirrors.tds.net/pub/sourceware.org/cygwin/"] @@ -67,6 +64,7 @@ required_packages = frozenset(["apache", "python", "rebase", "rsync", + "ruby", "subversion", "unzip", "vim", @@ -118,6 +116,8 @@ package_names.sort() def add_package_and_dependencies(name): if name in names_to_download: return + if not name in packages: + return packages[name]["needs_download"] = True names_to_download.add(name) for dep in packages[name]["requires"]: diff --git a/WebKitTools/CygwinDownloader/cygwin-downloader.zip b/WebKitTools/CygwinDownloader/cygwin-downloader.zip Binary files differindex 40f43b3..9b9c0f0 100644 --- a/WebKitTools/CygwinDownloader/cygwin-downloader.zip +++ b/WebKitTools/CygwinDownloader/cygwin-downloader.zip diff --git a/WebKitTools/DrawTest/DrawTest.xcodeproj/project.pbxproj b/WebKitTools/DrawTest/DrawTest.xcodeproj/project.pbxproj index 8d62751..3ac995b 100644 --- a/WebKitTools/DrawTest/DrawTest.xcodeproj/project.pbxproj +++ b/WebKitTools/DrawTest/DrawTest.xcodeproj/project.pbxproj @@ -36,7 +36,7 @@ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; }; 32CA4F630368D1EE00C91783 /* DrawTest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawTest_Prefix.pch; sourceTree = "<group>"; }; 78662E6C096B4E1600907EA7 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 8D1107320486CEB800E47090 /* DrawTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DrawTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; A8C006AF0898634600BA5114 /* TestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestController.h; sourceTree = "<group>"; }; A8C006B00898634600BA5114 /* SVGTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVGTest.m; sourceTree = "<group>"; }; @@ -217,7 +217,6 @@ mainGroup = 29B97314FDCFA39411CA2CEA /* DrawTest */; projectDirPath = ""; projectRoot = ""; - shouldCheckCompatibility = 1; targets = ( 8D1107260486CEB800E47090 /* DrawTest */, ); diff --git a/WebKitTools/Drosera/DebuggerDocument.cpp b/WebKitTools/Drosera/DebuggerDocument.cpp deleted file mode 100644 index f5dbf87..0000000 --- a/WebKitTools/Drosera/DebuggerDocument.cpp +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright (C) 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#include "config.h" -#include "DebuggerDocument.h" - -#include "ServerConnection.h" - -#include <JavaScriptCore/JSContextRef.h> -#include <JavaScriptCore/JSRetainPtr.h> -#include <JavaScriptCore/JSStringRefCF.h> -#include <JavaScriptCore/RetainPtr.h> - -DebuggerDocument::DebuggerDocument(ServerConnection* serverConn) - : m_server(serverConn) -{ - ASSERT(m_server); -} - -//-- Callbacks - -JSValueRef DebuggerDocument::breakpointEditorHTMLCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/) -{ - RetainPtr<CFURLRef> htmlURLRef(AdoptCF, ::CFBundleCopyResourceURL(::CFBundleGetBundleWithIdentifier(CFSTR("org.webkit.drosera")), CFSTR("breakpointEditor"), CFSTR("html"), 0)); - if (!htmlURLRef) - return JSValueMakeUndefined(context); - - // FIXME: I'm open to a better way to do this. We convert from UInt8 to CFString to JSString (3 string types!) - RetainPtr<CFReadStreamRef> readStreamRef(AdoptCF, CFReadStreamCreateWithFile(0, htmlURLRef.get())); - CFReadStreamRef readStream = readStreamRef.get(); - - if (!CFReadStreamOpen(readStream)) - return JSValueMakeUndefined(context); - - // Large enough for current BreakPointEditor.html but won't need to be changed if that file changes - // because we loop over the entire file and read it in bufferLength pieces at a time - const CFIndex bufferLength = 740; - UInt8 buffer[bufferLength]; - Vector<UInt8, bufferLength> charBuffer; - CFIndex readResult = bufferLength; - while (readResult == bufferLength) { - readResult = CFReadStreamRead(readStream, buffer, bufferLength); - - // Error condition (-1) will not copy any data - for (int i = 0; i < readResult; i++) - charBuffer.append(buffer[i]); - } - - CFReadStreamClose(readStream); - if (readResult == -1) - return JSValueMakeUndefined(context); - - // FIXME: Is there a way to determine the encoding? - RetainPtr<CFStringRef> fileContents(AdoptCF, CFStringCreateWithBytes(0, charBuffer.data(), charBuffer.size(), kCFStringEncodingUTF8, true)); - JSRetainPtr<JSStringRef> fileContentsJS(Adopt, JSStringCreateWithCFString(fileContents.get())); - JSValueRef ret = JSValueMakeString(context, fileContentsJS.get()); - - return ret; -} - -JSValueRef DebuggerDocument::pauseCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/) -{ - DebuggerDocument* debuggerDocument = reinterpret_cast<DebuggerDocument*>(JSObjectGetPrivate(thisObject)); - - debuggerDocument->platformPause(); - return JSValueMakeUndefined(context); -} - -JSValueRef DebuggerDocument::resumeCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/) -{ - DebuggerDocument* debuggerDocument = reinterpret_cast<DebuggerDocument*>(JSObjectGetPrivate(thisObject)); - debuggerDocument->platformResume(); - return JSValueMakeUndefined(context); -} - -JSValueRef DebuggerDocument::stepIntoCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/) -{ - DebuggerDocument* debuggerDocument = reinterpret_cast<DebuggerDocument*>(JSObjectGetPrivate(thisObject)); - debuggerDocument->platformStepInto(); - return JSValueMakeUndefined(context); -} - -JSValueRef DebuggerDocument::evaluateScriptCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - DebuggerDocument* debuggerDocument = reinterpret_cast<DebuggerDocument*>(JSObjectGetPrivate(thisObject)); - if (argumentCount < 2) - return JSValueMakeUndefined(context); - - if (!JSValueIsNumber(context, arguments[1])) - return JSValueMakeUndefined(context); - - double callFrame = JSValueToNumber(context, arguments[1], exception); - ASSERT(!*exception); - - JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[0], exception)); - ASSERT(!*exception); - - JSValueRef ret = debuggerDocument->platformEvaluateScript(context, script.get(), (int)callFrame); - - return ret; -} - -JSValueRef DebuggerDocument::currentFunctionStackCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef thisObject, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* exception) -{ - DebuggerDocument* debuggerDocument = reinterpret_cast<DebuggerDocument*>(JSObjectGetPrivate(thisObject)); - Vector<JSValueRef> stack; - debuggerDocument->getPlatformCurrentFunctionStack(context, stack); - return DebuggerDocument::toJSArray(context, stack, exception); -} - -JSValueRef DebuggerDocument::localScopeVariableNamesForCallFrameCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - DebuggerDocument* debuggerDocument = reinterpret_cast<DebuggerDocument*>(JSObjectGetPrivate(thisObject)); - if (argumentCount < 1) - return JSValueMakeUndefined(context); - - if (!JSValueIsNumber(context, arguments[0])) - return JSValueMakeUndefined(context); - - double callFrame = JSValueToNumber(context, arguments[0], exception); - ASSERT(!*exception); - - // Get the variable names - Vector<JSValueRef> localVariableNames; - - debuggerDocument->getPlatformLocalScopeVariableNamesForCallFrame(context, static_cast<int>(callFrame), localVariableNames); - return DebuggerDocument::toJSArray(context, localVariableNames, exception); -} - -JSValueRef DebuggerDocument::valueForScopeVariableNamedCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - DebuggerDocument* debuggerDocument = reinterpret_cast<DebuggerDocument*>(JSObjectGetPrivate(thisObject)); - - if (argumentCount < 2) - return JSValueMakeUndefined(context); - - if (!JSValueIsString(context, arguments[0])) - return JSValueMakeUndefined(context); - - JSRetainPtr<JSStringRef> key(Adopt, JSValueToStringCopy(context, arguments[0], exception)); - ASSERT(!*exception); - - if (!JSValueIsNumber(context, arguments[1])) - return JSValueMakeUndefined(context); - - double callFrame = JSValueToNumber(context, arguments[1], exception); - ASSERT(!*exception); - - return debuggerDocument->platformValueForScopeVariableNamed(context, key.get(), (int)callFrame); -} - -JSValueRef DebuggerDocument::logCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - if (argumentCount < 1) - return JSValueMakeUndefined(context); - - if (!JSValueIsString(context, arguments[0])) - return JSValueMakeUndefined(context); - - JSRetainPtr<JSStringRef> msg(Adopt, JSValueToStringCopy(context, arguments[0], exception)); - ASSERT(!*exception); - - DebuggerDocument::platformLog(msg.get()); - return JSValueMakeUndefined(context); -} - -//-- These are the calls into the JS. --// - -bool DebuggerDocument::isPaused(JSContextRef context) const -{ - JSObjectRef globalObject = JSContextGetGlobalObject(context); - JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithUTF8CString("isPaused")); - JSValueRef objectProperty = JSObjectGetProperty(context, globalObject, string.get(), 0); - return JSValueToBoolean(context, objectProperty); -} - -void DebuggerDocument::updateFileSource(JSContextRef context, JSStringRef documentSource, JSStringRef url) -{ - JSValueRef documentSourceValue = JSValueMakeString(context, documentSource); - JSValueRef urlValue = JSValueMakeString(context, url); - JSValueRef forceValue = JSValueMakeBoolean(context, true); - - JSValueRef arguments[] = { documentSourceValue, urlValue, forceValue }; - int argumentsSize = sizeof(arguments)/sizeof(arguments[0]); - - DebuggerDocument::callGlobalFunction(context, "updateFileSource", argumentsSize, arguments); -} - -void DebuggerDocument::didParseScript(JSContextRef context, JSStringRef source, JSStringRef documentSource, JSStringRef url, JSValueRef sourceId, JSValueRef baseLine) -{ - JSValueRef sourceValue = JSValueMakeString(context, source); - JSValueRef documentSourceValue = JSValueMakeString(context, documentSource); - JSValueRef urlValue = JSValueMakeString(context, url); - - JSValueRef arguments[] = { sourceValue, documentSourceValue, urlValue, sourceId, baseLine }; - int argumentsSize = sizeof(arguments)/sizeof(arguments[0]); - - DebuggerDocument::callGlobalFunction(context, "didParseScript", argumentsSize, arguments); -} - -void DebuggerDocument::willExecuteStatement(JSContextRef context, JSValueRef sourceId, JSValueRef lineno, JSValueRef* exception) -{ - JSValueRef arguments[] = { sourceId, lineno }; - int argumentsSize = sizeof(arguments)/sizeof(arguments[0]); - - DebuggerDocument::callGlobalFunction(context, "willExecuteStatement", argumentsSize, arguments, exception); - if (exception && *exception) - logException(context, *exception); -} - -void DebuggerDocument::didEnterCallFrame(JSContextRef context, JSValueRef sourceId, JSValueRef lineno, JSValueRef* exception) -{ - JSValueRef arguments[] = { sourceId, lineno }; - int argumentsSize = sizeof(arguments)/sizeof(arguments[0]); - - DebuggerDocument::callGlobalFunction(context, "didEnterCallFrame", argumentsSize, arguments, exception); - if (exception && *exception) - logException(context, *exception); -} - -void DebuggerDocument::willLeaveCallFrame(JSContextRef context, JSValueRef sourceId, JSValueRef lineno, JSValueRef* exception) -{ - JSValueRef arguments[] = { sourceId, lineno }; - int argumentsSize = sizeof(arguments)/sizeof(arguments[0]); - - DebuggerDocument::callGlobalFunction(context, "willLeaveCallFrame", argumentsSize, arguments, exception); - if (exception && *exception) - logException(context, *exception); -} - -void DebuggerDocument::exceptionWasRaised(JSContextRef context, JSValueRef sourceId, JSValueRef lineno, JSValueRef* exception) -{ - JSValueRef arguments[] = { sourceId, lineno }; - int argumentsSize = sizeof(arguments)/sizeof(arguments[0]); - - DebuggerDocument::callGlobalFunction(context, "exceptionWasRaised", argumentsSize, arguments, exception); -} - -void DebuggerDocument::windowScriptObjectAvailable(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) -{ - JSRetainPtr<JSStringRef> droseraStr(Adopt, JSStringCreateWithUTF8CString("DebuggerDocument")); - JSValueRef droseraObject = JSObjectMake(context, getDroseraJSClass(), this); - - JSObjectSetProperty(context, windowObject, droseraStr.get(), droseraObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); - if (exception && *exception) - logException(context, *exception); -} - -JSValueRef DebuggerDocument::toJSArray(JSContextRef context, Vector<JSValueRef>& vectorValues, JSValueRef* exception) -{ - JSObjectRef globalObject = JSContextGetGlobalObject(context); - JSRetainPtr<JSStringRef> constructorString(Adopt, JSStringCreateWithUTF8CString("Array")); - JSValueRef constructorProperty = JSObjectGetProperty(context, globalObject, constructorString.get(), exception); - ASSERT(!*exception); - - JSObjectRef arrayConstructor = JSValueToObject(context, constructorProperty, exception); - ASSERT(!*exception); - - JSObjectRef array = JSObjectCallAsConstructor(context, arrayConstructor, 0, 0, exception); - ASSERT(!*exception); - - JSRetainPtr<JSStringRef> pushString(Adopt, JSStringCreateWithUTF8CString("push")); - JSValueRef pushValue = JSObjectGetProperty(context, array, pushString.get(), exception); - ASSERT(!*exception); - - JSObjectRef push = JSValueToObject(context, pushValue, exception); - ASSERT(!*exception); - - for (Vector<JSValueRef>::iterator it = vectorValues.begin(); it != vectorValues.end(); ++it) { - JSObjectCallAsFunction(context, push, array, 1, it, exception); - ASSERT(!*exception); - } - - return array; -} - -// Private -JSValueRef DebuggerDocument::callGlobalFunction(JSContextRef context, const char* functionName, int argumentCount, JSValueRef arguments[], JSValueRef* exception) -{ - JSObjectRef globalObject = JSContextGetGlobalObject(context); - return callFunctionOnObject(context, globalObject, functionName, argumentCount, arguments, exception); -} - -JSValueRef DebuggerDocument::callFunctionOnObject(JSContextRef context, JSObjectRef object, const char* functionName, int argumentCount, JSValueRef arguments[], JSValueRef* exception) -{ - JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithUTF8CString(functionName)); - JSValueRef objectProperty = JSObjectGetProperty(context, object, string.get(), exception); - - JSObjectRef function = JSValueToObject(context, objectProperty, exception); - ASSERT(JSObjectIsFunction(context, function)); - - JSValueRef returnValue = JSObjectCallAsFunction(context, function, 0, argumentCount, arguments, exception); - if (exception && *exception) - logException(context, *exception); - - return returnValue; -} - -JSClassRef DebuggerDocument::getDroseraJSClass() -{ - static JSClassRef droseraClass = 0; - - if (!droseraClass) { - JSClassDefinition classDefinition = {0}; - classDefinition.staticFunctions = DebuggerDocument::staticFunctions(); - - droseraClass = JSClassCreate(&classDefinition); - } - - return droseraClass; -} - -JSStaticFunction* DebuggerDocument::staticFunctions() -{ - static JSStaticFunction staticFunctions[] = { - { "breakpointEditorHTML", DebuggerDocument::breakpointEditorHTMLCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { "currentFunctionStack", DebuggerDocument::currentFunctionStackCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { "evaluateScript", DebuggerDocument::evaluateScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { "localScopeVariableNamesForCallFrame", DebuggerDocument::localScopeVariableNamesForCallFrameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { "pause", DebuggerDocument::pauseCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { "resume", DebuggerDocument::resumeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { "stepInto", DebuggerDocument::stepIntoCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { "valueForScopeVariableNamed", DebuggerDocument::valueForScopeVariableNamedCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { "log", DebuggerDocument::logCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { 0, 0, 0 } - }; - - return staticFunctions; -} - -void DebuggerDocument::logException(JSContextRef context, JSValueRef exception) -{ - if (!exception) - return; - - JSRetainPtr<JSStringRef> msg(Adopt, JSValueToStringCopy(context, exception, 0)); - DebuggerDocument::platformLog(msg.get()); -} - diff --git a/WebKitTools/Drosera/DebuggerDocument.h b/WebKitTools/Drosera/DebuggerDocument.h deleted file mode 100644 index 7043ba1..0000000 --- a/WebKitTools/Drosera/DebuggerDocument.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef DebuggerDocument_H -#define DebuggerDocument_H - -#pragma warning(push) -#pragma warning(disable: 4510 4512 4610) -#include <JavaScriptCore/JSObjectRef.h> -#pragma warning(pop) - -#include <JavaScriptCore/Vector.h> - -// Forward Declarations -#if PLATFORM(MAC) -#include <JavaScriptCore/RetainPtr.h> -@class ServerConnection; -typedef RetainPtr<ServerConnection> ServerConnectionRef; -#else if PLATFORM(WIN) -#include <wtf/OwnPtr.h> -class ServerConnection; -typedef OwnPtr<ServerConnection> ServerConnectionRef; -#endif - -typedef struct OpaqueJSString* JSStringRef; -typedef struct OpaqueJSValue* JSObjectRef; - -class DebuggerDocument { -public: - DebuggerDocument(ServerConnection*); - - // These are all calls from the JS - static JSValueRef breakpointEditorHTMLCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); - static JSValueRef pauseCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); - static JSValueRef resumeCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); - static JSValueRef stepIntoCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); - static JSValueRef evaluateScriptCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); - static JSValueRef currentFunctionStackCallback(JSContextRef /*context*/, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); - static JSValueRef localScopeVariableNamesForCallFrameCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); - static JSValueRef valueForScopeVariableNamedCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); - static JSValueRef logCallback(JSContextRef context, JSObjectRef /*function*/, JSObjectRef /*thisObject*/, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/); - - // Non Cross-platform functions - void platformPause(); - void platformResume(); - void platformStepInto(); - JSValueRef platformEvaluateScript(JSContextRef, JSStringRef script, int callFrame); - void getPlatformCurrentFunctionStack(JSContextRef, Vector<JSValueRef>& currentStack); - void getPlatformLocalScopeVariableNamesForCallFrame(JSContextRef, int callFrame, Vector<JSValueRef>& variableNames); - JSValueRef platformValueForScopeVariableNamed(JSContextRef, JSStringRef key, int callFrame); - static void platformLog(JSStringRef msg); - - // These are the calls into the JS. - bool isPaused(JSContextRef) const; - static void updateFileSource(JSContextRef, JSStringRef documentSource, JSStringRef url); - static void didParseScript(JSContextRef, JSStringRef source, JSStringRef documentSource, JSStringRef url, JSValueRef sourceId, JSValueRef baseLine); - static void willExecuteStatement(JSContextRef, JSValueRef sourceId, JSValueRef lineno, JSValueRef* exception = 0); - static void didEnterCallFrame(JSContextRef, JSValueRef sourceId, JSValueRef lineno, JSValueRef* exception = 0); - static void willLeaveCallFrame(JSContextRef, JSValueRef sourceId, JSValueRef lineno, JSValueRef* exception = 0); - static void exceptionWasRaised(JSContextRef, JSValueRef sourceId, JSValueRef lineno, JSValueRef* exception = 0); - - static JSValueRef toJSArray(JSContextRef, Vector<JSValueRef>&, JSValueRef* exception); - static JSValueRef callGlobalFunction(JSContextRef, const char* functionName, int argumentCount, JSValueRef arguments[], JSValueRef* exception = 0); // Implementation for calls into JS - - void windowScriptObjectAvailable(JSContextRef, JSObjectRef windowObject, JSValueRef* exception = 0); - - ServerConnection* server() const { return m_server.get(); } - -private: - static JSValueRef callFunctionOnObject(JSContextRef, JSObjectRef object, const char* functionName, int argumentCount, JSValueRef arguments[], JSValueRef* exception = 0); // Implementation for calls into JS - static JSClassRef getDroseraJSClass(); - static JSStaticFunction* staticFunctions(); - - static void logException(JSContextRef, JSValueRef exception); - - ServerConnectionRef m_server; -}; - -#endif //DebuggerDocument_H - diff --git a/WebKitTools/Drosera/Drosera.icns b/WebKitTools/Drosera/Drosera.icns Binary files differdeleted file mode 100644 index ead895e..0000000 --- a/WebKitTools/Drosera/Drosera.icns +++ /dev/null diff --git a/WebKitTools/Drosera/DroseraWin.make b/WebKitTools/Drosera/DroseraWin.make deleted file mode 100644 index b69d47d..0000000 --- a/WebKitTools/Drosera/DroseraWin.make +++ /dev/null @@ -1,13 +0,0 @@ -!IF !defined(BUILDSTYLE) -BUILDSTYLE=Release -!ELSEIF "$(BUILDSTYLE)"=="DEBUG" -BUILDSTYLE=Debug_Internal -!ENDIF - -install: - set WebKitLibrariesDir=$(SRCROOT)\AppleInternal - set WebKitOutputDir=$(OBJROOT) - set PRODUCTION=1 - devenv "win\Drosera.vcproj\Drosera.vcproj" /rebuild $(BUILDSTYLE) - xcopy "$(OBJROOT)\bin\*" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y - xcopy "$(OBJROOT)\bin\Drosera.resources\*" "$(DSTROOT)\AppleInternal\bin\Drosera.resources" /e/v/i/h/y diff --git a/WebKitTools/Drosera/English.lproj/Debugger.nib/classes.nib b/WebKitTools/Drosera/English.lproj/Debugger.nib/classes.nib deleted file mode 100644 index 3e0e4cb..0000000 --- a/WebKitTools/Drosera/English.lproj/Debugger.nib/classes.nib +++ /dev/null @@ -1,12 +0,0 @@ -{ - IBClasses = ( - { - CLASS = DebuggerDocument; - LANGUAGE = ObjC; - OUTLETS = {server = id; webView = WebView; }; - SUPERCLASS = NSWindowController; - }, - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } - ); - IBVersion = 1; -}
\ No newline at end of file diff --git a/WebKitTools/Drosera/English.lproj/Debugger.nib/info.nib b/WebKitTools/Drosera/English.lproj/Debugger.nib/info.nib deleted file mode 100644 index 7564e3e..0000000 --- a/WebKitTools/Drosera/English.lproj/Debugger.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>IBDocumentLocation</key> - <string>907 177 356 240 0 0 1280 832 </string> - <key>IBFramework Version</key> - <string>446.1</string> - <key>IBOpenObjects</key> - <array> - <integer>5</integer> - </array> - <key>IBSystem Version</key> - <string>8L127</string> -</dict> -</plist> diff --git a/WebKitTools/Drosera/English.lproj/Debugger.nib/keyedobjects.nib b/WebKitTools/Drosera/English.lproj/Debugger.nib/keyedobjects.nib Binary files differdeleted file mode 100644 index 3978af2..0000000 --- a/WebKitTools/Drosera/English.lproj/Debugger.nib/keyedobjects.nib +++ /dev/null diff --git a/WebKitTools/Drosera/English.lproj/MainMenu.nib/classes.nib b/WebKitTools/Drosera/English.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index f192cda..0000000 --- a/WebKitTools/Drosera/English.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,40 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {attach = id; showAttachPanel = id; }; - CLASS = DebuggerApplication; - LANGUAGE = ObjC; - OUTLETS = {attachButton = NSButton; attachTable = NSTableView; attachWindow = NSPanel; }; - SUPERCLASS = NSObject; - }, - { - ACTIONS = { - closeCurrentFile = id; - pause = id; - resume = id; - showConsole = id; - stepInto = id; - stepOut = id; - stepOver = id; - }; - CLASS = DebuggerDocument; - LANGUAGE = ObjC; - OUTLETS = {server = id; webView = WebView; }; - SUPERCLASS = NSWindowController; - }, - { - ACTIONS = { - closeCurrentFile = id; - myAction = id; - showConsole = id; - stepInto = id; - stepOut = id; - stepOver = id; - }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - } - ); - IBVersion = 1; -}
\ No newline at end of file diff --git a/WebKitTools/Drosera/English.lproj/MainMenu.nib/info.nib b/WebKitTools/Drosera/English.lproj/MainMenu.nib/info.nib deleted file mode 100644 index 838fde9..0000000 --- a/WebKitTools/Drosera/English.lproj/MainMenu.nib/info.nib +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>IBDocumentLocation</key> - <string>488 89 356 240 0 0 1280 1002 </string> - <key>IBEditorPositions</key> - <dict> - <key>29</key> - <string>190 724 343 44 0 0 1280 1002 </string> - </dict> - <key>IBFramework Version</key> - <string>446.1</string> - <key>IBOpenObjects</key> - <array> - <integer>217</integer> - <integer>29</integer> - </array> - <key>IBSystem Version</key> - <string>8N1037</string> -</dict> -</plist> diff --git a/WebKitTools/Drosera/English.lproj/MainMenu.nib/keyedobjects.nib b/WebKitTools/Drosera/English.lproj/MainMenu.nib/keyedobjects.nib Binary files differdeleted file mode 100644 index b78326d..0000000 --- a/WebKitTools/Drosera/English.lproj/MainMenu.nib/keyedobjects.nib +++ /dev/null diff --git a/WebKitTools/Drosera/ForwardingHeaders/wtf/Assertions.h b/WebKitTools/Drosera/ForwardingHeaders/wtf/Assertions.h deleted file mode 100644 index 2144410..0000000 --- a/WebKitTools/Drosera/ForwardingHeaders/wtf/Assertions.h +++ /dev/null @@ -1 +0,0 @@ -#include <JavaScriptCore/Assertions.h> diff --git a/WebKitTools/Drosera/ForwardingHeaders/wtf/HashTraits.h b/WebKitTools/Drosera/ForwardingHeaders/wtf/HashTraits.h deleted file mode 100644 index 412fa98..0000000 --- a/WebKitTools/Drosera/ForwardingHeaders/wtf/HashTraits.h +++ /dev/null @@ -1 +0,0 @@ -#include <JavaScriptCore/HashTraits.h> diff --git a/WebKitTools/Drosera/ForwardingHeaders/wtf/Noncopyable.h b/WebKitTools/Drosera/ForwardingHeaders/wtf/Noncopyable.h deleted file mode 100644 index f8484d2..0000000 --- a/WebKitTools/Drosera/ForwardingHeaders/wtf/Noncopyable.h +++ /dev/null @@ -1 +0,0 @@ -#include <JavaScriptCore/Noncopyable.h> diff --git a/WebKitTools/Drosera/ForwardingHeaders/wtf/OwnPtr.h b/WebKitTools/Drosera/ForwardingHeaders/wtf/OwnPtr.h deleted file mode 100644 index 9211d38..0000000 --- a/WebKitTools/Drosera/ForwardingHeaders/wtf/OwnPtr.h +++ /dev/null @@ -1 +0,0 @@ -#include <JavaScriptCore/OwnPtr.h> diff --git a/WebKitTools/Drosera/ForwardingHeaders/wtf/Platform.h b/WebKitTools/Drosera/ForwardingHeaders/wtf/Platform.h deleted file mode 100644 index 3b22955..0000000 --- a/WebKitTools/Drosera/ForwardingHeaders/wtf/Platform.h +++ /dev/null @@ -1 +0,0 @@ -#include <JavaScriptCore/Platform.h> diff --git a/WebKitTools/Drosera/ForwardingHeaders/wtf/RetainPtr.h b/WebKitTools/Drosera/ForwardingHeaders/wtf/RetainPtr.h deleted file mode 100644 index 65fc27b..0000000 --- a/WebKitTools/Drosera/ForwardingHeaders/wtf/RetainPtr.h +++ /dev/null @@ -1 +0,0 @@ -#include <JavaScriptCore/RetainPtr.h> diff --git a/WebKitTools/Drosera/Images/Drosera.ico b/WebKitTools/Drosera/Images/Drosera.ico Binary files differdeleted file mode 100644 index 18a459d..0000000 --- a/WebKitTools/Drosera/Images/Drosera.ico +++ /dev/null diff --git a/WebKitTools/Drosera/Images/SourceArrow.png b/WebKitTools/Drosera/Images/SourceArrow.png Binary files differdeleted file mode 100644 index f493903..0000000 --- a/WebKitTools/Drosera/Images/SourceArrow.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/SourceArrowBlank.png b/WebKitTools/Drosera/Images/SourceArrowBlank.png Binary files differdeleted file mode 100644 index d178ac0..0000000 --- a/WebKitTools/Drosera/Images/SourceArrowBlank.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/SourceArrowOpen.png b/WebKitTools/Drosera/Images/SourceArrowOpen.png Binary files differdeleted file mode 100644 index 4016402..0000000 --- a/WebKitTools/Drosera/Images/SourceArrowOpen.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/background_stripe.png b/WebKitTools/Drosera/Images/background_stripe.png Binary files differdeleted file mode 100644 index d9ddebc..0000000 --- a/WebKitTools/Drosera/Images/background_stripe.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/breakPoint.tif b/WebKitTools/Drosera/Images/breakPoint.tif Binary files differdeleted file mode 100644 index 95431b4..0000000 --- a/WebKitTools/Drosera/Images/breakPoint.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/breakPointDisabled.tif b/WebKitTools/Drosera/Images/breakPointDisabled.tif Binary files differdeleted file mode 100644 index 2000bd2..0000000 --- a/WebKitTools/Drosera/Images/breakPointDisabled.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/breakpointeditor.png b/WebKitTools/Drosera/Images/breakpointeditor.png Binary files differdeleted file mode 100644 index 8bb992b..0000000 --- a/WebKitTools/Drosera/Images/breakpointeditor.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/close.tif b/WebKitTools/Drosera/Images/close.tif Binary files differdeleted file mode 100644 index a221ac7..0000000 --- a/WebKitTools/Drosera/Images/close.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/close_active.tif b/WebKitTools/Drosera/Images/close_active.tif Binary files differdeleted file mode 100644 index 104799d..0000000 --- a/WebKitTools/Drosera/Images/close_active.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/close_hover.tif b/WebKitTools/Drosera/Images/close_hover.tif Binary files differdeleted file mode 100644 index cd86fa5..0000000 --- a/WebKitTools/Drosera/Images/close_hover.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/console.png b/WebKitTools/Drosera/Images/console.png Binary files differdeleted file mode 100644 index fe7cbe6..0000000 --- a/WebKitTools/Drosera/Images/console.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/continue.tif b/WebKitTools/Drosera/Images/continue.tif Binary files differdeleted file mode 100644 index 58b9893..0000000 --- a/WebKitTools/Drosera/Images/continue.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/fileIcon.jpg b/WebKitTools/Drosera/Images/fileIcon.jpg Binary files differdeleted file mode 100644 index c651a78..0000000 --- a/WebKitTools/Drosera/Images/fileIcon.jpg +++ /dev/null diff --git a/WebKitTools/Drosera/Images/finishFunction.tif b/WebKitTools/Drosera/Images/finishFunction.tif Binary files differdeleted file mode 100644 index af75e60..0000000 --- a/WebKitTools/Drosera/Images/finishFunction.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/glossyFooterFill.tif b/WebKitTools/Drosera/Images/glossyFooterFill.tif Binary files differdeleted file mode 100644 index d5ea4d4..0000000 --- a/WebKitTools/Drosera/Images/glossyFooterFill.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/glossyHeader.png b/WebKitTools/Drosera/Images/glossyHeader.png Binary files differdeleted file mode 100644 index 8c80b6b..0000000 --- a/WebKitTools/Drosera/Images/glossyHeader.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/glossyHeaderPressed.png b/WebKitTools/Drosera/Images/glossyHeaderPressed.png Binary files differdeleted file mode 100644 index 6b0dd60..0000000 --- a/WebKitTools/Drosera/Images/glossyHeaderPressed.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/gradientBackground.png b/WebKitTools/Drosera/Images/gradientBackground.png Binary files differdeleted file mode 100644 index c0ce0a5..0000000 --- a/WebKitTools/Drosera/Images/gradientBackground.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/gutter.png b/WebKitTools/Drosera/Images/gutter.png Binary files differdeleted file mode 100644 index 9b698c1..0000000 --- a/WebKitTools/Drosera/Images/gutter.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/navLeftDisabled.png b/WebKitTools/Drosera/Images/navLeftDisabled.png Binary files differdeleted file mode 100644 index edd7c26..0000000 --- a/WebKitTools/Drosera/Images/navLeftDisabled.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/navLeftNormal.png b/WebKitTools/Drosera/Images/navLeftNormal.png Binary files differdeleted file mode 100644 index 9a14bbf..0000000 --- a/WebKitTools/Drosera/Images/navLeftNormal.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/navLeftPressed.png b/WebKitTools/Drosera/Images/navLeftPressed.png Binary files differdeleted file mode 100644 index 840a4b4..0000000 --- a/WebKitTools/Drosera/Images/navLeftPressed.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/navRightDisabled.png b/WebKitTools/Drosera/Images/navRightDisabled.png Binary files differdeleted file mode 100644 index 6057aae..0000000 --- a/WebKitTools/Drosera/Images/navRightDisabled.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/navRightNormal.png b/WebKitTools/Drosera/Images/navRightNormal.png Binary files differdeleted file mode 100644 index 936cd91..0000000 --- a/WebKitTools/Drosera/Images/navRightNormal.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/navRightPressed.png b/WebKitTools/Drosera/Images/navRightPressed.png Binary files differdeleted file mode 100644 index faf78ce..0000000 --- a/WebKitTools/Drosera/Images/navRightPressed.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/pause.tif b/WebKitTools/Drosera/Images/pause.tif Binary files differdeleted file mode 100644 index 460aeed..0000000 --- a/WebKitTools/Drosera/Images/pause.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/popUpArrows.png b/WebKitTools/Drosera/Images/popUpArrows.png Binary files differdeleted file mode 100644 index f47eaa5..0000000 --- a/WebKitTools/Drosera/Images/popUpArrows.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/programCounter.tif b/WebKitTools/Drosera/Images/programCounter.tif Binary files differdeleted file mode 100644 index e65d549..0000000 --- a/WebKitTools/Drosera/Images/programCounter.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/programCounterBreakPoint.tif b/WebKitTools/Drosera/Images/programCounterBreakPoint.tif Binary files differdeleted file mode 100644 index 093b639..0000000 --- a/WebKitTools/Drosera/Images/programCounterBreakPoint.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/programCounterBreakPointDisabled.tif b/WebKitTools/Drosera/Images/programCounterBreakPointDisabled.tif Binary files differdeleted file mode 100644 index 1c1a699..0000000 --- a/WebKitTools/Drosera/Images/programCounterBreakPointDisabled.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/run.tif b/WebKitTools/Drosera/Images/run.tif Binary files differdeleted file mode 100644 index f9e815f..0000000 --- a/WebKitTools/Drosera/Images/run.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/siteCollapsed.tif b/WebKitTools/Drosera/Images/siteCollapsed.tif Binary files differdeleted file mode 100644 index 07d8a12..0000000 --- a/WebKitTools/Drosera/Images/siteCollapsed.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/siteExpanded.tif b/WebKitTools/Drosera/Images/siteExpanded.tif Binary files differdeleted file mode 100644 index 8044385..0000000 --- a/WebKitTools/Drosera/Images/siteExpanded.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/siteIcon.tif b/WebKitTools/Drosera/Images/siteIcon.tif Binary files differdeleted file mode 100644 index d32654f..0000000 --- a/WebKitTools/Drosera/Images/siteIcon.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/small.ico b/WebKitTools/Drosera/Images/small.ico Binary files differdeleted file mode 100644 index 18a459d..0000000 --- a/WebKitTools/Drosera/Images/small.ico +++ /dev/null diff --git a/WebKitTools/Drosera/Images/splitterBar.tif b/WebKitTools/Drosera/Images/splitterBar.tif Binary files differdeleted file mode 100644 index 0e7425d..0000000 --- a/WebKitTools/Drosera/Images/splitterBar.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/splitterDimple.tif b/WebKitTools/Drosera/Images/splitterDimple.tif Binary files differdeleted file mode 100644 index d112854..0000000 --- a/WebKitTools/Drosera/Images/splitterDimple.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/step.tif b/WebKitTools/Drosera/Images/step.tif Binary files differdeleted file mode 100644 index 457f1cd..0000000 --- a/WebKitTools/Drosera/Images/step.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/stepOut.tif b/WebKitTools/Drosera/Images/stepOut.tif Binary files differdeleted file mode 100644 index ff9e64b..0000000 --- a/WebKitTools/Drosera/Images/stepOut.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/stepOver.tif b/WebKitTools/Drosera/Images/stepOver.tif Binary files differdeleted file mode 100644 index 6c18c71..0000000 --- a/WebKitTools/Drosera/Images/stepOver.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/stop.tif b/WebKitTools/Drosera/Images/stop.tif Binary files differdeleted file mode 100644 index a65c6df..0000000 --- a/WebKitTools/Drosera/Images/stop.tif +++ /dev/null diff --git a/WebKitTools/Drosera/Images/toolbarBackground.png b/WebKitTools/Drosera/Images/toolbarBackground.png Binary files differdeleted file mode 100644 index 018e001..0000000 --- a/WebKitTools/Drosera/Images/toolbarBackground.png +++ /dev/null diff --git a/WebKitTools/Drosera/Images/verticalSplitterBar.tiff b/WebKitTools/Drosera/Images/verticalSplitterBar.tiff Binary files differdeleted file mode 100644 index 4810d01..0000000 --- a/WebKitTools/Drosera/Images/verticalSplitterBar.tiff +++ /dev/null diff --git a/WebKitTools/Drosera/Images/verticalSplitterDimple.tiff b/WebKitTools/Drosera/Images/verticalSplitterDimple.tiff Binary files differdeleted file mode 100644 index fee927b..0000000 --- a/WebKitTools/Drosera/Images/verticalSplitterDimple.tiff +++ /dev/null diff --git a/WebKitTools/Drosera/Makefile b/WebKitTools/Drosera/Makefile deleted file mode 100644 index 4fce090..0000000 --- a/WebKitTools/Drosera/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -OTHER_OPTIONS = -project mac/Drosera.xcodeproj -SCRIPTS_PATH = ../Scripts -include ../../Makefile.shared diff --git a/WebKitTools/Drosera/breakpointEditor.html b/WebKitTools/Drosera/breakpointEditor.html deleted file mode 100644 index 30ef0c9..0000000 --- a/WebKitTools/Drosera/breakpointEditor.html +++ /dev/null @@ -1 +0,0 @@ -<div class="top">Breakpoint:<label>Enable:<input class="enable" type="checkbox" onclick="window.parent.toggleBreakpointOnLine(this.firstParentWithClass('editor').id)"></input></label><label>Hit Count:<span class="hitCounter">0</span></label><label>Action:<select class="editorDropdown" onchange="window.parent.updateBreakpointTypeOnLine(this.firstParentWithClass('editor').id)"><option value="pause">Pause</option><option value="log">Log</option></select></label><input type="button" class="close" onmouseup="window.parent.toggleBreakpointEditorOnLine(this.firstParentWithClass('editor').id)"> </input></div><div class="bottom"><label class="conditionLabel" for="editorCondition">Condition:</label><div class="condition"></div></div>
\ No newline at end of file diff --git a/WebKitTools/Drosera/console.css b/WebKitTools/Drosera/console.css deleted file mode 100644 index 02c37b7..0000000 --- a/WebKitTools/Drosera/console.css +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2006 David Smith (catfish.man@gmail.com) - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -img { padding: 0; margin: 0; } -body { margin: 0; padding: 0; overflow: hidden; } - -#main { - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; -} - -#top { - position: absolute; - top: 0; - bottom: 50px; - left: 0; - right: 0; -} - -#history { - position: absolute; - top: 0; - bottom: 10px; - left: 0; - right: 0; - overflow-y: auto; - overflow-x: hidden; -} - -#divider { - cursor: row-resize; - position: absolute; - bottom: 0; - left: 0; - right: 0; - background: url(splitterDimple.tif) 50% no-repeat, url(splitterBar.tif) repeat-x; - height: 10px; -} - -#input { - position: absolute; - -webkit-box-sizing: border-box; - height: 50px; - max-height: 150px; - left: 0; - right: 0; - bottom: 0; - -webkit-user-modify: read-write-plaintext-only; - -webkit-nbsp-mode: space; - -webkit-line-break: after-white-space; - word-wrap: break-word; - outline: none; - font-family: monospace; - font-size: 11px; - line-height: 14px; - padding: 3px; -} - -#history .row { - min-height: 38px; - padding: 4px; - -webkit-box-sizing: border-box; - font-family: monospace; - font-size: 12px; -} - -#history .row.alt { - background-color: rgb(237, 243, 254); -} - -.expression { - color: blue; -} - -.result { - color: navy; -} diff --git a/WebKitTools/Drosera/console.html b/WebKitTools/Drosera/console.html deleted file mode 100644 index 888878b..0000000 --- a/WebKitTools/Drosera/console.html +++ /dev/null @@ -1,47 +0,0 @@ -<!-- -Copyright (C) 2006 Apple Computer, 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. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE 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 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. ---> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <title>Console</title> - <script type="text/javascript" src="console.js"></script> - <style type="text/css"> - @import "console.css"; - </style> -</head> -<body onload="loaded()" onunload="unloading()"> -<div id="main"> -<div id="top"> -<div id="history"></div> -<div id="divider"></div> -</div> -<div id="input"></div> -</div> -</body> -</html> diff --git a/WebKitTools/Drosera/console.js b/WebKitTools/Drosera/console.js deleted file mode 100644 index 7db3fb4..0000000 --- a/WebKitTools/Drosera/console.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2006 David Smith (catfish.man@gmail.com) - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -var inputElement = null; -var mainWindow = window.opener; -var history = [""]; -var historyIndex = 0; - -function loaded() -{ - inputElement = document.getElementById("input"); - inputElement.addEventListener("keydown", inputKeyDown, false); - inputElement.addEventListener("keyup", inputKeyUp, false); - inputElement.focus(); -} - -function inputKeyDown(event) -{ - if (event.keyCode == 13 && !event.altKey) { - if (mainWindow.isPaused && mainWindow.currentStack) { - history[history.length - 1] = inputElement.innerText; - sendScript(inputElement.innerText); - inputElement.innerText = ""; - history.push(""); - historyIndex = history.length - 1; - inputElement.focus(); - } else - alert("The debugger needs to be paused.\tIn order to evaluate your script input you need to pause the debugger in the context of another script."); - event.preventDefault(); - } else if (event.keyCode == 38 && !event.altKey && historyIndex > 0) { - historyIndex--; - inputElement.innerText = history[historyIndex]; - inputElement.focus() - event.preventDefault(); - } else if (event.keyCode == 40 && !event.altKey && historyIndex < (history.length - 1)) { - historyIndex++; - inputElement.innerText = history[historyIndex]; - inputElement.focus() - event.preventDefault(); - } -} - -function inputKeyUp(event) -{ - if (event.keyCode != 38 && event.keyCode != 40 && event.keyCode != 13) { - history[historyIndex] = inputElement.innerText; - } -} - -function appendMessage(exp, msg) -{ - var historyDisplay = document.getElementById("history"); - var row = document.createElement("div"); - row.className = "row"; - if (historyDisplay.childNodes.length % 2) - row.className += " alt"; - - if (exp.length > 0) { - var expression = document.createElement("div"); - expression.className = "expression"; - expression.innerText = exp; - row.appendChild(expression); - } - - var result = document.createElement("div"); - result.className = "result"; - result.innerText = msg; - - row.appendChild(result); - - historyDisplay.appendChild(row); - historyDisplay.scrollTop = historyDisplay.scrollHeight; -} - -function sendScript(script) -{ - appendMessage(script, mainWindow.DebuggerDocument.evaluateScript(script, mainWindow.currentCallFrame.index)); - if (script.indexOf("=") >= 0) - mainWindow.currentCallFrame.loadVariables(); -} - -function unloading() -{ - mainWindow.consoleWindow = null; -} diff --git a/WebKitTools/Drosera/debugger.css b/WebKitTools/Drosera/debugger.css deleted file mode 100644 index f15d572..0000000 --- a/WebKitTools/Drosera/debugger.css +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2006 Vladimir Olexa (vladimir.olexa@gmail.com) - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -img { padding: 0; margin: 0; } -body { margin: 0; padding: 0; overflow: hidden; } -iframe { border: none; } - -#fileBrowser { position: absolute; top: 0; bottom: 0; left: 0; right: 0; width: 220px;} -#fileList { position: absolute; top: 0; bottom: 0; left: 0; right: 10px; padding: 0; margin: 0; } -#filesDivider { position: absolute; z-index: 10; right: 0px; bottom: 0px; top: 0; width: 10px; cursor: col-resize; background: url(verticalSplitterDimple.tiff) 50% no-repeat, url(verticalSplitterBar.tiff) repeat-y; width: 10px; } -#masterMain { position: absolute; top: 0; bottom: 0; left: 0; right: 0; } -#main { position: absolute; top: 0; bottom: 0; left: 220px; right: 0; } -#info { position: absolute; top: 0; height: 175px; left: 0; right: 0; } -#divider { cursor: row-resize; position: absolute; bottom: 0; left: 0; right: 0; background: url(splitterDimple.tif) 50% no-repeat, url(splitterBar.tif) repeat-x; height: 10px } -#body { position: absolute; top: 175px; left: 0; right: 0; bottom: 0; } -#sourcesContainer { position: absolute; top: 16px; left: 0; right: 0; bottom: 21px; background-color: white; } -#sources { width: 100%; height: 100% } -#header { vertical-align: top; height: 16px; -webkit-box-sizing: border-box; border-bottom: 1px solid #aaa; background: url(glossyHeader.png) repeat-x; position: absolute; top: 0; left: 0; right: 0; } -#header > * { vertical-align: top; } -.footer { height: 21px; -webkit-box-sizing: border-box; border-top: 1px solid #aaa; background: url(glossyFooterFill.tif) repeat-x; position: absolute; bottom: 0; left: 0; right: 0; } -#infoDivider { position: absolute; z-index: 10; right: 0; left: 0; top: 0; bottom: 9px; width: 10px; cursor: col-resize; background: url(verticalSplitterDimple.tiff) 50% no-repeat, url(verticalSplitterBar.tiff) repeat-y; width: 10px; } - -#filesBrowserSites { - position: absolute; - font-family: "Lucida Grande", sans-serif; - font-size: 11px; - padding: 2px; - overflow-x: hidden; - overflow-y: auto; - top: 16px; - left: 0; - right: 0; - bottom: 21px; - background-color: white; -} - -#filesBrowserSites div { - font-weight: normal; - overflow: hidden; - white-space: nowrap; - padding-left: 26px; - background: url(siteExpanded.tif) no-repeat 0px 0px; - cursor: default; - margin-bottom: 2px; -} - -#filesBrowserSites div.expanded { - background: url(siteExpanded.tif) no-repeat 0px 0px; -} -#filesBrowserSites div.collapsed { - background: url(siteCollapsed.tif) no-repeat 0px 0px; -} - -#filesBrowserSites div ul { - margin: 0; - padding: 0; - list-style-type: none; - font-weight: normal; -} - -#filesBrowserSites div ul li { - margin-left: -25px; - height: 15px; - padding-left: 38px; - margin-top: 1px; - margin-bottom: 1px; - background: url(fileIcon.jpg) no-repeat 26px 0%; - cursor: default; - overflow: hidden; -} - -#filesBrowserSites div ul li.active { - background-color: #ccc; -} - -#filesBrowserSites div ul li.passive { - background-color: white; -} - -#files, #functions { - opacity: 0; - position: absolute; - top: -2px; - left: -3px; - right: 0; - z-index: 10; - margin: 0; - padding: 0; - min-width: 100px; -} - -button.popup { - background: url(popUpArrows.png) right no-repeat; - border: none; - height: 15px; - font-size: 10px; - line-height: 10px; - padding: 0 20px 0 5px; - margin: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - position: relative; - min-width: 100px; - max-width: 350px; -} - -#filesPopupButtonContent, #functionButtonContent { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - width: 100%; - height: 100%; - line-height: 12px; - text-align: left; -} - -.placeholder { color: rgba(0, 0, 0, 0.6) } - -button.nav { - position: relative; - width: 32px; - height: 15px; - border: none; - margin: 0; - padding: 0; - border-left: 1px solid transparent; - border-right: 1px solid #aaa; -} - -button.nav.right { - background: url(navRightNormal.png) no-repeat; -} - -button.nav.right:disabled, button.nav.right:disabled:active { - border-left: 1px solid transparent; - background: url(navRightDisabled.png) no-repeat; -} - -button.nav.right:active { - border-left: 1px solid rgba(0, 0, 0, 0.3); - background: url(navRightPressed.png) no-repeat; -} - -button.nav.left { - background: url(navLeftNormal.png) no-repeat; -} - -button.nav.left:disabled, button.nav.left:disabled:active { - border-left: 1px solid transparent; - background: url(navLeftDisabled.png) no-repeat; -} - -button.nav.left:active { - margin-left: 0; - border-left: 1px solid rgba(0, 0, 0, 0.3); - background: url(navLeftPressed.png) no-repeat; -} - -#leftPane { - position: absolute; - top: 0; - bottom: 10px; - left: 0; - width: 253px; - padding: 0; - margin: 0; -} - -#rightPane { - position: absolute; - top: 0; - bottom: 0; - right: 0; - left: 253px; - padding: 0; - margin: 0; -} - -#stackframe { - position: absolute; - top: 0; - bottom: 0; - right: 0; - left: 0; -} - -#stackframeBody { - overflow-y: scroll; - overflow-x: hidden; - position: absolute; - top: 16px; - bottom: 0; - right: 0; - left: 0; -} - -#variables { - position: absolute; - top: 0; - bottom: 10px; - right: 0; - left: 10px; -} - -#variablesBody { - overflow-y: scroll; - overflow-x: hidden; - position: absolute; - top: 16px; - bottom: 0; - right: 0; - left: 0; -} - -.infoBackground { - background: url(background_stripe.png) repeat; - position: absolute; - top: 0; - bottom: 0; - right: 0; - left: 0; - z-index: -1; -} - -table { - font-family: "Lucida Grande", sans-serif; - font-size: 11px; - border-collapse: collapse; - border-spacing: 0; - width: 100%; - padding: 0; - margin: 0; - border: 0; -} - -td { - padding: 3px 7px 3px 9px; - height: 15px; - -webkit-box-sizing: border-box; - -webkit-user-select: none; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -tr.current { - background-color: rgb(56, 117, 215); - color: white; -} - -.stackNumber { - width: 2em; - padding: 3px 0; - text-align: center; -} - -.variable { - width: 170px; -} - -.column th.scrollCorner { - width: 15px; - padding: 0; - border-right: none; -} - -#variableColumnResizer { - position: absolute; - top: 0; - left: 168px; - width: 4px; - height: 16px; - cursor: col-resize; -} - -.column th { - background: url(glossyHeader.png) repeat-x; - border-right: 1px solid #d9d9d9; - height: 15px; - -webkit-box-sizing: border-box; - border-bottom: 1px solid #aaa; - font-weight: normal; - vertical-align: middle; - padding: 0 8px; - text-align: left; - -webkit-user-select: none; -} diff --git a/WebKitTools/Drosera/debugger.html b/WebKitTools/Drosera/debugger.html deleted file mode 100644 index 4b9685d..0000000 --- a/WebKitTools/Drosera/debugger.html +++ /dev/null @@ -1,92 +0,0 @@ -<!-- -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2006, 2007 Vladimir Olexa (vladimir.olexa@gmail.com) - -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. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE 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 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. ---> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <title>Debugger</title> - <script type="text/javascript" src="debugger.js"></script> - <style type="text/css"> - @import "debugger.css"; - </style> -</head> -<body onload="loaded()"> -<div id="masterMain"> -<div id="fileBrowser"> -<div id="fileList"> -<table id="fileListTableHeader"> -<tr class="column"><th onmousedown="headerMouseDown(this);" onmouseup="headerMouseUp(this);" onmouseout="headerMouseOut(this);">Files</th><th class="scrollCorner"></th></tr> -</table> -<div id="filesBrowserSites"> -</div> -<div class="footer"></div> -</div> -<div id="filesDivider"></div> -</div> -<div id="main"> -<div id="info"> -<div id="leftPane"> -<div id="stackframe"> -<table id="stackframeTableHeader"> -<tr class="column"><th class="stackNumber" onmousedown="headerMouseDown(this);" onmouseup="headerMouseUp(this);" onmouseout="headerMouseOut(this);">#</th><th onmousedown="headerMouseDown(this);" onmouseup="headerMouseUp(this);" onmouseout="headerMouseOut(this);">Function</th><th class="scrollCorner"></th></tr> -</table> -<div id="stackframeBody"> -<div class="infoBackground"></div> -<table id="stackframeTable"></table> -</div> -</div> -</div> -<div id="rightPane"> -<div id="infoDivider"></div> -<div id="variables"> -<table id="variablesTableHeader"> -<tr class="column"><th class="variable" id="variable" onmousedown="headerMouseDown(this);" onmouseup="headerMouseUp(this);" onmouseout="headerMouseOut(this);">Variable<div id="variableColumnResizer"></div> -</th><th onmousedown="headerMouseDown(this);" onmouseup="headerMouseUp(this);" onmouseout="headerMouseOut(this);">Value</th><th class="scrollCorner"></th></tr> -</table> -<div id="variablesBody"> -<div class="infoBackground"></div> -<table id="variablesTable"></table> -</div> -</div> -</div> -<div id="divider"></div> -</div> -<div id="body"> -<div id="header"> -<button id="navFileLeftButton" class="nav left" disabled onclick="navFilePrevious(this)"></button><button id="navFileRightButton" class="nav right" disabled onclick="navFileNext(this)"></button> -<button class="popup"><select size="1" id="files" onchange="switchFile()"></select><div id="filesPopupButtonContent"><span class="placeholder"><No files loaded></span></div></button> -<button class="popup" id="functionNamesPopup" style="display: none"><select size="1" id="functions" onchange="switchFunction(this.selectedIndex)"></select><div id="functionPopupButtonContent"><span class="placeholder"><No selected symbol></span></div></button> -</div> -<div id="sourcesContainer"><iframe name="sourcesFrame" id="sources" src="viewer.html"></iframe></div> -<div class="footer"></div> -</div> -</div> -</div> -</body> -</html> diff --git a/WebKitTools/Drosera/debugger.js b/WebKitTools/Drosera/debugger.js deleted file mode 100644 index 076fedf..0000000 --- a/WebKitTools/Drosera/debugger.js +++ /dev/null @@ -1,1433 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006 David Smith (catfish.man@gmail.com) - * Copyright (C) 2007 Vladimir Olexa (vladimir.olexa@gmail.com) - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -var files = new Array(); -var filesLookup = new Object(); -var scripts = new Array(); -var currentFile = -1; -var currentRow = null; -var currentStack = null; -var currentCallFrame = null; -var lastStatement = null; -var frameLineNumberStack = new Array(); -var previousFiles = new Array(); -var nextFiles = new Array(); -var isResizingColumn = false; -var draggingBreakpoint = null; -var steppingOut = false; -var steppingOver = false; -var steppingStack = 0; -var pauseOnNextStatement = false; -var pausedWhileLeavingFrame = false; -var consoleWindow = null; -var breakpointEditorHTML = DebuggerDocument.breakpointEditorHTML(); -var pendingAction = null; -var isPaused = false; - -ScriptCallFrame = function (functionName, index, row) -{ - this.functionName = functionName; - this.index = index; - this.row = row; - this.localVariableNames = null; -} - -ScriptCallFrame.prototype.valueForScopeVariable = function (name) -{ - return DebuggerDocument.valueForScopeVariableNamed(name, this.index); -} - -ScriptCallFrame.prototype.loadVariables = function () -{ - if (!this.localVariableNames) - this.localVariableNames = DebuggerDocument.localScopeVariableNamesForCallFrame(this.index); - - var variablesTable = document.getElementById("variablesTable"); - variablesTable.innerHTML = ""; - - if (!this.localVariableNames) - return; - - for(var i = 0; i < this.localVariableNames.length; i++) { - var tr = document.createElement("tr"); - var td = document.createElement("td"); - td.innerText = this.localVariableNames[i]; - td.className = "variable"; - tr.appendChild(td); - - td = document.createElement("td"); - td.innerText = this.valueForScopeVariable(this.localVariableNames[i]); - tr.appendChild(td); - tr.addEventListener("click", selectVariable, true); - - variablesTable.appendChild(tr); - } -} - -function sleep(numberMillis) -{ - var now = new Date(); - var exitTime = now.getTime() + numberMillis; - while (true) { - now = new Date(); - if (now.getTime() > exitTime) - return; - } -} - -function headerMouseDown(element) -{ - if (!isResizingColumn) - element.style.background = "url(glossyHeaderPressed.png) repeat-x"; -} - -function headerMouseUp(element) -{ - element.style.background = "url(glossyHeader.png) repeat-x"; -} - -function headerMouseOut(element) -{ - element.style.background = "url(glossyHeader.png) repeat-x"; -} - -function filesDividerDragStart(event) -{ - dividerDragStart(document.getElementById("filesDivider"), filesDividerDrag, filesDividerDragEnd, event, "col-resize"); -} - -function filesDividerDragEnd(event) -{ - dividerDragEnd(document.getElementById("filesDivider"), filesDividerDrag, filesDividerDragEnd, event); -} - -function filesDividerDrag(event) -{ - var element = document.getElementById("filesDivider"); - if (document.getElementById("filesDivider").dragging == true) { - var masterMain = document.getElementById("masterMain"); - var main = document.getElementById("main"); - var fileBrowser = document.getElementById("fileBrowser"); - var x = event.clientX + window.scrollX; - var delta = element.dragLastX - x; - var newWidth = constrainedWidthFromElement(fileBrowser.clientWidth - delta, masterMain, 0.1, 0.9); - if ((fileBrowser.clientWidth - delta) == newWidth) // the width wasn't constrained - element.dragLastX = x; - fileBrowser.style.width = newWidth + "px"; - main.style.left = newWidth + "px"; - event.preventDefault(); - } -} - -function dividerDragStart(element, dividerDrag, dividerDragEnd, event, cursor) -{ - element.dragging = true; - element.dragLastY = event.clientY + window.scrollY; - element.dragLastX = event.clientX + window.scrollX; - document.addEventListener("mousemove", dividerDrag, true); - document.addEventListener("mouseup", dividerDragEnd, true); - document.body.style.cursor = cursor; - event.preventDefault(); -} - -function dividerDragEnd(element, dividerDrag, dividerDragEnd, event) -{ - element.dragging = false; - document.removeEventListener("mousemove", dividerDrag, true); - document.removeEventListener("mouseup", dividerDragEnd, true); - document.body.style.removeProperty("cursor"); -} - -function dividerDrag(event) -{ - var element = document.getElementById("divider"); - if (document.getElementById("divider").dragging == true) { - var main = document.getElementById("main"); - var top = document.getElementById("info"); - var bottom = document.getElementById("body"); - var y = event.clientY + window.scrollY; - var delta = element.dragLastY - y; - var newHeight = constrainedHeightFromElement(top.clientHeight - delta, main); - if ((top.clientHeight - delta) == newHeight) // the height wasn't constrained - element.dragLastY = y; - top.style.height = newHeight + "px"; - bottom.style.top = newHeight + "px"; - event.preventDefault(); - } -} - -function sourceDividerDragStart(event) -{ - dividerDragStart(document.getElementById("divider"), dividerDrag, sourceDividerDragEnd, event, "row-resize"); -} - -function sourceDividerDragEnd(event) -{ - dividerDragEnd(document.getElementById("divider"), dividerDrag, sourceDividerDragEnd, event); -} - -function infoDividerDragStart(event) -{ - dividerDragStart(document.getElementById("infoDivider"), infoDividerDrag, infoDividerDragEnd, event, "col-resize"); -} - -function infoDividerDragEnd(event) -{ - dividerDragEnd(document.getElementById("infoDivider"), infoDividerDrag, infoDividerDragEnd, event); -} - -function infoDividerDrag(event) -{ - var element = document.getElementById("infoDivider"); - if (document.getElementById("infoDivider").dragging == true) { - var main = document.getElementById("main"); - var leftPane = document.getElementById("leftPane"); - var rightPane = document.getElementById("rightPane"); - var x = event.clientX + window.scrollX; - var delta = element.dragLastX - x; - var newWidth = constrainedWidthFromElement(leftPane.clientWidth - delta, main); - if ((leftPane.clientWidth - delta) == newWidth) // the width wasn't constrained - element.dragLastX = x; - leftPane.style.width = newWidth + "px"; - rightPane.style.left = newWidth + "px"; - event.preventDefault(); - } -} - -function columnResizerDragStart(event) -{ - isResizingColumn = true; - dividerDragStart(document.getElementById("variableColumnResizer"), columnResizerDrag, columnResizerDragEnd, event, "col-resize"); -} - -function columnResizerDragEnd(event) -{ - isResizingColumn = false; - dividerDragEnd(document.getElementById("variableColumnResizer"), columnResizerDrag, columnResizerDragEnd, event); -} - -function columnResizerDrag(event) -{ - var element = document.getElementById("variableColumnResizer"); - if (element.dragging == true) { - var main = document.getElementById("rightPane"); - var variableColumn = document.getElementById("variable"); - var rules = document.defaultView.getMatchedCSSRules(variableColumn, ""); - for (var i = 0; i < rules.length; i++) { - if (rules[i].selectorText == ".variable") { - var columnRule = rules[i]; - break; - } - } - - var x = event.clientX + window.scrollX; - var delta = element.dragLastX - x; - var newWidth = constrainedWidthFromElement(variableColumn.clientWidth - delta, main); - if ((variableColumn.clientWidth - delta) == newWidth) // the width wasn't constrained - element.dragLastX = x; - columnRule.style.width = newWidth + "px"; - element.style.left = newWidth + "px"; - event.preventDefault(); - } -} - -function constrainedWidthFromElement(width, element, constrainLeft, constrainRight) -{ - if (constrainLeft === undefined) constrainLeft = 0.25; - if (constrainRight === undefined) constrainRight = 0.75; - - if (width < element.clientWidth * constrainLeft) - width = element.clientWidth * constrainLeft; - else if (width > element.clientWidth * constrainRight) - width = element.clientWidth * constrainRight; - return width; -} - -function constrainedHeightFromElement(height, element) -{ - if (height < element.clientHeight * 0.25) - height = element.clientHeight * 0.25; - else if (height > element.clientHeight * 0.75) - height = element.clientHeight * 0.75; - return height; -} - -function loaded() -{ - document.getElementById("divider").addEventListener("mousedown", sourceDividerDragStart, false); - document.getElementById("infoDivider").addEventListener("mousedown", infoDividerDragStart, false); - document.getElementById("filesDivider").addEventListener("mousedown", filesDividerDragStart, false); - document.getElementById("variableColumnResizer").addEventListener("mousedown", columnResizerDragStart, false); -} - -function pause() -{ - DebuggerDocument.pause(); - isPaused = true; -} - -function resume() -{ - if (currentRow) { - currentRow.removeStyleClass("current"); - currentRow = null; - } - - var stackframeTable = document.getElementById("stackframeTable"); - stackframeTable.innerHTML = ""; // clear the content - var variablesTable = document.getElementById("variablesTable"); - variablesTable.innerHTML = ""; // clear the content - currentStack = null; - currentCallFrame = null; - - pauseOnNextStatement = false; - pausedWhileLeavingFrame = false; - steppingOut = false; - steppingOver = false; - steppingStack = 0; - - DebuggerDocument.resume(); - isPaused = false; -} - -function stepInto() -{ - pauseOnNextStatement = false; - steppingOut = false; - steppingOver = false; - steppingStack = 0; - DebuggerDocument.stepInto(); -} - -function stepOver() -{ - pauseOnNextStatement = false; - steppingOver = true; - steppingStack = 0; - DebuggerDocument.resume(); -} - -function stepOut() -{ - pauseOnNextStatement = pausedWhileLeavingFrame; - steppingOver = false; - steppingStack = 0; - steppingOut = true; - DebuggerDocument.resume(); -} - -Element.prototype.removeStyleClass = function(className) -{ - if (this.hasStyleClass(className)) - this.className = this.className.replace(className, ""); -} - -Element.prototype.addStyleClass = function(className) -{ - if (!this.hasStyleClass(className)) - this.className += (this.className.length ? " " + className : className); -} - -Element.prototype.hasStyleClass = function(className) -{ - return this.className.indexOf(className) != -1; -} - -Element.prototype.firstParentWithClass = function(className) -{ - var node = this.parentNode; - while(!node.hasStyleClass(className)) { - if (node == document) - return null; - node = node.parentNode; - } - return node; -} - -Element.prototype.query = function(query) -{ - return document.evaluate(query, this, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; -} - -Element.prototype.removeChildren = function() -{ - while (this.firstChild) - this.removeChild(this.firstChild); -} - -function breakpointAction(event) -{ - var file = files[currentFile]; - var lineNum = event.target.title; - - if (!file.breakpoints[lineNum]) - file.breakpoints[lineNum] = new BreakPoint(event.target.parentNode, file, lineNum); - else - toggleBreakpointOnLine(lineNum); -} - -BreakPoint = function(row, file, line) -{ - this.row = row; - this.file = file; - this.line = line; - row.addStyleClass("breakpoint"); - row.removeStyleClass("disabled"); - this.value = "break"; - this.enabled = true; - this.editor = null; - this.type = 0; - this.hitcount = 0; -} - -function toggleBreakpointEditorOnLine(lineNum) -{ - if (pendingAction) { - clearTimeout(pendingAction); - pendingAction = null; - } - var file = files[currentFile]; - bp = file.breakpoints[lineNum]; - if (bp) { - var editor = bp.editor; - if (!editor) { - var sourcesDocument = document.getElementById("sources").contentDocument; - editor = sourcesDocument.createElement("div"); - editor.className = "editor"; - editor.id = lineNum; - editor.innerHTML = breakpointEditorHTML; - - bp.row.childNodes[1].appendChild(editor); - - bp.editor = editor; - file.breakpoints[lineNum] = bp; - - editor.query('.//input[@class="enable"]').checked = bp.enabled; - - editor.query('.//select[@class="editorDropdown"]').selectedIndex = bp.type; - updateBreakpointTypeOnLine(lineNum); - - editor.query('.//span[@class="hitCounter"]').innerText = bp.hitcount; - - setConditionFieldText(bp); - } else { - saveBreakpointOnLine(lineNum); - bp.row.childNodes[1].removeChild(editor); - bp.editor = null; - } - } -} - -function updateBreakpointTypeOnLine(line) -{ - var breakpoint = files[currentFile].breakpoints[line]; - var editor = breakpoint.editor; - var label = editor.query('.//label[@class="conditionLabel"]'); - var dropdown = editor.query('.//select[@class="editorDropdown"]'); - breakpoint.type = dropdown.selectedIndex; - switch(breakpoint.type) { - case 0: - label.innerText = "Condition:"; - break; - case 1: - label.innerText = "Expression:"; - break; - } -} - -function setConditionFieldText(breakpoint) -{ - var conditionField = breakpoint.editor.query('.//div[@class="condition"]'); - - var functionBody = breakpoint.value; - if (!functionBody || functionBody == "break") - functionBody = ""; - else { - var startIndex = functionBody.indexOf("return((") + 8; - var endIndex = null; - if (startIndex != 7) //-1 + 8, yes, that's lame - endIndex = functionBody.lastIndexOf("))"); - else { - startIndex = functionBody.indexOf("{") + 1; - endIndex = functionBody.lastIndexOf("}"); - } - functionBody = functionBody.substring(startIndex, endIndex); - } - conditionField.innerText = functionBody; - conditionField.addEventListener("keyup", new Function("saveBreakpointOnLine(" + breakpoint.line + ");"), false); - conditionField.focus(); -} - -function saveBreakpointOnLine(lineNum) -{ - var file = files[currentFile]; - var breakpoint = file.breakpoints[lineNum]; - row = file.element.firstChild.childNodes.item(lineNum - 1); - var editor = breakpoint.editor; - var body = editor.query('.//div[@class="condition"]').innerText; - var actionIndex = editor.query('.//select[@class="editorDropdown"]').selectedIndex; - if (body.length == 0) - breakpoint.value = "break"; - else if (body.indexOf("return") != -1) - breakpoint.value = "__drosera_breakpoint_conditional_func = function() {" + body + "}; __drosera_breakpoint_conditional_func();"; - else - breakpoint.value = "__drosera_breakpoint_conditional_func = function() { return((" + body + ")); }; __drosera_breakpoint_conditional_func();"; -} - -function toggleBreakpointOnLine(lineNum) -{ - var breakpoint = files[currentFile].breakpoints[lineNum]; - pendingAction = null; - if (breakpoint.enabled) - breakpoint.row.addStyleClass("disabled"); - else - breakpoint.row.removeStyleClass("disabled"); - - var hack = breakpoint.row.offsetTop; // force a relayout if needed. - - breakpoint.enabled = !breakpoint.enabled; - var editor = breakpoint.editor; - if (editor) { - editor.query('.//input[@class="enable"]').checked = breakpoint.enabled; - setConditionFieldText(breakpoint, lineNum); - } -} - -function moveBreakPoint(event) -{ - if (event.target.parentNode.hasStyleClass("breakpoint")) { - draggingBreakpoint = event.target; - draggingBreakpoint.started = false; - draggingBreakpoint.dragLastY = event.clientY + window.scrollY; - draggingBreakpoint.dragLastX = event.clientX + window.scrollX; - var sourcesDocument = document.getElementById("sources").contentDocument; - sourcesDocument.addEventListener("mousemove", breakpointDrag, true); - sourcesDocument.addEventListener("mouseup", breakpointDragEnd, true); - sourcesDocument.body.style.cursor = "default"; - } -} - -function breakpointDrag(event) -{ - var sourcesDocument = document.getElementById("sources").contentDocument; - if (!draggingBreakpoint) { - sourcesDocument.removeEventListener("mousemove", breakpointDrag, true); - sourcesDocument.removeEventListener("mouseup", breakpointDragEnd, true); - sourcesDocument.body.style.removeProperty("cursor"); - return; - } - - var x = event.clientX + window.scrollX; - var y = event.clientY + window.scrollY; - var deltaX = draggingBreakpoint.dragLastX - x; - var deltaY = draggingBreakpoint.dragLastY - y; - if (draggingBreakpoint.started || deltaX > 4 || deltaY > 4 || deltaX < -4 || deltaY < -4) { - - if (!draggingBreakpoint.started) { - var lineNum = draggingBreakpoint.title; - var file = files[currentFile]; - var breakpoint = file.breakpoints[lineNum]; - draggingBreakpoint.breakpoint = breakpoint; - breakpoint.row.removeStyleClass("breakpoint"); - breakpoint.row.removeStyleClass("disabled"); - - var editor = breakpoint.editor; - if (editor) - toggleBreakpointEditorOnLine(lineNum); - - draggingBreakpoint.started = true; - - file.breakpoints[lineNum] = null; - - var dragImage = sourcesDocument.createElement("img"); - if (draggingBreakpoint.breakpoint.enabled) - dragImage.src = "breakPoint.tif"; - else - dragImage.src = "breakPointDisabled.tif"; - - dragImage.id = "breakpointDrag"; - dragImage.style.top = y - 8 + "px"; - dragImage.style.left = x - 12 + "px"; - sourcesDocument.body.appendChild(dragImage); - } else { - var dragImage = sourcesDocument.getElementById("breakpointDrag"); - if (!dragImage) { - sourcesDocument.removeEventListener("mousemove", breakpointDrag, true); - sourcesDocument.removeEventListener("mouseup", breakpointDragEnd, true); - sourcesDocument.body.style.removeProperty("cursor"); - return; - } - - dragImage.style.top = y - 8 + "px"; - dragImage.style.left = x - 12 + "px"; - if (x > 40) - dragImage.style.visibility = "hidden"; - else - dragImage.style.removeProperty("visibility"); - } - - draggingBreakpoint.dragLastX = x; - draggingBreakpoint.dragLastY = y; - } -} - -function breakpointDragEnd(event) -{ - var sourcesDocument = document.getElementById("sources").contentDocument; - sourcesDocument.removeEventListener("mousemove", breakpointDrag, true); - sourcesDocument.removeEventListener("mouseup", breakpointDragEnd, true); - sourcesDocument.body.style.removeProperty("cursor"); - - var dragImage = sourcesDocument.getElementById("breakpointDrag"); - if (!dragImage) - return; - - dragImage.parentNode.removeChild(dragImage); - - var x = event.clientX + window.scrollX; - if (x > 40 || !draggingBreakpoint) - return; - - var y = event.clientY + window.scrollY; - var rowHeight = draggingBreakpoint.parentNode.offsetHeight; - var row = Math.ceil(y / rowHeight); - if (row <= 0) - row = 1; - - var file = files[currentFile]; - var table = file.element.firstChild; - if (row > table.childNodes.length) - return; - - var tr = table.childNodes.item(row - 1); - if (!tr) - return; - - var breakpoint = draggingBreakpoint.breakpoint; - breakpoint.row = tr; - - // leave the editor there if it exists... we'll want to update it to the new values - breakpoint.editor = file.breakpoints[row].editor; - - file.breakpoints[row] = breakpoint; - - if (breakpoint.editor) { - breakpoint.editor.id = row; - updateBreakpointTypeOnLine(row); - setConditionFieldText(breakpoint); - } - - if (!breakpoint.enabled) - tr.addStyleClass("disabled"); - - tr.addStyleClass("breakpoint"); - - draggingBreakpoint = null; -} - -function totalOffsetTop(element, stop) -{ - var currentTop = 0; - while (element.offsetParent) { - currentTop += element.offsetTop - element = element.offsetParent; - if (element == stop) - break; - } - return currentTop; -} - -function switchFile(fileIndex) -{ - var filesSelect = document.getElementById("files"); - - if (fileIndex === undefined) - fileIndex = filesSelect.selectedIndex; - - fileClicked(filesSelect.options[fileIndex].value, false); - loadFile(filesSelect.options[fileIndex].value, true); -} - -function syntaxHighlight(code, file) -{ - var keywords = { 'abstract': 1, 'boolean': 1, 'break': 1, 'byte': 1, 'case': 1, 'catch': 1, 'char': 1, 'class': 1, 'const': 1, 'continue': 1, 'debugger': 1, 'default': 1, 'delete': 1, 'do': 1, 'double': 1, 'else': 1, 'enum': 1, 'export': 1, 'extends': 1, 'false': 1, 'final': 1, 'finally': 1, 'float': 1, 'for': 1, 'function': 1, 'goto': 1, 'if': 1, 'implements': 1, 'import': 1, 'in': 1, 'instanceof': 1, 'int': 1, 'interface': 1, 'long': 1, 'native': 1, 'new': 1, 'null': 1, 'package': 1, 'private': 1, 'protected': 1, 'public': 1, 'return': 1, 'short': 1, 'static': 1, 'super': 1, 'switch': 1, 'synchronized': 1, 'this': 1, 'throw': 1, 'throws': 1, 'transient': 1, 'true': 1, 'try': 1, 'typeof': 1, 'var': 1, 'void': 1, 'volatile': 1, 'while': 1, 'with': 1 }; - - function echoChar(c) { - if (c == '<') - result += '<'; - else if (c == '>') - result += '>'; - else if (c == '&') - result += '&'; - else if (c == '\t') - result += ' '; - else - result += c; - } - - function isDigit(number) { - var string = "1234567890"; - if (string.indexOf(number) != -1) - return true; - return false; - } - - function isHex(hex) { - var string = "1234567890abcdefABCDEF"; - if (string.indexOf(hex) != -1) - return true; - return false; - } - - function isLetter(letter) { - var string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - if (string.indexOf(letter) != -1) - return true; - return false; - } - - var result = ""; - var cPrev = ""; - var c = ""; - var cNext = ""; - for (var i = 0; i < code.length; i++) { - cPrev = c; - c = code.charAt(i); - cNext = code.charAt(i + 1); - - if (c == "/" && cNext == "*") { - result += "<span class=\"comment\">"; - echoChar(c); - echoChar(cNext); - for (i += 2; i < code.length; i++) { - c = code.charAt(i); - if (c == "\n") - result += "</span>"; - echoChar(c); - if (c == "\n") - result += "<span class=\"comment\">"; - if (cPrev == "*" && c == "/") - break; - cPrev = c; - } - result += "</span>"; - continue; - } else if (c == "/" && cNext == "/") { - result += "<span class=\"comment\">"; - echoChar(c); - echoChar(cNext); - for (i += 2; i < code.length; i++) { - c = code.charAt(i); - if (c == "\n") - break; - echoChar(c); - } - result += "</span>"; - echoChar(c); - continue; - } else if (c == "\"" || c == "'") { - var instringtype = c; - var stringstart = i; - result += "<span class=\"string\">"; - echoChar(c); - for (i += 1; i < code.length; i++) { - c = code.charAt(i); - if (stringstart < (i - 1) && cPrev == instringtype && code.charAt(i - 2) != "\\") - break; - echoChar(c); - cPrev = c; - } - result += "</span>"; - echoChar(c); - continue; - } else if (c == "0" && cNext == "x" && (i == 0 || (!isLetter(cPrev) && !isDigit(cPrev)))) { - result += "<span class=\"number\">"; - echoChar(c); - echoChar(cNext); - for (i += 2; i < code.length; i++) { - c = code.charAt(i); - if (!isHex(c)) - break; - echoChar(c); - } - result += "</span>"; - echoChar(c); - continue; - } else if ((isDigit(c) || ((c == "-" || c == ".") && isDigit(cNext))) && (i == 0 || (!isLetter(cPrev) && !isDigit(cPrev)))) { - result += "<span class=\"number\">"; - echoChar(c); - for (i += 1; i < code.length; i++) { - c = code.charAt(i); - if (!isDigit(c) && c != ".") - break; - echoChar(c); - } - result += "</span>"; - echoChar(c); - continue; - } else if (isLetter(c) && (i == 0 || !isLetter(cPrev))) { - var keyword = c; - var cj = ""; - for (var j = i + 1; j < i + 12 && j < code.length; j++) { - cj = code.charAt(j); - if (!isLetter(cj)) - break; - keyword += cj; - } - - if (keywords[keyword]) { - var functionName = ""; - var functionIsAnonymous = false; - if (keyword == "function") { - var functionKeywordOffset = 8; - for (var j = i + functionKeywordOffset; j < code.length; j++) { - cj = code.charAt(j); - if (cj == " ") - continue; - if (cj == "(") - break; - functionName += cj; - } - - if (!functionName.length) { - functionIsAnonymous = true; - var functionAssignmentFound = false; - var functionNameStart = -1; - var functionNameEnd = -1; - - for (var j = i - 1; j >= 0; j--) { - cj = code.charAt(j); - if (cj == ":" || cj == "=") { - functionAssignmentFound = true; - continue; - } - - var curCharIsSpace = (cj == " " || cj == "\t" || cj == "\n"); - if (functionAssignmentFound && functionNameEnd == -1 && !curCharIsSpace) { - functionNameEnd = j + 1; - } else if (!functionAssignmentFound && !curCharIsSpace) { - break; - } else if (functionNameEnd != -1 && curCharIsSpace) { - functionNameStart = j; - break; - } - } - - if (functionNameStart != -1 && functionNameEnd != -1) - functionName = code.substring(functionNameStart, functionNameEnd); - } - - if (!functionName.length) - functionName = "function"; - - file.functionNames.push(functionName); - } - - var fileIndex = filesLookup[file.url]; - - if (keyword == "function" && functionIsAnonymous) - result += "<span class=\"keyword\"><a name=\"function-" + fileIndex + "-" + file.functionNames.length + "\" id=\"" + fileIndex + "-" + file.functionNames.length + "\">" + keyword + "</a></span>"; - else - result += "<span class=\"keyword\">" + keyword + "</span>"; - - if (functionName.length && !functionIsAnonymous) { - result += " <a name=\"function-" + fileIndex + "-" + file.functionNames.length + "\" id=\"" + fileIndex + "-" + file.functionNames.length + "\">" + functionName + "</a>"; - i += keyword.length + functionName.length; - } else - i += keyword.length - 1; - - continue; - } - } - - echoChar(c); - } - - return result; -} - -function navFilePrevious(element) -{ - if (element.disabled) - return; - var lastFile = previousFiles.pop(); - if (currentFile != -1) - nextFiles.unshift(currentFile); - loadFile(lastFile, false); -} - -function navFileNext(element) -{ - if (element.disabled) - return; - var lastFile = nextFiles.shift(); - if (currentFile != -1) - previousFiles.push(currentFile); - loadFile(lastFile, false); -} - -function updateFunctionStack() -{ - var stackframeTable = document.getElementById("stackframeTable"); - stackframeTable.innerHTML = ""; // clear the content - - currentStack = new Array(); - var stack = DebuggerDocument.currentFunctionStack(); - for(var i = 0; i < stack.length; i++) { - var tr = document.createElement("tr"); - var td = document.createElement("td"); - td.className = "stackNumber"; - td.innerText = i; - tr.appendChild(td); - - td = document.createElement("td"); - td.innerText = stack[i]; - tr.appendChild(td); - tr.addEventListener("click", selectStackFrame, true); - - stackframeTable.appendChild(tr); - - var frame = new ScriptCallFrame(stack[i], i, tr); - tr.callFrame = frame; - currentStack.push(frame); - - if (i == 0) { - tr.addStyleClass("current"); - frame.loadVariables(); - currentCallFrame = frame; - } - } -} - -function selectStackFrame(event) -{ - var stackframeTable = document.getElementById("stackframeTable"); - var rows = stackframeTable.childNodes; - for (var i = 0; i < rows.length; i++) - rows[i].removeStyleClass("current"); - this.addStyleClass("current"); - this.callFrame.loadVariables(); - currentCallFrame = this.callFrame; - - if (frameLineNumberInfo = frameLineNumberStack[this.callFrame.index - 1]) - jumpToLine(frameLineNumberInfo[0], frameLineNumberInfo[1]); - else if (this.callFrame.index == 0) - jumpToLine(lastStatement[0], lastStatement[1]); -} - -function selectVariable(event) -{ - var variablesTable = document.getElementById("variablesTable"); - var rows = variablesTable.childNodes; - for (var i = 0; i < rows.length; i++) - rows[i].removeStyleClass("current"); - this.addStyleClass("current"); -} - -function switchFunction(index, shouldResetPopup) -{ - if (shouldResetPopup === undefined) shouldResetPopup = false; - var sourcesFrame = window.frames['sourcesFrame']; - - if (shouldResetPopup || index == 0) { - document.getElementById("functionPopupButtonContent").innerHTML = '<span class="placeholder"><No selected symbol></span>'; - return; - } - - var functionSelect = document.getElementById("functions"); - var selectedFunction = functionSelect.childNodes[index]; - var selection = sourcesFrame.getSelection(); - var currentFunction = selectedFunction.value; - var currentFunctionElement = sourcesFrame.document.getElementById(currentFunction); - - functionSelect.blur(); - sourcesFrame.focus(); - selection.setBaseAndExtent(currentFunctionElement, 0, currentFunctionElement, 1); - sourcesFrame.location.hash = "#function-" + selectedFunction.value; - document.getElementById("functionPopupButtonContent").innerText = selectedFunction.innerText; -} - -function loadFile(fileIndex, manageNavLists) -{ - var file = files[fileIndex]; - if (!file) - return; - - if (currentFile != -1 && files[currentFile] && files[currentFile].element) - files[currentFile].element.style.display = "none"; - - if (!file.loaded) { - var sourcesDocument = document.getElementById("sources").contentDocument; - var sourcesDiv = sourcesDocument.body; - var sourceDiv = sourcesDocument.createElement("div"); - sourceDiv.id = "file" + fileIndex; - sourcesDiv.appendChild(sourceDiv); - file.element = sourceDiv; - - var table = sourcesDocument.createElement("table"); - sourceDiv.appendChild(table); - - var normalizedSource = file.source.replace(/\r\n|\r/g, "\n"); // normalize line endings - var lines = syntaxHighlight(normalizedSource, file).split("\n"); - for( var i = 0; i < lines.length; i++ ) { - var tr = sourcesDocument.createElement("tr"); - var td = sourcesDocument.createElement("td"); - td.className = "gutter"; - td.title = (i + 1); - td.addEventListener("click", breakpointAction, true); - td.addEventListener("dblclick", function(event) { toggleBreakpointEditorOnLine(event.target.title); }, true); - td.addEventListener("mousedown", moveBreakPoint, true); - tr.appendChild(td); - - td = sourcesDocument.createElement("td"); - td.className = "source"; - td.innerHTML = (lines[i].length ? lines[i] : " "); - tr.appendChild(td); - table.appendChild(tr); - } - - file.loaded = true; - } - - file.element.style.removeProperty("display"); - - document.getElementById("filesPopupButtonContent").innerText = (file.url ? file.url : "(unknown script)"); - - var filesSelect = document.getElementById("files"); - for (var i = 0; i < filesSelect.childNodes.length; i++) { - if (filesSelect.childNodes[i].value == fileIndex) { - filesSelect.selectedIndex = i; - break; - } - } - - // Populate the function names pop-up - if (file.functionNames.length > 0) { - var functionSelect = document.getElementById("functions"); - var functionOption = document.createElement("option"); - - document.getElementById("functionNamesPopup").style.display = "inline"; - switchFunction(0, true); - - functionSelect.removeChildren(); - functionOption.value = null; - functionOption.text = "<No selected symbol>"; - functionSelect.appendChild(functionOption); - - for (var i = 0; i < file.functionNames.length; i++) { - functionOption = document.createElement("option"); - functionOption.value = fileIndex + "-" + (i+1); - functionOption.text = file.functionNames[i] + "()"; - functionSelect.appendChild(functionOption); - } - } else - document.getElementById("functionNamesPopup").style.display = "none"; - - if (manageNavLists) { - nextFiles = new Array(); - if (currentFile != -1) - previousFiles.push(currentFile); - } - - document.getElementById("navFileLeftButton").disabled = (previousFiles.length == 0); - document.getElementById("navFileRightButton").disabled = (nextFiles.length == 0); - - //Remember and recall scroll position for current file and file we just loaded - var frameBody = document.getElementById("sources").contentDocument.body; - if (currentFile != -1) - files[currentFile].scrollPosition = frameBody.scrollTop; - frameBody.scrollTop = file.scrollPosition; - frameBody.scrollLeft = 0; - - currentFile = fileIndex; -} - -function updateFileSource(source, url, force) -{ - var fileIndex = filesLookup[url]; - if (!fileIndex || !source.length) - return; - - var file = files[fileIndex]; - if (force || file.source.length != source.length || file.source != source) { - file.source = source; - file.loaded = false; - - if (file.element) { - file.element.parentNode.removeChild(file.element); - file.element = null; - } - - if (currentFile == fileIndex || force) - loadFile(fileIndex, false); - } -} - -/** -* ParsedURL - this object chops up full URL into two parts: - * 1) The domain: everything from http:// to the end of the domain name - * 2) The relative path: everything after the domain - * - * @param string url URL to be processed - */ -function ParsedURL(url) -{ - // Since we're getting the URL from the browser, we're safe to assume the URL is already well formatted - // and so there is no need for more sophisticated regular expression here - var url_parts = ((url.substring(0,4)).toLowerCase() == "file") ? url.match(/(file:[\/]{2,3}(\w|\.|-|_|\/|\%|\:)+)\/(.*)/) : url.match(/(http[s]?:\/\/(www)?\.?(\w|\.|-)+\w(:\d{1,5})?)\/?(.*)/); - // the domain here is considered the whole http://www.example.org:8000 or file:///Users/user/folder/file.htm string for display purposes - this.domain = url_parts[1]; - // the relative path is everything following the domain - this.relativePath = (url_parts[5] === undefined) ? "/" + url_parts[3] : "/" + url_parts[5]; -} - -/** -* SiteBrowser - modifies the file tree via DOM as new files are being open - * - */ -function SiteBrowser() -{ - var fileBrowser = document.getElementById("filesBrowserSites"); - - this.addURL = function add(url, fileIndex) - { - var parsedURL = new ParsedURL(url); - var divs = fileBrowser.getElementsByTagName("div"); - - if (divs.length == 0) { - addNewDomain(parsedURL, fileIndex); - } else { - var isNew = true; - for (var i = 0; i < divs.length; i++) { - if (divs[i].id == parsedURL.domain) { - var uls = divs[i].getElementsByTagName("ul"); - var ul = (uls.length > 0) ? uls[0] : document.createElement("ul"); - var li = document.createElement("li"); - - li.id = fileIndex; - li.addEventListener("click", fileBrowserMouseEvents, false); - li.title = li.innerText = parsedURL.relativePath ? parsedURL.relativePath : "/"; - ul.appendChild(li); - isNew = false; - break; - } - } - if (isNew) { - addNewDomain(parsedURL, fileIndex); - } - } - } - - this.selectInitialFile = function sf() - { - if (currentFile == -1) - document.getElementById("1").className = "active"; - } - - function addNewDomain(parsedURL, fileIndex) - { - var div = document.createElement("div"); - var ul = document.createElement("ul"); - var li = document.createElement("li"); - - div.id = div.innerText = div.title = parsedURL.domain; - div.addEventListener("click", fileBrowserMouseEvents, false); - // Maybe we can add some roll-overs here... - //div.addEventListener("mouseover", fileBrowserMouseEvents, false); - //div.addEventListener("mouseout", fileBrowserMouseEvents, false); - li.id = fileIndex; - li.addEventListener("click", fileBrowserMouseEvents, false); - li.title = li.innerText = parsedURL.relativePath ? parsedURL.relativePath : "/"; - ul.appendChild(li); - div.appendChild(ul); - fileBrowser.appendChild(div); - } - - function removeFile(fileIndex) - { - var theFile = document.getElementById(fileIndex); - // If we are removing the last file from its site, go ahead and remove the whole site - if (theFile.parentNode.childNodes.length < 2) { - var theSite = theFile.parentNode.parentNode; - theSite.removeChildren(); - theSite.parentNode.removeChild(theSite); - } - else - theFile.parentNode.removeChild(theFile); - } -} - -function fileBrowserMouseEvents(event) -{ - switch (event.type) - { - case "click": - // If we clicked on a site, collapse/expand it, if on a file, display it. Since we're only capturing this - // event from either a DIV or LI element, we don't have to worry about any ambiguity - (event.target.nodeName.toUpperCase() == "DIV") ? toggleCollapseSite(event) : fileClicked(event.target.id); - break; - } -} - -function fileClicked(fileId, shouldLoadFile) -{ - if (shouldLoadFile === undefined) - shouldLoadFile = true; - if (currentFile != -1) - document.getElementById(currentFile).className = "passive"; - document.getElementById(fileId).className = "active"; - if (shouldLoadFile) - loadFile(fileId, false); -} - -function toggleCollapseSite(event) -{ - var thisSite = document.getElementById(event.target.id); - var siteFiles = thisSite.getElementsByTagName("ul"); - - if (siteFiles[0].style.display == "block" || !siteFiles[0].style.display) { - siteFiles[0].style.display = "none"; - thisSite.className = "collapsed"; - } else { - siteFiles[0].style.display = "block"; - thisSite.className = "expanded"; - } -} - -function didParseScript(source, fileSource, url, sourceId, baseLineNumber) -{ - var fileIndex = filesLookup[url]; - var file = files[fileIndex]; - var firstLoad = false; - - if (!fileIndex || !file) { - fileIndex = files.length + 1; - if (url.length) - filesLookup[url] = fileIndex; - - file = new Object(); - file.scripts = new Array(); - file.breakpoints = new Array(); - file.functionNames = new Array(); - file.source = (fileSource.length ? fileSource : source); - file.url = (url.length ? url : null); - file.loaded = false; - - files[fileIndex] = file; - - var filesSelect = document.getElementById("files"); - var option = document.createElement("option"); - files[fileIndex].menuOption = option; - option.value = fileIndex; - option.text = (file.url ? file.url : "(unknown script)"); - filesSelect.appendChild(option); - - var siteBrowser = new SiteBrowser(); - siteBrowser.addURL(file.url, fileIndex); - siteBrowser.selectInitialFile(); - - firstLoad = true; - } - - var sourceObj = new Object(); - sourceObj.file = fileIndex; - sourceObj.baseLineNumber = baseLineNumber; - file.scripts.push(sourceId); - scripts[sourceId] = sourceObj; - - if (!firstLoad) - updateFileSource((fileSource.length ? fileSource : source), url, false); - - if (currentFile == -1) - loadFile(fileIndex, false); -} - -function jumpToLine(sourceId, line) -{ - var script = scripts[sourceId]; - if (line <= 0 || !script) - return; - - var file = files[script.file]; - if (!file) - return; - - if (currentFile != script.file) - loadFile(script.file, true); - if (currentRow) - currentRow.removeStyleClass("current"); - if (!file.element) - return; - if (line > file.element.firstChild.childNodes.length) - return; - - currentRow = file.element.firstChild.childNodes.item(line - 1); - if (!currentRow) - return; - - currentRow.addStyleClass("current"); - - var sourcesDiv = document.getElementById("sources"); - var sourcesDocument = document.getElementById("sources").contentDocument; - var parent = sourcesDocument.body; - var offset = totalOffsetTop(currentRow, parent); - if (offset < (parent.scrollTop + 20) || offset > (parent.scrollTop + sourcesDiv.clientHeight - 20)) - parent.scrollTop = totalOffsetTop(currentRow, parent) - (sourcesDiv.clientHeight / 2) + 10; -} - -function willExecuteStatement(sourceId, line, fromLeavingFrame) -{ - var script = scripts[sourceId]; - if (line <= 0 || !script) - return; - - var file = files[script.file]; - if (!file) - return; - - lastStatement = [sourceId, line]; - - var breakpoint = file.breakpoints[line]; - - var shouldBreak = false; - - if (breakpoint && breakpoint.enabled) { - switch(breakpoint.type) { - case 0: - shouldBreak = (breakpoint.value == "break" || DebuggerDocument.evaluateScript(breakpoint.value, 0) == 1); - if (shouldBreak) - breakpoint.hitcount++; - break; - case 1: - var message = "Hit breakpoint on line " + line; - if (breakpoint.value != "break") - message = DebuggerDocument.evaluateScript(breakpoint.value, 0); - if (consoleWindow) - consoleWindow.appendMessage("", message); - breakpoint.hitcount++; - break; - } - var editor = breakpoint.editor; - var counter = null; - if (editor) - counter = breakpoint.editor.query('.//span[@class="hitCounter"]'); - if (counter) - counter.innerText = breakpoint.hitcount; - } - - if (pauseOnNextStatement || shouldBreak || (steppingOver && !steppingStack)) { - pause(); - pauseOnNextStatement = false; - pausedWhileLeavingFrame = fromLeavingFrame || false; - } - - if (isPaused) { - updateFunctionStack(); - jumpToLine(sourceId, line); - } -} - -function didEnterCallFrame(sourceId, line) -{ - if (steppingOver || steppingOut) - steppingStack++; - - if (lastStatement) - frameLineNumberStack.unshift(lastStatement); - willExecuteStatement(sourceId, line); -} - -function willLeaveCallFrame(sourceId, line) -{ - if (line <= 0) - resume(); - willExecuteStatement(sourceId, line, true); - frameLineNumberStack.shift(); - if (!steppingStack) - steppingOver = false; - if (steppingOut && !steppingStack) { - steppingOut = false; - pauseOnNextStatement = true; - } - if ((steppingOver || steppingOut) && steppingStack >= 1) - steppingStack--; -} - -function exceptionWasRaised(sourceId, line) -{ - pause(); - updateFunctionStack(); - jumpToLine(sourceId, line); -} - -function showConsoleWindow() -{ - if (!consoleWindow) - consoleWindow = window.open("console.html", "console", "top=200, left=200, width=500, height=300, toolbar=yes, resizable=yes"); - else - consoleWindow.focus(); -} - -function closeFile(fileIndex) -{ - if (fileIndex != -1) { - currentFile = -1; - var file = files[fileIndex]; - var sourcesDocument = document.getElementById("sources").contentDocument; - // Clean up our file's content - sourcesDocument.getElementById("file" + fileIndex).removeChildren(); - // Remove the file from the open files pool - delete sourcesDocument.getElementById("file" + fileIndex); - - var filesSelect = document.getElementById("files"); - // Select the next loaded file. If we're at the end of the list, loop back to beginning. - var nextSelectedFile = (filesSelect.selectedIndex + 1 >= filesSelect.options.length) ? 0 : filesSelect.selectedIndex; - // Remove the file from file lists - filesSelect.options[filesSelect.selectedIndex] = null; - SiteBrowser.removeFile(fileIndex); - delete files[fileIndex]; - - // Clean up the function list - document.getElementById("functions").removeChildren(); - - // Display appropriate place-holders, if we closed all files - if (filesSelect.options.length < 1) { - document.getElementById("filesPopupButtonContent").innerHTML = "<span class='placeholder'><No files loaded></span>"; - document.getElementById("functionNamesPopup").style.display = "none"; - } - else - switchFile(nextSelectedFile); - } -} - -function closeCurrentFile() -{ - closeFile(currentFile); -} diff --git a/WebKitTools/Drosera/mac/DebuggerApplication.h b/WebKitTools/Drosera/mac/DebuggerApplication.h deleted file mode 100644 index 4722437..0000000 --- a/WebKitTools/Drosera/mac/DebuggerApplication.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -@interface DebuggerApplication : NSObject { - NSMutableDictionary *knownServerNames; - IBOutlet NSPanel *attachWindow; - IBOutlet NSTableView *attachTable; - IBOutlet NSButton *attachButton; -} -- (IBAction)showAttachPanel:(id)sender; -- (IBAction)attach:(id)sender; - -- (NSDictionary *)knownServers; -@end diff --git a/WebKitTools/Drosera/mac/DebuggerApplication.mm b/WebKitTools/Drosera/mac/DebuggerApplication.mm deleted file mode 100644 index 35cfa24..0000000 --- a/WebKitTools/Drosera/mac/DebuggerApplication.mm +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Computer, 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "DebuggerApplication.h" - -#import "DebuggerClient.h" -#import "ServerConnection.h" - -#import <WebKit/WebCoreStatistics.h> - -@implementation DebuggerApplication -- (void)awakeFromNib -{ - NSTableColumn *column = [attachTable tableColumnWithIdentifier:@"name"]; - NSBrowserCell *cell = [[NSBrowserCell alloc] init]; - [cell setLeaf:YES]; - [column setDataCell:cell]; - [cell release]; -} - -- (void)applicationDidFinishLaunching:(NSNotification *)notification -{ - [WebCoreStatistics setShouldPrintExceptions:YES]; - - knownServerNames = [[NSMutableDictionary alloc] init]; - - [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(serverLoaded:) name:WebScriptDebugServerDidLoadNotification object:nil]; - [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(serverLoaded:) name:WebScriptDebugServerQueryReplyNotification object:nil]; - [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(serverUnloaded:) name:WebScriptDebugServerWillUnloadNotification object:nil]; - [[NSDistributedNotificationCenter defaultCenter] postNotificationName:WebScriptDebugServerQueryNotification object:nil]; - - [self showAttachPanel:nil]; -} - -#pragma mark - -#pragma mark Server Detection Callbacks - -- (void)serverLoaded:(NSNotification *)notification -{ - int processId = [[[notification userInfo] objectForKey:WebScriptDebugServerProcessIdentifierKey] intValue]; - if (processId == [[NSProcessInfo processInfo] processIdentifier]) - return; - - NSMutableDictionary *info = [[notification userInfo] mutableCopy]; - if (!info) - return; - [knownServerNames setObject:info forKey:[notification object]]; - [info release]; - - [attachTable reloadData]; -} - -- (void)serverUnloaded:(NSNotification *)notification -{ - [knownServerNames removeObjectForKey:[notification object]]; - [attachTable reloadData]; -} - -- (NSDictionary *)knownServers -{ - return knownServerNames; -} - -#pragma mark - -#pragma mark Attach Panel Actions - -- (IBAction)showAttachPanel:(id)sender -{ - if (![attachWindow isVisible]) - [attachWindow center]; - [attachTable reloadData]; - [attachTable setTarget:self]; - [attachTable setDoubleAction:@selector(attach:)]; - [attachWindow makeKeyAndOrderFront:sender]; -} - -- (IBAction)attach:(id)sender -{ - if ([[attachTable selectedRowIndexes] count] != 1) - return; - - [attachWindow orderOut:sender]; - - unsigned int row = [[attachTable selectedRowIndexes] firstIndex]; - NSString *key = [[knownServerNames allKeys] objectAtIndex:row]; - - DebuggerClient *document = [[DebuggerClient alloc] initWithServerName:key]; - [document showWindow:sender]; -} - -#pragma mark - -#pragma mark Table View Delegate - -- (int)numberOfRowsInTableView:(NSTableView *)tableView -{ - return [knownServerNames count]; -} - -- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row -{ - return @""; -} - -- (void)tableView:(NSTableView *)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn row:(int)row -{ - NSString *key = [[knownServerNames allKeys] objectAtIndex:row]; - NSMutableDictionary *info = [knownServerNames objectForKey:key]; - NSString *processName = [info objectForKey:WebScriptDebugServerProcessNameKey]; - NSImage *icon = [info objectForKey:@"icon"]; - - if (!icon) { - NSString *path = [[NSWorkspace sharedWorkspace] fullPathForApplication:processName]; - if (path) icon = [[NSWorkspace sharedWorkspace] iconForFile:path]; - if (!icon) icon = [[NSWorkspace sharedWorkspace] iconForFileType:@"app"]; - if (icon) [info setObject:icon forKey:@"icon"]; - [icon setScalesWhenResized:YES]; - [icon setSize:NSMakeSize(32, 32)]; - } - - [cell setImage:icon]; - [cell setTitle:processName]; -} - -- (void)tableViewSelectionDidChange:(NSNotification *)notification -{ - [attachButton setEnabled:([[attachTable selectedRowIndexes] count])]; -} -@end diff --git a/WebKitTools/Drosera/mac/DebuggerClient.h b/WebKitTools/Drosera/mac/DebuggerClient.h deleted file mode 100644 index 808d331..0000000 --- a/WebKitTools/Drosera/mac/DebuggerClient.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006, 2007 Vladimir Olexa (vladimir.olexa@gmail.com) - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -class DebuggerDocument; - -@class ServerConnection; -@class WebView; - -@interface DebuggerClient : NSWindowController -{ - IBOutlet WebView *webView; - BOOL webViewLoaded; - DebuggerDocument* debuggerDocument; - ServerConnection *server; -} - -- (id)initWithServerName:(NSString *)serverConn; -- (IBAction)pause:(id)sender; -- (IBAction)resume:(id)sender; -- (IBAction)stepInto:(id)sender; -- (IBAction)stepOver:(id)sender; -- (IBAction)stepOut:(id)sender; -- (IBAction)showConsole:(id)sender; -- (IBAction)closeCurrentFile:(id)sender; - -@end diff --git a/WebKitTools/Drosera/mac/DebuggerClient.mm b/WebKitTools/Drosera/mac/DebuggerClient.mm deleted file mode 100644 index 71cfa8b..0000000 --- a/WebKitTools/Drosera/mac/DebuggerClient.mm +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006, 2007 Vladimir Olexa (vladimir.olexa@gmail.com) - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "DebuggerClient.h" - -#import "DebuggerApplication.h" -#import "DebuggerDocument.h" -#import "ServerConnection.h" - -#import <JavaScriptCore/JSContextRef.h> - -static NSString *DebuggerConsoleToolbarItem = @"DebuggerConsoleToolbarItem"; -static NSString *DebuggerContinueToolbarItem = @"DebuggerContinueToolbarItem"; -static NSString *DebuggerPauseToolbarItem = @"DebuggerPauseToolbarItem"; -static NSString *DebuggerStepIntoToolbarItem = @"DebuggerStepIntoToolbarItem"; -static NSString *DebuggerStepOverToolbarItem = @"DebuggerStepOverToolbarItem"; -static NSString *DebuggerStepOutToolbarItem = @"DebuggerStepOutToolbarItem"; - -@implementation DebuggerClient -+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector -{ - return NO; -} - -+ (BOOL)isKeyExcludedFromWebScript:(const char *)name -{ - return NO; -} - -#pragma mark - - -- (id)initWithServerName:(NSString *)serverName; -{ - if ((self = [super init])) { - server = [[ServerConnection alloc] initWithServerName:serverName]; - debuggerDocument = new DebuggerDocument(server); - } - - return self; -} - -- (void)dealloc -{ - delete debuggerDocument; - [server release]; - [super dealloc]; -} - -#pragma mark - -#pragma mark Interface Actions - -- (IBAction)pause:(id)sender -{ - DebuggerDocument::callGlobalFunction([[webView mainFrame] globalContext], "pause", 0, 0); -} - -- (IBAction)resume:(id)sender -{ - DebuggerDocument::callGlobalFunction([[webView mainFrame] globalContext], "resume", 0, 0); -} - -- (IBAction)stepInto:(id)sender -{ - DebuggerDocument::callGlobalFunction([[webView mainFrame] globalContext], "stepInto", 0, 0); -} - -- (IBAction)stepOver:(id)sender -{ - DebuggerDocument::callGlobalFunction([[webView mainFrame] globalContext], "stepOver", 0, 0); -} - -- (IBAction)stepOut:(id)sender -{ - DebuggerDocument::callGlobalFunction([[webView mainFrame] globalContext], "stepOut", 0, 0); -} - -- (IBAction)showConsole:(id)sender -{ - DebuggerDocument::callGlobalFunction([[webView mainFrame] globalContext], "showConsoleWindow", 0, 0); -} - -- (IBAction)closeCurrentFile:(id)sender -{ - DebuggerDocument::callGlobalFunction([[webView mainFrame] globalContext], "closeCurrentFile", 0, 0); -} - -#pragma mark - -#pragma mark Window Controller Overrides - -- (NSString *)windowNibName -{ - return @"Debugger"; -} - -- (void)windowDidLoad -{ - [super windowDidLoad]; - - NSString *path = [[NSBundle mainBundle] pathForResource:@"debugger" ofType:@"html" inDirectory:nil]; - [[webView mainFrame] loadRequest:[[[NSURLRequest alloc] initWithURL:[NSURL fileURLWithPath:path]] autorelease]]; - - NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:@"debugger"]; - [toolbar setDelegate:self]; - [toolbar setAllowsUserCustomization:YES]; - [toolbar setAutosavesConfiguration:YES]; - [[self window] setToolbar:toolbar]; - [toolbar release]; -} - -- (void)windowWillClose:(NSNotification *)notification -{ - [[webView windowScriptObject] removeWebScriptKey:@"DebuggerDocument"]; - - [server switchToServerNamed:nil]; - - [self autorelease]; // DebuggerApplication expects us to release on close -} - -#pragma mark - -#pragma mark Toolbar Delegate - -- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag -{ - if ([itemIdentifier isEqualToString:DebuggerContinueToolbarItem]) { - NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; - - [item setLabel:@"Continue"]; - [item setPaletteLabel:@"Continue"]; - - [item setToolTip:@"Continue script execution"]; - [item setImage:[NSImage imageNamed:@"continue"]]; - - [item setTarget:self]; - [item setAction:@selector(resume:)]; - - return [item autorelease]; - } else if ([itemIdentifier isEqualToString:DebuggerConsoleToolbarItem]) { - NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; - - [item setLabel:@"Console"]; - [item setPaletteLabel:@"Console"]; - - [item setToolTip:@"Console"]; - [item setImage:[NSImage imageNamed:@"console"]]; - - [item setTarget:self]; - [item setAction:@selector(showConsole:)]; - - return [item autorelease]; - } else if ([itemIdentifier isEqualToString:DebuggerPauseToolbarItem]) { - NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; - - [item setLabel:@"Pause"]; - [item setPaletteLabel:@"Pause"]; - - [item setToolTip:@"Pause script execution"]; - [item setImage:[NSImage imageNamed:@"pause"]]; - - [item setTarget:self]; - [item setAction:@selector(pause:)]; - - return [item autorelease]; - } else if ([itemIdentifier isEqualToString:DebuggerStepIntoToolbarItem]) { - NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; - - [item setLabel:@"Step Into"]; - [item setPaletteLabel:@"Step Into"]; - - [item setToolTip:@"Step into function call"]; - [item setImage:[NSImage imageNamed:@"step"]]; - - [item setTarget:self]; - [item setAction:@selector(stepInto:)]; - - return [item autorelease]; - } else if ([itemIdentifier isEqualToString:DebuggerStepOverToolbarItem]) { - NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; - - [item setLabel:@"Step Over"]; - [item setPaletteLabel:@"Step Over"]; - - [item setToolTip:@"Step over function call"]; - [item setImage:[NSImage imageNamed:@"stepOver"]]; - - [item setTarget:self]; - [item setAction:@selector(stepOver:)]; - - return [item autorelease]; - } else if ([itemIdentifier isEqualToString:DebuggerStepOutToolbarItem]) { - NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; - - [item setLabel:@"Step Out"]; - [item setPaletteLabel:@"Step Over"]; - - [item setToolTip:@"Step out of current function"]; - [item setImage:[NSImage imageNamed:@"stepOut"]]; - - [item setTarget:self]; - [item setAction:@selector(stepOut:)]; - - return [item autorelease]; - } - - return nil; -} - -- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar -{ - return [NSArray arrayWithObjects:DebuggerContinueToolbarItem, DebuggerPauseToolbarItem, - NSToolbarSeparatorItemIdentifier, DebuggerStepIntoToolbarItem, DebuggerStepOutToolbarItem, - DebuggerStepOverToolbarItem, NSToolbarFlexibleSpaceItemIdentifier, DebuggerConsoleToolbarItem, nil]; -} - -- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar -{ - return [NSArray arrayWithObjects:DebuggerConsoleToolbarItem, DebuggerContinueToolbarItem, DebuggerPauseToolbarItem, - DebuggerStepIntoToolbarItem, DebuggerStepOutToolbarItem, DebuggerStepOverToolbarItem, NSToolbarCustomizeToolbarItemIdentifier, - NSToolbarFlexibleSpaceItemIdentifier, NSToolbarSpaceItemIdentifier, NSToolbarSeparatorItemIdentifier, nil]; -} - -- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)interfaceItem -{ - SEL action = [interfaceItem action]; - if (action == @selector(pause:)) { - if (!webViewLoaded) - return NO; - - return !debuggerDocument->isPaused([[webView mainFrame] globalContext]); - } - if (action == @selector(resume:) || - action == @selector(stepOver:) || - action == @selector(stepOut:) || - action == @selector(stepInto:)) { - if (!webViewLoaded) - return YES; - - return debuggerDocument->isPaused([[webView mainFrame] globalContext]); - } - return YES; -} - -#pragma mark - -#pragma mark WebView UI Delegate - -- (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request -{ - WebView *newWebView = [[WebView alloc] initWithFrame:NSZeroRect frameName:nil groupName:nil]; - [newWebView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; - [newWebView setUIDelegate:self]; - [newWebView setPolicyDelegate:self]; - [newWebView setFrameLoadDelegate:self]; - if (request) - [[newWebView mainFrame] loadRequest:request]; - - NSWindow *window = [[NSWindow alloc] initWithContentRect:NSZeroRect styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask | NSUnifiedTitleAndToolbarWindowMask) backing:NSBackingStoreBuffered defer:NO screen:[[webView window] screen]]; - [window setReleasedWhenClosed:YES]; - [newWebView setFrame:[[window contentView] frame]]; - [[window contentView] addSubview:newWebView]; - [newWebView release]; - - return newWebView; -} - -- (void)webViewShow:(WebView *)sender -{ - [[sender window] makeKeyAndOrderFront:sender]; -} - -- (BOOL)webViewAreToolbarsVisible:(WebView *)sender -{ - return [[[sender window] toolbar] isVisible]; -} - -- (void)webView:(WebView *)sender setToolbarsVisible:(BOOL)visible -{ - [[[sender window] toolbar] setVisible:visible]; -} - -- (void)webView:(WebView *)sender setResizable:(BOOL)resizable -{ - [[sender window] setShowsResizeIndicator:resizable]; - [[[sender window] standardWindowButton:NSWindowZoomButton] setEnabled:resizable]; -} - -- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame -{ - NSRange range = [message rangeOfString:@"\t"]; - NSString *title = @"Alert"; - if (range.location != NSNotFound) { - title = [message substringToIndex:range.location]; - message = [message substringFromIndex:(range.location + range.length)]; - } - - NSBeginInformationalAlertSheet(title, nil, nil, nil, [sender window], nil, NULL, NULL, NULL, message); -} - -- (void)scriptConfirmSheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(long *)contextInfo -{ - *contextInfo = returnCode; -} - -- (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame -{ - NSRange range = [message rangeOfString:@"\t"]; - NSString *title = @"Alert"; - if (range.location != NSNotFound) { - title = [message substringToIndex:range.location]; - message = [message substringFromIndex:(range.location + range.length)]; - } - - long result = NSNotFound; - NSBeginInformationalAlertSheet(title, nil, @"Cancel", nil, [sender window], self, @selector(scriptConfirmSheetDidEnd:returnCode:contextInfo:), NULL, &result, message); - - while (result == NSNotFound) { - NSEvent *nextEvent = [[NSApplication sharedApplication] nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantFuture] inMode:NSDefaultRunLoopMode dequeue:YES]; - [[NSApplication sharedApplication] sendEvent:nextEvent]; - } - - return result; -} - -#pragma mark - -#pragma mark WebView Frame Load Delegate - -- (void)webView:(WebView *)sender windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject -{ - // note: this is the Debuggers's own WebView, not the one being debugged - JSContextRef context = [[webView mainFrame] globalContext]; - JSObjectRef globalObject = JSContextGetGlobalObject(context); - - debuggerDocument->windowScriptObjectAvailable(context, globalObject); -} - -- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame -{ - // note: this is the Debuggers's own WebView, not the one being debugged - if ([[sender window] isEqual:[self window]]) { - webViewLoaded = YES; - [server setGlobalContext:[[webView mainFrame] globalContext]]; - } -} - -- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame -{ - // note: this is the Debuggers's own WebViews, not the one being debugged - if ([frame isEqual:[sender mainFrame]]) { - NSDictionary *info = [[(DebuggerApplication *)[[NSApplication sharedApplication] delegate] knownServers] objectForKey:[server currentServerName]]; - NSString *processName = [info objectForKey:WebScriptDebugServerProcessNameKey]; - if (info && [processName length]) { - NSMutableString *newTitle = [[NSMutableString alloc] initWithString:processName]; - [newTitle appendString:@" - "]; - [newTitle appendString:title]; - [[sender window] setTitle:newTitle]; - [newTitle release]; - } else - [[sender window] setTitle:title]; - } -} - -@end diff --git a/WebKitTools/Drosera/mac/DebuggerDocumentPlatform.mm b/WebKitTools/Drosera/mac/DebuggerDocumentPlatform.mm deleted file mode 100644 index b49338c..0000000 --- a/WebKitTools/Drosera/mac/DebuggerDocumentPlatform.mm +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006, 2007 Vladimir Olexa (vladimir.olexa@gmail.com) - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "DebuggerDocument.h" - -#import "DebuggerClient.h" -#import "ServerConnection.h" - -#import <JavaScriptCore/JSRetainPtr.h> -#import <JavaScriptCore/JSStringRefCF.h> -#import <JavaScriptCore/RetainPtr.h> - -// Converting string types -NSString* NSStringCreateWithJSStringRef(JSStringRef jsString) -{ - CFStringRef cfString = JSStringCopyCFString(kCFAllocatorDefault, jsString); - return (NSString *)cfString; -} - -JSValueRef JSValueRefCreateWithNSString(JSContextRef context, NSString* nsString) -{ - JSRetainPtr<JSStringRef> jsString(Adopt, JSStringCreateWithCFString((CFStringRef)nsString)); - return JSValueMakeString(context, jsString.get()); -} - -@interface NSString (WebScriptStringExtras) -+ (NSString *)stringOrNilFromWebScriptResult:(id)scriptResult; -@end - -@implementation NSString (WebScriptStringExtras) -+ (NSString *)stringOrNilFromWebScriptResult:(id)scriptResult -{ - NSString *ret = nil; - - if ([scriptResult isKindOfClass:NSClassFromString(@"WebScriptObject")]) - ret = [scriptResult callWebScriptMethod:@"toString" withArguments:nil]; - else if (scriptResult && ![scriptResult isKindOfClass:[NSString class]]) - ret = [scriptResult description]; - else if (scriptResult) - ret = scriptResult; - - return ret; -} -@end - -@interface WebScriptObject (WebScriptObjectExtras) -+ (NSArray *)webScriptAttributeKeys:(WebScriptObject *)object; -@end - -@implementation WebScriptObject (WebScriptObjectExtras) -+ (NSArray *)webScriptAttributeKeys:(WebScriptObject *)object; -{ - WebScriptObject *enumerateAttributes = [object evaluateWebScript:@"(function () { var result = new Array(); for (var x in this) { result.push(x); } return result; })"]; - - NSMutableArray *result = [[NSMutableArray alloc] init]; - WebScriptObject *variables = [enumerateAttributes callWebScriptMethod:@"call" withArguments:[NSArray arrayWithObject:object]]; - unsigned length = [[variables valueForKey:@"length"] intValue]; - for (unsigned i = 0; i < length; i++) { - NSString *key = [variables webScriptValueAtIndex:i]; - [result addObject:key]; - } - - [result sortUsingSelector:@selector(compare:)]; - return [result autorelease]; -} -@end - -// DebuggerDocument platform specific implementations - -void DebuggerDocument::platformPause() -{ - [m_server.get() pause]; -} - -void DebuggerDocument::platformResume() -{ - [m_server.get() resume]; -} - -void DebuggerDocument::platformStepInto() -{ - [m_server.get() stepInto]; -} - -JSValueRef DebuggerDocument::platformEvaluateScript(JSContextRef context, JSStringRef script, int callFrame) -{ - WebScriptCallFrame *cframe = [m_server.get() currentFrame]; - for (unsigned count = 0; count < callFrame; count++) - cframe = [cframe caller]; - - if (!cframe) - return JSValueMakeUndefined(context); - - RetainPtr<NSString> scriptNS(AdoptNS, NSStringCreateWithJSStringRef(script)); - id value = [cframe evaluateWebScript:scriptNS.get()]; - NSString *result = [NSString stringOrNilFromWebScriptResult:value]; - if (!result) - return JSValueMakeNull(context); - - return JSValueRefCreateWithNSString(context, result); -} - -void DebuggerDocument::getPlatformCurrentFunctionStack(JSContextRef context, Vector<JSValueRef>& currentStack) -{ - for (WebScriptCallFrame *frame = [m_server.get() currentFrame]; frame;) { - CFStringRef function; - if ([frame functionName]) - function = (CFStringRef)[frame functionName]; - else if ([frame caller]) - function = CFSTR("(anonymous function)"); - else - function = CFSTR("(global scope)"); - frame = [frame caller]; - - currentStack.append(JSValueRefCreateWithNSString(context, (NSString *)function)); - } -} - -void DebuggerDocument::getPlatformLocalScopeVariableNamesForCallFrame(JSContextRef context, int callFrame, Vector<JSValueRef>& variableNames) -{ - WebScriptCallFrame *cframe = [m_server.get() currentFrame]; - for (unsigned count = 0; count < callFrame; count++) - cframe = [cframe caller]; - - if (!cframe) - return; - if (![[cframe scopeChain] count]) - return; - - WebScriptObject *scope = [[cframe scopeChain] objectAtIndex:0]; // local is always first - NSArray *localScopeVariableNames = [WebScriptObject webScriptAttributeKeys:scope]; - - for (int i = 0; i < [localScopeVariableNames count]; ++i) { - variableNames.append(JSValueRefCreateWithNSString(context, [localScopeVariableNames objectAtIndex:i])); - } -} - -JSValueRef DebuggerDocument::platformValueForScopeVariableNamed(JSContextRef context, JSStringRef key, int callFrame) -{ - WebScriptCallFrame *cframe = [m_server.get() currentFrame]; - for (unsigned count = 0; count < callFrame; count++) - cframe = [cframe caller]; - - if (!cframe) - return JSValueMakeUndefined(context); - - unsigned scopeCount = [[cframe scopeChain] count]; - - if (!scopeCount) - return JSValueMakeUndefined(context); - - NSString *resultString = nil; - - for (unsigned i = 0; i < scopeCount && resultString == nil; i++) { - WebScriptObject *scope = [[cframe scopeChain] objectAtIndex:i]; - - id value = nil; - @try { - RetainPtr<NSString> keyNS(AdoptNS, NSStringCreateWithJSStringRef(key)); - value = [scope valueForKey:keyNS.get()]; - } @catch(NSException* localException) { // The value wasn't found. - } - - resultString = [NSString stringOrNilFromWebScriptResult:value]; - } - - if (!resultString) - return JSValueMakeUndefined(context); - - return JSValueRefCreateWithNSString(context, resultString); -} - -void DebuggerDocument::platformLog(JSStringRef msg) -{ - RetainPtr<NSString> msgNS(AdoptNS, NSStringCreateWithJSStringRef(msg)); - NSLog(@"%@", msgNS.get()); -} - diff --git a/WebKitTools/Drosera/mac/Drosera.xcodeproj/project.pbxproj b/WebKitTools/Drosera/mac/Drosera.xcodeproj/project.pbxproj deleted file mode 100644 index 3ef8b64..0000000 --- a/WebKitTools/Drosera/mac/Drosera.xcodeproj/project.pbxproj +++ /dev/null @@ -1,659 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 15CE85540ADBEA620078A734 /* fileIcon.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 15CE854F0ADBEA610078A734 /* fileIcon.jpg */; }; - 15CE85550ADBEA620078A734 /* siteCollapsed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 15CE85500ADBEA610078A734 /* siteCollapsed.tif */; }; - 15CE85560ADBEA620078A734 /* siteExpanded.tif in Resources */ = {isa = PBXBuildFile; fileRef = 15CE85510ADBEA610078A734 /* siteExpanded.tif */; }; - 15CE85570ADBEA620078A734 /* siteIcon.tif in Resources */ = {isa = PBXBuildFile; fileRef = 15CE85520ADBEA610078A734 /* siteIcon.tif */; }; - 15CE85580ADBEA620078A734 /* SourceArrowOpen.png in Resources */ = {isa = PBXBuildFile; fileRef = 15CE85530ADBEA610078A734 /* SourceArrowOpen.png */; }; - 1C2632D30A4AF0A800EA7CD8 /* verticalSplitterBar.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 1C2632D10A4AF0A800EA7CD8 /* verticalSplitterBar.tiff */; }; - 1C2632D40A4AF0A800EA7CD8 /* verticalSplitterDimple.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 1C2632D20A4AF0A800EA7CD8 /* verticalSplitterDimple.tiff */; }; - 1C2632D70A4AF0B800EA7CD8 /* SourceArrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C2632D50A4AF0B800EA7CD8 /* SourceArrow.png */; }; - 1C2632D80A4AF0B800EA7CD8 /* SourceArrowBlank.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C2632D60A4AF0B800EA7CD8 /* SourceArrowBlank.png */; }; - 1C2632DA0A4AF0D200EA7CD8 /* background_stripe.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C2632D90A4AF0D200EA7CD8 /* background_stripe.png */; }; - 1C27ABC60A413B720016ECF4 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1C27ABC50A413B720016ECF4 /* WebKit.framework */; }; - 1C27AC200A413D2D0016ECF4 /* debugger.html in Resources */ = {isa = PBXBuildFile; fileRef = 1C27AC1F0A413D2D0016ECF4 /* debugger.html */; }; - 1C27B1260A421D870016ECF4 /* debugger.js in Resources */ = {isa = PBXBuildFile; fileRef = 1C27AC230A413D660016ECF4 /* debugger.js */; }; - 1C3487980A81208400101C5C /* Drosera.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1C3487970A81208400101C5C /* Drosera.icns */; }; - 1C4FF7440A44F52C0000D05D /* debugger.css in Resources */ = {isa = PBXBuildFile; fileRef = 1C4FF7430A44F5260000D05D /* debugger.css */; }; - 1C4FF7540A44F6320000D05D /* gutter.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C4FF7530A44F6320000D05D /* gutter.png */; }; - 1C4FF9210A45F3520000D05D /* glossyHeader.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C4FF91F0A45F3520000D05D /* glossyHeader.png */; }; - 1C4FF94E0A45F5060000D05D /* popUpArrows.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C4FF94D0A45F5060000D05D /* popUpArrows.png */; }; - 1C4FFE5E0A466F5D0000D05D /* programCounterBreakPoint.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1C4FFE5C0A466F5D0000D05D /* programCounterBreakPoint.tif */; }; - 1C4FFE5F0A466F5D0000D05D /* programCounterBreakPointDisabled.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1C4FFE5D0A466F5D0000D05D /* programCounterBreakPointDisabled.tif */; }; - 1C6F83FF0A58E97D004FCD89 /* stepOut.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1C6F83FE0A58E97D004FCD89 /* stepOut.tif */; }; - 1C6F84520A58EDFE004FCD89 /* console.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C6F84510A58EDFE004FCD89 /* console.png */; }; - 1C6F84550A58EE06004FCD89 /* console.css in Resources */ = {isa = PBXBuildFile; fileRef = 1C6F84530A58EE06004FCD89 /* console.css */; }; - 1C6F84560A58EE06004FCD89 /* console.html in Resources */ = {isa = PBXBuildFile; fileRef = 1C6F84540A58EE06004FCD89 /* console.html */; }; - 1C6F86730A59A18B004FCD89 /* console.js in Resources */ = {isa = PBXBuildFile; fileRef = 1C6F861F0A599F65004FCD89 /* console.js */; }; - 1C74F0350A47BF8300FEC632 /* viewer.html in Resources */ = {isa = PBXBuildFile; fileRef = 1C74F0340A47BF8300FEC632 /* viewer.html */; }; - 1C74F04B0A47BFE800FEC632 /* viewer.css in Resources */ = {isa = PBXBuildFile; fileRef = 1C74F03A0A47BFD600FEC632 /* viewer.css */; }; - 1C74F1850A47DEE600FEC632 /* DebuggerApplication.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C74F1840A47DEE600FEC632 /* DebuggerApplication.mm */; }; - 1CC058EE0A44A210006FE533 /* breakPoint.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058B80A44A210006FE533 /* breakPoint.tif */; }; - 1CC058EF0A44A210006FE533 /* breakPointDisabled.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058B90A44A210006FE533 /* breakPointDisabled.tif */; }; - 1CC059020A44A210006FE533 /* glossyFooterFill.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058CC0A44A210006FE533 /* glossyFooterFill.tif */; }; - 1CC0590E0A44A210006FE533 /* navLeftDisabled.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058D80A44A210006FE533 /* navLeftDisabled.png */; }; - 1CC0590F0A44A210006FE533 /* navLeftNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058D90A44A210006FE533 /* navLeftNormal.png */; }; - 1CC059100A44A210006FE533 /* navLeftPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058DA0A44A210006FE533 /* navLeftPressed.png */; }; - 1CC059110A44A210006FE533 /* navRightDisabled.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058DB0A44A210006FE533 /* navRightDisabled.png */; }; - 1CC059120A44A210006FE533 /* navRightNormal.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058DC0A44A210006FE533 /* navRightNormal.png */; }; - 1CC059130A44A210006FE533 /* navRightPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058DD0A44A210006FE533 /* navRightPressed.png */; }; - 1CC059160A44A210006FE533 /* programCounter.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058E00A44A210006FE533 /* programCounter.tif */; }; - 1CC059170A44A210006FE533 /* splitterBar.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058E10A44A210006FE533 /* splitterBar.tif */; }; - 1CC059180A44A210006FE533 /* splitterDimple.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058E20A44A210006FE533 /* splitterDimple.tif */; }; - 1CC0591A0A44A210006FE533 /* continue.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058E40A44A210006FE533 /* continue.tif */; }; - 1CC0591D0A44A210006FE533 /* pause.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058E70A44A210006FE533 /* pause.tif */; }; - 1CC0591E0A44A210006FE533 /* run.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058E80A44A210006FE533 /* run.tif */; }; - 1CC0591F0A44A210006FE533 /* step.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058E90A44A210006FE533 /* step.tif */; }; - 1CC059200A44A210006FE533 /* stepOver.tif in Resources */ = {isa = PBXBuildFile; fileRef = 1CC058EA0A44A210006FE533 /* stepOver.tif */; }; - 1CC059700A44A485006FE533 /* toolbarBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CC0596F0A44A485006FE533 /* toolbarBackground.png */; }; - 1CD434B20A4B86F800A007AB /* glossyHeaderPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CD434B10A4B86F800A007AB /* glossyHeaderPressed.png */; }; - 1CD8D5690A49041C00E5677B /* launcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CD8D5680A49041C00E5677B /* launcher.m */; }; - 1CD8D56C0A49043E00E5677B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; }; - 1CD8D5A60A49102900E5677B /* Drosera.app in Resources */ = {isa = PBXBuildFile; fileRef = 8D15AC370486D014006FF6A4 /* Drosera.app */; }; - 5D2C827F0A816BA700C193FD /* Drosera.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1C3487970A81208400101C5C /* Drosera.icns */; }; - 63D54BD70AE600560064C440 /* breakpointeditor.png in Resources */ = {isa = PBXBuildFile; fileRef = 63D54BD60AE600560064C440 /* breakpointeditor.png */; }; - 63D54CBD0AE72C990064C440 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63D54CBC0AE72C990064C440 /* Carbon.framework */; }; - 63D54D7E0AE75CF10064C440 /* close_active.tif in Resources */ = {isa = PBXBuildFile; fileRef = 63D54D7B0AE75CF10064C440 /* close_active.tif */; }; - 63D54D7F0AE75CF10064C440 /* close_hover.tif in Resources */ = {isa = PBXBuildFile; fileRef = 63D54D7C0AE75CF10064C440 /* close_hover.tif */; }; - 63D54D800AE75CF10064C440 /* close.tif in Resources */ = {isa = PBXBuildFile; fileRef = 63D54D7D0AE75CF10064C440 /* close.tif */; }; - 63D54F780AE8280F0064C440 /* breakpointEditor.html in Resources */ = {isa = PBXBuildFile; fileRef = 63D54F770AE8280F0064C440 /* breakpointEditor.html */; }; - 8D15AC2D0486D014006FF6A4 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */; }; - 8D15AC2E0486D014006FF6A4 /* Debugger.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B4FDCFA73011CA2CEA /* Debugger.nib */; }; - 8D15AC320486D014006FF6A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; - 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; }; - 957876850C9A226A008B6383 /* ServerConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 957876840C9A226A008B6383 /* ServerConnection.mm */; }; - 95B2A4500C95EECD00850C41 /* DebuggerClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95B2A44F0C95EECD00850C41 /* DebuggerClient.mm */; }; - 95B955250C975C7500AAB83B /* DebuggerDocumentPlatform.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95B955240C975C7500AAB83B /* DebuggerDocumentPlatform.mm */; }; - D23E47C60C4460C600B7CD07 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D23E47C50C4460C600B7CD07 /* JavaScriptCore.framework */; }; - D2D794FD0C4BED83004784F7 /* DebuggerDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D2D794ED0C4BED83004784F7 /* DebuggerDocument.cpp */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 1CD8D5A90A49104E00E5677B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 2A37F4A9FDCFA73011CA2CEA /* Project object */; - proxyType = 1; - remoteGlobalIDString = 8D15AC270486D014006FF6A4; - remoteInfo = Drosera; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; - 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; }; - 15CE854F0ADBEA610078A734 /* fileIcon.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = fileIcon.jpg; path = ../Images/fileIcon.jpg; sourceTree = SOURCE_ROOT; }; - 15CE85500ADBEA610078A734 /* siteCollapsed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = siteCollapsed.tif; path = ../Images/siteCollapsed.tif; sourceTree = SOURCE_ROOT; }; - 15CE85510ADBEA610078A734 /* siteExpanded.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = siteExpanded.tif; path = ../Images/siteExpanded.tif; sourceTree = SOURCE_ROOT; }; - 15CE85520ADBEA610078A734 /* siteIcon.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = siteIcon.tif; path = ../Images/siteIcon.tif; sourceTree = SOURCE_ROOT; }; - 15CE85530ADBEA610078A734 /* SourceArrowOpen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = SourceArrowOpen.png; path = ../Images/SourceArrowOpen.png; sourceTree = SOURCE_ROOT; }; - 1C2632D10A4AF0A800EA7CD8 /* verticalSplitterBar.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = verticalSplitterBar.tiff; path = ../Images/verticalSplitterBar.tiff; sourceTree = SOURCE_ROOT; }; - 1C2632D20A4AF0A800EA7CD8 /* verticalSplitterDimple.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = verticalSplitterDimple.tiff; path = ../Images/verticalSplitterDimple.tiff; sourceTree = SOURCE_ROOT; }; - 1C2632D50A4AF0B800EA7CD8 /* SourceArrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = SourceArrow.png; path = ../Images/SourceArrow.png; sourceTree = SOURCE_ROOT; }; - 1C2632D60A4AF0B800EA7CD8 /* SourceArrowBlank.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = SourceArrowBlank.png; path = ../Images/SourceArrowBlank.png; sourceTree = SOURCE_ROOT; }; - 1C2632D90A4AF0D200EA7CD8 /* background_stripe.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = background_stripe.png; path = ../Images/background_stripe.png; sourceTree = SOURCE_ROOT; }; - 1C27ABC50A413B720016ECF4 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = "<absolute>"; }; - 1C27AC1F0A413D2D0016ECF4 /* debugger.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = debugger.html; path = ../debugger.html; sourceTree = SOURCE_ROOT; tabWidth = 8; usesTabs = 0; }; - 1C27AC230A413D660016ECF4 /* debugger.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = debugger.js; path = ../debugger.js; sourceTree = SOURCE_ROOT; tabWidth = 8; usesTabs = 0; }; - 1C3487970A81208400101C5C /* Drosera.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Drosera.icns; path = ../Drosera.icns; sourceTree = SOURCE_ROOT; }; - 1C4FF7430A44F5260000D05D /* debugger.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = debugger.css; path = ../debugger.css; sourceTree = SOURCE_ROOT; tabWidth = 8; usesTabs = 0; }; - 1C4FF7530A44F6320000D05D /* gutter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = gutter.png; path = ../Images/gutter.png; sourceTree = SOURCE_ROOT; }; - 1C4FF91F0A45F3520000D05D /* glossyHeader.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = glossyHeader.png; path = ../Images/glossyHeader.png; sourceTree = SOURCE_ROOT; }; - 1C4FF94D0A45F5060000D05D /* popUpArrows.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = popUpArrows.png; path = ../Images/popUpArrows.png; sourceTree = SOURCE_ROOT; }; - 1C4FFE5C0A466F5D0000D05D /* programCounterBreakPoint.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = programCounterBreakPoint.tif; path = ../Images/programCounterBreakPoint.tif; sourceTree = SOURCE_ROOT; }; - 1C4FFE5D0A466F5D0000D05D /* programCounterBreakPointDisabled.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = programCounterBreakPointDisabled.tif; path = ../Images/programCounterBreakPointDisabled.tif; sourceTree = SOURCE_ROOT; }; - 1C6F83FE0A58E97D004FCD89 /* stepOut.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = stepOut.tif; path = ../Images/stepOut.tif; sourceTree = SOURCE_ROOT; }; - 1C6F84510A58EDFE004FCD89 /* console.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = console.png; path = ../Images/console.png; sourceTree = SOURCE_ROOT; }; - 1C6F84530A58EE06004FCD89 /* console.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = console.css; path = ../console.css; sourceTree = SOURCE_ROOT; }; - 1C6F84540A58EE06004FCD89 /* console.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = console.html; path = ../console.html; sourceTree = SOURCE_ROOT; }; - 1C6F861F0A599F65004FCD89 /* console.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = console.js; path = ../console.js; sourceTree = SOURCE_ROOT; }; - 1C74F0340A47BF8300FEC632 /* viewer.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = viewer.html; path = ../viewer.html; sourceTree = SOURCE_ROOT; tabWidth = 8; usesTabs = 0; }; - 1C74F03A0A47BFD600FEC632 /* viewer.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = viewer.css; path = ../viewer.css; sourceTree = SOURCE_ROOT; tabWidth = 8; usesTabs = 0; }; - 1C74F1830A47DEE600FEC632 /* DebuggerApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebuggerApplication.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; - 1C74F1840A47DEE600FEC632 /* DebuggerApplication.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DebuggerApplication.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; - 1CC058B80A44A210006FE533 /* breakPoint.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = breakPoint.tif; path = ../Images/breakPoint.tif; sourceTree = SOURCE_ROOT; }; - 1CC058B90A44A210006FE533 /* breakPointDisabled.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = breakPointDisabled.tif; path = ../Images/breakPointDisabled.tif; sourceTree = SOURCE_ROOT; }; - 1CC058CC0A44A210006FE533 /* glossyFooterFill.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = glossyFooterFill.tif; path = ../Images/glossyFooterFill.tif; sourceTree = SOURCE_ROOT; }; - 1CC058D80A44A210006FE533 /* navLeftDisabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = navLeftDisabled.png; path = ../Images/navLeftDisabled.png; sourceTree = SOURCE_ROOT; }; - 1CC058D90A44A210006FE533 /* navLeftNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = navLeftNormal.png; path = ../Images/navLeftNormal.png; sourceTree = SOURCE_ROOT; }; - 1CC058DA0A44A210006FE533 /* navLeftPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = navLeftPressed.png; path = ../Images/navLeftPressed.png; sourceTree = SOURCE_ROOT; }; - 1CC058DB0A44A210006FE533 /* navRightDisabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = navRightDisabled.png; path = ../Images/navRightDisabled.png; sourceTree = SOURCE_ROOT; }; - 1CC058DC0A44A210006FE533 /* navRightNormal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = navRightNormal.png; path = ../Images/navRightNormal.png; sourceTree = SOURCE_ROOT; }; - 1CC058DD0A44A210006FE533 /* navRightPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = navRightPressed.png; path = ../Images/navRightPressed.png; sourceTree = SOURCE_ROOT; }; - 1CC058E00A44A210006FE533 /* programCounter.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = programCounter.tif; path = ../Images/programCounter.tif; sourceTree = SOURCE_ROOT; }; - 1CC058E10A44A210006FE533 /* splitterBar.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = splitterBar.tif; path = ../Images/splitterBar.tif; sourceTree = SOURCE_ROOT; }; - 1CC058E20A44A210006FE533 /* splitterDimple.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = splitterDimple.tif; path = ../Images/splitterDimple.tif; sourceTree = SOURCE_ROOT; }; - 1CC058E40A44A210006FE533 /* continue.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = continue.tif; path = ../Images/continue.tif; sourceTree = SOURCE_ROOT; }; - 1CC058E60A44A210006FE533 /* finishFunction.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = finishFunction.tif; sourceTree = "<group>"; }; - 1CC058E70A44A210006FE533 /* pause.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = pause.tif; path = ../Images/pause.tif; sourceTree = SOURCE_ROOT; }; - 1CC058E80A44A210006FE533 /* run.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = run.tif; path = ../Images/run.tif; sourceTree = SOURCE_ROOT; }; - 1CC058E90A44A210006FE533 /* step.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = step.tif; path = ../Images/step.tif; sourceTree = SOURCE_ROOT; }; - 1CC058EA0A44A210006FE533 /* stepOver.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = stepOver.tif; path = ../Images/stepOver.tif; sourceTree = SOURCE_ROOT; }; - 1CC058EB0A44A210006FE533 /* stop.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = stop.tif; sourceTree = "<group>"; }; - 1CC0596F0A44A485006FE533 /* toolbarBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = toolbarBackground.png; path = ../Images/toolbarBackground.png; sourceTree = SOURCE_ROOT; }; - 1CD434B10A4B86F800A007AB /* glossyHeaderPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = glossyHeaderPressed.png; path = ../Images/glossyHeaderPressed.png; sourceTree = SOURCE_ROOT; }; - 1CD8D54D0A4902B000E5677B /* DroseraLauncher.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DroseraLauncher.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 1CD8D54F0A4902B000E5677B /* LauncherInfo.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = LauncherInfo.plist; sourceTree = "<group>"; }; - 1CD8D5680A49041C00E5677B /* launcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = launcher.m; sourceTree = "<group>"; }; - 2A37F4B0FDCFA73011CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; - 2A37F4B5FDCFA73011CA2CEA /* Debugger.nib */ = {isa = PBXFileReference; explicitFileType = wrapper.nib; name = Debugger.nib; path = ../English.lproj/Debugger.nib; sourceTree = "<group>"; }; - 2A37F4B7FDCFA73011CA2CEA /* MainMenu.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = MainMenu.nib; path = ../English.lproj/MainMenu.nib; sourceTree = "<group>"; }; - 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; - 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; }; - 63D54BD60AE600560064C440 /* breakpointeditor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = breakpointeditor.png; path = ../Images/breakpointeditor.png; sourceTree = SOURCE_ROOT; }; - 63D54CBC0AE72C990064C440 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; }; - 63D54D7B0AE75CF10064C440 /* close_active.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = close_active.tif; path = ../Images/close_active.tif; sourceTree = SOURCE_ROOT; }; - 63D54D7C0AE75CF10064C440 /* close_hover.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = close_hover.tif; path = ../Images/close_hover.tif; sourceTree = SOURCE_ROOT; }; - 63D54D7D0AE75CF10064C440 /* close.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = close.tif; path = ../Images/close.tif; sourceTree = SOURCE_ROOT; }; - 63D54F770AE8280F0064C440 /* breakpointEditor.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; name = breakpointEditor.html; path = ../breakpointEditor.html; sourceTree = SOURCE_ROOT; }; - 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; }; - 8D15AC370486D014006FF6A4 /* Drosera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Drosera.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 957876760C9A221B008B6383 /* ServerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServerConnection.h; sourceTree = "<group>"; }; - 957876840C9A226A008B6383 /* ServerConnection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ServerConnection.mm; sourceTree = "<group>"; }; - 957879610C9B37BC008B6383 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config.h; path = ../config.h; sourceTree = SOURCE_ROOT; }; - 95B2A44E0C95EECD00850C41 /* DebuggerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebuggerClient.h; sourceTree = "<group>"; }; - 95B2A44F0C95EECD00850C41 /* DebuggerClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DebuggerClient.mm; sourceTree = "<group>"; }; - 95B955240C975C7500AAB83B /* DebuggerDocumentPlatform.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DebuggerDocumentPlatform.mm; sourceTree = "<group>"; }; - 95C906AF0C8E439200F9BE0F /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platform.h; path = ../ForwardingHeaders/wtf/Platform.h; sourceTree = SOURCE_ROOT; }; - D23E47C50C4460C600B7CD07 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = /System/Library/Frameworks/JavaScriptCore.framework; sourceTree = "<absolute>"; }; - D2D794ED0C4BED83004784F7 /* DebuggerDocument.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; name = DebuggerDocument.cpp; path = ../DebuggerDocument.cpp; sourceTree = SOURCE_ROOT; }; - D2D794EE0C4BED83004784F7 /* DebuggerDocument.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 30; name = DebuggerDocument.h; path = ../DebuggerDocument.h; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1CD8D54B0A4902B000E5677B /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1CD8D56C0A49043E00E5677B /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D15AC330486D014006FF6A4 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 63D54CBD0AE72C990064C440 /* Carbon.framework in Frameworks */, - 8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */, - D23E47C60C4460C600B7CD07 /* JavaScriptCore.framework in Frameworks */, - 1C27ABC60A413B720016ECF4 /* WebKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 63D54CBC0AE72C990064C440 /* Carbon.framework */, - 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */, - 1C27ABC50A413B720016ECF4 /* WebKit.framework */, - ); - name = "Linked Frameworks"; - sourceTree = "<group>"; - }; - 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */, - 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */, - 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = "<group>"; - }; - 19C28FB0FE9D524F11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D15AC370486D014006FF6A4 /* Drosera.app */, - 1CD8D54D0A4902B000E5677B /* DroseraLauncher.app */, - ); - name = Products; - sourceTree = "<group>"; - }; - 1CC058B70A44A210006FE533 /* Images */ = { - isa = PBXGroup; - children = ( - 63D54D7B0AE75CF10064C440 /* close_active.tif */, - 63D54D7C0AE75CF10064C440 /* close_hover.tif */, - 63D54D7D0AE75CF10064C440 /* close.tif */, - 63D54BD60AE600560064C440 /* breakpointeditor.png */, - 15CE854F0ADBEA610078A734 /* fileIcon.jpg */, - 15CE85500ADBEA610078A734 /* siteCollapsed.tif */, - 15CE85510ADBEA610078A734 /* siteExpanded.tif */, - 15CE85520ADBEA610078A734 /* siteIcon.tif */, - 15CE85530ADBEA610078A734 /* SourceArrowOpen.png */, - 1C6F84510A58EDFE004FCD89 /* console.png */, - 1C4FF7530A44F6320000D05D /* gutter.png */, - 1C4FF91F0A45F3520000D05D /* glossyHeader.png */, - 1CD434B10A4B86F800A007AB /* glossyHeaderPressed.png */, - 1C4FF94D0A45F5060000D05D /* popUpArrows.png */, - 1CC058B80A44A210006FE533 /* breakPoint.tif */, - 1CC058B90A44A210006FE533 /* breakPointDisabled.tif */, - 1CC058E00A44A210006FE533 /* programCounter.tif */, - 1C4FFE5C0A466F5D0000D05D /* programCounterBreakPoint.tif */, - 1C4FFE5D0A466F5D0000D05D /* programCounterBreakPointDisabled.tif */, - 1CC058CC0A44A210006FE533 /* glossyFooterFill.tif */, - 1CC058D80A44A210006FE533 /* navLeftDisabled.png */, - 1CC058D90A44A210006FE533 /* navLeftNormal.png */, - 1CC058DA0A44A210006FE533 /* navLeftPressed.png */, - 1CC058DB0A44A210006FE533 /* navRightDisabled.png */, - 1CC058DC0A44A210006FE533 /* navRightNormal.png */, - 1CC058DD0A44A210006FE533 /* navRightPressed.png */, - 1CC058E10A44A210006FE533 /* splitterBar.tif */, - 1CC058E20A44A210006FE533 /* splitterDimple.tif */, - 1CC058E60A44A210006FE533 /* finishFunction.tif */, - 1CC058E40A44A210006FE533 /* continue.tif */, - 1CC058E70A44A210006FE533 /* pause.tif */, - 1CC058E80A44A210006FE533 /* run.tif */, - 1CC058E90A44A210006FE533 /* step.tif */, - 1C6F83FE0A58E97D004FCD89 /* stepOut.tif */, - 1CC058EA0A44A210006FE533 /* stepOver.tif */, - 1CC058EB0A44A210006FE533 /* stop.tif */, - 1CC0596F0A44A485006FE533 /* toolbarBackground.png */, - 1C2632D10A4AF0A800EA7CD8 /* verticalSplitterBar.tiff */, - 1C2632D20A4AF0A800EA7CD8 /* verticalSplitterDimple.tiff */, - 1C2632D50A4AF0B800EA7CD8 /* SourceArrow.png */, - 1C2632D60A4AF0B800EA7CD8 /* SourceArrowBlank.png */, - 1C2632D90A4AF0D200EA7CD8 /* background_stripe.png */, - ); - name = Images; - path = ../Images; - sourceTree = "<group>"; - }; - 1CD8D53C0A49025D00E5677B /* Nightly Support */ = { - isa = PBXGroup; - children = ( - 1CD8D54F0A4902B000E5677B /* LauncherInfo.plist */, - 1CD8D5680A49041C00E5677B /* launcher.m */, - ); - name = "Nightly Support"; - sourceTree = "<group>"; - }; - 2A37F4AAFDCFA73011CA2CEA /* SafariBug */ = { - isa = PBXGroup; - children = ( - D23E47C50C4460C600B7CD07 /* JavaScriptCore.framework */, - 2A37F4ABFDCFA73011CA2CEA /* Classes */, - 2A37F4AFFDCFA73011CA2CEA /* Other Sources */, - 2A37F4B8FDCFA73011CA2CEA /* Resources */, - 1CD8D53C0A49025D00E5677B /* Nightly Support */, - 2A37F4C3FDCFA73011CA2CEA /* Frameworks */, - 19C28FB0FE9D524F11CA2CBB /* Products */, - ); - name = SafariBug; - sourceTree = "<group>"; - }; - 2A37F4ABFDCFA73011CA2CEA /* Classes */ = { - isa = PBXGroup; - children = ( - 63D54F770AE8280F0064C440 /* breakpointEditor.html */, - 1C6F84530A58EE06004FCD89 /* console.css */, - 1C6F84540A58EE06004FCD89 /* console.html */, - 1C6F861F0A599F65004FCD89 /* console.js */, - 1C74F1830A47DEE600FEC632 /* DebuggerApplication.h */, - 1C74F1840A47DEE600FEC632 /* DebuggerApplication.mm */, - 95B2A44E0C95EECD00850C41 /* DebuggerClient.h */, - 95B2A44F0C95EECD00850C41 /* DebuggerClient.mm */, - D2D794ED0C4BED83004784F7 /* DebuggerDocument.cpp */, - D2D794EE0C4BED83004784F7 /* DebuggerDocument.h */, - 95B955240C975C7500AAB83B /* DebuggerDocumentPlatform.mm */, - 1C27AC230A413D660016ECF4 /* debugger.js */, - 1C27AC1F0A413D2D0016ECF4 /* debugger.html */, - 1C4FF7430A44F5260000D05D /* debugger.css */, - 95C906AF0C8E439200F9BE0F /* Platform.h */, - 957876760C9A221B008B6383 /* ServerConnection.h */, - 957876840C9A226A008B6383 /* ServerConnection.mm */, - 1C74F0340A47BF8300FEC632 /* viewer.html */, - 1C74F03A0A47BFD600FEC632 /* viewer.css */, - ); - name = Classes; - sourceTree = "<group>"; - tabWidth = 8; - usesTabs = 0; - }; - 2A37F4AFFDCFA73011CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 957879610C9B37BC008B6383 /* config.h */, - 2A37F4B0FDCFA73011CA2CEA /* main.m */, - ); - name = "Other Sources"; - sourceTree = "<group>"; - tabWidth = 8; - usesTabs = 0; - }; - 2A37F4B8FDCFA73011CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 1C3487970A81208400101C5C /* Drosera.icns */, - 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */, - 2A37F4B4FDCFA73011CA2CEA /* Debugger.nib */, - 8D15AC360486D014006FF6A4 /* Info.plist */, - 1CC058B70A44A210006FE533 /* Images */, - ); - name = Resources; - sourceTree = "<group>"; - tabWidth = 8; - usesTabs = 0; - }; - 2A37F4C3FDCFA73011CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */, - 1058C7A8FEA54F5311CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1CD8D54C0A4902B000E5677B /* Drosera (Nightly Launcher) */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1CD8D5500A4902B000E5677B /* Build configuration list for PBXNativeTarget "Drosera (Nightly Launcher)" */; - buildPhases = ( - 1CD8D5490A4902B000E5677B /* Resources */, - 1CD8D54A0A4902B000E5677B /* Sources */, - 1CD8D54B0A4902B000E5677B /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 1CD8D5AA0A49104E00E5677B /* PBXTargetDependency */, - ); - name = "Drosera (Nightly Launcher)"; - productName = "Drosera (Nightly Launcher)"; - productReference = 1CD8D54D0A4902B000E5677B /* DroseraLauncher.app */; - productType = "com.apple.product-type.application"; - }; - 8D15AC270486D014006FF6A4 /* Drosera */ = { - isa = PBXNativeTarget; - buildConfigurationList = C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "Drosera" */; - buildPhases = ( - 8D15AC2B0486D014006FF6A4 /* Resources */, - 8D15AC300486D014006FF6A4 /* Sources */, - 8D15AC330486D014006FF6A4 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Drosera; - productInstallPath = "$(HOME)/Applications"; - productName = SafariBug; - productReference = 8D15AC370486D014006FF6A4 /* Drosera.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 2A37F4A9FDCFA73011CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "Drosera" */; - compatibilityVersion = "Xcode 2.4"; - hasScannedForEncodings = 1; - mainGroup = 2A37F4AAFDCFA73011CA2CEA /* SafariBug */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D15AC270486D014006FF6A4 /* Drosera */, - 1CD8D54C0A4902B000E5677B /* Drosera (Nightly Launcher) */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 1CD8D5490A4902B000E5677B /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1CD8D5A60A49102900E5677B /* Drosera.app in Resources */, - 5D2C827F0A816BA700C193FD /* Drosera.icns in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D15AC2B0486D014006FF6A4 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D15AC2E0486D014006FF6A4 /* Debugger.nib in Resources */, - 1C3487980A81208400101C5C /* Drosera.icns in Resources */, - 8D15AC2D0486D014006FF6A4 /* MainMenu.nib in Resources */, - 1C2632D70A4AF0B800EA7CD8 /* SourceArrow.png in Resources */, - 1C2632D80A4AF0B800EA7CD8 /* SourceArrowBlank.png in Resources */, - 15CE85580ADBEA620078A734 /* SourceArrowOpen.png in Resources */, - 1C2632DA0A4AF0D200EA7CD8 /* background_stripe.png in Resources */, - 1CC058EE0A44A210006FE533 /* breakPoint.tif in Resources */, - 1CC058EF0A44A210006FE533 /* breakPointDisabled.tif in Resources */, - 63D54F780AE8280F0064C440 /* breakpointEditor.html in Resources */, - 63D54BD70AE600560064C440 /* breakpointeditor.png in Resources */, - 63D54D800AE75CF10064C440 /* close.tif in Resources */, - 63D54D7E0AE75CF10064C440 /* close_active.tif in Resources */, - 63D54D7F0AE75CF10064C440 /* close_hover.tif in Resources */, - 1C6F84550A58EE06004FCD89 /* console.css in Resources */, - 1C6F84560A58EE06004FCD89 /* console.html in Resources */, - 1C6F86730A59A18B004FCD89 /* console.js in Resources */, - 1C6F84520A58EDFE004FCD89 /* console.png in Resources */, - 1CC0591A0A44A210006FE533 /* continue.tif in Resources */, - 1C4FF7440A44F52C0000D05D /* debugger.css in Resources */, - 1C27AC200A413D2D0016ECF4 /* debugger.html in Resources */, - 1C27B1260A421D870016ECF4 /* debugger.js in Resources */, - 15CE85540ADBEA620078A734 /* fileIcon.jpg in Resources */, - 1CC059020A44A210006FE533 /* glossyFooterFill.tif in Resources */, - 1C4FF9210A45F3520000D05D /* glossyHeader.png in Resources */, - 1CD434B20A4B86F800A007AB /* glossyHeaderPressed.png in Resources */, - 1C4FF7540A44F6320000D05D /* gutter.png in Resources */, - 1CC0590E0A44A210006FE533 /* navLeftDisabled.png in Resources */, - 1CC0590F0A44A210006FE533 /* navLeftNormal.png in Resources */, - 1CC059100A44A210006FE533 /* navLeftPressed.png in Resources */, - 1CC059110A44A210006FE533 /* navRightDisabled.png in Resources */, - 1CC059120A44A210006FE533 /* navRightNormal.png in Resources */, - 1CC059130A44A210006FE533 /* navRightPressed.png in Resources */, - 1CC0591D0A44A210006FE533 /* pause.tif in Resources */, - 1C4FF94E0A45F5060000D05D /* popUpArrows.png in Resources */, - 1CC059160A44A210006FE533 /* programCounter.tif in Resources */, - 1C4FFE5E0A466F5D0000D05D /* programCounterBreakPoint.tif in Resources */, - 1C4FFE5F0A466F5D0000D05D /* programCounterBreakPointDisabled.tif in Resources */, - 1CC0591E0A44A210006FE533 /* run.tif in Resources */, - 15CE85550ADBEA620078A734 /* siteCollapsed.tif in Resources */, - 15CE85560ADBEA620078A734 /* siteExpanded.tif in Resources */, - 15CE85570ADBEA620078A734 /* siteIcon.tif in Resources */, - 1CC059170A44A210006FE533 /* splitterBar.tif in Resources */, - 1CC059180A44A210006FE533 /* splitterDimple.tif in Resources */, - 1CC0591F0A44A210006FE533 /* step.tif in Resources */, - 1C6F83FF0A58E97D004FCD89 /* stepOut.tif in Resources */, - 1CC059200A44A210006FE533 /* stepOver.tif in Resources */, - 1CC059700A44A485006FE533 /* toolbarBackground.png in Resources */, - 1C2632D30A4AF0A800EA7CD8 /* verticalSplitterBar.tiff in Resources */, - 1C2632D40A4AF0A800EA7CD8 /* verticalSplitterDimple.tiff in Resources */, - 1C74F04B0A47BFE800FEC632 /* viewer.css in Resources */, - 1C74F0350A47BF8300FEC632 /* viewer.html in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1CD8D54A0A4902B000E5677B /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1CD8D5690A49041C00E5677B /* launcher.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 8D15AC300486D014006FF6A4 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1C74F1850A47DEE600FEC632 /* DebuggerApplication.mm in Sources */, - 95B2A4500C95EECD00850C41 /* DebuggerClient.mm in Sources */, - D2D794FD0C4BED83004784F7 /* DebuggerDocument.cpp in Sources */, - 95B955250C975C7500AAB83B /* DebuggerDocumentPlatform.mm in Sources */, - 957876850C9A226A008B6383 /* ServerConnection.mm in Sources */, - 8D15AC320486D014006FF6A4 /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 1CD8D5AA0A49104E00E5677B /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 8D15AC270486D014006FF6A4 /* Drosera */; - targetProxy = 1CD8D5A90A49104E00E5677B /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 2A37F4B4FDCFA73011CA2CEA /* Debugger.nib */ = { - isa = PBXVariantGroup; - children = ( - 2A37F4B5FDCFA73011CA2CEA /* Debugger.nib */, - ); - name = Debugger.nib; - sourceTree = "<group>"; - }; - 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */ = { - isa = PBXVariantGroup; - children = ( - 2A37F4B7FDCFA73011CA2CEA /* MainMenu.nib */, - ); - name = MainMenu.nib; - sourceTree = "<group>"; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 1CD8D5510A4902B000E5677B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DEBUGGING_SYMBOLS = full; - GCC_DYNAMIC_NO_PIC = NO; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - INFOPLIST_FILE = LauncherInfo.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = DroseraLauncher; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 1CD8D5520A4902B000E5677B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - DEPLOYMENT_POSTPROCESSING = YES; - GCC_DEBUGGING_SYMBOLS = full; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - INFOPLIST_FILE = LauncherInfo.plist; - INSTALL_PATH = "$(HOME)/Applications"; - PRODUCT_NAME = DroseraLauncher; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - C05733C808A9546B00998B17 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREFIX_HEADER = ""; - HEADER_SEARCH_PATHS = ../ForwardingHeaders; - INFOPLIST_FILE = Info.plist; - PRODUCT_NAME = Drosera; - USER_HEADER_SEARCH_PATHS = ../ForwardingHeaders/; - VALID_ARCHS = "ppc7400 ppc970 i386 ppc"; - WRAPPER_EXTENSION = app; - ZERO_LINK = NO; - }; - name = Debug; - }; - C05733C908A9546B00998B17 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PREFIX_HEADER = ""; - HEADER_SEARCH_PATHS = ../ForwardingHeaders; - INFOPLIST_FILE = Info.plist; - PRODUCT_NAME = Drosera; - USER_HEADER_SEARCH_PATHS = ../ForwardingHeaders/; - VALID_ARCHS = "ppc7400 ppc970 i386 ppc"; - WRAPPER_EXTENSION = app; - ZERO_LINK = NO; - }; - name = Release; - }; - C05733CC08A9546B00998B17 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - USER_HEADER_SEARCH_PATHS = ../ForwardingHeaders/; - }; - name = Debug; - }; - C05733CD08A9546B00998B17 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - USER_HEADER_SEARCH_PATHS = ../ForwardingHeaders/; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1CD8D5500A4902B000E5677B /* Build configuration list for PBXNativeTarget "Drosera (Nightly Launcher)" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1CD8D5510A4902B000E5677B /* Debug */, - 1CD8D5520A4902B000E5677B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C05733C708A9546B00998B17 /* Build configuration list for PBXNativeTarget "Drosera" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C05733C808A9546B00998B17 /* Debug */, - C05733C908A9546B00998B17 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "Drosera" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C05733CC08A9546B00998B17 /* Debug */, - C05733CD08A9546B00998B17 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 2A37F4A9FDCFA73011CA2CEA /* Project object */; -} diff --git a/WebKitTools/Drosera/mac/Info.plist b/WebKitTools/Drosera/mac/Info.plist deleted file mode 100644 index 536f5a3..0000000 --- a/WebKitTools/Drosera/mac/Info.plist +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleName</key> - <string>${PRODUCT_NAME}</string> - <key>CFBundleExecutable</key> - <string>${EXECUTABLE_NAME}</string> - <key>CFBundleGetInfoString</key> - <string>420+, Copyright 2006 Apple Computer, Inc.</string> - <key>CFBundleIdentifier</key> - <string>org.webkit.drosera</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>CFBundleIconFile</key> - <string>Drosera</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>NSMainNibFile</key> - <string>MainMenu</string> - <key>NSPrincipalClass</key> - <string>NSApplication</string> -</dict> -</plist> diff --git a/WebKitTools/Drosera/mac/LauncherInfo.plist b/WebKitTools/Drosera/mac/LauncherInfo.plist deleted file mode 100644 index 12c4472..0000000 --- a/WebKitTools/Drosera/mac/LauncherInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>${EXECUTABLE_NAME}</string> - <key>CFBundleIconFile</key> - <string>Drosera</string> - <key>CFBundleIdentifier</key> - <string>org.webkit.drosera.launcher</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>VERSION</string> - <key>NSMainNibFile</key> - <string>MainMenu</string> - <key>NSPrincipalClass</key> - <string>NSApplication</string> -</dict> -</plist> diff --git a/WebKitTools/Drosera/mac/Makefile b/WebKitTools/Drosera/mac/Makefile deleted file mode 100644 index 058c21e..0000000 --- a/WebKitTools/Drosera/mac/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -SCRIPTS_PATH = ../../Scripts -include ../../../Makefile.shared diff --git a/WebKitTools/Drosera/mac/ServerConnection.h b/WebKitTools/Drosera/mac/ServerConnection.h deleted file mode 100644 index f2b1303..0000000 --- a/WebKitTools/Drosera/mac/ServerConnection.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006, 2007 Vladimir Olexa (vladimir.olexa@gmail.com) - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -@class DebuggerClient; -@class NSString; -@class WebScriptCallFrame; -@class WebScriptDebugServer; - -@interface ServerConnection : NSObject <WebScriptDebugListener> -{ - NSString *currentServerName; - WebScriptCallFrame *currentFrame; - id<WebScriptDebugServer> server; - JSGlobalContextRef globalContext; -} - -- (id)initWithServerName:(NSString *)serverName; -- (void)setGlobalContext:(JSGlobalContextRef)globalContextRef; -- (void)pause; -- (void)resume; -- (void)stepInto; -- (void)switchToServerNamed:(NSString *)name; -- (void)applicationTerminating:(NSNotification *)notifiction; -- (WebScriptCallFrame *)currentFrame; -- (NSString *)currentServerName; - -@end diff --git a/WebKitTools/Drosera/mac/ServerConnection.mm b/WebKitTools/Drosera/mac/ServerConnection.mm deleted file mode 100644 index 8444ee9..0000000 --- a/WebKitTools/Drosera/mac/ServerConnection.mm +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006, 2007 Vladimir Olexa (vladimir.olexa@gmail.com) - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "ServerConnection.h" - -#import "DebuggerDocument.h" - -#import <JavaScriptCore/JSContextRef.h> -#import <JavaScriptCore/JSRetainPtr.h> -#import <JavaScriptCore/JSStringRefCF.h> -#import <JavaScriptCore/RetainPtr.h> - -@implementation ServerConnection - -#pragma mark - -- (id)initWithServerName:(NSString *)serverName; -{ - if (!(self = [super init])) - return nil; - - [self switchToServerNamed:serverName]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationTerminating:) name:NSApplicationWillTerminateNotification object:nil]; - - return self; -} - -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationWillTerminateNotification object:nil]; - - [currentServerName release]; - [currentFrame release]; - [server release]; - JSGlobalContextRelease(globalContext); - [super dealloc]; -} - -- (void)setGlobalContext:(JSGlobalContextRef)globalContextRef -{ - globalContext = JSGlobalContextRetain(globalContextRef); -} - -#pragma mark - -#pragma mark Pause & Step - -- (void)pause -{ - if ([[(NSDistantObject *)server connectionForProxy] isValid]) - [server pause]; - [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; -} - -- (void)resume -{ - if ([[(NSDistantObject *)server connectionForProxy] isValid]) - [server resume]; -} - -- (void)stepInto -{ - if ([[(NSDistantObject *)server connectionForProxy] isValid]) - [server step]; -} - -#pragma mark - -#pragma mark Connection Handling - -- (void)switchToServerNamed:(NSString *)name -{ - if (server) { - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSConnectionDidDieNotification object:[(NSDistantObject *)server connectionForProxy]]; - if ([[(NSDistantObject *)server connectionForProxy] isValid]) { - [server removeListener:self]; - [self resume]; - } - } - - id<WebScriptDebugServer> oldServer = server; - server = [name length] ? [[NSConnection rootProxyForConnectionWithRegisteredName:name host:nil] retain] : nil; - [oldServer release]; - - NSString *oldServerName = currentServerName; - currentServerName = [name retain]; - [oldServerName release]; - - if (server) { - @try { - [(NSDistantObject *)server setProtocolForProxy:@protocol(WebScriptDebugServer)]; - [server addListener:self]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(serverConnectionDidDie:) name:NSConnectionDidDieNotification object:[(NSDistantObject *)server connectionForProxy]]; - } @catch (NSException *exception) { - [currentServerName release]; - currentServerName = nil; - [server release]; - server = nil; - } - } -} - -- (void)applicationTerminating:(NSNotification *)notifiction -{ - if (server && [[(NSDistantObject *)server connectionForProxy] isValid]) { - [self switchToServerNamed:nil]; - // call the runloop for a while to make sure our removeListener: is sent to the server - [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.25]]; - } -} - -- (void)serverConnectionDidDie:(NSNotification *)notifiction -{ - [self switchToServerNamed:nil]; -} - -#pragma mark - -#pragma mark Debug Listener Callbacks - -- (void)webView:(WebView *)view didLoadMainResourceForDataSource:(WebDataSource *)dataSource -{ - // Get document source - NSString *documentSource = nil; - id <WebDocumentRepresentation> rep = [dataSource representation]; - if ([rep canProvideDocumentSource]) - documentSource = [rep documentSource]; - - if (!documentSource) - return; - - JSRetainPtr<JSStringRef> documentSourceJS(Adopt, JSStringCreateWithCFString((CFStringRef)documentSource)); - - // Get URL - NSString *url = [[[dataSource response] URL] absoluteString]; - JSRetainPtr<JSStringRef> urlJS(Adopt, JSStringCreateWithCFString(url ? (CFStringRef)url : CFSTR(""))); - - DebuggerDocument::updateFileSource(globalContext, documentSourceJS.get(), urlJS.get()); -} - -- (void)webView:(WebView *)view didParseSource:(NSString *)source baseLineNumber:(unsigned)baseLine fromURL:(NSURL *)url sourceId:(int)sid forWebFrame:(WebFrame *)webFrame -{ - if (!globalContext) - return; - - RetainPtr<NSString> sourceCopy = source; - if (!sourceCopy.get()) - return; - - RetainPtr<NSString> documentSourceCopy; - RetainPtr<NSString> urlCopy = [url absoluteString]; - - WebDataSource *dataSource = [webFrame dataSource]; - if (!url || [[[dataSource response] URL] isEqual:url]) { - id <WebDocumentRepresentation> rep = [dataSource representation]; - if ([rep canProvideDocumentSource]) - documentSourceCopy = [rep documentSource]; - if (!urlCopy.get()) - urlCopy = [[[dataSource response] URL] absoluteString]; - } - - JSRetainPtr<JSStringRef> sourceCopyJS(Adopt, JSStringCreateWithCFString((CFStringRef)sourceCopy.get())); // We checked for NULL earlier. - JSRetainPtr<JSStringRef> documentSourceCopyJS(Adopt, JSStringCreateWithCFString(documentSourceCopy.get() ? (CFStringRef)documentSourceCopy.get() : CFSTR(""))); - JSRetainPtr<JSStringRef> urlCopyJS(Adopt, JSStringCreateWithCFString(urlCopy.get() ? (CFStringRef)urlCopy.get() : CFSTR(""))); - JSValueRef sidJS = JSValueMakeNumber(globalContext, sid); - JSValueRef baseLineJS = JSValueMakeNumber(globalContext, baseLine); - - DebuggerDocument::didParseScript(globalContext, sourceCopyJS.get(), documentSourceCopyJS.get(), urlCopyJS.get(), sidJS, baseLineJS); -} - -- (void)webView:(WebView *)view failedToParseSource:(NSString *)source baseLineNumber:(unsigned)baseLine fromURL:(NSURL *)url withError:(NSError *)error forWebFrame:(WebFrame *)webFrame -{ -} - -- (void)webView:(WebView *)view didEnterCallFrame:(WebScriptCallFrame *)frame sourceId:(int)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame -{ - if (!globalContext) - return; - - id old = currentFrame; - currentFrame = [frame retain]; - [old release]; - - JSValueRef sidJS = JSValueMakeNumber(globalContext, sid); - JSValueRef linenoJS = JSValueMakeNumber(globalContext, lineno); - - DebuggerDocument::didEnterCallFrame(globalContext, sidJS, linenoJS); -} - -- (void)webView:(WebView *)view willExecuteStatement:(WebScriptCallFrame *)frame sourceId:(int)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame -{ - if (!globalContext) - return; - - JSValueRef sidJS = JSValueMakeNumber(globalContext, sid); - JSValueRef linenoJS = JSValueMakeNumber(globalContext, lineno); - - DebuggerDocument::willExecuteStatement(globalContext, sidJS, linenoJS); -} - -- (void)webView:(WebView *)view willLeaveCallFrame:(WebScriptCallFrame *)frame sourceId:(int)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame -{ - if (!globalContext) - return; - - JSValueRef sidJS = JSValueMakeNumber(globalContext, sid); - JSValueRef linenoJS = JSValueMakeNumber(globalContext, lineno); - - DebuggerDocument::willLeaveCallFrame(globalContext, sidJS, linenoJS); - - id old = currentFrame; - currentFrame = [[frame caller] retain]; - [old release]; -} - -- (void)webView:(WebView *)view exceptionWasRaised:(WebScriptCallFrame *)frame sourceId:(int)sid line:(int)lineno forWebFrame:(WebFrame *)webFrame -{ - if (!globalContext) - return; - - JSValueRef sidJS = JSValueMakeNumber(globalContext, sid); - JSValueRef linenoJS = JSValueMakeNumber(globalContext, lineno); - - DebuggerDocument::exceptionWasRaised(globalContext, sidJS, linenoJS); -} - -#pragma mark - -#pragma mark Stack & Variables - -- (WebScriptCallFrame *)currentFrame -{ - return currentFrame; -} - -#pragma mark - -#pragma mark Server Detection Callbacks - --(NSString *)currentServerName -{ - return currentServerName; -} -@end diff --git a/WebKitTools/Drosera/mac/launcher.m b/WebKitTools/Drosera/mac/launcher.m deleted file mode 100644 index 04c5ccb..0000000 --- a/WebKitTools/Drosera/mac/launcher.m +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 <Cocoa/Cocoa.h> -#import <CoreFoundation/CoreFoundation.h> - -void displayErrorAndQuit(NSString *title, NSString *message) -{ - NSApplicationLoad(); - NSRunCriticalAlertPanel(title, message, @"Quit", nil, nil); - exit(0); -} - -void checkMacOSXVersion() -{ - long versionNumber = 0; - OSErr error = Gestalt(gestaltSystemVersion, &versionNumber); - if (error != noErr || versionNumber < 0x1040) - displayErrorAndQuit(@"Mac OS X 10.4 is Required", @"Nightly builds of Drosera require Mac OS X 10.4 or newer."); -} - -static void myExecve(NSString *executable, NSArray *args, NSDictionary *environment) -{ - char **argv = (char **)calloc(sizeof(char *), [args count] + 1); - char **env = (char **)calloc(sizeof(char *), [environment count] + 1); - - NSEnumerator *e = [args objectEnumerator]; - NSString *s; - int i = 0; - while (s = [e nextObject]) - argv[i++] = (char *) [s UTF8String]; - - e = [environment keyEnumerator]; - i = 0; - while (s = [e nextObject]) - env[i++] = (char *) [[NSString stringWithFormat:@"%@=%@", s, [environment objectForKey:s]] UTF8String]; - - execve([executable fileSystemRepresentation], argv, env); -} - -int main(int argc, char *argv[]) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - checkMacOSXVersion(); - - CFURLRef webkitURL = nil; - OSStatus err = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR("org.webkit.nightly.WebKit"), nil, nil, &webkitURL); - if (err != noErr) - displayErrorAndQuit(@"Unable to locate WebKit.app", @"Drosera nightly builds require WebKit.app to run. Please check that it is available and then try again."); - - NSBundle *webKitAppBundle = [NSBundle bundleWithPath:[(NSURL *)webkitURL path]]; - NSString *frameworkPath = [webKitAppBundle resourcePath]; - NSBundle *droseraBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"Drosera" ofType:@"app"]]; - NSString *executablePath = [droseraBundle executablePath]; - NSString *pathToEnablerLib = [webKitAppBundle pathForResource:@"WebKitNightlyEnabler" ofType:@"dylib"]; - - NSMutableArray *arguments = [NSMutableArray arrayWithObjects:executablePath, @"-WebKitDeveloperExtras", @"YES", nil]; - - while (*++argv) - [arguments addObject:[NSString stringWithUTF8String:*argv]]; - - NSDictionary *environment = [NSDictionary dictionaryWithObjectsAndKeys:frameworkPath, @"DYLD_FRAMEWORK_PATH", - @"YES", @"WEBKIT_UNSET_DYLD_FRAMEWORK_PATH", pathToEnablerLib, @"DYLD_INSERT_LIBRARIES", - [[NSBundle mainBundle] executablePath], @"WebKitAppPath", nil]; - - myExecve(executablePath, arguments, environment); - - char *error = strerror(errno); - NSString *errorMessage = [NSString stringWithFormat:@"Launching Drosera at %@ failed with the error '%s' (%d)", [(NSURL *)webkitURL path], error, errno]; - displayErrorAndQuit(@"Unable to launch Drosera", errorMessage); - - [pool release]; - return 0; -} diff --git a/WebKitTools/Drosera/mac/main.m b/WebKitTools/Drosera/mac/main.m deleted file mode 100644 index 2c09761..0000000 --- a/WebKitTools/Drosera/mac/main.m +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#include <Cocoa/Cocoa.h> - -int main(int argc, char *argv[]) -{ - return NSApplicationMain(argc, (const char **) argv); -} diff --git a/WebKitTools/Drosera/viewer.css b/WebKitTools/Drosera/viewer.css deleted file mode 100644 index aaac7a9..0000000 --- a/WebKitTools/Drosera/viewer.css +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -body { background-image: url(gutter.png); background-repeat: repeat-y; margin: 0; padding: 0; } -img { padding: 0; margin: 0; } - -table { border-spacing: 0; padding: 0; margin: 0; width: 100%; } -.gutter { -webkit-user-select: none; cursor: default; width: 32px; min-width: 32px; max-width: 32px; -webkit-box-sizing: border-box; font-size: 9px; font-family: Helvetica; color: #888; text-align: right; padding-right: 4px; } -.source { font-family: Monaco, monospace; white-space: pre; padding-left: 4px; padding-right: 4px; font-size: 11px; line-height: 14px; } - -.keyword { color: #8b0053 } -.string { color: #a00000 } -.number { color: #2900ff } -.comment { color: #007215 } - -td.gutter:after { content: attr(title); -webkit-user-select: none; } - -.breakpoint td.gutter, .current td.gutter { padding-right: 1px; vertical-align: top; } -.breakpoint td.gutter:after { content: url(breakPoint.tif); -webkit-user-select: none; vertical-align: middle; } -.breakpoint.disabled td.gutter:after { content: url(breakPointDisabled.tif); } - -.current td.gutter:after { content: url(programCounter.tif); -webkit-user-select: none; vertical-align: middle; } -.current.breakpoint td.gutter:after { content: url(programCounterBreakPoint.tif); } -.current.breakpoint.disabled td.gutter:after { content: url(programCounterBreakPointDisabled.tif); } -.current td.source { background-color: #abbffe; outline: 1px solid #406ffd; } - -#breakpointDrag { - position: absolute; - top: 0; - left: 0; - z-index: 100; - -webkit-user-select: none; - cursor: default; -} - -.editor { - top: -2px; - left: -2px; - margin-bottom: -2px; - position: relative; - min-width: 350px; - max-width: 500px; - border-width: 20px 12px 11px 36px; - border-color: transparent; - border-style: solid; - -webkit-border-image: url(breakpointeditor.png) 20 12 11 36; - font-size: 11px; - font-family: 'Lucida Grande', sans-serif; -} - -.editor .top { - position: absolute; - height: 20px; - -webkit-border-top-right-radius: 6px; - background-color: rgb(0, 134, 226); - border-bottom: 2px solid rgb(0, 110, 208); - top: -4px; - right: -5px; - left: -5px; - padding-left: 5px; - padding-right: 5px; -} - -.editor .bottom { - position: relative; - padding: 5px 0; - top: 20px; -} - -.editor .top label { - margin-left: 15px; -} - -.editor span.hitCounter { - margin-right: 4px; - margin-top: 1px; - padding-right: 2px; - padding-left: 2px; -} - -.editor select.editorDropdown { - margin-top: -1px; -} - -.editor div.condition { - position: relative; - background-color: white; - -webkit-user-modify: read-write-plaintext-only; - -webkit-nbsp-mode: space; - -webkit-line-break: after-white-space; - word-wrap: break-word; - outline: none; - font-family: monospace; - font-size: 10px; - line-height: 10px; - padding: 3px; - border: 1px solid darkgray; - top: -15px; - left: 65px; - margin-right: 65px; -} - -.editor input.close { - margin:0px; - margin-right: -4px; - float: right; - background-color: transparent; - background-image:url("close.tif"); - background-repeat: no-repeat; - height: 13px; - width: 12px; - border: none; -} - -.editor input.close:active { - background-image:url("close_active.tif"); -} - -.editor input.close:hover { - background-image:url("close_hover.tif"); -} diff --git a/WebKitTools/Drosera/viewer.html b/WebKitTools/Drosera/viewer.html deleted file mode 100644 index fb4a21c..0000000 --- a/WebKitTools/Drosera/viewer.html +++ /dev/null @@ -1,48 +0,0 @@ -<!-- -Copyright (C) 2006 Apple Computer, 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. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE 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 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. ---> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <script type="text/javascript"> - Element.prototype.firstParentWithClass = function(className) { - var node = this.parentNode; - while(node.className.indexOf(className) == -1) { - if (node == document) - return null; - node = node.parentNode; - } - return node; - } - </script> - <style type="text/css"> - @import "viewer.css"; - </style> -</head> -<body></body> -</html> diff --git a/WebKitTools/Drosera/win/BaseDelegate.h b/WebKitTools/Drosera/win/BaseDelegate.h deleted file mode 100644 index eb43293..0000000 --- a/WebKitTools/Drosera/win/BaseDelegate.h +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef BaseDelegate_H -#define BaseDelegate_H - -#include <WebKit/IWebFrameLoadDelegate.h> -#include <WebKit/IWebUIDelegate.h> - -struct IDataObject; -struct IPropertyBag; -struct IWebView; -struct IWebFrame; -struct IWebError; -struct IWebURLRequest; -struct IWebOpenPanelResultListener; - -class BaseDelegate : public IWebFrameLoadDelegate, public IWebUIDelegate { -public: - // IUnknown - virtual HRESULT STDMETHODCALLTYPE QueryInterface( - /* [in] */ REFIID, - /* [retval][out] */ void**) - { return E_NOTIMPL; }; - - // IWebFrameLoadDelegate - virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame( - /* [in] */ IWebView*, - /* [in] */ IWebFrame*) { return E_NOTIMPL; }; - - virtual HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable( - /* [in] */ IWebView*, - /* [in] */ JSContextRef, - /* [in] */ JSObjectRef) { return E_NOTIMPL; }; - - virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame( - /* [in] */ IWebView*, - /* [in] */ IWebFrame*) { return E_NOTIMPL; }; - - virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame( - /* [in] */ IWebView*, - /* [in] */ IWebFrame*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError( - /* [in] */ IWebView*, - /* [in] */ IWebError*, - /* [in] */ IWebFrame*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame( - /* [in] */ IWebView*, - /* [in] */ IWebFrame*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE didReceiveTitle( - /* [in] */ IWebView*, - /* [in] */ BSTR, - /* [in] */ IWebFrame*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE didReceiveIcon( - /* [in] */ IWebView*, - /* [in] */ OLE_HANDLE, - /* [in] */ IWebFrame*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError( - /* [in] */ IWebView*, - /* [in] */ IWebError*, - /* [in] */ IWebFrame*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame( - /* [in] */ IWebView*, - /* [in] */ IWebFrame*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL( - /* [in] */ IWebView*, - /* [in] */ BSTR, - /* [in] */ double /*delaySeconds*/, - /* [in] */ DATE, - /* [in] */ IWebFrame*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame( - /* [in] */ IWebView*, - /* [in] */ IWebFrame*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE willCloseFrame( - /* [in] */ IWebView*, - /* [in] */ IWebFrame*) { return E_NOTIMPL; } - - // IWebUIDelegate - virtual HRESULT STDMETHODCALLTYPE createWebViewWithRequest( - /* [in] */ IWebView*, - /* [in] */ IWebURLRequest*, - /* [retval][out] */ IWebView**) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE webViewShow( - /* [in] */ IWebView*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE webViewClose( - /* [in] */ IWebView*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE webViewFocus( - /* [in] */ IWebView*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE webViewUnfocus( - /* [in] */ IWebView*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE webViewFirstResponder( - /* [in] */ IWebView*, - /* [retval][out] */ OLE_HANDLE*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE makeFirstResponder( - /* [in] */ IWebView*, - /* [in] */ OLE_HANDLE) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE setStatusText( - /* [in] */ IWebView*, - /* [in] */ BSTR) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE webViewStatusText( - /* [in] */ IWebView*, - /* [retval][out] */ BSTR*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE webViewAreToolbarsVisible( - /* [in] */ IWebView*, - /* [retval][out] */ BOOL*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE setToolbarsVisible( - /* [in] */ IWebView*, - /* [in] */ BOOL) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE webViewIsStatusBarVisible( - /* [in] */ IWebView*, - /* [retval][out] */ BOOL*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE setStatusBarVisible( - /* [in] */ IWebView*, - /* [in] */ BOOL) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE webViewIsResizable( - /* [in] */ IWebView*, - /* [retval][out] */ BOOL*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE setResizable( - /* [in] */ IWebView*, - /* [in] */ BOOL) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE setFrame( - /* [in] */ IWebView*, - /* [in] */ RECT*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE webViewFrame( - /* [in] */ IWebView*, - /* [retval][out] */ RECT*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE setContentRect( - /* [in] */ IWebView*, - /* [in] */ RECT*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE webViewContentRect( - /* [in] */ IWebView*, - /* [retval][out] */ RECT*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE runJavaScriptAlertPanelWithMessage( - /* [in] */ IWebView*, - /* [in] */ BSTR) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE runJavaScriptConfirmPanelWithMessage( - /* [in] */ IWebView*, - /* [in] */ BSTR, - /* [retval][out] */ BOOL*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE runJavaScriptTextInputPanelWithPrompt( - /* [in] */ IWebView*, - /* [in] */ BSTR /*message*/, - /* [in] */ BSTR /*defaultText*/, - /* [retval][out] */ BSTR*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE runBeforeUnloadConfirmPanelWithMessage( - /* [in] */ IWebView*, - /* [in] */ BSTR /*message*/, - /* [in] */ IWebFrame* /*initiatedByFrame*/, - /* [retval][out] */ BOOL*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE runOpenPanelForFileButtonWithResultListener( - /* [in] */ IWebView*, - /* [in] */ IWebOpenPanelResultListener*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE mouseDidMoveOverElement( - /* [in] */ IWebView*, - /* [in] */ IPropertyBag*, - /* [in] */ UINT /*modifierFlags*/) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE contextMenuItemsForElement( - /* [in] */ IWebView*, - /* [in] */ IPropertyBag*, - /* [in] */ OLE_HANDLE, - /* [retval][out] */ OLE_HANDLE*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE validateUserInterfaceItem( - /* [in] */ IWebView*, - /* [in] */ UINT, - /* [in] */ BOOL, - /* [retval][out] */ BOOL*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE shouldPerformAction( - /* [in] */ IWebView*, - /* [in] */ UINT /*itemCommandID*/, - /* [in] */ UINT /*sender*/) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE dragDestinationActionMaskForDraggingInfo( - /* [in] */ IWebView*, - /* [in] */ IDataObject*, - /* [retval][out] */ WebDragDestinationAction*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE willPerformDragDestinationAction( - /* [in] */ IWebView*, - /* [in] */ WebDragDestinationAction, - /* [in] */ IDataObject*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE dragSourceActionMaskForPoint( - /* [in] */ IWebView*, - /* [in] */ LPPOINT, - /* [retval][out] */ WebDragSourceAction*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE willPerformDragSourceAction( - /* [in] */ IWebView*, - /* [in] */ WebDragSourceAction, - /* [in] */ LPPOINT, - /* [in] */ IDataObject*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE contextMenuItemSelected( - /* [in] */ IWebView*, - /* [in] */ void* /*item*/, - /* [in] */ IPropertyBag*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE hasCustomMenuImplementation( - /* [retval][out] */ BOOL*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE trackCustomPopupMenu( - /* [in] */ IWebView*, - /* [in] */ OLE_HANDLE, - /* [in] */ LPPOINT) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE measureCustomMenuItem( - /* [in] */ IWebView*, - /* [in] */ void* /*measureItem*/) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE drawCustomMenuItem( - /* [in] */ IWebView*, - /* [in] */ void* /*drawItem*/) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE addCustomMenuDrawingData( - /* [in] */ IWebView*, - /* [in] */ OLE_HANDLE) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE cleanUpCustomMenuDrawingData( - /* [in] */ IWebView*, - /* [in] */ OLE_HANDLE) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE canTakeFocus( - /* [in] */ IWebView*, - /* [in] */ BOOL /*forward*/, - /* [out] */ BOOL*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE takeFocus( - /* [in] */ IWebView*, - /* [in] */ BOOL /*forward*/) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE registerUndoWithTarget( - /* [in] */ IWebUndoTarget*, - /* [in] */ BSTR /*actionName*/, - /* [in] */ IUnknown* /*actionArg*/) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE removeAllActionsWithTarget( - /* [in] */ IWebUndoTarget*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE setActionTitle( - /* [in] */ BSTR) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE undo( void) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE redo( void) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE canUndo( - /* [retval][out] */ BOOL*) { return E_NOTIMPL; } - - virtual HRESULT STDMETHODCALLTYPE canRedo( - /* [retval][out] */ BOOL*) { return E_NOTIMPL; } -}; - -#endif //BaseDelegate_H diff --git a/WebKitTools/Drosera/win/DebuggerClient.cpp b/WebKitTools/Drosera/win/DebuggerClient.cpp deleted file mode 100644 index b15c61d..0000000 --- a/WebKitTools/Drosera/win/DebuggerClient.cpp +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Copyright (C) 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ -#include "config.h" -#include "DebuggerClient.h" - -#include "DebuggerDocument.h" -#include "Drosera.h" -#include "ServerConnection.h" - -#include <WebKit/ForEachCoClass.h> -#include <WebKit/IWebView.h> -#include <WebKit/IWebViewPrivate.h> -#include <WebKit/WebKit.h> -#include <JavaScriptCore/JSContextRef.h> - -static LPCTSTR kConsoleTitle = _T("Console"); -static LPCTSTR kConsoleClassName = _T("DroseraConsoleWindowClass"); - -static LRESULT CALLBACK consoleWndProc(HWND, UINT, WPARAM, LPARAM); - -void registerConsoleClass(HINSTANCE hInstance) -{ - static bool haveRegisteredWindowClass = false; - - if (haveRegisteredWindowClass) { - haveRegisteredWindowClass = true; - return; - } - - WNDCLASSEX wcex; - - wcex.cbSize = sizeof(WNDCLASSEX); - - wcex.style = 0; - wcex.lpfnWndProc = consoleWndProc; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = sizeof(DebuggerClient*); - wcex.hInstance = hInstance; - wcex.hIcon = 0; - wcex.hCursor = LoadCursor(0, IDC_ARROW); - wcex.hbrBackground = 0; - wcex.lpszMenuName = 0; - wcex.lpszClassName = kConsoleClassName; - wcex.hIconSm = 0; - - RegisterClassEx(&wcex); -} - -static LRESULT CALLBACK consoleWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0); - DebuggerClient* client = reinterpret_cast<DebuggerClient*>(longPtr); - - switch (message) { - case WM_SIZE: - if (!client) - return 0; - return client->onSize(wParam, lParam); - case WM_PAINT: { - PAINTSTRUCT ps; - BeginPaint(hWnd, &ps); - EndPaint(hWnd, &ps); - break; - } - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - - return 0; -} - -LRESULT DebuggerClient::onSize(WPARAM, LPARAM) -{ - if (!m_webViewPrivate) - return 0; - - RECT clientRect = {0}; - if (!GetClientRect(m_consoleWindow, &clientRect)) - return 0; - - HWND viewWindow; - if (SUCCEEDED(m_webViewPrivate->viewWindow(reinterpret_cast<OLE_HANDLE*>(&viewWindow)))) - SetWindowPos(viewWindow, 0, clientRect.left, clientRect.top, clientRect.right - clientRect.left, clientRect.bottom - clientRect.top, SWP_NOZORDER); - - return 0; -} - -DebuggerClient::DebuggerClient() - : m_webViewLoaded(false) - , m_debuggerDocument(new DebuggerDocument(new ServerConnection())) - , m_globalContext(0) -{ -} - -DebuggerClient::~DebuggerClient() -{ - if (m_globalContext) - JSGlobalContextRelease(m_globalContext); -} - -// IUnknown ------------------------------ -HRESULT STDMETHODCALLTYPE DebuggerClient::QueryInterface(REFIID riid, void** ppvObject) -{ - *ppvObject = 0; - if (IsEqualGUID(riid, IID_IUnknown)) - *ppvObject = this; - else if (IsEqualGUID(riid, IID_IWebFrameLoadDelegate)) - *ppvObject = static_cast<IWebFrameLoadDelegate*>(this); - else if (IsEqualGUID(riid, IID_IWebUIDelegate)) - *ppvObject = static_cast<IWebUIDelegate*>(this); - else - return E_NOINTERFACE; - - AddRef(); - return S_OK; -} - -ULONG STDMETHODCALLTYPE DebuggerClient::AddRef() -{ - // COM ref-counting isn't useful to us because we're in charge of the lifetime of the WebView. - return 1; -} - -ULONG STDMETHODCALLTYPE DebuggerClient::Release() -{ - // COM ref-counting isn't useful to us because we're in charge of the lifetime of the WebView. - return 1; -} - -// IWebFrameLoadDelegate ------------------------------ -HRESULT STDMETHODCALLTYPE DebuggerClient::didFinishLoadForFrame( - /* [in] */ IWebView* webView, - /* [in] */ IWebFrame*) -{ - HRESULT ret = S_OK; - - m_webViewLoaded = true; - - COMPtr<IWebFrame> mainFrame; - ret = webView->mainFrame(&mainFrame); - if (FAILED(ret)) - return ret; - - if (!m_globalContext) { - JSGlobalContextRef context = mainFrame->globalContext(); - if (!context) - return E_FAIL; - - m_globalContext = JSGlobalContextRetain(context); - } - - if (serverConnected()) - m_debuggerDocument->server()->setGlobalContext(m_globalContext); - - return ret; -} - -HRESULT STDMETHODCALLTYPE DebuggerClient::windowScriptObjectAvailable( - /* [in] */ IWebView*, - /* [in] */ JSContextRef context, - /* [in] */ JSObjectRef windowObject) -{ - JSValueRef exception = 0; - if (m_debuggerDocument) - m_debuggerDocument->windowScriptObjectAvailable(context, windowObject, &exception); - - if (exception) - return E_FAIL; - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE DebuggerClient::createWebViewWithRequest( - /* [in] */ IWebView*, - /* [in] */ IWebURLRequest* request, - /* [retval][out] */ IWebView** newWebView) -{ - HRESULT ret = S_OK; - - if (!newWebView) - return E_POINTER; - - *newWebView = 0; - - HINSTANCE instance = Drosera::getInst(); - - registerConsoleClass(instance); - - m_consoleWindow = CreateWindow(kConsoleClassName, kConsoleTitle, WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, 0, 500, 350, 0, 0, instance, 0); - - if (!m_consoleWindow) - return HRESULT_FROM_WIN32(GetLastError()); - - SetLastError(0); - SetWindowLongPtr(m_consoleWindow, 0, reinterpret_cast<LONG_PTR>(this)); - ret = HRESULT_FROM_WIN32(GetLastError()); - if (FAILED(ret)) - return ret; - - CLSID clsid = CLSID_NULL; - ret = CLSIDFromProgID(PROGID(WebView), &clsid); - if (FAILED(ret)) - return ret; - - COMPtr<IWebView> view; - ret = CoCreateInstance(clsid, 0, CLSCTX_ALL, IID_IWebView, (void**)&view); - if (FAILED(ret)) - return ret; - - m_webViewPrivate.query(view); - if (!m_webViewPrivate) - return E_FAIL; - - ret = view->setHostWindow(reinterpret_cast<OLE_HANDLE>(m_consoleWindow)); - if (FAILED(ret)) - return ret; - - RECT clientRect = {0}; - GetClientRect(m_consoleWindow, &clientRect); - ret = view->initWithFrame(clientRect, 0, 0); - if (FAILED(ret)) - return ret; - - ret = view->setUIDelegate(this); - if (FAILED(ret)) - return ret; - - ret = view->setFrameLoadDelegate(this); - if (FAILED(ret)) - return ret; - - if (request) { - BOOL requestIsEmpty = FALSE; - ret = request->isEmpty(&requestIsEmpty); - if (FAILED(ret)) - return ret; - - if (!requestIsEmpty) { - COMPtr<IWebFrame> mainFrame; - ret = view->mainFrame(&mainFrame); - if (FAILED(ret)) - return ret; - - ret = mainFrame->loadRequest(request); - if (FAILED(ret)) - return ret; - } - } - - ShowWindow(m_consoleWindow, SW_SHOW); - UpdateWindow(m_consoleWindow); - - *newWebView = view.releaseRef(); - - return S_OK; -} - -// IWebUIDelegate ------------------------------ -HRESULT STDMETHODCALLTYPE DebuggerClient::runJavaScriptAlertPanelWithMessage( // For debugging purposes - /* [in] */ IWebView*, - /* [in] */ BSTR message) -{ -#ifndef NDEBUG - fwprintf(stderr, L"%s\n", message ? message : L""); -#else - (void)message; -#endif - return S_OK; -} - -// Pause & Step ------------------------------- -void DebuggerClient::resume() -{ - DebuggerDocument::callGlobalFunction(m_globalContext, "resume", 0, 0); -} - -void DebuggerClient::pause() -{ - DebuggerDocument::callGlobalFunction(m_globalContext, "pause", 0, 0); -} - -void DebuggerClient::stepInto() -{ - DebuggerDocument::callGlobalFunction(m_globalContext, "stepInto", 0, 0); -} - -void DebuggerClient::stepOver() -{ - DebuggerDocument::callGlobalFunction(m_globalContext, "stepOver", 0, 0); -} - -void DebuggerClient::stepOut() -{ - DebuggerDocument::callGlobalFunction(m_globalContext, "stepOut", 0, 0); -} - -void DebuggerClient::showConsole() -{ - DebuggerDocument::callGlobalFunction(m_globalContext, "showConsoleWindow", 0, 0); -} - -void DebuggerClient::closeCurrentFile() -{ - DebuggerDocument::callGlobalFunction(m_globalContext, "closeCurrentFile", 0, 0); -} - - -// Server Connection Functions ---------------- -bool DebuggerClient::serverConnected() const -{ - return m_debuggerDocument->server()->serverConnected(); -} - -void DebuggerClient::attemptToCreateServerConnection() -{ - m_debuggerDocument->server()->attemptToCreateServerConnection(m_globalContext); -} diff --git a/WebKitTools/Drosera/win/DebuggerClient.h b/WebKitTools/Drosera/win/DebuggerClient.h deleted file mode 100644 index 7297615..0000000 --- a/WebKitTools/Drosera/win/DebuggerClient.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef DebuggerClient_H -#define DebuggerClient_H - -#include "BaseDelegate.h" - -#include <string> -#include <WebCore/COMPtr.h> -#include <wtf/OwnPtr.h> - -class DebuggerDocument; -interface IWebView; -interface IWebFrame; -interface IWebViewPrivate; - -typedef const struct OpaqueJSContext* JSContextRef; -typedef struct OpaqueJSValue* JSObjectRef; - -class DebuggerClient : public BaseDelegate { -public: - DebuggerClient(); - ~DebuggerClient(); - explicit DebuggerClient(const std::wstring& serverName); - - LRESULT DebuggerClient::onSize(WPARAM, LPARAM); - - // IUnknown - HRESULT STDMETHODCALLTYPE QueryInterface( - /* [in] */ REFIID riid, - /* [retval][out] */ void** ppvObject); - - ULONG STDMETHODCALLTYPE AddRef(); - ULONG STDMETHODCALLTYPE Release(); - - // IWebFrameLoadDelegate - HRESULT STDMETHODCALLTYPE didFinishLoadForFrame( - /* [in] */ IWebView*, - /* [in] */ IWebFrame*); - - HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable( - /* [in] */ IWebView*, - /* [in] */ JSContextRef, - /* [in] */ JSObjectRef); - - // IWebUIDelegate - HRESULT STDMETHODCALLTYPE runJavaScriptAlertPanelWithMessage( - /* [in] */ IWebView*, - /* [in] */ BSTR); - - HRESULT STDMETHODCALLTYPE createWebViewWithRequest( - /* [in] */ IWebView*, - /* [in] */ IWebURLRequest*, - /* [retval][out] */ IWebView**); - - bool webViewLoaded() const { return m_webViewLoaded; } - - // Pause & Step - void resume(); - void pause(); - void stepInto(); - void stepOver(); - void stepOut(); - void showConsole(); - void closeCurrentFile(); - - // Server Connection Functions - bool serverConnected() const; - void attemptToCreateServerConnection(); - -private: - bool m_webViewLoaded; - JSGlobalContextRef m_globalContext; - - HWND m_consoleWindow; - COMPtr<IWebViewPrivate> m_webViewPrivate; - - OwnPtr<DebuggerDocument> m_debuggerDocument; -}; - -#endif //DebuggerClient_H diff --git a/WebKitTools/Drosera/win/DebuggerDocumentPlatform.cpp b/WebKitTools/Drosera/win/DebuggerDocumentPlatform.cpp deleted file mode 100644 index 36e51e2..0000000 --- a/WebKitTools/Drosera/win/DebuggerDocumentPlatform.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ -#include "config.h" -#include "DebuggerDocument.h" - -#include "ServerConnection.h" - -#include <JavaScriptCore/JSRetainPtr.h> -#include <JavaScriptCore/JSStringRef.h> -#include <JavaScriptCore/JSStringRefBSTR.h> -#include <WebKit/IWebScriptCallFrame.h> - -JSValueRef JSValueRefCreateWithBSTR(JSContextRef context, BSTR string) -{ - JSRetainPtr<JSStringRef> jsString(Adopt, JSStringCreateWithBSTR(string)); - return JSValueMakeString(context, jsString.get()); -} - -// DebuggerDocument platform specific implementations - -void DebuggerDocument::platformPause() -{ - m_server->pause(); -} - -void DebuggerDocument::platformResume() -{ - m_server->resume(); -} - -void DebuggerDocument::platformStepInto() -{ - m_server->stepInto(); -} - -JSValueRef DebuggerDocument::platformEvaluateScript(JSContextRef context, JSStringRef script, int callFrame) -{ - HRESULT ret = S_OK; - - COMPtr<IWebScriptCallFrame> cframe = m_server->getCallerFrame(callFrame); - if (!cframe) - return JSValueMakeUndefined(context); - - // Convert script to BSTR - BSTR scriptBSTR = JSStringCopyBSTR(script); - BSTR value = 0; - ret = cframe->stringByEvaluatingJavaScriptFromString(scriptBSTR, &value); - SysFreeString(scriptBSTR); - if (FAILED(ret)) { - SysFreeString(value); - return JSValueMakeUndefined(context); - } - - JSValueRef returnValue = JSValueRefCreateWithBSTR(context, value); - SysFreeString(value); - return returnValue; - -} - -void DebuggerDocument::getPlatformCurrentFunctionStack(JSContextRef context, Vector<JSValueRef>& currentStack) -{ - COMPtr<IWebScriptCallFrame> frame = m_server->currentFrame(); - while (frame) { - COMPtr<IWebScriptCallFrame> caller; - BSTR function = 0; - if (FAILED(frame->functionName(&function))) - return; - - if (FAILED(frame->caller(&caller))) - return; - - if (!function) { - if (caller) - function = SysAllocString(L"(anonymous function)"); - else - function = SysAllocString(L"(global scope)"); - } - - currentStack.append(JSValueRefCreateWithBSTR(context, function)); - SysFreeString(function); - - frame = caller; - } -} - -void DebuggerDocument::getPlatformLocalScopeVariableNamesForCallFrame(JSContextRef context, int callFrame, Vector<JSValueRef>& variableNames) -{ - COMPtr<IWebScriptCallFrame> cframe = m_server->getCallerFrame(callFrame); - if (!cframe) - return; - - VARIANT var; - VariantInit(&var); - - COMPtr<IEnumVARIANT> localScopeVariableNames; - if (FAILED(cframe->variableNames(&localScopeVariableNames))) - return; - - while (localScopeVariableNames->Next(1, &var, 0) == S_OK) { - ASSERT(V_VT(&var) == VT_BSTR); - BSTR variableName; - - variableName = V_BSTR(&var); - variableNames.append(JSValueRefCreateWithBSTR(context, variableName)); - - SysFreeString(variableName); - VariantClear(&var); - } -} - -JSValueRef DebuggerDocument::platformValueForScopeVariableNamed(JSContextRef context, JSStringRef key, int callFrame) -{ - COMPtr<IWebScriptCallFrame> cframe = m_server->getCallerFrame(callFrame); - if (!cframe) - return JSValueMakeUndefined(context); - - BSTR bstrKey = JSStringCopyBSTR(key); - - BSTR variableValue; - HRESULT hr = cframe->valueForVariable(bstrKey, &variableValue); - SysFreeString(bstrKey); - if (FAILED(hr)) - return JSValueMakeUndefined(context); - - JSValueRef returnValue = JSValueRefCreateWithBSTR(context, variableValue); - SysFreeString(variableValue); - - return returnValue; -} - - -void DebuggerDocument::platformLog(JSStringRef msg) -{ - printf("%S\n", JSStringGetCharactersPtr(msg)); -} diff --git a/WebKitTools/Drosera/win/Drosera.cpp b/WebKitTools/Drosera/win/Drosera.cpp deleted file mode 100644 index 5e35c8c..0000000 --- a/WebKitTools/Drosera/win/Drosera.cpp +++ /dev/null @@ -1,394 +0,0 @@ -/* - * Copyright (C) 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#include "config.h" -#include "Drosera.h" - -#include "DebuggerClient.h" -#include "DebuggerDocument.h" -#include "resource.h" -#include "ServerConnection.h" - -#include <JavaScriptCore/JSStringRef.h> -#include <WebKit/ForEachCoClass.h> -#include <WebKit/IWebMutableURLRequest.h> -#include <WebKit/IWebView.h> -#include <WebKit/WebKit.h> -#include <wtf/RetainPtr.h> - -const unsigned MAX_LOADSTRING = 100; - -TCHAR szTitle[MAX_LOADSTRING]; // The title bar text -TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name - -static LPCTSTR s_DroseraPointerProp = TEXT("DroseraPointer"); -static HINSTANCE hInst; - -BSTR cfStringToBSTR(CFStringRef cfstr); - -void registerDroseraClass(HINSTANCE hInstance); -LRESULT CALLBACK droseraWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK aboutWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); - -HINSTANCE Drosera::getInst() { return hInst; } -void Drosera::setInst(HINSTANCE in) { hInst = in; } -void launchConsoleWindow(); - -extern "C" __declspec(dllimport) HANDLE* __pioinfo; - -int APIENTRY _tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) -{ - UNREFERENCED_PARAMETER(hPrevInstance); - UNREFERENCED_PARAMETER(lpCmdLine); - - MSG msg; - -#ifndef NDEBUG - launchConsoleWindow(); -#endif - - Drosera drosera; - - HRESULT ret = drosera.init(hInstance, nCmdShow); - if (FAILED(ret)) - return ret; - - HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_DROSERA)); - - // Main message loop: - while (GetMessage(&msg, 0, 0, 0)) { - if (!drosera.serverConnected()) - drosera.attemptToCreateServerConnection(); - - if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - - return static_cast<int>(msg.wParam); -} - -void launchConsoleWindow() -{ - if (AllocConsole()) { - // MSVCRT exports __pioinfo which is an array of ioinfo handles. the first three are stdout, stdin, and stderr - // the first pointer in the ioinfo object is the kernel handle for the console, so we can simplify the expression - // to just deref the exported symbol, setting it to the newly allocated console handle. - *__pioinfo = GetStdHandle(STD_OUTPUT_HANDLE); - // When an app is created without a console, stdout, stderr and stdin are all invalid handles (i.e. negative) - // Since we've introduced new handles, we can reset their file index - which is the index into the ioinfo array. - // This hooks up the standard cruntime APIS to the new console, allowing a functional output. As for input YMMV. - stdout->_file = 0; - stderr->_file = 0; - } -} - -////////////////// Setup Windows Specific Interface ////////////////// - -void registerDroseraClass(HINSTANCE hInstance) -{ - WNDCLASSEX wcex; - - wcex.cbSize = sizeof(WNDCLASSEX); - - wcex.style = CS_HREDRAW | CS_VREDRAW; - wcex.lpfnWndProc = ::droseraWndProc; - wcex.cbClsExtra = 0; - wcex.cbWndExtra = sizeof(Drosera*); - wcex.hInstance = hInstance; - wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_DROSERA)); - wcex.hCursor = LoadCursor(0, IDC_ARROW); - wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - wcex.lpszMenuName = MAKEINTRESOURCE(IDC_DROSERA); - wcex.lpszClassName = szWindowClass; - wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); - - RegisterClassEx(&wcex); -} - -//Processes messages for the main window. -LRESULT CALLBACK droseraWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - PAINTSTRUCT ps; - HDC hdc; - - LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0); - Drosera* drosera = reinterpret_cast<Drosera*>(longPtr); - - switch (message) { - case WM_COMMAND: - return drosera->handleCommand(hWnd, message, wParam, lParam); - break; - case WM_SIZE: - if (!drosera) - return 0; - return drosera->webViewLoaded() ? drosera->onSize(wParam, lParam) : 0; - case WM_PAINT: - hdc = BeginPaint(hWnd, &ps); - EndPaint(hWnd, &ps); - break; - case WM_DESTROY: - PostQuitMessage(0); - break; - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - - return 0; -} - -LRESULT CALLBACK Drosera::handleCommand(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - int wmId = LOWORD(wParam); - switch (wmId) { - case ID_DEBUG_CONTINUE: - m_debuggerClient->resume(); - break; - case ID_DEBUG_PAUSE: - m_debuggerClient->pause(); - break; - case ID_DEBUG_STEPINTO: - m_debuggerClient->stepInto(); - break; - case ID_DEBUG_STEPOVER: - m_debuggerClient->stepOver(); - break; - case ID_DEBUG_STEPOUT: - m_debuggerClient->stepOut(); - break; - case ID_DEBUG_SHOWCONSOLE: - m_debuggerClient->showConsole(); - break; - case ID_HELP_ABOUT: - DialogBox(Drosera::getInst(), MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, ::aboutWndProc); - break; - case ID_FILE_EXIT: - DestroyWindow(hWnd); - break; - default: - return DefWindowProc(hWnd, message, wParam, lParam); - } - - return 0; -} - -// Message handler for about box. -INT_PTR CALLBACK aboutWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) -{ - UNREFERENCED_PARAMETER(lParam); - switch (message) { - case WM_INITDIALOG: - return (INT_PTR)TRUE; - - case WM_COMMAND: - if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { - EndDialog(hDlg, LOWORD(wParam)); - return (INT_PTR)TRUE; - } - break; - } - return (INT_PTR)FALSE; -} - -////////////////// End Setup Windows Specific Interface ////////////////// - -Drosera::Drosera() - : m_hWnd(0) - , m_debuggerClient(new DebuggerClient()) -{ -} - -HRESULT Drosera::init(HINSTANCE hInstance, int nCmdShow) -{ - HRESULT ret = initUI(hInstance, nCmdShow); - if (FAILED(ret)) - return ret; - - ret = attach(); - return ret; -} - - -HRESULT Drosera::initUI(HINSTANCE hInstance, int nCmdShow) -{ - // Initialize global strings - LoadString(hInstance, IDS_APP_TITLE, szTitle, ARRAYSIZE(szTitle)); - LoadString(hInstance, IDC_DROSERA, szWindowClass, ARRAYSIZE(szWindowClass)); - registerDroseraClass(hInstance); - - Drosera::setInst(hInstance); // Store instance handle in our local variable - - m_hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0, 0, hInstance, 0); - - if (!m_hWnd) - return HRESULT_FROM_WIN32(GetLastError()); - - SetLastError(0); - SetWindowLongPtr(m_hWnd, 0, reinterpret_cast<LONG_PTR>(this)); - HRESULT ret = HRESULT_FROM_WIN32(GetLastError()); - if (FAILED(ret)) - return ret; - - CLSID clsid = CLSID_NULL; - ret = CLSIDFromProgID(PROGID(WebView), &clsid); - if (FAILED(ret)) - return ret; - - ret = CoCreateInstance(clsid, 0, CLSCTX_ALL, IID_IWebView, (void**)&m_webView); - if (FAILED(ret)) - return ret; - - m_webViewPrivate.query(m_webView.get()); - if (!m_webViewPrivate) - return E_FAIL; - - ret = m_webView->setHostWindow(reinterpret_cast<OLE_HANDLE>(m_hWnd)); - if (FAILED(ret)) - return ret; - - RECT clientRect = {0}; - ::GetClientRect(m_hWnd, &clientRect); - ret = m_webView->initWithFrame(clientRect, 0, 0); - if (FAILED(ret)) - return ret; - - HWND viewWindow; - ret = m_webViewPrivate->viewWindow(reinterpret_cast<OLE_HANDLE*>(&viewWindow)); - if (FAILED(ret)) - return ret; - - SetProp(viewWindow, s_DroseraPointerProp, (HANDLE)this); - - // FIXME: Implement window size/position save/restore - ShowWindow(m_hWnd, nCmdShow); - UpdateWindow(m_hWnd); - - return ret; -} - -LRESULT Drosera::onSize(WPARAM, LPARAM) -{ - if (!m_webViewPrivate) - return 0; - - RECT clientRect = {0}; - ::GetClientRect(m_hWnd, &clientRect); - - HWND viewWindow; - if (SUCCEEDED(m_webViewPrivate->viewWindow(reinterpret_cast<OLE_HANDLE*>(&viewWindow)))) - // FIXME should this be the height-command bars height? - ::SetWindowPos(viewWindow, 0, clientRect.left, clientRect.top, clientRect.right - clientRect.left, clientRect.bottom - clientRect.top, SWP_NOZORDER); - - return 0; -} - -bool Drosera::webViewLoaded() const -{ - return m_debuggerClient->webViewLoaded(); -} - -// Server Detection Callbacks - -HRESULT Drosera::attach() -{ - // Get selected server - HRESULT ret = m_webView->setFrameLoadDelegate(m_debuggerClient.get()); - if (FAILED(ret)) - return ret; - - ret = m_webView->setUIDelegate(m_debuggerClient.get()); - if (FAILED(ret)) - return ret; - - CLSID clsid = CLSID_NULL; - ret = CLSIDFromProgID(PROGID(WebMutableURLRequest), &clsid); - if (FAILED(ret)) - return ret; - - COMPtr<IWebMutableURLRequest> request; - ret = CoCreateInstance(clsid, 0, CLSCTX_ALL, IID_IWebMutableURLRequest, (void**)&request); - if (FAILED(ret)) - return ret; - - RetainPtr<CFURLRef> htmlURLRef(AdoptCF, ::CFBundleCopyResourceURL(::CFBundleGetBundleWithIdentifier(CFSTR("org.webkit.drosera")), CFSTR("debugger"), CFSTR("html"), CFSTR("Drosera"))); - if (!htmlURLRef) - return E_FAIL; - - CFStringRef urlStringRef = ::CFURLGetString(htmlURLRef.get()); - BSTR tempStr = cfStringToBSTR(urlStringRef); // Both initWithRUL and SysFreeString can handle 0. - ret = request->initWithURL(tempStr, WebURLRequestUseProtocolCachePolicy, 60); - SysFreeString(tempStr); - if (FAILED(ret)) - return ret; - - COMPtr<IWebFrame> mainFrame; - ret = m_webView->mainFrame(&mainFrame); - if (FAILED(ret)) - return ret; - - ret = mainFrame->loadRequest(request.get()); - if (FAILED(ret)) - return ret; - - return ret; -} - -BSTR cfStringToBSTR(CFStringRef cfstr) -{ - if (!cfstr) - return 0; - - const UniChar* uniChars = CFStringGetCharactersPtr(cfstr); - if (uniChars) - return SysAllocStringLen((LPCTSTR)uniChars, CFStringGetLength(cfstr)); - - CFIndex length = CFStringGetLength(cfstr); - BSTR bstr = SysAllocStringLen(0, length); - CFStringGetCharacters(cfstr, CFRangeMake(0, length), (UniChar*)bstr); - bstr[length] = 0; - - return bstr; -} - -// Server Connection Functions - -bool Drosera::serverConnected() const -{ - return m_debuggerClient->serverConnected(); -} - -void Drosera::attemptToCreateServerConnection() -{ - m_debuggerClient->attemptToCreateServerConnection(); -} - diff --git a/WebKitTools/Drosera/win/Drosera.h b/WebKitTools/Drosera/win/Drosera.h deleted file mode 100644 index a73c7f7..0000000 --- a/WebKitTools/Drosera/win/Drosera.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2006, 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef Drosera_H -#define Drosera_H - -#include "DebuggerDocument.h" - -#include <WebCore/COMPtr.h> -#include <wtf/OwnPtr.h> - -class DebuggerClient; -interface IWebView; -interface IWebViewPrivate; - -class Drosera { -public: - Drosera(); - - static HINSTANCE getInst(); - static void setInst(HINSTANCE); - - HRESULT init(HINSTANCE hInstance, int nCmdShow); - LRESULT onSize(WPARAM, LPARAM); - LRESULT CALLBACK handleCommand(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); - - bool webViewLoaded() const; - - // Server connection functions - bool serverConnected() const; - void attemptToCreateServerConnection(); - -private: - HRESULT initUI(HINSTANCE hInstance, int nCmdShow); - HRESULT attach(); - - HWND m_hWnd; - - COMPtr<IWebView> m_webView; - COMPtr<IWebViewPrivate> m_webViewPrivate; - - OwnPtr<DebuggerClient> m_debuggerClient; -}; - -#endif //Drosera_H diff --git a/WebKitTools/Drosera/win/Drosera.vcproj/Drosera.rc b/WebKitTools/Drosera/win/Drosera.vcproj/Drosera.rc deleted file mode 100755 index 6f8a8c8..0000000 --- a/WebKitTools/Drosera/win/Drosera.vcproj/Drosera.rc +++ /dev/null @@ -1,196 +0,0 @@ -// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-#ifndef APSTUDIO_INVOKED
-#include "autoversion.h"
-#endif
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#define APSTUDIO_HIDDEN_SYMBOLS
-#include "windows.h"
-#undef APSTUDIO_HIDDEN_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_DROSERA ICON "Drosera.ico"
-IDI_SMALL ICON "small.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDC_DROSERA MENU
-BEGIN
- POPUP "&File"
- BEGIN
- MENUITEM "Close Current File", ID_FILE_CLOSECURRENTFILE
- MENUITEM "Exit", ID_FILE_EXIT
- END
- POPUP "Edit"
- BEGIN
- MENUITEM "Undo", ID_EDIT_UNDO
- MENUITEM "Redo", ID_EDIT_REDO
- MENUITEM SEPARATOR
- MENUITEM "Cut", ID_EDIT_CUT
- MENUITEM "Copy", ID_EDIT_COPY
- MENUITEM "Paste", ID_EDIT_PASTE
- MENUITEM "Select All", ID_EDIT_SELECTALL
- MENUITEM SEPARATOR
- POPUP "Find"
- BEGIN
- MENUITEM "Find", ID_FIND_FIND
- MENUITEM "Find Next", ID_FIND_FINDNEXT
- MENUITEM "Find Previous", ID_FIND_FINDPREVIOUS
- MENUITEM "Use Selection for Find", ID_FIND_USESELECTIONFORFIND
- MENUITEM "Jump to Selection", ID_FIND_JUMPTOSELECTION
- END
- MENUITEM SEPARATOR
- MENUITEM "Special Characters", ID_EDIT_SPECIALCHARACTERS
- END
- POPUP "Debug"
- BEGIN
- MENUITEM "Show Console", ID_DEBUG_SHOWCONSOLE
- MENUITEM SEPARATOR
- MENUITEM "Continue", ID_DEBUG_CONTINUE
- MENUITEM "Pause", ID_DEBUG_PAUSE
- MENUITEM "Step Into", ID_DEBUG_STEPINTO
- MENUITEM "Step Over", ID_DEBUG_STEPOVER
- MENUITEM "Step Out", ID_DEBUG_STEPOUT
- END
- MENUITEM "Window", ID_WINDOW
- POPUP "Help"
- BEGIN
- MENUITEM "About", ID_HELP_ABOUT
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOGEX 0, 0, 146, 62
-STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_CAPTION | WS_SYSMENU
-CAPTION "About"
-FONT 8, "System", 0, 0, 0x0
-BEGIN
- ICON IDI_DROSERA,IDC_MYICON,64,10,20,20
- CTEXT "Drosera Version 1.0",IDC_STATIC,0,37,146,8,SS_NOPREFIX
-END
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
- "#include ""windows.h""\r\n"
- "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION __VERSION_MAJOR__,__BUILD_NUMBER_MAJOR__,__BUILD_NUMBER_MINOR__,__BUILD_NUMBER_VARIANT__
- PRODUCTVERSION __VERSION_MAJOR__,__VERSION_MINOR__,__VERSION_TINY__,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "FileDescription", "Drosera JavaScript Debugger"
- VALUE "FileVersion", __VERSION_TEXT__
- VALUE "CompanyName", "Apple Inc."
- VALUE "InternalName", "Drosera"
- VALUE "LegalCopyright", "Copyright Apple Inc. 2006-2008"
- VALUE "OriginalFilename", "Drosera.exe"
- VALUE "ProductName", "Drosera"
- VALUE "ProductVersion", __VERSION_TEXT__
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE
-BEGIN
- IDS_APP_TITLE "Drosera"
- IDC_DROSERA "DROSERA"
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/WebKitTools/Drosera/win/Drosera.vcproj/Drosera.vcproj b/WebKitTools/Drosera/win/Drosera.vcproj/Drosera.vcproj deleted file mode 100755 index 3f72dda..0000000 --- a/WebKitTools/Drosera/win/Drosera.vcproj/Drosera.vcproj +++ /dev/null @@ -1,449 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="Drosera"
- ProjectGUID="{91671475-2114-4D8F-A051-9A1B270F6467}"
- RootNamespace="Drosera"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%
bash "$(WebKitLibrariesDir)\tools\scripts\auto-version.sh" "$(IntDir)"
"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(ProjectDir)";"$(ProjectDir)\..";"$(ProjectDir)\..\..";"$(ProjectDir)\..\..\ForwardingHeaders";"$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(IntDir)\include""
- PreprocessorDefinitions="STRICT;__APPLICATION_NAME__=\"$(ProjectName)\""
- UsePrecompiledHeader="2"
- PrecompiledHeaderThrough="DroseraPrefix.h"
- ForcedIncludeFiles="DroseraPrefix.h"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;__APPLICATION_NAME__=\"$(ProjectName)\""
- Culture="1033"
- AdditionalIncludeDirectories=""$(IntDir)\include""
- />
- <Tool
- Name="VCPreLinkEventTool"
- CommandLine=""
- />
- <Tool
- Name="VCLinkerTool"
- LinkLibraryDependencies="false"
- AdditionalDependencies="CoreFoundation$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib""
- IgnoreAllDefaultLibraries="false"
- EmbedManagedResourceFile=""
- DelayLoadDLLs=""
- GenerateDebugInformation="true"
- SubSystem="2"
- LinkTimeCodeGeneration="0"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="mkdir 2>NUL "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin36$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin36$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc36$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc36$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"

mkdir 2>NUL "$(OutDir)\$(ProjectName).resources"
xcopy /y /d "$(ProjectDir)..\Info.plist" "$(OutDir)\$(ProjectName).resources"

mkdir 2>NUL "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\*.css" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\*.html" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\*.js" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\Images\*" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%
bash "$(WebKitLibrariesDir)\tools\scripts\auto-version.sh" "$(IntDir)"
"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/EHsc"
- AdditionalIncludeDirectories=""$(ProjectDir)";"$(ProjectDir)\..";"$(ProjectDir)\..\..";"$(ProjectDir)\..\..\ForwardingHeaders";"$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(IntDir)\include""
- PreprocessorDefinitions="STRICT;__APPLICATION_NAME__=\"$(ProjectName)\""
- UsePrecompiledHeader="2"
- PrecompiledHeaderThrough="DroseraPrefix.h"
- ForcedIncludeFiles="DroseraPrefix.h"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;__APPLICATION_NAME__=\"$(ProjectName)\""
- Culture="1033"
- AdditionalIncludeDirectories=""$(IntDir)\include""
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkLibraryDependencies="false"
- AdditionalDependencies="CoreFoundation$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
- LinkIncremental="1"
- AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib""
- DelayLoadDLLs=""
- GenerateDebugInformation="true"
- SubSystem="2"
- OptimizeReferences="0"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="mkdir 2>NUL "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin36$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin36$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc36$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc36$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"

mkdir 2>NUL "$(OutDir)\$(ProjectName).resources"
xcopy /y /d "$(ProjectDir)..\Info.plist" "$(OutDir)\$(ProjectName).resources"

mkdir 2>NUL "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\*.css" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\*.html" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\*.js" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\Images\*" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
"
- />
- </Configuration>
- <Configuration
- Name="Debug_Internal|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%
bash "$(WebKitLibrariesDir)\tools\scripts\auto-version.sh" "$(IntDir)"
"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(ProjectDir)";"$(ProjectDir)\..";"$(ProjectDir)\..\..";"$(ProjectDir)\..\..\ForwardingHeaders";"$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(IntDir)\include""
- PreprocessorDefinitions="STRICT;__APPLICATION_NAME__=\"$(ProjectName)\""
- UsePrecompiledHeader="2"
- PrecompiledHeaderThrough="DroseraPrefix.h"
- ForcedIncludeFiles="DroseraPrefix.h"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;__APPLICATION_NAME__=\"$(ProjectName)\""
- Culture="1033"
- AdditionalIncludeDirectories=""$(IntDir)\include""
- />
- <Tool
- Name="VCPreLinkEventTool"
- CommandLine=""
- />
- <Tool
- Name="VCLinkerTool"
- LinkLibraryDependencies="false"
- AdditionalDependencies="CoreFoundation$(LibraryConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WTF$(WebKitConfigSuffix).lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(WebKitLibrariesDir)\lib""
- IgnoreAllDefaultLibraries="false"
- EmbedManagedResourceFile=""
- DelayLoadDLLs=""
- GenerateDebugInformation="true"
- SubSystem="2"
- LinkTimeCodeGeneration="0"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="mkdir 2>NUL "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin36$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin36$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc36$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc36$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"

mkdir 2>NUL "$(OutDir)\$(ProjectName).resources"
xcopy /y /d "$(ProjectDir)..\Info.plist" "$(OutDir)\$(ProjectName).resources"

mkdir 2>NUL "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\*.css" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\*.html" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\*.js" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
xcopy /y /d "$(ProjectDir)..\..\Images\*" "$(OutDir)\$(ProjectName).resources\$(ProjectName)"
"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath="..\DebuggerClient.cpp"
- >
- </File>
- <File
- RelativePath="..\..\DebuggerDocument.cpp"
- >
- </File>
- <File
- RelativePath="..\DebuggerDocumentPlatform.cpp"
- >
- </File>
- <File
- RelativePath="..\Drosera.cpp"
- >
- </File>
- <File
- RelativePath="..\DroseraPrefix.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- UsePrecompiledHeader="1"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\ServerConnection.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath="..\BaseDelegate.h"
- >
- </File>
- <File
- RelativePath="..\..\config.h"
- >
- </File>
- <File
- RelativePath="..\DebuggerClient.h"
- >
- </File>
- <File
- RelativePath="..\..\DebuggerDocument.h"
- >
- </File>
- <File
- RelativePath="..\Drosera.h"
- >
- </File>
- <File
- RelativePath="..\DroseraPrefix.h"
- >
- </File>
- <File
- RelativePath="..\ServerConnection.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- <File
- RelativePath="..\..\Images\Drosera.ico"
- >
- </File>
- <File
- RelativePath=".\Drosera.rc"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""$(InputDir)\WTL75\include";"$(IntDir)\include";"$(ProjectDir)..";"$(ProjectDir)..\..\Images""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""$(ProjectDir)..";"$(ProjectDir)..\..\Images""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- >
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""$(InputDir)\WTL75\include";"$(IntDir)\include";"$(ProjectDir)..";"$(ProjectDir)..\..\Images""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\resource.h"
- >
- </File>
- <File
- RelativePath="..\..\Images\small.ico"
- >
- </File>
- </Filter>
- <Filter
- Name="WebSource"
- >
- <File
- RelativePath="..\..\breakpointEditor.html"
- >
- </File>
- <File
- RelativePath="..\..\console.css"
- >
- </File>
- <File
- RelativePath="..\..\console.html"
- >
- </File>
- <File
- RelativePath="..\..\console.js"
- >
- </File>
- <File
- RelativePath="..\..\debugger.css"
- >
- </File>
- <File
- RelativePath="..\..\debugger.html"
- >
- </File>
- <File
- RelativePath="..\..\debugger.js"
- >
- </File>
- <File
- RelativePath="..\..\viewer.css"
- >
- </File>
- <File
- RelativePath="..\..\viewer.html"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/WebKitTools/Drosera/win/DroseraPrefix.cpp b/WebKitTools/Drosera/win/DroseraPrefix.cpp deleted file mode 100644 index 39d3f80..0000000 --- a/WebKitTools/Drosera/win/DroseraPrefix.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#include "DroseraPrefix.h" diff --git a/WebKitTools/Drosera/win/DroseraPrefix.h b/WebKitTools/Drosera/win/DroseraPrefix.h deleted file mode 100644 index fe608c7..0000000 --- a/WebKitTools/Drosera/win/DroseraPrefix.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2007 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef droseraPrefix_H -#define droseraPrefix_H - -// Modify the following defines if you have to target a platform prior to the ones specified below. -// Refer to MSDN for the latest info on corresponding values for different platforms. -#ifndef WINVER // Allow use of features specific to Windows XP or later. -#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. -#endif - -#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. -#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. -#endif - -#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. -#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. -#endif - -#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. -#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. -#endif - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#endif - -#ifndef WIN32 -#define WIN32 1 -#endif - -#endif //droseraPrefix_H diff --git a/WebKitTools/Drosera/win/Info.plist b/WebKitTools/Drosera/win/Info.plist deleted file mode 100644 index ce4a0f7..0000000 --- a/WebKitTools/Drosera/win/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>Drosera</string> - <key>CFBundleIconFile</key> - <string>Drosera</string> - <key>CFBundleIdentifier</key> - <string>org.webkit.drosera</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>21081</string> - <key>NSMainNibFile</key> - <string>MainMenu</string> - <key>NSPrincipalClass</key> - <string>NSApplication</string> -</dict> -</plist> diff --git a/WebKitTools/Drosera/win/ServerConnection.cpp b/WebKitTools/Drosera/win/ServerConnection.cpp deleted file mode 100644 index e59c4fc..0000000 --- a/WebKitTools/Drosera/win/ServerConnection.cpp +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006, 2007 Vladimir Olexa (vladimir.olexa@gmail.com) - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#include "config.h" -#include "ServerConnection.h" - -#include "DebuggerDocument.h" - -#include <JavaScriptCore/JSContextRef.h> -#include <JavaScriptCore/JSRetainPtr.h> -#include <JavaScriptCore/JSStringRefBSTR.h> -#include <JavaScriptCore/RetainPtr.h> -#include <WebKit/ForEachCoClass.h> -#include <WebKit/IWebScriptCallFrame.h> -#include <WebKit/IWebScriptDebugServer.h> -#include <WebKit/WebKit.h> - -#include <iostream> - -ServerConnection::ServerConnection() - : m_globalContext(0) - , m_serverConnected(false) -{ - OleInitialize(0); - attemptToCreateServerConnection(); -} - -ServerConnection::~ServerConnection() -{ - if (m_server) - m_server->removeListener(this); - - if (m_globalContext) - JSGlobalContextRelease(m_globalContext); -} - -void ServerConnection::attemptToCreateServerConnection(JSGlobalContextRef globalContextRef) -{ - COMPtr<IWebScriptDebugServer> tempServer; - - CLSID clsid = CLSID_NULL; - if (FAILED(CLSIDFromProgID(PROGID(WebScriptDebugServer), &clsid))) - return; - - if (FAILED(CoCreateInstance(clsid, 0, CLSCTX_LOCAL_SERVER, IID_IWebScriptDebugServer, (void**)&tempServer))) - return; - - if (FAILED(tempServer->sharedWebScriptDebugServer(&m_server))) - return; - - if (FAILED(m_server->addListener(this))) { - m_server = 0; - return; - } - - m_serverConnected = true; - - if (globalContextRef) - m_globalContext = JSGlobalContextRetain(globalContextRef); -} - -void ServerConnection::setGlobalContext(JSGlobalContextRef globalContextRef) -{ - m_globalContext = JSGlobalContextRetain(globalContextRef); -} - -// Pause & Step - -void ServerConnection::pause() -{ - if (m_server) - m_server->pause(); -} - -void ServerConnection::resume() -{ - if (m_server) - m_server->resume(); -} - -void ServerConnection::stepInto() -{ - if (m_server) - m_server->step(); -} - -// IUnknown -------------------------------------------------- -HRESULT STDMETHODCALLTYPE ServerConnection::QueryInterface(REFIID riid, void** ppvObject) -{ - *ppvObject = 0; - if (IsEqualGUID(riid, IID_IUnknown)) - *ppvObject = this; - else if (IsEqualGUID(riid, IID_IWebScriptDebugListener)) - *ppvObject = static_cast<IWebScriptDebugListener*>(this); - else - return E_NOINTERFACE; - - AddRef(); - return S_OK; -} - -ULONG STDMETHODCALLTYPE ServerConnection::AddRef(void) -{ - // COM ref-counting isn't useful to us because we're in charge of the lifetime of the WebView. - return 1; -} - -ULONG STDMETHODCALLTYPE ServerConnection::Release(void) -{ - // COM ref-counting isn't useful to us because we're in charge of the lifetime of the WebView. - return 1; -} -// IWebScriptDebugListener ----------------------------------- -HRESULT STDMETHODCALLTYPE ServerConnection::didLoadMainResourceForDataSource( - /* [in] */ IWebView*, - /* [in] */ IWebDataSource* dataSource) -{ - HRESULT ret = S_OK; - if (!m_globalContext || !dataSource) - return ret; - - // Get document source - COMPtr<IWebDocumentRepresentation> rep; - ret = dataSource->representation(&rep); - if (FAILED(ret)) - return ret; - - BOOL canProvideDocumentSource = FALSE; - ret = rep->canProvideDocumentSource(&canProvideDocumentSource); - if (FAILED(ret)) - return ret; - - BSTR documentSource = 0; - if (canProvideDocumentSource) - ret = rep->documentSource(&documentSource); - - if (FAILED(ret) || !documentSource) - return ret; - - JSRetainPtr<JSStringRef> documentSourceJS(Adopt, JSStringCreateWithBSTR(documentSource)); - SysFreeString(documentSource); - - // Get URL - COMPtr<IWebURLResponse> response; - ret = dataSource->response(&response); - if (FAILED(ret)) - return ret; - - BSTR url = 0; - ret = response->URL(&url); - if (FAILED(ret)) - return ret; - - JSRetainPtr<JSStringRef> urlJS(Adopt, JSStringCreateWithBSTR(url)); - SysFreeString(url); - - DebuggerDocument::updateFileSource(m_globalContext, documentSourceJS.get(), urlJS.get()); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE ServerConnection::didParseSource( - /* [in] */ IWebView*, - /* [in] */ BSTR sourceCode, - /* [in] */ UINT baseLineNumber, - /* [in] */ BSTR url, - /* [in] */ int sourceID, - /* [in] */ IWebFrame* webFrame) -{ - HRESULT ret = S_OK; - if (!m_globalContext || !sourceCode) - return ret; - - COMPtr<IWebDataSource> dataSource; - ret = webFrame->dataSource(&dataSource); - if (FAILED(ret)) - return ret; - - COMPtr<IWebURLResponse> response; - ret = dataSource->response(&response); - if (FAILED(ret)) - return ret; - - BSTR responseURL; - ret = response->URL(&responseURL); - if (FAILED(ret)) - return ret; - - BSTR documentSource = 0; - if (!url || !wcscmp(responseURL, url)) { - COMPtr<IWebDocumentRepresentation> rep; - ret = dataSource->representation(&rep); - if (FAILED(ret)) - return ret; - - BOOL canProvideDocumentSource; - rep->canProvideDocumentSource(&canProvideDocumentSource); - if (FAILED(ret)) - return ret; - - if (canProvideDocumentSource) { - ret = rep->documentSource(&documentSource); - if (FAILED(ret)) - return ret; - } - - if (!url) { - ret = response->URL(&url); - if (FAILED(ret)) - return ret; - } - } - SysFreeString(responseURL); - - JSRetainPtr<JSStringRef> sourceJS(Adopt, JSStringCreateWithBSTR(sourceCode)); - JSRetainPtr<JSStringRef> documentSourceJS(Adopt, JSStringCreateWithBSTR(documentSource)); - SysFreeString(documentSource); - JSRetainPtr<JSStringRef> urlJS(Adopt, JSStringCreateWithBSTR(url)); - JSValueRef sidJS = JSValueMakeNumber(m_globalContext, sourceID); - JSValueRef baseLineJS = JSValueMakeNumber(m_globalContext, baseLineNumber); - - DebuggerDocument::didParseScript(m_globalContext, sourceJS.get(), documentSourceJS.get(), urlJS.get(), sidJS, baseLineJS); - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE ServerConnection::failedToParseSource( - /* [in] */ IWebView*, - /* [in] */ BSTR, - /* [in] */ UINT, - /* [in] */ BSTR, - /* [in] */ BSTR, - /* [in] */ IWebFrame*) -{ - return S_OK; -} - -HRESULT STDMETHODCALLTYPE ServerConnection::didEnterCallFrame( - /* [in] */ IWebView*, - /* [in] */ IWebScriptCallFrame* frame, - /* [in] */ int sourceID, - /* [in] */ int lineNumber, - /* [in] */ IWebFrame*) -{ - HRESULT ret = S_OK; - if (!m_globalContext) - return ret; - - m_currentFrame = frame; - - JSValueRef sidJS = JSValueMakeNumber(m_globalContext, sourceID); - JSValueRef linenoJS = JSValueMakeNumber(m_globalContext, lineNumber); - - DebuggerDocument::didEnterCallFrame(m_globalContext, sidJS, linenoJS); - - return ret; -} - -HRESULT STDMETHODCALLTYPE ServerConnection::willExecuteStatement( - /* [in] */ IWebView*, - /* [in] */ IWebScriptCallFrame*, - /* [in] */ int sourceID, - /* [in] */ int lineNumber, - /* [in] */ IWebFrame*) -{ - HRESULT ret = S_OK; - if (!m_globalContext) - return ret; - - JSValueRef sidJS = JSValueMakeNumber(m_globalContext, sourceID); - JSValueRef linenoJS = JSValueMakeNumber(m_globalContext, lineNumber); - - DebuggerDocument::willExecuteStatement(m_globalContext, sidJS, linenoJS); - return ret; -} - -HRESULT STDMETHODCALLTYPE ServerConnection::willLeaveCallFrame( - /* [in] */ IWebView*, - /* [in] */ IWebScriptCallFrame* frame, - /* [in] */ int sourceID, - /* [in] */ int lineNumber, - /* [in] */ IWebFrame*) -{ - HRESULT ret = S_OK; - if (!m_globalContext) - return ret; - - JSValueRef sidJS = JSValueMakeNumber(m_globalContext, sourceID); - JSValueRef linenoJS = JSValueMakeNumber(m_globalContext, lineNumber); - - DebuggerDocument::willLeaveCallFrame(m_globalContext, sidJS, linenoJS); - - m_currentFrame = frame; - - return S_OK; -} - -HRESULT STDMETHODCALLTYPE ServerConnection::exceptionWasRaised( - /* [in] */ IWebView*, - /* [in] */ IWebScriptCallFrame*, - /* [in] */ int sourceID, - /* [in] */ int lineNumber, - /* [in] */ IWebFrame*) -{ - HRESULT ret = S_OK; - if (!m_globalContext) - return ret; - - JSValueRef sidJS = JSValueMakeNumber(m_globalContext, sourceID); - JSValueRef linenoJS = JSValueMakeNumber(m_globalContext, lineNumber); - - DebuggerDocument::exceptionWasRaised(m_globalContext, sidJS, linenoJS); - - return ret; -} - -HRESULT STDMETHODCALLTYPE ServerConnection::serverDidDie() -{ - m_server = 0; - m_currentFrame = 0; - m_serverConnected = false; - return S_OK; -} - -// Stack & Variables - -IWebScriptCallFrame* ServerConnection::currentFrame() const -{ - return m_currentFrame.get(); -} - -COMPtr<IWebScriptCallFrame> ServerConnection::getCallerFrame(int callFrame) const -{ - COMPtr<IWebScriptCallFrame> cframe = currentFrame(); - for (int count = 0; count < callFrame; count++) { - COMPtr<IWebScriptCallFrame> callerFrame; - if (FAILED(cframe->caller(&callerFrame))) - return 0; - - cframe = callerFrame; - } - - return cframe; -} diff --git a/WebKitTools/Drosera/win/ServerConnection.h b/WebKitTools/Drosera/win/ServerConnection.h deleted file mode 100644 index 765d487..0000000 --- a/WebKitTools/Drosera/win/ServerConnection.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006, 2007 Vladimir Olexa (vladimir.olexa@gmail.com) - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - */ - -#ifndef ServerConnection_H -#define ServerConnection_H - -#include <string> -#include <WebCore/COMPtr.h> -#include <WebKit/IWebScriptDebugListener.h> - -class DebuggerClient; -interface IWebScriptCallFrame; -interface IWebScriptDebugServer; - -typedef struct OpaqueJSContext* JSGlobalContextRef; - -class ServerConnection : public IWebScriptDebugListener { -public: - ServerConnection(); - ~ServerConnection(); - - bool serverConnected() const { return m_serverConnected; } - void attemptToCreateServerConnection(JSGlobalContextRef = 0); - void setGlobalContext(JSGlobalContextRef); - - // Pause & Step - void pause(); - void resume(); - void stepInto(); - - // IUnknown - virtual HRESULT STDMETHODCALLTYPE QueryInterface( - /* [in] */ REFIID riid, - /* [retval][out] */ void** ppvObject); - - virtual ULONG STDMETHODCALLTYPE AddRef(); - virtual ULONG STDMETHODCALLTYPE Release(); - - // IWebScriptDebugListener - virtual HRESULT STDMETHODCALLTYPE didLoadMainResourceForDataSource( - /* [in] */ IWebView*, - /* [in] */ IWebDataSource* dataSource); - - virtual HRESULT STDMETHODCALLTYPE didParseSource( - /* [in] */ IWebView*, - /* [in] */ BSTR sourceCode, - /* [in] */ UINT baseLineNumber, - /* [in] */ BSTR url, - /* [in] */ int sourceID, - /* [in] */ IWebFrame* webFrame); - - virtual HRESULT STDMETHODCALLTYPE failedToParseSource( - /* [in] */ IWebView*, - /* [in] */ BSTR sourceCode, - /* [in] */ UINT baseLineNumber, - /* [in] */ BSTR url, - /* [in] */ BSTR error, - /* [in] */ IWebFrame*); - - virtual HRESULT STDMETHODCALLTYPE didEnterCallFrame( - /* [in] */ IWebView*, - /* [in] */ IWebScriptCallFrame* frame, - /* [in] */ int sourceID, - /* [in] */ int lineNumber, - /* [in] */ IWebFrame*); - - virtual HRESULT STDMETHODCALLTYPE willExecuteStatement( - /* [in] */ IWebView*, - /* [in] */ IWebScriptCallFrame*, - /* [in] */ int sourceID, - /* [in] */ int lineNumber, - /* [in] */ IWebFrame*); - - virtual HRESULT STDMETHODCALLTYPE willLeaveCallFrame( - /* [in] */ IWebView*, - /* [in] */ IWebScriptCallFrame* frame, - /* [in] */ int sourceID, - /* [in] */ int lineNumber, - /* [in] */ IWebFrame*); - - virtual HRESULT STDMETHODCALLTYPE exceptionWasRaised( - /* [in] */ IWebView*, - /* [in] */ IWebScriptCallFrame*, - /* [in] */ int sourceID, - /* [in] */ int lineNumber, - /* [in] */ IWebFrame*); - - virtual HRESULT STDMETHODCALLTYPE serverDidDie(); - - // Stack & Variables - IWebScriptCallFrame* currentFrame() const; - COMPtr<IWebScriptCallFrame> getCallerFrame(int callFrame) const; - -private: - bool m_serverConnected; - - COMPtr<IWebScriptCallFrame> m_currentFrame; - COMPtr<IWebScriptDebugServer> m_server; - JSGlobalContextRef m_globalContext; -}; - -#endif //ServerConnection_H diff --git a/WebKitTools/Drosera/win/resource.h b/WebKitTools/Drosera/win/resource.h deleted file mode 100644 index 4ba014e..0000000 --- a/WebKitTools/Drosera/win/resource.h +++ /dev/null @@ -1,47 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Drosera.rc -// -#define IDC_MYICON 2 -#define IDS_APP_TITLE 103 -#define IDD_ABOUTBOX 103 -#define IDI_DROSERA 107 -#define IDI_SMALL 108 -#define IDC_DROSERA 109 -#define IDC_LIST1 1001 -#define ID_DEBUG_SHOWCONSOLE 32771 -#define ID_DEBUG_CONTINUE 32772 -#define ID_DEBUG_PAUSE 32773 -#define ID_DEBUG_STEPINTO 32774 -#define ID_DEBUG_STEPOVER 32775 -#define ID_DEBUG_STEPOUT 32776 -#define ID_EDIT_UNDO 32777 -#define ID_EDIT_REDO 32778 -#define ID_EDIT_CUT 32779 -#define ID_EDIT_COPY 32780 -#define ID_EDIT_PASTE 32781 -#define ID_EDIT_SELECTALL 32782 -#define ID_FIND_FIND 32784 -#define ID_FIND_FINDNEXT 32785 -#define ID_FIND_FINDPREVIOUS 32786 -#define ID_FIND_USESELECTIONFORFIND 32787 -#define ID_FIND_JUMPTOSELECTION 32788 -#define ID_EDIT_SPECIALCHARACTERS 32789 -#define ID_FILE_EXIT 32791 -#define ID_WINDOW 32793 -#define ID_HELP_ABOUT 32794 -#define ID_FILE_CLOSE_CURRENT_FILE 32795 -#define ID_FILE_CLOSECURRENTFILE 32798 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NO_MFC 1 -#define _APS_NEXT_RESOURCE_VALUE 131 -#define _APS_NEXT_COMMAND_VALUE 32799 -#define _APS_NEXT_CONTROL_VALUE 1002 -#define _APS_NEXT_SYMED_VALUE 110 -#endif -#endif diff --git a/WebKitTools/DumpRenderTree/AccessibilityController.cpp b/WebKitTools/DumpRenderTree/AccessibilityController.cpp new file mode 100644 index 0000000..d2ed2a6 --- /dev/null +++ b/WebKitTools/DumpRenderTree/AccessibilityController.cpp @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2008 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. ``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 + * 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. + */ + +#include "config.h" +#include "AccessibilityController.h" + +#include "AccessibilityUIElement.h" +#include <JavaScriptCore/JSRetainPtr.h> + +// Static Value Getters + +static JSValueRef getFocusedElementCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + AccessibilityController* controller = reinterpret_cast<AccessibilityController*>(JSObjectGetPrivate(thisObject)); + return AccessibilityUIElement::makeJSAccessibilityUIElement(context, controller->focusedElement()); +} + +static JSValueRef getRootElementCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + AccessibilityController* controller = reinterpret_cast<AccessibilityController*>(JSObjectGetPrivate(thisObject)); + return AccessibilityUIElement::makeJSAccessibilityUIElement(context, controller->rootElement()); +} + +// Object Creation + +void AccessibilityController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> accessibilityControllerStr(Adopt, JSStringCreateWithUTF8CString("accessibilityController")); + JSValueRef accessibilityControllerObject = JSObjectMake(context, getJSClass(), this); + JSObjectSetProperty(context, windowObject, accessibilityControllerStr.get(), accessibilityControllerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); +} + +JSClassRef AccessibilityController::getJSClass() +{ + static JSStaticValue staticValues[] = { + { "focusedElement", getFocusedElementCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "rootElement", getRootElementCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { 0, 0, 0, 0 } + }; + + static JSClassDefinition classDefinition = { + 0, kJSClassAttributeNone, "AccessibilityController", 0, staticValues, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + + static JSClassRef accessibilityControllerClass = JSClassCreate(&classDefinition); + return accessibilityControllerClass; +} diff --git a/WebKitTools/DumpRenderTree/AccessibilityController.h b/WebKitTools/DumpRenderTree/AccessibilityController.h new file mode 100644 index 0000000..0af6613 --- /dev/null +++ b/WebKitTools/DumpRenderTree/AccessibilityController.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2008 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. ``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 + * 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. + */ + +#ifndef AccessibilityController_h +#define AccessibilityController_h + +#include <JavaScriptCore/JSObjectRef.h> + +class AccessibilityUIElement; + +class AccessibilityController { +public: + AccessibilityController(); + ~AccessibilityController(); + + void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception); + + // Controller Methods - platform-independent implementations + AccessibilityUIElement rootElement(); + AccessibilityUIElement focusedElement(); + +private: + static JSClassRef getJSClass(); +}; + +#endif // AccessibilityController_h diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp new file mode 100644 index 0000000..02d2dfa --- /dev/null +++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp @@ -0,0 +1,303 @@ +/* + * Copyright (C) 2008 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. ``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 + * 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. + */ + +#include "config.h" +#include "AccessibilityUIElement.h" + +#include <JavaScriptCore/JSRetainPtr.h> + +// Static Functions + +static AccessibilityUIElement* toAXElement(JSObjectRef object) +{ + // FIXME: We should ASSERT that it is the right class here. + return reinterpret_cast<AccessibilityUIElement*>(JSObjectGetPrivate(object)); +} + +static JSValueRef allAttributesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> attributes(Adopt, toAXElement(thisObject)->allAttributes()); + return JSValueMakeString(context, attributes.get()); +} + +static JSValueRef attributesOfLinkedUIElementsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> linkedUIDescription(Adopt, toAXElement(thisObject)->attributesOfLinkedUIElements()); + return JSValueMakeString(context, linkedUIDescription.get()); +} + +static JSValueRef attributesOfDocumentLinksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> linkedUIDescription(Adopt, toAXElement(thisObject)->attributesOfDocumentLinks()); + return JSValueMakeString(context, linkedUIDescription.get()); +} + +static JSValueRef attributesOfChildrenCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> childrenDescription(Adopt, toAXElement(thisObject)->attributesOfChildren()); + return JSValueMakeString(context, childrenDescription.get()); +} + +static JSValueRef parameterizedAttributeNamesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> parameterizedAttributeNames(Adopt, toAXElement(thisObject)->parameterizedAttributeNames()); + return JSValueMakeString(context, parameterizedAttributeNames.get()); +} + +static JSValueRef attributesOfColumnHeadersCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> attributesOfColumnHeaders(Adopt, toAXElement(thisObject)->attributesOfColumnHeaders()); + return JSValueMakeString(context, attributesOfColumnHeaders.get()); +} + +static JSValueRef attributesOfRowHeadersCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> attributesOfRowHeaders(Adopt, toAXElement(thisObject)->attributesOfRowHeaders()); + return JSValueMakeString(context, attributesOfRowHeaders.get()); +} + +static JSValueRef attributesOfColumnsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> attributesOfColumns(Adopt, toAXElement(thisObject)->attributesOfColumns()); + return JSValueMakeString(context, attributesOfColumns.get()); +} + +static JSValueRef attributesOfRowsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> attributesOfRows(Adopt, toAXElement(thisObject)->attributesOfRows()); + return JSValueMakeString(context, attributesOfRows.get()); +} + +static JSValueRef attributesOfVisibleCellsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> attributesOfVisibleCells(Adopt, toAXElement(thisObject)->attributesOfVisibleCells()); + return JSValueMakeString(context, attributesOfVisibleCells.get()); +} + +static JSValueRef attributesOfHeaderCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> attributesOfHeader(Adopt, toAXElement(thisObject)->attributesOfHeader()); + return JSValueMakeString(context, attributesOfHeader.get()); +} + +static JSValueRef indexInTableCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + return JSValueMakeNumber(context, toAXElement(thisObject)->indexInTable()); +} + +static JSValueRef rowIndexRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> rowIndexRange(Adopt, toAXElement(thisObject)->rowIndexRange()); + return JSValueMakeString(context, rowIndexRange.get()); +} + +static JSValueRef columnIndexRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> columnIndexRange(Adopt, toAXElement(thisObject)->columnIndexRange()); + return JSValueMakeString(context, columnIndexRange.get()); +} + +static JSValueRef lineForIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + int indexNumber = -1; + if (argumentCount == 1) + indexNumber = JSValueToNumber(context, arguments[0], exception); + + return JSValueMakeNumber(context, toAXElement(thisObject)->lineForIndex(indexNumber)); +} + +static JSValueRef boundsForRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + unsigned location = UINT_MAX, length = 0; + if (argumentCount == 2) { + location = JSValueToNumber(context, arguments[0], exception); + length = JSValueToNumber(context, arguments[1], exception); + } + + JSRetainPtr<JSStringRef> boundsDescription(Adopt, toAXElement(thisObject)->boundsForRange(location, length)); + return JSValueMakeString(context, boundsDescription.get()); +} + +static JSValueRef childAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + int indexNumber = -1; + if (argumentCount == 1) + indexNumber = JSValueToNumber(context, arguments[0], exception); + + return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->getChildAtIndex(indexNumber)); +} + +static JSValueRef cellForColumnAndRowCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + unsigned column = 0, row = 0; + if (argumentCount == 2) { + column = JSValueToNumber(context, arguments[0], exception); + row = JSValueToNumber(context, arguments[1], exception); + } + + return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->cellForColumnAndRow(column, row)); +} + +static JSValueRef titleUIElementCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->titleUIElement()); +} + +static JSValueRef setSelectedTextRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + unsigned location = UINT_MAX, length = 0; + if (argumentCount == 2) { + location = JSValueToNumber(context, arguments[0], exception); + length = JSValueToNumber(context, arguments[1], exception); + } + + toAXElement(thisObject)->setSelectedTextRange(location, length); + return 0; +} + +// Static Value Getters + +static JSValueRef getRoleCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> role(Adopt, toAXElement(thisObject)->role()); + return JSValueMakeString(context, role.get()); +} + +static JSValueRef getTitleCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> title(Adopt, toAXElement(thisObject)->title()); + return JSValueMakeString(context, title.get()); +} + +static JSValueRef getDescriptionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> description(Adopt, toAXElement(thisObject)->description()); + return JSValueMakeString(context, description.get()); +} + +static JSValueRef getWidthCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + return JSValueMakeNumber(context, toAXElement(thisObject)->width()); +} + +static JSValueRef getHeightCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + return JSValueMakeNumber(context, toAXElement(thisObject)->height()); +} + +static JSValueRef getIntValueCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + return JSValueMakeNumber(context, toAXElement(thisObject)->intValue()); +} + +static JSValueRef getMinValueCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + return JSValueMakeNumber(context, toAXElement(thisObject)->minValue()); +} + +static JSValueRef getMaxValueCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + return JSValueMakeNumber(context, toAXElement(thisObject)->maxValue()); +} + +static JSValueRef getInsertionPointLineNumberCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + return JSValueMakeNumber(context, toAXElement(thisObject)->insertionPointLineNumber()); +} + +static JSValueRef getSelectedTextRangeCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + JSRetainPtr<JSStringRef> selectedTextRange(Adopt, toAXElement(thisObject)->selectedTextRange()); + return JSValueMakeString(context, selectedTextRange.get()); +} + +static JSValueRef getSupportsPressActionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) +{ + return JSValueMakeBoolean(context, toAXElement(thisObject)->supportsPressAction()); +} + +// Destruction + +static void finalize(JSObjectRef thisObject) +{ + delete toAXElement(thisObject); +} + +// Object Creation + +JSObjectRef AccessibilityUIElement::makeJSAccessibilityUIElement(JSContextRef context, const AccessibilityUIElement& element) +{ + return JSObjectMake(context, AccessibilityUIElement::getJSClass(), new AccessibilityUIElement(element)); +} + +JSClassRef AccessibilityUIElement::getJSClass() +{ + static JSStaticValue staticValues[] = { + { "role", getRoleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "title", getTitleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "description", getDescriptionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "width", getWidthCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "height", getHeightCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "intValue", getIntValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "minValue", getMinValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "maxValue", getMaxValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "insertionPointLineNumber", getInsertionPointLineNumberCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "selectedTextRange", getSelectedTextRangeCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "supportsPressAction", getSupportsPressActionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { 0, 0, 0, 0 } + }; + + static JSStaticFunction staticFunctions[] = { + { "allAttributes", allAttributesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "attributesOfLinkedUIElements", attributesOfLinkedUIElementsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "attributesOfDocumentLinks", attributesOfDocumentLinksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "attributesOfChildren", attributesOfChildrenCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "parameterizedAttributeNames", parameterizedAttributeNamesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "lineForIndex", lineForIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "boundsForRange", boundsForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "childAtIndex", childAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "attributesOfColumnHeaders", attributesOfColumnHeadersCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "attributesOfRowHeaders", attributesOfRowHeadersCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "attributesOfColumns", attributesOfColumnsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "attributesOfRows", attributesOfRowsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "attributesOfVisibleCells", attributesOfVisibleCellsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "attributesOfHeader", attributesOfHeaderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "indexInTable", indexInTableCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "rowIndexRange", rowIndexRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "columnIndexRange", columnIndexRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "cellForColumnAndRow", cellForColumnAndRowCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "titleUIElement", titleUIElementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "setSelectedTextRange", setSelectedTextRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { 0, 0, 0 } + }; + + static JSClassDefinition classDefinition = { + 0, kJSClassAttributeNone, "AccessibilityUIElement", 0, staticValues, staticFunctions, + 0, finalize, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + + static JSClassRef accessibilityUIElementClass = JSClassCreate(&classDefinition); + return accessibilityUIElementClass; +} diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h new file mode 100644 index 0000000..064829f --- /dev/null +++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2008 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. ``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 + * 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. + */ + +#ifndef AccessibilityUIElement_h +#define AccessibilityUIElement_h + +#include <JavaScriptCore/JSObjectRef.h> +#include <wtf/Vector.h> + +#if PLATFORM(MAC) +#ifdef __OBJC__ +typedef id PlatformUIElement; +#else +typedef struct objc_object* PlatformUIElement; +#endif +#elif PLATFORM(WIN) +#undef _WINSOCKAPI_ +#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h + +#include <oleacc.h> +#include <WebCore/COMPtr.h> + +typedef COMPtr<IAccessible> PlatformUIElement; +#else +typedef void* PlatformUIElement; +#endif + +class AccessibilityUIElement { +public: + AccessibilityUIElement(PlatformUIElement); + AccessibilityUIElement(const AccessibilityUIElement&); + ~AccessibilityUIElement(); + + PlatformUIElement platformUIElement() { return m_element; } + + static JSObjectRef makeJSAccessibilityUIElement(JSContextRef, const AccessibilityUIElement&); + + void getLinkedUIElements(Vector<AccessibilityUIElement>&); + void getDocumentLinks(Vector<AccessibilityUIElement>&); + void getChildren(Vector<AccessibilityUIElement>&); + AccessibilityUIElement getChildAtIndex(unsigned); + AccessibilityUIElement titleUIElement(); + + // Methods - platform-independent implementations + JSStringRef allAttributes(); + JSStringRef attributesOfLinkedUIElements(); + JSStringRef attributesOfDocumentLinks(); + JSStringRef attributesOfChildren(); + JSStringRef parameterizedAttributeNames(); + + // Attributes - platform-independent implementations + JSStringRef role(); + JSStringRef title(); + JSStringRef description(); + double width(); + double height(); + double intValue(); + double minValue(); + double maxValue(); + int insertionPointLineNumber(); + JSStringRef selectedTextRange(); + bool supportsPressAction(); + + // Table-specific attributes + JSStringRef attributesOfColumnHeaders(); + JSStringRef attributesOfRowHeaders(); + JSStringRef attributesOfColumns(); + JSStringRef attributesOfRows(); + JSStringRef attributesOfVisibleCells(); + JSStringRef attributesOfHeader(); + int indexInTable(); + JSStringRef rowIndexRange(); + JSStringRef columnIndexRange(); + + // Parameterized attributes + int lineForIndex(int); + JSStringRef boundsForRange(unsigned location, unsigned length); + void setSelectedTextRange(unsigned location, unsigned length); + + // Table-specific + AccessibilityUIElement cellForColumnAndRow(unsigned column, unsigned row); + +private: + static JSClassRef getJSClass(); + + PlatformUIElement m_element; +}; + +#endif // AccessibilityUIElement_h diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.h b/WebKitTools/DumpRenderTree/DumpRenderTree.h index e74d4bc..9336a04 100644 --- a/WebKitTools/DumpRenderTree/DumpRenderTree.h +++ b/WebKitTools/DumpRenderTree/DumpRenderTree.h @@ -29,7 +29,10 @@ #ifndef DumpRenderTree_h #define DumpRenderTree_h +// FIXME: Remove this when all platforms are using config.h +#ifndef Config_H #include <wtf/Platform.h> +#endif #if PLATFORM(MAC) #include "DumpRenderTreeMac.h" @@ -46,14 +49,16 @@ extern CFRunLoopTimerRef waitToDumpWatchdog; #include <string> +#if !PLATFORM(OPENBSD) std::wstring urlSuitableForTestResult(const std::wstring& url); +#endif class LayoutTestController; extern volatile bool done; // FIXME: This is a bad abstraction. We should insted pass this to other controller objects which need access to it. -extern LayoutTestController* layoutTestController; +extern LayoutTestController* gLayoutTestController; void dump(); void displayWebView(); diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj index 1a59f19..ca7bdcd 100644 --- a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj +++ b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj @@ -27,13 +27,13 @@ 141BF436096A455900E0753C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A84F608908B136DA00E9745F /* Cocoa.framework */; }; 141BF438096A455900E0753C /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A817090308B164D300CCB9FB /* JavaScriptCore.framework */; }; 141BF439096A455900E0753C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; }; - 141BF44C096A45C800E0753C /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 141BF448096A45C800E0753C /* Info.plist */; }; 141BF453096A45EB00E0753C /* PluginObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 141BF447096A45C800E0753C /* PluginObject.h */; }; 14770FE20A22ADF7009342EE /* GCController.h in Headers */ = {isa = PBXBuildFile; fileRef = 14770FE00A22ADF7009342EE /* GCController.h */; }; 1A8F02E80BB9B4EC008CFA34 /* TestObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8F024C0BB9B056008CFA34 /* TestObject.h */; }; 1AC6C8490D07638600CD3161 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C77F0D07589B00CD3161 /* main.cpp */; }; 1AC6C84A0D07638600CD3161 /* PluginObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C7800D07589B00CD3161 /* PluginObject.cpp */; }; 1AC6C84B0D07638600CD3161 /* TestObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C7810D07589B00CD3161 /* TestObject.cpp */; }; + 23BCB8900EA57623003C6289 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23BCB88F0EA57623003C6289 /* OpenGL.framework */; }; 9340994C08540CAE007F3BC8 /* DumpRenderTreePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = 32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */; }; 9340995108540CAE007F3BC8 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9335435F03D75502008635CE /* WebKit.framework */; }; A817090008B163EF00CCB9FB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A84F608908B136DA00E9745F /* Cocoa.framework */; }; @@ -50,6 +50,9 @@ B5A752A208AF5D1F00138E45 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A752A108AF5D1F00138E45 /* QuartzCore.framework */; }; BC0131DA0C9772010087317D /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0131D80C9772010087317D /* LayoutTestController.cpp */; }; BC0131DB0C9772010087317D /* LayoutTestController.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0131D90C9772010087317D /* LayoutTestController.h */; }; + BC0E24E00E2D9451001B6BC2 /* AccessibilityUIElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */; }; + BC0E24E10E2D9451001B6BC2 /* AccessibilityUIElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */; }; + BC0E26150E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */; }; BC47412A0D038A4C0072B006 /* JavaScriptThreading.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4741290D038A4C0072B006 /* JavaScriptThreading.h */; }; BC4741410D038A570072B006 /* JavaScriptThreadingPthreads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4741400D038A570072B006 /* JavaScriptThreadingPthreads.cpp */; }; BC9D90240C97472E0099A4A3 /* WorkQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9D90210C97472D0099A4A3 /* WorkQueue.cpp */; }; @@ -91,6 +94,8 @@ BCB284D00CFA83CC007E533E /* PixelDumpSupportCG.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB284890CFA8202007E533E /* PixelDumpSupportCG.h */; }; BCB284D60CFA83D1007E533E /* PixelDumpSupportMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCB2848C0CFA8221007E533E /* PixelDumpSupportMac.mm */; }; BCB284F60CFA84F8007E533E /* ImageDiffCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB284F30CFA84F2007E533E /* ImageDiffCG.cpp */; }; + BCD08B3A0E1057EF00A7D0C1 /* AccessibilityController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */; }; + BCD08B710E1059D200A7D0C1 /* AccessibilityControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */; }; BCF6C6500C98E9C000AC063E /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF6C64F0C98E9C000AC063E /* GCController.cpp */; }; /* End PBXBuildFile section */ @@ -121,13 +126,23 @@ /* Begin PBXFileReference section */ 141BF233096A44CF00E0753C /* TestNetscapePlugIn.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestNetscapePlugIn.plugin; sourceTree = BUILT_PRODUCTS_DIR; }; 141BF447096A45C800E0753C /* PluginObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PluginObject.h; sourceTree = "<group>"; }; - 141BF448096A45C800E0753C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; }; + 141BF448096A45C800E0753C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 14770FE00A22ADF7009342EE /* GCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCController.h; sourceTree = "<group>"; }; 1A8F024C0BB9B056008CFA34 /* TestObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestObject.h; sourceTree = "<group>"; }; 1AC6C77F0D07589B00CD3161 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; }; 1AC6C7800D07589B00CD3161 /* PluginObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginObject.cpp; sourceTree = "<group>"; }; 1AC6C7810D07589B00CD3161 /* TestObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestObject.cpp; sourceTree = "<group>"; }; + 23BCB88F0EA57623003C6289 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; }; 32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; }; + 375F09710DAC3CB600C8B4E5 /* WebKitWeightWatcher100.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher100.ttf; path = fonts/WebKitWeightWatcher100.ttf; sourceTree = "<group>"; }; + 375F09720DAC3CB600C8B4E5 /* WebKitWeightWatcher200.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher200.ttf; path = fonts/WebKitWeightWatcher200.ttf; sourceTree = "<group>"; }; + 375F09730DAC3CB600C8B4E5 /* WebKitWeightWatcher300.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher300.ttf; path = fonts/WebKitWeightWatcher300.ttf; sourceTree = "<group>"; }; + 375F09740DAC3CB600C8B4E5 /* WebKitWeightWatcher400.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher400.ttf; path = fonts/WebKitWeightWatcher400.ttf; sourceTree = "<group>"; }; + 375F09750DAC3CB600C8B4E5 /* WebKitWeightWatcher500.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher500.ttf; path = fonts/WebKitWeightWatcher500.ttf; sourceTree = "<group>"; }; + 375F09760DAC3CB600C8B4E5 /* WebKitWeightWatcher600.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher600.ttf; path = fonts/WebKitWeightWatcher600.ttf; sourceTree = "<group>"; }; + 375F09770DAC3CB600C8B4E5 /* WebKitWeightWatcher700.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher700.ttf; path = fonts/WebKitWeightWatcher700.ttf; sourceTree = "<group>"; }; + 375F09780DAC3CB600C8B4E5 /* WebKitWeightWatcher800.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher800.ttf; path = fonts/WebKitWeightWatcher800.ttf; sourceTree = "<group>"; }; + 375F09790DAC3CB600C8B4E5 /* WebKitWeightWatcher900.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher900.ttf; path = fonts/WebKitWeightWatcher900.ttf; sourceTree = "<group>"; }; 9335435F03D75502008635CE /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9340995408540CAF007F3BC8 /* DumpRenderTree */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = DumpRenderTree; sourceTree = BUILT_PRODUCTS_DIR; }; A803FF7409CAAD08009B2A37 /* DumpRenderTree.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DumpRenderTree.h; sourceTree = "<group>"; }; @@ -145,13 +160,16 @@ B5A752A108AF5D1F00138E45 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; }; BC0131D80C9772010087317D /* LayoutTestController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = LayoutTestController.cpp; sourceTree = "<group>"; }; BC0131D90C9772010087317D /* LayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LayoutTestController.h; sourceTree = "<group>"; }; + BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityUIElement.h; sourceTree = "<group>"; }; + BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityUIElement.cpp; sourceTree = "<group>"; }; + BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityUIElementMac.mm; path = mac/AccessibilityUIElementMac.mm; sourceTree = "<group>"; }; BC4741290D038A4C0072B006 /* JavaScriptThreading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptThreading.h; sourceTree = "<group>"; }; BC4741400D038A570072B006 /* JavaScriptThreadingPthreads.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaScriptThreadingPthreads.cpp; path = pthreads/JavaScriptThreadingPthreads.cpp; sourceTree = "<group>"; }; BC9D90210C97472D0099A4A3 /* WorkQueue.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = WorkQueue.cpp; sourceTree = "<group>"; }; BC9D90220C97472E0099A4A3 /* WorkQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WorkQueue.h; sourceTree = "<group>"; }; BC9D90230C97472E0099A4A3 /* WorkQueueItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WorkQueueItem.h; sourceTree = "<group>"; }; BCA18B210C9B014B00114369 /* GCControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = GCControllerMac.mm; path = mac/GCControllerMac.mm; sourceTree = "<group>"; }; - BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = LayoutTestControllerMac.mm; path = mac/LayoutTestControllerMac.mm; sourceTree = "<group>"; }; + BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = LayoutTestControllerMac.mm; path = mac/LayoutTestControllerMac.mm; sourceTree = "<group>"; }; BCA18B250C9B015C00114369 /* WorkQueueItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = WorkQueueItemMac.mm; path = mac/WorkQueueItemMac.mm; sourceTree = "<group>"; }; BCA18B2F0C9B01B400114369 /* ObjCController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ObjCController.h; path = mac/ObjCController.h; sourceTree = "<group>"; }; BCA18B300C9B01B400114369 /* ObjCController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ObjCController.m; path = mac/ObjCController.m; sourceTree = "<group>"; }; @@ -192,6 +210,9 @@ BCB2848C0CFA8221007E533E /* PixelDumpSupportMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = PixelDumpSupportMac.mm; path = mac/PixelDumpSupportMac.mm; sourceTree = "<group>"; }; BCB284B20CFA82CB007E533E /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; }; BCB284F30CFA84F2007E533E /* ImageDiffCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ImageDiffCG.cpp; path = cg/ImageDiffCG.cpp; sourceTree = "<group>"; }; + BCD08A580E10496B00A7D0C1 /* AccessibilityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityController.h; sourceTree = "<group>"; }; + BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityController.cpp; sourceTree = "<group>"; }; + BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityControllerMac.mm; path = mac/AccessibilityControllerMac.mm; sourceTree = "<group>"; }; BCF6C64F0C98E9C000AC063E /* GCController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = GCController.cpp; sourceTree = "<group>"; }; /* End PBXFileReference section */ @@ -215,6 +236,7 @@ A84F608A08B136DA00E9745F /* Cocoa.framework in Frameworks */, A817090408B164D300CCB9FB /* JavaScriptCore.framework in Frameworks */, 9340995108540CAE007F3BC8 /* WebKit.framework in Frameworks */, + 23BCB8900EA57623003C6289 /* OpenGL.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -277,6 +299,12 @@ 1422A2690AF6F45200E1A883 /* Controllers */ = { isa = PBXGroup; children = ( + BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */, + BCD08A580E10496B00A7D0C1 /* AccessibilityController.h */, + BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */, + BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */, + BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */, + BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */, BCA18B360C9B021900114369 /* AppleScriptController.h */, BCA18B370C9B021900114369 /* AppleScriptController.m */, BCA18B6B0C9B08DB00114369 /* EventSendingController.h */, @@ -296,6 +324,7 @@ ); name = Controllers; sourceTree = "<group>"; + usesTabs = 0; }; 1422A2750AF6F4BD00E1A883 /* Delegates */ = { isa = PBXGroup; @@ -327,6 +356,15 @@ 9345229B0BD12B2C0086EDA0 /* Resources */ = { isa = PBXGroup; children = ( + 375F09710DAC3CB600C8B4E5 /* WebKitWeightWatcher100.ttf */, + 375F09720DAC3CB600C8B4E5 /* WebKitWeightWatcher200.ttf */, + 375F09730DAC3CB600C8B4E5 /* WebKitWeightWatcher300.ttf */, + 375F09740DAC3CB600C8B4E5 /* WebKitWeightWatcher400.ttf */, + 375F09750DAC3CB600C8B4E5 /* WebKitWeightWatcher500.ttf */, + 375F09760DAC3CB600C8B4E5 /* WebKitWeightWatcher600.ttf */, + 375F09770DAC3CB600C8B4E5 /* WebKitWeightWatcher700.ttf */, + 375F09780DAC3CB600C8B4E5 /* WebKitWeightWatcher800.ttf */, + 375F09790DAC3CB600C8B4E5 /* WebKitWeightWatcher900.ttf */, AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */, ); name = Resources; @@ -341,6 +379,7 @@ A817090308B164D300CCB9FB /* JavaScriptCore.framework */, B5A752A108AF5D1F00138E45 /* QuartzCore.framework */, 9335435F03D75502008635CE /* WebKit.framework */, + 23BCB88F0EA57623003C6289 /* OpenGL.framework */, ); name = Frameworks; sourceTree = "<group>"; @@ -433,6 +472,7 @@ BCB284C70CFA83C4007E533E /* PixelDumpSupport.h in Headers */, BCB284D00CFA83CC007E533E /* PixelDumpSupportCG.h in Headers */, BC47412A0D038A4C0072B006 /* JavaScriptThreading.h in Headers */, + BC0E24E00E2D9451001B6BC2 /* AccessibilityUIElement.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -526,7 +566,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 141BF44C096A45C800E0753C /* Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -573,6 +612,10 @@ BCB284CD0CFA83C8007E533E /* PixelDumpSupportCG.cpp in Sources */, BCB284D60CFA83D1007E533E /* PixelDumpSupportMac.mm in Sources */, BC4741410D038A570072B006 /* JavaScriptThreadingPthreads.cpp in Sources */, + BCD08B3A0E1057EF00A7D0C1 /* AccessibilityController.cpp in Sources */, + BCD08B710E1059D200A7D0C1 /* AccessibilityControllerMac.mm in Sources */, + BC0E24E10E2D9451001B6BC2 /* AccessibilityUIElement.cpp in Sources */, + BC0E26150E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -653,7 +696,7 @@ buildSettings = { COPY_PHASE_STRIP = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - OPTIMIZATION_CFLAGS = "-O0"; + GCC_OPTIMIZATION_LEVEL = 0; OTHER_CFLAGS = ""; OTHER_REZFLAGS = ""; PRODUCT_NAME = All; @@ -671,7 +714,7 @@ buildSettings = { COPY_PHASE_STRIP = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - OPTIMIZATION_CFLAGS = "-O0"; + GCC_OPTIMIZATION_LEVEL = 0; OTHER_CFLAGS = ""; OTHER_REZFLAGS = ""; PRODUCT_NAME = All; diff --git a/WebKitTools/DumpRenderTree/DumpRenderTreePrefix.h b/WebKitTools/DumpRenderTree/DumpRenderTreePrefix.h index cb40968..1344754 100644 --- a/WebKitTools/DumpRenderTree/DumpRenderTreePrefix.h +++ b/WebKitTools/DumpRenderTree/DumpRenderTreePrefix.h @@ -31,3 +31,8 @@ #import <Foundation/Foundation.h> #endif + +// If we don't define these, they get defined in windef.h. +// We want to use std::min and std::max +#define max max +#define min min diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/Locker.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/Locker.h new file mode 100644 index 0000000..75b0acd --- /dev/null +++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/Locker.h @@ -0,0 +1 @@ +#include <JavaScriptCore/Locker.h> diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/MathExtras.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/MathExtras.h new file mode 100644 index 0000000..2955786 --- /dev/null +++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/MathExtras.h @@ -0,0 +1 @@ +#include <JavaScriptCore/MathExtras.h> diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/PassRefPtr.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/PassRefPtr.h new file mode 100644 index 0000000..aafd1a2 --- /dev/null +++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/PassRefPtr.h @@ -0,0 +1 @@ +#include <JavaScriptCore/PassRefPtr.h> diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/RefCounted.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/RefCounted.h new file mode 100644 index 0000000..628a63b --- /dev/null +++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/RefCounted.h @@ -0,0 +1 @@ +#include <JavaScriptCore/RefCounted.h> diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/RefPtr.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/RefPtr.h new file mode 100644 index 0000000..0ff6213 --- /dev/null +++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/RefPtr.h @@ -0,0 +1 @@ +#include <JavaScriptCore/RefPtr.h> diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/Threading.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/Threading.h new file mode 100644 index 0000000..17359e5 --- /dev/null +++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/Threading.h @@ -0,0 +1 @@ +#include <JavaScriptCore/Threading.h> diff --git a/WebKitTools/DumpRenderTree/GCController.cpp b/WebKitTools/DumpRenderTree/GCController.cpp index 38c45bf..e1a16f2 100644 --- a/WebKitTools/DumpRenderTree/GCController.cpp +++ b/WebKitTools/DumpRenderTree/GCController.cpp @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "GCController.h" #include <JavaScriptCore/JSObjectRef.h> diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp index bda93ce..f450543 100644 --- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp +++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp @@ -26,21 +26,25 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "LayoutTestController.h" #include <JavaScriptCore/JSObjectRef.h> #include <JavaScriptCore/JSRetainPtr.h> #include <wtf/Assertions.h> +#include <wtf/MathExtras.h> -LayoutTestController::LayoutTestController(bool testRepaintDefault, bool testRepaintSweepHorizontallyDefault) +LayoutTestController::LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash) : m_dumpAsText(false) + , m_dumpAsPDF(false) , m_dumpBackForwardList(false) , m_dumpChildFrameScrollPositions(false) , m_dumpChildFramesAsText(false) + , m_dumpDatabaseCallbacks(false) , m_dumpDOMAsWebArchive(false) , m_dumpSelectionRect(false) , m_dumpSourceAsWebArchive(false) + , m_dumpStatusCallbacks(false) , m_dumpTitleChanges(false) , m_dumpEditingCallbacks(false) , m_dumpResourceLoadCallbacks(false) @@ -49,11 +53,15 @@ LayoutTestController::LayoutTestController(bool testRepaintDefault, bool testRep , m_callCloseOnWebViews(true) , m_canOpenWindows(false) , m_closeRemainingWindowsWhenComplete(true) - , m_testRepaint(testRepaintDefault) - , m_testRepaintSweepHorizontally(testRepaintSweepHorizontallyDefault) + , m_stopProvisionalFrameLoads(false) + , m_testOnscreen(false) + , m_testRepaint(false) + , m_testRepaintSweepHorizontally(false) , m_waitToDump(false) , m_windowIsKey(true) , m_globalFlag(false) + , m_testPathOrURL(testPathOrURL) + , m_expectedPixelHash(expectedPixelHash) { } @@ -66,6 +74,13 @@ static JSValueRef dumpAsTextCallback(JSContextRef context, JSObjectRef function, return JSValueMakeUndefined(context); } +static JSValueRef dumpAsPDFCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->setDumpAsPDF(true); + return JSValueMakeUndefined(context); +} + static JSValueRef dumpBackForwardListCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); @@ -87,24 +102,24 @@ static JSValueRef dumpChildFrameScrollPositionsCallback(JSContextRef context, JS return JSValueMakeUndefined(context); } -static JSValueRef dumpDOMAsWebArchiveCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +static JSValueRef dumpDatabaseCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); - controller->setDumpDOMAsWebArchive(true); + controller->setDumpDatabaseCallbacks(true); return JSValueMakeUndefined(context); } -static JSValueRef dumpEditingCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +static JSValueRef dumpDOMAsWebArchiveCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); - controller->setDumpEditingCallbacks(true); + controller->setDumpDOMAsWebArchive(true); return JSValueMakeUndefined(context); } -static JSValueRef dumpFrameLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +static JSValueRef dumpEditingCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); - controller->setDumpFrameLoadCallbacks(true); + controller->setDumpEditingCallbacks(true); return JSValueMakeUndefined(context); } @@ -129,6 +144,13 @@ static JSValueRef dumpSourceAsWebArchiveCallback(JSContextRef context, JSObjectR return JSValueMakeUndefined(context); } +static JSValueRef dumpStatusCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->setDumpStatusCallbacks(true); + return JSValueMakeUndefined(context); +} + static JSValueRef dumpTitleChangesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); @@ -186,6 +208,13 @@ static JSValueRef setCloseRemainingWindowsWhenCompleteCallback(JSContextRef cont return JSValueMakeUndefined(context); } +static JSValueRef testOnscreenCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->setTestOnscreen(true); + return JSValueMakeUndefined(context); +} + static JSValueRef testRepaintCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); @@ -215,6 +244,15 @@ static JSValueRef addDisallowedURLCallback(JSContextRef context, JSObjectRef fun return JSValueMakeUndefined(context); } +static JSValueRef clearAllDatabasesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + // Has mac & windows implementation + LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->clearAllDatabases(); + + return JSValueMakeUndefined(context); +} + static JSValueRef clearBackForwardListCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation @@ -310,7 +348,6 @@ static JSValueRef notifyDoneCallback(JSContextRef context, JSObjectRef function, // May be able to be made platform independant by using shared WorkQueue LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); controller->notifyDone(); - return JSValueMakeUndefined(context); } @@ -432,6 +469,32 @@ static JSValueRef setCustomPolicyDelegateCallback(JSContextRef context, JSObject return JSValueMakeUndefined(context); } +static JSValueRef setDatabaseQuotaCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + // Has mac implementation + if (argumentCount < 1) + return JSValueMakeUndefined(context); + + LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + + double quota = JSValueToNumber(context, arguments[0], NULL); + if (!isnan(quota)) + controller->setDatabaseQuota(static_cast<unsigned long long>(quota)); + + return JSValueMakeUndefined(context); + +} + +static JSValueRef setJavaScriptProfilingEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + if (argumentCount < 1) + return JSValueMakeUndefined(context); + + LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->setJavaScriptProfilingEnabled(JSValueToBoolean(context, arguments[0])); + return JSValueMakeUndefined(context); +} + static JSValueRef setMainFrameIsFirstResponderCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac implementation @@ -563,6 +626,33 @@ static JSValueRef setPopupBlockingEnabledCallback(JSContextRef context, JSObject return JSValueMakeUndefined(context); } +static JSValueRef setSmartInsertDeleteEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + if (argumentCount < 1) + return JSValueMakeUndefined(context); + + LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->setSmartInsertDeleteEnabled(JSValueToBoolean(context, arguments[0])); + return JSValueMakeUndefined(context); +} + +static JSValueRef setStopProvisionalFrameLoadsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->setStopProvisionalFrameLoads(true); + return JSValueMakeUndefined(context); +} + +static JSValueRef elementDoesAutoCompleteForElementWithIdCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[0], exception)); + ASSERT(!*exception); + + bool autoCompletes = controller->elementDoesAutoCompleteForElementWithId(elementId.get()); + + return JSValueMakeBoolean(context, autoCompletes); +} // Static Values @@ -579,11 +669,18 @@ static bool setGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, return true; } +static void layoutTestControllerObjectFinalize(JSObjectRef object) +{ + LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(object)); + controller->deref(); +} + // Object Creation void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) { JSRetainPtr<JSStringRef> layoutTestContollerStr(Adopt, JSStringCreateWithUTF8CString("layoutTestController")); + ref(); JSValueRef layoutTestContollerObject = JSObjectMake(context, getJSClass(), this); JSObjectSetProperty(context, windowObject, layoutTestContollerStr.get(), layoutTestContollerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); } @@ -597,7 +694,7 @@ JSClassRef LayoutTestController::getJSClass() JSStaticFunction* staticFunctions = LayoutTestController::staticFunctions(); JSClassDefinition classDefinition = { 0, kJSClassAttributeNone, "LayoutTestController", 0, staticValues, staticFunctions, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0, layoutTestControllerObjectFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; layoutTestControllerClass = JSClassCreate(&classDefinition); @@ -621,20 +718,23 @@ JSStaticFunction* LayoutTestController::staticFunctions() static JSStaticFunction staticFunctions[] = { { "addDisallowedURL", addDisallowedURLCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "addFileToPasteboardOnDrag", addFileToPasteboardOnDragCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "clearAllDatabases", clearAllDatabasesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "clearBackForwardList", clearBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "clearPersistentUserStyleSheet", clearPersistentUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "decodeHostName", decodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "display", displayCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpAsText", dumpAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "printToPDF", dumpAsPDFCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpBackForwardList", dumpBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpChildFramesAsText", dumpChildFramesAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpChildFrameScrollPositions", dumpChildFrameScrollPositionsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "dumpDatabaseCallbacks", dumpDatabaseCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpDOMAsWebArchive", dumpDOMAsWebArchiveCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpEditingCallbacks", dumpEditingCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { "dumpFrameLoadCallbacks", dumpFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpResourceLoadCallbacks", dumpResourceLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpSelectionRect", dumpSelectionRectCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpSourceAsWebArchive", dumpSourceAsWebArchiveCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "dumpStatusCallbacks", dumpStatusCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpTitleChanges", dumpTitleChangesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "encodeHostName", encodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "execCommand", execCommandCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -653,18 +753,24 @@ JSStaticFunction* LayoutTestController::staticFunctions() { "setCanOpenWindows", setCanOpenWindowsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setCloseRemainingWindowsWhenComplete", setCloseRemainingWindowsWhenCompleteCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setCustomPolicyDelegate", setCustomPolicyDelegateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "setDatabaseQuota", setDatabaseQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "setJavaScriptProfilingEnabled", setJavaScriptProfilingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setMainFrameIsFirstResponder", setMainFrameIsFirstResponderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setPersistentUserStyleSheetLocation", setPersistentUserStyleSheetLocationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setPrivateBrowsingEnabled", setPrivateBrowsingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setPopupBlockingEnabled", setPopupBlockingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "setSmartInsertDeleteEnabled", setSmartInsertDeleteEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "setStopProvisionalFrameLoads", setStopProvisionalFrameLoadsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setTabKeyCyclesThroughElements", setTabKeyCyclesThroughElementsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setUseDashboardCompatibilityMode", setUseDashboardCompatibilityModeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setUserStyleSheetEnabled", setUserStyleSheetEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setUserStyleSheetLocation", setUserStyleSheetLocationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setWindowIsKey", setWindowIsKeyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "testOnscreen", testOnscreenCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "testRepaint", testRepaintCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "waitUntilDone", waitUntilDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "windowCount", windowCountCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "elementDoesAutoCompleteForElementWithId", elementDoesAutoCompleteForElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { 0, 0, 0 } }; diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h index 9677ffa..f27c2c6 100644 --- a/WebKitTools/DumpRenderTree/LayoutTestController.h +++ b/WebKitTools/DumpRenderTree/LayoutTestController.h @@ -30,16 +30,19 @@ #define LayoutTestController_h #include <JavaScriptCore/JSObjectRef.h> +#include <wtf/RefCounted.h> +#include <string> -class LayoutTestController { +class LayoutTestController : public RefCounted<LayoutTestController> { public: - LayoutTestController(bool testRepaintDefault, bool testRepaintSweepHorizontallyDefault); + LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash); ~LayoutTestController(); void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception); // Controller Methods - platfrom independant implementations void addDisallowedURL(JSStringRef url); + void clearAllDatabases(); void clearBackForwardList(); JSStringRef copyDecodedHostName(JSStringRef name); JSStringRef copyEncodedHostName(JSStringRef name); @@ -56,20 +59,28 @@ public: void setAcceptsEditing(bool acceptsEditing); void setAuthorAndUserStylesEnabled(bool); void setCustomPolicyDelegate(bool setDelegate); + void setDatabaseQuota(unsigned long long quota); void setMainFrameIsFirstResponder(bool flag); void setPrivateBrowsingEnabled(bool flag); void setPopupBlockingEnabled(bool flag); void setTabKeyCyclesThroughElements(bool cycles); + void setSmartInsertDeleteEnabled(bool flag); + void setJavaScriptProfilingEnabled(bool profilingEnabled); void setUseDashboardCompatibilityMode(bool flag); void setUserStyleSheetEnabled(bool flag); void setUserStyleSheetLocation(JSStringRef path); void setPersistentUserStyleSheetLocation(JSStringRef path); void clearPersistentUserStyleSheet(); int windowCount(); + + bool elementDoesAutoCompleteForElementWithId(JSStringRef id); bool dumpAsText() const { return m_dumpAsText; } void setDumpAsText(bool dumpAsText) { m_dumpAsText = dumpAsText; } + bool dumpAsPDF() const { return m_dumpAsPDF; } + void setDumpAsPDF(bool dumpAsPDF) { m_dumpAsPDF = dumpAsPDF; } + bool dumpBackForwardList() const { return m_dumpBackForwardList; } void setDumpBackForwardList(bool dumpBackForwardList) { m_dumpBackForwardList = dumpBackForwardList; } @@ -79,6 +90,12 @@ public: bool dumpChildFramesAsText() const { return m_dumpChildFramesAsText; } void setDumpChildFramesAsText(bool dumpChildFramesAsText) { m_dumpChildFramesAsText = dumpChildFramesAsText; } + bool dumpDatabaseCallbacks() const { return m_dumpDatabaseCallbacks; } + void setDumpDatabaseCallbacks(bool dumpDatabaseCallbacks) { m_dumpDatabaseCallbacks = dumpDatabaseCallbacks; } + + bool dumpStatusCallbacks() const { return m_dumpStatusCallbacks; } + void setDumpStatusCallbacks(bool dumpStatusCallbacks) { m_dumpStatusCallbacks = dumpStatusCallbacks; } + bool dumpDOMAsWebArchive() const { return m_dumpDOMAsWebArchive; } void setDumpDOMAsWebArchive(bool dumpDOMAsWebArchive) { m_dumpDOMAsWebArchive = dumpDOMAsWebArchive; } @@ -111,6 +128,12 @@ public: bool closeRemainingWindowsWhenComplete() const { return m_closeRemainingWindowsWhenComplete; } void setCloseRemainingWindowsWhenComplete(bool closeRemainingWindowsWhenComplete) { m_closeRemainingWindowsWhenComplete = closeRemainingWindowsWhenComplete; } + + bool stopProvisionalFrameLoads() const { return m_stopProvisionalFrameLoads; } + void setStopProvisionalFrameLoads(bool stopProvisionalFrameLoads) { m_stopProvisionalFrameLoads = stopProvisionalFrameLoads; } + + bool testOnscreen() const { return m_testOnscreen; } + void setTestOnscreen(bool testOnscreen) { m_testOnscreen = testOnscreen; } bool testRepaint() const { return m_testRepaint; } void setTestRepaint(bool testRepaint) { m_testRepaint = testRepaint; } @@ -127,14 +150,20 @@ public: bool globalFlag() const { return m_globalFlag; } void setGlobalFlag(bool globalFlag) { m_globalFlag = globalFlag; } + const std::string& testPathOrURL() const { return m_testPathOrURL; } + const std::string& expectedPixelHash() const { return m_expectedPixelHash; } + private: bool m_dumpAsText; + bool m_dumpAsPDF; bool m_dumpBackForwardList; bool m_dumpChildFrameScrollPositions; bool m_dumpChildFramesAsText; + bool m_dumpDatabaseCallbacks; bool m_dumpDOMAsWebArchive; bool m_dumpSelectionRect; bool m_dumpSourceAsWebArchive; + bool m_dumpStatusCallbacks; bool m_dumpTitleChanges; bool m_dumpEditingCallbacks; bool m_dumpResourceLoadCallbacks; @@ -143,6 +172,8 @@ private: bool m_callCloseOnWebViews; bool m_canOpenWindows; bool m_closeRemainingWindowsWhenComplete; + bool m_stopProvisionalFrameLoads; + bool m_testOnscreen; bool m_testRepaint; bool m_testRepaintSweepHorizontally; bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called. @@ -150,6 +181,9 @@ private: bool m_globalFlag; + std::string m_testPathOrURL; + std::string m_expectedPixelHash; // empty string if no hash + static JSClassRef getJSClass(); static JSStaticValue* staticValues(); static JSStaticFunction* staticFunctions(); diff --git a/WebKitTools/DumpRenderTree/PixelDumpSupport.h b/WebKitTools/DumpRenderTree/PixelDumpSupport.h index 3214d04..d4f8948 100644 --- a/WebKitTools/DumpRenderTree/PixelDumpSupport.h +++ b/WebKitTools/DumpRenderTree/PixelDumpSupport.h @@ -29,12 +29,18 @@ #ifndef PixelDumpSupport_h #define PixelDumpSupport_h -void dumpWebViewAsPixelsAndCompareWithExpected(const char* currentTest, bool forceAllTestsToDumpPixels); +#include <string> + +void dumpWebViewAsPixelsAndCompareWithExpected(const std::string& expectedHash); + +#if PLATFORM(MAC) // Can be used as a signal handler -void restoreColorSpace(int ignored); +void restoreMainDisplayColorProfile(int ignored); + +// May change your color space, requiring a call to restoreMainDisplayColorProfile +void setupMainDisplayColorProfile(); -// May change your color space, requiring a call to restoreColorSpace -void initializeColorSpaceAndScreeBufferForPixelTests(); +#endif #endif // PixelDumpSupport_h diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp index 4cd4c04..11fb30d 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp @@ -1,34 +1,26 @@ /* - IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in - consideration of your agreement to the following terms, and your use, installation, - modification or redistribution of this Apple software constitutes acceptance of these - terms. If you do not agree with these terms, please do not use, install, modify or - redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject to these - terms, Apple grants you a personal, non-exclusive license, under Apple’s copyrights in - this original Apple software (the "Apple Software"), to use, reproduce, modify and - redistribute the Apple Software, with or without modifications, in source and/or binary - forms; provided that if you redistribute the Apple Software in its entirety and without - modifications, you must retain this notice and the following text and disclaimers in all - such redistributions of the Apple Software. Neither the name, trademarks, service marks - or logos of Apple Computer, Inc. may be used to endorse or promote products derived from - the Apple Software without specific prior written permission from Apple. Except as expressly - stated in this notice, no other rights or licenses, express or implied, are granted by Apple - herein, including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, - EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS - USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, - REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND - WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR - OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright (C) 2006, 2007, 2008 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. ``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 + * 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. */ #include "PluginObject.h" @@ -37,22 +29,22 @@ #include <assert.h> #include <stdio.h> -static void pluginInvalidate(NPObject *obj); -static bool pluginHasProperty(NPObject *obj, NPIdentifier name); -static bool pluginHasMethod(NPObject *obj, NPIdentifier name); -static bool pluginGetProperty(NPObject *obj, NPIdentifier name, NPVariant *variant); -static bool pluginSetProperty(NPObject *obj, NPIdentifier name, const NPVariant *variant); -static bool pluginInvoke(NPObject *obj, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result); -static bool pluginInvokeDefault(NPObject *obj, const NPVariant *args, uint32_t argCount, NPVariant *result); -static NPObject *pluginAllocate(NPP npp, NPClass *theClass); -static void pluginDeallocate(NPObject *obj); +static void pluginInvalidate(NPObject*); +static bool pluginHasProperty(NPObject*, NPIdentifier name); +static bool pluginHasMethod(NPObject*, NPIdentifier name); +static bool pluginGetProperty(NPObject*, NPIdentifier name, NPVariant*); +static bool pluginSetProperty(NPObject*, NPIdentifier name, const NPVariant*); +static bool pluginInvoke(NPObject*, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result); +static bool pluginInvokeDefault(NPObject*, const NPVariant* args, uint32_t argCount, NPVariant* result); +static NPObject* pluginAllocate(NPP npp, NPClass*); +static void pluginDeallocate(NPObject*); -NPNetscapeFuncs *browser; +NPNetscapeFuncs* browser; -static NPClass pluginClass = { +static NPClass pluginClass = { NP_CLASS_STRUCT_VERSION, - pluginAllocate, - pluginDeallocate, + pluginAllocate, + pluginDeallocate, pluginInvalidate, pluginHasMethod, pluginInvoke, @@ -61,7 +53,7 @@ static NPClass pluginClass = { pluginGetProperty, pluginSetProperty, }; - + NPClass *getPluginClass(void) { return &pluginClass; @@ -69,12 +61,13 @@ NPClass *getPluginClass(void) static bool identifiersInitialized = false; -#define ID_PROPERTY_PROPERTY 0 -#define ID_PROPERTY_EVENT_LOGGING 1 -#define ID_PROPERTY_HAS_STREAM 2 -#define ID_PROPERTY_TEST_OBJECT 3 -#define ID_PROPERTY_LOG_DESTROY 4 -#define NUM_PROPERTY_IDENTIFIERS 5 +#define ID_PROPERTY_PROPERTY 0 +#define ID_PROPERTY_EVENT_LOGGING 1 +#define ID_PROPERTY_HAS_STREAM 2 +#define ID_PROPERTY_TEST_OBJECT 3 +#define ID_PROPERTY_LOG_DESTROY 4 +#define ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM 5 +#define NUM_PROPERTY_IDENTIFIERS 6 static NPIdentifier pluginPropertyIdentifiers[NUM_PROPERTY_IDENTIFIERS]; static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = { @@ -83,6 +76,7 @@ static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = { "hasStream", "testObject", "logDestroy", + "returnErrorFromNewStream", }; #define ID_TEST_CALLBACK_METHOD 0 @@ -97,7 +91,11 @@ static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = { #define ID_TEST_GET_PROPERTY 9 #define ID_TEST_EVALUATE 10 #define ID_TEST_GET_PROPERTY_RETURN_VALUE 11 -#define NUM_METHOD_IDENTIFIERS 12 +#define ID_TEST_IDENTIFIER_TO_STRING 12 +#define ID_TEST_IDENTIFIER_TO_INT 13 +#define ID_TEST_POSTURL_FILE 14 +#define ID_TEST_CONSTRUCT 15 +#define NUM_METHOD_IDENTIFIERS 16 static NPIdentifier pluginMethodIdentifiers[NUM_METHOD_IDENTIFIERS]; static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = { @@ -113,9 +111,13 @@ static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = { "testGetProperty", "testEvaluate", "testGetPropertyReturnValue", + "testIdentifierToString", + "testIdentifierToInt", + "testPostURLFile", + "testConstruct", }; -static NPUTF8* createCStringFromNPVariant(const NPVariant *variant) +static NPUTF8* createCStringFromNPVariant(const NPVariant* variant) { size_t length = NPVARIANT_TO_STRING(*variant).UTF8Length; NPUTF8* result = (NPUTF8*)malloc(length + 1); @@ -146,46 +148,54 @@ static bool pluginHasMethod(NPObject *obj, NPIdentifier name) return false; } -static bool pluginGetProperty(NPObject *obj, NPIdentifier name, NPVariant *variant) +static bool pluginGetProperty(NPObject* obj, NPIdentifier name, NPVariant* result) { + PluginObject* plugin = reinterpret_cast<PluginObject*>(obj); if (name == pluginPropertyIdentifiers[ID_PROPERTY_PROPERTY]) { - STRINGZ_TO_NPVARIANT("property", *variant); + STRINGZ_TO_NPVARIANT("property", *result); return true; } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_EVENT_LOGGING]) { - BOOLEAN_TO_NPVARIANT(((PluginObject *)obj)->eventLogging, *variant); + BOOLEAN_TO_NPVARIANT(plugin->eventLogging, *result); return true; } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_LOG_DESTROY]) { - BOOLEAN_TO_NPVARIANT(((PluginObject *)obj)->logDestroy, *variant); - return true; + BOOLEAN_TO_NPVARIANT(plugin->logDestroy, *result); + return true; } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_HAS_STREAM]) { - BOOLEAN_TO_NPVARIANT(((PluginObject *)obj)->stream != 0, *variant); + BOOLEAN_TO_NPVARIANT(plugin->stream != 0, *result); return true; } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_TEST_OBJECT]) { - NPObject *testObject = ((PluginObject *)obj)->testObject; + NPObject* testObject = plugin->testObject; browser->retainobject(testObject); - OBJECT_TO_NPVARIANT(testObject, *variant); + OBJECT_TO_NPVARIANT(testObject, *result); + return true; + } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM]) { + BOOLEAN_TO_NPVARIANT(plugin->returnErrorFromNewStream, *result); return true; } return false; } -static bool pluginSetProperty(NPObject *obj, NPIdentifier name, const NPVariant *variant) +static bool pluginSetProperty(NPObject* obj, NPIdentifier name, const NPVariant* variant) { + PluginObject* plugin = reinterpret_cast<PluginObject*>(obj); if (name == pluginPropertyIdentifiers[ID_PROPERTY_EVENT_LOGGING]) { - ((PluginObject *)obj)->eventLogging = NPVARIANT_TO_BOOLEAN(*variant); + plugin->eventLogging = NPVARIANT_TO_BOOLEAN(*variant); return true; } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_LOG_DESTROY]) { - ((PluginObject *)obj)->logDestroy = NPVARIANT_TO_BOOLEAN(*variant); + plugin->logDestroy = NPVARIANT_TO_BOOLEAN(*variant); + return true; + } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM]) { + plugin->returnErrorFromNewStream = NPVARIANT_TO_BOOLEAN(*variant); return true; } - + return false; } -static void testDOMAccess(PluginObject *obj) +static bool testDOMAccess(PluginObject* obj, const NPVariant*, uint32_t, NPVariant* result) { // Get plug-in's DOM element - NPObject *elementObject; + NPObject* elementObject; if (browser->getvalue(obj->npp, NPNVPluginElementNPObject, &elementObject) == NPERR_NO_ERROR) { // Get style NPVariant styleVariant; @@ -198,199 +208,386 @@ static void testDOMAccess(PluginObject *obj) browser->setproperty(obj->npp, NPVARIANT_TO_OBJECT(styleVariant), borderIdentifier, &borderVariant); browser->releasevariantvalue(&styleVariant); } - + browser->releaseobject(elementObject); } + VOID_TO_NPVARIANT(*result); + return true; } -static bool pluginInvoke(NPObject *header, NPIdentifier name, const NPVariant *args, uint32_t argCount, NPVariant *result) +static NPIdentifier stringVariantToIdentifier(NPVariant variant) { - PluginObject *obj = (PluginObject *)header; - if (name == pluginMethodIdentifiers[ID_TEST_CALLBACK_METHOD]) { - // call whatever method name we're given - if (argCount > 0 && NPVARIANT_IS_STRING(args[0])) { - NPObject *windowScriptObject; - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); + assert(NPVARIANT_IS_STRING(variant)); + NPUTF8* utf8String = createCStringFromNPVariant(&variant); + NPIdentifier identifier = browser->getstringidentifier(utf8String); + free(utf8String); + return identifier; +} - NPUTF8* callbackString = createCStringFromNPVariant(&args[0]); - NPIdentifier callbackIdentifier = browser->getstringidentifier(callbackString); - free(callbackString); +static NPIdentifier int32VariantToIdentifier(NPVariant variant) +{ + assert(NPVARIANT_IS_INT32(variant)); + int32 integer = NPVARIANT_TO_INT32(variant); + return browser->getintidentifier(integer); +} - NPVariant browserResult; - browser->invoke(obj->npp, windowScriptObject, callbackIdentifier, 0, 0, &browserResult); - browser->releasevariantvalue(&browserResult); +static NPIdentifier doubleVariantToIdentifier(NPVariant variant) +{ + assert(NPVARIANT_IS_DOUBLE(variant)); + double value = NPVARIANT_TO_DOUBLE(variant); + // Sadly there is no "getdoubleidentifier" + int32 integer = static_cast<int32>(value); + return browser->getintidentifier(integer); +} - VOID_TO_NPVARIANT(*result); - return true; - } - } else if (name == pluginMethodIdentifiers[ID_TEST_GETURL]) { - if (argCount == 2 && NPVARIANT_IS_STRING(args[0]) && NPVARIANT_IS_STRING(args[1])) { - NPUTF8* urlString = createCStringFromNPVariant(&args[0]); - NPUTF8* targetString = createCStringFromNPVariant(&args[1]); - browser->geturl(obj->npp, urlString, targetString); - free(urlString); - free(targetString); - - VOID_TO_NPVARIANT(*result); - return true; - } else if (argCount == 1 && NPVARIANT_IS_STRING(args[0])) { - NPUTF8* urlString = createCStringFromNPVariant(&args[0]); - browser->geturl(obj->npp, urlString, 0); - free(urlString); +static NPIdentifier variantToIdentifier(NPVariant variant) +{ + if (NPVARIANT_IS_STRING(variant)) + return stringVariantToIdentifier(variant); + else if (NPVARIANT_IS_INT32(variant)) + return int32VariantToIdentifier(variant); + else if (NPVARIANT_IS_DOUBLE(variant)) + return doubleVariantToIdentifier(variant); + return 0; +} - VOID_TO_NPVARIANT(*result); - return true; - } - } else if (name == pluginMethodIdentifiers[ID_REMOVE_DEFAULT_METHOD]) { - pluginClass.invokeDefault = 0; - VOID_TO_NPVARIANT(*result); +static bool testIdentifierToString(PluginObject*, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (argCount != 1) + return false; + NPIdentifier identifier = variantToIdentifier(args[0]); + if (!identifier) + return false; + NPUTF8* utf8String = browser->utf8fromidentifier(identifier); + if (!utf8String) + return false; + STRINGZ_TO_NPVARIANT(utf8String, *result); + return true; +} + +static bool testIdentifierToInt(PluginObject*, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (argCount != 1) + return false; + NPIdentifier identifier = variantToIdentifier(args[0]); + if (!identifier) + return false; + int32 integer = browser->intfromidentifier(identifier); + INT32_TO_NPVARIANT(integer, *result); + return true; +} + +static bool testCallback(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (argCount == 0 || !NPVARIANT_IS_STRING(args[0])) + return false; + + NPObject* windowScriptObject; + browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); + + NPUTF8* callbackString = createCStringFromNPVariant(&args[0]); + NPIdentifier callbackIdentifier = browser->getstringidentifier(callbackString); + free(callbackString); + + NPVariant browserResult; + browser->invoke(obj->npp, windowScriptObject, callbackIdentifier, 0, 0, &browserResult); + browser->releasevariantvalue(&browserResult); + + browser->releaseobject(windowScriptObject); + + VOID_TO_NPVARIANT(*result); + return true; +} + +static bool getURL(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (argCount == 2 && NPVARIANT_IS_STRING(args[0]) && NPVARIANT_IS_STRING(args[1])) { + NPUTF8* urlString = createCStringFromNPVariant(&args[0]); + NPUTF8* targetString = createCStringFromNPVariant(&args[1]); + NPError npErr = browser->geturl(obj->npp, urlString, targetString); + free(urlString); + free(targetString); + + INT32_TO_NPVARIANT(npErr, *result); return true; - } else if (name == pluginMethodIdentifiers[ID_TEST_DOM_ACCESS]) { - testDOMAccess(obj); - VOID_TO_NPVARIANT(*result); + } else if (argCount == 1 && NPVARIANT_IS_STRING(args[0])) { + NPUTF8* urlString = createCStringFromNPVariant(&args[0]); + NPError npErr = browser->geturl(obj->npp, urlString, 0); + free(urlString); + + INT32_TO_NPVARIANT(npErr, *result); return true; - } else if (name == pluginMethodIdentifiers[ID_TEST_GET_URL_NOTIFY]) { - if (argCount == 3 - && NPVARIANT_IS_STRING(args[0]) - && (NPVARIANT_IS_STRING(args[1]) || NPVARIANT_IS_NULL(args[1])) - && NPVARIANT_IS_STRING(args[2])) { - NPUTF8* urlString = createCStringFromNPVariant(&args[0]); - NPUTF8* targetString = (NPVARIANT_IS_STRING(args[1]) ? createCStringFromNPVariant(&args[1]) : NULL); - NPUTF8* callbackString = createCStringFromNPVariant(&args[2]); - - NPIdentifier callbackIdentifier = browser->getstringidentifier(callbackString); - browser->geturlnotify(obj->npp, urlString, targetString, callbackIdentifier); - - free(urlString); - free(targetString); - free(callbackString); - - VOID_TO_NPVARIANT(*result); - return true; - } - } else if (name == pluginMethodIdentifiers[ID_TEST_INVOKE_DEFAULT] && NPVARIANT_IS_OBJECT(args[0])) { - NPObject *callback = NPVARIANT_TO_OBJECT(args[0]); - - NPVariant args[1]; - NPVariant browserResult; - - STRINGZ_TO_NPVARIANT("test", args[0]); - bool retval = browser->invokeDefault(obj->npp, callback, args, 1, &browserResult); - - if (retval) + } + return false; +} + +static bool removeDefaultMethod(PluginObject*, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + pluginClass.invokeDefault = 0; + VOID_TO_NPVARIANT(*result); + return true; +} + +static bool getURLNotify(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (argCount != 3 || !NPVARIANT_IS_STRING(args[0]) + || (!NPVARIANT_IS_STRING(args[1]) && !NPVARIANT_IS_NULL(args[1])) + || !NPVARIANT_IS_STRING(args[2])) + return false; + + NPUTF8* urlString = createCStringFromNPVariant(&args[0]); + NPUTF8* targetString = (NPVARIANT_IS_STRING(args[1]) ? createCStringFromNPVariant(&args[1]) : NULL); + NPUTF8* callbackString = createCStringFromNPVariant(&args[2]); + + NPIdentifier callbackIdentifier = browser->getstringidentifier(callbackString); + browser->geturlnotify(obj->npp, urlString, targetString, callbackIdentifier); + + free(urlString); + free(targetString); + free(callbackString); + + VOID_TO_NPVARIANT(*result); + return true; +} + +static bool testInvokeDefault(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (!NPVARIANT_IS_OBJECT(args[0])) + return false; + + NPObject *callback = NPVARIANT_TO_OBJECT(args[0]); + + NPVariant invokeArgs[1]; + NPVariant browserResult; + + STRINGZ_TO_NPVARIANT("test", invokeArgs[0]); + bool retval = browser->invokeDefault(obj->npp, callback, invokeArgs, 1, &browserResult); + + if (retval) + browser->releasevariantvalue(&browserResult); + + BOOLEAN_TO_NPVARIANT(retval, *result); + return true; +} + +static bool destroyStream(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + NPError npError = browser->destroystream(obj->npp, obj->stream, NPRES_USER_BREAK); + INT32_TO_NPVARIANT(npError, *result); + return true; +} + +static bool testEnumerate(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (argCount != 2 || !NPVARIANT_IS_OBJECT(args[0]) || !NPVARIANT_IS_OBJECT(args[1])) + return false; + + uint32_t count; + NPIdentifier* identifiers; + if (browser->enumerate(obj->npp, NPVARIANT_TO_OBJECT(args[0]), &identifiers, &count)) { + NPObject* outArray = NPVARIANT_TO_OBJECT(args[1]); + NPIdentifier pushIdentifier = browser->getstringidentifier("push"); + + for (uint32_t i = 0; i < count; i++) { + NPUTF8* string = browser->utf8fromidentifier(identifiers[i]); + + if (!string) + continue; + + NPVariant args[1]; + STRINGZ_TO_NPVARIANT(string, args[0]); + NPVariant browserResult; + browser->invoke(obj->npp, outArray, pushIdentifier, args, 1, &browserResult); browser->releasevariantvalue(&browserResult); - - BOOLEAN_TO_NPVARIANT(retval, *result); - return true; - } else if (name == pluginMethodIdentifiers[ID_TEST_ENUMERATE]) { - if (argCount == 2 && NPVARIANT_IS_OBJECT(args[0]) && NPVARIANT_IS_OBJECT(args[1])) { - uint32_t count; - NPIdentifier* identifiers; - - if (browser->enumerate(obj->npp, NPVARIANT_TO_OBJECT(args[0]), &identifiers, &count)) { - NPObject* outArray = NPVARIANT_TO_OBJECT(args[1]); - NPIdentifier pushIdentifier = browser->getstringidentifier("push"); - - for (uint32_t i = 0; i < count; i++) { - NPUTF8* string = browser->utf8fromidentifier(identifiers[i]); - - if (!string) - continue; - - NPVariant args[1]; - STRINGZ_TO_NPVARIANT(string, args[0]); - NPVariant browserResult; - browser->invoke(obj->npp, outArray, pushIdentifier, args, 1, &browserResult); - browser->releasevariantvalue(&browserResult); - browser->memfree(string); - } - - browser->memfree(identifiers); - } - - VOID_TO_NPVARIANT(*result); - return true; - } - } else if (name == pluginMethodIdentifiers[ID_DESTROY_STREAM]) { - NPError npError = browser->destroystream(obj->npp, obj->stream, NPRES_USER_BREAK); - INT32_TO_NPVARIANT(npError, *result); - return true; - } else if (name == pluginMethodIdentifiers[ID_TEST_GETINTIDENTIFIER]) { - if (argCount == 1 && NPVARIANT_IS_DOUBLE(args[0])) { - NPIdentifier identifier = browser->getintidentifier((int)NPVARIANT_TO_DOUBLE(args[0])); - INT32_TO_NPVARIANT((int32)identifier, *result); - return true; + browser->memfree(string); } - } else if (name == pluginMethodIdentifiers[ID_TEST_EVALUATE] && - argCount == 1 && NPVARIANT_IS_STRING(args[0])) { - NPObject *windowScriptObject; - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); - - NPString s = NPVARIANT_TO_STRING(args[0]); - - bool retval = browser->evaluate(obj->npp, windowScriptObject, &s, result); - browser->releaseobject(windowScriptObject); - return retval; - } else if (name == pluginMethodIdentifiers[ID_TEST_GET_PROPERTY] && - argCount > 0) { - NPObject *object; - browser->getvalue(obj->npp, NPNVWindowNPObject, &object); - - for (uint32_t i = 0; i < argCount; i++) { - assert(NPVARIANT_IS_STRING(args[i])); - NPUTF8* propertyString = createCStringFromNPVariant(&args[i]); - NPIdentifier propertyIdentifier = browser->getstringidentifier(propertyString); - free(propertyString); - - NPVariant variant; - bool retval = browser->getproperty(obj->npp, object, propertyIdentifier, &variant); - browser->releaseobject(object); - - if (!retval) - break; - - if (i + 1 < argCount) { - assert(NPVARIANT_IS_OBJECT(variant)); - object = NPVARIANT_TO_OBJECT(variant); - } else { - *result = variant; - return true; - } - } - - VOID_TO_NPVARIANT(*result); + + browser->memfree(identifiers); + } + + VOID_TO_NPVARIANT(*result); + return true; +} + +static bool testGetIntIdentifier(PluginObject*, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (argCount != 1 || !NPVARIANT_IS_DOUBLE(args[0])) return false; - } else if (name == pluginMethodIdentifiers[ID_TEST_GET_PROPERTY_RETURN_VALUE] && - argCount == 2 && NPVARIANT_IS_OBJECT(args[0]) && NPVARIANT_IS_STRING(args[1])) { - NPUTF8* propertyString = createCStringFromNPVariant(&args[1]); + + NPIdentifier identifier = browser->getintidentifier((int)NPVARIANT_TO_DOUBLE(args[0])); + INT32_TO_NPVARIANT((int32)(long long)identifier, *result); + return true; +} + +static bool testGetProperty(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (argCount == 0) + return false; + + NPObject *object; + browser->getvalue(obj->npp, NPNVWindowNPObject, &object); + + for (uint32_t i = 0; i < argCount; i++) { + assert(NPVARIANT_IS_STRING(args[i])); + NPUTF8* propertyString = createCStringFromNPVariant(&args[i]); NPIdentifier propertyIdentifier = browser->getstringidentifier(propertyString); free(propertyString); NPVariant variant; - bool retval = browser->getproperty(obj->npp, NPVARIANT_TO_OBJECT(args[0]), propertyIdentifier, &variant); - if (retval) - browser->releasevariantvalue(&variant); + bool retval = browser->getproperty(obj->npp, object, propertyIdentifier, &variant); + browser->releaseobject(object); - BOOLEAN_TO_NPVARIANT(retval, *result); - return true; + if (!retval) + break; + + if (i + 1 < argCount) { + assert(NPVARIANT_IS_OBJECT(variant)); + object = NPVARIANT_TO_OBJECT(variant); + } else { + *result = variant; + return true; + } } + + VOID_TO_NPVARIANT(*result); + return false; +} + +static bool testEvaluate(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (argCount != 1 || !NPVARIANT_IS_STRING(args[0])) + return false; + NPObject* windowScriptObject; + browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); + + NPString s = NPVARIANT_TO_STRING(args[0]); + + bool retval = browser->evaluate(obj->npp, windowScriptObject, &s, result); + browser->releaseobject(windowScriptObject); + return retval; +} + +static bool testGetPropertyReturnValue(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (argCount != 2 || !NPVARIANT_IS_OBJECT(args[0]) || !NPVARIANT_IS_STRING(args[1])) + return false; + + NPUTF8* propertyString = createCStringFromNPVariant(&args[1]); + NPIdentifier propertyIdentifier = browser->getstringidentifier(propertyString); + free(propertyString); + + NPVariant variant; + bool retval = browser->getproperty(obj->npp, NPVARIANT_TO_OBJECT(args[0]), propertyIdentifier, &variant); + if (retval) + browser->releasevariantvalue(&variant); + + BOOLEAN_TO_NPVARIANT(retval, *result); + return true; +} + +static char* toCString(const NPString& string) +{ + char* result = static_cast<char*>(malloc(string.UTF8Length + 1)); + memcpy(result, string.UTF8Characters, string.UTF8Length); + result[string.UTF8Length] = '\0'; + + return result; +} + +static bool testPostURLFile(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (argCount != 4 || !NPVARIANT_IS_STRING(args[0]) || !NPVARIANT_IS_STRING(args[1]) || !NPVARIANT_IS_STRING(args[2]) || !NPVARIANT_IS_STRING(args[3])) + return false; + + NPString urlString = NPVARIANT_TO_STRING(args[0]); + char* url = toCString(urlString); + + NPString targetString = NPVARIANT_TO_STRING(args[1]); + char* target = toCString(targetString); + + NPString pathString = NPVARIANT_TO_STRING(args[2]); + char* path = toCString(pathString); + + NPString contentsString = NPVARIANT_TO_STRING(args[3]); + + FILE* tempFile = fopen(path, "w"); + if (!tempFile) + return false; + + fwrite(contentsString.UTF8Characters, contentsString.UTF8Length, 1, tempFile); + fclose(tempFile); + + NPError error = browser->posturl(obj->npp, url, target, pathString.UTF8Length, path, TRUE); + + free(path); + free(target); + free(url); + + BOOLEAN_TO_NPVARIANT(error == NPERR_NO_ERROR, *result); + return true; +} + +static bool testConstruct(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + if (!argCount || !NPVARIANT_IS_OBJECT(args[0])) + return false; + + return browser->construct(obj->npp, NPVARIANT_TO_OBJECT(args[0]), args + 1, argCount - 1, result); +} + +static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + PluginObject* plugin = reinterpret_cast<PluginObject*>(header); + if (name == pluginMethodIdentifiers[ID_TEST_CALLBACK_METHOD]) + return testCallback(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_GETURL]) + return getURL(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_REMOVE_DEFAULT_METHOD]) + return removeDefaultMethod(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_DOM_ACCESS]) + return testDOMAccess(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_GET_URL_NOTIFY]) + return getURLNotify(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_INVOKE_DEFAULT]) + return testInvokeDefault(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_ENUMERATE]) + return testEnumerate(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_DESTROY_STREAM]) + return destroyStream(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_GETINTIDENTIFIER]) + return testGetIntIdentifier(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_EVALUATE]) + return testEvaluate(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_GET_PROPERTY]) + return testGetProperty(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_GET_PROPERTY_RETURN_VALUE]) + return testGetPropertyReturnValue(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_IDENTIFIER_TO_STRING]) + return testIdentifierToString(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_IDENTIFIER_TO_INT]) + return testIdentifierToInt(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_POSTURL_FILE]) + return testPostURLFile(plugin, args, argCount, result); + else if (name == pluginMethodIdentifiers[ID_TEST_CONSTRUCT]) + return testConstruct(plugin, args, argCount, result); + return false; } -static bool pluginInvokeDefault(NPObject *obj, const NPVariant *args, uint32_t argCount, NPVariant *result) +static bool pluginInvokeDefault(NPObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) { INT32_TO_NPVARIANT(1, *result); return true; } -static void pluginInvalidate(NPObject *obj) +static void pluginInvalidate(NPObject* obj) { } static NPObject *pluginAllocate(NPP npp, NPClass *theClass) { - PluginObject *newInstance = (PluginObject*)malloc(sizeof(PluginObject)); - + PluginObject* newInstance = (PluginObject*)malloc(sizeof(PluginObject)); + if (!identifiersInitialized) { identifiersInitialized = true; initializeIdentifiers(); @@ -399,42 +596,43 @@ static NPObject *pluginAllocate(NPP npp, NPClass *theClass) newInstance->npp = npp; newInstance->testObject = browser->createobject(npp, getTestClass()); newInstance->eventLogging = FALSE; + newInstance->onStreamLoad = 0; + newInstance->onStreamDestroy = 0; + newInstance->onURLNotify = 0; newInstance->logDestroy = FALSE; newInstance->logSetWindow = FALSE; newInstance->returnErrorFromNewStream = FALSE; newInstance->stream = 0; - + newInstance->firstUrl = NULL; newInstance->firstHeaders = NULL; newInstance->lastUrl = NULL; newInstance->lastHeaders = NULL; - - return (NPObject *)newInstance; + + return (NPObject*)newInstance; } -static void pluginDeallocate(NPObject *header) +static void pluginDeallocate(NPObject* header) { - PluginObject* obj = (PluginObject*)header; - - browser->releaseobject(obj->testObject); - - free(obj->firstUrl); - free(obj->firstHeaders); - free(obj->lastUrl); - free(obj->lastHeaders); - - free(obj); + PluginObject* plugin = reinterpret_cast<PluginObject*>(header); + browser->releaseobject(plugin->testObject); + + free(plugin->firstUrl); + free(plugin->firstHeaders); + free(plugin->lastUrl); + free(plugin->lastHeaders); + free(plugin); } void handleCallback(PluginObject* object, const char *url, NPReason reason, void *notifyData) { assert(object); - + NPVariant args[2]; - + NPObject *windowScriptObject; browser->getvalue(object->npp, NPNVWindowNPObject, &windowScriptObject); - + NPIdentifier callbackIdentifier = notifyData; INT32_TO_NPVARIANT(reason, args[0]); diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h index 95abbf9..a5441d8 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h @@ -1,34 +1,26 @@ /* - IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in - consideration of your agreement to the following terms, and your use, installation, - modification or redistribution of this Apple software constitutes acceptance of these - terms. If you do not agree with these terms, please do not use, install, modify or - redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject to these - terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in - this original Apple software (the "Apple Software"), to use, reproduce, modify and - redistribute the Apple Software, with or without modifications, in source and/or binary - forms; provided that if you redistribute the Apple Software in its entirety and without - modifications, you must retain this notice and the following text and disclaimers in all - such redistributions of the Apple Software. Neither the name, trademarks, service marks - or logos of Apple Computer, Inc. may be used to endorse or promote products derived from - the Apple Software without specific prior written permission from Apple. Except as expressly - stated in this notice, no other rights or licenses, express or implied, are granted by Apple - herein, including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, - EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS - USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, - REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND - WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR - OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright (C) 2006, 2007 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. ``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 + * 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. */ #include <WebKit/npfunctions.h> @@ -45,6 +37,8 @@ typedef struct { NPObject* testObject; NPStream* stream; char* onStreamLoad; + char* onStreamDestroy; + char* onURLNotify; char* firstUrl; char* firstHeaders; char* lastUrl; diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp index 6b6206e..3e85e2c 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp @@ -1,34 +1,26 @@ /* - IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in - consideration of your agreement to the following terms, and your use, installation, - modification or redistribution of this Apple software constitutes acceptance of these - terms. If you do not agree with these terms, please do not use, install, modify or - redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject to these - terms, Apple grants you a personal, non-exclusive license, under Apple’s copyrights in - this original Apple software (the "Apple Software"), to use, reproduce, modify and - redistribute the Apple Software, with or without modifications, in source and/or binary - forms; provided that if you redistribute the Apple Software in its entirety and without - modifications, you must retain this notice and the following text and disclaimers in all - such redistributions of the Apple Software. Neither the name, trademarks, service marks - or logos of Apple Computer, Inc. may be used to endorse or promote products derived from - the Apple Software without specific prior written permission from Apple. Except as expressly - stated in this notice, no other rights or licenses, express or implied, are granted by Apple - herein, including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, - EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS - USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, - REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND - WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR - OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright (C) 2007 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. ``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 + * 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. */ #include "TestObject.h" @@ -36,8 +28,10 @@ static bool testEnumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count); static bool testHasProperty(NPObject *obj, NPIdentifier name); +static bool testGetProperty(NPObject*, NPIdentifier name, NPVariant*); static NPObject *testAllocate(NPP npp, NPClass *theClass); static void testDeallocate(NPObject *obj); +static bool testConstruct(NPObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result); static NPClass testClass = { NP_CLASS_STRUCT_VERSION, @@ -48,10 +42,11 @@ static NPClass testClass = { 0, 0, testHasProperty, + testGetProperty, 0, 0, - 0, - testEnumerate + testEnumerate, + testConstruct }; NPClass *getTestClass(void) @@ -61,12 +56,16 @@ NPClass *getTestClass(void) static bool identifiersInitialized = false; -#define NUM_TEST_IDENTIFIERS 2 +#define ID_OBJECT_POINTER 2 + +#define NUM_ENUMERATABLE_TEST_IDENTIFIERS 2 +#define NUM_TEST_IDENTIFIERS 3 static NPIdentifier testIdentifiers[NUM_TEST_IDENTIFIERS]; static const NPUTF8 *testIdentifierNames[NUM_TEST_IDENTIFIERS] = { "foo", - "bar" + "bar", + "objectPointer", }; static void initializeIdentifiers(void) @@ -76,7 +75,7 @@ static void initializeIdentifiers(void) static NPObject *testAllocate(NPP npp, NPClass *theClass) { - NPObject *newInstance = (NPObject*)malloc(sizeof(NPObject)); + NPObject *newInstance = static_cast<NPObject*>(malloc(sizeof(NPObject))); if (!identifiersInitialized) { identifiersInitialized = true; @@ -101,14 +100,35 @@ static bool testHasProperty(NPObject *obj, NPIdentifier name) return false; } +static bool testGetProperty(NPObject* npobj, NPIdentifier name, NPVariant* result) +{ + if (name == testIdentifiers[ID_OBJECT_POINTER]) { + int32_t objectPointer = static_cast<int32_t>(reinterpret_cast<long long>(npobj)); + + INT32_TO_NPVARIANT(objectPointer, *result); + return true; + } + + return false; +} + static bool testEnumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count) { *count = NUM_TEST_IDENTIFIERS; - *value = (NPIdentifier*)browser->memalloc(NUM_TEST_IDENTIFIERS * sizeof(NPIdentifier)); - memcpy(*value, testIdentifiers, sizeof(NPIdentifier) * NUM_TEST_IDENTIFIERS); + *value = (NPIdentifier*)browser->memalloc(NUM_ENUMERATABLE_TEST_IDENTIFIERS * sizeof(NPIdentifier)); + memcpy(*value, testIdentifiers, sizeof(NPIdentifier) * NUM_ENUMERATABLE_TEST_IDENTIFIERS); + + return true; +} + +static bool testConstruct(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVariant* result) +{ + browser->retainobject(npobj); + // Just return the same object. + OBJECT_TO_NPVARIANT(npobj, *result); return true; } diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h index f27aea6..1295fb7 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h @@ -1,34 +1,26 @@ /* - IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in - consideration of your agreement to the following terms, and your use, installation, - modification or redistribution of this Apple software constitutes acceptance of these - terms. If you do not agree with these terms, please do not use, install, modify or - redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject to these - terms, Apple grants you a personal, non-exclusive license, under Apple’s copyrights in - this original Apple software (the "Apple Software"), to use, reproduce, modify and - redistribute the Apple Software, with or without modifications, in source and/or binary - forms; provided that if you redistribute the Apple Software in its entirety and without - modifications, you must retain this notice and the following text and disclaimers in all - such redistributions of the Apple Software. Neither the name, trademarks, service marks - or logos of Apple Computer, Inc. may be used to endorse or promote products derived from - the Apple Software without specific prior written permission from Apple. Except as expressly - stated in this notice, no other rights or licenses, express or implied, are granted by Apple - herein, including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, - EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS - USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, - REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND - WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR - OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright (C) 2007 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. ``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 + * 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. */ #include <WebKit/npapi.h> diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp index fb6a6ca..bb98ba2 100644 --- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp +++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp @@ -1,38 +1,34 @@ /* - IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in - consideration of your agreement to the following terms, and your use, installation, - modification or redistribution of this Apple software constitutes acceptance of these - terms. If you do not agree with these terms, please do not use, install, modify or - redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject to these - terms, Apple grants you a personal, non-exclusive license, under Apple’s copyrights in - this original Apple software (the "Apple Software"), to use, reproduce, modify and - redistribute the Apple Software, with or without modifications, in source and/or binary - forms; provided that if you redistribute the Apple Software in its entirety and without - modifications, you must retain this notice and the following text and disclaimers in all - such redistributions of the Apple Software. Neither the name, trademarks, service marks - or logos of Apple Computer, Inc. may be used to endorse or promote products derived from - the Apple Software without specific prior written permission from Apple. Except as expressly - stated in this notice, no other rights or licenses, express or implied, are granted by Apple - herein, including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, - EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS - USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, - REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND - WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR - OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright (C) 2006, 2007 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. ``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 + * 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 "PluginObject.h" +#if __LP64__ +#define USE_COCOA_EVENT_MODEL 1 +#endif + // Mach-o entry points extern "C" { NPError NP_Initialize(NPNetscapeFuncs *browserFuncs); @@ -74,14 +70,28 @@ void NP_Shutdown(void) NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved) { +#if USE_COCOA_EVENT_MODEL + // If the browser supports the Cocoa event model, enable it. + NPBool supportsCocoa; + if (browser->getvalue(instance, NPNVsupportsCocoaBool, &supportsCocoa) != NPERR_NO_ERROR) + supportsCocoa = FALSE; + + if (!supportsCocoa) + return NPERR_INCOMPATIBLE_VERSION_ERROR; + + browser->setvalue(instance, NPPVpluginEventModel, (void *)NPEventModelCocoa); +#endif + if (browser->version >= 14) { PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass()); - - obj->onStreamLoad = NULL; - + for (int i = 0; i < argc; i++) { if (strcasecmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad) obj->onStreamLoad = strdup(argv[i]); + else if (strcasecmp(argn[i], "onStreamDestroy") == 0 && !obj->onStreamDestroy) + obj->onStreamDestroy = strdup(argv[i]); + else if (strcasecmp(argn[i], "onURLNotify") == 0 && !obj->onURLNotify) + obj->onURLNotify = strdup(argv[i]); else if (strcasecmp(argn[i], "src") == 0 && strcasecmp(argv[i], "data:application/x-webkit-test-netscape,returnerrorfromnewstream") == 0) obj->returnErrorFromNewStream = TRUE; @@ -101,6 +111,12 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save) if (obj) { if (obj->onStreamLoad) free(obj->onStreamLoad); + + if (obj->onStreamDestroy) + free(obj->onStreamDestroy); + + if (obj->onURLNotify) + free(obj->onURLNotify); if (obj->logDestroy) printf("PLUGIN: NPP_Destroy\n"); @@ -124,6 +140,20 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window) return NPERR_NO_ERROR; } +static void executeScript(const PluginObject* obj, const char* script) +{ + NPObject *windowScriptObject; + browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); + + NPString npScript; + npScript.UTF8Characters = script; + npScript.UTF8Length = strlen(script); + + NPVariant browserResult; + browser->evaluate(obj->npp, windowScriptObject, &npScript, &browserResult); + browser->releasevariantvalue(&browserResult); +} + NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, uint16 *stype) { PluginObject* obj = static_cast<PluginObject*>(instance->pdata); @@ -136,24 +166,19 @@ NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool se if (browser->version >= NPVERS_HAS_RESPONSE_HEADERS) notifyStream(obj, stream->url, stream->headers); - if (obj->onStreamLoad) { - NPObject *windowScriptObject; - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); - - NPString script; - script.UTF8Characters = obj->onStreamLoad; - script.UTF8Length = strlen(obj->onStreamLoad); - - NPVariant browserResult; - browser->evaluate(obj->npp, windowScriptObject, &script, &browserResult); - browser->releasevariantvalue(&browserResult); - } - + if (obj->onStreamLoad) + executeScript(obj, obj->onStreamLoad); + return NPERR_NO_ERROR; } NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason) { + PluginObject* obj = (PluginObject*)instance->pdata; + + if (obj->onStreamDestroy) + executeScript(obj, obj->onStreamDestroy); + return NPERR_NO_ERROR; } @@ -180,7 +205,35 @@ int16 NPP_HandleEvent(NPP instance, void *event) PluginObject* obj = static_cast<PluginObject*>(instance->pdata); if (!obj->eventLogging) return 0; - + +#if USE_COCOA_EVENT_MODEL + // FIXME: Generate output that will match the Carbon event model + // so that the layout tests using this plug-in will work in either model. + NPCocoaEvent *cocoaEvent = static_cast<NPCocoaEvent*>(event); + switch (cocoaEvent->type) { + case NPCocoaEventWindowFocusChanged: + case NPCocoaEventFocusChanged: + return 1; + + case NPCocoaEventDrawRect: + return 1; + + case NPCocoaEventKeyDown: + case NPCocoaEventKeyUp: + case NPCocoaEventFlagsChanged: + return 1; + + case NPCocoaEventMouseDown: + case NPCocoaEventMouseUp: + + case NPCocoaEventMouseMoved: + case NPCocoaEventMouseEntered: + case NPCocoaEventMouseExited: + case NPCocoaEventMouseDragged: + case NPCocoaEventScrollWheel: + return 1; + } +#else EventRecord* evt = static_cast<EventRecord*>(event); Point pt = { evt->where.v, evt->where.h }; switch (evt->what) { @@ -242,14 +295,17 @@ int16 NPP_HandleEvent(NPP instance, void *event) default: printf("PLUGIN: event %d\n", evt->what); } - +#endif return 0; } void NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyData) { PluginObject* obj = static_cast<PluginObject*>(instance->pdata); - + + if (obj->onURLNotify) + executeScript(obj, obj->onURLNotify); + handleCallback(obj, url, reason, notifyData); } diff --git a/WebKitTools/DumpRenderTree/WorkQueue.cpp b/WebKitTools/DumpRenderTree/WorkQueue.cpp index 87c7af5..0891b9c 100644 --- a/WebKitTools/DumpRenderTree/WorkQueue.cpp +++ b/WebKitTools/DumpRenderTree/WorkQueue.cpp @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "WorkQueue.h" #include "WorkQueueItem.h" diff --git a/WebKitTools/DumpRenderTree/cg/ImageDiffCG.cpp b/WebKitTools/DumpRenderTree/cg/ImageDiffCG.cpp index 068f73d..1e55e78 100644 --- a/WebKitTools/DumpRenderTree/cg/ImageDiffCG.cpp +++ b/WebKitTools/DumpRenderTree/cg/ImageDiffCG.cpp @@ -36,6 +36,7 @@ #if PLATFORM(WIN) #include <fcntl.h> #include <io.h> +#include <wtf/MathExtras.h> #endif #if PLATFORM(MAC) @@ -54,6 +55,10 @@ typedef float CGFloat; using namespace std; #if PLATFORM(WIN) +static inline float strtof(const char *nptr, char **endptr) +{ + return strtod(nptr, endptr); +} static const CFStringRef kUTTypePNG = CFSTR("public.png"); #endif @@ -72,85 +77,99 @@ static RetainPtr<CGImageRef> createImageFromStdin(int bytesRemaining) return RetainPtr<CGImageRef>(AdoptCF, CGImageCreateWithPNGDataProvider(dataProvider.get(), 0, false, kCGRenderingIntentDefault)); } -static RetainPtr<CGContextRef> getDifferenceBitmap(CGImageRef testBitmap, CGImageRef referenceBitmap) +static void releaseMallocBuffer(void* info, const void* data, size_t size) { - // we must have both images to take diff - if (!testBitmap || !referenceBitmap) - return 0; - - RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); - unsigned char* data = new unsigned char[CGImageGetHeight(testBitmap) * CGImageGetBytesPerRow(testBitmap)]; - RetainPtr<CGContextRef> context(AdoptCF, CGBitmapContextCreate(data, CGImageGetWidth(testBitmap), CGImageGetHeight(testBitmap), - CGImageGetBitsPerComponent(testBitmap), CGImageGetBytesPerRow(testBitmap), colorSpace.get(), kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst)); - - CGContextSetBlendMode(context.get(), kCGBlendModeNormal); - CGContextDrawImage(context.get(), CGRectMake(0, 0, static_cast<CGFloat>(CGImageGetWidth(testBitmap)), static_cast<CGFloat>(CGImageGetHeight(testBitmap))), testBitmap); - CGContextSetBlendMode(context.get(), kCGBlendModeDifference); - CGContextDrawImage(context.get(), CGRectMake(0, 0, static_cast<CGFloat>(CGImageGetWidth(referenceBitmap)), static_cast<CGFloat>(CGImageGetHeight(referenceBitmap))), referenceBitmap); - - return context; + free((void*)data); } -/** - * Counts the number of non-black pixels, and returns the percentage - * of non-black pixels to total pixels in the image. - */ -static float computePercentageDifferent(CGContextRef diffBitmap, unsigned threshold) +static RetainPtr<CGImageRef> createDifferenceImage(CGImageRef baseImage, CGImageRef testImage, float& difference) { - // if diffBiatmap is nil, then there was an error, and it didn't match. - if (!diffBitmap) - return 100.0f; - - size_t pixelsHigh = CGBitmapContextGetHeight(diffBitmap); - size_t pixelsWide = CGBitmapContextGetWidth(diffBitmap); - size_t bytesPerRow = CGBitmapContextGetBytesPerRow(diffBitmap); - unsigned char* pixelRowData = static_cast<unsigned char*>(CGBitmapContextGetData(diffBitmap)); - unsigned differences = 0; - - // NOTE: This may not be safe when switching between ENDIAN types - for (unsigned row = 0; row < pixelsHigh; row++) { - for (unsigned col = 0; col < (pixelsWide * 4); col += 4) { - unsigned char* red = pixelRowData + col; - unsigned char* green = red + 1; - unsigned char* blue = red + 2; - unsigned distance = *red + *green + *blue; - if (distance > threshold) { - differences++; - // shift the pixels towards white to make them more visible - *red = static_cast<unsigned char>(min(UCHAR_MAX, *red + 100)); - *green = static_cast<unsigned char>(min(UCHAR_MAX, *green + 100)); - *blue = static_cast<unsigned char>(min(UCHAR_MAX, *blue + 100)); + static RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); + RetainPtr<CGImageRef> diffImage; + + size_t width = CGImageGetWidth(baseImage); + size_t height = CGImageGetHeight(baseImage); + size_t rowBytes = width * 4; + + // Draw base image in bitmap context + void* baseBuffer = calloc(height, rowBytes); + CGContextRef baseContext = CGBitmapContextCreate(baseBuffer, width, height, 8, rowBytes, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); + CGContextDrawImage(baseContext, CGRectMake(0, 0, width, height), baseImage); + CGContextRelease(baseContext); + + // Draw test image in bitmap context + void* buffer = calloc(height, rowBytes); + CGContextRef context = CGBitmapContextCreate(buffer, width, height, 8, rowBytes, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); + CGContextDrawImage(context, CGRectMake(0, 0, width, height), testImage); + CGContextRelease(context); + + // Compare the content of the 2 bitmaps + void* diffBuffer = malloc(width * height); + float count = 0.0f; + float sum = 0.0f; + float maxDistance = 0.0f; + unsigned char* basePixel = (unsigned char*)baseBuffer; + unsigned char* pixel = (unsigned char*)buffer; + unsigned char* diff = (unsigned char*)diffBuffer; + for (size_t y = 0; y < height; ++y) { + for (size_t x = 0; x < width; ++x) { + float red = (pixel[0] - basePixel[0]) / max<float>(255 - basePixel[0], basePixel[0]); + float green = (pixel[1] - basePixel[1]) / max<float>(255 - basePixel[1], basePixel[1]); + float blue = (pixel[2] - basePixel[2]) / max<float>(255 - basePixel[2], basePixel[2]); + float alpha = (pixel[3] - basePixel[3]) / max<float>(255 - basePixel[3], basePixel[3]); + float distance = sqrtf(red * red + green * green + blue * blue + alpha * alpha) / 2.0f; + + *diff++ = (unsigned char)(distance * 255.0f); + + if (distance >= 1.0f / 255.0f) { + count += 1.0f; + sum += distance; + if (distance > maxDistance) + maxDistance = distance; } + + basePixel += 4; + pixel += 4; } - pixelRowData += bytesPerRow; } - - float totalPixels = static_cast<float>(pixelsHigh * pixelsWide); - return (differences * 100.f) / totalPixels; + + // Compute the difference as a percentage combining both the number of different pixels and their difference amount i.e. the average distance over the entire image + if (count > 0.0f) + difference = 100.0f * sum / (height * width); + else + difference = 0.0f; + + // Generate a normalized diff image if there is any difference + if (difference > 0.0f) { + if (maxDistance < 1.0f) { + diff = (unsigned char*)diffBuffer; + for(size_t p = 0; p < height * width; ++p) + diff[p] = diff[p] / maxDistance; + } + + CGDataProviderRef provider = CGDataProviderCreateWithData(0, diffBuffer, width * height, releaseMallocBuffer); + CGColorSpaceRef diffColorspace = CGColorSpaceCreateDeviceGray(); + diffImage.adoptCF(CGImageCreate(width, height, 8, 8, width, diffColorspace, 0, provider, 0, false, kCGRenderingIntentDefault)); + CGColorSpaceRelease(diffColorspace); + CGDataProviderRelease(provider); + } + else + free(diffBuffer); + + // Destroy drawing buffers + if (buffer) + free(buffer); + if (baseBuffer) + free(baseBuffer); + + return diffImage; } -static void compareImages(CGImageRef actualBitmap, CGImageRef baselineBitmap, unsigned threshold) +static inline bool imageHasAlpha(CGImageRef image) { - // prepare the difference blend to check for pixel variations - RetainPtr<CGContextRef> diffBitmap = getDifferenceBitmap(actualBitmap, baselineBitmap); - - float percentage = computePercentageDifferent(diffBitmap.get(), threshold); - - percentage = (float)((int)(percentage * 100.0f)) / 100.0f; // round to 2 decimal places - - // send message to let them know if an image was wrong - if (percentage > 0.0f) { - // since the diff might actually show something, send it to stdout - RetainPtr<CGImageRef> image(AdoptCF, CGBitmapContextCreateImage(diffBitmap.get())); - RetainPtr<CFMutableDataRef> imageData(AdoptCF, CFDataCreateMutable(0, 0)); - RetainPtr<CGImageDestinationRef> imageDest(AdoptCF, CGImageDestinationCreateWithData(imageData.get(), kUTTypePNG, 1, 0)); - CGImageDestinationAddImage(imageDest.get(), image.get(), 0); - CGImageDestinationFinalize(imageDest.get()); - printf("Content-length: %lu\n", CFDataGetLength(imageData.get())); - fwrite(CFDataGetBytePtr(imageData.get()), 1, CFDataGetLength(imageData.get()), stdout); - fprintf(stdout, "diff: %01.2f%% failed\n", percentage); - } else - fprintf(stdout, "diff: %01.2f%% passed\n", percentage); + CGImageAlphaInfo info = CGImageGetAlphaInfo(image); + + return (info >= kCGImageAlphaPremultipliedLast) && (info <= kCGImageAlphaFirst); } int main(int argc, const char* argv[]) @@ -160,13 +179,13 @@ int main(int argc, const char* argv[]) _setmode(1, _O_BINARY); #endif - unsigned threshold = 0; + float tolerance = 0.0f; for (int i = 1; i < argc; ++i) { - if (!strcmp(argv[i], "-t") || !strcmp(argv[i], "--threshold")) { + if (!strcmp(argv[i], "-t") || !strcmp(argv[i], "--tolerance")) { if (i >= argc - 1) exit(1); - threshold = strtol(argv[i + 1], 0, 0); + tolerance = strtof(argv[i + 1], 0); ++i; continue; } @@ -182,7 +201,7 @@ int main(int argc, const char* argv[]) if (newLineCharacter) *newLineCharacter = '\0'; - if (!strncmp("Content-length: ", buffer, 16)) { + if (!strncmp("Content-Length: ", buffer, 16)) { strtok(buffer, " "); int imageSize = strtol(strtok(0, " "), 0, 10); @@ -195,7 +214,34 @@ int main(int argc, const char* argv[]) } if (actualImage && baselineImage) { - compareImages(actualImage.get(), baselineImage.get(), threshold); + RetainPtr<CGImageRef> diffImage; + float difference = 100.0f; + + if ((CGImageGetWidth(actualImage.get()) == CGImageGetWidth(baselineImage.get())) && (CGImageGetHeight(actualImage.get()) == CGImageGetHeight(baselineImage.get())) && (imageHasAlpha(actualImage.get()) == imageHasAlpha(baselineImage.get()))) { + diffImage = createDifferenceImage(actualImage.get(), baselineImage.get(), difference); // difference is passed by reference + if (difference <= tolerance) + difference = 0.0f; + else { + difference = roundf(difference * 100.0f) / 100.0f; + difference = max(difference, 0.01f); // round to 2 decimal places + } + } else + fputs("error, test and reference image have different properties.\n", stderr); + + if (difference > 0.0f) { + if (diffImage) { + RetainPtr<CFMutableDataRef> imageData(AdoptCF, CFDataCreateMutable(0, 0)); + RetainPtr<CGImageDestinationRef> imageDest(AdoptCF, CGImageDestinationCreateWithData(imageData.get(), kUTTypePNG, 1, 0)); + CGImageDestinationAddImage(imageDest.get(), diffImage.get(), 0); + CGImageDestinationFinalize(imageDest.get()); + printf("Content-Length: %lu\n", CFDataGetLength(imageData.get())); + fwrite(CFDataGetBytePtr(imageData.get()), 1, CFDataGetLength(imageData.get()), stdout); + } + + fprintf(stdout, "diff: %01.2f%% failed\n", difference); + } else + fprintf(stdout, "diff: %01.2f%% passed\n", difference); + actualImage = 0; baselineImage = 0; } diff --git a/WebKitTools/DumpRenderTree/cg/PixelDumpSupportCG.cpp b/WebKitTools/DumpRenderTree/cg/PixelDumpSupportCG.cpp index e2e790c..2320e19 100644 --- a/WebKitTools/DumpRenderTree/cg/PixelDumpSupportCG.cpp +++ b/WebKitTools/DumpRenderTree/cg/PixelDumpSupportCG.cpp @@ -28,12 +28,16 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "PixelDumpSupportCG.h" +#include "DumpRenderTree.h" #include "LayoutTestController.h" #include <ImageIO/CGImageDestination.h> +#include <algorithm> +#include <ctype.h> #include <wtf/Assertions.h> +#include <wtf/RefPtr.h> #include <wtf/RetainPtr.h> #include <wtf/StringExtras.h> @@ -55,72 +59,76 @@ static void printPNG(CGImageRef image) RetainPtr<CGImageDestinationRef> imageDest(AdoptCF, CGImageDestinationCreateWithData(imageData.get(), kUTTypePNG, 1, 0)); CGImageDestinationAddImage(imageDest.get(), image, 0); CGImageDestinationFinalize(imageDest.get()); - printf("Content-length: %lu\n", CFDataGetLength(imageData.get())); + + printf("Content-Type: %s\n", "image/png"); + printf("Content-Length: %lu\n", CFDataGetLength(imageData.get())); + fwrite(CFDataGetBytePtr(imageData.get()), 1, CFDataGetLength(imageData.get()), stdout); } -static void getMD5HashStringForBitmap(CGContextRef bitmap, char string[33]) +static void computeMD5HashStringForBitmapContext(CGContextRef bitmapContext, char hashString[33]) { - MD5_CTX md5Context; - unsigned char hash[16]; - - size_t bitsPerPixel = CGBitmapContextGetBitsPerPixel(bitmap); - ASSERT(bitsPerPixel == 32); // ImageDiff assumes 32 bit RGBA, we must as well. - size_t bytesPerPixel = bitsPerPixel / 8; - size_t pixelsHigh = CGBitmapContextGetHeight(bitmap); - size_t pixelsWide = CGBitmapContextGetWidth(bitmap); - size_t bytesPerRow = CGBitmapContextGetBytesPerRow(bitmap); - ASSERT(bytesPerRow >= (pixelsWide * bytesPerPixel)); + ASSERT(CGBitmapContextGetBitsPerPixel(bitmapContext) == 32); // ImageDiff assumes 32 bit RGBA, we must as well. + size_t pixelsHigh = CGBitmapContextGetHeight(bitmapContext); + size_t pixelsWide = CGBitmapContextGetWidth(bitmapContext); + size_t bytesPerRow = CGBitmapContextGetBytesPerRow(bitmapContext); + // We need to swap the bytes to ensure consistent hashes independently of endianness + MD5_CTX md5Context; MD5_Init(&md5Context); - unsigned char* bitmapData = static_cast<unsigned char*>(CGBitmapContextGetData(bitmap)); - for (unsigned row = 0; row < pixelsHigh; row++) { - MD5_Update(&md5Context, bitmapData, static_cast<unsigned>(pixelsWide * bytesPerPixel)); - bitmapData += bytesPerRow; + unsigned char* bitmapData = static_cast<unsigned char*>(CGBitmapContextGetData(bitmapContext)); +#if PLATFORM(MAC) + if ((CGBitmapContextGetBitmapInfo(bitmapContext) & kCGBitmapByteOrderMask) == kCGBitmapByteOrder32Big) { + for (unsigned row = 0; row < pixelsHigh; row++) { + uint32_t buffer[pixelsWide]; + for (unsigned column = 0; column < pixelsWide; column++) + buffer[column] = OSReadLittleInt32(bitmapData, 4 * column); + MD5_Update(&md5Context, buffer, 4 * pixelsWide); + bitmapData += bytesPerRow; + } + } else +#endif + { + for (unsigned row = 0; row < pixelsHigh; row++) { + MD5_Update(&md5Context, bitmapData, 4 * pixelsWide); + bitmapData += bytesPerRow; + } } + unsigned char hash[16]; MD5_Final(hash, &md5Context); - string[0] = '\0'; + hashString[0] = '\0'; for (int i = 0; i < 16; i++) - snprintf(string, 33, "%s%02x", string, hash[i]); + snprintf(hashString, 33, "%s%02x", hashString, hash[i]); } -void drawSelectionRect(CGContextRef context, const CGRect& rect) +void dumpWebViewAsPixelsAndCompareWithExpected(const std::string& expectedHash) { - CGContextSaveGState(context); - CGContextSetRGBStrokeColor(context, 1.0, 0.0, 0.0, 1.0); - CGContextStrokeRect(context, rect); - CGContextRestoreGState(context); -} - -void dumpWebViewAsPixelsAndCompareWithExpected(const char* /*currentTest*/, bool /*forceAllTestsToDumpPixels*/) -{ - RetainPtr<CGContextRef> context = getBitmapContextFromWebView(); - + RefPtr<BitmapContext> context; + #if PLATFORM(MAC) - if (layoutTestController->testRepaint()) - repaintWebView(context.get(), layoutTestController->testRepaintSweepHorizontally()); - else - paintWebView(context.get()); - - if (layoutTestController->dumpSelectionRect()) - drawSelectionRect(context.get(), getSelectionRect()); + context = createBitmapContextFromWebView(gLayoutTestController->testOnscreen(), gLayoutTestController->testRepaint(), gLayoutTestController->testRepaintSweepHorizontally(), gLayoutTestController->dumpSelectionRect()); #endif - - // Compute the actual hash to compare to the expected image's hash. + ASSERT(context); + + // Compute the hash of the bitmap context pixels char actualHash[33]; - getMD5HashStringForBitmap(context.get(), actualHash); + computeMD5HashStringForBitmapContext(context->cgContext(), actualHash); printf("\nActualHash: %s\n", actualHash); - - // FIXME: We should compare the actualHash to the expected hash here and - // only set dumpImage to true if they don't match, but DRT doesn't have - // enough information currently to find the expected checksum file. + + // Check the computed hash against the expected one and dump image on mismatch bool dumpImage = true; - + if (expectedHash.length() > 0) { + ASSERT(expectedHash.length() == 32); + + printf("\nExpectedHash: %s\n", expectedHash.c_str()); + + if (expectedHash == actualHash) // FIXME: do case insensitive compare + dumpImage = false; + } + if (dumpImage) { - RetainPtr<CGImageRef> image(AdoptCF, CGBitmapContextCreateImage(context.get())); + RetainPtr<CGImageRef> image(AdoptCF, CGBitmapContextCreateImage(context->cgContext())); printPNG(image.get()); } - - printf("#EOF\n"); } diff --git a/WebKitTools/DumpRenderTree/cg/PixelDumpSupportCG.h b/WebKitTools/DumpRenderTree/cg/PixelDumpSupportCG.h index 0abdea6..84350e8 100644 --- a/WebKitTools/DumpRenderTree/cg/PixelDumpSupportCG.h +++ b/WebKitTools/DumpRenderTree/cg/PixelDumpSupportCG.h @@ -31,25 +31,50 @@ #ifndef PixelDumpSupportCG_h #define PixelDumpSupportCG_h +#include <wtf/PassRefPtr.h> +#include <wtf/RefCounted.h> #include <wtf/RetainPtr.h> -#ifndef CGFLOAT_DEFINED -#ifdef __LP64__ -typedef double CGFloat; -#else -typedef float CGFloat; +typedef struct CGContext* CGContextRef; + +#if PLATFORM(MAC) +typedef void* PlatformBitmapBuffer; +#elif PLATFORM(WIN) +typedef HBITMAP PlatformBitmapBuffer; #endif -#define CGFLOAT_DEFINED 1 + +class BitmapContext : public RefCounted<BitmapContext> { +public: + static PassRefPtr<BitmapContext> createByAdoptingBitmapAndContext(PlatformBitmapBuffer buffer, CGContextRef context) + { + return adoptRef(new BitmapContext(buffer, context)); + } + + ~BitmapContext() + { + if (m_buffer) +#if PLATFORM(MAC) + free(m_buffer); +#elif PLATFORM(WIN) + DeleteObject(m_buffer); #endif + } -typedef struct CGContext* CGContextRef; -struct CGRect; + CGContextRef cgContext() const { return m_context.get(); } + +private: + + BitmapContext(PlatformBitmapBuffer buffer, CGContextRef context) + : m_buffer(buffer) + , m_context(AdoptCF, context) + { + } + + PlatformBitmapBuffer m_buffer; + RetainPtr<CGContextRef> m_context; -RetainPtr<CGContextRef> getBitmapContextFromWebView(); -CGRect getSelectionRect(); +}; -void paintWebView(CGContextRef); -void repaintWebView(CGContextRef context, bool horizontal); -void drawSelectionRect(CGContextRef, const CGRect&); +PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool incrementalRepaint, bool sweepHorizontally, bool drawSelectionRect); #endif // PixelDumpSupportCG_h diff --git a/WebKitTools/Drosera/config.h b/WebKitTools/DumpRenderTree/config.h index 0b4a2c8..4775ae2 100644 --- a/WebKitTools/Drosera/config.h +++ b/WebKitTools/DumpRenderTree/config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Apple Inc. All rights reserved. + * Copyright (C) 2008 Nuanti Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -18,27 +18,30 @@ * */ -#include <wtf/Platform.h> - -#if PLATFORM(MAC) - -#import <WebKit/WebKit.h> -#import <WebKit/WebScriptDebugServer.h> +#define Config_H +#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H +#include "autotoolsconfig.h" #endif +#include <wtf/Platform.h> + #if PLATFORM(WIN) +#define WTF_PLATFORM_CF 1 + +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0500 + +#undef WINVER +#define WINVER 0x0500 // If we don't define these, they get defined in windef.h. // We want to use std::min and std::max -#ifndef max +#undef max #define max max -#endif -#ifndef min +#undef min #define min min -#endif - -#include <tchar.h> - -#endif // PLATFORM(WIN) +#undef _WINSOCKAPI_ +#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h +#endif // PLATFORM(WIN) diff --git a/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf Binary files differnew file mode 100644 index 0000000..22b00de --- /dev/null +++ b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf diff --git a/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf Binary files differnew file mode 100644 index 0000000..1ccadba --- /dev/null +++ b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf diff --git a/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher300.ttf b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher300.ttf Binary files differnew file mode 100644 index 0000000..ab5563d --- /dev/null +++ b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher300.ttf diff --git a/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher400.ttf b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher400.ttf Binary files differnew file mode 100644 index 0000000..56d279e --- /dev/null +++ b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher400.ttf diff --git a/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher500.ttf b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher500.ttf Binary files differnew file mode 100644 index 0000000..d827d7d --- /dev/null +++ b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher500.ttf diff --git a/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher600.ttf b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher600.ttf Binary files differnew file mode 100644 index 0000000..9141596 --- /dev/null +++ b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher600.ttf diff --git a/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher700.ttf b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher700.ttf Binary files differnew file mode 100644 index 0000000..a2d0505 --- /dev/null +++ b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher700.ttf diff --git a/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher800.ttf b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher800.ttf Binary files differnew file mode 100644 index 0000000..d0f354b --- /dev/null +++ b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher800.ttf diff --git a/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf Binary files differnew file mode 100644 index 0000000..6b895ca --- /dev/null +++ b/WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp index 271da15..13b914d 100644 --- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2007 Eric Seidel <eric@webkit.org> + * Copyright (C) 2008 Alp Toker <alp@nuanti.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,18 +27,16 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" +#include "DumpRenderTree.h" + #include "LayoutTestController.h" #include "WorkQueue.h" #include "WorkQueueItem.h" #include <gtk/gtk.h> #include <webkit/webkit.h> - -#include <JavaScriptCore/JSBase.h> -#include <JavaScriptCore/JSContextRef.h> -#include <JavaScriptCore/JSObjectRef.h> -#include <JavaScriptCore/JSStringRef.h> -#include <JavaScriptCore/JSValueRef.h> +#include <JavaScriptCore/JavaScript.h> #include <wtf/Assertions.h> @@ -46,21 +45,21 @@ #include <stdlib.h> #include <string.h> +using namespace std; + extern "C" { // This API is not yet public. extern GSList* webkit_web_frame_get_children(WebKitWebFrame* frame); extern gchar* webkit_web_frame_get_inner_text(WebKitWebFrame* frame); +extern gchar* webkit_web_frame_dump_render_tree(WebKitWebFrame* frame); } volatile bool done; static bool printSeparators; -static int testRepaintDefault; -static int repaintSweepHorizontallyDefault; static int dumpPixels; static int dumpTree = 1; -static gchar* currentTest; -LayoutTestController* layoutTestController = 0; +LayoutTestController* gLayoutTestController = 0; static WebKitWebView* webView; WebKitWebFrame* mainFrame = 0; WebKitWebFrame* topLoadingFrame = 0; @@ -109,34 +108,25 @@ static gchar* dumpFramesAsText(WebKitWebFrame* frame) // Add header for all but the main frame. bool isMainFrame = (webkit_web_view_get_main_frame(webView) == frame); - if (isMainFrame) { - gchar* innerText = webkit_web_frame_get_inner_text(frame); + gchar* innerText = webkit_web_frame_get_inner_text(frame); + if (isMainFrame) result = g_strdup_printf("%s\n", innerText); - g_free(innerText); - } else { + else { const gchar* frameName = webkit_web_frame_get_name(frame); - gchar* innerText = webkit_web_frame_get_inner_text(frame); - result = g_strdup_printf("\n--------\nFrame: '%s'\n--------\n%s\n", frameName, innerText); - - g_free(innerText); } + g_free(innerText); - if (layoutTestController->dumpChildFramesAsText()) { + if (gLayoutTestController->dumpChildFramesAsText()) { GSList* children = webkit_web_frame_get_children(frame); - for (;children; children = g_slist_next(children)) + for (GSList* child = children; child; child = g_slist_next(child)) appendString(result, dumpFramesAsText((WebKitWebFrame*)children->data)); + g_slist_free(children); } return result; } -static gchar* dumpRenderTreeAsText(WebKitWebFrame* frame) -{ - // FIXME: this will require new WebKitGtk SPI - return strdup("foo"); -} - static void invalidateAnyPreviousWaitToDumpWatchdog() { if (waitToDumpWatchdog) { @@ -151,27 +141,28 @@ void dump() if (dumpTree) { char* result = 0; - bool dumpAsText = layoutTestController->dumpAsText(); + bool dumpAsText = gLayoutTestController->dumpAsText(); // FIXME: Also dump text resuls as text. - layoutTestController->setDumpAsText(dumpAsText); - if (layoutTestController->dumpAsText()) + gLayoutTestController->setDumpAsText(dumpAsText); + if (gLayoutTestController->dumpAsText()) result = dumpFramesAsText(mainFrame); else { - bool isSVGW3CTest = (g_strrstr(currentTest, "svg/W3C-SVG-1.1")); - if (isSVGW3CTest) - gtk_widget_set_size_request(GTK_WIDGET(webView), 480, 360); - else - gtk_widget_set_size_request(GTK_WIDGET(webView), maxViewWidth, maxViewHeight); - result = dumpRenderTreeAsText(mainFrame); + bool isSVGW3CTest = (gLayoutTestController->testPathOrURL().find("svg/W3C-SVG-1.1") != string::npos); + GtkAllocation size; + size.width = isSVGW3CTest ? 480 : maxViewWidth; + size.height = isSVGW3CTest ? 360 : maxViewHeight; + gtk_widget_size_allocate(GTK_WIDGET(webView), &size); + + result = webkit_web_frame_dump_render_tree(mainFrame); } if (!result) { const char* errorMessage; - if (layoutTestController->dumpAsText()) + if (gLayoutTestController->dumpAsText()) errorMessage = "[documentElement innerText]"; - else if (layoutTestController->dumpDOMAsWebArchive()) + else if (gLayoutTestController->dumpDOMAsWebArchive()) errorMessage = "[[mainFrame DOMDocument] webArchive]"; - else if (layoutTestController->dumpSourceAsWebArchive()) + else if (gLayoutTestController->dumpSourceAsWebArchive()) errorMessage = "[[mainFrame dataSource] webArchive]"; else errorMessage = "[mainFrame renderTreeAsExternalRepresentation]"; @@ -179,59 +170,93 @@ void dump() } else { printf("%s", result); g_free(result); - if (!layoutTestController->dumpAsText() && !layoutTestController->dumpDOMAsWebArchive() && !layoutTestController->dumpSourceAsWebArchive()) + if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive()) dumpFrameScrollPosition(mainFrame); } - if (layoutTestController->dumpBackForwardList()) { + if (gLayoutTestController->dumpBackForwardList()) { // FIXME: not implemented } - if (printSeparators) - puts("#EOF"); + if (printSeparators) { + puts("#EOF"); // terminate the content block + fputs("#EOF\n", stderr); + fflush(stdout); + fflush(stderr); + } } if (dumpPixels) { - if (!layoutTestController->dumpAsText() && !layoutTestController->dumpDOMAsWebArchive() && !layoutTestController->dumpSourceAsWebArchive()) { + if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive()) { // FIXME: Add support for dumping pixels } } - fflush(stdout); - // FIXME: call displayWebView here when we support --paint + puts("#EOF"); // terminate the (possibly empty) pixels block + + fflush(stdout); + fflush(stderr); + done = true; } -static void runTest(const char* pathOrURL) +static void setDefaultsToConsistentStateValuesForTesting() +{ + WebKitWebSettings *settings = webkit_web_view_get_settings(webView); + + g_object_set(G_OBJECT(settings), + "default-font-family", "Times", + "monospace-font-family", "Courier", + "serif-font-family", "Times", + "sans-serif-font-family", "Helvetica", + "default-font-size", 16, + "default-monospace-font-size", 13, + "minimum-font-size", 1, + NULL); +} + +static void runTest(const string& testPathOrURL) { - gchar* url = autocorrectURL(pathOrURL); + ASSERT(!testPathOrURL.empty()); - layoutTestController = new LayoutTestController(testRepaintDefault, repaintSweepHorizontallyDefault); + // Look for "'" as a separator between the path or URL, and the pixel dump hash that follows. + string pathOrURL(testPathOrURL); + string expectedPixelHash; - done = false; - topLoadingFrame = 0; + size_t separatorPos = pathOrURL.find("'"); + if (separatorPos != string::npos) { + pathOrURL = string(testPathOrURL, 0, separatorPos); + expectedPixelHash = string(testPathOrURL, separatorPos + 1); + } - if (shouldLogFrameLoadDelegates(pathOrURL)) - layoutTestController->setDumpFrameLoadCallbacks(true); + gchar* url = autocorrectURL(pathOrURL.c_str()); + const string testURL(url); - if (currentTest) - g_free(currentTest); - currentTest = url; + gLayoutTestController = new LayoutTestController(testURL, expectedPixelHash); + topLoadingFrame = 0; + done = false; + + if (shouldLogFrameLoadDelegates(pathOrURL.c_str())) + gLayoutTestController->setDumpFrameLoadCallbacks(true); WorkQueue::shared()->clear(); WorkQueue::shared()->setFrozen(false); webkit_web_view_open(webView, url); + g_free(url); + url = NULL; + while (!done) - g_main_context_iteration(NULL, true); + g_main_context_iteration(NULL, TRUE); - WorkQueue::shared()->clear(); + // A blank load seems to be necessary to reset state after certain tests. + webkit_web_view_open(webView, "about:blank"); - delete layoutTestController; - layoutTestController = 0; + gLayoutTestController->deref(); + gLayoutTestController = 0; } void webViewLoadStarted(WebKitWebView* view, WebKitWebFrame* frame, void*) @@ -253,20 +278,20 @@ static gboolean processWork(void* data) } // if we didn't start a new load, then we finished all the commands, so we're ready to dump state - if (!topLoadingFrame && !layoutTestController->waitToDump()) + if (!topLoadingFrame && !gLayoutTestController->waitToDump()) dump(); return FALSE; } -void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*) +static void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*) { if (frame != topLoadingFrame) return; topLoadingFrame = 0; WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue for the rest of this test - if (layoutTestController->waitToDump()) + if (gLayoutTestController->waitToDump()) return; if (WorkQueue::shared()->count()) @@ -275,49 +300,56 @@ void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*) dump(); } -void webViewWindowObjectCleared(WebKitWebView* view, WebKitWebFrame* frame, JSGlobalContextRef context, JSObjectRef globalObject) +static void webViewWindowObjectCleared(WebKitWebView* view, WebKitWebFrame* frame, JSGlobalContextRef context, JSObjectRef windowObject, gpointer data) { JSValueRef exception = 0; - assert(layoutTestController); - layoutTestController->makeWindowObject(context, globalObject, &exception); + assert(gLayoutTestController); + + gLayoutTestController->makeWindowObject(context, windowObject, &exception); assert(!exception); } -gboolean webViewConsoleMessage(WebKitWebView* view, const gchar* message, unsigned int line, const gchar* sourceId) +static gboolean webViewConsoleMessage(WebKitWebView* view, const gchar* message, unsigned int line, const gchar* sourceId, gpointer data) { fprintf(stdout, "CONSOLE MESSAGE: line %d: %s\n", line, message); return TRUE; } -gboolean webViewScriptAlert(WebKitWebView* view, WebKitWebFrame* frame, const gchar* message) +static gboolean webViewScriptAlert(WebKitWebView* view, WebKitWebFrame* frame, const gchar* message, gpointer data) { fprintf(stdout, "ALERT: %s\n", message); return TRUE; } -gboolean webViewScriptPrompt(WebKitWebView* webView, WebKitWebFrame* frame, const gchar* message, const gchar* defaultValue, gchar** value) +static gboolean webViewScriptPrompt(WebKitWebView* webView, WebKitWebFrame* frame, const gchar* message, const gchar* defaultValue, gchar** value, gpointer data) { fprintf(stdout, "PROMPT: %s, default text: %s\n", message, defaultValue); *value = g_strdup(defaultValue); return TRUE; } -gboolean webViewScriptConfirm(WebKitWebView* view, WebKitWebFrame* frame, const gchar* message, gboolean* didConfirm) +static gboolean webViewScriptConfirm(WebKitWebView* view, WebKitWebFrame* frame, const gchar* message, gboolean* didConfirm, gpointer data) { fprintf(stdout, "CONFIRM: %s\n", message); *didConfirm = TRUE; return TRUE; } +static void webViewTitleChanged(WebKitWebView* view, WebKitWebFrame* frame, const gchar* title, gpointer data) +{ + if (gLayoutTestController->dumpTitleChanges() && !done) + printf("TITLE CHANGED: %s\n", title ? title : ""); +} int main(int argc, char* argv[]) { + g_thread_init(NULL); + gtk_init(&argc, &argv); + struct option options[] = { - {"horizontal-sweep", no_argument, &repaintSweepHorizontallyDefault, true}, {"notree", no_argument, &dumpTree, false}, {"pixel-tests", no_argument, &dumpPixels, true}, - {"repaint", no_argument, &testRepaintDefault, true}, {"tree", no_argument, &dumpTree, true}, {NULL, 0, NULL, 0} }; @@ -331,8 +363,6 @@ int main(int argc, char* argv[]) break; } - gtk_init(&argc, &argv); - GtkWidget* window = gtk_window_new(GTK_WINDOW_POPUP); GtkContainer* container = GTK_CONTAINER(gtk_fixed_new()); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(container)); @@ -350,6 +380,9 @@ int main(int argc, char* argv[]) g_signal_connect(G_OBJECT(webView), "script-alert", G_CALLBACK(webViewScriptAlert), 0); g_signal_connect(G_OBJECT(webView), "script-prompt", G_CALLBACK(webViewScriptPrompt), 0); g_signal_connect(G_OBJECT(webView), "script-confirm", G_CALLBACK(webViewScriptConfirm), 0); + g_signal_connect(G_OBJECT(webView), "title-changed", G_CALLBACK(webViewTitleChanged), 0); + + setDefaultsToConsistentStateValuesForTesting(); if (argc == optind+1 && strcmp(argv[optind], "-") == 0) { char filenameBuffer[2048]; diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.pro b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.pro deleted file mode 100644 index 51fdd65..0000000 --- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.pro +++ /dev/null @@ -1,19 +0,0 @@ -TEMPLATE = app -SOURCES += DumpRenderTree.cpp \ - ../LayoutTestController.cpp \ - ../GCController.cpp \ - ../WorkQueue.cpp \ - GCControllerGtk.cpp \ - LayoutTestControllerGtk.cpp \ - WorkQueueItemGtk.cpp - -CONFIG -= app_bundle - -BASE_DIR = $$PWD/../../.. - -include(../../../WebKit.pri) - -INCLUDEPATH += \ - $$BASE_DIR/WebKitTools/DumpRenderTree - -QMAKE_RPATHDIR += $$OUTPUT_DIR/lib diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTreeGtk.h b/WebKitTools/DumpRenderTree/gtk/DumpRenderTreeGtk.h index 7be651a..1d2f179 100644 --- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTreeGtk.h +++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTreeGtk.h @@ -30,9 +30,12 @@ #define DumpRenderTreeGtk_h #include <webkit/webkitdefines.h> +#include <JavaScriptCore/JSBase.h> extern WebKitWebFrame* mainFrame; extern WebKitWebFrame* topLoadingFrame; extern guint waitToDumpWatchdog; +gchar* JSStringCopyUTF8CString(JSStringRef jsString); + #endif // DumpRenderTreeGtk_h diff --git a/WebKitTools/DumpRenderTree/gtk/GCControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/GCControllerGtk.cpp index b3e6ad3..35f1685 100644 --- a/WebKitTools/DumpRenderTree/gtk/GCControllerGtk.cpp +++ b/WebKitTools/DumpRenderTree/gtk/GCControllerGtk.cpp @@ -26,6 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" #include "GCController.h" void GCController::collect() const diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp index fead119..3a01e60 100644 --- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp +++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2007 Apple Inc. All rights reserved. * Copyright (C) 2007 Eric Seidel <eric@webkit.org> + * Copyright (C) 2008 Nuanti Ltd. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,6 +28,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" #include "LayoutTestController.h" #include "DumpRenderTree.h" @@ -36,6 +38,7 @@ #include <JavaScriptCore/JSStringRef.h> #include <glib.h> +#include <webkit/webkit.h> LayoutTestController::~LayoutTestController() { @@ -49,7 +52,20 @@ void LayoutTestController::addDisallowedURL(JSStringRef url) void LayoutTestController::clearBackForwardList() { - // FIXME: implement + WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); + WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list(webView); + WebKitWebHistoryItem* item = webkit_web_back_forward_list_get_current_item(list); + g_object_ref(item); + + // We clear the history by setting the back/forward list's capacity to 0 + // then restoring it back and adding back the current item. + gint limit = webkit_web_back_forward_list_get_limit(list); + webkit_web_back_forward_list_set_limit(list, 0); + webkit_web_back_forward_list_set_limit(list, limit); + // FIXME: implement add_item() + //webkit_web_back_forward_list_add_item(list, item); + webkit_web_back_forward_list_go_to_item(list, item); + g_object_unref(item); } JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name) @@ -84,7 +100,7 @@ void LayoutTestController::notifyDone() JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url) { // Function introduced in r28690. This may need special-casing on Windows. - return url; // Do nothing on Unix. + return JSStringRetain(url); // Do nothing on Unix. } void LayoutTestController::queueBackNavigation(int howFarBack) @@ -113,9 +129,10 @@ void LayoutTestController::queueScript(JSStringRef script) WorkQueue::shared()->queue(new ScriptItem(script)); } -void LayoutTestController::setAcceptsEditing(bool newAcceptsEditing) +void LayoutTestController::setAcceptsEditing(bool acceptsEditing) { - // FIXME: implement + WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); + webkit_web_view_set_editable(webView, acceptsEditing); } void LayoutTestController::setCustomPolicyDelegate(bool setDelegate) @@ -138,14 +155,27 @@ void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) // FIXME: implement } +static gchar* userStyleSheet = NULL; +static gboolean userStyleSheetEnabled = TRUE; + void LayoutTestController::setUserStyleSheetEnabled(bool flag) { - // FIXME: implement + userStyleSheetEnabled = flag; + + WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); + WebKitWebSettings* settings = webkit_web_view_get_settings(webView); + if (flag && userStyleSheet) + g_object_set(G_OBJECT(settings), "user-stylesheet-uri", userStyleSheet, NULL); + else + g_object_set(G_OBJECT(settings), "user-stylesheet-uri", "", NULL); } void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) { - // FIXME: implement + g_free(userStyleSheet); + userStyleSheet = JSStringCopyUTF8CString(path); + if (userStyleSheetEnabled) + setUserStyleSheetEnabled(true); } void LayoutTestController::setWindowIsKey(bool windowIsKey) @@ -153,11 +183,17 @@ void LayoutTestController::setWindowIsKey(bool windowIsKey) // FIXME: implement } +void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +{ + // FIXME: implement +} + static gboolean waitToDumpWatchdogFired(void*) { const char* message = "FAIL: Timed out waiting for notifyDone to be called\n"; fprintf(stderr, "%s", message); fprintf(stdout, "%s", message); + waitToDumpWatchdog = 0; dump(); return FALSE; } @@ -178,7 +214,7 @@ void LayoutTestController::setWaitToDump(bool waitUntilDone) int LayoutTestController::windowCount() { // FIXME: implement - return 0; + return 1; } void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) @@ -191,11 +227,22 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) // FIXME: implement } +void LayoutTestController::setJavaScriptProfilingEnabled(bool flag) +{ + // FIXME: implement +} + void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled) { // FIXME: implement } +bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +{ + // FIXME: implement + return false; +} + void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) { // FIXME: implement @@ -210,3 +257,14 @@ void LayoutTestController::clearPersistentUserStyleSheet() { // FIXME: implement } + +void LayoutTestController::clearAllDatabases() +{ + // FIXME: implement +} + +void LayoutTestController::setDatabaseQuota(unsigned long long quota) +{ + // FIXME: implement +} + diff --git a/WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp b/WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp index ee77683..5526667 100644 --- a/WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp +++ b/WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp @@ -17,14 +17,17 @@ * Boston, MA 02110-1301, USA. */ +#include "config.h" #include "WorkQueueItem.h" + #include "DumpRenderTree.h" #include <JavaScriptCore/JSStringRef.h> #include <webkit/webkit.h> +#include <string.h> // Returns a newly allocated UTF-8 character buffer which must be freed with g_free() -static gchar* JSStringCopyUTF8CString(JSStringRef jsString) +gchar* JSStringCopyUTF8CString(JSStringRef jsString) { size_t dataSize = JSStringGetMaximumUTF8CStringSize(jsString); gchar* utf8 = (gchar*)g_malloc(dataSize); @@ -60,7 +63,6 @@ void ScriptItem::invoke() const { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); gchar* scriptString = JSStringCopyUTF8CString(script()); - // TODO: does this return something we need to free? If not, why not? webkit_web_view_execute_script(webView, scriptString); g_free(scriptString); } diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm new file mode 100644 index 0000000..482c4f3 --- /dev/null +++ b/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2008 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. ``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 + * 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 "DumpRenderTree.h" +#import "AccessibilityController.h" + +#import "AccessibilityUIElement.h" +#import <Foundation/Foundation.h> +#import <WebKit/WebFrame.h> +#import <WebKit/WebHTMLView.h> + +AccessibilityController::AccessibilityController() +{ +} + +AccessibilityController::~AccessibilityController() +{ +} + +AccessibilityUIElement AccessibilityController::focusedElement() +{ + // FIXME: we could do some caching here. + id accessibilityObject = [[[mainFrame frameView] documentView] accessibilityFocusedUIElement]; + return AccessibilityUIElement(accessibilityObject); +} + +AccessibilityUIElement AccessibilityController::rootElement() +{ + // FIXME: we could do some caching here. + id accessibilityObject = [[mainFrame frameView] documentView]; + return AccessibilityUIElement(accessibilityObject); +} diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm new file mode 100644 index 0000000..81edd99 --- /dev/null +++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm @@ -0,0 +1,425 @@ +/* + * Copyright (C) 2008 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. ``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 + * 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 "DumpRenderTree.h" +#import "AccessibilityUIElement.h" + +#import <Foundation/Foundation.h> +#import <JavaScriptCore/JSStringRef.h> +#import <JavaScriptCore/JSStringRefCF.h> +#import <WebKit/WebFrame.h> +#import <WebKit/WebHTMLView.h> +#import <WebKit/WebTypesInternal.h> +#import <wtf/RetainPtr.h> +#import <wtf/Vector.h> + +AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element) + : m_element(element) +{ + [m_element retain]; +} + +AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other) + : m_element(other.m_element) +{ + [m_element retain]; +} + +AccessibilityUIElement::~AccessibilityUIElement() +{ + [m_element release]; +} + +@interface NSString (JSStringRefAdditions) +- (JSStringRef)createJSStringRef; +@end + +@implementation NSString (JSStringRefAdditions) + +- (JSStringRef)createJSStringRef +{ + return JSStringCreateWithCFString((CFStringRef)self); +} + +@end + +static NSString* descriptionOfValue(id valueObject, id focusedAccessibilityObject) +{ + if (!valueObject) + return NULL; + + if ([valueObject isKindOfClass:[NSArray class]]) + return [NSString stringWithFormat:@"<array of size %d>", [(NSArray*)valueObject count]]; + + if ([valueObject isKindOfClass:[NSNumber class]]) + return [(NSNumber*)valueObject stringValue]; + + if ([valueObject isKindOfClass:[NSValue class]]) { + NSString* type = [NSString stringWithCString:[valueObject objCType] encoding:NSASCIIStringEncoding]; + NSValue* value = (NSValue*)valueObject; + if ([type rangeOfString:@"NSRect"].length > 0) + return [NSString stringWithFormat:@"NSRect: %@", NSStringFromRect([value rectValue])]; + if ([type rangeOfString:@"NSPoint"].length > 0) + return [NSString stringWithFormat:@"NSPoint: %@", NSStringFromPoint([value pointValue])]; + if ([type rangeOfString:@"NSSize"].length > 0) + return [NSString stringWithFormat:@"NSSize: %@", NSStringFromSize([value sizeValue])]; + if ([type rangeOfString:@"NSRange"].length > 0) + return [NSString stringWithFormat:@"NSRange: %@", NSStringFromRange([value rangeValue])]; + } + + // Strip absolute URL paths + NSString* description = [valueObject description]; + NSRange range = [description rangeOfString:@"LayoutTests"]; + if (range.length) + return [description substringFromIndex:range.location]; + + // Strip pointer locations + if ([description rangeOfString:@"0x"].length) { + NSString* role = [focusedAccessibilityObject accessibilityAttributeValue:@"AXRole"]; + NSString* title = [focusedAccessibilityObject accessibilityAttributeValue:@"AXTitle"]; + if ([title length]) + return [NSString stringWithFormat:@"<%@: '%@'>", role, title]; + return [NSString stringWithFormat:@"<%@>", role]; + } + + return [valueObject description]; +} + +static NSString* attributesOfElement(id accessibilityObject) +{ + NSArray* supportedAttributes = [accessibilityObject accessibilityAttributeNames]; + + NSMutableString* attributesString = [NSMutableString string]; + for (NSUInteger i = 0; i < [supportedAttributes count]; ++i) { + NSString* attribute = [supportedAttributes objectAtIndex:i]; + + // Right now, position provides useless and screen-specific information, so we do not + // want to include it for the sake of universally passing tests. + if ([attribute isEqualToString:@"AXPosition"]) + continue; + + id valueObject = [accessibilityObject accessibilityAttributeValue:attribute]; + NSString* value = descriptionOfValue(valueObject, accessibilityObject); + [attributesString appendFormat:@"%@: %@\n", attribute, value]; + } + + return attributesString; +} + +static JSStringRef concatenateAttributeAndValue(NSString* attribute, NSString* value) +{ + Vector<UniChar> buffer([attribute length]); + [attribute getCharacters:buffer.data()]; + buffer.append(':'); + buffer.append(' '); + + Vector<UniChar> valueBuffer([value length]); + [value getCharacters:valueBuffer.data()]; + buffer.append(valueBuffer); + + return JSStringCreateWithCharacters(buffer.data(), buffer.size()); +} + +static void convertNSArrayToVector(NSArray* array, Vector<AccessibilityUIElement>& elementVector) +{ + NSUInteger count = [array count]; + for (NSUInteger i = 0; i < count; ++i) + elementVector.append(AccessibilityUIElement([array objectAtIndex:i])); +} + +static JSStringRef descriptionOfElements(Vector<AccessibilityUIElement>& elementVector) +{ + NSMutableString* allElementString = [NSMutableString string]; + size_t size = elementVector.size(); + for (size_t i = 0; i < size; ++i) { + NSString* attributes = attributesOfElement(elementVector[i].platformUIElement()); + [allElementString appendFormat:@"%@\n------------\n", attributes]; + } + + return [allElementString createJSStringRef]; +} + +void AccessibilityUIElement::getLinkedUIElements(Vector<AccessibilityUIElement>& elementVector) +{ + NSArray* linkedElements = [m_element accessibilityAttributeValue:NSAccessibilityLinkedUIElementsAttribute]; + convertNSArrayToVector(linkedElements, elementVector); +} + +void AccessibilityUIElement::getDocumentLinks(Vector<AccessibilityUIElement>& elementVector) +{ + NSArray* linkElements = [m_element accessibilityAttributeValue:@"AXLinkUIElements"]; + convertNSArrayToVector(linkElements, elementVector); +} + +void AccessibilityUIElement::getChildren(Vector<AccessibilityUIElement>& elementVector) +{ + NSArray* children = [m_element accessibilityAttributeValue:NSAccessibilityChildrenAttribute]; + convertNSArrayToVector(children, elementVector); +} + +AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index) +{ + Vector<AccessibilityUIElement> children; + getChildren(children); + + if (index < children.size()) + return children[index]; + return nil; +} + +AccessibilityUIElement AccessibilityUIElement::titleUIElement() +{ + id accessibilityObject = [m_element accessibilityAttributeValue:NSAccessibilityTitleUIElementAttribute]; + if (accessibilityObject) + return AccessibilityUIElement(accessibilityObject); + + return nil; +} + +JSStringRef AccessibilityUIElement::attributesOfLinkedUIElements() +{ + Vector<AccessibilityUIElement> linkedElements; + getLinkedUIElements(linkedElements); + return descriptionOfElements(linkedElements); +} + +JSStringRef AccessibilityUIElement::attributesOfDocumentLinks() +{ + Vector<AccessibilityUIElement> linkElements; + getDocumentLinks(linkElements); + return descriptionOfElements(linkElements); +} + +JSStringRef AccessibilityUIElement::attributesOfChildren() +{ + Vector<AccessibilityUIElement> children; + getChildren(children); + return descriptionOfElements(children); +} + +JSStringRef AccessibilityUIElement::allAttributes() +{ + NSString* attributes = attributesOfElement(m_element); + return [attributes createJSStringRef]; +} + +JSStringRef AccessibilityUIElement::parameterizedAttributeNames() +{ + NSArray* supportedParameterizedAttributes = [m_element accessibilityParameterizedAttributeNames]; + + NSMutableString* attributesString = [NSMutableString string]; + for (NSUInteger i = 0; i < [supportedParameterizedAttributes count]; ++i) { + [attributesString appendFormat:@"%@\n", [supportedParameterizedAttributes objectAtIndex:i]]; + } + + return [attributesString createJSStringRef]; +} + +JSStringRef AccessibilityUIElement::role() +{ + NSString* role = descriptionOfValue([m_element accessibilityAttributeValue:@"AXRole"], m_element); + return concatenateAttributeAndValue(@"AXRole", role); +} + +JSStringRef AccessibilityUIElement::title() +{ + NSString* title = descriptionOfValue([m_element accessibilityAttributeValue:@"AXTitle"], m_element); + return concatenateAttributeAndValue(@"AXTitle", title); +} + +JSStringRef AccessibilityUIElement::description() +{ + id description = descriptionOfValue([m_element accessibilityAttributeValue:@"AXDescription"], m_element); + return concatenateAttributeAndValue(@"AXDescription", description); +} + +double AccessibilityUIElement::width() +{ + NSValue* sizeValue = [m_element accessibilityAttributeValue:@"AXSize"]; + return static_cast<double>([sizeValue sizeValue].width); +} + +double AccessibilityUIElement::height() +{ + NSValue* sizeValue = [m_element accessibilityAttributeValue:@"AXSize"]; + return static_cast<double>([sizeValue sizeValue].height); +} + +double AccessibilityUIElement::intValue() +{ + id value = [m_element accessibilityAttributeValue:@"AXValue"]; + if ([value isKindOfClass:[NSNumber class]]) + return [(NSNumber*)value doubleValue]; + return 0.0f; +} + +double AccessibilityUIElement::minValue() +{ + id value = [m_element accessibilityAttributeValue:@"AXMinValue"]; + if ([value isKindOfClass:[NSNumber class]]) + return [(NSNumber*)value doubleValue]; + return 0.0f; +} + +double AccessibilityUIElement::maxValue() +{ + id value = [m_element accessibilityAttributeValue:@"AXMaxValue"]; + if ([value isKindOfClass:[NSNumber class]]) + return [(NSNumber*)value doubleValue]; + return 0.0; +} + +int AccessibilityUIElement::insertionPointLineNumber() +{ + id value = [m_element accessibilityAttributeValue:@"AXInsertionPointLineNumber"]; + if ([value isKindOfClass:[NSNumber class]]) + return [(NSNumber *)value intValue]; + return -1; +} + +bool AccessibilityUIElement::supportsPressAction() +{ + NSArray* actions = [m_element accessibilityActionNames]; + return [actions containsObject:@"AXPress"]; +} + +// parameterized attributes +int AccessibilityUIElement::lineForIndex(int index) +{ + id value = [m_element accessibilityAttributeValue:@"AXLineForIndex" forParameter:[NSNumber numberWithInt:index]]; + if ([value isKindOfClass:[NSNumber class]]) + return [(NSNumber *)value intValue]; + return -1; +} + +JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length) +{ + NSRange range = NSMakeRange(location, length); + id value = [m_element accessibilityAttributeValue:NSAccessibilityBoundsForRangeParameterizedAttribute forParameter:[NSValue valueWithRange:range]]; + NSRect rect = NSMakeRect(0,0,0,0); + if ([value isKindOfClass:[NSValue class]]) + rect = [value rectValue]; + + // don't return position information because it is platform dependent + NSMutableString* boundsDescription = [NSMutableString stringWithFormat:@"{{%f, %f}, {%f, %f}}",-1.0f,-1.0f,rect.size.width,rect.size.height]; + return [boundsDescription createJSStringRef]; +} + +JSStringRef AccessibilityUIElement::attributesOfColumnHeaders() +{ + // not yet defined in AppKit... odd + NSArray* columnHeadersArray = [m_element accessibilityAttributeValue:@"AXColumnHeaderUIElements"]; + Vector<AccessibilityUIElement> columnHeadersVector; + convertNSArrayToVector(columnHeadersArray, columnHeadersVector); + return descriptionOfElements(columnHeadersVector); +} + +JSStringRef AccessibilityUIElement::attributesOfRowHeaders() +{ + NSArray* rowHeadersArray = [m_element accessibilityAttributeValue:@"AXRowHeaderUIElements"]; + Vector<AccessibilityUIElement> rowHeadersVector; + convertNSArrayToVector(rowHeadersArray, rowHeadersVector); + return descriptionOfElements(rowHeadersVector); +} + +JSStringRef AccessibilityUIElement::attributesOfColumns() +{ + NSArray* columnsArray = [m_element accessibilityAttributeValue:NSAccessibilityColumnsAttribute]; + Vector<AccessibilityUIElement> columnsVector; + convertNSArrayToVector(columnsArray, columnsVector); + return descriptionOfElements(columnsVector); +} + +JSStringRef AccessibilityUIElement::attributesOfRows() +{ + NSArray* rowsArray = [m_element accessibilityAttributeValue:NSAccessibilityRowsAttribute]; + Vector<AccessibilityUIElement> rowsVector; + convertNSArrayToVector(rowsArray, rowsVector); + return descriptionOfElements(rowsVector); +} + +JSStringRef AccessibilityUIElement::attributesOfVisibleCells() +{ + NSArray* cellsArray = [m_element accessibilityAttributeValue:@"AXVisibleCells"]; + Vector<AccessibilityUIElement> cellsVector; + convertNSArrayToVector(cellsArray, cellsVector); + return descriptionOfElements(cellsVector); +} + +JSStringRef AccessibilityUIElement::attributesOfHeader() +{ + id headerObject = [m_element accessibilityAttributeValue:NSAccessibilityHeaderAttribute]; + if (!headerObject) + return [@"" createJSStringRef]; + + Vector<AccessibilityUIElement> headerVector; + headerVector.append(headerObject); + return descriptionOfElements(headerVector); +} + +int AccessibilityUIElement::indexInTable() +{ + NSNumber* indexNumber = [m_element accessibilityAttributeValue:NSAccessibilityIndexAttribute]; + if (!indexNumber) + return -1; + return [indexNumber intValue]; +} + +JSStringRef AccessibilityUIElement::rowIndexRange() +{ + NSValue* indexRange = [m_element accessibilityAttributeValue:@"AXRowIndexRange"]; + NSRange range = indexRange ? [indexRange rangeValue] : NSMakeRange(0,0); + NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length]; + return [rangeDescription createJSStringRef]; +} + +JSStringRef AccessibilityUIElement::columnIndexRange() +{ + NSNumber* indexRange = [m_element accessibilityAttributeValue:@"AXColumnIndexRange"]; + NSRange range = indexRange ? [indexRange rangeValue] : NSMakeRange(0,0); + NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length]; + return [rangeDescription createJSStringRef]; +} + +AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned col, unsigned row) +{ + NSArray *colRowArray = [NSArray arrayWithObjects:[NSNumber numberWithUnsignedInt:col], [NSNumber numberWithUnsignedInt:row], nil]; + return [m_element accessibilityAttributeValue:@"AXCellForColumnAndRow" forParameter:colRowArray]; +} + +JSStringRef AccessibilityUIElement::selectedTextRange() +{ + NSNumber *indexRange = [m_element accessibilityAttributeValue:NSAccessibilitySelectedTextRangeAttribute]; + NSRange range = indexRange ? [indexRange rangeValue] : NSMakeRange(0,0); + NSMutableString *rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length]; + return [rangeDescription createJSStringRef]; +} + +void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length) +{ + NSRange textRange = NSMakeRange(location, length); + NSValue *textRangeValue = [NSValue valueWithRange:textRange]; + [m_element accessibilitySetValue:textRangeValue forAttribute:NSAccessibilitySelectedTextRangeAttribute]; +} diff --git a/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig b/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig index bd5b1e0..de9d67f 100644 --- a/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig +++ b/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig @@ -3,6 +3,8 @@ FRAMEWORK_SEARCH_PATHS = $(FRAMEWORK_SEARCH_PATHS_$(MAC_OS_X_VERSION_MAJOR)); FRAMEWORK_SEARCH_PATHS_ = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks FRAMEWORK_SEARCH_PATHS_1040 = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks FRAMEWORK_SEARCH_PATHS_1050 = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks +FRAMEWORK_SEARCH_PATHS_1060 = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks +GCC_PREPROCESSOR_DEFINITIONS = ENABLE_DASHBOARD_SUPPORT; DEBUG_INFORMATION_FORMAT = dwarf PREBINDING = NO GCC_C_LANGUAGE_STANDARD = gnu99 @@ -12,4 +14,4 @@ GCC_WARN_UNUSED_FUNCTION = YES GCC_WARN_UNUSED_VARIABLE = YES GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO WARNING_CFLAGS = -Wall -W -Wno-unused-parameter -VALID_ARCHS = ppc7400 ppc970 i386 ppc +LINKER_DISPLAYS_MANGLED_NAMES = YES; diff --git a/WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig b/WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig index e17439e..e272da2 100644 --- a/WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig +++ b/WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig @@ -1,4 +1,6 @@ #include "Base.xcconfig" +ARCHS = $(NATIVE_ARCH); + MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR)) MACOSX_DEPLOYMENT_TARGET_ = 10.4 MACOSX_DEPLOYMENT_TARGET_1040 = 10.4 diff --git a/WebKitTools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig b/WebKitTools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig index c8a7bdc..b977225 100644 --- a/WebKitTools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig +++ b/WebKitTools/DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig @@ -1,4 +1,4 @@ -OTHER_LDFLAGS = -sectcreate __DATA Ahem qt/fonts/AHEM____.TTF +OTHER_LDFLAGS = -sectcreate __DATA Ahem qt/fonts/AHEM____.TTF -sectcreate __DATA WeightWatcher100 fonts/WebKitWeightWatcher100.ttf -sectcreate __DATA WeightWatcher200 fonts/WebKitWeightWatcher200.ttf -sectcreate __DATA WeightWatcher300 fonts/WebKitWeightWatcher300.ttf -sectcreate __DATA WeightWatcher400 fonts/WebKitWeightWatcher400.ttf -sectcreate __DATA WeightWatcher500 fonts/WebKitWeightWatcher500.ttf -sectcreate __DATA WeightWatcher600 fonts/WebKitWeightWatcher600.ttf -sectcreate __DATA WeightWatcher700 fonts/WebKitWeightWatcher700.ttf -sectcreate __DATA WeightWatcher800 fonts/WebKitWeightWatcher800.ttf -sectcreate __DATA WeightWatcher900 fonts/WebKitWeightWatcher900.ttf PRODUCT_NAME = DumpRenderTree GCC_ENABLE_OBJC_EXCEPTIONS = YES GCC_PREFIX_HEADER = DumpRenderTreePrefix.h diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm index 6df150d..203c6b2 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm @@ -29,6 +29,7 @@ #import "DumpRenderTree.h" +#import "AccessibilityController.h" #import "CheckedMalloc.h" #import "DumpRenderTreePasteboard.h" #import "DumpRenderTreeWindow.h" @@ -46,34 +47,42 @@ #import "UIDelegate.h" #import "WorkQueue.h" #import "WorkQueueItem.h" +#import <Carbon/Carbon.h> #import <CoreFoundation/CoreFoundation.h> #import <WebKit/DOMElementPrivate.h> #import <WebKit/DOMExtensions.h> #import <WebKit/DOMRange.h> #import <WebKit/WebBackForwardList.h> +#import <WebKit/WebCache.h> #import <WebKit/WebCoreStatistics.h> -#import <WebKit/WebDatabaseManagerPrivate.h> #import <WebKit/WebDataSourcePrivate.h> +#import <WebKit/WebDatabaseManagerPrivate.h> #import <WebKit/WebDocumentPrivate.h> #import <WebKit/WebEditingDelegate.h> #import <WebKit/WebFrameView.h> +#import <WebKit/WebHTMLRepresentationInternal.h> #import <WebKit/WebHistory.h> #import <WebKit/WebHistoryItemPrivate.h> +#import <WebKit/WebInspector.h> #import <WebKit/WebPluginDatabase.h> #import <WebKit/WebPreferences.h> #import <WebKit/WebPreferencesPrivate.h> #import <WebKit/WebResourceLoadDelegate.h> +#import <WebKit/WebTypesInternal.h> #import <WebKit/WebViewPrivate.h> #import <getopt.h> #import <mach-o/getsect.h> #import <objc/objc-runtime.h> #import <wtf/Assertions.h> #import <wtf/RetainPtr.h> +#import <wtf/OwnPtr.h> + +using namespace std; @interface DumpRenderTreeEvent : NSEvent @end -static void runTest(const char *pathOrURL); +static void runTest(const string& testPathOrURL); // Deciding when it's OK to dump out the state is a bit tricky. All these must be true: // - There is no load in progress @@ -84,8 +93,8 @@ static void runTest(const char *pathOrURL); volatile bool done; -NavigationController* navigationController = 0; -LayoutTestController* layoutTestController = 0; +NavigationController* gNavigationController = 0; +LayoutTestController* gLayoutTestController = 0; WebFrame *mainFrame = 0; // This is the topmost frame that is loading, during a given load, or nil when no load is @@ -106,13 +115,10 @@ static ResourceLoadDelegate *resourceLoadDelegate; PolicyDelegate *policyDelegate; static int dumpPixels; -static int dumpAllPixels; static int threaded; -static int testRepaintDefault; -static int repaintSweepHorizontallyDefault; static int dumpTree = YES; +static int forceComplexText; static BOOL printSeparators; -static NSString *currentTest = nil; static RetainPtr<CFStringRef> persistentUserStyleSheetLocation; static WebHistoryItem *prevTestBFItem = nil; // current b/f item at the end of the previous test @@ -120,43 +126,109 @@ static WebHistoryItem *prevTestBFItem = nil; // current b/f item at the end of const unsigned maxViewHeight = 600; const unsigned maxViewWidth = 800; +#if __OBJC2__ +static void swizzleAllMethods(Class imposter, Class original) +{ + unsigned int imposterMethodCount; + Method* imposterMethods = class_copyMethodList(imposter, &imposterMethodCount); + + unsigned int originalMethodCount; + Method* originalMethods = class_copyMethodList(original, &originalMethodCount); + + for (unsigned int i = 0; i < imposterMethodCount; i++) { + SEL imposterMethodName = method_getName(imposterMethods[i]); + + // Attempt to add the method to the original class. If it fails, the method already exists and we should + // instead exchange the implementations. + if (class_addMethod(original, imposterMethodName, method_getImplementation(originalMethods[i]), method_getTypeEncoding(originalMethods[i]))) + continue; + + unsigned int j = 0; + for (; j < originalMethodCount; j++) { + SEL originalMethodName = method_getName(originalMethods[j]); + if (sel_isEqual(imposterMethodName, originalMethodName)) + break; + } + + // If class_addMethod failed above then the method must exist on the original class. + ASSERT(j < originalMethodCount); + method_exchangeImplementations(imposterMethods[i], originalMethods[j]); + } + + free(imposterMethods); + free(originalMethods); +} +#endif + +static void poseAsClass(const char* imposter, const char* original) +{ + Class imposterClass = objc_getClass(imposter); + Class originalClass = objc_getClass(original); + +#if !__OBJC2__ + class_poseAs(imposterClass, originalClass); +#else + + // Swizzle instance methods + swizzleAllMethods(imposterClass, originalClass); + // and then class methods + swizzleAllMethods(object_getClass(imposterClass), object_getClass(originalClass)); +#endif +} + void setPersistentUserStyleSheetLocation(CFStringRef url) { persistentUserStyleSheetLocation = url; } -static BOOL shouldIgnoreWebCoreNodeLeaks(CFStringRef URLString) +static bool shouldIgnoreWebCoreNodeLeaks(const string& URLString) { - static CFStringRef const ignoreSet[] = { + static char* const ignoreSet[] = { // Keeping this infrastructure around in case we ever need it again. }; - static const int ignoreSetCount = sizeof(ignoreSet) / sizeof(CFStringRef); + static const int ignoreSetCount = sizeof(ignoreSet) / sizeof(char*); for (int i = 0; i < ignoreSetCount; i++) { - CFStringRef ignoreString = ignoreSet[i]; - CFRange range = CFRangeMake(0, CFStringGetLength(URLString)); - CFOptionFlags flags = kCFCompareAnchored | kCFCompareBackwards | kCFCompareCaseInsensitive; - if (CFStringFindWithOptions(URLString, ignoreString, range, flags, NULL)) - return YES; + // FIXME: ignore case + string curIgnore(ignoreSet[i]); + // Match at the end of the URLString + if (!URLString.compare(URLString.length() - curIgnore.length(), curIgnore.length(), curIgnore)) + return true; } - return NO; + return false; } -static void activateAhemFont() -{ - unsigned long fontDataLength; - char* fontData = getsectdata("__DATA", "Ahem", &fontDataLength); - if (!fontData) { - fprintf(stderr, "Failed to locate the Ahem font.\n"); - exit(1); - } +static void activateFonts() +{ + static const char* fontSectionNames[] = { + "Ahem", + "WeightWatcher100", + "WeightWatcher200", + "WeightWatcher300", + "WeightWatcher400", + "WeightWatcher500", + "WeightWatcher600", + "WeightWatcher700", + "WeightWatcher800", + "WeightWatcher900", + 0 + }; + + for (unsigned i = 0; fontSectionNames[i]; ++i) { + unsigned long fontDataLength; + char* fontData = getsectdata("__DATA", fontSectionNames[i], &fontDataLength); + if (!fontData) { + fprintf(stderr, "Failed to locate the %s font.\n", fontSectionNames[i]); + exit(1); + } - ATSFontContainerRef fontContainer; - OSStatus status = ATSFontActivateFromMemory(fontData, fontDataLength, kATSFontContextLocal, kATSFontFormatUnspecified, NULL, kATSOptionFlagsDefault, &fontContainer); + ATSFontContainerRef fontContainer; + OSStatus status = ATSFontActivateFromMemory(fontData, fontDataLength, kATSFontContextLocal, kATSFontFormatUnspecified, NULL, kATSOptionFlagsDefault, &fontContainer); - if (status != noErr) { - fprintf(stderr, "Failed to activate the Ahem font.\n"); - exit(1); + if (status != noErr) { + fprintf(stderr, "Failed to activate the %s font.\n", fontSectionNames[i]); + exit(1); + } } } @@ -235,18 +307,26 @@ void testStringByEvaluatingJavaScriptFromString() static void setDefaultsToConsistentValuesForTesting() { // Give some clear to undocumented defaults values - static const int MediumFontSmoothing = 2; + static const int NoFontSmoothing = 0; static const int BlueTintedAppearance = 1; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - [defaults setObject:@"DoubleMax" forKey:@"AppleScrollBarVariant"]; [defaults setInteger:4 forKey:@"AppleAntiAliasingThreshold"]; // smallest font size to CG should perform antialiasing on - [defaults setInteger:MediumFontSmoothing forKey:@"AppleFontSmoothing"]; + [defaults setInteger:NoFontSmoothing forKey:@"AppleFontSmoothing"]; [defaults setInteger:BlueTintedAppearance forKey:@"AppleAquaColorVariant"]; [defaults setObject:@"0.709800 0.835300 1.000000" forKey:@"AppleHighlightColor"]; [defaults setObject:@"0.500000 0.500000 0.500000" forKey:@"AppleOtherHighlightColor"]; [defaults setObject:[NSArray arrayWithObject:@"en"] forKey:@"AppleLanguages"]; + // Scrollbars are drawn either using AppKit (which uses NSUserDefaults) or using HIToolbox (which uses CFPreferences / kCFPreferencesAnyApplication / kCFPreferencesCurrentUser / kCFPreferencesAnyHost) + [defaults setObject:@"DoubleMax" forKey:@"AppleScrollBarVariant"]; + RetainPtr<CFTypeRef> initialValue = CFPreferencesCopyValue(CFSTR("AppleScrollBarVariant"), kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); + CFPreferencesSetValue(CFSTR("AppleScrollBarVariant"), CFSTR("DoubleMax"), kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); + ThemeScrollBarArrowStyle style; + GetThemeScrollBarArrowStyle(&style); // Force HIToolbox to read from CFPreferences + if (initialValue) + CFPreferencesSetValue(CFSTR("AppleScrollBarVariant"), initialValue.get(), kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); + NSString *libraryPath = [@"~/Library/Application Support/DumpRenderTree" stringByExpandingTildeInPath]; [defaults setObject:[libraryPath stringByAppendingPathComponent:@"Databases"] forKey:WebDatabaseDirectoryDefaultsKey]; @@ -265,6 +345,8 @@ static void setDefaultsToConsistentValuesForTesting() [preferences setEditableLinkBehavior:WebKitEditableLinkOnlyLiveWithShiftKey]; [preferences setTabsToLinks:NO]; [preferences setDOMPasteAllowed:YES]; + [preferences setFullDocumentTeardownEnabled:YES]; + [preferences setShouldPrintBackgrounds:YES]; // The back/forward cache is causing problems due to layouts during transition from one page to another. // So, turn it off for now, but we might want to turn it back on some day. @@ -273,8 +355,10 @@ static void setDefaultsToConsistentValuesForTesting() static void crashHandler(int sig) { - fprintf(stderr, "%s\n", strsignal(sig)); - restoreColorSpace(0); + char *signalName = strsignal(sig); + write(STDERR_FILENO, signalName, strlen(signalName)); + write(STDERR_FILENO, "\n", 1); + restoreMainDisplayColorProfile(0); exit(128 + sig); } @@ -295,7 +379,7 @@ static void installSignalHandlers() static void allocateGlobalControllers() { // FIXME: We should remove these and move to the ObjC standard [Foo sharedInstance] model - navigationController = [[NavigationController alloc] init]; + gNavigationController = [[NavigationController alloc] init]; frameLoadDelegate = [[FrameLoadDelegate alloc] init]; uiDelegate = [[UIDelegate alloc] init]; editingDelegate = [[EditingDelegate alloc] init]; @@ -312,7 +396,7 @@ static inline void releaseAndZero(NSObject** object) static void releaseGlobalControllers() { - releaseAndZero(&navigationController); + releaseAndZero(&gNavigationController); releaseAndZero(&frameLoadDelegate); releaseAndZero(&editingDelegate); releaseAndZero(&resourceLoadDelegate); @@ -323,13 +407,11 @@ static void releaseGlobalControllers() static void initializeGlobalsFromCommandLineOptions(int argc, const char *argv[]) { struct option options[] = { - {"dump-all-pixels", no_argument, &dumpAllPixels, YES}, - {"horizontal-sweep", no_argument, &repaintSweepHorizontallyDefault, YES}, {"notree", no_argument, &dumpTree, NO}, {"pixel-tests", no_argument, &dumpPixels, YES}, - {"repaint", no_argument, &testRepaintDefault, YES}, {"tree", no_argument, &dumpTree, YES}, {"threaded", no_argument, &threaded, YES}, + {"complex-text", no_argument, &forceComplexText, YES}, {NULL, 0, NULL, 0} }; @@ -376,14 +458,14 @@ static void runTestingServerLoop() static void prepareConsistentTestingEnvironment() { - class_poseAs(objc_getClass("DumpRenderTreePasteboard"), objc_getClass("NSPasteboard")); - class_poseAs(objc_getClass("DumpRenderTreeEvent"), objc_getClass("NSEvent")); + poseAsClass("DumpRenderTreePasteboard", "NSPasteboard"); + poseAsClass("DumpRenderTreeEvent", "NSEvent"); setDefaultsToConsistentValuesForTesting(); - activateAhemFont(); + activateFonts(); if (dumpPixels) - initializeColorSpaceAndScreeBufferForPixelTests(); + setupMainDisplayColorProfile(); allocateGlobalControllers(); makeLargeMallocFailSilently(); @@ -396,12 +478,17 @@ void dumpRenderTree(int argc, const char *argv[]) addTestPluginsToPluginSearchPath(argv[0]); if (dumpPixels) installSignalHandlers(); - + + if (forceComplexText) + [WebView _setAlwaysUsesComplexTextCodePath:YES]; + WebView *webView = createWebViewAndOffscreenWindow(); mainFrame = [webView mainFrame]; [[NSURLCache sharedURLCache] removeAllCachedResponses]; + [WebCache empty]; + // <rdar://problem/5222911> testStringByEvaluatingJavaScriptFromString(); @@ -420,7 +507,6 @@ void dumpRenderTree(int argc, const char *argv[]) if (threaded) stopJavaScriptThreads(); - [WebCoreStatistics emptyCache]; // Otherwise SVGImages trigger false positives for Frame/Node counts [webView close]; mainFrame = nil; @@ -445,7 +531,7 @@ void dumpRenderTree(int argc, const char *argv[]) } if (dumpPixels) - restoreColorSpace(0); + restoreMainDisplayColorProfile(0); } int main(int argc, const char *argv[]) @@ -454,11 +540,12 @@ int main(int argc, const char *argv[]) [NSApplication sharedApplication]; // Force AppKit to init itself dumpRenderTree(argc, argv); [WebCoreStatistics garbageCollectJavaScriptObjects]; + [WebCoreStatistics emptyCache]; // Otherwise SVGImages trigger false positives for Frame/Node counts [pool release]; return 0; } -static int compareHistoryItems(id item1, id item2, void *context) +static NSInteger compareHistoryItems(id item1, id item2, void *context) { return [[item1 target] caseInsensitiveCompare:[item2 target]]; } @@ -497,7 +584,7 @@ static void dumpFrameScrollPosition(WebFrame *f) printf("scrolled to %.f,%.f\n", scrollPosition.x, scrollPosition.y); } - if (layoutTestController->dumpChildFrameScrollPositions()) { + if (gLayoutTestController->dumpChildFrameScrollPositions()) { NSArray *kids = [f childFrames]; if (kids) for (unsigned i = 0; i < [kids count]; i++) @@ -521,7 +608,7 @@ static NSString *dumpFramesAsText(WebFrame *frame) [result appendFormat:@"%@\n", [documentElement innerText]]; - if (layoutTestController->dumpChildFramesAsText()) { + if (gLayoutTestController->dumpChildFramesAsText()) { NSArray *kids = [frame childFrames]; if (kids) { for (unsigned i = 0; i < [kids count]; i++) @@ -532,8 +619,47 @@ static NSString *dumpFramesAsText(WebFrame *frame) return result; } +static NSData *dumpFrameAsPDF(WebFrame *frame) +{ + if (!frame) + return nil; + + // Sadly we have to dump to a file and then read from that file again + // +[NSPrintOperation PDFOperationWithView:insideRect:] requires a rect and prints to a single page + // likewise +[NSView dataWithPDFInsideRect:] also prints to a single continuous page + // The goal of this function is to test "real" printing across multiple pages. + // FIXME: It's possible there might be printing SPI to let us print a multi-page PDF to an NSData object + NSString *path = @"/tmp/test.pdf"; + + NSMutableDictionary *printInfoDict = [NSMutableDictionary dictionaryWithDictionary:[[NSPrintInfo sharedPrintInfo] dictionary]]; + [printInfoDict setObject:NSPrintSaveJob forKey:NSPrintJobDisposition]; + [printInfoDict setObject:path forKey:NSPrintSavePath]; + + NSPrintInfo *printInfo = [[NSPrintInfo alloc] initWithDictionary:printInfoDict]; + [printInfo setHorizontalPagination:NSAutoPagination]; + [printInfo setVerticalPagination:NSAutoPagination]; + [printInfo setVerticallyCentered:NO]; + + NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView:[frame frameView] printInfo:printInfo]; + [printOperation setShowPanels:NO]; + [printOperation runOperation]; + + [printInfo release]; + + NSData *pdfData = [NSData dataWithContentsOfFile:path]; + [[NSFileManager defaultManager] removeFileAtPath:path handler:nil]; + + return pdfData; +} + static void convertMIMEType(NSMutableString *mimeType) { +#ifdef BUILDING_ON_LEOPARD + // Workaround for <rdar://problem/5539824> on Leopard + if ([mimeType isEqualToString:@"text/xml"]) + [mimeType setString:@"application/xml"]; +#endif + // Workaround for <rdar://problem/6234318> with Dashcode 2.0 if ([mimeType isEqualToString:@"application/x-javascript"]) [mimeType setString:@"text/javascript"]; } @@ -543,22 +669,24 @@ static void convertWebResourceDataToString(NSMutableDictionary *resource) NSMutableString *mimeType = [resource objectForKey:@"WebResourceMIMEType"]; convertMIMEType(mimeType); - if ([mimeType hasPrefix:@"text/"]) { + if ([mimeType hasPrefix:@"text/"] || [[WebHTMLRepresentation supportedNonImageMIMETypes] containsObject:mimeType]) { NSData *data = [resource objectForKey:@"WebResourceData"]; NSString *dataAsString = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; [resource setObject:dataAsString forKey:@"WebResourceData"]; } } -static void normalizeWebResourceURL(NSMutableString *webResourceURL, NSString *oldURLBase) +static void normalizeWebResourceURL(NSMutableString *webResourceURL) { - [webResourceURL replaceOccurrencesOfString:oldURLBase - withString:@"file://" - options:NSLiteralSearch - range:NSMakeRange(0, [webResourceURL length])]; + static int fileUrlLength = [(NSString *)@"file://" length]; + NSRange layoutTestsWebArchivePathRange = [webResourceURL rangeOfString:@"/LayoutTests/" options:NSBackwardsSearch]; + if (layoutTestsWebArchivePathRange.location == NSNotFound) + return; + NSRange currentWorkingDirectoryRange = NSMakeRange(fileUrlLength, layoutTestsWebArchivePathRange.location - fileUrlLength); + [webResourceURL replaceCharactersInRange:currentWorkingDirectoryRange withString:@""]; } -static void convertWebResourceResponseToDictionary(NSMutableDictionary *propertyList, NSString *oldURLBase) +static void convertWebResourceResponseToDictionary(NSMutableDictionary *propertyList) { NSURLResponse *response = nil; NSData *responseData = [propertyList objectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m @@ -573,7 +701,7 @@ static void convertWebResourceResponseToDictionary(NSMutableDictionary *property NSMutableDictionary *responseDictionary = [[NSMutableDictionary alloc] init]; NSMutableString *urlString = [[[response URL] description] mutableCopy]; - normalizeWebResourceURL(urlString, oldURLBase); + normalizeWebResourceURL(urlString); [responseDictionary setObject:urlString forKey:@"URL"]; [urlString release]; @@ -598,6 +726,14 @@ static void convertWebResourceResponseToDictionary(NSMutableDictionary *property [responseDictionary release]; } +static NSInteger compareResourceURLs(id resource1, id resource2, void *context) +{ + NSString *url1 = [resource1 objectForKey:@"WebResourceURL"]; + NSString *url2 = [resource2 objectForKey:@"WebResourceURL"]; + + return [url1 compare:url2]; +} + static NSString *serializeWebArchiveToXML(WebArchive *webArchive) { NSString *errorString; @@ -608,9 +744,6 @@ static NSString *serializeWebArchiveToXML(WebArchive *webArchive) if (!propertyList) return errorString; - // Normalize WebResourceResponse and WebResourceURL values in plist for testing - NSString *cwdURL = [@"file://" stringByAppendingString:[[[NSFileManager defaultManager] currentDirectoryPath] stringByExpandingTildeInPath]]; - NSMutableArray *resources = [NSMutableArray arrayWithCapacity:1]; [resources addObject:propertyList]; @@ -619,7 +752,7 @@ static NSString *serializeWebArchiveToXML(WebArchive *webArchive) [resources removeObjectAtIndex:0]; NSMutableDictionary *mainResource = [resourcePropertyList objectForKey:@"WebMainResource"]; - normalizeWebResourceURL([mainResource objectForKey:@"WebResourceURL"], cwdURL); + normalizeWebResourceURL([mainResource objectForKey:@"WebResourceURL"]); convertWebResourceDataToString(mainResource); // Add subframeArchives to list for processing @@ -631,10 +764,14 @@ static NSString *serializeWebArchiveToXML(WebArchive *webArchive) NSEnumerator *enumerator = [subresources objectEnumerator]; NSMutableDictionary *subresourcePropertyList; while ((subresourcePropertyList = [enumerator nextObject])) { - normalizeWebResourceURL([subresourcePropertyList objectForKey:@"WebResourceURL"], cwdURL); - convertWebResourceResponseToDictionary(subresourcePropertyList, cwdURL); + normalizeWebResourceURL([subresourcePropertyList objectForKey:@"WebResourceURL"]); + convertWebResourceResponseToDictionary(subresourcePropertyList); convertWebResourceDataToString(subresourcePropertyList); } + + // Sort the subresources so they're always in a predictable order for the dump + if (NSArray *sortedSubresources = [subresources sortedArrayUsingFunction:compareResourceURLs context:nil]) + [resourcePropertyList setObject:sortedSubresources forKey:@"WebSubresources"]; } NSData *xmlData = [NSPropertyListSerialization dataFromPropertyList:propertyList @@ -689,7 +826,7 @@ static void dumpBackForwardListForWebView(WebView *view) static void sizeWebViewForCurrentTest() { // W3C SVG tests expect to be 480x360 - bool isSVGW3CTest = ([currentTest rangeOfString:@"svg/W3C-SVG-1.1"].length); + bool isSVGW3CTest = (gLayoutTestController->testPathOrURL().find("svg/W3C-SVG-1.1") != string::npos); if (isSVGW3CTest) [[mainFrame webView] setFrameSize:NSMakeSize(480, 360)]; else @@ -699,11 +836,11 @@ static void sizeWebViewForCurrentTest() static const char *methodNameStringForFailedTest() { const char *errorMessage; - if (layoutTestController->dumpAsText()) + if (gLayoutTestController->dumpAsText()) errorMessage = "[documentElement innerText]"; - else if (layoutTestController->dumpDOMAsWebArchive()) + else if (gLayoutTestController->dumpDOMAsWebArchive()) errorMessage = "[[mainFrame DOMDocument] webArchive]"; - else if (layoutTestController->dumpSourceAsWebArchive()) + else if (gLayoutTestController->dumpSourceAsWebArchive()) errorMessage = "[[mainFrame dataSource] webArchive]"; else errorMessage = "[mainFrame renderTreeAsExternalRepresentation]"; @@ -735,21 +872,27 @@ void dump() { invalidateAnyPreviousWaitToDumpWatchdog(); + bool dumpAsText = gLayoutTestController->dumpAsText(); if (dumpTree) { NSString *resultString = nil; NSData *resultData = nil; + NSString *resultMimeType = @"text/plain"; - bool dumpAsText = layoutTestController->dumpAsText(); dumpAsText |= [[[mainFrame dataSource] _responseMIMEType] isEqualToString:@"text/plain"]; - layoutTestController->setDumpAsText(dumpAsText); - if (layoutTestController->dumpAsText()) { + gLayoutTestController->setDumpAsText(dumpAsText); + if (gLayoutTestController->dumpAsText()) { resultString = dumpFramesAsText(mainFrame); - } else if (layoutTestController->dumpDOMAsWebArchive()) { + } else if (gLayoutTestController->dumpAsPDF()) { + resultData = dumpFrameAsPDF(mainFrame); + resultMimeType = @"application/pdf"; + } else if (gLayoutTestController->dumpDOMAsWebArchive()) { WebArchive *webArchive = [[mainFrame DOMDocument] webArchive]; resultString = serializeWebArchiveToXML(webArchive); - } else if (layoutTestController->dumpSourceAsWebArchive()) { + resultMimeType = @"application/x-webarchive"; + } else if (gLayoutTestController->dumpSourceAsWebArchive()) { WebArchive *webArchive = [[mainFrame dataSource] webArchive]; resultString = serializeWebArchiveToXML(webArchive); + resultMimeType = @"application/x-webarchive"; } else { sizeWebViewForCurrentTest(); resultString = [mainFrame renderTreeAsExternalRepresentation]; @@ -758,25 +901,32 @@ void dump() if (resultString && !resultData) resultData = [resultString dataUsingEncoding:NSUTF8StringEncoding]; + printf("Content-Type: %s\n", [resultMimeType UTF8String]); + if (resultData) { fwrite([resultData bytes], 1, [resultData length], stdout); - if (!layoutTestController->dumpAsText() && !layoutTestController->dumpDOMAsWebArchive() && !layoutTestController->dumpSourceAsWebArchive()) + if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive()) dumpFrameScrollPosition(mainFrame); - if (layoutTestController->dumpBackForwardList()) + if (gLayoutTestController->dumpBackForwardList()) dumpBackForwardListForAllWindows(); } else printf("ERROR: nil result from %s", methodNameStringForFailedTest()); - if (printSeparators) - puts("#EOF"); + if (printSeparators) { + puts("#EOF"); // terminate the content block + fputs("#EOF\n", stderr); + } } - if (dumpPixels) - dumpWebViewAsPixelsAndCompareWithExpected([currentTest UTF8String], dumpAllPixels); + if (dumpPixels && !dumpAsText) + dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); + + puts("#EOF"); // terminate the (possibly empty) pixels block fflush(stdout); + fflush(stderr); done = YES; } @@ -786,29 +936,24 @@ static bool shouldLogFrameLoadDelegates(const char *pathOrURL) return strstr(pathOrURL, "loading/"); } -static CFURLRef createCFURLFromPathOrURL(CFStringRef pathOrURLString) -{ - CFURLRef URL; - if (CFStringHasPrefix(pathOrURLString, CFSTR("http://")) || CFStringHasPrefix(pathOrURLString, CFSTR("https://"))) - URL = CFURLCreateWithString(NULL, pathOrURLString, NULL); - else - URL = CFURLCreateWithFileSystemPath(NULL, pathOrURLString, kCFURLPOSIXPathStyle, FALSE); - return URL; -} - static void resetWebViewToConsistentStateBeforeTesting() { WebView *webView = [mainFrame webView]; [(EditingDelegate *)[webView editingDelegate] setAcceptsEditing:YES]; [webView makeTextStandardSize:nil]; - [webView setTabKeyCyclesThroughElements: YES]; + [webView resetPageZoom:nil]; + [webView setTabKeyCyclesThroughElements:YES]; [webView setPolicyDelegate:nil]; [webView _setDashboardBehavior:WebDashboardBehaviorUseBackwardCompatibilityMode to:NO]; + [webView _clearMainFrameName]; WebPreferences *preferences = [webView preferences]; [preferences setPrivateBrowsingEnabled:NO]; [preferences setAuthorAndUserStylesEnabled:YES]; [preferences setJavaScriptCanOpenWindowsAutomatically:YES]; + [preferences setOfflineWebApplicationCacheEnabled:YES]; + [preferences setFullDocumentTeardownEnabled:YES]; + [preferences setDeveloperExtrasEnabled:NO]; if (persistentUserStyleSheetLocation) { [preferences setUserStyleSheetLocation:[NSURL URLWithString:(NSString *)(persistentUserStyleSheetLocation.get())]]; @@ -816,56 +961,72 @@ static void resetWebViewToConsistentStateBeforeTesting() } else [preferences setUserStyleSheetEnabled:NO]; + [[mainFrame webView] setSmartInsertDeleteEnabled:YES]; + [[[mainFrame webView] inspector] setJavaScriptProfilingEnabled:NO]; + [WebView _setUsesTestModeFocusRingColor:YES]; } -static void runTest(const char *pathOrURL) +static void runTest(const string& testPathOrURL) { - CFStringRef pathOrURLString = CFStringCreateWithCString(NULL, pathOrURL, kCFStringEncodingUTF8); + ASSERT(!testPathOrURL.empty()); + + // Look for "'" as a separator between the path or URL, and the pixel dump hash that follows. + string pathOrURL(testPathOrURL); + string expectedPixelHash; + + size_t separatorPos = pathOrURL.find("'"); + if (separatorPos != string::npos) { + pathOrURL = string(testPathOrURL, 0, separatorPos); + expectedPixelHash = string(testPathOrURL, separatorPos + 1); + } + + NSString *pathOrURLString = [NSString stringWithUTF8String:pathOrURL.c_str()]; if (!pathOrURLString) { - fprintf(stderr, "Failed to parse filename as UTF-8: %s\n", pathOrURL); + fprintf(stderr, "Failed to parse \"%s\" as UTF-8\n", pathOrURL.c_str()); return; } - CFURLRef URL = createCFURLFromPathOrURL(pathOrURLString); - if (!URL) { - CFRelease(pathOrURLString); - fprintf(stderr, "Can't turn %s into a CFURL\n", pathOrURL); + NSURL *url; + if ([pathOrURLString hasPrefix:@"http://"] || [pathOrURLString hasPrefix:@"https://"]) + url = [NSURL URLWithString:pathOrURLString]; + else + url = [NSURL fileURLWithPath:pathOrURLString]; + if (!url) { + fprintf(stderr, "Failed to parse \"%s\" as a URL\n", pathOrURL.c_str()); return; } + const string testURL([[url absoluteString] UTF8String]); + resetWebViewToConsistentStateBeforeTesting(); - layoutTestController = new LayoutTestController(testRepaintDefault, repaintSweepHorizontallyDefault); + gLayoutTestController = new LayoutTestController(testURL, expectedPixelHash); topLoadingFrame = nil; done = NO; if (disallowedURLs) CFSetRemoveAllValues(disallowedURLs); - if (shouldLogFrameLoadDelegates(pathOrURL)) - layoutTestController->setDumpFrameLoadCallbacks(true); + if (shouldLogFrameLoadDelegates(pathOrURL.c_str())) + gLayoutTestController->setDumpFrameLoadCallbacks(true); if ([WebHistory optionalSharedHistory]) [WebHistory setOptionalSharedHistory:nil]; lastMousePosition = NSZeroPoint; lastClickPosition = NSZeroPoint; - if (currentTest != nil) - CFRelease(currentTest); - currentTest = (NSString *)pathOrURLString; [prevTestBFItem release]; prevTestBFItem = [[[[mainFrame webView] backForwardList] currentItem] retain]; WorkQueue::shared()->clear(); WorkQueue::shared()->setFrozen(false); - BOOL _shouldIgnoreWebCoreNodeLeaks = shouldIgnoreWebCoreNodeLeaks(CFURLGetString(URL)); - if (_shouldIgnoreWebCoreNodeLeaks) + bool ignoreWebCoreNodeLeaks = shouldIgnoreWebCoreNodeLeaks(testURL); + if (ignoreWebCoreNodeLeaks) [WebCoreStatistics startIgnoringWebCoreNodeLeaks]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [mainFrame loadRequest:[NSURLRequest requestWithURL:(NSURL *)URL]]; - CFRelease(URL); + [mainFrame loadRequest:[NSURLRequest requestWithURL:url]]; [pool release]; while (!done) { pool = [[NSAutoreleasePool alloc] init]; @@ -878,7 +1039,7 @@ static void runTest(const char *pathOrURL) WorkQueue::shared()->clear(); - if (layoutTestController->closeRemainingWindowsWhenComplete()) { + if (gLayoutTestController->closeRemainingWindowsWhenComplete()) { NSArray* array = [DumpRenderTreeWindow openWindows]; unsigned count = [array count]; @@ -905,10 +1066,10 @@ static void runTest(const char *pathOrURL) ASSERT(CFArrayGetCount(openWindowsRef) == 1); ASSERT(CFArrayGetValueAtIndex(openWindowsRef, 0) == [[mainFrame webView] window]); - delete layoutTestController; - layoutTestController = 0; + gLayoutTestController->deref(); + gLayoutTestController = 0; - if (_shouldIgnoreWebCoreNodeLeaks) + if (ignoreWebCoreNodeLeaks) [WebCoreStatistics stopIgnoringWebCoreNodeLeaks]; } diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h index c4c7573..03d354d 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h @@ -32,6 +32,12 @@ // FIXME: we should add a config.h file for DumpRenderTree. #define WTF_PLATFORM_CF 1 +#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 +#define BUILDING_ON_TIGER 1 +#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5 +#define BUILDING_ON_LEOPARD 1 +#endif + @class DumpRenderTreeDraggingInfo; @class NavigationController; @class PolicyDelegate; @@ -45,7 +51,7 @@ extern CFMutableSetRef disallowedURLs; extern WebFrame* mainFrame; extern WebFrame* topLoadingFrame; extern DumpRenderTreeDraggingInfo *draggingInfo; -extern NavigationController* navigationController; +extern NavigationController* gNavigationController; extern PolicyDelegate* policyDelegate; extern const unsigned maxViewHeight; diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.h b/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.h index 6a01a42..ba2754b 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.h +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.h @@ -29,9 +29,10 @@ */ #import <AppKit/AppKit.h> +#import <WebKit/WebTypesInternal.h> @interface DumpRenderTreePasteboard : NSPasteboard -- (int)declareType:(NSString *)type owner:(id)newOwner; +- (NSInteger)declareType:(NSString *)type owner:(id)newOwner; + (void)releaseLocalPasteboards; @end diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m b/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m index b5a9b7a..a797b5c 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m @@ -28,14 +28,17 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#import "DumpRenderTreeMac.h" #import "DumpRenderTreePasteboard.h" +#import <WebKit/WebTypesInternal.h> + @interface LocalPasteboard : NSPasteboard { NSMutableArray *typesArray; NSMutableSet *typesSet; NSMutableDictionary *dataByType; - int changeCount; + NSInteger changeCount; } @end @@ -68,7 +71,7 @@ static NSMutableDictionary *localPasteboards; // Convenience method for JS so that it doesn't have to try and create a NSArray on the objc side instead // of the usual WebScriptObject that is passed around -- (int)declareType:(NSString *)type owner:(id)newOwner +- (NSInteger)declareType:(NSString *)type owner:(id)newOwner { return [self declareTypes:[NSArray arrayWithObject:type] owner:newOwner]; } @@ -107,7 +110,7 @@ static NSMutableDictionary *localPasteboards; { } -- (int)declareTypes:(NSArray *)newTypes owner:(id)newOwner +- (NSInteger)declareTypes:(NSArray *)newTypes owner:(id)newOwner { [typesArray removeAllObjects]; [typesSet removeAllObjects]; @@ -115,7 +118,7 @@ static NSMutableDictionary *localPasteboards; return [self addTypes:newTypes owner:newOwner]; } -- (int)addTypes:(NSArray *)newTypes owner:(id)newOwner +- (NSInteger)addTypes:(NSArray *)newTypes owner:(id)newOwner { unsigned count = [newTypes count]; unsigned i; @@ -134,7 +137,7 @@ static NSMutableDictionary *localPasteboards; return ++changeCount; } -- (int)changeCount +- (NSInteger)changeCount { return changeCount; } diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm index 9e5e104..b3fc5a7 100644 --- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm +++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm @@ -34,6 +34,7 @@ // FIXME: This file is ObjC++ only because of this include. :( #import "LayoutTestController.h" +#import <WebKit/WebTypesInternal.h> CFMutableArrayRef openWindowsRef = 0; @@ -52,7 +53,7 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = { return [[(NSArray *)openWindowsRef copy] autorelease]; } -- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation +- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation { if (!openWindowsRef) openWindowsRef = CFArrayCreateMutable(NULL, 0, &NonRetainingArrayCallbacks); @@ -73,7 +74,7 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = { - (BOOL)isKeyWindow { - return layoutTestController ? layoutTestController->windowIsKey() : YES; + return gLayoutTestController ? gLayoutTestController->windowIsKey() : YES; } - (void)keyDown:(id)sender diff --git a/WebKitTools/DumpRenderTree/mac/EditingDelegate.mm b/WebKitTools/DumpRenderTree/mac/EditingDelegate.mm index a8f0815..cf4026b 100644 --- a/WebKitTools/DumpRenderTree/mac/EditingDelegate.mm +++ b/WebKitTools/DumpRenderTree/mac/EditingDelegate.mm @@ -73,14 +73,14 @@ - (BOOL)webView:(WebView *)webView shouldBeginEditingInDOMRange:(DOMRange *)range { - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", [[range dump] UTF8String]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldEndEditingInDOMRange:(DOMRange *)range { - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", [[range dump] UTF8String]); return acceptsEditing; } @@ -93,7 +93,7 @@ "WebViewInsertActionDropped", }; - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", [[node dumpPath] UTF8String], [[range dump] UTF8String], insertactionstring[action]); return acceptsEditing; } @@ -106,14 +106,14 @@ "WebViewInsertActionDropped", }; - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n", [[text description] UTF8String], [[range dump] UTF8String], insertactionstring[action]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldDeleteDOMRange:(DOMRange *)range { - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", [[range dump] UTF8String]); return acceptsEditing; } @@ -134,52 +134,52 @@ "TRUE" }; - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n", [[currentRange dump] UTF8String], [[proposedRange dump] UTF8String], affinitystring[selectionAffinity], boolstring[flag]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldApplyStyle:(DOMCSSStyleDeclaration *)style toElementsInDOMRange:(DOMRange *)range { - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n", [[style description] UTF8String], [[range dump] UTF8String]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldChangeTypingStyle:(DOMCSSStyleDeclaration *)currentStyle toStyle:(DOMCSSStyleDeclaration *)proposedStyle { - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldChangeTypingStyle:%s toStyle:%s\n", [[currentStyle description] UTF8String], [[proposedStyle description] UTF8String]); return acceptsEditing; } - (void)webViewDidBeginEditing:(NSNotification *)notification { - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidBeginEditing:%s\n", [[notification name] UTF8String]); } - (void)webViewDidChange:(NSNotification *)notification { - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChange:%s\n", [[notification name] UTF8String]); } - (void)webViewDidEndEditing:(NSNotification *)notification { - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidEndEditing:%s\n", [[notification name] UTF8String]); } - (void)webViewDidChangeTypingStyle:(NSNotification *)notification { - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeTypingStyle:%s\n", [[notification name] UTF8String]); } - (void)webViewDidChangeSelection:(NSNotification *)notification { - if (!done && layoutTestController->dumpEditingCallbacks()) + if (!done && gLayoutTestController->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeSelection:%s\n", [[notification name] UTF8String]); } diff --git a/WebKitTools/DumpRenderTree/mac/EventSendingController.h b/WebKitTools/DumpRenderTree/mac/EventSendingController.h index 28d0385..deee848 100644 --- a/WebKitTools/DumpRenderTree/mac/EventSendingController.h +++ b/WebKitTools/DumpRenderTree/mac/EventSendingController.h @@ -31,7 +31,7 @@ @interface EventSendingController : NSObject <DOMEventListener> { - BOOL down; + BOOL leftMouseButtonDown; BOOL dragMode; int clickCount; NSTimeInterval lastClick; diff --git a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm index 8e9be38..8be05e7 100644 --- a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm +++ b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm @@ -35,13 +35,29 @@ #import "DumpRenderTreeDraggingInfo.h" #import <Carbon/Carbon.h> // for GetCurrentEventTime() -#import <WebKit/WebKit.h> #import <WebKit/DOMPrivate.h> +#import <WebKit/WebKit.h> +#import <WebKit/WebViewPrivate.h> extern "C" void _NSNewKillRingSequence(); +enum MouseAction { + MouseDown, + MouseUp, + MouseDragged +}; + +// Match the DOM spec (sadly the DOM spec does not provide an enum) +enum MouseButton { + LeftMouseButton = 0, + MiddleMouseButton = 1, + RightMouseButton = 2, + NoMouseButton = -1 +}; + NSPoint lastMousePosition; NSPoint lastClickPosition; +int lastClickButton = NoMouseButton; NSArray *webkitDomEventNames; NSMutableArray *savedMouseEvents; // mouse events sent between mouseDown and mouseUp are stored here, and then executed at once. BOOL replayingSavedEvents; @@ -102,8 +118,8 @@ BOOL replayingSavedEvents; + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector { - if (aSelector == @selector(mouseDown) - || aSelector == @selector(mouseUp) + if (aSelector == @selector(mouseDown:) + || aSelector == @selector(mouseUp:) || aSelector == @selector(contextClick) || aSelector == @selector(mouseMoveToX:Y:) || aSelector == @selector(leapForward:) @@ -112,7 +128,9 @@ BOOL replayingSavedEvents; || aSelector == @selector(fireKeyboardEventsToElement:) || aSelector == @selector(clearKillRing) || aSelector == @selector(textZoomIn) - || aSelector == @selector(textZoomOut)) + || aSelector == @selector(textZoomOut) + || aSelector == @selector(zoomPageIn) + || aSelector == @selector(zoomPageOut)) return NO; return YES; } @@ -126,6 +144,10 @@ BOOL replayingSavedEvents; + (NSString *)webScriptNameForSelector:(SEL)aSelector { + if (aSelector == @selector(mouseDown:)) + return @"mouseDown"; + if (aSelector == @selector(mouseUp:)) + return @"mouseUp"; if (aSelector == @selector(mouseMoveToX:Y:)) return @"mouseMoveTo"; if (aSelector == @selector(leapForward:)) @@ -161,7 +183,7 @@ BOOL replayingSavedEvents; - (void)leapForward:(int)milliseconds { - if (dragMode && down && !replayingSavedEvents) { + if (dragMode && leftMouseButtonDown && !replayingSavedEvents) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[EventSendingController instanceMethodSignatureForSelector:@selector(leapForward:)]]; [invocation setTarget:self]; [invocation setSelector:@selector(leapForward:)]; @@ -180,15 +202,59 @@ BOOL replayingSavedEvents; _NSNewKillRingSequence(); } -- (void)mouseDown +static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction action) +{ + switch (button) { + case LeftMouseButton: + switch (action) { + case MouseDown: + return NSLeftMouseDown; + case MouseUp: + return NSLeftMouseUp; + case MouseDragged: + return NSLeftMouseDragged; + } + case RightMouseButton: + switch (action) { + case MouseDown: + return NSRightMouseDown; + case MouseUp: + return NSRightMouseUp; + case MouseDragged: + return NSRightMouseDragged; + } + default: + switch (action) { + case MouseDown: + return NSOtherMouseDown; + case MouseUp: + return NSOtherMouseUp; + case MouseDragged: + return NSOtherMouseDragged; + } + } + assert(0); + return static_cast<NSEventType>(0); +} + +- (void)updateClickCountForButton:(int)buttonNumber { - [[[mainFrame frameView] documentView] layout]; if (([self currentEventTime] - lastClick >= 1) || - !NSEqualPoints(lastMousePosition, lastClickPosition)) + !NSEqualPoints(lastMousePosition, lastClickPosition) || + lastClickButton != buttonNumber) { clickCount = 1; - else + lastClickButton = buttonNumber; + } else clickCount++; - NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDown +} + +- (void)mouseDown:(int)buttonNumber +{ + [[[mainFrame frameView] documentView] layout]; + [self updateClickCountForButton:buttonNumber]; + + NSEventType eventType = eventTypeForMouseButtonAndAction(buttonNumber, MouseDown); + NSEvent *event = [NSEvent mouseEventWithType:eventType location:lastMousePosition modifierFlags:0 timestamp:[self currentEventTime] @@ -201,7 +267,8 @@ BOOL replayingSavedEvents; NSView *subView = [[mainFrame webView] hitTest:[event locationInWindow]]; if (subView) { [subView mouseDown:event]; - down = YES; + if (buttonNumber == LeftMouseButton) + leftMouseButtonDown = YES; } } @@ -215,12 +282,23 @@ BOOL replayingSavedEvents; [[mainFrame webView] makeTextSmaller:self]; } -- (void)mouseUp +- (void)zoomPageIn +{ + [[mainFrame webView] zoomPageIn:self]; +} + +- (void)zoomPageOut +{ + [[mainFrame webView] zoomPageOut:self]; +} + +- (void)mouseUp:(int)buttonNumber { if (dragMode && !replayingSavedEvents) { - NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[EventSendingController instanceMethodSignatureForSelector:@selector(mouseUp)]]; + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[EventSendingController instanceMethodSignatureForSelector:@selector(mouseUp:)]]; [invocation setTarget:self]; - [invocation setSelector:@selector(mouseUp)]; + [invocation setSelector:@selector(mouseUp:)]; + [invocation setArgument:&buttonNumber atIndex:2]; [EventSendingController saveEvent:invocation]; [EventSendingController replaySavedEvents]; @@ -229,7 +307,8 @@ BOOL replayingSavedEvents; } [[[mainFrame frameView] documentView] layout]; - NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseUp + NSEventType eventType = eventTypeForMouseButtonAndAction(buttonNumber, MouseUp); + NSEvent *event = [NSEvent mouseEventWithType:eventType location:lastMousePosition modifierFlags:0 timestamp:[self currentEventTime] @@ -246,7 +325,8 @@ BOOL replayingSavedEvents; targetView = targetView ? targetView : [[mainFrame frameView] documentView]; assert(targetView); [targetView mouseUp:event]; - down = NO; + if (buttonNumber == LeftMouseButton) + leftMouseButtonDown = NO; lastClick = [event timestamp]; lastClickPosition = lastMousePosition; if (draggingInfo) { @@ -266,7 +346,7 @@ BOOL replayingSavedEvents; - (void)mouseMoveToX:(int)x Y:(int)y { - if (dragMode && down && !replayingSavedEvents) { + if (dragMode && leftMouseButtonDown && !replayingSavedEvents) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[EventSendingController instanceMethodSignatureForSelector:@selector(mouseMoveToX:Y:)]]; [invocation setTarget:self]; [invocation setSelector:@selector(mouseMoveToX:Y:)]; @@ -280,19 +360,19 @@ BOOL replayingSavedEvents; NSView *view = [mainFrame webView]; lastMousePosition = [view convertPoint:NSMakePoint(x, [view frame].size.height - y) toView:nil]; - NSEvent *event = [NSEvent mouseEventWithType:(down ? NSLeftMouseDragged : NSMouseMoved) + NSEvent *event = [NSEvent mouseEventWithType:(leftMouseButtonDown ? NSLeftMouseDragged : NSMouseMoved) location:lastMousePosition modifierFlags:0 timestamp:[self currentEventTime] windowNumber:[[view window] windowNumber] context:[NSGraphicsContext currentContext] eventNumber:++eventNumber - clickCount:(down ? clickCount : 0) + clickCount:(leftMouseButtonDown ? clickCount : 0) pressure:0.0]; NSView *subView = [[mainFrame webView] hitTest:[event locationInWindow]]; if (subView) { - if (down) { + if (leftMouseButtonDown) { [subView mouseDragged:event]; if (draggingInfo) { [[draggingInfo draggingSource] draggedImage:[draggingInfo draggedImage] movedTo:lastMousePosition]; @@ -306,11 +386,9 @@ BOOL replayingSavedEvents; - (void)contextClick { [[[mainFrame frameView] documentView] layout]; - if ([self currentEventTime] - lastClick >= 1) - clickCount = 1; - else - clickCount++; - NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown + [self updateClickCountForButton:RightMouseButton]; + + NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown location:lastMousePosition modifierFlags:0 timestamp:[self currentEventTime] diff --git a/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.h b/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.h index 3b86fdf..6c3cbdb 100644 --- a/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.h +++ b/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.h @@ -28,10 +28,12 @@ #import <Foundation/Foundation.h> +class AccessibilityController; class GCController; @interface FrameLoadDelegate : NSObject { + AccessibilityController* accessibilityController; GCController* gcController; } @end diff --git a/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm b/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm index 98b6bac..3d7f8b4 100644 --- a/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm +++ b/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm @@ -29,6 +29,7 @@ #import "DumpRenderTree.h" #import "FrameLoadDelegate.h" +#import "AccessibilityController.h" #import "AppleScriptController.h" #import "EventSendingController.h" #import "GCController.h" @@ -94,8 +95,10 @@ - (id)init { - if ((self = [super init])) + if ((self = [super init])) { gcController = new GCController; + accessibilityController = new AccessibilityController; + } return self; } @@ -117,7 +120,7 @@ } // if we didn't start a new load, then we finished all the commands, so we're ready to dump state - if (!topLoadingFrame && !layoutTestController->waitToDump()) + if (!topLoadingFrame && !gLayoutTestController->waitToDump()) dump(); } @@ -126,7 +129,7 @@ if ([dataSource webFrame] == topLoadingFrame) { topLoadingFrame = nil; WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue for the rest of this test - if (!layoutTestController->waitToDump()) { + if (!gLayoutTestController->waitToDump()) { if (WorkQueue::shared()->count()) [self performSelector:@selector(processWork:) withObject:nil afterDelay:0]; else @@ -137,7 +140,7 @@ - (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didStartProvisionalLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -147,11 +150,17 @@ // end up doing two dumps for one test. if (!topLoadingFrame && !done) topLoadingFrame = frame; + + if (!done && gLayoutTestController->stopProvisionalFrameLoads()) { + NSString *string = [NSString stringWithFormat:@"%@ - stopping load in didStartProvisionalLoadForFrame callback", [frame _drt_descriptionSuitableForTestResult]]; + printf ("%s\n", [string UTF8String]); + [frame stopLoading]; + } } - (void)webView:(WebView *)sender didCommitLoadForFrame:(WebFrame *)frame { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didCommitLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -159,7 +168,7 @@ ASSERT(![frame provisionalDataSource]); ASSERT([frame dataSource]); - layoutTestController->setWindowIsKey(true); + gLayoutTestController->setWindowIsKey(true); NSView *documentView = [[mainFrame frameView] documentView]; [[[mainFrame webView] window] makeFirstResponder:documentView]; if ([documentView isKindOfClass:[WebHTMLView class]]) @@ -168,7 +177,7 @@ - (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFailProvisionalLoadWithError", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -189,7 +198,7 @@ ASSERT([frame dataSource]); ASSERT(frame == [[frame dataSource] webFrame]); - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFinishLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -200,12 +209,12 @@ if ([[sender mainFrame] isEqual:frame]) [sender displayIfNeeded]; [self webView:sender locationChangeDone:nil forDataSource:[frame dataSource]]; - [navigationController webView:sender didFinishLoadForFrame:frame]; + [gNavigationController webView:sender didFinishLoadForFrame:frame]; } - (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame; { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFailLoadWithError", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -218,7 +227,7 @@ - (void)webView:(WebView *)webView windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject; { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"?? - windowScriptObjectAvailable"]; printf ("%s\n", [string UTF8String]); } @@ -236,13 +245,16 @@ JSObjectRef globalObject = JSContextGetGlobalObject(context); JSValueRef exception = 0; - ASSERT(layoutTestController); - layoutTestController->makeWindowObject(context, globalObject, &exception); + ASSERT(gLayoutTestController); + gLayoutTestController->makeWindowObject(context, globalObject, &exception); ASSERT(!exception); gcController->makeWindowObject(context, globalObject, &exception); ASSERT(!exception); + accessibilityController->makeWindowObject(context, globalObject, &exception); + ASSERT(!exception); + // Make Old-Style controllers EventSendingController *esc = [[EventSendingController alloc] init]; [obj setValue:esc forKey:@"eventSender"]; @@ -260,7 +272,7 @@ [obj setValue:occ forKey:@"objCController"]; [occ release]; - [obj setValue:navigationController forKey:@"navigationController"]; + [obj setValue:gNavigationController forKey:@"navigationController"]; ObjCPlugin *plugin = [[ObjCPlugin alloc] init]; [obj setValue:plugin forKey:@"objCPlugin"]; @@ -273,18 +285,18 @@ - (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didReceiveTitle: %@", [frame _drt_descriptionSuitableForTestResult], title]; printf ("%s\n", [string UTF8String]); } - if (layoutTestController->dumpTitleChanges()) + if (gLayoutTestController->dumpTitleChanges()) printf("TITLE CHANGED: %s\n", [title UTF8String]); } - (void)webView:(WebView *)sender didReceiveServerRedirectForProvisionalLoadForFrame:(WebFrame *)frame { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didReceiveServerRedirectForProvisionalLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -292,7 +304,7 @@ - (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didChangeLocationWithinPageForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -300,7 +312,7 @@ - (void)webView:(WebView *)sender willPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forFrame:(WebFrame *)frame { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - willPerformClientRedirectToURL: %@ ", [frame _drt_descriptionSuitableForTestResult], [URL _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -308,7 +320,7 @@ - (void)webView:(WebView *)sender didCancelClientRedirectForFrame:(WebFrame *)frame { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didCancelClientRedirectForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -316,15 +328,21 @@ - (void)webView:(WebView *)sender didFinishDocumentLoadForFrame:(WebFrame *)frame; { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFinishDocumentLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); + } else if (!done) { + unsigned pendingFrameUnloadEvents = [frame _pendingFrameUnloadEventCount]; + if (pendingFrameUnloadEvents) { + NSString *string = [NSString stringWithFormat:@"%@ - has %u onunload handler(s)", [frame _drt_descriptionSuitableForTestResult], pendingFrameUnloadEvents]; + printf ("%s\n", [string UTF8String]); + } } } - (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame; { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didHandleOnloadEventsForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm index b321319..2200c27 100644 --- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm +++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm @@ -36,13 +36,19 @@ #import <JavaScriptCore/JSRetainPtr.h> #import <JavaScriptCore/JSStringRef.h> #import <JavaScriptCore/JSStringRefCF.h> +#import <WebKit/DOMDocument.h> #import <WebKit/WebBackForwardList.h> +#import <WebKit/WebDatabaseManagerPrivate.h> +#import <WebKit/WebDataSource.h> #import <WebKit/WebFrame.h> +#import <WebKit/WebHTMLRepresentation.h> #import <WebKit/WebHTMLViewPrivate.h> #import <WebKit/WebHistory.h> +#import <WebKit/WebInspector.h> #import <WebKit/WebNSURLExtras.h> #import <WebKit/WebPreferences.h> #import <WebKit/WebPreferencesPrivate.h> +#import <WebKit/WebSecurityOriginPrivate.h> #import <WebKit/WebView.h> #import <WebKit/WebViewPrivate.h> #import <wtf/RetainPtr.h> @@ -65,6 +71,11 @@ void LayoutTestController::addDisallowedURL(JSStringRef url) CFSetAddValue(disallowedURLs, [request URL]); } +void LayoutTestController::clearAllDatabases() +{ + [[WebDatabaseManager sharedWebDatabaseManager] deleteAllDatabases]; +} + void LayoutTestController::clearBackForwardList() { WebBackForwardList *backForwardList = [[mainFrame webView] backForwardList]; @@ -170,6 +181,13 @@ void LayoutTestController::setCustomPolicyDelegate(bool setDelegate) [[mainFrame webView] setPolicyDelegate:nil]; } +void LayoutTestController::setDatabaseQuota(unsigned long long quota) +{ + WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"file:///"]]; + [origin setQuota:quota]; + [origin release]; +} + void LayoutTestController::setMainFrameIsFirstResponder(bool flag) { NSView *documentView = [[mainFrame frameView] documentView]; @@ -232,13 +250,24 @@ void LayoutTestController::setWindowIsKey(bool windowIsKey) [(WebHTMLView *)documentView _updateFocusedAndActiveState]; } +void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +{ + [[mainFrame webView] setSmartInsertDeleteEnabled:flag]; +} + +void LayoutTestController::setJavaScriptProfilingEnabled(bool profilingEnabled) +{ + [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:profilingEnabled]; + [[[mainFrame webView] inspector] setJavaScriptProfilingEnabled:profilingEnabled]; +} + static const CFTimeInterval waitToDumpWatchdogInterval = 10.0; static void waitUntilDoneWatchdogFired(CFRunLoopTimerRef timer, void* info) { const char* message = "FAIL: Timed out waiting for notifyDone to be called\n"; - fprintf(stderr, message); - fprintf(stdout, message); + fprintf(stderr, "%s", message); + fprintf(stdout, "%s", message); dump(); } @@ -256,6 +285,20 @@ int LayoutTestController::windowCount() return CFArrayGetCount(openWindowsRef); } +bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +{ + RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, id)); + NSString *idNS = (NSString *)idCF.get(); + + DOMElement *element = [[mainFrame DOMDocument] getElementById:idNS]; + id rep = [[mainFrame dataSource] representation]; + + if ([rep class] == [WebHTMLRepresentation class]) + return [(WebHTMLRepresentation *)rep elementDoesAutoComplete:element]; + + return false; +} + void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) { RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); diff --git a/WebKitTools/DumpRenderTree/mac/ObjCController.m b/WebKitTools/DumpRenderTree/mac/ObjCController.m index 1b9abb7..ec1ed38 100644 --- a/WebKitTools/DumpRenderTree/mac/ObjCController.m +++ b/WebKitTools/DumpRenderTree/mac/ObjCController.m @@ -28,11 +28,28 @@ #import "ObjCController.h" +#import <JavaScriptCore/JavaScriptCore.h> #import <WebKit/DOMAbstractView.h> #import <WebKit/WebScriptObject.h> #import <WebKit/WebView.h> +#import <pthread.h> #import <wtf/Assertions.h> +static void* runJavaScriptThread(void* arg) +{ + JSGlobalContextRef ctx = JSGlobalContextCreate(0); + JSStringRef scriptRef = JSStringCreateWithUTF8CString("'Hello World!'"); + + JSValueRef exception = 0; + JSEvaluateScript(ctx, scriptRef, 0, 0, 1, &exception); + ASSERT(!exception); + + JSGlobalContextRelease(ctx); + JSStringRelease(scriptRef); + + return 0; +} + @implementation ObjCController + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector @@ -46,6 +63,8 @@ || aSelector == @selector(testWrapperRoundTripping:) || aSelector == @selector(accessStoredWebScriptObject) || aSelector == @selector(storeWebScriptObject:) + || aSelector == @selector(testValueForKey) + || aSelector == @selector(testArray) ) return NO; return YES; @@ -67,6 +86,10 @@ return @"testWrapperRoundTripping"; if (aSelector == @selector(storeWebScriptObject:)) return @"storeWebScriptObject"; + if (aSelector == @selector(testValueForKey)) + return @"testValueForKey"; + if (aSelector == @selector(testArray)) + return @"testArray"; return nil; } @@ -115,6 +138,20 @@ return num; } +- (void)testValueForKey +{ + ASSERT(storedWebScriptObject); + + @try { + [storedWebScriptObject valueForKey:@"ThisKeyDoesNotExist"]; + } @catch (NSException *e) { + } + + pthread_t pthread; + pthread_create(&pthread, 0, &runJavaScriptThread, 0); + pthread_join(pthread, 0); +} + - (BOOL)testWrapperRoundTripping:(WebScriptObject *)webScriptObject { JSObjectRef jsObject = [webScriptObject JSObject]; @@ -182,6 +219,11 @@ storedWebScriptObject = [webScriptObject retain]; } +- (NSArray *)testArray +{ + return [NSArray array]; +} + - (void)dealloc { [storedWebScriptObject release]; diff --git a/WebKitTools/DumpRenderTree/mac/ObjCPlugin.m b/WebKitTools/DumpRenderTree/mac/ObjCPlugin.m index 18b174c..3ec3e74 100644 --- a/WebKitTools/DumpRenderTree/mac/ObjCPlugin.m +++ b/WebKitTools/DumpRenderTree/mac/ObjCPlugin.m @@ -110,7 +110,7 @@ static BOOL _allowsScriptsFullAccess = NO; - (void)log:(NSString *)message { - NSLog(message); + NSLog(@"%@", message); } - (id)retainObject:(id)obj diff --git a/WebKitTools/DumpRenderTree/mac/PixelDumpSupportMac.mm b/WebKitTools/DumpRenderTree/mac/PixelDumpSupportMac.mm index 5a19164..f4191e5 100644 --- a/WebKitTools/DumpRenderTree/mac/PixelDumpSupportMac.mm +++ b/WebKitTools/DumpRenderTree/mac/PixelDumpSupportMac.mm @@ -34,129 +34,208 @@ #include "LayoutTestController.h" #include <CoreGraphics/CGBitmapContext.h> +#ifndef BUILDING_ON_LEOPARD +#include <OpenGL/OpenGL.h> +#include <OpenGL/CGLMacro.h> +#endif #include <wtf/Assertions.h> -#include <wtf/RetainPtr.h> +#include <wtf/RefPtr.h> #import <WebKit/WebDocumentPrivate.h> #import <WebKit/WebKit.h> -static unsigned char* screenCaptureBuffer; +// To ensure pixel tests consistency, we need to always render in the same colorspace. +// Unfortunately, because of AppKit / WebKit constraints, we can't render directly in the colorspace of our choice. +// This implies we have to temporarily change the profile of the main display to the colorspace we want to render into. +// We also need to make sure the CGBitmapContext we return is in that same colorspace. -static CMProfileRef currentColorProfile = 0; -static CGColorSpaceRef sharedColorSpace; +#define PROFILE_PATH "/System/Library/ColorSync/Profiles/Generic RGB Profile.icc" // FIXME: This cannot be more than CS_MAX_PATH (256 characters) -void restoreColorSpace(int ignored) +static CMProfileLocation sInitialProfileLocation; // The locType field is initialized to 0 which is the same as cmNoProfileBase + +void restoreMainDisplayColorProfile(int ignored) { // This is used as a signal handler, and thus the calls into ColorSync are unsafe // But we might as well try to restore the user's color profile, we're going down anyway... - if (currentColorProfile) { - // This call is deprecated in Leopard, but there appears to be no replacement. - int error = CMSetDefaultProfileByUse(cmDisplayUse, currentColorProfile); + if (sInitialProfileLocation.locType != cmNoProfileBase) { + const CMDeviceScope scope = { kCFPreferencesCurrentUser, kCFPreferencesCurrentHost }; + int error = CMSetDeviceProfile(cmDisplayDeviceClass, (CMDeviceID)kCGDirectMainDisplay, &scope, cmDefaultProfileID, &sInitialProfileLocation); if (error) - fprintf(stderr, "Failed to retore previous color profile! You may need to open System Preferences : Displays : Color and manually restore your color settings. (Error: %i)", error); - currentColorProfile = 0; + fprintf(stderr, "Failed to restore initial color profile for main display! Open System Preferences > Displays > Color and manually re-select the profile. (Error: %i)", error); + sInitialProfileLocation.locType = cmNoProfileBase; } } -static void setDefaultColorProfileToRGB() +void setupMainDisplayColorProfile() { - CMProfileRef genericProfile = (CMProfileRef)[[NSColorSpace genericRGBColorSpace] colorSyncProfile]; - CMProfileRef previousProfile; - int error = CMGetDefaultProfileByUse(cmDisplayUse, &previousProfile); + const CMDeviceScope scope = { kCFPreferencesCurrentUser, kCFPreferencesCurrentHost }; + int error; + + CMProfileRef profile = 0; + error = CMGetProfileByAVID((CMDisplayIDType)kCGDirectMainDisplay, &profile); + if (!error) { + UInt32 size = sizeof(CMProfileLocation); + error = NCMGetProfileLocation(profile, &sInitialProfileLocation, &size); + CMCloseProfile(profile); + } if (error) { - fprintf(stderr, "Failed to get current color profile. I will not be able to restore your current profile, thus I'm not changing it. Many pixel tests may fail as a result. (Error: %i)\n", error); + fprintf(stderr, "Failed to retrieve current color profile for main display, thus it won't be changed. Many pixel tests may fail as a result. (Error: %i)", error); + sInitialProfileLocation.locType = cmNoProfileBase; return; } - if (previousProfile == genericProfile) - return; - CFStringRef previousProfileName; - CFStringRef genericProfileName; - char previousProfileNameString[1024]; - char genericProfileNameString[1024]; - CMCopyProfileDescriptionString(previousProfile, &previousProfileName); - CMCopyProfileDescriptionString(genericProfile, &genericProfileName); - CFStringGetCString(previousProfileName, previousProfileNameString, sizeof(previousProfileNameString), kCFStringEncodingUTF8); - CFStringGetCString(genericProfileName, genericProfileNameString, sizeof(previousProfileNameString), kCFStringEncodingUTF8); - CFRelease(previousProfileName); - CFRelease(genericProfileName); - - fprintf(stderr, "\n\nWARNING: Temporarily changing your system color profile from \"%s\" to \"%s\".\n", previousProfileNameString, genericProfileNameString); - fprintf(stderr, "This allows the WebKit pixel-based regression tests to have consistent color values across all machines.\n"); - fprintf(stderr, "The colors on your screen will change for the duration of the testing.\n\n"); - if ((error = CMSetDefaultProfileByUse(cmDisplayUse, genericProfile))) { - fprintf(stderr, "Failed to set color profile to \"%s\"! Many pixel tests will fail as a result. (Error: %i)", - genericProfileNameString, error); - } else { - currentColorProfile = previousProfile; - signal(SIGINT, restoreColorSpace); - signal(SIGHUP, restoreColorSpace); - signal(SIGTERM, restoreColorSpace); + CMProfileLocation location; + location.locType = cmPathBasedProfile; + strcpy(location.u.pathLoc.path, PROFILE_PATH); + error = CMSetDeviceProfile(cmDisplayDeviceClass, (CMDeviceID)kCGDirectMainDisplay, &scope, cmDefaultProfileID, &location); + if (error) { + fprintf(stderr, "Failed to set color profile for main display! Many pixel tests may fail as a result. (Error: %i)", error); + sInitialProfileLocation.locType = cmNoProfileBase; + return; } + + // Other signals are handled in installSignalHandlers() which also calls restoreMainDisplayColorProfile() + signal(SIGINT, restoreMainDisplayColorProfile); + signal(SIGHUP, restoreMainDisplayColorProfile); + signal(SIGTERM, restoreMainDisplayColorProfile); + + fprintf(stderr, "\n\nWARNING: Temporarily changing the main display color profile to \"%s\": the colors on your screen will change for the duration of the testing.\n", PROFILE_PATH); + fprintf(stderr, "This allows the WebKit pixel-based regression tests to have consistent color values across all machines.\n"); } -void initializeColorSpaceAndScreeBufferForPixelTests() -{ - setDefaultColorProfileToRGB(); - screenCaptureBuffer = (unsigned char *)malloc(maxViewHeight * maxViewWidth * 4); - sharedColorSpace = CGColorSpaceCreateDeviceRGB(); -} - -// Declared in PixelDumpSupportCG.h - -RetainPtr<CGContextRef> getBitmapContextFromWebView() -{ - NSSize webViewSize = [[mainFrame webView] frame].size; - return RetainPtr<CGContextRef>(AdoptCF, CGBitmapContextCreate(screenCaptureBuffer, static_cast<size_t>(webViewSize.width), static_cast<size_t>(webViewSize.height), 8, static_cast<size_t>(webViewSize.width) * 4, sharedColorSpace, kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedLast)); -} - -void paintWebView(CGContextRef context) +PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool incrementalRepaint, bool sweepHorizontally, bool drawSelectionRect) { - RetainPtr<NSGraphicsContext> savedContext = [NSGraphicsContext currentContext]; - - NSGraphicsContext* nsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:NO]; - [NSGraphicsContext setCurrentContext:nsContext]; - WebView* view = [mainFrame webView]; - [view displayIfNeeded]; - [view lockFocus]; - NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:[view frame]]; - [view unlockFocus]; - [imageRep draw]; - [imageRep release]; - - [NSGraphicsContext setCurrentContext:savedContext.get()]; -} - -void repaintWebView(CGContextRef context, bool horizontal) -{ - RetainPtr<NSGraphicsContext> savedContext = [NSGraphicsContext currentContext]; - - NSGraphicsContext* nsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:NO]; - [NSGraphicsContext setCurrentContext:nsContext]; - - WebView *view = [mainFrame webView]; NSSize webViewSize = [view frame].size; + size_t pixelsWide = static_cast<size_t>(webViewSize.width); + size_t pixelsHigh = static_cast<size_t>(webViewSize.height); + size_t rowBytes = (4 * pixelsWide + 63) & ~63; // Use a multiple of 64 bytes to improve CG performance - if (horizontal) { - for (NSRect column = NSMakeRect(0, 0, 1, webViewSize.height); column.origin.x < webViewSize.width; column.origin.x++) - [view displayRectIgnoringOpacity:column inContext:nsContext]; - } else { - for (NSRect line = NSMakeRect(0, 0, webViewSize.width, 1); line.origin.y < webViewSize.height; line.origin.y++) - [view displayRectIgnoringOpacity:line inContext:nsContext]; + void *buffer = calloc(pixelsHigh, rowBytes); + if (!buffer) + return 0; + + static CGColorSpaceRef colorSpace = 0; + if (!colorSpace) { + CMProfileLocation location; + location.locType = cmPathBasedProfile; + strcpy(location.u.pathLoc.path, PROFILE_PATH); + CMProfileRef profile; + if (CMOpenProfile(&profile, &location) == noErr) { + colorSpace = CGColorSpaceCreateWithPlatformColorSpace(profile); + CMCloseProfile(profile); + } + } + + CGContextRef context = CGBitmapContextCreate(buffer, pixelsWide, pixelsHigh, 8, rowBytes, colorSpace, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); // Use ARGB8 on PPC or BGRA8 on X86 to improve CG performance + if (!context) { + free(buffer); + return 0; } - [NSGraphicsContext setCurrentContext:savedContext.get()]; -} + // The BitmapContext keeps the CGContextRef and the pixel buffer alive + RefPtr<BitmapContext> bitmapContext = BitmapContext::createByAdoptingBitmapAndContext(buffer, context); + + NSGraphicsContext *nsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:NO]; + ASSERT(nsContext); + + if (incrementalRepaint) { + if (sweepHorizontally) { + for (NSRect column = NSMakeRect(0, 0, 1, webViewSize.height); column.origin.x < webViewSize.width; column.origin.x++) + [view displayRectIgnoringOpacity:column inContext:nsContext]; + } else { + for (NSRect line = NSMakeRect(0, 0, webViewSize.width, 1); line.origin.y < webViewSize.height; line.origin.y++) + [view displayRectIgnoringOpacity:line inContext:nsContext]; + } + } else { + if (onscreen) { +#ifdef BUILDING_ON_LEOPARD + // Ask the window server to provide us a composited version of the *real* window content including surfaces (i.e. OpenGL content) + // Note that the returned image might differ very slightly from the window backing because of dithering artifacts in the window server compositor + + CGImageRef image = CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, [[view window] windowNumber], kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque); + CGContextDrawImage(context, CGRectMake(0, 0, CGImageGetWidth(image), CGImageGetHeight(image)), image); + CGImageRelease(image); +#else + // On 10.4 and earlier, we have to move the window temporarily "onscreen" and read directly from the display framebuffer using OpenGL + // In this code path, we need to ensure the window is above any other window or captured result will be corrupted + + NSWindow *window = [view window]; + int oldLevel = [window level]; + NSRect oldFrame = [window frame]; + + NSRect newFrame = [[[NSScreen screens] objectAtIndex:0] frame]; + newFrame = NSMakeRect(newFrame.origin.x + (newFrame.size.width - oldFrame.size.width) / 2, newFrame.origin.y + (newFrame.size.height - oldFrame.size.height) / 2, oldFrame.size.width, oldFrame.size.height); + [window setLevel:NSScreenSaverWindowLevel]; + [window setFrame:newFrame display:NO animate:NO]; + + CGRect rect = CGRectMake(newFrame.origin.x, newFrame.origin.y, webViewSize.width, webViewSize.height); + CGDirectDisplayID displayID; + CGDisplayCount count; + if (CGGetDisplaysWithRect(rect, 1, &displayID, &count) == kCGErrorSuccess) { + CGRect bounds = CGDisplayBounds(displayID); + rect.origin.x -= bounds.origin.x; + rect.origin.y -= bounds.origin.y; + + CGLPixelFormatAttribute attributes[] = {kCGLPFAAccelerated, kCGLPFANoRecovery, kCGLPFAFullScreen, kCGLPFADisplayMask, (CGLPixelFormatAttribute)CGDisplayIDToOpenGLDisplayMask(displayID), (CGLPixelFormatAttribute)0}; + CGLPixelFormatObj pixelFormat; + GLint num; + if (CGLChoosePixelFormat(attributes, &pixelFormat, &num) == kCGLNoError) { + CGLContextObj cgl_ctx; + if (CGLCreateContext(pixelFormat, 0, &cgl_ctx) == kCGLNoError) { + if (CGLSetFullScreen(cgl_ctx) == kCGLNoError) { + void *flipBuffer = calloc(pixelsHigh, rowBytes); + if (flipBuffer) { + glPixelStorei(GL_PACK_ROW_LENGTH, rowBytes / 4); + glPixelStorei(GL_PACK_ALIGNMENT, 4); +#if __BIG_ENDIAN__ + glReadPixels(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, flipBuffer); +#else + glReadPixels(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, flipBuffer); +#endif + if (!glGetError()) { + for(size_t i = 0; i < pixelsHigh; ++i) + bcopy((char*)flipBuffer + rowBytes * i, (char*)buffer + rowBytes * (pixelsHigh - i - 1), pixelsWide * 4); + } + + free(flipBuffer); + } + } + CGLDestroyContext(cgl_ctx); + } + CGLDestroyPixelFormat(pixelFormat); + } + } + + [window setFrame:oldFrame display:NO animate:NO]; + [window setLevel:oldLevel]; +#endif + } else { + // Grab directly the contents of the window backing buffer (this ignores any surfaces on the window) + // FIXME: This path is suboptimal: data is read from window backing store, converted to RGB8 then drawn again into an RGBA8 bitmap + + [view displayIfNeeded]; + [view lockFocus]; + NSBitmapImageRep *imageRep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:[view frame]] autorelease]; + [view unlockFocus]; + + RetainPtr<NSGraphicsContext> savedContext = [NSGraphicsContext currentContext]; + [NSGraphicsContext setCurrentContext:nsContext]; + [imageRep draw]; + [NSGraphicsContext setCurrentContext:savedContext.get()]; + } + } -CGRect getSelectionRect() -{ - NSView *documentView = [[mainFrame frameView] documentView]; - if ([documentView conformsToProtocol:@protocol(WebDocumentSelection)]) { + if (drawSelectionRect) { + NSView *documentView = [[mainFrame frameView] documentView]; + ASSERT([documentView conformsToProtocol:@protocol(WebDocumentSelection)]); NSRect rect = [documentView convertRect:[(id <WebDocumentSelection>)documentView selectionRect] fromView:nil]; - return CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); + CGContextSaveGState(context); + CGContextSetLineWidth(context, 1.0); + CGContextSetRGBStrokeColor(context, 1.0, 0.0, 0.0, 1.0); + CGContextStrokeRect(context, CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)); + CGContextRestoreGState(context); } - - ASSERT_NOT_REACHED(); - return CGRectZero; + + return bitmapContext.release(); } diff --git a/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm b/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm index cc0eb4a..5d2e2b4 100644 --- a/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm +++ b/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm @@ -31,6 +31,7 @@ #import "DumpRenderTree.h" #import "LayoutTestController.h" #import <WebKit/WebKit.h> +#import <WebKit/WebTypesInternal.h> #import <wtf/Assertions.h> @interface NSURL (DRTExtras) @@ -54,12 +55,12 @@ { NSString *str = [NSString stringWithFormat:@"<NSError domain %@, code %d", [self domain], [self code]]; NSURL *failingURL; - + if ((failingURL = [[self userInfo] objectForKey:@"NSErrorFailingURLKey"])) str = [str stringByAppendingFormat:@", failing URL \"%@\"", [failingURL _drt_descriptionSuitableForTestResult]]; - + str = [str stringByAppendingFormat:@">"]; - + return str; } @@ -75,9 +76,9 @@ WebDataSource *dataSource = [mainFrame dataSource]; if (!dataSource) dataSource = [mainFrame provisionalDataSource]; - + NSString *basePath = [[[[dataSource request] URL] path] stringByDeletingLastPathComponent]; - + return [[self path] substringFromIndex:[basePath length] + 1]; } @@ -106,24 +107,35 @@ - webView: (WebView *)wv identifierForInitialRequest: (NSURLRequest *)request fromDataSource: (WebDataSource *)dataSource { ASSERT([[dataSource webFrame] dataSource] || [[dataSource webFrame] provisionalDataSource]); - - if (!done && layoutTestController->dumpResourceLoadCallbacks()) + + if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) return [[request URL] _drt_descriptionSuitableForTestResult]; - + return @"<unknown>"; } -(NSURLRequest *)webView: (WebView *)wv resource:identifier willSendRequest: (NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource { - if (!done && layoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - willSendRequest %@ redirectResponse %@", identifier, [newRequest _drt_descriptionSuitableForTestResult], [redirectResponse _drt_descriptionSuitableForTestResult]]; - printf ("%s\n", [string UTF8String]); - } - - if (disallowedURLs && CFSetContainsValue(disallowedURLs, [newRequest URL])) + printf("%s\n", [string UTF8String]); + } + + NSURL *url = [newRequest URL]; + NSString *host = [url host]; + if (host + && (NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"http"] || NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"https"]) + && NSOrderedSame != [host compare:@"127.0.0.1"] + && NSOrderedSame != [host compare:@"255.255.255.255"] // used in some tests that expect to get back an error + && NSOrderedSame != [host caseInsensitiveCompare:@"localhost"]) { + printf("Blocked access to external URL %s\n", [[url absoluteString] cStringUsingEncoding:NSUTF8StringEncoding]); return nil; - + } + + if (disallowedURLs && CFSetContainsValue(disallowedURLs, url)) + return nil; + return newRequest; } @@ -137,41 +149,44 @@ -(void)webView: (WebView *)wv resource:identifier didReceiveResponse: (NSURLResponse *)response fromDataSource:(WebDataSource *)dataSource { - if (!done && layoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didReceiveResponse %@", identifier, [response _drt_descriptionSuitableForTestResult]]; - printf ("%s\n", [string UTF8String]); - } + printf("%s\n", [string UTF8String]); + } } --(void)webView: (WebView *)wv resource:identifier didReceiveContentLength: (unsigned)length fromDataSource:(WebDataSource *)dataSource +-(void)webView: (WebView *)wv resource:identifier didReceiveContentLength: (NSInteger)length fromDataSource:(WebDataSource *)dataSource { } -(void)webView: (WebView *)wv resource:identifier didFinishLoadingFromDataSource:(WebDataSource *)dataSource { - if (!done && layoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFinishLoading", identifier]; - printf ("%s\n", [string UTF8String]); + printf("%s\n", [string UTF8String]); } } -(void)webView: (WebView *)wv resource:identifier didFailLoadingWithError:(NSError *)error fromDataSource:(WebDataSource *)dataSource { - if (!done && layoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFailLoadingWithError: %@", identifier, [error _drt_descriptionSuitableForTestResult]]; - printf ("%s\n", [string UTF8String]); + printf("%s\n", [string UTF8String]); } } - (void)webView: (WebView *)wv plugInFailedWithError:(NSError *)error dataSource:(WebDataSource *)dataSource { + // The call to -display here simulates the "Plug-in not found" sheet that Safari shows. + // It is used for platform/mac/plugins/update-widget-from-style-recalc.html + [wv display]; } -(NSCachedURLResponse *) webView: (WebView *)wv resource:(id)identifier willCacheResponse:(NSCachedURLResponse *)response fromDataSource:(WebDataSource *)dataSource { - if (!done && layoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - willCacheResponse: called", identifier]; - printf ("%s\n", [string UTF8String]); + printf("%s\n", [string UTF8String]); } return response; } diff --git a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm index 29f3ddd..0c5a93c 100644 --- a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm +++ b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm @@ -84,10 +84,18 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; return defaultText; } +- (BOOL)webView:(WebView *)c runBeforeUnloadConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame +{ + if (!done) + printf("CONFIRM NAVIGATION: %s\n", [message UTF8String]); + return YES; +} + + - (void)webView:(WebView *)sender dragImage:(NSImage *)anImage at:(NSPoint)viewLocation offset:(NSSize)initialOffset event:(NSEvent *)event pasteboard:(NSPasteboard *)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag forView:(NSView *)view { assert(!draggingInfo); - if (layoutTestController->addFileToPasteboardOnDrag()) { + if (gLayoutTestController->addFileToPasteboardOnDrag()) { [pboard declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil]; [pboard setPropertyList:[NSArray arrayWithObject:@"DRTFakeFile"] forType:NSFilenamesPboardType]; } @@ -97,19 +105,21 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webViewFocus:(WebView *)webView { - layoutTestController->setWindowIsKey(true); - NSView *documentView = [[mainFrame frameView] documentView]; - if ([documentView isKindOfClass:[WebHTMLView class]]) - [(WebHTMLView *)documentView _updateFocusedAndActiveState]; + gLayoutTestController->setWindowIsKey(true); +} + +- (void)webViewUnfocus:(WebView *)webView +{ + gLayoutTestController->setWindowIsKey(false); } - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request { - if (!layoutTestController->canOpenWindows()) + if (!gLayoutTestController->canOpenWindows()) return nil; // Make sure that waitUntilDone has been called. - ASSERT(layoutTestController->waitToDump()); + ASSERT(gLayoutTestController->waitToDump()); WebView *webView = createWebViewAndOffscreenWindow(); @@ -120,7 +130,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; { NSWindow* window = [sender window]; - if (layoutTestController->callCloseOnWebViews()) + if (gLayoutTestController->callCloseOnWebViews()) [sender close]; [window close]; @@ -128,10 +138,19 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier { - static const unsigned long long defaultQuota = 5 * 1024 * 1024; + if (!done && gLayoutTestController->dumpDatabaseCallbacks()) + printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", [[origin protocol] UTF8String], [[origin host] UTF8String], + [origin port], [databaseIdentifier UTF8String]); + + static const unsigned long long defaultQuota = 5 * 1024 * 1024; [origin setQuota:defaultQuota]; } +- (void)webView:(WebView *)sender setStatusText:(NSString *)text +{ + if (gLayoutTestController->dumpStatusCallbacks()) + printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", [text UTF8String]); +} - (void)dealloc { diff --git a/WebKitTools/DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp b/WebKitTools/DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp index a305414..3ac257d 100644 --- a/WebKitTools/DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp +++ b/WebKitTools/DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp @@ -65,18 +65,20 @@ void* runJavaScriptThread(void* arg) JSStringRef scriptRef = JSStringCreateWithUTF8CString(script); JSValueRef exception = 0; - JSEvaluateScript(ctx, scriptRef, 0, 0, 0, &exception); + JSEvaluateScript(ctx, scriptRef, 0, 0, 1, &exception); ASSERT(!exception); + JSGarbageCollect(ctx); JSGlobalContextRelease(ctx); JSStringRelease(scriptRef); - JSGarbageCollect(ctx); + JSGarbageCollect(0); pthread_mutex_lock(&javaScriptThreadsMutex); // Check for cancellation. if (javaScriptThreadsShouldTerminate) { + javaScriptThreads()->remove(pthread_self()); pthread_mutex_unlock(&javaScriptThreadsMutex); return 0; } @@ -122,9 +124,14 @@ void stopJavaScriptThreads() pthread_mutex_unlock(&javaScriptThreadsMutex); - ThreadSet::iterator end = javaScriptThreads()->end(); - for (ThreadSet::iterator it = javaScriptThreads()->begin(); it != end; ++it) { - pthread_t pthread = *it; - pthread_join(pthread, 0); + while (true) { + pthread_mutex_lock(&javaScriptThreadsMutex); + int threadCount = javaScriptThreads()->size(); + pthread_mutex_unlock(&javaScriptThreadsMutex); + + if (!threadCount) + break; + + usleep(1000); } } diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp index 5df8a38..07075ba 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> + * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +30,7 @@ #include "DumpRenderTree.h" #include "jsobjects.h" +#include "testplugin.h" #include <QDir> #include <QFile> @@ -46,8 +48,10 @@ #include <unistd.h> #include <qdebug.h> + extern void qt_drt_run(bool b); extern void qt_dump_set_accepts_editing(bool b); +extern void qt_dump_frame_loader(bool b); namespace WebCore { @@ -61,10 +65,10 @@ class WebPage : public QWebPage { public: WebPage(QWidget *parent, DumpRenderTree *drt); - QWebPage *createWindow(); + QWebPage *createWindow(QWebPage::WebWindowType); void javaScriptAlert(QWebFrame *frame, const QString& message); - void javaScriptConsoleMessage(const QString& message, unsigned int lineNumber, const QString& sourceID); + void javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID); bool javaScriptConfirm(QWebFrame *frame, const QString& msg); bool javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result); @@ -85,11 +89,13 @@ WebPage::WebPage(QWidget *parent, DumpRenderTree *drt) settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true); settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true); settings()->setAttribute(QWebSettings::LinksIncludedInFocusChain, false); - connect(this, SIGNAL(geometryChangeRequest(const QRect &)), + connect(this, SIGNAL(geometryChangeRequested(const QRect &)), this, SLOT(setViewGeometry(const QRect & ))); + + setPluginFactory(new TestPlugin(this)); } -QWebPage *WebPage::createWindow() +QWebPage *WebPage::createWindow(QWebPage::WebWindowType) { return m_drt->createWindow(); } @@ -99,7 +105,7 @@ void WebPage::javaScriptAlert(QWebFrame *frame, const QString& message) fprintf(stdout, "ALERT: %s\n", message.toUtf8().constData()); } -void WebPage::javaScriptConsoleMessage(const QString& message, unsigned int lineNumber, const QString&) +void WebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString&) { fprintf (stdout, "CONSOLE MESSAGE: line %d: %s\n", lineNumber, message.toUtf8().constData()); } @@ -130,9 +136,11 @@ DumpRenderTree::DumpRenderTree() view->setPage(m_page); connect(m_page, SIGNAL(frameCreated(QWebFrame *)), this, SLOT(connectFrame(QWebFrame *))); connectFrame(m_page->mainFrame()); - - m_page->mainFrame()->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - m_page->mainFrame()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + + connect(m_page, SIGNAL(loadFinished(bool)), m_controller, SLOT(maybeDump(bool))); + + m_page->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); + m_page->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); connect(m_page->mainFrame(), SIGNAL(titleChanged(const QString&)), SLOT(titleChanged(const QString&))); @@ -168,7 +176,16 @@ void DumpRenderTree::open() void DumpRenderTree::open(const QUrl& url) { + // W3C SVG tests expect to be 480x360 + bool isW3CTest = url.toString().contains("svg/W3C-SVG-1.1"); + int width = isW3CTest ? 480 : maxViewWidth; + int height = isW3CTest ? 360 : maxViewHeight; + m_page->view()->resize(QSize(width, height)); + m_page->setViewportSize(QSize(width, height)); + resetJSObjects(); + + qt_dump_frame_loader(url.toString().contains("loading/")); m_page->mainFrame()->load(url); } @@ -181,8 +198,14 @@ void DumpRenderTree::readStdin(int /* socket */) //fprintf(stderr, "\n opening %s\n", line.constData()); if (line.isEmpty()) quit(); - QFileInfo fi(line); - open(QUrl::fromLocalFile(fi.absoluteFilePath())); + + if (line.startsWith("http:") || line.startsWith("https:")) + open(QUrl(line)); + else { + QFileInfo fi(line); + open(QUrl::fromLocalFile(fi.absoluteFilePath())); + } + fflush(stdout); } @@ -198,9 +221,9 @@ void DumpRenderTree::initJSObjects() { QWebFrame *frame = qobject_cast<QWebFrame*>(sender()); Q_ASSERT(frame); - frame->addToJSWindowObject(QLatin1String("layoutTestController"), m_controller); - frame->addToJSWindowObject(QLatin1String("eventSender"), m_eventSender); - frame->addToJSWindowObject(QLatin1String("textInputController"), m_textInputController); + frame->addToJavaScriptWindowObject(QLatin1String("layoutTestController"), m_controller); + frame->addToJavaScriptWindowObject(QLatin1String("eventSender"), m_eventSender); + frame->addToJavaScriptWindowObject(QLatin1String("textInputController"), m_textInputController); } @@ -213,11 +236,11 @@ QString DumpRenderTree::dumpFramesAsText(QWebFrame* frame) QWebFrame *parent = qobject_cast<QWebFrame *>(frame->parent()); if (parent) { result.append(QLatin1String("\n--------\nFrame: '")); - result.append(frame->name()); + result.append(frame->frameName()); result.append(QLatin1String("'\n--------\n")); } - result.append(frame->innerText()); + result.append(frame->toPlainText()); result.append(QLatin1String("\n")); if (m_controller->shouldDumpChildrenAsText()) { @@ -236,7 +259,7 @@ void DumpRenderTree::dump() //fprintf(stderr, " Dumping\n"); if (!m_notifier) { // Dump markup in single file mode... - QString markup = frame->markup(); + QString markup = frame->toHtml(); fprintf(stdout, "Source:\n\n%s\n", markup.toUtf8().constData()); } @@ -257,6 +280,10 @@ void DumpRenderTree::dump() fflush(stdout); + fprintf(stderr, "#EOF\n"); + + fflush(stderr); + if (!m_notifier) { // Exit now in single file mode... quit(); @@ -271,14 +298,9 @@ void DumpRenderTree::titleChanged(const QString &s) void DumpRenderTree::connectFrame(QWebFrame *frame) { - connect(frame, SIGNAL(cleared()), this, SLOT(initJSObjects())); + connect(frame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(initJSObjects())); connect(frame, SIGNAL(provisionalLoad()), layoutTestController(), SLOT(provisionalLoad())); - - if (frame == m_page->mainFrame()) { - connect(frame, SIGNAL(loadDone(bool)), - layoutTestController(), SLOT(maybeDump(bool))); - } } QWebPage *DumpRenderTree::createWindow() diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.h b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.h index b939fad..a46cccb 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.h +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.h @@ -33,8 +33,11 @@ #include <QObject> #include <QTextStream> #include <QSocketNotifier> + +QT_BEGIN_NAMESPACE class QUrl; class QFile; +QT_END_NAMESPACE class QWebPage; class QWebFrame; diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro index 8c3dbbf..08f1ab7 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro @@ -16,3 +16,7 @@ SOURCES = DumpRenderTree.cpp main.cpp jsobjects.cpp testplugin.cpp unix:!mac { QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR } + +qt-port:lessThan(QT_MINOR_VERSION, 4) { + DEFINES += QT_BEGIN_NAMESPACE="" QT_END_NAMESPACE="" +} diff --git a/WebKitTools/DumpRenderTree/qt/jsobjects.cpp b/WebKitTools/DumpRenderTree/qt/jsobjects.cpp index 78a93fe..98603ad 100644 --- a/WebKitTools/DumpRenderTree/qt/jsobjects.cpp +++ b/WebKitTools/DumpRenderTree/qt/jsobjects.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Trolltech ASA + * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,6 +35,7 @@ #include "DumpRenderTree.h" extern void qt_dump_editing_callbacks(bool b); +extern void qt_dump_resource_load_callbacks(bool b); LayoutTestController::LayoutTestController(WebCore::DumpRenderTree *drt) : QObject() @@ -58,14 +59,11 @@ void LayoutTestController::reset() } m_topLoadingFrame = 0; qt_dump_editing_callbacks(false); + qt_dump_resource_load_callbacks(false); } void LayoutTestController::maybeDump(bool ok) { - QWebFrame *frame = qobject_cast<QWebFrame*>(sender()); - if (frame != m_topLoadingFrame) - return; - m_topLoadingFrame = 0; if (!shouldWaitUntilDone()) { @@ -109,6 +107,11 @@ void LayoutTestController::dumpEditingCallbacks() qt_dump_editing_callbacks(true); } +void LayoutTestController::dumpResourceLoadCallbacks() +{ + qt_dump_resource_load_callbacks(true); +} + void LayoutTestController::queueReload() { //qDebug() << ">>>queueReload"; diff --git a/WebKitTools/DumpRenderTree/qt/jsobjects.h b/WebKitTools/DumpRenderTree/qt/jsobjects.h index 511e857..4ee6439 100644 --- a/WebKitTools/DumpRenderTree/qt/jsobjects.h +++ b/WebKitTools/DumpRenderTree/qt/jsobjects.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006 Trolltech ASA + * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -68,6 +68,7 @@ public slots: void waitUntilDone(); void notifyDone(); void dumpEditingCallbacks(); + void dumpResourceLoadCallbacks(); void queueReload(); void provisionalLoad(); void setCloseRemainingWindowsWhenComplete(bool=false) {} diff --git a/WebKitTools/DumpRenderTree/qt/main.cpp b/WebKitTools/DumpRenderTree/qt/main.cpp index dd4c0e9..8c4bc9c 100644 --- a/WebKitTools/DumpRenderTree/qt/main.cpp +++ b/WebKitTools/DumpRenderTree/qt/main.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> - * Copyright (C) 2007 Trolltech ASA + * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,7 +28,6 @@ */ #include "DumpRenderTree.h" -#include "testplugin.h" #include <qstringlist.h> #include <qapplication.h> @@ -49,10 +48,6 @@ #include <execinfo.h> #endif -#if QT_VERSION < 0x040400 -Q_IMPORT_PLUGIN(testplugin) -#endif - void messageHandler(QtMsgType type, const char *message) { if (type == QtCriticalMsg) { @@ -162,7 +157,9 @@ int main(int argc, char* argv[]) dumper.open(); } else { if (!args.last().startsWith("/") - && !args.last().startsWith("file:")) { + && !args.last().startsWith("file:") + && !args.last().startsWith("http:") + && !args.last().startsWith("https:")) { QString path = QDir::currentPath(); if (!path.endsWith('/')) path.append('/'); diff --git a/WebKitTools/DumpRenderTree/qt/testplugin.cpp b/WebKitTools/DumpRenderTree/qt/testplugin.cpp index 27558c9..54431e9 100644 --- a/WebKitTools/DumpRenderTree/qt/testplugin.cpp +++ b/WebKitTools/DumpRenderTree/qt/testplugin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Trolltech ASA + * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,10 +27,8 @@ */ #include "testplugin.h" -#if QT_VERSION < 0x040400 - TestPlugin::TestPlugin(QObject *parent) - : QWebObjectPlugin(parent) + : QWebPluginFactory(parent) { } @@ -38,34 +36,32 @@ TestPlugin::~TestPlugin() { } -QStringList TestPlugin::keys() const +QList<QWebPluginFactory::Plugin> TestPlugin::plugins() const { - return QStringList(QLatin1String("testplugin")); -} + QWebPluginFactory::Plugin plugin; -QString TestPlugin::descriptionForKey(const QString &) const -{ - return QLatin1String("testdescription"); -} + plugin.name = "testplugin"; + plugin.description = "testdescription"; + MimeType mimeType; + mimeType.name = "testtype"; + mimeType.fileExtensions.append("testsuffixes"); + plugin.mimeTypes.append(mimeType); -QStringList TestPlugin::mimetypesForKey(const QString &) const -{ - return QStringList(QLatin1String("testtype")); -} + plugin.name = "testplugin2"; + plugin.description = "testdescription2"; + mimeType.name = "testtype2"; + mimeType.fileExtensions.append("testsuffixes2"); + mimeType.fileExtensions.append("testsuffixes3"); + plugin.mimeTypes.append(mimeType); -QStringList TestPlugin::extensionsForMimetype(const QString &) const -{ - return QStringList(QLatin1String("testsuffixes")); + return QList<QWebPluginFactory::Plugin>() << plugin; } -QObject *TestPlugin::create(QWebObjectPluginConnector *, - const QUrl &, - const QString &, - const QStringList &, - const QStringList &) const +QObject *TestPlugin::create(const QString &mimeType, + const QUrl &url, + const QStringList &argumentNames, + const QStringList &argumentValues) const { return 0; } -Q_EXPORT_PLUGIN2(testplugin, TestPlugin) -#endif diff --git a/WebKitTools/DumpRenderTree/qt/testplugin.h b/WebKitTools/DumpRenderTree/qt/testplugin.h index e305069..3d8a28c 100644 --- a/WebKitTools/DumpRenderTree/qt/testplugin.h +++ b/WebKitTools/DumpRenderTree/qt/testplugin.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Trolltech ASA + * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,28 +25,21 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <qglobal.h> -#if QT_VERSION < 0x040400 -#define QT_STATICPLUGIN -#include <qwebobjectplugin.h> +#include <qwebpluginfactory.h> -class TestPlugin : public QWebObjectPlugin +class TestPlugin : public QWebPluginFactory { public: explicit TestPlugin(QObject *parent = 0); virtual ~TestPlugin(); - virtual QStringList keys() const; + virtual QList<Plugin> plugins() const; - virtual QString descriptionForKey(const QString &key) const; - virtual QStringList mimetypesForKey(const QString &key) const; - virtual QStringList extensionsForMimetype(const QString &mimeType) const; - virtual QObject *create(QWebObjectPluginConnector *connector, + virtual QObject *create(const QString &mimeType, const QUrl &url, - const QString &mimeType, const QStringList &argumentNames, const QStringList &argumentValues) const; + }; -#endif diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp new file mode 100644 index 0000000..b6e45f2 --- /dev/null +++ b/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2008 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. ``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 + * 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. + */ + +#include "config.h" +#include "AccessibilityController.h" + +#include "AccessibilityUIElement.h" +#include "DumpRenderTree.h" +#include <JavaScriptCore/Assertions.h> +#include <WebCore/COMPtr.h> +#include <WebKit/WebKit.h> +#include <oleacc.h> + +AccessibilityController::AccessibilityController() +{ +} + +AccessibilityController::~AccessibilityController() +{ +} + +AccessibilityUIElement AccessibilityController::focusedElement() +{ + COMPtr<IAccessible> rootAccessible = rootElement().platformUIElement(); + + VARIANT vFocus; + if (FAILED(rootAccessible->get_accFocus(&vFocus))) + return 0; + + if (V_VT(&vFocus) == VT_I4) { + ASSERT(V_I4(&vFocus) == CHILDID_SELF); + // The root accessible object is the focused object. + return rootAccessible; + } + + ASSERT(V_VT(&vFocus) == VT_DISPATCH); + // We have an IDispatch; query for IAccessible. + return COMPtr<IAccessible>(Query, V_DISPATCH(&vFocus)); +} + +AccessibilityUIElement AccessibilityController::rootElement() +{ + COMPtr<IWebView> view; + if (FAILED(frame->webView(&view))) + return 0; + + COMPtr<IWebViewPrivate> viewPrivate(Query, view); + if (!viewPrivate) + return 0; + + HWND webViewWindow; + if (FAILED(viewPrivate->viewWindow((OLE_HANDLE*)&webViewWindow))) + return 0; + + // Get the root accessible object by querying for the accessible object for the + // WebView's window. + COMPtr<IAccessible> rootAccessible; + if (FAILED(AccessibleObjectFromWindow(webViewWindow, static_cast<DWORD>(OBJID_CLIENT), __uuidof(IAccessible), reinterpret_cast<void**>(&rootAccessible)))) + return 0; + + return rootAccessible; +} diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp new file mode 100644 index 0000000..d835bb3 --- /dev/null +++ b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp @@ -0,0 +1,266 @@ +/* + * Copyright (C) 2008 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. ``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 + * 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. + */ + +#include "config.h" +#include "AccessibilityUIElement.h" + +#include <JavaScriptCore/JSStringRef.h> +#include <tchar.h> +#include <string> + +using std::wstring; + +AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element) + : m_element(element) +{ +} + +AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other) + : m_element(other.m_element) +{ +} + +AccessibilityUIElement::~AccessibilityUIElement() +{ +} + +void AccessibilityUIElement::getLinkedUIElements(Vector<AccessibilityUIElement>&) +{ +} + +void AccessibilityUIElement::getDocumentLinks(Vector<AccessibilityUIElement>&) +{ +} + +void AccessibilityUIElement::getChildren(Vector<AccessibilityUIElement>& children) +{ + long childCount; + if (FAILED(m_element->get_accChildCount(&childCount))) + return; + for (long i = 0; i < childCount; ++i) + children.append(getChildAtIndex(i)); +} + +AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index) +{ + COMPtr<IDispatch> child; + VARIANT vChild; + ::VariantInit(&vChild); + V_VT(&vChild) = VT_I4; + // In MSAA, index 0 is the object itself. + V_I4(&vChild) = index + 1; + if (FAILED(m_element->get_accChild(vChild, &child))) + return 0; + return COMPtr<IAccessible>(Query, child); +} + +JSStringRef AccessibilityUIElement::allAttributes() +{ + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::attributesOfLinkedUIElements() +{ + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::attributesOfDocumentLinks() +{ + return JSStringCreateWithCharacters(0, 0); +} +AccessibilityUIElement AccessibilityUIElement::titleUIElement() +{ + return 0; +} + +JSStringRef AccessibilityUIElement::attributesOfChildren() +{ + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::parameterizedAttributeNames() +{ + return JSStringCreateWithCharacters(0, 0); +} + +static VARIANT& self() +{ + static VARIANT vSelf; + static bool haveInitialized; + + if (!haveInitialized) { + ::VariantInit(&vSelf); + V_VT(&vSelf) = VT_I4; + V_I4(&vSelf) = CHILDID_SELF; + } + return vSelf; +} + +JSStringRef AccessibilityUIElement::role() +{ + VARIANT vRole; + if (FAILED(m_element->get_accRole(self(), &vRole))) + return JSStringCreateWithCharacters(0, 0); + ASSERT(V_VT(&vRole) == VT_I4); + TCHAR roleText[64] = {0}; + ::GetRoleText(V_I4(&vRole), roleText, ARRAYSIZE(roleText)); + return JSStringCreateWithCharacters(roleText, _tcslen(roleText)); +} + +JSStringRef AccessibilityUIElement::title() +{ + BSTR titleBSTR; + if (FAILED(m_element->get_accName(self(), &titleBSTR)) || !titleBSTR) + return JSStringCreateWithCharacters(0, 0); + wstring title(titleBSTR, SysStringLen(titleBSTR)); + ::SysFreeString(titleBSTR); + return JSStringCreateWithCharacters(title.data(), title.length()); +} + +JSStringRef AccessibilityUIElement::description() +{ + BSTR descriptionBSTR; + if (FAILED(m_element->get_accName(self(), &descriptionBSTR)) || !descriptionBSTR) + return JSStringCreateWithCharacters(0, 0); + wstring description(descriptionBSTR, SysStringLen(descriptionBSTR)); + ::SysFreeString(descriptionBSTR); + return JSStringCreateWithCharacters(description.data(), description.length()); +} + +double AccessibilityUIElement::width() +{ + long x, y, width, height; + if (FAILED(m_element->accLocation(&x, &y, &width, &height, self()))) + return 0; + return width; +} + +double AccessibilityUIElement::height() +{ + long x, y, width, height; + if (FAILED(m_element->accLocation(&x, &y, &width, &height, self()))) + return 0; + return height; +} + +double AccessibilityUIElement::intValue() +{ + BSTR valueBSTR; + if (FAILED(m_element->get_accValue(self(), &valueBSTR)) || !valueBSTR) + return 0; + wstring value(valueBSTR, SysStringLen(valueBSTR)); + ::SysFreeString(valueBSTR); + TCHAR* ignored; + return _tcstod(value.data(), &ignored); +} + +double AccessibilityUIElement::minValue() +{ + return 0; +} + +double AccessibilityUIElement::maxValue() +{ + return 0; +} + +bool AccessibilityUIElement::supportsPressAction() +{ + return false; +} + +int AccessibilityUIElement::insertionPointLineNumber() +{ + return 0; +} + +JSStringRef AccessibilityUIElement::attributesOfColumnHeaders() +{ + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::attributesOfRowHeaders() +{ + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::attributesOfColumns() +{ + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::attributesOfRows() +{ + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::attributesOfVisibleCells() +{ + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::attributesOfHeader() +{ + return JSStringCreateWithCharacters(0, 0); +} + +int AccessibilityUIElement::indexInTable() +{ + return 0; +} + +JSStringRef AccessibilityUIElement::rowIndexRange() +{ + return JSStringCreateWithCharacters(0, 0); +} + +JSStringRef AccessibilityUIElement::columnIndexRange() +{ + return JSStringCreateWithCharacters(0, 0); +} + +int AccessibilityUIElement::lineForIndex(int) +{ + return 0; +} + +JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length) +{ + return JSStringCreateWithCharacters(0, 0); +} + +AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row) +{ + return 0; +} + +JSStringRef AccessibilityUIElement::selectedTextRange() +{ + return JSStringCreateWithCharacters(0, 0); +} + +void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length) +{ +} diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp index c0d0577..b3b73a9 100644 --- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp @@ -26,6 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" #include "DumpRenderTree.h" #include "EditingDelegate.h" @@ -37,31 +38,26 @@ #include "UIDelegate.h" #include "WorkQueueItem.h" #include "WorkQueue.h" + +#include <fcntl.h> +#include <io.h> +#include <math.h> +#include <pthread.h> +#include <shlwapi.h> +#include <stdio.h> +#include <string.h> +#include <tchar.h> #include <wtf/RetainPtr.h> #include <wtf/Vector.h> -#include <WebCore/COMPtr.h> -#include <CoreFoundation/CoreFoundation.h> +#include <windows.h> #include <CFNetwork/CFURLCachePriv.h> +#include <CoreFoundation/CoreFoundation.h> #include <JavaScriptCore/JavaScriptCore.h> -#include <math.h> -#include <pthread.h> -#include <string> -#include <tchar.h> -#include <WebKit/DOMPrivate.h> -#include <WebKit/IWebFramePrivate.h> -#include <WebKit/IWebHistoryItem.h> -#include <WebKit/IWebHistoryItemPrivate.h> -#include <WebKit/IWebPreferencesPrivate.h> -#include <WebKit/IWebURLResponse.h> -#include <WebKit/IWebViewPrivate.h> +#include <WebCore/COMPtr.h> +#include <WebKit/ForEachCoClass.h> #include <WebKit/WebKit.h> -#include <fcntl.h> -#include <io.h> -#include <windows.h> -#include <stdio.h> -#include <shlwapi.h> -using std::wstring; +using namespace std; #ifndef NDEBUG const LPWSTR TestPluginDir = L"TestNetscapePlugin_Debug"; @@ -79,12 +75,10 @@ static bool dumpPixels; static bool dumpAllPixels; static bool printSeparators; static bool leakChecking = false; -static bool timedOut = false; static bool threaded = false; +static bool forceComplexText = false; static RetainPtr<CFStringRef> persistentUserStyleSheetLocation; -static const char* currentTest; - volatile bool done; // This is the topmost frame that is loading, during a given load, or nil when no load is // in progress. Usually this is the same as the main frame, but not always. In the case @@ -101,12 +95,9 @@ COMPtr<ResourceLoadDelegate> sharedResourceLoadDelegate; IWebFrame* frame; HWND webViewWindow; -LayoutTestController* layoutTestController = 0; +LayoutTestController* gLayoutTestController = 0; CFRunLoopTimerRef waitToDumpWatchdog = 0; -static const unsigned timeoutValue = 60000; -static const unsigned timeoutId = 10; - const unsigned maxViewWidth = 800; const unsigned maxViewHeight = 600; @@ -126,12 +117,6 @@ wstring urlSuitableForTestResult(const wstring& url) static LRESULT CALLBACK DumpRenderTreeWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { - case WM_TIMER: - // The test ran long enough to time out - timedOut = true; - PostQuitMessage(0); - return 0; - break; case WM_DESTROY: for (unsigned i = openWindows().size() - 1; i >= 0; --i) { if (openWindows()[i] == hWnd) { @@ -230,7 +215,16 @@ static void initialize() TEXT("Times Bold.ttf"), TEXT("Times Italic.ttf"), TEXT("Times Roman.ttf"), - TEXT("WebKit Layout Tests.ttf") + TEXT("WebKit Layout Tests.ttf"), + TEXT("WebKitWeightWatcher100.ttf"), + TEXT("WebKitWeightWatcher200.ttf"), + TEXT("WebKitWeightWatcher300.ttf"), + TEXT("WebKitWeightWatcher400.ttf"), + TEXT("WebKitWeightWatcher500.ttf"), + TEXT("WebKitWeightWatcher600.ttf"), + TEXT("WebKitWeightWatcher700.ttf"), + TEXT("WebKitWeightWatcher800.ttf"), + TEXT("WebKitWeightWatcher900.ttf") }; wstring resourcesPath = fontsPath(); @@ -293,7 +287,7 @@ void dumpFrameScrollPosition(IWebFrame* frame) printf("scrolled to %.f,%.f\n", (double)scrollPosition.cx, (double)scrollPosition.cy); } - if (::layoutTestController->dumpChildFrameScrollPositions()) { + if (::gLayoutTestController->dumpChildFrameScrollPositions()) { COMPtr<IEnumVARIANT> enumKids; if (FAILED(frame->childFrames(&enumKids))) return; @@ -350,7 +344,7 @@ static wstring dumpFramesAsText(IWebFrame* frame) SysFreeString(innerText); - if (::layoutTestController->dumpChildFramesAsText()) { + if (::gLayoutTestController->dumpChildFramesAsText()) { COMPtr<IEnumVARIANT> enumKids; if (FAILED(frame->childFrames(&enumKids))) return L""; @@ -553,7 +547,7 @@ void dump() if (SUCCEEDED(dataSource->response(&response)) && response) { BSTR mimeType; if (SUCCEEDED(response->MIMEType(&mimeType))) - ::layoutTestController->setDumpAsText(::layoutTestController->dumpAsText() | !_tcscmp(mimeType, TEXT("text/plain"))); + ::gLayoutTestController->setDumpAsText(::gLayoutTestController->dumpAsText() | !_tcscmp(mimeType, TEXT("text/plain"))); SysFreeString(mimeType); } } @@ -561,13 +555,13 @@ void dump() BSTR resultString = 0; if (dumpTree) { - if (::layoutTestController->dumpAsText()) { + if (::gLayoutTestController->dumpAsText()) { ::InvalidateRect(webViewWindow, 0, TRUE); ::SendMessage(webViewWindow, WM_PAINT, 0, 0); wstring result = dumpFramesAsText(frame); resultString = SysAllocStringLen(result.data(), result.size()); } else { - bool isSVGW3CTest = strstr(currentTest, "svg\\W3C-SVG-1.1"); + bool isSVGW3CTest = (gLayoutTestController->testPathOrURL().find("svg\\W3C-SVG-1.1") != string::npos); unsigned width; unsigned height; if (isSVGW3CTest) { @@ -589,7 +583,7 @@ void dump() } if (!resultString) - printf("ERROR: nil result from %s", ::layoutTestController->dumpAsText() ? "IDOMElement::innerText" : "IFrameViewPrivate::renderTreeAsExternalRepresentation"); + printf("ERROR: nil result from %s", ::gLayoutTestController->dumpAsText() ? "IDOMElement::innerText" : "IFrameViewPrivate::renderTreeAsExternalRepresentation"); else { unsigned stringLength = SysStringLen(resultString); int bufferSize = ::WideCharToMultiByte(CP_UTF8, 0, resultString, stringLength, 0, 0, 0, 0); @@ -597,23 +591,28 @@ void dump() ::WideCharToMultiByte(CP_UTF8, 0, resultString, stringLength, buffer, bufferSize + 1, 0, 0); fwrite(buffer, 1, bufferSize, stdout); free(buffer); - if (!::layoutTestController->dumpAsText()) + if (!::gLayoutTestController->dumpAsText()) dumpFrameScrollPosition(frame); } - if (::layoutTestController->dumpBackForwardList()) + if (::gLayoutTestController->dumpBackForwardList()) dumpBackForwardListForAllWindows(); } - if (printSeparators) - puts("#EOF"); + if (printSeparators) { + puts("#EOF"); // terminate the content block + fputs("#EOF\n", stderr); + fflush(stdout); + fflush(stderr); + } if (dumpPixels) { - if (layoutTestController->dumpAsText() || layoutTestController->dumpDOMAsWebArchive() || layoutTestController->dumpSourceAsWebArchive()) - printf("#EOF\n"); - else - dumpWebViewAsPixelsAndCompareWithExpected(currentTest, dumpAllPixels); + if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive()) + dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); } + printf("#EOF\n"); // terminate the (possibly empty) pixels block + fflush(stdout); + fail: SysFreeString(resultString); // This will exit from our message loop @@ -635,8 +634,10 @@ static void resetWebViewToConsistentStateBeforeTesting() webView->setPolicyDelegate(0); COMPtr<IWebIBActions> webIBActions(Query, webView); - if (webIBActions) + if (webIBActions) { webIBActions->makeTextStandardSize(0); + webIBActions->resetPageZoom(0); + } COMPtr<IWebPreferences> preferences; if (SUCCEEDED(webView->preferences(&preferences))) { @@ -654,26 +655,48 @@ static void resetWebViewToConsistentStateBeforeTesting() preferences->setUserStyleSheetEnabled(FALSE); COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences); - if (prefsPrivate) + if (prefsPrivate) { prefsPrivate->setAuthorAndUserStylesEnabled(TRUE); + prefsPrivate->setDeveloperExtrasEnabled(FALSE); + } } + COMPtr<IWebViewEditing> viewEditing; + if (SUCCEEDED(webView->QueryInterface(&viewEditing))) + viewEditing->setSmartInsertDeleteEnabled(TRUE); + COMPtr<IWebViewPrivate> webViewPrivate(Query, webView); if (!webViewPrivate) return; + COMPtr<IWebInspector> inspector; + if (SUCCEEDED(webViewPrivate->inspector(&inspector))) + inspector->setJavaScriptProfilingEnabled(FALSE); + HWND viewWindow; if (SUCCEEDED(webViewPrivate->viewWindow(reinterpret_cast<OLE_HANDLE*>(&viewWindow))) && viewWindow) SetFocus(viewWindow); + + webViewPrivate->clearMainFrameName(); } -static void runTest(const char* pathOrURL) +static void runTest(const string& testPathOrURL) { static BSTR methodBStr = SysAllocString(TEXT("GET")); + // Look for "'" as a separator between the path or URL, and the pixel dump hash that follows. + string pathOrURL(testPathOrURL); + string expectedPixelHash; + + size_t separatorPos = pathOrURL.find("'"); + if (separatorPos != string::npos) { + pathOrURL = string(testPathOrURL, 0, separatorPos); + expectedPixelHash = string(testPathOrURL, separatorPos + 1); + } + BSTR urlBStr; - CFStringRef str = CFStringCreateWithCString(0, pathOrURL, kCFStringEncodingWindowsLatin1); + CFStringRef str = CFStringCreateWithCString(0, pathOrURL.c_str(), kCFStringEncodingWindowsLatin1); CFURLRef url = CFURLCreateWithString(0, str, 0); if (!url) @@ -692,15 +715,12 @@ static void runTest(const char* pathOrURL) CFRelease(url); - currentTest = pathOrURL; - - ::layoutTestController = new LayoutTestController(false, false); + ::gLayoutTestController = new LayoutTestController(pathOrURL, expectedPixelHash); done = false; topLoadingFrame = 0; - timedOut = false; - if (shouldLogFrameLoadDelegates(pathOrURL)) - layoutTestController->setDumpFrameLoadCallbacks(true); + if (shouldLogFrameLoadDelegates(pathOrURL.c_str())) + gLayoutTestController->setDumpFrameLoadCallbacks(true); COMPtr<IWebHistory> history(Create, CLSID_WebHistory); if (history) @@ -723,15 +743,12 @@ static void runTest(const char* pathOrURL) HWND hostWindow; webView->hostWindow(reinterpret_cast<OLE_HANDLE*>(&hostWindow)); - // Set the test timeout timer - SetTimer(hostWindow, timeoutId, timeoutValue, 0); - COMPtr<IWebMutableURLRequest> request; HRESULT hr = CoCreateInstance(CLSID_WebMutableURLRequest, 0, CLSCTX_ALL, IID_IWebMutableURLRequest, (void**)&request); if (FAILED(hr)) goto exit; - request->initWithURL(urlBStr, WebURLRequestUseProtocolCachePolicy, 0); + request->initWithURL(urlBStr, WebURLRequestUseProtocolCachePolicy, 60); request->setHTTPMethod(methodBStr); frame->loadRequest(request.get()); @@ -746,19 +763,10 @@ static void runTest(const char* pathOrURL) TranslateMessage(&msg); DispatchMessage(&msg); } - KillTimer(hostWindow, timeoutId); - - if (timedOut) { - fprintf(stderr, "ERROR: Timed out running %s\n", pathOrURL); - printf("ERROR: Timed out loading page\n"); - - if (printSeparators) - puts("#EOF"); - } frame->stopLoading(); - if (::layoutTestController->closeRemainingWindowsWhenComplete()) { + if (::gLayoutTestController->closeRemainingWindowsWhenComplete()) { Vector<HWND> windows = openWindows(); unsigned size = windows.size(); for (unsigned i = 0; i < size; i++) { @@ -774,7 +782,8 @@ static void runTest(const char* pathOrURL) exit: SysFreeString(urlBStr); - delete ::layoutTestController; + ::gLayoutTestController->deref(); + ::gLayoutTestController = 0; return; } @@ -854,7 +863,7 @@ void* runJavaScriptThread(void* arg) JSStringRef scriptRef = JSStringCreateWithUTF8CString(script); JSValueRef exception = 0; - JSEvaluateScript(ctx, scriptRef, 0, 0, 0, &exception); + JSEvaluateScript(ctx, scriptRef, 0, 0, 1, &exception); assert(!exception); JSGlobalContextRelease(ctx); @@ -963,11 +972,12 @@ IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow) return 0; viewPrivate->setShouldApplyMacFontAscentHack(TRUE); + viewPrivate->setAlwaysUsesComplexTextCodePath(forceComplexText); BSTR pluginPath = SysAllocStringLen(0, exePath().length() + _tcslen(TestPluginDir)); _tcscpy(pluginPath, exePath().c_str()); _tcscat(pluginPath, TestPluginDir); - failed = FAILED(viewPrivate->addAdditionalPluginPath(pluginPath)); + failed = FAILED(viewPrivate->addAdditionalPluginDirectory(pluginPath)); SysFreeString(pluginPath); if (failed) return 0; @@ -1016,6 +1026,7 @@ int main(int argc, char* argv[]) leakChecking = false; _setmode(1, _O_BINARY); + _setmode(2, _O_BINARY); initialize(); @@ -1037,6 +1048,11 @@ int main(int argc, char* argv[]) continue; } + if (!stricmp(argv[i], "--complex-text")) { + forceComplexText = true; + continue; + } + tests.append(argv[i]); } @@ -1083,7 +1099,6 @@ int main(int argc, char* argv[]) continue; runTest(filenameBuffer); - fflush(stdout); } } else { printSeparators = tests.size() > 1; @@ -1106,5 +1121,7 @@ int main(int argc, char* argv[]) } #endif + shutDownWebKit(); + return 0; } diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj index a357f29..e094bde 100644 --- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj +++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj @@ -23,7 +23,7 @@ >
<Tool
Name="VCPreBuildEventTool"
- CommandLine="mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"

xcopy /y /d "$(ProjectDir)\..\ForwardingHeaders\wtf\*.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"

mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"

xcopy /y /d "$(ProjectDir)\..\ForwardingHeaders\wtf\*.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
"
/>
<Tool
Name="VCCustomBuildTool"
@@ -39,9 +39,10 @@ />
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(ProjectDir)\.";"$(ProjectDir)\..";"$(ProjectDir)\..\cg";"$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders""
+ AdditionalIncludeDirectories=""$(ProjectDir)\.";"$(ProjectDir)\..";"$(ProjectDir)\..\cg";"$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility""
PreprocessorDefinitions="_CONSOLE"
DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="DumpRenderTreePrefix.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -54,7 +55,7 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib"
+ AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib oleacc.lib"
AdditionalLibraryDirectories=""
DelayLoadDLLs=""
SubSystem="1"
@@ -65,6 +66,8 @@ />
<Tool
Name="VCManifestTool"
+ TypeLibraryFile="$(WebKitOutputDir)\lib\WebKit.tlb"
+ ComponentFileName="WebKit$(WebKitDLLConfigSuffix)"
/>
<Tool
Name="VCXDCMakeTool"
@@ -83,7 +86,7 @@ />
<Tool
Name="VCPostBuildEventTool"
- CommandLine="
"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if "$(ARCHIVE_BUILD)"=="" (if not "$(PRODUCTION)"=="" exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
/>
</Configuration>
<Configuration
@@ -95,7 +98,7 @@ >
<Tool
Name="VCPreBuildEventTool"
- CommandLine="mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"

xcopy /y /d "$(ProjectDir)\..\ForwardingHeaders\wtf\*.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"

mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"

xcopy /y /d "$(ProjectDir)\..\ForwardingHeaders\wtf\*.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
"
/>
<Tool
Name="VCCustomBuildTool"
@@ -111,9 +114,10 @@ />
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(ProjectDir)\.";"$(ProjectDir)\..";"$(ProjectDir)\..\cg";"$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders""
+ AdditionalIncludeDirectories=""$(ProjectDir)\.";"$(ProjectDir)\..";"$(ProjectDir)\..\cg";"$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility""
PreprocessorDefinitions="_CONSOLE"
DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="DumpRenderTreePrefix.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -126,7 +130,7 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib"
+ AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib oleacc.lib"
AdditionalLibraryDirectories=""
DelayLoadDLLs=""
SubSystem="1"
@@ -137,6 +141,8 @@ />
<Tool
Name="VCManifestTool"
+ TypeLibraryFile="$(WebKitOutputDir)\lib\WebKit.tlb"
+ ComponentFileName="WebKit$(WebKitDLLConfigSuffix)"
/>
<Tool
Name="VCXDCMakeTool"
@@ -155,7 +161,7 @@ />
<Tool
Name="VCPostBuildEventTool"
- CommandLine="
"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if "$(ARCHIVE_BUILD)"=="" (if not "$(PRODUCTION)"=="" exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
/>
</Configuration>
<Configuration
@@ -166,7 +172,7 @@ >
<Tool
Name="VCPreBuildEventTool"
- CommandLine="mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"

xcopy /y /d "$(ProjectDir)\..\ForwardingHeaders\wtf\*.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"

mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders"
mkdir 2>NUL "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"

xcopy /y /d "$(ProjectDir)\..\ForwardingHeaders\wtf\*.h" "$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf"
"
/>
<Tool
Name="VCCustomBuildTool"
@@ -182,9 +188,10 @@ />
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(ProjectDir)\.";"$(ProjectDir)\..";"$(ProjectDir)\..\cg";"$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders""
+ AdditionalIncludeDirectories=""$(ProjectDir)\.";"$(ProjectDir)\..";"$(ProjectDir)\..\cg";"$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility""
PreprocessorDefinitions="_CONSOLE;DEBUG_WEBKIT_HAS_SUFFIX"
DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="DumpRenderTreePrefix.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -197,7 +204,7 @@ />
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib"
+ AdditionalDependencies="WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib WTF$(WebKitConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib oleacc.lib"
AdditionalLibraryDirectories=""
DelayLoadDLLs=""
SubSystem="1"
@@ -207,6 +214,8 @@ />
<Tool
Name="VCManifestTool"
+ TypeLibraryFile="$(WebKitOutputDir)\lib\WebKit.tlb"
+ ComponentFileName="WebKit$(WebKitDLLConfigSuffix)"
/>
<Tool
Name="VCXDCMakeTool"
@@ -225,7 +234,7 @@ />
<Tool
Name="VCPostBuildEventTool"
- CommandLine="
"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

if "$(ARCHIVE_BUILD)"=="" (if not "$(PRODUCTION)"=="" exit /b)

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CFNetwork.resources" "$(WebKitOutputDir)\bin\CFNetwork.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\dnssd.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
/>
</Configuration>
</Configurations>
@@ -236,6 +245,18 @@ Name="Controllers"
>
<File
+ RelativePath="..\AccessibilityController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\AccessibilityController.h"
+ >
+ </File>
+ <File
+ RelativePath=".\AccessibilityControllerWin.cpp"
+ >
+ </File>
+ <File
RelativePath=".\EventSender.cpp"
>
</File>
@@ -313,6 +334,18 @@ </File>
</Filter>
<File
+ RelativePath="..\AccessibilityUIElement.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\AccessibilityUIElement.h"
+ >
+ </File>
+ <File
+ RelativePath=".\AccessibilityUIElementWin.cpp"
+ >
+ </File>
+ <File
RelativePath=".\DraggingInfo.h"
>
</File>
@@ -325,6 +358,10 @@ >
</File>
<File
+ RelativePath="..\DumpRenderTreePrefix.h"
+ >
+ </File>
+ <File
RelativePath=".\DumpRenderTreeWin.h"
>
</File>
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h index 54dc697..45ce0dc 100644 --- a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h +++ b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h @@ -29,25 +29,6 @@ #ifndef DumpRenderTreeWin_h #define DumpRenderTreeWin_h -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0500 - -#undef WINVER -#define WINVER 0x0500 - -// If we don't define these, they get defined in windef.h. -// We want to use std::min and std::max -#undef max -#define max max -#undef min -#define min min - -#undef _WINSOCKAPI_ -#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h - -// FIXME: we should add a config.h file for DumpRenderTree. -#define WTF_PLATFORM_CF 1 - struct IWebFrame; struct IWebPolicyDelegate; struct IWebView; diff --git a/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp b/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp index 7add64e..32c02bd 100644 --- a/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp +++ b/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp @@ -26,9 +26,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "EditingDelegate.h" +#include "DumpRenderTree.h" #include "LayoutTestController.h" #include <WebCore/COMPtr.h> #include <wtf/Platform.h> @@ -127,7 +128,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldBeginEditingInDOMRange( return E_POINTER; } - if (::layoutTestController->dumpEditingCallbacks() && !done) + if (::gLayoutTestController->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n"), dump(range)); *result = m_acceptsEditing; @@ -144,7 +145,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldEndEditingInDOMRange( return E_POINTER; } - if (::layoutTestController->dumpEditingCallbacks() && !done) + if (::gLayoutTestController->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n"), dump(range)); *result = m_acceptsEditing; @@ -163,7 +164,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldInsertNode( TEXT("WebViewInsertActionDropped"), }; - if (::layoutTestController->dumpEditingCallbacks() && !done) + if (::gLayoutTestController->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n"), dumpPath(node), dump(range), insertactionstring[action]); return S_OK; @@ -187,7 +188,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldInsertText( TEXT("WebViewInsertActionDropped"), }; - if (::layoutTestController->dumpEditingCallbacks() && !done) + if (::gLayoutTestController->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n"), text ? text : TEXT(""), dump(range), insertactionstring[action]); *result = m_acceptsEditing; @@ -204,7 +205,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldDeleteDOMRange( return E_POINTER; } - if (::layoutTestController->dumpEditingCallbacks() && !done) + if (::gLayoutTestController->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldDeleteDOMRange:%s\n"), dump(range)); *result = m_acceptsEditing; @@ -233,7 +234,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldChangeSelectedDOMRange( TEXT("TRUE") }; - if (::layoutTestController->dumpEditingCallbacks() && !done) + if (::gLayoutTestController->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n"), dump(currentRange), dump(proposedRange), affinitystring[selectionAffinity], boolstring[stillSelecting]); *result = m_acceptsEditing; @@ -251,7 +252,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldApplyStyle( return E_POINTER; } - if (::layoutTestController->dumpEditingCallbacks() && !done) + if (::gLayoutTestController->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n"), TEXT("'style description'")/*[[style description] UTF8String]*/, dump(range)); *result = m_acceptsEditing; @@ -269,7 +270,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldChangeTypingStyle( return E_POINTER; } - if (::layoutTestController->dumpEditingCallbacks() && !done) + if (::gLayoutTestController->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldChangeTypingStyle:%s toStyle:%s\n"), TEXT("'currentStyle description'"), TEXT("'proposedStyle description'")); *result = m_acceptsEditing; @@ -286,7 +287,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::doPlatformCommand( return E_POINTER; } - if (::layoutTestController->dumpEditingCallbacks() && !done) + if (::gLayoutTestController->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: doPlatformCommand:%s\n"), command ? command : TEXT("")); *result = m_acceptsEditing; @@ -296,7 +297,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::doPlatformCommand( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidBeginEditing( /* [in] */ IWebNotification* notification) { - if (::layoutTestController->dumpEditingCallbacks() && !done) { + if (::gLayoutTestController->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidBeginEditing:%s\n"), name ? name : TEXT("")); @@ -308,7 +309,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidBeginEditing( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChange( /* [in] */ IWebNotification *notification) { - if (::layoutTestController->dumpEditingCallbacks() && !done) { + if (::gLayoutTestController->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidBeginEditing:%s\n"), name ? name : TEXT("")); @@ -320,7 +321,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChange( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidEndEditing( /* [in] */ IWebNotification *notification) { - if (::layoutTestController->dumpEditingCallbacks() && !done) { + if (::gLayoutTestController->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidEndEditing:%s\n"), name ? name : TEXT("")); @@ -332,7 +333,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidEndEditing( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeTypingStyle( /* [in] */ IWebNotification *notification) { - if (::layoutTestController->dumpEditingCallbacks() && !done) { + if (::gLayoutTestController->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidChangeTypingStyle:%s\n"), name ? name : TEXT("")); @@ -344,7 +345,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeTypingStyle( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeSelection( /* [in] */ IWebNotification *notification) { - if (::layoutTestController->dumpEditingCallbacks() && !done) { + if (::gLayoutTestController->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidChangeSelection:%s\n"), name ? name : TEXT("")); diff --git a/WebKitTools/DumpRenderTree/win/EditingDelegate.h b/WebKitTools/DumpRenderTree/win/EditingDelegate.h index 4ed74b2..6dba675 100644 --- a/WebKitTools/DumpRenderTree/win/EditingDelegate.h +++ b/WebKitTools/DumpRenderTree/win/EditingDelegate.h @@ -29,7 +29,7 @@ #ifndef EditingDelegate_h #define EditingDelegate_h -#include <WebKit/IWebEditingDelegate.h> +#include <WebKit/WebKit.h> class __declspec(uuid("265DCD4B-79C3-44a2-84BC-511C3EDABD6F")) EditingDelegate : public IWebEditingDelegate { public: diff --git a/WebKitTools/DumpRenderTree/win/EventSender.cpp b/WebKitTools/DumpRenderTree/win/EventSender.cpp index 66d8772..efecc03 100644 --- a/WebKitTools/DumpRenderTree/win/EventSender.cpp +++ b/WebKitTools/DumpRenderTree/win/EventSender.cpp @@ -26,18 +26,18 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "EventSender.h" #include "DraggingInfo.h" +#include "DumpRenderTree.h" #include <WebCore/COMPtr.h> #include <wtf/ASCIICType.h> #include <wtf/Platform.h> #include <JavaScriptCore/JavaScriptCore.h> #include <JavaScriptCore/Assertions.h> -#include <WebKit/IWebFrame.h> -#include <WebKit/IWebFramePrivate.h> +#include <WebKit/WebKit.h> #include <windows.h> #define WM_DRT_SEND_QUEUED_EVENT (WM_APP+1) @@ -485,8 +485,8 @@ static JSValueRef textZoomInCallback(JSContextRef context, JSObjectRef function, if (FAILED(frame->webView(&webView))) return JSValueMakeUndefined(context); - COMPtr<IWebIBActions> webIBActions; - if (FAILED(webView->QueryInterface(IID_IWebIBActions, (void**)&webIBActions))) + COMPtr<IWebIBActions> webIBActions(Query, webView); + if (!webIBActions) return JSValueMakeUndefined(context); webIBActions->makeTextLarger(0); @@ -499,14 +499,42 @@ static JSValueRef textZoomOutCallback(JSContextRef context, JSObjectRef function if (FAILED(frame->webView(&webView))) return JSValueMakeUndefined(context); - COMPtr<IWebIBActions> webIBActions; - if (FAILED(webView->QueryInterface(IID_IWebIBActions, (void**)&webIBActions))) + COMPtr<IWebIBActions> webIBActions(Query, webView); + if (!webIBActions) return JSValueMakeUndefined(context); webIBActions->makeTextSmaller(0); return JSValueMakeUndefined(context); } +static JSValueRef zoomPageInCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + COMPtr<IWebView> webView; + if (FAILED(frame->webView(&webView))) + return JSValueMakeUndefined(context); + + COMPtr<IWebIBActions> webIBActions(Query, webView); + if (!webIBActions) + return JSValueMakeUndefined(context); + + webIBActions->zoomPageIn(0); + return JSValueMakeUndefined(context); +} + +static JSValueRef zoomPageOutCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + COMPtr<IWebView> webView; + if (FAILED(frame->webView(&webView))) + return JSValueMakeUndefined(context); + + COMPtr<IWebIBActions> webIBActions(Query, webView); + if (!webIBActions) + return JSValueMakeUndefined(context); + + webIBActions->zoomPageOut(0); + return JSValueMakeUndefined(context); +} + static JSStaticFunction staticFunctions[] = { { "contextClick", contextClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "mouseDown", mouseDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -517,6 +545,8 @@ static JSStaticFunction staticFunctions[] = { { "dispatchMessage", dispatchMessageCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "textZoomIn", textZoomInCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "textZoomOut", textZoomOutCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "zoomPageIn", zoomPageInCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "zoomPageOut", zoomPageOutCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { 0, 0, 0 } }; diff --git a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp index b436352..b18b961 100644 --- a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp +++ b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp @@ -26,9 +26,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "FrameLoadDelegate.h" +#include "AccessibilityController.h" +#include "DumpRenderTree.h" #include "EventSender.h" #include "GCController.h" #include "LayoutTestController.h" @@ -37,8 +39,7 @@ #include <WebCore/COMPtr.h> #include <JavaScriptCore/Assertions.h> #include <JavaScriptCore/JavaScriptCore.h> -#include <WebKit/IWebFramePrivate.h> -#include <WebKit/IWebViewPrivate.h> +#include <WebKit/WebKit.h> #include <wtf/Vector.h> #include <stdio.h> #include <string> @@ -68,14 +69,13 @@ string descriptionSuitableForTestResult(IWebFrame* webFrame) if (FAILED(webView->mainFrame(&mainFrame))) return string(); - if (webFrame == mainFrame) - return "main frame"; - BSTR frameNameBSTR; - if (FAILED(webFrame->name(&frameNameBSTR))) - return string(); + if (FAILED(webFrame->name(&frameNameBSTR)) || BSTRtoString(frameNameBSTR).empty() ) + return (webFrame == mainFrame) ? "main frame" : string(); + + string frameName = (webFrame == mainFrame) ? "main frame" : "frame"; + frameName += " \"" + BSTRtoString(frameNameBSTR) + "\""; - string frameName = "frame \"" + BSTRtoString(frameNameBSTR) + "\""; SysFreeString(frameNameBSTR); return frameName; @@ -84,6 +84,7 @@ string descriptionSuitableForTestResult(IWebFrame* webFrame) FrameLoadDelegate::FrameLoadDelegate() : m_refCount(1) , m_gcController(new GCController) + , m_accessibilityController(new AccessibilityController) { } @@ -128,7 +129,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didStartProvisionalLoadForFrame( /* [in] */ IWebView* webView, /* [in] */ IWebFrame* frame) { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) printf("%s - didStartProvisionalLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); @@ -145,7 +146,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFailProvisionalLoadWithError( /* [in] */ IWebError *error, /* [in] */ IWebFrame *frame) { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) printf("%s - didFailProvisionalLoadWithError\n", descriptionSuitableForTestResult(frame).c_str()); @@ -162,7 +163,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didCommitLoadForFrame( return hr; webViewPrivate->updateFocusedAndActiveState(); - if (!done && layoutTestController->dumpFrameLoadCallbacks()) + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) printf("%s - didCommitLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); @@ -175,7 +176,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didReceiveTitle( /* [in] */ BSTR title, /* [in] */ IWebFrame *frame) { - if (::layoutTestController->dumpTitleChanges() && !done) + if (::gLayoutTestController->dumpTitleChanges() && !done) printf("TITLE CHANGED: %S\n", title ? title : L""); return S_OK; } @@ -190,7 +191,7 @@ void FrameLoadDelegate::processWork() } // if we didn't start a new load, then we finished all the commands, so we're ready to dump state - if (!topLoadingFrame && !::layoutTestController->waitToDump()) + if (!topLoadingFrame && !::gLayoutTestController->waitToDump()) dump(); } @@ -210,7 +211,7 @@ void FrameLoadDelegate::locationChangeDone(IWebError*, IWebFrame* frame) topLoadingFrame = 0; WorkQueue::shared()->setFrozen(true); - if (::layoutTestController->waitToDump()) + if (::gLayoutTestController->waitToDump()) return; if (WorkQueue::shared()->count()) { @@ -227,7 +228,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFinishLoadForFrame( /* [in] */ IWebView* webView, /* [in] */ IWebFrame* frame) { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) printf("%s - didFinishLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); @@ -259,12 +260,15 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didClearWindowObject( { JSValueRef exception = 0; - ::layoutTestController->makeWindowObject(context, windowObject, &exception); + ::gLayoutTestController->makeWindowObject(context, windowObject, &exception); ASSERT(!exception); m_gcController->makeWindowObject(context, windowObject, &exception); ASSERT(!exception); + m_accessibilityController->makeWindowObject(context, windowObject, &exception); + ASSERT(!exception); + JSStringRef eventSenderStr = JSStringCreateWithUTF8CString("eventSender"); JSValueRef eventSender = makeEventSender(context); JSObjectSetProperty(context, windowObject, eventSenderStr, eventSender, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, 0); @@ -277,9 +281,22 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFinishDocumentLoadForFrame( /* [in] */ IWebView *sender, /* [in] */ IWebFrame *frame) { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) printf("%s - didFinishDocumentLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); + if (!done) { + COMPtr<IWebFramePrivate> webFramePrivate; + HRESULT hr = frame->QueryInterface(&webFramePrivate); + if (FAILED(hr)) + return hr; + unsigned pendingFrameUnloadEvents; + hr = webFramePrivate->pendingFrameUnloadEventCount(&pendingFrameUnloadEvents); + if (FAILED(hr)) + return hr; + if (pendingFrameUnloadEvents) + printf("%s - has %u onunload handler(s)\n", + descriptionSuitableForTestResult(frame).c_str(), pendingFrameUnloadEvents); + } return S_OK; } @@ -288,7 +305,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didHandleOnloadEventsForFrame( /* [in] */ IWebView *sender, /* [in] */ IWebFrame *frame) { - if (!done && layoutTestController->dumpFrameLoadCallbacks()) + if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) printf("%s - didHandleOnloadEventsForFrame\n", descriptionSuitableForTestResult(frame).c_str()); diff --git a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h index 8e694be..1a134fc 100644 --- a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h +++ b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h @@ -29,10 +29,10 @@ #ifndef FrameLoadDelegate_h #define FrameLoadDelegate_h -#include <WebKit/IWebFrameLoadDelegate.h> -#include <WebKit/IWebFrameLoadDelegatePrivate.h> +#include <WebKit/WebKit.h> #include <wtf/OwnPtr.h> +class AccessibilityController; class GCController; class FrameLoadDelegate : public IWebFrameLoadDelegate2, public IWebFrameLoadDelegatePrivate { @@ -133,6 +133,7 @@ protected: ULONG m_refCount; OwnPtr<GCController> m_gcController; + OwnPtr<AccessibilityController> m_accessibilityController; }; #endif // FrameLoadDelegate_h diff --git a/WebKitTools/DumpRenderTree/win/GCControllerWin.cpp b/WebKitTools/DumpRenderTree/win/GCControllerWin.cpp index 8c41556..547aabc 100644 --- a/WebKitTools/DumpRenderTree/win/GCControllerWin.cpp +++ b/WebKitTools/DumpRenderTree/win/GCControllerWin.cpp @@ -26,11 +26,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "GCController.h" +#include "DumpRenderTree.h" #include <WebCore/COMPtr.h> -#include <WebKit/IWebJavaScriptCollector.h> #include <WebKit/WebKit.h> void GCController::collect() const diff --git a/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj b/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj index 2dc17c5..9da1a56 100644 --- a/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj +++ b/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj @@ -22,6 +22,7 @@ >
<Tool
Name="VCPreBuildEventTool"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"
"
/>
<Tool
Name="VCCustomBuildTool"
@@ -37,7 +38,7 @@ />
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\include""
+ AdditionalIncludeDirectories=""$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -77,6 +78,7 @@ />
<Tool
Name="VCPostBuildEventTool"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if "$(ARCHIVE_BUILD)"=="" (if not "$(PRODUCTION)"=="" exit /b)

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt38.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt38$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin38$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin38$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc38$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc38$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
/>
</Configuration>
<Configuration
@@ -88,6 +90,7 @@ >
<Tool
Name="VCPreBuildEventTool"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"
"
/>
<Tool
Name="VCCustomBuildTool"
@@ -103,7 +106,7 @@ />
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\include""
+ AdditionalIncludeDirectories=""$(WebKitOutputDir)\include";"$(WebKitOutputDir)\include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility""
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -143,6 +146,7 @@ />
<Tool
Name="VCPostBuildEventTool"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed"

mkdir 2>NUL "$(WebKitOutputDir)\bin"

if "$(ARCHIVE_BUILD)"=="" (if not "$(PRODUCTION)"=="" exit /b)

if not exist "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" exit /b

xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CoreFoundation.resources" "$(WebKitOutputDir)\bin\CoreFoundation.resources"
xcopy /y /d /e /i "$(WebKitLibrariesDir)\bin\CharacterSets" "$(WebKitOutputDir)\bin\CharacterSets"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt38.dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icudt38$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin38$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuin38$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc38$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\icuuc38$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll" "$(WebKitOutputDir)\bin"
xcopy /y /d "$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb" "$(WebKitOutputDir)\bin"
"
/>
</Configuration>
</Configurations>
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp index 5469cd4..275fcd3 100644 --- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp +++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp @@ -6,13 +6,13 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * 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. + * documentation and/or other materials provided with the distribution. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. + * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -26,9 +26,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "LayoutTestController.h" +#include "DumpRenderTree.h" #include "EditingDelegate.h" #include "PolicyDelegate.h" #include "WorkQueue.h" @@ -40,9 +41,6 @@ #include <JavaScriptCore/Assertions.h> #include <JavaScriptCore/JavaScriptCore.h> #include <JavaScriptCore/JSRetainPtr.h> -#include <WebKit/IWebHistory.h> -#include <WebKit/IWebPreferencesPrivate.h> -#include <WebKit/IWebViewPrivate.h> #include <WebKit/WebKit.h> #include <string> #include <CoreFoundation/CoreFoundation.h> @@ -352,9 +350,10 @@ static bool followShortcuts(wstring& path) return true; // Do we have a shortcut? - path.append(TEXT(".lnk")); - if (!PathFileExists(path.c_str())) - return false; + wstring linkPath = path; + linkPath.append(TEXT(".lnk")); + if (!PathFileExists(linkPath.c_str())) + return true; // We have a shortcut, find its target. COMPtr<IShellLink> shortcut(Create, CLSID_ShellLink); @@ -363,7 +362,7 @@ static bool followShortcuts(wstring& path) COMPtr<IPersistFile> persistFile(Query, shortcut); if (!shortcut) return false; - if (FAILED(persistFile->Load(path.c_str(), STGM_READ))) + if (FAILED(persistFile->Load(linkPath.c_str(), STGM_READ))) return false; if (FAILED(shortcut->Resolve(0, 0))) return false; @@ -391,7 +390,7 @@ static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath) DWORD rootPathSize = _countof(rootPath); DWORD keyType; DWORD result = ::SHGetValueW(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/"), TEXT("native"), &keyType, &rootPath, &rootPathSize); - + if (result != ERROR_SUCCESS || keyType != REG_SZ) return false; @@ -509,6 +508,45 @@ void LayoutTestController::setWindowIsKey(bool flag) ::SendMessage(webViewWindow, flag ? WM_SETFOCUS : WM_KILLFOCUS, (WPARAM)::GetDesktopWindow(), 0); } +void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +{ + COMPtr<IWebView> webView; + if (FAILED(frame->webView(&webView))) + return; + + COMPtr<IWebViewEditing> viewEditing; + if (FAILED(webView->QueryInterface(&viewEditing))) + return; + + viewEditing->setSmartInsertDeleteEnabled(flag ? TRUE : FALSE); +} + +void LayoutTestController::setJavaScriptProfilingEnabled(bool flag) +{ + COMPtr<IWebView> webView; + if (FAILED(frame->webView(&webView))) + return; + + COMPtr<IWebViewPrivate> viewPrivate; + if (FAILED(webView->QueryInterface(&viewPrivate))) + return; + + COMPtr<IWebPreferences> preferences; + if (FAILED(webView->preferences(&preferences))) + return; + + COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences); + if (!prefsPrivate) + return; + + COMPtr<IWebInspector> inspector; + if (FAILED(viewPrivate->inspector(&inspector))) + return; + + prefsPrivate->setDeveloperExtrasEnabled(flag); + inspector->setJavaScriptProfilingEnabled(flag); +} + static const CFTimeInterval waitToDumpWatchdogInterval = 10.0; static void waitUntilDoneWatchdogFired(CFRunLoopTimerRef timer, void* info) @@ -534,6 +572,32 @@ int LayoutTestController::windowCount() return openWindows().size(); } +bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +{ + COMPtr<IDOMDocument> document; + if (FAILED(frame->DOMDocument(&document))) + return false; + + wstring idWstring = jsStringRefToWString(id); + BSTR idBSTR = SysAllocStringLen((OLECHAR*)idWstring.c_str(), idWstring.length()); + COMPtr<IDOMElement> element; + HRESULT result = document->getElementById(idBSTR, &element); + SysFreeString(idBSTR); + + if (FAILED(result)) + return false; + + COMPtr<IWebFramePrivate> framePrivate(Query, frame); + if (!framePrivate) + return false; + + BOOL autoCompletes; + if (FAILED(framePrivate->elementDoesAutoComplete(element.get(), &autoCompletes))) + return false; + + return autoCompletes; +} + void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) { wstring wName = jsStringRefToWString(name); @@ -554,3 +618,13 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) SysFreeString(nameBSTR); SysFreeString(valueBSTR); } + +void LayoutTestController::clearAllDatabases() +{ + printf("ERROR: LayoutTestController::clearAllDatabases() not implemented\n"); +} + +void LayoutTestController::setDatabaseQuota(unsigned long long quota) +{ + printf("ERROR: LayoutTestController::setDatabaseQuota() not implemented\n"); +} diff --git a/WebKitTools/DumpRenderTree/win/MD5.cpp b/WebKitTools/DumpRenderTree/win/MD5.cpp index 4d4c848..1bfc9c7 100644 --- a/WebKitTools/DumpRenderTree/win/MD5.cpp +++ b/WebKitTools/DumpRenderTree/win/MD5.cpp @@ -26,6 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" #include "MD5.h" #include <windows.h> diff --git a/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp b/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp index f6dd82d..d0b79e1 100644 --- a/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp +++ b/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp @@ -26,14 +26,15 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "PixelDumpSupportCG.h" +#include "DumpRenderTree.h" #include <CoreGraphics/CGBitmapContext.h> #include <wtf/Assertions.h> #include <wtf/RetainPtr.h> -RetainPtr<CGContextRef> getBitmapContextFromWebView() +PassRefPtr<BitmapContext> getBitmapContextFromWebView(bool onscreen, bool incrementalRepaint, bool sweepHorizontally, bool drawSelectionRect) { RECT frame; if (!GetWindowRect(webViewWindow, &frame)) @@ -47,8 +48,6 @@ RetainPtr<CGContextRef> getBitmapContextFromWebView() bmp.bmiHeader.biBitCount = 32; bmp.bmiHeader.biCompression = BI_RGB; - // FIXME: Currently we leak this HBITMAP because we don't have a good way - // to destroy it when the CGBitmapContext gets destroyed. void* bits = 0; HBITMAP bitmap = CreateDIBSection(0, &bmp, DIB_RGB_COLORS, &bits, 0, 0); @@ -62,6 +61,8 @@ RetainPtr<CGContextRef> getBitmapContextFromWebView() ASSERT(info.bmBitsPixel == 32); RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); - return RetainPtr<CGContextRef>(AdoptCF, CGBitmapContextCreate(info.bmBits, info.bmWidth, info.bmHeight, 8, - info.bmWidthBytes, colorSpace.get(), kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst)); + CGContextRef context = CGBitmapContextCreate(info.bmBits, info.bmWidth, info.bmHeight, 8, + info.bmWidthBytes, colorSpace.get(), kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst); + + return BitmapContext::createByAdoptingBitmapAndContext(bitmap, context); } diff --git a/WebKitTools/DumpRenderTree/win/PolicyDelegate.cpp b/WebKitTools/DumpRenderTree/win/PolicyDelegate.cpp index c6a9fb0..99a1fd7 100644 --- a/WebKitTools/DumpRenderTree/win/PolicyDelegate.cpp +++ b/WebKitTools/DumpRenderTree/win/PolicyDelegate.cpp @@ -26,9 +26,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "PolicyDelegate.h" +#include "DumpRenderTree.h" + #include <string> using std::wstring; diff --git a/WebKitTools/DumpRenderTree/win/PolicyDelegate.h b/WebKitTools/DumpRenderTree/win/PolicyDelegate.h index d59dd9d..b9844f4 100644 --- a/WebKitTools/DumpRenderTree/win/PolicyDelegate.h +++ b/WebKitTools/DumpRenderTree/win/PolicyDelegate.h @@ -29,7 +29,7 @@ #ifndef PolicyDelegate_h #define PolicyDelegate_h -#include <WebKit/IWebPolicyDelegate.h> +#include <WebKit/WebKit.h> class PolicyDelegate : public IWebPolicyDelegate { public: diff --git a/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp b/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp index 0f15648..1e77eda 100644 --- a/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp +++ b/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp @@ -26,9 +26,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "ResourceLoadDelegate.h" +#include "DumpRenderTree.h" #include "LayoutTestController.h" #include <wtf/HashMap.h> #include <wtf/Vector.h> @@ -194,7 +195,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::identifierForInitialRequest( /* [in] */ IWebDataSource* dataSource, /* [in] */ unsigned long identifier) { - if (!done && layoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { BSTR urlStr; if (FAILED(request->URL(&urlStr))) return E_FAIL; @@ -213,7 +214,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::willSendRequest( /* [in] */ IWebDataSource* dataSource, /* [retval][out] */ IWebURLRequest **newRequest) { - if (!done && layoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { printf("%S - willSendRequest %S redirectResponse %S\n", descriptionSuitableForTestResult(identifier).c_str(), descriptionSuitableForTestResult(request).c_str(), @@ -230,7 +231,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didFinishLoadingFromDataSource( /* [in] */ unsigned long identifier, /* [in] */ IWebDataSource* dataSource) { - if (!done && layoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { printf("%S - didFinishLoading\n", descriptionSuitableForTestResult(identifier).c_str()), urlMap().remove(identifier); @@ -245,7 +246,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didFailLoadingWithError( /* [in] */ IWebError* error, /* [in] */ IWebDataSource* dataSource) { - if (!done && layoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { printf("%S - didFailLoadingWithError: %S\n", descriptionSuitableForTestResult(identifier).c_str(), descriptionSuitableForTestResult(error, identifier).c_str()); diff --git a/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.h b/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.h index 519ee64..e259adc 100644 --- a/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.h +++ b/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.h @@ -29,7 +29,7 @@ #ifndef ResourceLoadDelegate_h #define ResourceLoadDelegate_h -#include <WebKit/IWebResourceLoadDelegate.h> +#include <WebKit/WebKit.h> class ResourceLoadDelegate : public IWebResourceLoadDelegate { public: diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj index 0bc77f6..eced57e 100644 --- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj +++ b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8,00"
+ Version="8.00"
Name="TestNetscapePlugin"
ProjectGUID="{C0737398-3565-439E-A2B8-AB2BE4D5430C}"
RootNamespace="TestNetscapePlugin"
@@ -23,6 +23,7 @@ >
<Tool
Name="VCPreBuildEventTool"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"
"
/>
<Tool
Name="VCCustomBuildTool"
@@ -38,7 +39,7 @@ />
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(ProjectDir)..\..\TestNetscapePlugin.subproj""
+ AdditionalIncludeDirectories=""$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(ProjectDir)..\..\TestNetscapePlugin.subproj";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility""
PreprocessorDefinitions="_USRDLL;TESTNETSCAPEPLUGIN_EXPORTS;snprintf=_snprintf"
/>
<Tool
@@ -79,6 +80,7 @@ />
<Tool
Name="VCPostBuildEventTool"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed""
/>
</Configuration>
<Configuration
@@ -90,6 +92,7 @@ >
<Tool
Name="VCPreBuildEventTool"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"
"
/>
<Tool
Name="VCCustomBuildTool"
@@ -105,7 +108,7 @@ />
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(ProjectDir)..\..\TestNetscapePlugin.subproj""
+ AdditionalIncludeDirectories=""$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(ProjectDir)..\..\TestNetscapePlugin.subproj";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility""
PreprocessorDefinitions="_USRDLL;TESTNETSCAPEPLUGIN_EXPORTS;snprintf=_snprintf"
/>
<Tool
@@ -146,6 +149,7 @@ />
<Tool
Name="VCPostBuildEventTool"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed""
/>
</Configuration>
<Configuration
@@ -156,6 +160,7 @@ >
<Tool
Name="VCPreBuildEventTool"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%
if exist "$(WebKitOutputDir)\buildfailed" grep XX$(ProjectName)XX "$(WebKitOutputDir)\buildfailed"
if errorlevel 1 exit 1
echo XX$(ProjectName)XX > "$(WebKitOutputDir)\buildfailed"
"
/>
<Tool
Name="VCCustomBuildTool"
@@ -171,7 +176,7 @@ />
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(ProjectDir)..\..\TestNetscapePlugin.subproj""
+ AdditionalIncludeDirectories=""$(WebKitOutputDir)\Include";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(ProjectDir)..\..\TestNetscapePlugin.subproj";"$(WebKitLibrariesDir)\include";"$(WebKitLibrariesDir)\include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility""
PreprocessorDefinitions="_USRDLL;TESTNETSCAPEPLUGIN_EXPORTS;snprintf=_snprintf"
RuntimeLibrary="3"
/>
@@ -213,6 +218,7 @@ />
<Tool
Name="VCPostBuildEventTool"
+ CommandLine="if exist "$(WebKitOutputDir)\buildfailed" del "$(WebKitOutputDir)\buildfailed""
/>
</Configuration>
</Configurations>
diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.c b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.c index 8c542ed..829a32c 100644 --- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.c +++ b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.c @@ -1,34 +1,26 @@ /* - IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in - consideration of your agreement to the following terms, and your use, installation, - modification or redistribution of this Apple software constitutes acceptance of these - terms. If you do not agree with these terms, please do not use, install, modify or - redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject to these - terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in - this original Apple software (the "Apple Software"), to use, reproduce, modify and - redistribute the Apple Software, with or without modifications, in source and/or binary - forms; provided that if you redistribute the Apple Software in its entirety and without - modifications, you must retain this notice and the following text and disclaimers in all - such redistributions of the Apple Software. Neither the name, trademarks, service marks - or logos of Apple Computer, Inc. may be used to endorse or promote products derived from - the Apple Software without specific prior written permission from Apple. Except as expressly - stated in this notice, no other rights or licenses, express or implied, are granted by Apple - herein, including but not limited to any patent rights that may be infringed by your - derivative works or by other works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, - EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS - USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, - REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND - WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR - OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * Copyright (C) 2007 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. ``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 + * 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. */ #include "PluginObject.h" diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp index 8c542ed..ab54872 100644 --- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp +++ b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp @@ -76,12 +76,14 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch { if (browser->version >= 14) { PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass()); - - obj->onStreamLoad = NULL; for (int16 i = 0; i < argc; i++) { if (_stricmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad) obj->onStreamLoad = _strdup(argv[i]); + else if (_stricmp(argn[i], "onStreamDestroy") == 0 && !obj->onStreamDestroy) + obj->onStreamDestroy = _strdup(argv[i]); + else if (_stricmp(argn[i], "onURLNotify") == 0 && !obj->onURLNotify) + obj->onURLNotify = _strdup(argv[i]); } instance->pdata = obj; @@ -96,7 +98,13 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save) if (obj) { if (obj->onStreamLoad) free(obj->onStreamLoad); - + + if (obj->onURLNotify) + free(obj->onURLNotify); + + if (obj->onStreamDestroy) + free(obj->onStreamDestroy); + if (obj->logDestroy) printf("PLUGIN: NPP_Destroy\n"); @@ -110,30 +118,43 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window) return NPERR_NO_ERROR; } +static void executeScript(const PluginObject* obj, const char* script) +{ + NPObject *windowScriptObject; + browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); + + NPString npScript; + npScript.UTF8Characters = script; + npScript.UTF8Length = strlen(script); + + NPVariant browserResult; + browser->evaluate(obj->npp, windowScriptObject, &npScript, &browserResult); + browser->releasevariantvalue(&browserResult); +} + NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, uint16 *stype) { PluginObject* obj = (PluginObject*)instance->pdata; + + if (obj->returnErrorFromNewStream) + return NPERR_GENERIC_ERROR; + obj->stream = stream; *stype = NP_ASFILEONLY; - if (obj->onStreamLoad) { - NPObject *windowScriptObject; - browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject); - - NPString script; - script.UTF8Characters = obj->onStreamLoad; - script.UTF8Length = strlen(obj->onStreamLoad); - - NPVariant browserResult; - browser->evaluate(obj->npp, windowScriptObject, &script, &browserResult); - browser->releasevariantvalue(&browserResult); - } + if (obj->onStreamLoad) + executeScript(obj, obj->onStreamLoad); return NPERR_NO_ERROR; } NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason) { + PluginObject* obj = (PluginObject*)instance->pdata; + + if (obj->onStreamDestroy) + executeScript(obj, obj->onStreamDestroy); + return NPERR_NO_ERROR; } @@ -168,6 +189,9 @@ int16 NPP_HandleEvent(NPP instance, void *event) void NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyData) { PluginObject *obj = (PluginObject*)instance->pdata; + + if (obj->onURLNotify) + executeScript(obj, obj->onURLNotify); handleCallback(obj, url, reason, notifyData); } diff --git a/WebKitTools/DumpRenderTree/win/UIDelegate.cpp b/WebKitTools/DumpRenderTree/win/UIDelegate.cpp index 750e67a..a2532a5 100755 --- a/WebKitTools/DumpRenderTree/win/UIDelegate.cpp +++ b/WebKitTools/DumpRenderTree/win/UIDelegate.cpp @@ -26,9 +26,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "UIDelegate.h" +#include "DumpRenderTree.h" #include "DraggingInfo.h" #include "EventSender.h" #include "LayoutTestController.h" @@ -38,8 +39,7 @@ #include <wtf/Vector.h> #include <JavaScriptCore/Assertions.h> #include <JavaScriptCore/JavaScriptCore.h> -#include <WebKit/IWebFramePrivate.h> -#include <WebKit/IWebViewPrivate.h> +#include <WebKit/WebKit.h> #include <stdio.h> using std::wstring; @@ -322,6 +322,18 @@ HRESULT STDMETHODCALLTYPE UIDelegate::runJavaScriptTextInputPanelWithPrompt( return S_OK; } +HRESULT STDMETHODCALLTYPE UIDelegate::runBeforeUnloadConfirmPanelWithMessage( + /* [in] */ IWebView* /*sender*/, + /* [in] */ BSTR /*message*/, + /* [in] */ IWebFrame* /*initiatedByFrame*/, + /* [retval][out] */ BOOL* result) +{ + if (!result) + return E_POINTER; + *result = TRUE; + return E_NOTIMPL; +} + HRESULT STDMETHODCALLTYPE UIDelegate::webViewAddMessageToConsole( /* [in] */ IWebView* sender, /* [in] */ BSTR message, @@ -374,13 +386,13 @@ HRESULT STDMETHODCALLTYPE UIDelegate::createWebViewWithRequest( /* [in] */ IWebURLRequest *request, /* [retval][out] */ IWebView **newWebView) { - if (!::layoutTestController->canOpenWindows()) + if (!::gLayoutTestController->canOpenWindows()) return E_FAIL; *newWebView = createWebViewAndOffscreenWindow(); return S_OK; } -HRESULT STDMETHODCALLTYPE UIDelegate::webViewClose( +HRESULT STDMETHODCALLTYPE UIDelegate::webViewClose( /* [in] */ IWebView *sender) { HWND hostWindow; @@ -389,6 +401,22 @@ HRESULT STDMETHODCALLTYPE UIDelegate::webViewClose( return S_OK; } +HRESULT STDMETHODCALLTYPE UIDelegate::webViewFocus( + /* [in] */ IWebView *sender) +{ + HWND hostWindow; + sender->hostWindow(reinterpret_cast<OLE_HANDLE*>(&hostWindow)); + SetForegroundWindow(hostWindow); + return S_OK; +} + +HRESULT STDMETHODCALLTYPE UIDelegate::webViewUnfocus( + /* [in] */ IWebView *sender) +{ + SetForegroundWindow(GetDesktopWindow()); + return S_OK; +} + HRESULT STDMETHODCALLTYPE UIDelegate::webViewPainted( /* [in] */ IWebView *sender) { @@ -406,3 +434,11 @@ HRESULT STDMETHODCALLTYPE UIDelegate::exceededDatabaseQuota( return S_OK; } + + +HRESULT STDMETHODCALLTYPE UIDelegate::setStatusText(IWebView*, BSTR text) +{ + if (gLayoutTestController->dumpStatusCallbacks()) + printf("UI DELEGATE STATUS CALLBACK: setStatusText:%S\n", text ? text : L""); + return S_OK; +} diff --git a/WebKitTools/DumpRenderTree/win/UIDelegate.h b/WebKitTools/DumpRenderTree/win/UIDelegate.h index 1699c33..2113957 100755 --- a/WebKitTools/DumpRenderTree/win/UIDelegate.h +++ b/WebKitTools/DumpRenderTree/win/UIDelegate.h @@ -29,8 +29,7 @@ #ifndef UIDelegate_h #define UIDelegate_h -#include <WebKit/IWebUIDelegate.h> -#include <WebKit/IWebUIDelegatePrivate.h> +#include <WebKit/WebKit.h> #include <wtf/OwnPtr.h> #include <windef.h> @@ -60,10 +59,10 @@ public: /* [in] */ IWebView *sender); virtual HRESULT STDMETHODCALLTYPE webViewFocus( - /* [in] */ IWebView *sender) { return E_NOTIMPL; } + /* [in] */ IWebView *sender); virtual HRESULT STDMETHODCALLTYPE webViewUnfocus( - /* [in] */ IWebView *sender) { return E_NOTIMPL; } + /* [in] */ IWebView *sender); virtual HRESULT STDMETHODCALLTYPE webViewFirstResponder( /* [in] */ IWebView *sender, @@ -75,7 +74,7 @@ public: virtual HRESULT STDMETHODCALLTYPE setStatusText( /* [in] */ IWebView *sender, - /* [in] */ BSTR text) { return E_NOTIMPL; } + /* [in] */ BSTR text); virtual HRESULT STDMETHODCALLTYPE webViewStatusText( /* [in] */ IWebView *sender, @@ -140,7 +139,7 @@ public: /* [in] */ IWebView *sender, /* [in] */ BSTR message, /* [in] */ IWebFrame *initiatedByFrame, - /* [retval][out] */ BOOL *result) { return E_NOTIMPL; } + /* [retval][out] */ BOOL *result); virtual HRESULT STDMETHODCALLTYPE runOpenPanelForFileButtonWithResultListener( /* [in] */ IWebView *sender, @@ -254,6 +253,11 @@ protected: virtual HRESULT STDMETHODCALLTYPE webViewResizerRect( /* [in] */ IWebView *sender, /* [retval][out] */ RECT *rect) { return E_NOTIMPL; } + + virtual HRESULT STDMETHODCALLTYPE webViewSendResizeMessage( + /* [in] */ UINT uMsg, + /* [in] */ WPARAM wParam, + /* [in] */ LPARAM lParam) { return E_NOTIMPL; } virtual HRESULT STDMETHODCALLTYPE webViewDrawResizer( /* [in] */ IWebView *sender, diff --git a/WebKitTools/DumpRenderTree/win/WorkQueueItemWin.cpp b/WebKitTools/DumpRenderTree/win/WorkQueueItemWin.cpp index 1a2924f..a489498 100644 --- a/WebKitTools/DumpRenderTree/win/WorkQueueItemWin.cpp +++ b/WebKitTools/DumpRenderTree/win/WorkQueueItemWin.cpp @@ -26,13 +26,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "DumpRenderTree.h" +#include "config.h" #include "WorkQueueItem.h" +#include "DumpRenderTree.h" #include <WebCore/COMPtr.h> -#include <WebKit/IWebFrame.h> -#include <WebKit/IWebURLRequest.h> -#include <WebKit/IWebView.h> #include <WebKit/WebKit.h> #include <JavaScriptCore/JSStringRef.h> #include <JavaScriptCore/JSStringRefCF.h> diff --git a/WebKitTools/FindSafari/FindSafari.cpp b/WebKitTools/FindSafari/FindSafari.cpp index bc31eda..616323b 100644 --- a/WebKitTools/FindSafari/FindSafari.cpp +++ b/WebKitTools/FindSafari/FindSafari.cpp @@ -26,6 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "resource.h" + #include <shlwapi.h> #include <stdio.h> #include <tchar.h> @@ -120,6 +122,62 @@ static TCHAR* getInstalledWebKitDirectory() return webKitPath; } +static char* copyManifest(HMODULE module, LPCTSTR id) +{ + HRSRC resHandle = FindResource(module, id, MAKEINTRESOURCE(RT_MANIFEST)); + if (!resHandle) + return 0; + DWORD manifestSize = SizeofResource(module, resHandle); + if (!manifestSize) + return 0; + HGLOBAL resData = LoadResource(module, resHandle); + if (!resData) + return 0; + void* data = LockResource(resData); + if (!data) + return 0; + + char* dataCopy = static_cast<char*>(malloc(manifestSize + 1)); + if (!dataCopy) + return 0; + memcpy(dataCopy, data, manifestSize); + dataCopy[manifestSize] = 0; + return dataCopy; +} + +static void replaceManifest() +{ + TCHAR safariPath[MAX_PATH]; + ::ExpandEnvironmentStrings(TEXT("%TMP%\\WebKitNightly\\Safari.exe"), safariPath, ARRAYSIZE(safariPath)); + + // get the existing manifest out of Safari.exe + HMODULE safariModule = LoadLibraryEx(safariPath, 0, LOAD_LIBRARY_AS_DATAFILE); + if (!safariModule) + return; + char* safariManifest = copyManifest(safariModule, MAKEINTRESOURCE(1)); + FreeLibrary(safariModule); + if (!safariManifest) + return; + + // see if the existing Safari manifest contains registry free COM info + // (we only need to update if it is not registry free COM-aware) + bool needsUpdate = !strstr(safariManifest, "<comClass"); + free(safariManifest); + if (!needsUpdate) + return; + + // replace the manifest with the extra manifest stashed in FindSafar.exe (ID 100) + char* replacementManifest = copyManifest(0, MAKEINTRESOURCE(IDR_SAFARI_MANIFEST)); + if (!replacementManifest) + return; + if (HANDLE h = BeginUpdateResource(safariPath, FALSE)) { + UpdateResource(h, MAKEINTRESOURCE(RT_MANIFEST), MAKEINTRESOURCE(1), MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), replacementManifest, strlen(replacementManifest)); + EndUpdateResource(h, FALSE); + } + + free(replacementManifest); +} + int _tmain(int argc, TCHAR* argv[]) { TCHAR* path = getInstalledWebKitDirectory(); @@ -131,6 +189,7 @@ int _tmain(int argc, TCHAR* argv[]) bool printLauncher = false; bool printEnvironment = false; bool debugger = false; + bool updateManifest = false; for (int i = 1; i < argc; ++i) { if (!_tcscmp(argv[i], TEXT("/printSafariLauncher"))) { @@ -145,6 +204,16 @@ int _tmain(int argc, TCHAR* argv[]) debugger = true; continue; } + + if (!_tcscmp(argv[i], TEXT("/updateManifest"))) { + updateManifest = true; + continue; + } + } + + if (updateManifest) { + replaceManifest(); + return 0; } // printLauncher is inclusive of printEnvironment, so do not @@ -160,13 +229,20 @@ int _tmain(int argc, TCHAR* argv[]) LPCTSTR lines[] = { TEXT("@echo off"), + TEXT("del /s /q \"%%TMP%%\\WebKitNightly\""), TEXT("mkdir 2>NUL \"%%TMP%%\\WebKitNightly\\Safari.resources\""), + TEXT("mkdir 2>NUL \"%%TMP%%\\WebKitNightly\\WebKit.resources\""), TEXT("xcopy /y /i /d \"%sSafari.exe\" \"%%TMP%%\\WebKitNightly\""), TEXT("xcopy /y /i /d /e \"%sSafari.resources\" \"%%TMP%%\\WebKitNightly\\Safari.resources\""), + TEXT("xcopy /y /i /d /e \"%splugins\" \"%%TMP%%\\WebKitNightly\\plugins\""), + TEXT("xcopy /y /i /d WebKit.dll \"%%TMP%%\\WebKitNightly\""), + TEXT("xcopy /y /i /d WebKit.pdb \"%%TMP%%\\WebKitNightly\""), + TEXT("xcopy /y /i /d /e WebKit.resources \"%%TMP%%\\WebKitNightly\\WebKit.resources\""), + TEXT("FindSafari.exe /updateManifest"), TEXT("set PATH=%%CD%%;%s;%%PATH%%"), }; - LPCTSTR command = TEXT("\"%TMP%\\WebKitNightly\\Safari.exe\" /customWebKit"); + LPCTSTR command = TEXT("\"%TMP%\\WebKitNightly\\Safari.exe\""); LPCTSTR launchLines[] = { TEXT("%s"), @@ -194,7 +270,7 @@ int _tmain(int argc, TCHAR* argv[]) _tprintf(TEXT("\n")); } } - + free(path); return 0; } diff --git a/WebKitTools/FindSafari/FindSafari.rc b/WebKitTools/FindSafari/FindSafari.rc new file mode 100644 index 0000000..20c2da2 --- /dev/null +++ b/WebKitTools/FindSafari/FindSafari.rc @@ -0,0 +1,70 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// RT_MANIFEST +// + +IDR_SAFARI_MANIFEST RT_MANIFEST "Safari.exe.manifest" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/WebKitTools/FindSafari/FindSafari.vcproj b/WebKitTools/FindSafari/FindSafari.vcproj index 4e89cd0..48ea3df 100644 --- a/WebKitTools/FindSafari/FindSafari.vcproj +++ b/WebKitTools/FindSafari/FindSafari.vcproj @@ -15,74 +15,10 @@ </ToolFiles>
<Configurations>
<Configuration
- Name="Debug|Win32"
- ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="shlwapi.lib advapi32.lib ole32.lib"
- SubSystem="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
CharacterSet="1"
- WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
@@ -114,6 +50,7 @@ <Tool
Name="VCLinkerTool"
AdditionalDependencies="shlwapi.lib advapi32.lib ole32.lib"
+ OutputFile="$(OutDir)\$(ProjectName).exe"
SubSystem="1"
/>
<Tool
@@ -160,12 +97,20 @@ Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
+ <File
+ RelativePath=".\FindSafari.rc"
+ >
+ </File>
</Filter>
</Files>
<Globals>
diff --git a/WebKitTools/FindSafari/Safari.exe.manifest b/WebKitTools/FindSafari/Safari.exe.manifest new file mode 100644 index 0000000..08c85cf --- /dev/null +++ b/WebKitTools/FindSafari/Safari.exe.manifest @@ -0,0 +1,129 @@ +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
+ </dependentAssembly>
+ </dependency>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
+ </dependentAssembly>
+ </dependency>
+ <file name="WebKit" hashalg="SHA1">
+ <comClass progid="OpenSourceWebKit.WebView" clsid="{D6BCA079-F61C-4E1E-B453-32A0477D02E3}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebIconDatabase" clsid="{66827EC1-3AEF-4241-BAC5-F776B44F030F}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebMutableURLRequest" clsid="{A062ECC3-BB1B-4694-A569-F59E0AD6BE0C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebNotificationCenter" clsid="{BA590766-0A6F-46C7-B96E-743490D94CB7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebHistory" clsid="{A4B9B45D-949F-4C8C-9B92-6FBFCC1CAAA2}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.CFDictionaryPropertyBag" clsid="{DD653964-4D37-4FB2-9CB6-6A9A97719332}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebHistoryItem" clsid="{6BE190E9-1725-4E4A-88DB-6A9FE242C9E5}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebCache" clsid="{F71071FD-A51B-4B69-9EB6-44374405E80C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebJavaScriptCollector" clsid="{1820D883-42FE-4B78-88C8-5456BB19D224}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebPreferences" clsid="{67B89F90-F778-438B-ABBF-34D1ACBF8651}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebKitStatistics" clsid="{E93AA8D7-F362-4A4A-A95D-325906BEB5F0}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebError" clsid="{6C6AF3F9-36B4-4BF7-8BDE-74DCD4AD75A4}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebURLCredential" clsid="{7433F53B-7FE9-484A-9432-72909457A646}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebDownload" clsid="{C0F98BD9-3B1C-413D-904A-E2D1453EAF1F}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebURLRequest" clsid="{2FB5499A-BB5D-4469-8517-789FEC8FD9BA}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebURLProtectionSpace" clsid="{F366A6E8-E43C-4FD4-AAB0-8E6E79C73E6E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebScrollBar" clsid="{24A53AD5-AA9F-44E6-AA22-2C7C250B661A}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebScriptDebugServer" clsid="{715636C4-59E7-4B85-BBC5-B555888787D7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebURLResponse" clsid="{AB201196-8DD2-4D45-AEBD-029B6A37AA27}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebTextRenderer" clsid="{24040CD6-AFF4-4A51-9C8B-71539580EE76}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebDatabaseManager" clsid="{C2A1BFC2-1E7C-49FE-8592-D0C7FB440BC0}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebArchive" clsid="{1B63D781-9BC4-4A04-899F-C4B05BBD3BE5}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebCoreStatistics" clsid="{96B93356-9D61-4B3F-A6CF-A78283AC9649}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <comClass progid="OpenSourceWebKit.WebCookieManager" clsid="{3F35F332-BB2B-49B3-AEDD-27B317687E07}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}"></comClass>
+ <typelib tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" version="528.0" helpdir="" flags="HASDISKIMAGE"></typelib>
+ </file>
+ <comInterfaceExternalProxyStub name="IWebView" iid="{174BBEFD-058E-49C7-91DF-6F110AA4AC28}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebUIDelegate" iid="{2452A889-A74A-4FBC-9617-326A0A953630}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLRequest" iid="{F4B85F1D-F3B2-493D-B786-0930E804A3BA}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFrame" iid="{B4B22EF7-DD43-4D01-A992-99C4A8B1F845}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFrameView" iid="{E23E1B15-78F6-4E89-AD2E-49992A040A35}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDocumentView" iid="{0A6397A7-90FE-49A0-B9C1-44693DD779F7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDataSource" iid="{5221A975-AE09-4A7B-A4DF-E3B1B5F38A21}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDocumentRepresentation" iid="{3C9F6251-CFD8-447A-B429-6B6AE627436C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebError" iid="{89E3B189-0B60-4D6B-A87A-3F1172CB5538}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebMutableURLRequest" iid="{C4042773-371F-427E-AFA9-9D4B358A0D93}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLResponse" iid="{9814930B-E037-4477-8DF1-4D898B648995}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebArchive" iid="{F07D5252-F66E-4A4D-B9DC-33BD11DCC138}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebResource" iid="{09567E0E-7859-494A-B0E4-92C13CFE5574}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMNode" iid="{3EEA3E20-72DA-4BE7-954F-79B5A14AD726}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMObject" iid="{A27FA225-F34E-425D-88EB-A35BD105A527}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScriptObject" iid="{7022340A-649C-43FC-9214-85CA7D3BE3C7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMNodeList" iid="{10A05A96-CBD9-4493-83AD-FAFB952615CE}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMNamedNodeMap" iid="{E6CBF396-C9F9-431B-A8D6-BCB525067E9F}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMDocument" iid="{A83C2C44-0BAC-45C7-8E17-6A49975D5CCA}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMDocumentType" iid="{17FCE6EA-4164-4BD4-9DBF-0395FBF37FD3}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMImplementation" iid="{6E48C25D-E542-4D1A-BC73-ACDC21E39C56}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMElement" iid="{E053A35B-7775-4859-80EA-C35D02D145A2}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMAttr" iid="{B587E098-8206-4B5A-A7DB-422F218571A0}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMDocumentFragment" iid="{09D35665-8396-4868-949E-8AA2407A6E10}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMText" iid="{74638F45-1AA0-4DB5-958C-82066E00BD2B}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCharacterData" iid="{F4DED047-FE61-461A-BDBD-BB87F79DB713}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMComment" iid="{118002E8-847F-4B1A-968C-B25A6AC7B128}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCDATASection" iid="{31B506C1-45A3-4D72-815A-311B0A897E58}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMProcessingInstruction" iid="{D99D2F48-ABF3-426A-9339-54681E1AFCA9}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMEntityReference" iid="{0593CE45-15B2-44AF-BBD0-5A1654F8240E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMHTMLElement" iid="{EBD5F41D-FF65-41D8-97C9-FCE3A3D4CC3E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebOpenPanelResultListener" iid="{634198C7-9DFC-4ABA-9E8C-90AEEA7A4144}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebUndoTarget" iid="{BF7F516E-E75D-4E3A-83E2-8F694D83C72D}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebResourceLoadDelegate" iid="{AF3289AA-90DB-4CA4-A112-A1E5F0517953}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLAuthenticationChallenge" iid="{5382DABA-C3C3-40C5-AA40-04079F11A844}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLAuthenticationChallengeSender" iid="{9360D6FB-186C-4FF7-AE57-D1B973DA0D1C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLCredential" iid="{A1E9D765-FACE-4189-BBE3-AED7EBF65EBD}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebURLProtectionSpace" iid="{71D2622A-3FF2-404B-BD45-C60659C901AF}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDownloadDelegate" iid="{16A32AE6-C862-40CD-9225-2CAF823F40F9}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDownload" iid="{65EFE83B-A9E4-4516-8F3B-BAA25DA90FFD}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFrameLoadDelegate" iid="{4CD809C2-73A5-44EE-B0D7-D1863DFE9F57}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebPolicyDelegate" iid="{9B0BAE6C-A496-4000-9E22-2E89F0747401}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebPolicyDecisionListener" iid="{DFCDE523-FD96-4F95-958B-151540FE122A}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebBackForwardList" iid="{C278A16D-B502-4131-B551-DCE3F4ED2B36}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebHistoryItem" iid="{1E2970AE-72B7-4500-A7A0-12B0FFEB91FC}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebPreferences" iid="{0930D594-A5A3-46E1-858E-AB17A13CD28E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebIBActions" iid="{8F0E3A30-B924-44F8-990A-1AE61ED6C632}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebViewCSS" iid="{ADF68A8C-336F-405C-A053-3D11A9D5B092}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCSSStyleDeclaration" iid="{DBBE9A6B-D505-4647-B4AB-40A7CF3EE63E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCSSValue" iid="{51D29553-2AF7-4F52-AFE6-3C59196A8BAA}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCSSRule" iid="{05947A31-9E1C-4C98-8608-6688959D6542}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCSSStyleSheet" iid="{14B1C213-1458-48A1-AD8F-54BFE64F9ECF}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMCSSRuleList" iid="{D45DA43D-5EDB-4315-A097-3ED3FA089193}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebViewEditing" iid="{07BDAC9A-19A1-4086-864D-BAD9E0F00D5C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMRange" iid="{2F33E42C-0B39-48B3-B7B6-E910CDB325AD}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebUndoManager" iid="{D25D748C-6C1E-478D-9832-FDA26E8F7EE4}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebInvocation" iid="{67B067BE-4DE6-45C2-AD39-A91DFA84FF4E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebMethodSignature" iid="{431DD6B2-56BF-4F48-943B-78CCEAC418E4}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebEditingDelegate" iid="{2C75A1E3-EE9D-45C8-A385-19DE68AC5675}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebNotification" iid="{93598207-3E34-49EC-97EC-EFA9A1E16335}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IEnumWebGrammarDetails" iid="{FABCC69A-5917-4242-A19A-42E8B62227A7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebGrammarDetail" iid="{8B95C1B3-E1B3-4F97-80D6-2240417E3E0C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IEnumSpellingGuesses" iid="{B0F960E7-FB81-447F-A958-E02DA02ADBB7}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebViewUndoableEditing" iid="{639E7121-13C8-4A12-BC18-6E1F3D68F3C3}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebViewEditingActions" iid="{7E066C42-8E81-4778-888D-D6CC93E27D4C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebNotificationObserver" iid="{1BA491C4-58A7-4091-9F56-9AED118DB4C1}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebViewPrivate" iid="{44914369-DEB5-4FCF-A6A3-30C02E73154F}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFormDelegate" iid="{4CBEC1BD-ABC3-4BDB-8E5E-4D3BCF9E8C1E}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMHTMLInputElement" iid="{80C40AC5-1755-4894-812F-479269C262A2}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IDOMHTMLTextAreaElement" iid="{298B02B7-3EB5-4BA4-AD3F-7FA53241AADE}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFormSubmissionListener" iid="{1911D650-035E-4204-8746-ABECF77A4C9B}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebFrameLoadDelegatePrivate" iid="{32DC2531-948D-400E-A82F-FE6668B61A0B}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IEnumTextMatches" iid="{C0CDE63A-5ED1-453F-B937-93B1A61AD3B3}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebInspector" iid="{68159FF1-9037-45EC-9992-B2E455CF39F3}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebIconDatabase" iid="{E93F2616-2560-47D9-BD4D-6E2F1E1D3174}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebNotificationCenter" iid="{1E411ABE-DAA0-4A83-BCCA-D94E0704F193}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebHistory" iid="{F34E4B1A-361D-4B9F-9A3F-D869DCD97F9A}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebCache" iid="{0673E6F5-AE63-4871-AAC6-6A1E0E6A99AB}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebJavaScriptCollector" iid="{E6A1D169-F44A-4D11-B55B-F0A406F47612}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebKitStatistics" iid="{955C1042-BCF7-4F51-8AE7-66C2D0D47C44}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScrollBarPrivate" iid="{6C585B08-2E4F-4594-9B90-0425E3A33FD0}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScrollBarDelegatePrivate" iid="{2E8D56AF-3BF5-4E17-BDA6-01692ACBE3D5}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScriptDebugServer" iid="{E24111D6-3668-4C8B-B921-D644524945F8}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScriptDebugListener" iid="{09612B56-BE17-4867-A441-1C5C4E0F5302}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebScriptCallFrame" iid="{029D0676-162A-4140-8917-9574E09F66EB}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebTextRenderer" iid="{5B26ABBB-C27A-4527-A313-CB733E2CD257}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebDatabaseManager" iid="{5724F010-A77B-4A42-8F89-A5095B61D469}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebSecurityOrigin" iid="{304D4462-A921-4E85-BC11-BCE1462B159D}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebCoreStatistics" iid="{9607001D-6EEF-4C2C-AD22-94E9DA587973}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+ <comInterfaceExternalProxyStub name="IWebCookieManager" iid="{7053FE94-3623-444F-A298-209A90879A8C}" tlbid="{2A748656-625D-4207-B29F-40C95BFEB3A9}" proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"></comInterfaceExternalProxyStub>
+</assembly>
\ No newline at end of file diff --git a/WebKitTools/FindSafari/resource.h b/WebKitTools/FindSafari/resource.h new file mode 100644 index 0000000..91d1053 --- /dev/null +++ b/WebKitTools/FindSafari/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by FindSafari.rc +// +#define IDR_SAFARI_MANIFEST 100 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/WebKitTools/GNUmakefile.am b/WebKitTools/GNUmakefile.am index e42a064..ee403a9 100644 --- a/WebKitTools/GNUmakefile.am +++ b/WebKitTools/GNUmakefile.am @@ -5,46 +5,72 @@ noinst_PROGRAMS += \ # GtkLauncher Programs_GtkLauncher_CPPFLAGS = \ -I$(srcdir)/WebKit/gtk \ - $(global_cppflags) + -I$(top_builddir)/WebKit/gtk \ + $(global_cppflags) \ + $(javascriptcore_cppflags) Programs_GtkLauncher_SOURCES = \ WebKitTools/GtkLauncher/main.c Programs_GtkLauncher_CFLAGS = \ - $(DEPENDENCIES_CFLAGS) \ - $(global_cflags) + -fno-strict-aliasing \ + -O2 \ + $(global_cflags) \ + $(GTK_CFLAGS) Programs_GtkLauncher_LDADD = \ - $(DEPENDENCIES_LIBS) \ - libJavaScriptCore.la \ - libWebKitGtk.la - -Programs_GtkLauncher_LDFLAGS = -ljpeg -rpath $(CURDIR)/.libs + libwebkit-1.0.la \ + $(GTK_LIBS) # DumpRenderTree Programs_DumpRenderTree_CPPFLAGS = \ -I$(srcdir)/WebKitTools/DumpRenderTree \ -I$(srcdir)/WebKitTools/DumpRenderTree/gtk \ -I$(srcdir)/WebKit/gtk \ - $(global_cppflags) + -I$(top_builddir)/WebKit/gtk \ + $(global_cppflags) \ + $(javascriptcore_cppflags) Programs_DumpRenderTree_SOURCES = \ - WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp \ - WebKitTools/DumpRenderTree/LayoutTestController.cpp \ + WebKitTools/DumpRenderTree/AccessibilityController.h \ + WebKitTools/DumpRenderTree/AccessibilityUIElement.h \ + WebKitTools/DumpRenderTree/DumpRenderTree.h \ + WebKitTools/DumpRenderTree/DumpRenderTreePrefix.h \ WebKitTools/DumpRenderTree/GCController.cpp \ + WebKitTools/DumpRenderTree/GCController.h \ + WebKitTools/DumpRenderTree/JavaScriptThreading.h \ + WebKitTools/DumpRenderTree/LayoutTestController.cpp \ + WebKitTools/DumpRenderTree/LayoutTestController.h \ + WebKitTools/DumpRenderTree/PixelDumpSupport.h \ WebKitTools/DumpRenderTree/WorkQueue.cpp \ + WebKitTools/DumpRenderTree/WorkQueue.h \ + WebKitTools/DumpRenderTree/WorkQueueItem.h \ + WebKitTools/DumpRenderTree/config.h \ + WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp \ + WebKitTools/DumpRenderTree/gtk/DumpRenderTreeGtk.h \ WebKitTools/DumpRenderTree/gtk/GCControllerGtk.cpp \ WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp \ WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp Programs_DumpRenderTree_CXXFLAGS = \ - $(DEPENDENCIES_CFLAGS) \ $(global_cxxflags) \ - $(global_cflags) + $(Programs_DumpRenderTree_CFLAGS) + +Programs_DumpRenderTree_CFLAGS = \ + -fno-strict-aliasing \ + -O2 \ + $(global_cflags) \ + $(GLOBALDEPS_CFLAGS) \ + $(CAIRO_CFLAGS) \ + $(GTK_CFLAGS) Programs_DumpRenderTree_LDADD = \ - $(DEPENDENCIES_LIBS) \ - libJavaScriptCore.la \ - libWebKitGtk.la + libwebkit-1.0.la \ + $(GLOBALDEPS_LIBS) \ + $(CAIRO_LIBS) \ + $(GTK_LIBS) -Programs_DumpRenderTree_LDFLAGS = -rpath $(CURDIR)/.libs +# clean target +CLEANFILES += \ + Programs/GtkLauncher \ + Programs/DumpRenderTree diff --git a/WebKitTools/GtkLauncher/GtkLauncher.pro b/WebKitTools/GtkLauncher/GtkLauncher.pro deleted file mode 100644 index b8c4aa8..0000000 --- a/WebKitTools/GtkLauncher/GtkLauncher.pro +++ /dev/null @@ -1,10 +0,0 @@ -TEMPLATE = app -SOURCES += main.c -CONFIG -= app_bundle - -BASE_DIR = $$PWD/../.. - -include(../../WebKit.pri) - - -QMAKE_RPATHDIR += $$OUTPUT_DIR/lib diff --git a/WebKitTools/Makefile b/WebKitTools/Makefile index a0f946a..45bca06 100644 --- a/WebKitTools/Makefile +++ b/WebKitTools/Makefile @@ -1,4 +1,4 @@ -MODULES = Drosera DumpRenderTree +MODULES = DumpRenderTree all: @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \ @@ -7,15 +7,27 @@ all: debug d development dev develop: @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \ if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done - + release r deployment dep deploy: @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \ if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done universal u: - @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; if [ $$? -ne 0 ]; then break; fi; done + @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \ + if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done -clean: +x86_64: + @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \ + if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done + +64: @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \ if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done +64u: + @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \ + if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done + +clean: + @for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \ + if [ $$exit_status -ne 0 ]; then exit $$exit_status; fi; done diff --git a/WebKitTools/Scripts/VCSUtils.pm b/WebKitTools/Scripts/VCSUtils.pm index 26401f4..e09d331 100644 --- a/WebKitTools/Scripts/VCSUtils.pm +++ b/WebKitTools/Scripts/VCSUtils.pm @@ -111,11 +111,9 @@ sub makeFilePathRelative($) return $path unless isGit(); unless (defined $gitRoot) { - chomp($gitRoot = `git rev-parse --git-dir`); - $gitRoot =~ s/\.git$//; + chomp($gitRoot = `git rev-parse --show-cdup`); } - my $result = File::Spec->abs2rel(File::Spec->rel2abs($path, $gitRoot)); - return $result; + return $gitRoot . $path; } 1; diff --git a/WebKitTools/Scripts/bisect-builds b/WebKitTools/Scripts/bisect-builds index 43e3889..f77f81f 100755 --- a/WebKitTools/Scripts/bisect-builds +++ b/WebKitTools/Scripts/bisect-builds @@ -42,7 +42,7 @@ use strict; use File::Basename; use File::Path; use File::Spec; -use File::Temp; +use File::Temp qw(tempfile); use Getopt::Long; use Time::HiRes qw(usleep); @@ -204,13 +204,12 @@ sub createTempFile($) return undef if !$url; - my $fh = new File::Temp( + my ($fh, $tempFile) = tempfile( + basename($0) . "-XXXXXXXX", DIR => ($ENV{'TMPDIR'} || "/tmp"), SUFFIX => ".html", - TEMPLATE => basename($0) . "-XXXXXXXX", UNLINK => 0, ); - my $tempFile = $fh->filename(); print $fh "<meta http-equiv=\"refresh\" content=\"0; $url\">\n"; close($fh); @@ -319,7 +318,9 @@ sub makeNightlyList($$$$) } if (eval "v$macOSXVersion" ge v10.5) { - if (eval "v$safariVersion" ge v3.0) { + if (eval "v$safariVersion" ge v3.1) { + @files = grep { $_->{rev} >= 29711 } @files; + } elsif (eval "v$safariVersion" ge v3.0) { @files = grep { $_->{rev} >= 25124 } @files; } elsif (eval "v$safariVersion" ge v2.0) { @files = grep { $_->{rev} >= 19594 } @files; @@ -327,7 +328,9 @@ sub makeNightlyList($$$$) die "Requires Safari 2.0 or newer"; } } elsif (eval "v$macOSXVersion" ge v10.4) { - if (eval "v$safariVersion" ge v3.0) { + if (eval "v$safariVersion" ge v3.1) { + @files = grep { $_->{rev} >= 29711 } @files; + } elsif (eval "v$safariVersion" ge v3.0) { @files = grep { $_->{rev} >= 19992 } @files; } elsif (eval "v$safariVersion" ge v2.0) { @files = grep { $_->{rev} >= 11976 } @files; diff --git a/WebKitTools/Scripts/build-drosera b/WebKitTools/Scripts/build-drosera deleted file mode 100755 index f3b1144..0000000 --- a/WebKitTools/Scripts/build-drosera +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/perl -w - -# Copyright (C) 2006 Apple Computer, 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. -# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of -# its contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - -# Simplified build script for Web Kit Open Source Project. -# Modified copy of build-webkit. Perhaps these could share code. -# Currently only works for the Deployment build style. - -use strict; -use FindBin; -use lib $FindBin::Bin; -use webkitdirs; -use POSIX; - -checkRequiredSystemConfig(); -setConfiguration(); -chdirWebKit(); -my @options = XcodeOptions(); - -# Build -chdir "WebKitTools/Drosera/mac" or die; -my $result; -if (isOSX()) { - print "xcodebuild -project Drosera.xcodeproj ", join(" ", @options), "\n"; - $result = system "xcodebuild", "-project", "Drosera.xcodeproj", @options; -} else { - die "Building not defined for this platform!\n"; -} -exit exitStatus($result); diff --git a/WebKitTools/Scripts/build-dumprendertree b/WebKitTools/Scripts/build-dumprendertree index 7f48a59..a11481b 100755 --- a/WebKitTools/Scripts/build-dumprendertree +++ b/WebKitTools/Scripts/build-dumprendertree @@ -42,7 +42,7 @@ my @options = XcodeOptions(); chdir "WebKitTools/DumpRenderTree" or die; my $result; if (isOSX()) { - $result = system "xcodebuild", "-project", "DumpRenderTree.xcodeproj", @options; + $result = system "xcodebuild", "-project", "DumpRenderTree.xcodeproj", @options, @ARGV; } elsif (isCygwin()) { $result = buildVisualStudioProject("DumpRenderTree.sln"); } elsif (isQt() || isGtk()) { diff --git a/WebKitTools/Scripts/build-testkjs b/WebKitTools/Scripts/build-jsc index 5dc28ad..f258ea5 100755 --- a/WebKitTools/Scripts/build-testkjs +++ b/WebKitTools/Scripts/build-jsc @@ -42,7 +42,7 @@ my @options = XcodeOptions(); chdir "JavaScriptCore" or die "Can't find JavaScriptCore directory to build from"; my $result; if (isOSX()) { - $result = system "sh", "-c", 'xcodebuild -project JavaScriptCore.xcodeproj -target testkjs "$@" | grep -v setenv && exit ${PIPESTATUS[0]}', "xcodebuild", @options, @ARGV; + $result = system "sh", "-c", 'xcodebuild -project JavaScriptCore.xcodeproj -target jsc "$@" | grep -v setenv && exit ${PIPESTATUS[0]}', "xcodebuild", @options, @ARGV; } elsif (isCygwin()) { $result = buildVisualStudioProject("JavaScriptCore.vcproj/JavaScriptCore.sln"); } elsif (isQt() or isGtk() or isWx()) { diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit index 4cd8817..6ed3ddc 100755 --- a/WebKitTools/Scripts/build-webkit +++ b/WebKitTools/Scripts/build-webkit @@ -26,7 +26,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Simplified build script for Web Kit Open Source Project. +# Simplified build script for WebKit Open Source Project. use strict; use File::Basename; @@ -40,10 +40,12 @@ use POSIX; my $originalWorkingDirectory = getcwd(); my $databaseSupport = 1; +my $domStorageSupport = 1; my $iconDatabaseSupport = 1; +my $offlineWebApplicationSupport = 1; my $svgSupport = 1; my $svgExperimentalSupport = 0; -my $svgAnimationSupport = $svgExperimentalSupport; +my $svgAnimationSupport = 1; my $svgFiltersSupport = $svgExperimentalSupport; my $svgForeignObjectSupport = 1; my $svgUseSupport = 1; @@ -52,22 +54,30 @@ my $svgAsImageSupport = 1; my $xpathSupport = 1; my $xsltSupport = 1; my $coverageSupport = 0; -my $videoSupport = isOSX() || isCygwin(); # Enable by default on OSX and Windows +my $videoSupport = (isOSX() || isCygwin()); # Enable by default on OSX and Windows my $showHelp = 0; my $clean = 0; +my $buildUniversal = 0; +my $buildSixtyFourBit = 0; my $programName = basename($0); my $usage = <<EOF; Usage: $programName [options] [options to pass to build system] --help Show this help message + --cairo-win32 Build using Cairo (rather than CoreGraphics) on Windows + --clean Cleanup the build directory + --universal Build 2-way universal (PPC and Intel 32-bit) + --64-bit Build 64-bit, combine with --universal to build 4-way universal + --[no-]offline-web-applications Toggle Offline Web Application Support (default : $offlineWebApplicationSupport) --[no-]database Toggle Database Support (default: $databaseSupport) + --[no-]dom-storage Toggle DOM Storage Support (default: $domStorageSupport) --[no-]icon-database Toggle Icon database support (default: $iconDatabaseSupport) --[no-]svg Toggle SVG support (default: $svgSupport) --[no-]svg-experimental Toggle SVG experimental features support (default: $svgExperimentalSupport, implies SVG Support) --[no-]svg-animation Toggle SVG animation support (default: $svgAnimationSupport, implies SVG Support) --[no-]svg-filters Toggle SVG filters support (default: $svgFiltersSupport, implies SVG Support) - --[no-]svg-foreign-object Toggle SVG forgeing object support (default: $svgForeignObjectSupport, implies SVG Support) + --[no-]svg-foreign-object Toggle SVG foreign object support (default: $svgForeignObjectSupport, implies SVG Support) --[no-]svg-fonts Toggle SVG fonts support (default: $svgFontsSupport, implies SVG Support) --[no-]svg-as-image Toggle SVG as Image support (default: $svgAsImageSupport, implies SVG Support) --[no-]svg-use Toggle SVG use element support (default: $svgUseSupport, implies SVG Support) @@ -78,7 +88,9 @@ Usage: $programName [options] [options to pass to build system] EOF GetOptions('database!' => \$databaseSupport, + 'dom-storage!' => \$domStorageSupport, 'icon-database!' => \$iconDatabaseSupport, + 'offline-web-applications!' => \$offlineWebApplicationSupport, 'svg!' => \$svgSupport, 'svg-experimental!' => \$svgExperimentalSupport, 'svg-animation!' => \$svgAnimationSupport, @@ -92,6 +104,8 @@ GetOptions('database!' => \$databaseSupport, 'video!' => \$videoSupport, 'coverage!' => \$coverageSupport, 'help' => \$showHelp, + 'universal' => \$buildUniversal, + '64-bit' => \$buildSixtyFourBit, 'clean' => \$clean); if ($showHelp) { @@ -141,17 +155,19 @@ my $productDir = productDir(); my @overrideFeatureDefinesOption = (); push @overrideFeatureDefinesOption, "ENABLE_DATABASE" if $databaseSupport; +push @overrideFeatureDefinesOption, "ENABLE_DOM_STORAGE" if $domStorageSupport; push @overrideFeatureDefinesOption, "ENABLE_ICONDATABASE" if $iconDatabaseSupport; +push @overrideFeatureDefinesOption, "ENABLE_OFFLINE_WEB_APPLICATIONS" if $offlineWebApplicationSupport; push @overrideFeatureDefinesOption, "ENABLE_SVG" if $svgSupport; push @overrideFeatureDefinesOption, "ENABLE_SVG_ANIMATION" if $svgAnimationSupport; +push @overrideFeatureDefinesOption, "ENABLE_SVG_AS_IMAGE" if $svgAsImageSupport; push @overrideFeatureDefinesOption, "ENABLE_SVG_FILTERS" if $svgFiltersSupport; -push @overrideFeatureDefinesOption, "ENABLE_SVG_FOREIGN_OBJECT" if $svgForeignObjectSupport; push @overrideFeatureDefinesOption, "ENABLE_SVG_FONTS" if $svgFontsSupport; -push @overrideFeatureDefinesOption, "ENABLE_SVG_AS_IMAGE" if $svgAsImageSupport; +push @overrideFeatureDefinesOption, "ENABLE_SVG_FOREIGN_OBJECT" if $svgForeignObjectSupport; push @overrideFeatureDefinesOption, "ENABLE_SVG_USE" if $svgUseSupport; +push @overrideFeatureDefinesOption, "ENABLE_VIDEO" if $videoSupport; push @overrideFeatureDefinesOption, "ENABLE_XPATH" if $xpathSupport; push @overrideFeatureDefinesOption, "ENABLE_XSLT" if $xsltSupport; -push @overrideFeatureDefinesOption, "ENABLE_VIDEO" if $videoSupport; my $overrideFeatureDefinesString = "FEATURE_DEFINES=" . join(" ", @overrideFeatureDefinesOption); my @coverageSupportOption = (); @@ -179,10 +195,27 @@ if ($clean && isOSX()) { push(@options, "clean"); } +if ($buildSixtyFourBit && isOSX()) { + my $cpuVendor = `sysctl -n machdep.cpu.vendor`; + chomp $cpuVendor; + + if ($buildUniversal) { + push(@options, "ARCHS=ppc ppc64 i386 x86_64"); + } elsif ($cpuVendor eq "GenuineIntel") { + push(@options, "ARCHS=i386 x86_64"); + } else { + push(@options, "ARCHS=ppc ppc64"); + } +} elsif ($buildUniversal && isOSX()) { + push(@options, "ARCHS=ppc i386"); +} + # enable autotool options accordingly -if ($ENV{WEBKITAUTOTOOLS}) { +if (isGtk()) { push @options, autotoolsFlag($databaseSupport, "database"); + push @options, autotoolsFlag($domStorageSupport, "dom-storage"); push @options, autotoolsFlag($iconDatabaseSupport, "icon-database"); + push @options, autotoolsFlag($offlineWebApplicationSupport, "offline-web-applications"); push @options, autotoolsFlag($svgSupport, "svg"); push @options, autotoolsFlag($svgAnimationSupport, "svg-animation"); push @options, autotoolsFlag($svgFiltersSupport, "svg-filters"); @@ -241,12 +274,6 @@ if (isOSX()) { } } -if (isGtk() && isDarwin() && !$ENV{WEBKITAUTOTOOLS} && !$ENV{QMAKESPEC}) { - # The qmake from Trolltech's binary "QT for Mac" distribution tries to - # create xcode projects, not Makefiles - $ENV{QMAKESPEC} = "macx-g++"; -} - if (isCygwin()) { # Copy WebKitSupportLibrary to the correct location in WebKitLibraries so it can be found. # Will fail if WebKitSupportLibrary.zip is not in source root. @@ -266,7 +293,7 @@ for my $dir (@projects) { chdir ".." or die; next; } - + $result = buildGtkProject($dir, $clean, @options); } elsif (isQt()) { if ($dir ne "WebKit") { @@ -312,8 +339,7 @@ if ($svgSupport) { print " $launcherName will have SVG viewing capabilities.\n"; } if ($svgAnimationSupport or $svgFiltersSupport or $svgForeignObjectSupport or $svgFontsSupport or $svgAsImageSupport or $svgUseSupport) { - print "\n NOTE: WebKit has been built with experimental SVG features enabled.\n"; - print " Your build supports: \n"; + print " Your build supports the following (optional) SVG features: \n"; print " * Basic SVG animation.\n" if $svgAnimationSupport; print " * SVG filters.\n" if $svgFiltersSupport; print " * SVG foreign object.\n" if $svgForeignObjectSupport; diff --git a/WebKitTools/Scripts/check-for-global-initializers b/WebKitTools/Scripts/check-for-global-initializers index c73b8cc..493b40c 100755 --- a/WebKitTools/Scripts/check-for-global-initializers +++ b/WebKitTools/Scripts/check-for-global-initializers @@ -26,7 +26,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# "check-for-global-initializers" script for Web Kit Open Source Project +# "check-for-global-initializers" script for WebKit Open Source Project # Intended to be invoked from an Xcode build step to check if there are # any global initializers in a target. @@ -92,22 +92,26 @@ for my $file (sort @files) { $shortName =~ s/.*\///; # Special cases for files that have initializers in debug builds. - if ($configuration eq "Debug" or $debugRoot ) { + if ($configuration eq "Debug" or $variant eq "debug" or $debugRoot) { if ($target eq "JavaScriptCore") { - next if $shortName eq "nodes.o"; next if $shortName eq "AllInOneFile.o"; + next if $shortName eq "Opcode.o"; + next if $shortName eq "StructureID.o"; + next if $shortName eq "nodes.o"; } if ($target eq "WebCore") { next if $shortName eq "CachedPage.o"; + next if $shortName eq "CachedResource.o"; next if $shortName eq "Frame.o"; next if $shortName eq "JSCustomSQLTransactionCallback.o"; + next if $shortName eq "JSEventListener.o"; next if $shortName eq "Node.o"; next if $shortName eq "Page.o"; next if $shortName eq "Range.o"; next if $shortName eq "RenderObject.o"; next if $shortName eq "SubresourceLoader.o"; + next if $shortName eq "SVGElementInstance.o"; next if $shortName eq "bidi.o"; - next if $shortName eq "kjs_events.o"; } } diff --git a/WebKitTools/Scripts/check-for-weak-vtables b/WebKitTools/Scripts/check-for-weak-vtables new file mode 100755 index 0000000..d274b01 --- /dev/null +++ b/WebKitTools/Scripts/check-for-weak-vtables @@ -0,0 +1,101 @@ +#!/usr/bin/perl + +# Copyright (C) 2006, 2007, 2008 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. +# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of +# its contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY APPLE 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 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. + +# "check-for-weak-vtables" script for WebKit Open Source Project + +# Intended to be invoked from an Xcode build step to check if there are +# any weak vtables in a target. + +use warnings; +use strict; + +use File::Basename; + +sub touch($); + +my $arch = $ENV{'CURRENT_ARCH'}; +my $configuration = $ENV{'CONFIGURATION'}; +my $target = $ENV{'TARGET_NAME'}; +my $variant = $ENV{'CURRENT_VARIANT'}; +my $coverageBuild = $ENV{'WEBKIT_COVERAGE_BUILD'}; +my $debugRoot = $ENV{'WEBKIT_DEBUG_ROOT'}; + +$arch = $ENV{'NATIVE_ARCH'} if !$arch; # for Xcode 2.1, which does not have CURRENT_ARCH +$variant = "normal" if !$variant; # for Xcode 2.1, which does not have CURRENT_VARIANT + +my $executablePath = "$ENV{'TARGET_BUILD_DIR'}/$ENV{'EXECUTABLE_PATH'}"; + +my $buildTimestampPath = $ENV{'TARGET_TEMP_DIR'} . "/" . basename($0) . ".timestamp"; +my $buildTimestampAge = -M $buildTimestampPath; +my $executablePathAge = -M $executablePath; + +my $sawError = 0; + +if (!defined $executablePathAge || !defined $buildTimestampAge || $executablePathAge > $buildTimestampAge) { + if (!open NM, "(nm -m '$executablePath' | c++filt | sed 's/^/STDOUT:/') 2>&1 |") { + print "Could not open $executablePath\n"; + $sawError = 1; + next; + } + my @weakVTableClasses = (); + while (<NM>) { + if (/^STDOUT:/) { + push @weakVTableClasses, $1 if /weak external vtable for (.*)$/; + } else { + print STDERR if $_ ne "nm: no name list\n"; + } + } + close NM; + if (@weakVTableClasses) { + my $shortName = $executablePath; + $shortName =~ s/.*\///; + + print "$shortName has a weak vtable in it ($executablePath)\n"; + print "Fix by making sure the first virtual function in each of these classes is not an inline:\n"; + for my $class (sort @weakVTableClasses) { + print " $class\n"; + } + $sawError = 1; + } +} + +if ($sawError and !$coverageBuild) { + unlink $executablePath; + exit 1; +} + +touch($buildTimestampPath); + +exit 0; + +sub touch($) +{ + my ($path) = @_; + open(TOUCH, ">", $path) or die "$!"; + close(TOUCH); +} diff --git a/WebKitTools/Scripts/commit-log-editor b/WebKitTools/Scripts/commit-log-editor index e7ee5155..939b28c 100755 --- a/WebKitTools/Scripts/commit-log-editor +++ b/WebKitTools/Scripts/commit-log-editor @@ -96,8 +96,8 @@ for my $changeLog (@changeLogs) { while (<CHANGELOG>) { if (/^\S/) { last if $contents; - next; - } elsif (/\S/) { + } + if (/\S/) { $contents .= $blankLines if $contents; $blankLines = ""; $contents .= $_; diff --git a/WebKitTools/Scripts/create-exports b/WebKitTools/Scripts/create-exports new file mode 100755 index 0000000..c645d55 --- /dev/null +++ b/WebKitTools/Scripts/create-exports @@ -0,0 +1,5 @@ +#!/usr/bin/perl -w + +while (<>) { + print "$1\n" if /^\s*\"(.+)\", referenced from:$/; +} diff --git a/WebKitTools/Scripts/do-file-rename b/WebKitTools/Scripts/do-file-rename index 23a460c..ac5099e 100755 --- a/WebKitTools/Scripts/do-file-rename +++ b/WebKitTools/Scripts/do-file-rename @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# Copyright (C) 2006 Apple Computer, Inc. All rights reserved. +# Copyright (C) 2006, 2008 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -42,7 +42,10 @@ my %words; # find all files we want to process my @paths; +find(\&wanted, "JavaScriptCore"); +find(\&wanted, "JavaScriptGlue"); find(\&wanted, "WebCore"); +find(\&wanted, "WebKit"); sub wanted { @@ -65,7 +68,9 @@ sub wanted } my %renames = ( - "xxx.mm" => "yyy.mm", +); + +my %renamesContemplatedForTheFuture = ( ); # rename files @@ -99,7 +104,7 @@ for my $file (sort @paths) { my $newContents = $contents; for my $from (keys %renames) { - $newContents =~ s/\b\Q$from\E(?!["\w])/$renames{$from}/g; # this " unconfuses Xcode syntax highlighting + $newContents =~ s/\b\Q$from\E(?!\w)/$renames{$from}/g; # this " unconfuses Xcode syntax highlighting } if ($newContents ne $contents) { diff --git a/WebKitTools/Scripts/do-webcore-rename b/WebKitTools/Scripts/do-webcore-rename index 24b14a3..edfe2dc 100755 --- a/WebKitTools/Scripts/do-webcore-rename +++ b/WebKitTools/Scripts/do-webcore-rename @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# Copyright (C) 2006, 2007 Apple Inc. All rights reserved. +# Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -43,6 +43,7 @@ my %words; my @paths; find(\&wanted, "JavaScriptCore"); +find(\&wanted, "JavaScriptGlue"); find(\&wanted, "WebCore"); find(\&wanted, "WebKit"); @@ -67,224 +68,91 @@ sub wanted } my %renames = ( - "ArrayInstance" => "JSArray", - "ActivationImp" => "Activation", - "ActivationImpData" => "ActivationData", - "ArrayObjectImp" => "ArrayConstructor", - "ArrayProtoFuncConcat" => "ArrayFunctionConcat", - "ArrayProtoFuncEvery" => "ArrayFunctionEvery", - "ArrayProtoFuncFilter" => "ArrayFunctionFilter", - "ArrayProtoFuncForEach" => "ArrayFunctionForEach", - "ArrayProtoFuncIndexOf" => "ArrayFunctionIndexOf", - "ArrayProtoFuncJoin" => "ArrayFunctionJoin", - "ArrayProtoFuncLastIndexOf" => "ArrayFunctionLastIndexOf", - "ArrayProtoFuncMap" => "ArrayFunctionMap", - "ArrayProtoFuncPop" => "ArrayFunctionPop", - "ArrayProtoFuncPush" => "ArrayFunctionPush", - "ArrayProtoFuncReverse" => "ArrayFunctionReverse", - "ArrayProtoFuncShift" => "ArrayFunctionShift", - "ArrayProtoFuncSlice" => "ArrayFunctionSlice", - "ArrayProtoFuncSome" => "ArrayFunctionSome", - "ArrayProtoFuncSort" => "ArrayFunctionSort", - "ArrayProtoFuncSplice" => "ArrayFunctionSplice", - "ArrayProtoFuncToLocaleString" => "ArrayFunctionToLocaleString", - "ArrayProtoFuncToString" => "ArrayFunctionToString", - "ArrayProtoFuncUnShift" => "ArrayFunctionUnshift", - "BooleanInstance" => "BooleanObject", - "BooleanObjectImp" => "BooleanConstructor", - "BooleanProtoFunc" => "BooleanFunction", - "DateObjectFuncImp" => "DateFunction", - "DateObjectImp" => "DateConstructor", - "DateProtoFuncGetDate" => "DateFunctionGetDate", - "DateProtoFuncGetDay" => "DateFunctionGetDay", - "DateProtoFuncGetFullYear" => "DateFunctionGetFullYear", - "DateProtoFuncGetHours" => "DateFunctionGetHours", - "DateProtoFuncGetMilliSeconds" => "DateFunctionGetMilliSeconds", - "DateProtoFuncGetMinutes" => "DateFunctionGetMinutes", - "DateProtoFuncGetMonth" => "DateFunctionGetMonth", - "DateProtoFuncGetSeconds" => "DateFunctionGetSeconds", - "DateProtoFuncGetTime" => "DateFunctionGetTime", - "DateProtoFuncGetTimezoneOffset" => "DateFunctionGetTimezoneOffset", - "DateProtoFuncGetUTCDate" => "DateFunctionGetUTCDate", - "DateProtoFuncGetUTCDay" => "DateFunctionGetUTCDay", - "DateProtoFuncGetUTCFullYear" => "DateFunctionGetUTCFullYear", - "DateProtoFuncGetUTCHours" => "DateFunctionGetUTCHours", - "DateProtoFuncGetUTCMilliseconds" => "DateFunctionGetUTCMilliseconds", - "DateProtoFuncGetUTCMinutes" => "DateFunctionGetUTCMinutes", - "DateProtoFuncGetUTCMonth" => "DateFunctionGetUTCMonth", - "DateProtoFuncGetUTCSeconds" => "DateFunctionGetUTCSeconds", - "DateProtoFuncGetYear" => "DateFunctionGetYear", - "DateProtoFuncSetDate" => "DateFunctionSetDate", - "DateProtoFuncSetFullYear" => "DateFunctionSetFullYear", - "DateProtoFuncSetHours" => "DateFunctionSetHours", - "DateProtoFuncSetMilliSeconds" => "DateFunctionSetMilliSeconds", - "DateProtoFuncSetMinutes" => "DateFunctionSetMinutes", - "DateProtoFuncSetMonth" => "DateFunctionSetMonth", - "DateProtoFuncSetSeconds" => "DateFunctionSetSeconds", - "DateProtoFuncSetTime" => "DateFunctionSetTime", - "DateProtoFuncSetUTCDate" => "DateFunctionSetUTCDate", - "DateProtoFuncSetUTCFullYear" => "DateFunctionSetUTCFullYear", - "DateProtoFuncSetUTCHours" => "DateFunctionSetUTCHours", - "DateProtoFuncSetUTCMilliseconds" => "DateFunctionSetUTCMilliseconds", - "DateProtoFuncSetUTCMinutes" => "DateFunctionSetUTCMinutes", - "DateProtoFuncSetUTCMonth" => "DateFunctionSetUTCMonth", - "DateProtoFuncSetUTCSeconds" => "DateFunctionSetUTCSeconds", - "DateProtoFuncSetYear" => "DateFunctionSetYear", - "DateProtoFuncToDateString" => "DateFunctionToDateString", - "DateProtoFuncToGMTString" => "DateFunctionToGMTString", - "DateProtoFuncToLocaleDateString" => "DateFunctionToLocaleDateString", - "DateProtoFuncToLocaleString" => "DateFunctionToLocaleString", - "DateProtoFuncToLocaleTimeString" => "DateFunctionToLocaleTimeString", - "DateProtoFuncToString" => "DateFunctionToString", - "DateProtoFuncToTimeString" => "DateFunctionToTimeString", - "DateProtoFuncToUTCString" => "DateFunctionToUTCString", - "DateProtoFuncValueOf" => "DateFunctionValueOf", - "DebuggerImp" => "DebuggerData", - "ErrorObjectImp" => "ErrorConstructor", - "ErrorProtoFuncToString" => "ErrorFunction", - "FRAMES_ON_STACK" => "numFramesOnStack", - "FunctionImp" => "Function", - "FunctionObjectImp" => "FunctionConstructor", - "FunctionProtoFunc" => "FunctionFunction", - "GetterSetterImp" => "GetterSetter", - "GlobalFuncImp" => "GlobalFunction", - "GlobalImp" => "TestGlobalObject", - "HTMLGenericFormElement" => "HTMLFormControlElement", - "HTMLGenericFormElement_h" => "HTMLFormControlElement_h", +); + +my %renamesContemplatedForTheFuture = ( + "StructureID" => "Structure", + "StructureIDChain" => "StructureChain", + "StructureIDs" => "Structures", + "StructureID_h" => "Structure_h", + "StructureIDChain_h" => "StructureChain_h", + "activationStructureID" => "activationStructure", + "createStructureID" => "createStructure", + "currStructureID" => "currStructure", + "derefStructureIDs" => "derefStructures", + "liveStructureIDSet" => "liveStructureSet", + "m_structureID" => "mm_structure", + "newStructureID" => "newStructureID", + "numberStructureID" => "numberStructure", + "oldStructureID" => "oldStructure", + "printStructureIDs" => "printStructures", + "refStructureIDs" => "refStructures", + "repatchGetByIdDefaultStructureID" => "repatchGetByIdDefaultStructure", + "repatchOffsetGetByIdStructureID" => "repatchOffsetGetByIdStructure", + "repatchOffsetPutByIdStructureID" => "repatchOffsetPutByIdStructure", + "sIDC" => "chain", + "setCachedStructureID" => "setCachedStructureID", + "staticScopeStructureID" => "staticScopeStructure", + "stringStructureID" => "stringStructure", + "structureID" => "structure", + "structureIDAddr" => "structureAddress", + "structureIDChain" => "structureChain", + "structureIDCounter" => "structureCounter", + "structureIDInstructionIndex" => "structureInstructionIndex", + "structureIDInstructions" => "structureInstructions", + + "DOMObject" => "JSDOMObject", + + "runtimeObjectGetter" => "pluginElementGetter", + "runtimeObjectPropertyGetter" => "pluginElementPropertyGetter", + "runtimeObjectCustomGetOwnPropertySlot" => "pluginElementCustomGetOwnPropertySlot", + "runtimeObjectCustomPut" => "pluginElementCustomPut", + "runtimeObjectImplementsCall" => "pluginElementImplementsCall", + "runtimeObjectCallAsFunction" => "pluginElementCallAsFunction", + + "CLONE_CONTENTS" => "Clone", + "DELETE_CONTENTS" => "Delete", + "EXTRACT_CONTENTS" => "Extract", + + "DateInstance" => "JSDate", + "ErrorInstance" => "JSError", + "ImageConstructorImp" => "JSImageConstructor", - "InternalFunctionImp" => "InternalFunction", - "JSXMLHttpRequestConstructorImp" => "JSXMLHttpRequestConstructor", + "Navigator" => "JSNavigator", + + "JSHTMLOptionElementConstructor" => "JSOptionConstructor", + "XSLTProcessorPrototypeTable" => "JSXSLTProcessorPrototypeTable", + "KURL" => "URL", "KURLCFNet" => "URLCF", + "KURLHash" => "URLHash", "KURLMac" => "URLMac", "KURL_H_" => "URL_h", - "List" => "ArgumentList", - "MathObjectImp" => "MathObject", - "MathProtoFuncACos" => "MathFunctionACos", - "MathProtoFuncASin" => "MathFunctionASin", - "MathProtoFuncATan" => "MathFunctionATan", - "MathProtoFuncATan2" => "MathFunctionATan2", - "MathProtoFuncAbs" => "MathFunctionAbs", - "MathProtoFuncCeil" => "MathFunctionCeil", - "MathProtoFuncCos" => "MathFunctionCos", - "MathProtoFuncExp" => "MathFunctionExp", - "MathProtoFuncFloor" => "MathFunctionFloor", - "MathProtoFuncLog" => "MathFunctionLog", - "MathProtoFuncMax" => "MathFunctionMax", - "MathProtoFuncMin" => "MathFunctionMin", - "MathProtoFuncPow" => "MathFunctionPow", - "MathProtoFuncRandom" => "MathFunctionRandom", - "MathProtoFuncRound" => "MathFunctionRound", - "MathProtoFuncSin" => "MathFunctionSin", - "MathProtoFuncSqrt" => "MathFunctionSqrt", - "MathProtoFuncTan" => "MathFunctionTan", - "NativeErrorImp" => "NativeErrorConstructor", - "Navigator" => "JSNavigator", - "NumberImp" => "JSNumberCell", - "NumberInstance" => "NumberObject", - "NumberObjectImp" => "NumberConstructor", - "NumberProtoFunc" => "NumberFunction", + + "ThreadSafeShared" => "ThreadSafeRefCounted", + "TreeShared" => "TreeRefCounted", + + "StringImpl" => "SharedString", + + "RenderView" => "RenderViewport", + "ObjcFallbackObjectImp" => "ObjCFallbackObject", - "ObjectObjectImp" => "ObjectConstructor", - "ObjectProtoFunc" => "ObjectFunction", - "RECURSIVE_MATCH_STARTNG_NEW_GROUP" => "RECURSIVE_MATCH_NEW_GROUP", - "RegExpImp" => "RegExpObject", - "RegExpObjectImp" => "RegExpConstructor", - "RegExpObjectImpPrivate" => "RegExpConstructorPrivate", - "RegExpProtoFunc" => "RegExpFunction", "RuntimeObjectImp" => "ForeignObject", - "StringImp" => "JSString", - "StringImpl" => "SharedString", - "StringInstance" => "StringObject", - "StringInstanceThatMasqueradesAsUndefined" => "StringObjectThatMasqueradesAsUndefined", - "StringObjectFuncImp" => "StringConstructorFunction", - "StringObjectImp" => "StringConstructor", - "StringProtoFuncAnchor" => "StringFunctionAnchor", - "StringProtoFuncBig" => "StringFunctionBig", - "StringProtoFuncBlink" => "StringFunctionBlink", - "StringProtoFuncBold" => "StringFunctionBold", - "StringProtoFuncCharAt" => "StringFunctionCharAt", - "StringProtoFuncCharCodeAt" => "StringFunctionCharCodeAt", - "StringProtoFuncConcat" => "StringFunctionConcat", - "StringProtoFuncFixed" => "StringFunctionFixed", - "StringProtoFuncFontcolor" => "StringFunctionFontcolor", - "StringProtoFuncFontsize" => "StringFunctionFontsize", - "StringProtoFuncIndexOf" => "StringFunctionIndexOf", - "StringProtoFuncItalics" => "StringFunctionItalics", - "StringProtoFuncLastIndexOf" => "StringFunctionLastIndexOf", - "StringProtoFuncLink" => "StringFunctionLink", - "StringProtoFuncLocaleCompare" => "StringFunctionLocaleCompare", - "StringProtoFuncMatch" => "StringFunctionMatch", - "StringProtoFuncReplace" => "StringFunctionReplace", - "StringProtoFuncSearch" => "StringFunctionSearch", - "StringProtoFuncSlice" => "StringFunctionSlice", - "StringProtoFuncSmall" => "StringFunctionSmall", - "StringProtoFuncSplit" => "StringFunctionSplit", - "StringProtoFuncStrike" => "StringFunctionStrike", - "StringProtoFuncSub" => "StringFunctionSub", - "StringProtoFuncSubstr" => "StringFunctionSubstr", - "StringProtoFuncSubstring" => "StringFunctionSubstring", - "StringProtoFuncSup" => "StringFunctionSup", - "StringProtoFuncToLocaleLowerCase" => "StringFunctionToLocaleLowerCase", - "StringProtoFuncToLocaleUpperCase" => "StringFunctionToLocaleUpperCase", - "StringProtoFuncToLowerCase" => "StringFunctionToLowerCase", - "StringProtoFuncToString" => "StringFunctionToString", - "StringProtoFuncToUpperCase" => "StringFunctionToUpperCase", - "StringProtoFuncValueOf" => "StringFunctionValueOf", - "TestFunctionImp" => "TestFunction", - "ThreadSafeShared" => "ThreadSafeRefCounted", - "XSLTProcessorConstructorImp" => "JSXSLTProcessorConstructor", - "XSLTProcessorPrototype" => "JSXSLTProcessorPrototype", - "animationController" => "animation", - "branchfirstbyte" => "branchFirstByte", - "branchreqbyte" => "branchReqByte", - "class_charcount" => "classCharCount", - "class_lastchar" => "classLastChar", - "codeptr" => "codePtr", - "domString" => "string", + "equalIgnoringCase" => "equalFoldingCase", - "errorcodeptr" => "errorCodePtr", - "errorptr" => "errorPtr", - "first_byte" => "firstByte", - "first_byte_caseless" => "firstByteIsCaseless", - "first_char" => "firstChar", - "firstbyte" => "firstByte", - "groupsetfirstbyte" => "didGroupSetFirstByte", - "is_quantifier" => "isQuantifier", - "isclass" => "isClass", - "kjs_binding" => "JSDOMBinding", - "kjs_binding_h" => "JSDOMBinding_h", - "kjs_css" => "JSRGBColor", - "kjs_css_h" => "JSRGBColor_h", - "kjs_proxy" => "ScriptController", - "kjs_proxy_h" => "ScriptController_h", - "last_branch" => "lastBranch", - "mclength" => "mcLength", - "negate_class" => "negateClass", - "offsetcount" => "offsetCount", - "op_type" => "opType", - "prev_length" => "prevLength", - "ptrptr" => "ptrPtr", - "repeat_min" => "repeatMin", - "repeat_type" => "repeatType", - "req_byte" => "reqByte", - "req_byte2" => "reqByte2", - "req_byte_caseless" => "reqByteIsCaseless", - "req_caseopt" => "reqCaseOpt", - "req_varyopt" => "reqVaryOpt", - "reqbyte" => "reqByte", - "resetcount" => "resetCount", - "scriptProxy" => "script", - "selectionController" => "selection", - "should_flip_negation" => "shouldFlipNegation", - "skipbytes" => "skipBytes", - "subfirstbyte" => "subFirstByte", - "subreqbyte" => "subReqByte", - "top_backref" => "topBackref", - "top_bracket" => "topBracket", - "using_temporary_offsets" => "usingTemporaryOffsets", - "zerofirstbyte" => "zeroFirstByte", - "zeroreqbyte" => "zeroReqByte", + + "FTPDirectoryTokenizer" => "FTPDirectoryDocumentBuilder", + "HTMLTokenizer" => "HTMLDocumentBuilder", + "ImageTokenizer" => "ImageDocumentBuilder", + "PluginTokenizer" => "PluginDocumentBuilder", + "TextTokenizer" => "TextDocumentBuilder", + "Tokenizer" => "DocumentBuilder", + "Tokenizer_h" => "DocumentBuilder_h", + "XMLTokenizer" => "XMLDocumentBuilder", + "isHTMLTokenizer" => "isHTMLDocumentBuilder", + "m_tokenizer" => "m_builder", + "createTokenizer" => "createBuilder", + "tokenizerProcessedData" => "documentBuilderProcessedData", ); # rename files diff --git a/WebKitTools/Scripts/extract-localizable-strings b/WebKitTools/Scripts/extract-localizable-strings index 15d6782..420624b 100755 --- a/WebKitTools/Scripts/extract-localizable-strings +++ b/WebKitTools/Scripts/extract-localizable-strings @@ -44,14 +44,16 @@ use strict; -my $stringsFile = "English.lproj/Localizable.strings"; -my %isDebugMacro = ( ASSERT_WITH_MESSAGE => 1, LOG_ERROR => 1, ERROR => 1, NSURL_ERROR => 1, FATAL => 1, LOG => 1, dprintf => 1, NSException => 1, NSLog => 1, printf => 1 ); +my %isDebugMacro = ( ASSERT_WITH_MESSAGE => 1, LOG_ERROR => 1, ERROR => 1, NSURL_ERROR => 1, FATAL => 1, LOG => 1, LOG_WARNING => 1, UI_STRING_LOCALIZE_LATER => 1, LPCTSTR_UI_STRING_LOCALIZE_LATER => 1, UNLOCALIZED_STRING => 1, UNLOCALIZED_LPCTSTR => 1, dprintf => 1, NSException => 1, NSLog => 1, printf => 1 ); @ARGV >= 1 or die "Usage: extract-localizable-strings <exceptions file> [ directory... ]\nDid you mean to run extract-webkit-localizable-strings instead?\n"; my $exceptionsFile = shift @ARGV; -f $exceptionsFile or die "Couldn't find exceptions file $exceptionsFile\n"; +my $fileToUpdate = shift @ARGV; +-f $fileToUpdate or die "Couldn't find file to update $fileToUpdate\n"; + my @directories = (); my @directoriesToSkip = (); if (@ARGV < 1) { @@ -164,7 +166,7 @@ handleString: # FIXME: Validate UTF-8 here? $UIString = $string; $expected = ","; - } elsif (($macro eq "UI_STRING_KEY" or $macro eq "LPCTSTR_UI_STRING_KEY") and !defined $key) { + } elsif (($macro =~ /UI_STRING_KEY$/) and !defined $key) { # FIXME: Validate UTF-8 here? $key = $string; $expected = ","; @@ -223,7 +225,7 @@ handleString: $sawError = 1; $expected = ""; } - if ($token eq "UI_STRING" or $token eq "UI_STRING_KEY" or $token eq "LPCTSTR_UI_STRING" or $token eq "LPCTSTR_UI_STRING_KEY") { + if ($token =~ /UI_STRING(_KEY)?$/) { $expected = "("; $macro = $token; $UIString = undef; @@ -325,7 +327,7 @@ print "$NSLocalizeCount uses of NSLocalize\n" if $NSLocalizeCount; print scalar(@unusedExceptions), " unused exceptions\n" if @unusedExceptions; if ($sawError) { - print "\nErrors encountered. Exiting without writing a $stringsFile file.\n"; + print "\nErrors encountered. Exiting without writing to $fileToUpdate.\n"; exit 1; } @@ -338,22 +340,12 @@ for my $key (sort keys %commentByKey) { # Write out the strings file in UTF-16 with a BOM. utf8::decode($localizedStrings) if $^V ge chr(5).chr(8); my $output = pack "n*", (0xFEFF, unpack "U*", $localizedStrings); -foreach my $directory (@directories) { - if (-e "$directory/mac/$stringsFile") { - open STRINGS, ">", "$directory/mac/$stringsFile" or die; - print STRINGS $output; - close STRINGS; - } - - if (-e "$directory/win/$stringsFile") { - open STRINGS, ">", "$directory/win/$stringsFile" or die; - print STRINGS $output; - close STRINGS; - } - if (-e "$directory/$stringsFile") { - open STRINGS, ">", "$directory/$stringsFile" or die; - print STRINGS $output; - close STRINGS; - } +if (-e "$fileToUpdate") { + open STRINGS, ">", "$fileToUpdate" or die; + print STRINGS $output; + close STRINGS; +} else { + print "$fileToUpdate does not exist\n"; + exit 1; } diff --git a/WebKitTools/Scripts/gdb-drosera b/WebKitTools/Scripts/gdb-drosera deleted file mode 100644 index fcde476..0000000 --- a/WebKitTools/Scripts/gdb-drosera +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/perl -w - -# Copyright (C) 2007 Apple Computer, 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. -# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of -# its contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - -# Simplified "run under gdb" script for Web Kit Open Source Project. - -use strict; -use Getopt::Long; -use FindBin; -use lib $FindBin::Bin; -use webkitdirs; -use File::Temp qw/:mktemp/; - -setConfiguration(); -my $productDir = productDir(); -my $droseraPath = "$productDir/Drosera.app/Contents/MacOS/Drosera"; - -# Check to see that gdb is in the usual place. -my $gdbPath = "/usr/bin/gdb"; -die "Can't find gdb executable. Is gdb installed?\n" unless -x $gdbPath; - -# Check to see that all the frameworks are built. -checkFrameworks(); - -# Put a command to set DYLD_FRAMEWORK_PATH in a temp file. -my ($fh, $path) = mkstemp("/tmp/gdb-drosera-XXXX"); -print $fh "set env DYLD_FRAMEWORK_PATH $productDir\n"; - -# Start up Drosera. -print "Start Drosera under gdb with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n"; -exec $gdbPath, "-x", $path, $droseraPath or die; - -# Delete the temporary file. -unlink0($fh, $path) or die "Error unlinking file $path safely"; - diff --git a/WebKitTools/Scripts/gdb-safari b/WebKitTools/Scripts/gdb-safari index 026856c..f87f965 100755 --- a/WebKitTools/Scripts/gdb-safari +++ b/WebKitTools/Scripts/gdb-safari @@ -26,15 +26,36 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Simplified "run under gdb" script for Web Kit Open Source Project. +# Simplified "run under gdb" script for WebKit Open Source Project. use strict; -use Getopt::Long; +use File::Temp qw/:mktemp/; use FindBin; +use Getopt::Long; use lib $FindBin::Bin; use webkitdirs; -use File::Temp qw/:mktemp/; +my $programName = basename($0); +my $showHelp = 0; +my $run64Bit; + +my $usage = <<EOF; +Usage: $programName [options] + --help Show this help message + --64-bit Run in 64-bit mode +EOF + +my $getOptionsResult = GetOptions( + 'help' => \$showHelp, + '64-bit!' => \$run64Bit +); + +if (!$getOptionsResult || $showHelp) { + print STDERR $usage; + exit 1; +} + +setRun64Bit($run64Bit); setConfiguration(); my $productDir = productDir(); my $safariPath = safariPath(); @@ -47,12 +68,16 @@ die "Can't find gdb executable. Is gdb installed?\n" unless -x $gdbPath; checkFrameworks(); # Put a command to set DYLD_FRAMEWORK_PATH in a temp file. +# Also set WEBKIT_UNSET_DYLD_FRAMEWORK_PATH to YES in this environment, so that +# executables launched by Safari don't inherit using the new frameworks. my ($fh, $path) = mkstemp("/tmp/gdb-safari-XXXX"); print $fh "set env DYLD_FRAMEWORK_PATH $productDir\n"; +print $fh "set env WEBKIT_UNSET_DYLD_FRAMEWORK_PATH YES\n"; +my @architectureFlags = ("-arch", preferredArchitecture()) if isOSX(); # Start up Safari. print "Start Safari under gdb with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n"; -exec $gdbPath, "-x", $path, $safariPath or die; +exec $gdbPath, "-x", $path, @architectureFlags, $safariPath or die; # Delete the temporary file. unlink0($fh, $path) or die "Error unlinking file $path safely"; diff --git a/WebKitTools/Scripts/make-js-test-wrappers b/WebKitTools/Scripts/make-js-test-wrappers index b58978f..4ac21ea 100755 --- a/WebKitTools/Scripts/make-js-test-wrappers +++ b/WebKitTools/Scripts/make-js-test-wrappers @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# Copyright (C) 2006 Apple Computer, Inc. All rights reserved. +# Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -29,23 +29,38 @@ # Script to generate HTML wrappers for JavaScript tests from templates use strict; + use FindBin; use lib $FindBin::Bin; + +use File::Basename; +use File::Find; +use Getopt::Long; use webkitdirs; +sub directoryFilter; +sub findTemplateFiles(@); + +my $showHelp; + +my $result = GetOptions( + "help" => \$showHelp, +); + +if (!$result || $showHelp) { + print STDERR basename($0) . " [-h|--help] [path ...]\n"; + exit 1; +} + setConfiguration(); my $productDir = productDir(); -use strict; - chdirWebKit(); -my @templates = `find LayoutTests -name "TEMPLATE.html"`; +my @templates = findTemplateFiles(@ARGV); for my $tfile (@templates) { - chomp $tfile; - my $tpath = $tfile; $tpath =~ s:/resources/TEMPLATE.html$::; @@ -54,7 +69,11 @@ for my $tfile (@templates) { chdirWebKit(); chdir($tpath); - my @files = `find resources -name "*.js"`; + my @files; + my $fileFilter = sub { + push @files, $File::Find::name if substr($_, -3) eq ".js"; + }; + find({ preprocess => \&directoryFilter, wanted => $fileFilter }, "resources"); open TEMPLATE, "<resources/TEMPLATE.html"; my $template = do { local $/; <TEMPLATE> }; @@ -68,19 +87,31 @@ for my $tfile (@templates) { } for my $file (@files) { - chomp $file; next if $file =~ /js-test-.*\.js$/; next if $file =~ /SVGTestCase\.js/; + + next if $file =~ m:resources/NSResolver-exceptions\.js$:; next if $file =~ m:resources/attr-case-sensitivity\.js$:; + next if $file =~ m:resources/codegen-temporaries-multiple-global-blocks-1\.js$:; + next if $file =~ m:resources/codegen-temporaries-multiple-global-blocks-2\.js$:; + next if $file =~ m:resources/constructors-cached-navigate\.js$:; next if $file =~ m:resources/frame-loading-via-document-write\.js$:; + next if $file =~ m:resources/id-fastpath-almost-strict\.js$:; + next if $file =~ m:resources/id-fastpath-strict\.js$:; next if $file =~ m:resources/intersectsNode\.js$:; + next if $file =~ m:resources/p-in-scope\.js$:; next if $file =~ m:resources/script-element-gc\.js$:; next if $file =~ m:resources/script-element-gc\.js$:; next if $file =~ m:resources/script3\.js$:; next if $file =~ m:resources/script4\.js$:; next if $file =~ m:resources/script5\.js$:; next if $file =~ m:resources/select-options-remove\.js$:; + next if $file =~ m:resources/shadow-offset\.js$:; + next if $file =~ m:resources/tabindex-focus-blur-all\.js$:; + next if $file =~ m:resources/use-instanceRoot-event-bubbling\.js$:; + next if $file =~ m:resources/use-instanceRoot-event-listeners\.js$:; next if $file =~ m:resources/wrapper-identity-base\.js$:; + next if $file =~ m:resources/xhtml-scripts\.js$:; my $html = $file; $html =~ s:resources/(.*)\.js:$1.html:; @@ -101,3 +132,28 @@ for my $tfile (@templates) { close HTML; } } + +exit 0; + +sub directoryFilter +{ + return () if basename($File::Find::dir) eq ".svn"; + return @_; +} + +sub findTemplateFiles(@) { + my @args = @_; + my @templateFiles; + + push @args, "LayoutTests" if scalar(@args) == 0; + + my @paths = map { -f $_ ? dirname($_) : $_ } @args; + + my $fileFilter = sub { + push @templateFiles, $File::Find::name if $_ eq "TEMPLATE.html"; + }; + + find({ preprocess => \&directoryFilter, wanted => $fileFilter }, @paths); + + return @templateFiles; +} diff --git a/WebKitTools/Scripts/pdevenv b/WebKitTools/Scripts/pdevenv index 8072adf..1931211 100755 --- a/WebKitTools/Scripts/pdevenv +++ b/WebKitTools/Scripts/pdevenv @@ -13,7 +13,8 @@ chomp(my $vcBin = `cygpath -w "$FindBin::Bin/../vcbin"`); print $fh "\@echo off\n\n"; print $fh "call \"\%VS80COMNTOOLS\%\\vsvars32.bat\"\n\n"; print $fh "set PATH=$vcBin;\%PATH\%\n\n"; -print $fh "devenv.com /useenv " . join(" ", @ARGV) . "\n"; +print $fh "IF EXIST \"\%VSINSTALLDIR\%\\Common7\\IDE\\devenv.com\" (devenv.com /useenv " . join(" ", @ARGV) . ") ELSE "; +print $fh "VCExpress.exe /useenv " . join(" ", @ARGV) . "\n"; close $fh; diff --git a/WebKitTools/Scripts/prepare-ChangeLog b/WebKitTools/Scripts/prepare-ChangeLog index 913eea5..ff4ce80 100755 --- a/WebKitTools/Scripts/prepare-ChangeLog +++ b/WebKitTools/Scripts/prepare-ChangeLog @@ -82,6 +82,7 @@ sub testListForChangeLog(@); sub get_function_line_ranges($$); sub get_function_line_ranges_for_c($$); sub get_function_line_ranges_for_java($$); +sub get_function_line_ranges_for_javascript($$); sub method_decl_to_selector($); sub processPaths(\@); sub reviewerAndDescriptionForGitCommit($); @@ -174,8 +175,8 @@ if (@changed_files) { if (%changed_line_ranges) { print STDERR " Extracting affected function names from source files.\n"; foreach my $file (keys %changed_line_ranges) { - # Only look for function names in .c files. - next unless $file =~ /\.(c|cpp|m|mm|h|java)/; + # Only look for function names in certain source files. + next unless $file =~ /\.(c|cpp|m|mm|h|java|js)/; # Find all the functions in the file. open SOURCE, $file or next; @@ -386,6 +387,8 @@ sub get_function_line_ranges($$) return get_function_line_ranges_for_c ($file_handle, $file_name); } elsif ($file_name =~ /\.java$/) { return get_function_line_ranges_for_java ($file_handle, $file_name); + } elsif ($file_name =~ /\.js$/) { + return get_function_line_ranges_for_javascript ($file_handle, $file_name); } return (); } @@ -893,6 +896,190 @@ sub get_function_line_ranges_for_java($$) return @ranges; } + + +# Read a file and get all the line ranges of the things that look like +# JavaScript functions. +# +# A function name is the word that immediately follows `function' when +# followed by an open curly brace. It can appear at the top level, or +# inside other functions. +# +# An anonymous function name is the identifier chain immediately before +# an assignment with the equals operator or object notation that has a +# value starting with `function' followed by an open curly brace. +# +# A getter or setter name is the word that immediately follows `get' or +# `set' when followed by an open curly brace . +# +# Comment handling is simple-minded but will work for all but pathological cases. +# +# Result is a list of triples: [ start_line, end_line, function_name ]. + +sub get_function_line_ranges_for_javascript($$) +{ + my ($fileHandle, $fileName) = @_; + + my @currentScopes; + my @currentIdentifiers; + my @currentFunctionNames; + my @currentFunctionDepths; + my @currentFunctionStartLines; + + my @ranges; + + my $inComment = 0; + my $parenthesesDepth = 0; + my $bracesDepth = 0; + + my $functionJustSeen = 0; + my $getterJustSeen = 0; + my $setterJustSeen = 0; + my $assignmentJustSeen = 0; + + my $word = ""; + + while (<$fileHandle>) { + # Handle continued multi-line comment. + if ($inComment) { + next unless s-.*\*/--; + $inComment = 0; + } + + # Handle comments and quoted text. + while (m-(/\*|//|\'|\")-) { # \' and \" keep emacs perl mode happy + my $match = $1; + if ($match eq '/*') { + if (!s-/\*.*?\*/--) { + s-/\*.*--; + $inComment = 1; + } + } elsif ($match eq '//') { + s-//.*--; + } else { # ' or " + if (!s-$match([^\\]|\\.)*?$match--) { + warn "mismatched quotes at line $. in $fileName\n"; + s-$match.*--; + } + } + } + + # Find function names. + while (m-(\w+|[(){}=:;])-g) { + # Open parenthesis. + if ($1 eq '(') { + $parenthesesDepth++; + next; + } + + # Close parenthesis. + if ($1 eq ')') { + $parenthesesDepth--; + next; + } + + # Open brace. + if ($1 eq '{') { + push(@currentScopes, join(".", @currentIdentifiers)); + @currentIdentifiers = (); + + $bracesDepth++; + next; + } + + # Close brace. + if ($1 eq '}') { + $bracesDepth--; + + if (@currentFunctionDepths and $bracesDepth == $currentFunctionDepths[$#currentFunctionDepths]) { + pop(@currentFunctionDepths); + + my $currentFunction = pop(@currentFunctionNames); + my $start = pop(@currentFunctionStartLines); + + push(@ranges, [$start, $., $currentFunction]); + } + + pop(@currentScopes); + @currentIdentifiers = (); + + next; + } + + # Semicolon. + if ($1 eq ';') { + @currentIdentifiers = (); + next; + } + + # Function. + if ($1 eq 'function') { + $functionJustSeen = 1; + + if ($assignmentJustSeen) { + my $currentFunction = join('.', (@currentScopes, @currentIdentifiers)); + $currentFunction =~ s/\.{2,}/\./g; # Removes consecutive periods. + + push(@currentFunctionNames, $currentFunction); + push(@currentFunctionDepths, $bracesDepth); + push(@currentFunctionStartLines, $.); + } + + next; + } + + # Getter prefix. + if ($1 eq 'get') { + $getterJustSeen = 1; + next; + } + + # Setter prefix. + if ($1 eq 'set') { + $setterJustSeen = 1; + next; + } + + # Assignment operator. + if ($1 eq '=' or $1 eq ':') { + $assignmentJustSeen = 1; + next; + } + + next if $parenthesesDepth; + + # Word. + $word = $1; + $word = "get $word" if $getterJustSeen; + $word = "set $word" if $setterJustSeen; + + if (($functionJustSeen and !$assignmentJustSeen) or $getterJustSeen or $setterJustSeen) { + push(@currentIdentifiers, $word); + + my $currentFunction = join('.', (@currentScopes, @currentIdentifiers)); + $currentFunction =~ s/\.{2,}/\./g; # Removes consecutive periods. + + push(@currentFunctionNames, $currentFunction); + push(@currentFunctionDepths, $bracesDepth); + push(@currentFunctionStartLines, $.); + } elsif ($word ne 'if' and $word ne 'for' and $word ne 'do' and $word ne 'while' and $word ne 'which' and $word ne 'var') { + push(@currentIdentifiers, $word); + } + + $functionJustSeen = 0; + $getterJustSeen = 0; + $setterJustSeen = 0; + $assignmentJustSeen = 0; + } + } + + warn "mismatched braces in $fileName\n" if $bracesDepth; + warn "mismatched parentheses in $fileName\n" if $parenthesesDepth; + + return @ranges; +} + + sub processPaths(\@) { my ($paths) = @_; @@ -947,7 +1134,7 @@ sub diffCommand(@) if ($isSVN) { $command = "$SVN diff --diff-cmd diff -x -N $pathsString"; } elsif ($isGit) { - $command = "$GIT diff " . diffFromToString(); + $command = "$GIT diff -U0 " . diffFromToString(); $command .= " -- $pathsString" unless $gitCommit; } @@ -1065,8 +1252,10 @@ sub generateFileList(\@\@\%) } elsif (isConflictStatus($status)) { push @{$conflictFiles}, $file; } - my $description = statusDescription($status, $original); - $functionLists->{$file} = $description if defined $description; + if (basename($file) ne "ChangeLog") { + my $description = statusDescription($status, $original); + $functionLists->{$file} = $description if defined $description; + } } close STAT; } @@ -1156,18 +1345,9 @@ sub extractLineRange($) if ($isSVN && $string =~ /^\d+(,\d+)?[acd](\d+)(,(\d+))?/) { $start = $2; $end = $4 || $2; - } elsif ($isGit && $string =~ /^@@ -\d+,\d+ \+(\d+),(\d+) @@/) { - $start = $1; - $end = $1 + $2 - 1; - - # git-diff shows 3 lines of context above and below the actual changes, - # so we need to subtract that context to find the actual changed range. - - # FIXME: This won't work if there's a change at the very beginning or - # very end of a file. - - $start += 3; - $end -= 6; + } elsif ($isGit && $string =~ /^@@ -\d+(,\d+)? \+(\d+)(,(\d+))? @@/) { + $start = $2; + $end = defined($4) ? $4 + $2 - 1 : $2; } return ($start, $end); diff --git a/WebKitTools/Scripts/print-msvc-project-dependencies b/WebKitTools/Scripts/print-msvc-project-dependencies new file mode 100755 index 0000000..dbc8402 --- /dev/null +++ b/WebKitTools/Scripts/print-msvc-project-dependencies @@ -0,0 +1,143 @@ +#!/usr/bin/perl -w + +# Copyright (C) 2008 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. ``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 +# 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 File::Basename; + +sub printDependencyTree($); + +my $basename = basename($0); +@ARGV or die "Usage: $basename sln1 [sln2 sln3...]"; + +foreach my $sln (@ARGV) { + printDependencyTree($sln); +} + +exit; + +sub printDependencyTree($) +{ + my ($sln) = @_; + + unless (-f $sln) { + warn "Warning: Can't find $sln; skipping\n"; + return; + } + + unless (open SLN, "<", $sln) { + warn "Warning: Can't open $sln; skipping\n"; + return; + } + + my %projectsByUUID = (); + my $currentProject; + + my $state = "initial"; + foreach my $line (<SLN>) { + if ($state eq "initial") { + if ($line =~ /^Project\([^\)]+\) = "([^"]+)", "[^"]+", "([^"]+)"\r?$/) { + my $name = $1; + my $uuid = $2; + if (exists $projectsByUUID{$uuid}) { + warn "Warning: Project $name appears more than once in $sln; using first definition\n"; + next; + } + $currentProject = { + name => $name, + uuid => $uuid, + dependencies => {}, + }; + $projectsByUUID{$uuid} = $currentProject; + + $state = "inProject"; + } + + next; + } + + if ($state eq "inProject") { + defined($currentProject) or die; + + if ($line =~ /^\s*ProjectSection\(ProjectDependencies\) = postProject\r?$/) { + $state = "inDependencies"; + } elsif ($line =~ /^EndProject\r?$/) { + $currentProject = undef; + $state = "initial"; + } + + next; + } + + if ($state eq "inDependencies") { + defined($currentProject) or die; + + if ($line =~ /^\s*({[^}]+}) = ({[^}]+})\r?$/) { + my $uuid1 = $1; + my $uuid2 = $2; + if (exists $currentProject->{dependencies}->{$uuid1}) { + warn "Warning: UUID $uuid1 listed more than once as dependency of project ", $currentProject->{name}, "\n"; + next; + } + + $uuid1 eq $uuid2 or warn "Warning: UUIDs in depedency section of project ", $currentProject->{name}, " don't match: $uuid1 $uuid2; using first UUID\n"; + + $currentProject->{dependencies}->{$uuid1} = 1; + } elsif ($line =~ /^\s*EndProjectSection\r?$/) { + $state = "inProject"; + } + + next; + } + } + + close SLN or warn "Warning: Can't close $sln\n"; + + my %projectsNotDependedUpon = %projectsByUUID; + CANDIDATE: foreach my $candidateUUID (keys %projectsByUUID) { + foreach my $projectUUID (keys %projectsByUUID) { + next if $candidateUUID eq $projectUUID; + foreach my $dependencyUUID (keys %{$projectsByUUID{$projectUUID}->{dependencies}}) { + if ($candidateUUID eq $dependencyUUID) { + delete $projectsNotDependedUpon{$candidateUUID}; + next CANDIDATE; + } + } + } + } + + foreach my $project (values %projectsNotDependedUpon) { + printProjectAndDependencies($project, 0, \%projectsByUUID); + } +} + +sub printProjectAndDependencies +{ + my ($project, $indentLevel, $projectsByUUID) = @_; + + print " " x $indentLevel, $project->{name}, "\n"; + foreach my $dependencyUUID (keys %{$project->{dependencies}}) { + printProjectAndDependencies($projectsByUUID->{$dependencyUUID}, $indentLevel + 1, $projectsByUUID); + } +} diff --git a/WebKitTools/Scripts/resolve-ChangeLogs b/WebKitTools/Scripts/resolve-ChangeLogs index fa01243..58471ec 100755 --- a/WebKitTools/Scripts/resolve-ChangeLogs +++ b/WebKitTools/Scripts/resolve-ChangeLogs @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# Copyright (C) 2007 Apple Inc. All rights reserved. +# Copyright (C) 2007, 2008 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -34,73 +34,82 @@ use FindBin; use lib $FindBin::Bin; use File::Basename; +use File::Path; use File::Spec; use Getopt::Long; +use POSIX; use VCSUtils; sub conflictFiles($); +sub findChangeLog($); sub fixChangeLogPatch($); +sub fixMergedChangeLogs($;@); +sub fixOneMergedChangeLog($); sub mergeChanges($$$); +sub parseFixMerged($$;$); +sub removeChangeLogArguments(); +sub resolveChangeLog($); sub resolveConflict($); sub showStatus($;$); +sub usageAndExit(); my $SVN = "svn"; my $GIT = "git"; +my $fixMerged; my $printWarnings = 1; my $showHelp; my $getOptionsResult = GetOptions( + 'f|fix-merged:s' => \&parseFixMerged, 'h|help' => \$showHelp, 'w|warnings!' => \$printWarnings, ); -sub findChangeLog { - return $_ if basename($_) eq "ChangeLog"; +my @changeLogFiles = removeChangeLogArguments(); - my $file = File::Spec->catfile($_, "ChangeLog"); - return $file if -d $_ and -e $file; - - return undef; -} - -my @changeLogFiles = grep { defined $_ } map { findChangeLog($_) } @ARGV; - -if (scalar(@changeLogFiles) != scalar(@ARGV)) { +if (scalar(@ARGV) > 0) { print STDERR "ERROR: Files listed on command-line that are not ChangeLogs.\n"; undef $getOptionsResult; -} elsif (scalar(@changeLogFiles) == 0) { +} elsif (!defined $fixMerged && scalar(@changeLogFiles) == 0) { print STDERR "ERROR: No ChangeLog files listed on command-line.\n"; undef $getOptionsResult; +} elsif (defined $fixMerged && !isGit()) { + print STDERR "ERROR: --fix-merged may only be used with a git repository\n"; + undef $getOptionsResult; } -if (!$getOptionsResult || $showHelp) { +sub usageAndExit() +{ print STDERR <<__END__; Usage: @{[ basename($0) ]} [options] path/to/ChangeLog [path/to/another/ChangeLog ...] - -h|--help show this help message - -w|--[no-]warnings show or suppress warnings (default: show warnings) + -f|--fix-merged [revision-range] fix git-merged ChangeLog entries; if a revision-range + is specified, run git filter-branch on the range + -h|--help show this help message + -w|--[no-]warnings show or suppress warnings (default: show warnings) __END__ exit 1; } -for my $file (@changeLogFiles) { - my ($fileMine, $fileOlder, $fileNewer) = conflictFiles($file); - if (!$fileMine || !$fileOlder || !$fileNewer) { - next; - } - if (mergeChanges($fileMine, $fileOlder, $fileNewer)) { - if ($file ne $fileNewer) { - unlink($file); - rename($fileNewer, $file) || die; +if (!$getOptionsResult || $showHelp) { + usageAndExit(); +} + +if (defined $fixMerged && length($fixMerged) > 0) { + my $commitRange = $fixMerged; + $commitRange = $commitRange . "..HEAD" if index($commitRange, "..") < 0; + fixMergedChangeLogs($commitRange, @changeLogFiles); +} elsif (@changeLogFiles) { + for my $file (@changeLogFiles) { + if (defined $fixMerged) { + fixOneMergedChangeLog($file); + } else { + resolveChangeLog($file); } - unlink($fileMine, $fileOlder); - resolveConflict($file); - showStatus($file, 1); - } else { - showStatus($file); - print STDERR "WARNING: ${file} could not be merged using fuzz level 3.\n" if $printWarnings; - unlink($fileMine, $fileOlder, $fileNewer) if isGit(); } +} else { + print STDERR "ERROR: Unknown combination of switches and arguments.\n"; + usageAndExit(); } exit 0; @@ -176,6 +185,15 @@ sub conflictFiles($) return ($fileMine, $fileOlder, $fileNewer); } +sub findChangeLog($) { + return $_[0] if basename($_[0]) eq "ChangeLog"; + + my $file = File::Spec->catfile($_[0], "ChangeLog"); + return $file if -d $_[0] and -e $file; + + return undef; +} + sub fixChangeLogPatch($) { my $patch = shift; @@ -227,6 +245,96 @@ sub fixChangeLogPatch($) return $newPatch; } +sub fixMergedChangeLogs($;@) +{ + my $revisionRange = shift; + my @changedFiles = @_; + + if (scalar(@changedFiles) < 1) { + # Read in list of files changed in $revisionRange + open GIT, "-|", $GIT, "diff", "--name-only", $revisionRange || die; + push @changedFiles, <GIT>; + close GIT || die; + die "No changed files in $revisionRange" if scalar(@changedFiles) < 1; + chomp @changedFiles; + } + + my @changeLogs = grep { defined $_ } map { findChangeLog($_) } @changedFiles; + die "No changed ChangeLog files in $revisionRange" if scalar(@changeLogs) < 1; + + system("$GIT filter-branch --tree-filter 'PREVIOUS_COMMIT=\`$GIT rev-parse \$GIT_COMMIT^\` && MAPPED_PREVIOUS_COMMIT=\`map \$PREVIOUS_COMMIT\` $0 -f \"" . join('" "', @changeLogs) . "\"' $revisionRange"); + + # On success, remove the backup refs directory + if (WEXITSTATUS($?) == 0) { + rmtree(qw(.git/refs/original)); + } +} + +sub fixOneMergedChangeLog($) +{ + my $file = shift; + my $patch; + + # Read in patch for incorrectly merged ChangeLog entry + { + local $/ = undef; + open GIT, "-|", $GIT, "diff", ($ENV{GIT_COMMIT} || "HEAD") . "^", $file || die; + $patch = <GIT>; + close GIT || die; + } + + # Always checkout the previous commit's copy of the ChangeLog + system($GIT, "checkout", $ENV{MAPPED_PREVIOUS_COMMIT} || "HEAD^", $file); + + # The patch must have 0 or more lines of context, then 1 or more lines + # of additions, and then 1 or more lines of context. If not, we skip it. + if ($patch =~ /\n@@ -(\d+),(\d+) \+(\d+),(\d+) @@\n( .*\n)*((\+.*\n)+)( .*\n)+$/m) { + # Copy the header from the original patch. + my $newPatch = substr($patch, 0, index($patch, "@@ -${1},${2} +${3},${4} @@")); + + # Generate a new set of line numbers and patch lengths. Our new + # patch will start with the lines for the fixed ChangeLog entry, + # then have 3 lines of context from the top of the current file to + # make the patch apply cleanly. + $newPatch .= "@@ -1,3 +1," . ($4 - $2 + 3) . " @@\n"; + + # We assume that top few lines of the ChangeLog entry are actually + # at the bottom of the list of added lines (due to the way the patch + # algorithm works), so we simply search through the lines until we + # find the date line, then move the rest of the lines to the top. + my @patchLines = map { $_ . "\n" } split(/\n/, $6); + foreach my $i (0 .. $#patchLines) { + if ($patchLines[$i] =~ /^\+\d{4}-\d{2}-\d{2} /) { + unshift(@patchLines, splice(@patchLines, $i, scalar(@patchLines) - $i)); + last; + } + } + + $newPatch .= join("", @patchLines); + + # Add 3 lines of context to the end + open FILE, "<", $file || die; + for (my $i = 0; $i < 3; $i++) { + $newPatch .= " " . <FILE>; + } + close FILE; + + # Apply the new patch + open(PATCH, "| patch -p1 $file > /dev/null") || die; + print PATCH $newPatch; + close(PATCH) || die; + + # Run "git add" on the fixed ChangeLog file + system($GIT, "add", $file); + + showStatus($file, 1); + } elsif ($patch) { + # Restore the current copy of the ChangeLog file since we can't repatch it + system($GIT, "checkout", $ENV{GIT_COMMIT} || "HEAD", $file); + print STDERR "WARNING: Last change to ${file} could not be fixed and re-merged.\n" if $printWarnings; + } +} + sub mergeChanges($$$) { my ($fileMine, $fileOlder, $fileNewer) = @_; @@ -276,6 +384,61 @@ sub mergeChanges($$$) return $result; } +sub parseFixMerged($$;$) +{ + my ($switchName, $key, $value) = @_; + if (defined $key) { + if (defined findChangeLog($key)) { + unshift(@ARGV, $key); + $fixMerged = ""; + } else { + $fixMerged = $key; + } + } else { + $fixMerged = ""; + } +} + +sub removeChangeLogArguments() +{ + my @results = (); + + for (my $i = 0; $i < scalar(@ARGV); ) { + my $file = findChangeLog($ARGV[$i]); + if (defined $file) { + splice(@ARGV, $i, 1); + push @results, $file; + } else { + $i++; + } + } + + return @results; +} + +sub resolveChangeLog($) +{ + my ($file) = @_; + + my ($fileMine, $fileOlder, $fileNewer) = conflictFiles($file); + + return unless $fileMine && $fileOlder && $fileNewer; + + if (mergeChanges($fileMine, $fileOlder, $fileNewer)) { + if ($file ne $fileNewer) { + unlink($file); + rename($fileNewer, $file) || die; + } + unlink($fileMine, $fileOlder); + resolveConflict($file); + showStatus($file, 1); + } else { + showStatus($file); + print STDERR "WARNING: ${file} could not be merged using fuzz level 3.\n" if $printWarnings; + unlink($fileMine, $fileOlder, $fileNewer) if isGit(); + } +} + sub resolveConflict($) { my ($file) = @_; diff --git a/WebKitTools/Scripts/run-drosera b/WebKitTools/Scripts/run-drosera deleted file mode 100644 index 925293c..0000000 --- a/WebKitTools/Scripts/run-drosera +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/perl -w - -# Copyright (C) 2005, 2007 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. -# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of -# its contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY APPLE 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 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. - -# Simplified "run" script for Web Kit Open Source Project. - -use strict; -use FindBin; -use lib $FindBin::Bin; -use webkitdirs; - -setConfiguration(); - -# Check to see that all the frameworks are built. -checkFrameworks(); - -exit exitStatus(runDrosera()); diff --git a/WebKitTools/Scripts/run-drosera-nightly.cmd b/WebKitTools/Scripts/run-drosera-nightly.cmd deleted file mode 100644 index 4f547fb..0000000 --- a/WebKitTools/Scripts/run-drosera-nightly.cmd +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -set script="%TMP%\run-drosera-nightly2.cmd" -set vsvars="%VS80COMNTOOLS%\vsvars32.bat" -if exist %vsvars% ( - copy %vsvars% "%script%" -) else ( - del "%script%" -) - -FindSafari.exe %1 /printSafariEnvironment >> "%script%" -echo Drosera.exe >> "%script%" -call %script% diff --git a/WebKitTools/Scripts/run-drosera.cmd b/WebKitTools/Scripts/run-drosera.cmd deleted file mode 100755 index 3b6e1f0..0000000 --- a/WebKitTools/Scripts/run-drosera.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@echo off -set script="%TMP%\run-drosera2.cmd" -FindSafari.exe %1 /printSafariEnvironment > "%script%" -call %script% -Drosera.exe diff --git a/WebKitTools/Scripts/run-iexploder-tests b/WebKitTools/Scripts/run-iexploder-tests index 6acff18..f5e8a6c 100755 --- a/WebKitTools/Scripts/run-iexploder-tests +++ b/WebKitTools/Scripts/run-iexploder-tests @@ -41,7 +41,7 @@ use webkitdirs; sub openHTTPDIfNeeded(); sub closeHTTPD(); -sub runSafari(); +sub runSafariWithIExploder(); # Argument handling my $guardMalloc = ''; @@ -69,7 +69,7 @@ if ($downloadTest) { system "/usr/bin/curl -o ~/Desktop/iexploder$downloadTest.html \"http://127.0.0.1:$httpdPort/iexploder.cgi?lookup=1&test=$downloadTest\""; print "Saved the test as iexploder$downloadTest.html on the desktop\n"; } else { - runSafari(); + runSafariWithIExploder(); print "Last generated tests:\n"; system "grep 'iexploder.cgi' /tmp/WebKit/access_log.txt | tail -n -5 | awk -F'[ =&\\?]' '{if (\$8 == \"lookup\") print \$11; else print \$9}'"; } @@ -77,7 +77,7 @@ if ($downloadTest) { closeHTTPD(); -sub runSafari() +sub runSafariWithIExploder() { my $redirectTo; if (@ARGV) { @@ -134,6 +134,7 @@ sub openHTTPDIfNeeded() $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|; my $documentRoot = "$iExploderDirectory/htdocs"; my $typesConfig = "$testDirectory/http/conf/mime.types"; + my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem"; my $listen = "127.0.0.1:$httpdPort"; open2(\*HTTPDIN, \*HTTPDOUT, $httpdPath, @@ -143,6 +144,7 @@ sub openHTTPDIfNeeded() "-c", "TypesConfig \"$typesConfig\"", "-c", "CustomLog \"/tmp/WebKit/access_log.txt\" common", "-c", "ErrorLog \"/tmp/WebKit/error_log.txt\"", + "-c", "SSLCertificateFile \"$sslCertificate\"", # Apache wouldn't run CGIs with permissions==700 otherwise "-c", "User \"#$<\""); diff --git a/WebKitTools/Scripts/run-javascriptcore-tests b/WebKitTools/Scripts/run-javascriptcore-tests index b47d630..afd0ab4 100755 --- a/WebKitTools/Scripts/run-javascriptcore-tests +++ b/WebKitTools/Scripts/run-javascriptcore-tests @@ -56,16 +56,20 @@ $configuration = configuration(); my @jsArgs; my @xcodeArgs; my $root; +my $run64Bit; # pre-evaluate arguments. jsDriver args have - preceding, xcode args do not. # special arguments # --root=<path to webkit root> use pre-built root # --gtk build gtk +# --no-64-bit or --64-bit foreach my $arg(@ARGV) { print $arg."\n"; if( $arg =~ /root=(.*)/ ){ $root = $1; } elsif( $arg =~ /^--gtk$/i || $arg =~ /^--qt$/i || $arg =~ /^--wx$/i ){ + } elsif( $arg =~ /(no-)?64-bit/ ) { + $run64Bit = !defined($1); } elsif( $arg =~ /^-/ or !($arg =~/=/)){ push( @jsArgs, $arg ); } else { @@ -75,19 +79,30 @@ foreach my $arg(@ARGV) { setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root)); +if (isOSX() && !isTiger()) { + my $preferredArch = preferredArchitecture("JavaScriptCore"); + setRun64Bit($run64Bit); + my $arch = preferredArchitecture("JavaScriptCore"); + if ($arch ne $preferredArch) { + push(@jsArgs, "-a", $arch); + } +} + if(!defined($root)){ chdirWebKit(); - my @args; - push(@args, "--" . $configuration); + push(@xcodeArgs, "--" . $configuration); # FIXME: These should be stored per-config and ignored here push(@xcodeArgs, "--qt") if isQt(); push(@xcodeArgs, "--gtk") if isGtk(); push(@xcodeArgs, "--wx") if isWx(); - my $buildResult = system "perl", "WebKitTools/Scripts/build-testkjs", @xcodeArgs; + my $arch = preferredArchitecture("JavaScriptCore"); + push(@xcodeArgs, "ARCHS=$arch") if (isOSX()); + + my $buildResult = system "perl", "WebKitTools/Scripts/build-jsc", @xcodeArgs; if ($buildResult) { - print STDERR "Compiling testkjs failed!\n"; + print STDERR "Compiling jsc failed!\n"; exit exitStatus($buildResult); } } @@ -98,20 +113,20 @@ chdir("JavaScriptCore"); my $productDir = productDir(); chdir "tests/mozilla" or die; - -$productDir .= "/JavaScriptCore" if (isQt() or isGtk()); +$productDir .= "/JavaScriptCore" if isQt(); +$productDir .= "/Programs" if isGtk(); $ENV{DYLD_FRAMEWORK_PATH} = $productDir; setPathForRunningWebKitApp(\%ENV) if isCygwin(); -sub testKJSPath($) +sub jscPath($) { my ($productDir) = @_; - my $testkjsName = "testkjs"; - $testkjsName .= "_debug" if (isCygwin() && ($configuration eq "Debug")); - return "$productDir/$testkjsName"; + my $jscName = "jsc"; + $jscName .= "_debug" if (isCygwin() && ($configuration eq "Debug")); + return "$productDir/$jscName"; } -my $result = system "perl", "jsDriver.pl", "-e", "kjs", "-s", testKJSPath($productDir), "-f", "actual.html", @jsArgs; +my $result = system "perl", "jsDriver.pl", "-e", "squirrelfish", "-s", jscPath($productDir), "-f", "actual.html", @jsArgs; exit exitStatus($result) if $result; my %failures; diff --git a/WebKitTools/Scripts/run-testkjs b/WebKitTools/Scripts/run-jsc index 5610bad..20dc5e8 100755 --- a/WebKitTools/Scripts/run-testkjs +++ b/WebKitTools/Scripts/run-jsc @@ -26,7 +26,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# This script runs a list of scripts through testkjs a specified number of times. +# This script runs a list of scripts through jsc a specified number of times. use strict; use warnings; @@ -35,7 +35,7 @@ use lib $FindBin::Bin; use Getopt::Long; use webkitdirs; -my $usage = "Usage: run-testkjs [--count run_count] [--verbose] shell_file [file2...]"; +my $usage = "Usage: run-jsc [--count run_count] [--verbose] shell_file [file2...]"; my $count = 1; my $verbose = 0; @@ -43,15 +43,15 @@ GetOptions("count|c=i" => \$count, "verbose|v" => \$verbose); die "$usage\n" if (@ARGV < 1); -my $testkjs = productDir() . "/testkjs @ARGV"; -$testkjs .= " 2> /dev/null" unless $verbose; +my $jsc = productDir() . "/jsc @ARGV"; +$jsc .= " 2> /dev/null" unless $verbose; my $dyld = productDir(); $ENV{"DYLD_FRAMEWORK_PATH"} = $dyld; -print STDERR "Running $count time(s): DYLD_FRAMEWORK_PATH=$dyld $testkjs\n"; +print STDERR "Running $count time(s): DYLD_FRAMEWORK_PATH=$dyld $jsc\n"; while ($count--) { - if (system("$testkjs") != 0) { + if (system("$jsc") != 0) { last; } } diff --git a/WebKitTools/Scripts/run-launcher b/WebKitTools/Scripts/run-launcher index 60f3c86..f2b58cb 100755 --- a/WebKitTools/Scripts/run-launcher +++ b/WebKitTools/Scripts/run-launcher @@ -27,7 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Simplified "run" script for Web Kit Open Source Project. +# Simplified "run" script for WebKit Open Source Project. use strict; use File::Spec::Functions qw/catdir/; @@ -45,26 +45,21 @@ my @args = @ARGV; checkFrameworks(); # Set paths according to the build system used -if (!$ENV{WEBKITAUTOTOOLS}) { +if (isQt()) { my $libDir = catdir(productDir(), 'lib'); - - if (isGtk()) { - $launcherPath = catdir($launcherPath, "WebKitTools", "GtkLauncher", "GtkLauncher"); - # Strip --gtk from the arg-list, since otherwise GtkLauncher will try to - # interpret it as a URL. - @args = grep(!/^(--gtk)$/, @args); - } elsif (isQt()) { - $launcherPath = catdir($launcherPath, "bin", "QtLauncher"); - } + $launcherPath = catdir($launcherPath, "bin", "QtLauncher"); # Set up LD_LIBRARY_PATH to point to the product directory. print "Starting webkit launcher with LD_LIBRARY_PATH set to point to built WebKit in $libDir.\n"; - + $ENV{LD_LIBRARY_PATH} = $ENV{LD_LIBRARY_PATH} ? "$libDir:$ENV{LD_LIBRARY_PATH}" : $libDir; + $ENV{DYLD_LIBRARY_PATH} = $ENV{DYLD_LIBRARY_PATH} ? "$libDir:$ENV{DYLD_LIBRARY_PATH}" : $libDir; } else { if (isGtk()) { $launcherPath = catdir($launcherPath, "Programs", "GtkLauncher"); + # Strip --gtk from the arg-list, since otherwise GtkLauncher will try to + # interpret it as a URL. @args = grep(!/^(--gtk)$/, @args); } diff --git a/WebKitTools/Scripts/run-mangleme-tests b/WebKitTools/Scripts/run-mangleme-tests index 78b5d14..93b7894 100755 --- a/WebKitTools/Scripts/run-mangleme-tests +++ b/WebKitTools/Scripts/run-mangleme-tests @@ -41,7 +41,7 @@ use webkitdirs; sub openHTTPDIfNeeded(); sub closeHTTPD(); -sub runSafari(); +sub runSafariWithMangleme(); # Argument handling my $guardMalloc = ''; @@ -72,7 +72,7 @@ if ($downloadTest) { system "/usr/bin/curl -o ~/Desktop/mangleme$downloadTest.html http://127.0.0.1:$httpdPort/remangle.cgi?$downloadTest"; print "Saved the test as mangleme$downloadTest.html on the desktop\n"; } else { - runSafari(); + runSafariWithMangleme(); print "Last generated tests:\n"; system "grep 'Mangle attempt' /tmp/WebKit/error_log.txt | tail -n -5 | awk ' {print \$4}'"; } @@ -80,7 +80,7 @@ if ($downloadTest) { closeHTTPD(); -sub runSafari() +sub runSafariWithMangleme() { my $redirectTo; if (@ARGV) { @@ -137,6 +137,7 @@ sub openHTTPDIfNeeded() $httpdConfig = "$testDirectory/http/conf/apache2-httpd.conf" if `$httpdPath -v` =~ m|Apache/2|; my $documentRoot = "$manglemeDirectory"; my $typesConfig = "$testDirectory/http/conf/mime.types"; + my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem"; my $listen = "127.0.0.1:$httpdPort"; open2(\*HTTPDIN, \*HTTPDOUT, $httpdPath, @@ -146,6 +147,7 @@ sub openHTTPDIfNeeded() "-c", "TypesConfig \"$typesConfig\"", "-c", "CustomLog \"/tmp/WebKit/access_log.txt\" common", "-c", "ErrorLog \"/tmp/WebKit/error_log.txt\"", + "-c", "SSLCertificateFile \"$sslCertificate\"", # Apache wouldn't run CGIs with permissions==700 otherwise "-c", "User \"#$<\""); diff --git a/WebKitTools/Scripts/run-safari b/WebKitTools/Scripts/run-safari index 4474b69..f31fed3 100755 --- a/WebKitTools/Scripts/run-safari +++ b/WebKitTools/Scripts/run-safari @@ -26,13 +26,35 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Simplified "run" script for Web Kit Open Source Project. +# Simplified "run" script for WebKit Open Source Project. use strict; use FindBin; +use Getopt::Long qw(:config pass_through); use lib $FindBin::Bin; use webkitdirs; +my $programName = basename($0); +my $showHelp = 0; +my $run64Bit; + +my $usage = <<EOF; +Usage: $programName [options] + --help Show this help message + --64-bit Run in 64-bit mode +EOF + +my $getOptionsResult = GetOptions( + 'help' => \$showHelp, + '64-bit!' => \$run64Bit +); + +if (!$getOptionsResult || $showHelp) { + print STDERR $usage; + exit 1; +} + +setRun64Bit($run64Bit); setConfiguration(); # Check to see that all the frameworks are built. diff --git a/WebKitTools/Scripts/run-sunspider b/WebKitTools/Scripts/run-sunspider index 8dfeabb..2e58418 100755 --- a/WebKitTools/Scripts/run-sunspider +++ b/WebKitTools/Scripts/run-sunspider @@ -41,6 +41,8 @@ my $testRuns = 10; # This number may be different from what sunspider defaults t my $runShark = 0; my $runShark20 = 0; my $runSharkCache = 0; +my $ubench = 0; +my $v8 = 0; my $setBaseline = 0; my $showHelp = 0; my $testsPattern; @@ -56,14 +58,18 @@ Usage: $programName [options] [options to pass to build system] --shark Sample with the Mac OS X "Shark" performance testing tool (implies --runs=1) --shark20 Like --shark, but with a 20 microsecond sampling interval --shark-cache Like --shark, but performs a L2 cache-miss sample instead of time sample + --ubench Use microbenchmark suite instead of regular tests (to check for core execution regressions) + --v8 Use the V8 benchmark suite. EOF -GetOptions('root=s' => sub { my ($value) = @_; $root = $value; setConfigurationProductDir(Cwd::abs_path($root)); }, +GetOptions('root=s' => sub { my ($x, $value) = @_; $root = $value; setConfigurationProductDir(Cwd::abs_path($root)); }, 'runs=i' => \$testRuns, 'set-baseline' => \$setBaseline, 'shark' => \$runShark, 'shark20' => \$runShark20, 'shark-cache' => \$runSharkCache, + 'ubench' => \$ubench, + 'v8' => \$v8, 'tests=s' => \$testsPattern, 'help' => \$showHelp); @@ -72,15 +78,15 @@ if ($showHelp) { exit 1; } -sub buildTestKJS +sub buildJSC { if (!defined($root)){ push(@ARGV, "--" . $configuration); chdirWebKit(); - my $buildResult = system "WebKitTools/Scripts/build-testkjs", @ARGV; + my $buildResult = system "WebKitTools/Scripts/build-jsc", @ARGV; if ($buildResult) { - print STDERR "Compiling testkjs failed!\n"; + print STDERR "Compiling jsc failed!\n"; exit exitStatus($buildResult); } } @@ -94,15 +100,15 @@ sub setupEnvironmentForExecution($) # FIXME: Other platforms may wish to augment this method to use LD_LIBRARY_PATH, etc. } -sub testKJSPath($) +sub jscPath($) { my ($productDir) = @_; - my $testkjsName = "testkjs"; - $testkjsName .= "_debug" if (isCygwin() && ($configuration eq "Debug")); - return "$productDir/$testkjsName"; + my $jscName = "jsc"; + $jscName .= "_debug" if (isCygwin() && ($configuration eq "Debug")); + return "$productDir/$jscName"; } -buildTestKJS(); +buildJSC(); chdirWebKit(); chdir("SunSpider"); @@ -112,12 +118,14 @@ my $productDir = productDir(); $productDir .= "/JavaScriptCore" if (isQt() or isGtk()); setupEnvironmentForExecution($productDir); -my @args = ("--shell", testKJSPath($productDir), "--runs", $testRuns); +my @args = ("--shell", jscPath($productDir), "--runs", $testRuns); # This code could be removed if we chose to pass extra args to sunspider instead of Xcode push @args, "--set-baseline" if $setBaseline; push @args, "--shark" if $runShark; push @args, "--shark20" if $runShark20; push @args, "--shark-cache" if $runSharkCache; +push @args, "--ubench" if $ubench; +push @args, "--v8" if $v8; push @args, "--tests", $testsPattern if $testsPattern; exec "./sunspider", @args; diff --git a/WebKitTools/Scripts/run-webkit-tests b/WebKitTools/Scripts/run-webkit-tests index 3b6bbb3..4f129b7 100755 --- a/WebKitTools/Scripts/run-webkit-tests +++ b/WebKitTools/Scripts/run-webkit-tests @@ -29,7 +29,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Script to run the Web Kit Open Source Project layout tests. +# Script to run the WebKit Open Source Project layout tests. # Run all the tests passed in on the command line. # If no tests are passed, find all the .html, .shtml, .xml, .xhtml, .pl, .php (and svg) files in the test directory. @@ -48,6 +48,7 @@ use strict; use warnings; use Cwd; +use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK); use File::Basename; use File::Copy; use File::Find; @@ -58,7 +59,7 @@ use FindBin; use Getopt::Long; use IPC::Open2; use IPC::Open3; -use Time::HiRes qw(time); +use Time::HiRes qw(time usleep); use List::Util 'shuffle'; @@ -81,20 +82,27 @@ sub splitpath($); sub stripExtension($); sub isTextOnlyTest($); sub expectedDirectoryForTest($;$;$); +sub countFinishedTest($$$$); +sub testCrashedOrTimedOut($$$$$); +sub sampleDumpTool(); sub printFailureMessageForTest($$); sub toURL($); sub toWindowsPath($); sub closeCygpaths(); sub validateSkippedArg($$;$); -sub htmlForExpectedAndActualResults($); +sub htmlForResultsSection(\@$&); sub deleteExpectedAndActualResults($); sub recordActualResultsAndDiff($$); sub buildPlatformHierarchy(); sub epiloguesAndPrologues($$); sub parseLeaksandPrintUniqueLeaks(); +sub readFromDumpToolWithTimer(*;$); +sub setFileHandleNonBlocking(*$); +sub writeToFile($$); # Argument handling my $addPlatformExceptions = 0; +my $complexText = 0; my $configuration = configuration(); my $guardMalloc = ''; my $httpdPort = 8000; @@ -104,29 +112,29 @@ my $launchSafari = 1; my $platform; my $pixelTests = ''; my $quiet = ''; -my $repaintSweepHorizontally = ''; -my $repaintTests = ''; my $report10Slowest = 0; my $resetResults = 0; my $shouldCheckLeaks = 0; my $showHelp = 0; -my $testsPerDumpTool = 1000; +my $testsPerDumpTool; my $testHTTP = 1; my $testMedia = 1; my $testResultsDirectory = "/tmp/layout-test-results"; my $threaded = 0; -my $threshold = 0; +my $tolerance = 0; my $treatSkipped = "default"; my $verbose = 0; my $useValgrind = 0; my $strictTesting = 0; my $generateNewResults = 1; my $stripEditingCallbacks = isCygwin(); +my $runSample = 1; my $root; my $reverseTests = 0; my $randomizeTests = 0; my $mergeDepth; my @leaksFilenames; +my $run64Bit; # Default to --no-http for Qt, Gtk and wx for now. $testHTTP = 0 if (isQt() || isGtk() || isWx()); @@ -140,6 +148,8 @@ if (isTiger()) { $platform = "mac-tiger"; } elsif (isLeopard()) { $platform = "mac-leopard"; +} elsif (isSnowLeopard()) { + $platform = "mac-snowleopard"; } elsif (isOSX()) { $platform = "mac"; } elsif (isQt()) { @@ -158,30 +168,32 @@ if (!defined($platform)) { my $programName = basename($0); my $launchSafariDefault = $launchSafari ? "launch" : "do not launch"; my $httpDefault = $testHTTP ? "run" : "do not run"; +my $sampleDefault = $runSample ? "run" : "do not run"; # FIXME: "--strict" should be renamed to qt-mac-comparison, or something along those lines. my $usage = <<EOF; Usage: $programName [options] [testdir|testpath ...] --add-platform-exceptions Put new results for non-platform-specific failing tests into the platform-specific results directory + --complex-text Use the complex text code path for all text (Mac OS X and Windows only) -c|--configuration config Set DumpRenderTree build configuration -g|--guard-malloc Enable malloc guard --help Show this help message - -h|--horizontal-sweep Change repaint to sweep horizontally instead of vertically (implies --repaint-tests) --[no-]http Run (or do not run) http tests (default: $httpDefault) -i|--ignore-tests Comma-separated list of directories or tests to ignore --[no-]launch-safari Launch (or do not launch) Safari to display test results (default: $launchSafariDefault) -l|--leaks Enable leaks checking --[no-]new-test-results Generate results for new tests -p|--pixel-tests Enable pixel tests + --tolerance t Ignore image differences less than this percentage (implies --pixel-tests) --platform Override the detected platform to use for tests and results (default: $platform) --port Web server port to use with http tests -q|--quiet Less verbose output - -r|--repaint-tests Run repaint tests (implies --pixel-tests) --reset-results Reset ALL results (including pixel tests if --pixel-tests is set) -o|--results-directory Output results directory (default: $testResultsDirectory) --random Run the tests in a random order --reverse Run the tests in reverse alphabetical order --root Path to root tools build + --[no-]sample-on-timeout Run sample on timeout (default: $sampleDefault) (Mac OS X only) -1|--singly Isolate each test case run (implies --verbose) --skipped=[default|ignore|only] Specifies how to treat the Skipped file default: Tests/directories listed in the Skipped file are not tested @@ -191,18 +203,20 @@ Usage: $programName [options] [testdir|testpath ...] --strict Do a comparison with the output on Mac (Qt only) --[no-]strip-editing-callbacks Remove editing callbacks from expected results -t|--threaded Run a concurrent JavaScript thead with each test - --threshold t Ignore pixel value deviations less than or equal to t --valgrind Run DumpRenderTree inside valgrind (Qt/Linux only) -v|--verbose More verbose output (overrides --quiet) -m|--merge-leak-depth arg Merges leak callStacks and prints the number of unique leaks beneath a callstack depth of arg. Defaults to 5. + --64-bit run in 64bit mode EOF +# Process @ARGV for configuration switches before calling GetOptions() +$configuration = passedConfiguration() || configuration(); + my $getOptionsResult = GetOptions( + 'complex-text' => \$complexText, 'c|configuration=s' => \$configuration, - 'debug|devel' => sub { $configuration = "Debug" }, 'guard-malloc|g' => \$guardMalloc, 'help' => \$showHelp, - 'horizontal-sweep|h' => \$repaintSweepHorizontally, 'http!' => \$testHTTP, 'ignore-tests|i=s' => \$ignoreTests, 'launch-safari!' => \$launchSafari, @@ -211,8 +225,6 @@ my $getOptionsResult = GetOptions( 'platform=s' => \$platform, 'port=i' => \$httpdPort, 'quiet|q' => \$quiet, - 'release|deploy' => sub { $configuration = "Release" }, - 'repaint-tests|r' => \$repaintTests, 'reset-results' => \$resetResults, 'new-test-results!' => \$generateNewResults, 'results-directory|o=s' => \$testResultsDirectory, @@ -221,9 +233,10 @@ my $getOptionsResult = GetOptions( 'skipped=s' => \&validateSkippedArg, 'slowest' => \$report10Slowest, 'threaded|t' => \$threaded, - 'threshold=i' => \$threshold, + 'tolerance=f' => \$tolerance, 'verbose|v' => \$verbose, 'valgrind' => \$useValgrind, + 'sample-on-timeout!' => \$runSample, 'strict' => \$strictTesting, 'strip-editing-callbacks!' => \$stripEditingCallbacks, 'random' => \$randomizeTests, @@ -231,6 +244,7 @@ my $getOptionsResult = GetOptions( 'root=s' => \$root, 'add-platform-exceptions' => \$addPlatformExceptions, 'merge-leak-depth|m:5' => \$mergeDepth, + '64-bit!' => \$run64Bit ); if (!$getOptionsResult || $showHelp) { @@ -247,10 +261,9 @@ setConfiguration($configuration); my $configurationOption = "--" . lc($configuration); -$repaintTests = 1 if $repaintSweepHorizontally; +$pixelTests = 1 if $tolerance > 0; -$pixelTests = 1 if $repaintTests; -$pixelTests = 1 if $threshold > 0; +$testsPerDumpTool = 1000 if !$testsPerDumpTool; $verbose = 1 if $testsPerDumpTool == 1; @@ -263,25 +276,24 @@ $testMedia = 0 if $shouldCheckLeaks && isTiger(); setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root)); my $productDir = productDir(); -$productDir .= "/bin" if (isQt()); - -if (isGtk()) { - if ($ENV{WEBKITAUTOTOOLS}) { - $productDir .= "/Programs"; - } else { - $productDir .= "/WebKitTools/DumpRenderTree/gtk"; - } -} +$productDir .= "/bin" if isQt(); +$productDir .= "/Programs" if isGtk(); +setRun64Bit($run64Bit); chdirWebKit(); -if(!defined($root)){ +if (!defined($root)) { # Push the parameters to build-dumprendertree as an array my @args; - push(@args, "--" . $configuration); + push(@args, $configurationOption); push(@args, "--qt") if isQt(); push(@args, "--gtk") if isGtk(); + if (isOSX()) { + my $arch = preferredArchitecture(); + push(@args, "ARCHS=$arch"); + } + my $buildResult = system "WebKitTools/Scripts/build-dumprendertree", @args; if ($buildResult) { print STDERR "Compiling DumpRenderTree failed!\n"; @@ -295,6 +307,7 @@ my $dumpTool = "$productDir/$dumpToolName"; die "can't find executable $dumpToolName (looked in $productDir)\n" unless -x $dumpTool; my $imageDiffTool = "$productDir/ImageDiff"; +$imageDiffTool .= "_debug" if isCygwin() && $configuration ne "Release"; die "can't find executable $imageDiffTool (looked in $productDir)\n" if $pixelTests && !-x $imageDiffTool; checkFrameworks() unless isCygwin(); @@ -434,15 +447,13 @@ my $leaksOutputFileNumber = 1; my $totalLeaks = 0; my @toolArgs = (); -push @toolArgs, "--dump-all-pixels" if $pixelTests && $resetResults; push @toolArgs, "--pixel-tests" if $pixelTests; -push @toolArgs, "--repaint" if $repaintTests; -push @toolArgs, "--horizontal-sweep" if $repaintSweepHorizontally; push @toolArgs, "--threaded" if $threaded; +push @toolArgs, "--complex-text" if $complexText; push @toolArgs, "-"; my @diffToolArgs = (); -push @diffToolArgs, "--threshold", $threshold; +push @diffToolArgs, "--tolerance", $tolerance; $| = 1; @@ -451,6 +462,7 @@ if ($pixelTests) { local %ENV; $ENV{MallocStackLogging} = 1 if $shouldCheckLeaks; $imageDiffToolPID = open2(\*DIFFIN, \*DIFFOUT, $imageDiffTool, @diffToolArgs) or die "unable to open $imageDiffTool\n"; + $ENV{MallocStackLogging} = 0 if $shouldCheckLeaks; } my $dumpToolPID; @@ -468,7 +480,7 @@ $SIG{"PIPE"} = "catch_pipe"; print "Testing ", scalar @tests, " test cases.\n"; my $overallStartTime = time; -my %expectedResultDirectory; +my %expectedResultPaths; # Reverse the tests @tests = reverse @tests if $reverseTests; @@ -483,6 +495,7 @@ for my $test (@tests) { openDumpTool(); my $base = stripExtension($test); + my $expectedExtension = ".txt"; my $dir = $base; $dir =~ s|/[^/]+$||; @@ -498,7 +511,11 @@ for my $test (@tests) { print "running epilogue or prologue $logue\n"; } print OUT "$logue\n"; - # Discard the output. + # Throw away output from DumpRenderTree. + # Once for the test output and once for pixel results (empty) + while (<IN>) { + last if /#EOF/; + } while (<IN>) { last if /#EOF/; } @@ -523,6 +540,20 @@ for my $test (@tests) { my $startTime = time if $report10Slowest; + # Try to read expected hash file for pixel tests + my $suffixExpectedHash = ""; + if ($pixelTests && !$resetResults) { + my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png"); + if (open EXPECTEDHASH, "$expectedPixelDir/$base-$expectedTag.checksum") { + my $expectedHash = <EXPECTEDHASH>; + chomp($expectedHash); + close EXPECTEDHASH; + + # Format expected hash into a suffix string that is appended to the path / URL passed to DRT + $suffixExpectedHash = "'$expectedHash"; + } + } + if ($test !~ /^http\//) { my $testPath = "$testDirectory/$test"; if (isCygwin()) { @@ -530,17 +561,17 @@ for my $test (@tests) { } else { $testPath = canonpath($testPath); } - print OUT "$testPath\n"; + print OUT "$testPath$suffixExpectedHash\n"; } else { openHTTPDIfNeeded(); if ($test !~ /^http\/tests\/local\// && $test !~ /^http\/tests\/ssl\// && $test !~ /^http\/tests\/media\//) { my $path = canonpath($test); $path =~ s/^http\/tests\///; - print OUT "http://127.0.0.1:$httpdPort/$path\n"; + print OUT "http://127.0.0.1:$httpdPort/$path$suffixExpectedHash\n"; } elsif ($test =~ /^http\/tests\/ssl\//) { my $path = canonpath($test); $path =~ s/^http\/tests\///; - print OUT "https://127.0.0.1:$httpdSSLPort/$path\n"; + print OUT "https://127.0.0.1:$httpdSSLPort/$path$suffixExpectedHash\n"; } else { my $testPath = "$testDirectory/$test"; if (isCygwin()) { @@ -548,25 +579,42 @@ for my $test (@tests) { } else { $testPath = canonpath($testPath); } - print OUT "$testPath\n"; + print OUT "$testPath$suffixExpectedHash\n"; } } - my $actual = ""; - while (<IN>) { - last if /#EOF/; - $actual .= $_; - } + # DumpRenderTree is expected to dump two "blocks" to stdout for each test. + # Each block is terminated by a #EOF on a line by itself. + # The first block is the output of the test (in text, RenderTree or other formats). + # The second block is for optional pixel data in PNG format, and may be empty if + # pixel tests are not being run, or the test does not dump pixels (e.g. text tests). + + my $actualRead = readFromDumpToolWithTimer(IN); + my $errorRead = readFromDumpToolWithTimer(ERROR, $actualRead->{status} eq "timedOut"); + + my $actual = $actualRead->{output}; + my $error = $errorRead->{output}; + + $expectedExtension = $actualRead->{extension}; + my $expectedFileName = "$base-$expectedTag.$expectedExtension"; my $isText = isTextOnlyTest($actual); + my $expectedDir = expectedDirectoryForTest($base, $isText, $expectedExtension); + $expectedResultPaths{$base} = "$expectedDir/$expectedFileName"; + + unless ($actualRead->{status} eq "success" && $errorRead->{status} eq "success") { + my $crashed = $actualRead->{status} eq "crashed" || $errorRead->{status} eq "crashed"; + testCrashedOrTimedOut($test, $base, $crashed, $actual, $error); + countFinishedTest($test, $base, $crashed ? "crash" : "timedout", 0); + next; + } + $durations{$test} = time - $startTime if $report10Slowest; my $expected; - my $expectedDir = expectedDirectoryForTest($base, $isText, 0); - $expectedResultDirectory{$base} = $expectedDir; - if (!$resetResults && open EXPECTED, "<", "$expectedDir/$base-$expectedTag.txt") { + if (!$resetResults && open EXPECTED, "<", "$expectedDir/$expectedFileName") { $expected = ""; while (<EXPECTED>) { next if $stripEditingCallbacks && $_ =~ /^EDITING DELEGATE:/; @@ -576,7 +624,7 @@ for my $test (@tests) { } my $expectedMac; if (!isOSX() && $strictTesting && !$isText) { - if (!$resetResults && open EXPECTED, "<", "$testDirectory/platform/mac/$base-$expectedTag.txt") { + if (!$resetResults && open EXPECTED, "<", "$testDirectory/platform/mac/$expectedFileName") { $expectedMac = ""; while (<EXPECTED>) { $expectedMac .= $_; @@ -593,64 +641,77 @@ for my $test (@tests) { my $diffPNG = ""; my $diffPercentage = ""; my $diffResult = "passed"; - - if ($pixelTests) { - my $expectedPixelDir = expectedDirectoryForTest($base, $isText, 1); - - my $actualHash = ""; - my $expectedHash = ""; - my $actualPNGSize = 0; - - while (<IN>) { - last if /#EOF/; - if (/ActualHash: ([a-f0-9]{32})/) { - $actualHash = $1; - } elsif (/BaselineHash: ([a-f0-9]{32})/) { - $expectedHash = $1; - } elsif (/Content-length: (\d+)\s*/) { - $actualPNGSize = $1; - read(IN, $actualPNG, $actualPNGSize); - } + + my $actualHash = ""; + my $expectedHash = ""; + my $actualPNGSize = 0; + + while (<IN>) { + last if /#EOF/; + if (/ActualHash: ([a-f0-9]{32})/) { + $actualHash = $1; + } elsif (/ExpectedHash: ([a-f0-9]{32})/) { + $expectedHash = $1; + } elsif (/Content-Length: (\d+)\s*/) { + $actualPNGSize = $1; + read(IN, $actualPNG, $actualPNGSize); } + } + + if ($verbose && $pixelTests && !$resetResults && $actualPNGSize) { + if ($actualHash eq "" && $expectedHash eq "") { + printFailureMessageForTest($test, "WARNING: actual & expected pixel hashes are missing!"); + } elsif ($actualHash eq "") { + printFailureMessageForTest($test, "WARNING: actual pixel hash is missing!"); + } elsif ($expectedHash eq "") { + printFailureMessageForTest($test, "WARNING: expected pixel hash is missing!"); + } + } - if ($expectedHash ne $actualHash && -f "$expectedPixelDir/$base-$expectedTag.png") { - my $expectedPNGSize = -s "$expectedPixelDir/$base-$expectedTag.png"; - my $expectedPNG = ""; - open EXPECTEDPNG, "$expectedPixelDir/$base-$expectedTag.png"; - read(EXPECTEDPNG, $expectedPNG, $expectedPNGSize); + if ($actualPNGSize > 0) { + my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png"); - print DIFFOUT "Content-length: $actualPNGSize\n"; - print DIFFOUT $actualPNG; + if (!$resetResults && ($expectedHash ne $actualHash || ($actualHash eq "" && $expectedHash eq ""))) { + if (-f "$expectedPixelDir/$base-$expectedTag.png") { + my $expectedPNGSize = -s "$expectedPixelDir/$base-$expectedTag.png"; + my $expectedPNG = ""; + open EXPECTEDPNG, "$expectedPixelDir/$base-$expectedTag.png"; + read(EXPECTEDPNG, $expectedPNG, $expectedPNGSize); - print DIFFOUT "Content-length: $expectedPNGSize\n"; - print DIFFOUT $expectedPNG; + print DIFFOUT "Content-Length: $actualPNGSize\n"; + print DIFFOUT $actualPNG; - while (<DIFFIN>) { - last if /^error/ || /^diff:/; - if (/Content-length: (\d+)\s*/) { - read(DIFFIN, $diffPNG, $1); + print DIFFOUT "Content-Length: $expectedPNGSize\n"; + print DIFFOUT $expectedPNG; + + while (<DIFFIN>) { + last if /^error/ || /^diff:/; + if (/Content-Length: (\d+)\s*/) { + read(DIFFIN, $diffPNG, $1); + } } - } - if (/^diff: (.+)% (passed|failed)/) { - $diffPercentage = $1; - $imageDifferences{$base} = $diffPercentage; - $diffResult = $2; + if (/^diff: (.+)% (passed|failed)/) { + $diffPercentage = $1; + $imageDifferences{$base} = $diffPercentage; + $diffResult = $2; + } + + if ($diffPercentage == 0) { + printFailureMessageForTest($test, "pixel hash failed (but pixel test still passes)"); + } + } elsif ($verbose) { + printFailureMessageForTest($test, "WARNING: expected image is missing!"); } } - if ($actualPNGSize && ($resetResults || !-f "$expectedPixelDir/$base-$expectedTag.png")) { + if ($resetResults || !-f "$expectedPixelDir/$base-$expectedTag.png") { mkpath catfile($expectedPixelDir, dirname($base)) if $testDirectory ne $expectedPixelDir; - open EXPECTED, ">", "$expectedPixelDir/$base-expected.png" or die "could not create $expectedPixelDir/$base-expected.png\n"; - print EXPECTED $actualPNG; - close EXPECTED; + writeToFile("$expectedPixelDir/$base-$expectedTag.png", $actualPNG); } - # update the expected hash if the image diff said that there was no difference if ($actualHash ne "" && ($resetResults || !-f "$expectedPixelDir/$base-$expectedTag.checksum")) { - open EXPECTED, ">", "$expectedPixelDir/$base-$expectedTag.checksum" or die "could not create $expectedPixelDir/$base-$expectedTag.checksum\n"; - print EXPECTED $actualHash; - close EXPECTED; + writeToFile("$expectedPixelDir/$base-$expectedTag.checksum", $actualHash); } } @@ -691,16 +752,12 @@ for my $test (@tests) { $expectedMac =~ s/\s+"\n/"\n/g; if ($simplified_actual ne $expectedMac) { - open ACTUAL, ">", "/tmp/actual.txt" or die; - print ACTUAL $simplified_actual; - close ACTUAL; - open ACTUAL, ">", "/tmp/expected.txt" or die; - print ACTUAL $expectedMac; - close ACTUAL; + writeToFile("/tmp/actual.txt", $simplified_actual); + writeToFile("/tmp/expected.txt", $expectedMac); system "diff -u \"/tmp/expected.txt\" \"/tmp/actual.txt\" > \"/tmp/simplified.diff\""; $diffResult = "failed"; - if($verbose) { + if ($verbose) { print "\n"; system "cat /tmp/simplified.diff"; print "failed!!!!!"; @@ -711,22 +768,7 @@ for my $test (@tests) { if (dumpToolDidCrash()) { $result = "crash"; - - printFailureMessageForTest($test, "crashed"); - - my $dir = "$testResultsDirectory/$base"; - $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n"; - mkpath $dir; - - deleteExpectedAndActualResults($base); - - open CRASH, ">", "$testResultsDirectory/$base-$errorTag.txt" or die; - print CRASH <ERROR>; - close CRASH; - - recordActualResultsAndDiff($base, $actual); - - closeDumpTool(); + testCrashedOrTimedOut($test, $base, 1, $actual, $error); } elsif (!defined $expected) { if ($verbose) { print "new " . ($resetResults ? "result" : "test") ."\n"; @@ -736,9 +778,7 @@ for my $test (@tests) { if ($generateNewResults || $resetResults) { mkpath catfile($expectedDir, dirname($base)) if $testDirectory ne $expectedDir; - open EXPECTED, ">", "$expectedDir/$base-$expectedTag.txt" or die "could not create $expectedDir/$base-$expectedTag.txt\n"; - print EXPECTED $actual; - close EXPECTED; + writeToFile("$expectedDir/$expectedFileName", $actual); } deleteExpectedAndActualResults($base); unless ($resetResults) { @@ -771,10 +811,8 @@ for my $test (@tests) { my $expectedResultIsMaximallyPlatformSpecific = $expectedBase =~ m|^\Q$platformTestDirectory\E/|; if (!$testIsMaximallyPlatformSpecific && !$expectedResultIsMaximallyPlatformSpecific) { mkpath catfile($platformTestDirectory, dirname($base)); - my $expectedFile = catfile($platformTestDirectory, "$base-$expectedTag.txt"); - open EXPECTED, ">", $expectedFile or die "could not create $expectedFile\n"; - print EXPECTED $actual; - close EXPECTED; + my $expectedFile = catfile($platformTestDirectory, "$expectedFileName"); + writeToFile("$expectedFile", $actual); $message .= " (results generated in $platformTestDirectory)"; } } @@ -792,15 +830,11 @@ for my $test (@tests) { if ($pixelTests && $diffPNG && $diffPNG ne "") { $imagesPresent{$base} = 1; - open ACTUAL, ">", "$testResultsDirectory/$base-$actualTag.png" or die; - print ACTUAL $actualPNG; - close ACTUAL; + writeToFile("$testResultsDirectory/$base-$actualTag.png", $actualPNG); + writeToFile("$testResultsDirectory/$base-$diffsTag.png", $diffPNG); - open DIFF, ">", "$testResultsDirectory/$base-$diffsTag.png" or die; - print DIFF $diffPNG; - close DIFF; - - copy("$expectedDir/$base-$expectedTag.png", "$testResultsDirectory/$base-$expectedTag.png"); + my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png"); + copy("$expectedPixelDir/$base-$expectedTag.png", "$testResultsDirectory/$base-$expectedTag.png"); open DIFFHTML, ">$testResultsDirectory/$base-$diffsTag.html" or die; print DIFFHTML "<html>\n"; @@ -847,26 +881,18 @@ for my $test (@tests) { } } - if (($count + 1) % $testsPerDumpTool == 0 || $count == $#tests) { - if ($shouldCheckLeaks) { - my $fileName; - if ($testsPerDumpTool == 1) { - $fileName = "$testResultsDirectory/$base-leaks.txt"; - } else { - $fileName = "$testResultsDirectory/" . fileNameWithNumber($dumpToolName, $leaksOutputFileNumber) . "-leaks.txt"; - } - my $leakCount = countAndPrintLeaks($dumpToolName, $dumpToolPID, $fileName); - $totalLeaks += $leakCount; - $leaksOutputFileNumber++ if ($leakCount); - } - - closeDumpTool(); + if ($error) { + my $dir = "$testResultsDirectory/$base"; + $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n"; + mkpath $dir; + + writeToFile("$testResultsDirectory/$base-$errorTag.txt", $error); + + $counts{error}++; + push @{$tests{error}}, $test; } - $count++; - $counts{$result}++; - push @{$tests{$result}}, $test; - $testType{$test} = $isText; + countFinishedTest($test, $base, $result, $isText); } printf "\n%0.2fs total testing time\n", (time - $overallStartTime) . ""; @@ -926,10 +952,12 @@ my %text = ( match => "succeeded", mismatch => "had incorrect layout", new => "were new", + timedout => "timed out", crash => "crashed", + error => "had stderr output" ); -for my $type ("match", "mismatch", "new", "crash") { +for my $type ("match", "mismatch", "new", "timedout", "crash", "error") { my $c = $counts{$type}; if ($c) { my $t = $text{$type}; @@ -954,66 +982,18 @@ print HTML "<title>Layout Test Results</title>\n"; print HTML "</head>\n"; print HTML "<body>\n"; -if ($counts{mismatch}) { - print HTML "<p>Tests where results did not match expected results:</p>\n"; - print HTML "<table>\n"; - for my $test (@{$tests{mismatch}}) { - my $base = stripExtension($test); - print HTML "<tr>\n"; - print HTML "<td><a href=\"" . toURL("$testDirectory/$test") . "\">$test</a></td>\n"; - print HTML htmlForExpectedAndActualResults($base); - if ($pixelTests) { - if ($imagesPresent{$base}) { - print HTML "<td><a href=\"$base-$expectedTag.png\">expected image</a></td>\n"; - print HTML "<td><a href=\"$base-$diffsTag.html\">image diffs</a>\n"; - print HTML "<a href=\"$base-$diffsTag.png\">$imageDifferences{$base}%</a></td>\n"; - } else { - print HTML "<td></td><td></td>\n"; - } - } - print HTML "</tr>\n"; - } - print HTML "</table>\n"; -} - -if ($counts{crash}) { - print HTML "<p>Tests that caused the DumpRenderTree tool to crash:</p>\n"; - print HTML "<table>\n"; - for my $test (@{$tests{crash}}) { - my $base = stripExtension($test); - my $expectedDir = $expectedResultDirectory{$base}; - print HTML "<tr>\n"; - print HTML "<td><a href=\"" . toURL("$testDirectory/$test") . "\">$base</a></td>\n"; - print HTML htmlForExpectedAndActualResults($base); - print HTML "<td><a href=\"$base-$errorTag.txt\">stderr</a></td>\n"; - print HTML "</tr>\n"; - } - print HTML "</table>\n"; -} - -if ($counts{new}) { - print HTML "<p>Tests that had no expected results (probably new):</p>\n"; - print HTML "<table>\n"; - for my $test (@{$tests{new}}) { - my $base = stripExtension($test); - my $expectedDir = $expectedResultDirectory{$base}; - print HTML "<tr>\n"; - print HTML "<td><a href=\"" . toURL("$testDirectory/$test") . "\">$base</a></td>\n"; - print HTML "<td><a href=\"" . toURL("$expectedDir/$base-$expectedTag.txt") . "\">results</a></td>\n"; - if ($pixelTests && -f "$expectedDir/$base-$expectedTag.png") { - print HTML "<td><a href=\"" . toURL("$expectedDir/$base-$expectedTag.png") . "\">image</a></td>\n"; - } - print HTML "</tr>\n"; - } - print HTML "</table>\n"; -} +print HTML htmlForResultsSection(@{$tests{mismatch}}, "Tests where results did not match expected results", \&linksForMismatchTest); +print HTML htmlForResultsSection(@{$tests{timedout}}, "Tests that timed out", \&linksForErrorTest); +print HTML htmlForResultsSection(@{$tests{crash}}, "Tests that caused the DumpRenderTree tool to crash", \&linksForErrorTest); +print HTML htmlForResultsSection(@{$tests{error}}, "Tests that had stderr output", \&linksForErrorTest); +print HTML htmlForResultsSection(@{$tests{new}}, "Tests that had no expected results (probably new)", \&linksForNewTest); print HTML "</body>\n"; print HTML "</html>\n"; close HTML; if (isQt()) { - system "konqueror", $testResults if $launchSafari; + system "WebKitTools/Scripts/run-launcher", "--qt", $configurationOption, $testResults if $launchSafari; } elsif (isGtk()) { system "WebKitTools/Scripts/run-launcher", "--gtk", $configurationOption, $testResults if $launchSafari; } elsif (isCygwin()) { @@ -1079,8 +1059,9 @@ sub countAndPrintLeaks($$$) "_CFHTTPReadStreamReadMark", # leak in CFNetwork, rdar://problem/5441468 "httpProtocolStart", # leak in CFNetwork, rdar://problem/5468837 "_CFURLConnectionSendCallbacks", # leak in CFNetwork, rdar://problem/5441600 - "DispatchQTMsg", # leak in Quicktime, PPC only, <rdar://problem/5667132> - "QTMovieContentView createVisualContext", # leak in Quicktime, PPC only, <rdar://problem/5667132> + "DispatchQTMsg", # leak in QuickTime, PPC only, rdar://problem/5667132 + "QTMovieContentView createVisualContext", # leak in QuickTime, PPC only, rdar://problem/5667132 + "_CopyArchitecturesForJVMVersion", # leak in Java, rdar://problem/5910823 ); } @@ -1111,9 +1092,7 @@ sub countAndPrintLeaks($$$) print " + $count leaks ($bytes bytes) were found, details in $leaksFilePath\n"; } - open LEAKS, ">", $leaksFilePath or die; - print LEAKS $leaksOutput; - close LEAKS; + writeToFile($leaksFilePath, $leaksOutput); push( @leaksFilenames, $leaksFilePath ); } @@ -1121,6 +1100,14 @@ sub countAndPrintLeaks($$$) return $adjustedCount; } +sub writeToFile($$) +{ + my ($filePath, $contents) = @_; + open NEWFILE, ">", "$filePath" or die "could not create $filePath\n"; + print NEWFILE $contents; + close NEWFILE; +} + # Break up a path into the directory (with slash) and base name. sub splitpath($) { @@ -1220,7 +1207,6 @@ sub openDumpTool() } $ENV{DYLD_FRAMEWORK_PATH} = $productDir; $ENV{XML_CATALOG_FILES} = ""; # work around missing /etc/catalog <rdar://problem/4292995> - $ENV{MallocStackLogging} = 1 if $shouldCheckLeaks; $ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc; if (isCygwin()) { @@ -1231,16 +1217,21 @@ sub openDumpTool() } setPathForRunningWebKitApp(\%ENV) if isCygwin(); } - - my @args = (); - if ($useValgrind) { - push @args, $dumpTool; + + exportArchPreference(); + + my @args = @toolArgs; + unshift @args, $dumpTool; + if (isOSX and !isTiger()) { + unshift @args, "arch"; } - push @args, @toolArgs; if ($useValgrind) { - $dumpTool = "valgrind"; - } - $dumpToolPID = open3(\*OUT, \*IN, \*ERROR, $dumpTool, @args) or die "Failed to start tool: $dumpTool\n"; + unshift @args, "valgrind"; + } + + $ENV{MallocStackLogging} = 1 if $shouldCheckLeaks; + $dumpToolPID = open3(\*OUT, \*IN, \*ERROR, @args) or die "Failed to start tool: $dumpTool\n"; + $ENV{MallocStackLogging} = 0 if $shouldCheckLeaks; $isDumpToolOpen = 1; $dumpToolCrashed = 0; } @@ -1251,8 +1242,15 @@ sub closeDumpTool() close IN; close OUT; - close ERROR; waitpid $dumpToolPID, 0; + + # check for WebCore counter leaks. + if ($shouldCheckLeaks) { + while (<ERROR>) { + print; + } + } + close ERROR; $isDumpToolOpen = 0; } @@ -1262,7 +1260,17 @@ sub dumpToolDidCrash() return 0 unless $isDumpToolOpen; my $pid = waitpid(-1, WNOHANG); - return $pid == $dumpToolPID; + return 1 if ($pid == $dumpToolPID); + + # On Mac OS X, crashing may be significantly delayed by crash reporter. + return 0 unless isOSX(); + + my $tryingToExit = 0; + open PS, "ps -o state -p $dumpToolPID |"; + <PS>; # skip header + $tryingToExit = 1 if <PS> =~ /E/; + close PS; + return $tryingToExit; } sub openHTTPDIfNeeded() @@ -1402,21 +1410,15 @@ sub isTextOnlyTest($) sub expectedDirectoryForTest($;$;$) { - my ($base, $isText, $isPixelTest) = @_; + my ($base, $isText, $expectedExtension) = @_; my @directories = @platformHierarchy; push @directories, map { catdir($platformBaseDirectory, $_) } qw(mac-leopard mac) if isCygwin(); push @directories, $expectedDirectory; # If we already have expected results, just return their location. - if ($isPixelTest) { - foreach my $directory (@directories) { - return $directory if (-f "$directory/$base-$expectedTag.png"); - } - } else { - foreach my $directory (@directories) { - return $directory if (-f "$directory/$base-$expectedTag.txt"); - } + foreach my $directory (@directories) { + return $directory if (-f "$directory/$base-$expectedTag.$expectedExtension"); } # For platform-specific tests, the results should go right next to the test itself. @@ -1432,6 +1434,56 @@ sub expectedDirectoryForTest($;$;$) return $isText ? $expectedDirectory : $platformHierarchy[$#platformHierarchy]; } +sub countFinishedTest($$$$) { + my ($test, $base, $result, $isText) = @_; + + if (($count + 1) % $testsPerDumpTool == 0 || $count == $#tests) { + if ($shouldCheckLeaks) { + my $fileName; + if ($testsPerDumpTool == 1) { + $fileName = "$testResultsDirectory/$base-leaks.txt"; + } else { + $fileName = "$testResultsDirectory/" . fileNameWithNumber($dumpToolName, $leaksOutputFileNumber) . "-leaks.txt"; + } + my $leakCount = countAndPrintLeaks($dumpToolName, $dumpToolPID, $fileName); + $totalLeaks += $leakCount; + $leaksOutputFileNumber++ if ($leakCount); + } + + closeDumpTool(); + } + + $count++; + $counts{$result}++; + push @{$tests{$result}}, $test; + $testType{$test} = $isText; +} + +sub testCrashedOrTimedOut($$$$$) +{ + my ($test, $base, $didCrash, $actual, $error) = @_; + + printFailureMessageForTest($test, $didCrash ? "crashed" : "timed out"); + + sampleDumpTool() unless $didCrash; + + my $dir = "$testResultsDirectory/$base"; + $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n"; + mkpath $dir; + + deleteExpectedAndActualResults($base); + + if (defined($error) && length($error)) { + writeToFile("$testResultsDirectory/$base-$errorTag.txt", $error); + } + + recordActualResultsAndDiff($base, $actual); + + kill 9, $dumpToolPID unless $didCrash; + + closeDumpTool(); +} + sub printFailureMessageForTest($$) { my ($test, $description) = @_; @@ -1517,15 +1569,94 @@ sub validateSkippedArg($$;$) $treatSkipped = $value; } -sub htmlForExpectedAndActualResults($) +sub htmlForResultsSection(\@$&) +{ + my ($tests, $description, $linkGetter) = @_; + + my @html = (); + return join("\n", @html) unless @{$tests}; + + push @html, "<p>$description:</p>"; + push @html, "<table>"; + foreach my $test (@{$tests}) { + push @html, "<tr>"; + push @html, "<td><a href=\"" . toURL("$testDirectory/$test") . "\">$test</a></td>"; + foreach my $link (@{&{$linkGetter}($test)}) { + push @html, "<td><a href=\"$link->{href}\">$link->{text}</a></td>"; + } + push @html, "</tr>"; + } + push @html, "</table>"; + + return join("\n", @html); +} + +sub linksForExpectedAndActualResults($) { my ($base) = @_; - return "<td></td><td></td><td></td>\n" unless -s "$testResultsDirectory/$base-$diffsTag.txt"; + my @links = (); + + return \@links unless -s "$testResultsDirectory/$base-$diffsTag.txt"; + + my $expectedResultPath = $expectedResultPaths{$base}; + my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$}); + + push @links, { href => "$base-$expectedTag$expectedResultExtension", text => "expected" }; + push @links, { href => "$base-$actualTag$expectedResultExtension", text => "actual" }; + push @links, { href => "$base-$diffsTag.txt", text => "diffs" }; + + return \@links; +} + +sub linksForMismatchTest +{ + my ($test) = @_; + + my @links = (); + + my $base = stripExtension($test); + + push @links, @{linksForExpectedAndActualResults($base)}; + return \@links unless $pixelTests && $imagesPresent{$base}; + + push @links, { href => "$base-$expectedTag.png", text => "expected image" }; + push @links, { href => "$base-$diffsTag.html", text => "image diffs" }; + push @links, { href => "$base-$diffsTag.png", text => "$imageDifferences{$base}%" }; + + return \@links; +} + +sub linksForErrorTest +{ + my ($test) = @_; + + my @links = (); + + my $base = stripExtension($test); + + push @links, @{linksForExpectedAndActualResults($base)}; + push @links, { href => "$base-$errorTag.txt", text => "stderr" }; + + return \@links; +} + +sub linksForNewTest +{ + my ($test) = @_; - return "<td><a href=\"$base-$expectedTag.txt\">expected</a></td>\n" - . "<td><a href=\"$base-$actualTag.txt\">actual</a></td>\n" - . "<td><a href=\"$base-$diffsTag.txt\">diffs</a></td>\n"; + my @links = (); + + my $base = stripExtension($test); + my $expectedResultPath = $expectedResultPaths{$base}; + my $expectedResultPathMinusExtension = stripExtension($expectedResultPath); + + push @links, { href => toURL($expectedResultPath), text => "results" }; + if ($pixelTests && -f "$expectedResultPathMinusExtension.png") { + push @links, { href => toURL("$expectedResultPathMinusExtension.png"), text => "image" }; + } + + return \@links; } sub deleteExpectedAndActualResults($) @@ -1539,18 +1670,18 @@ sub deleteExpectedAndActualResults($) sub recordActualResultsAndDiff($$) { - my ($base, $actual) = @_; - - return unless length($actual); + my ($base, $actualResults) = @_; - open ACTUAL, ">", "$testResultsDirectory/$base-$actualTag.txt" or die "Couldn't open actual results file for $base"; - print ACTUAL $actual; - close ACTUAL; + return unless defined($actualResults) && length($actualResults); - my $expectedDir = $expectedResultDirectory{$base}; - copy("$expectedDir/$base-$expectedTag.txt", "$testResultsDirectory/$base-$expectedTag.txt"); + my $expectedResultPath = $expectedResultPaths{$base}; + my ($expectedResultFileNameMinusExtension, $expectedResultDirectoryPath, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$}); + my $actualResultsPath = "$testResultsDirectory/$base-$actualTag$expectedResultExtension"; + my $copiedExpectedResultsPath = "$testResultsDirectory/$base-$expectedTag$expectedResultExtension"; + writeToFile("$actualResultsPath", $actualResults); + copy("$expectedResultPath", "$copiedExpectedResultsPath"); - system "diff -u \"$testResultsDirectory/$base-$expectedTag.txt\" \"$testResultsDirectory/$base-$actualTag.txt\" > \"$testResultsDirectory/$base-$diffsTag.txt\""; + system "diff -u \"$copiedExpectedResultsPath\" \"$actualResultsPath\" > \"$testResultsDirectory/$base-$diffsTag.txt\""; } sub buildPlatformHierarchy() @@ -1573,7 +1704,7 @@ sub epiloguesAndPrologues($$) { my @components = split('/', $directory); while (@lastComponents) { - if ($lastComponents[0] ne $components[0]) { + if (!defined($components[0]) || $lastComponents[0] ne $components[0]) { last; } shift @components; @@ -1625,3 +1756,107 @@ sub parseLeaksandPrintUniqueLeaks() { print "See above for individual leaks results.\n" if ($leaksOutputFileNumber > 2); } + +sub extensionForMimeType($) +{ + my ($mimeType) = @_; + + if ($mimeType eq "application/x-webarchive") { + return "webarchive"; + } elsif ($mimeType eq "application/pdf") { + return "pdf"; + } + return "txt"; +} + +# Read up to the first #EOF (the content block of the test), or until detecting crashes or timeouts. +sub readFromDumpToolWithTimer(*;$) +{ + my ($fh, $dontWaitForTimeOut) = @_; + + setFileHandleNonBlocking($fh, 1); + + my $maximumSecondsWithoutOutput = 60; + $maximumSecondsWithoutOutput *= 10 if $guardMalloc; + my $microsecondsToWaitBeforeReadingAgain = 1000; + + my $timeOfLastSuccessfulRead = time; + + my @output = (); + my $status = "success"; + my $mimeType = "text/plain"; + # We don't have a very good way to know when the "headers" stop + # and the content starts, so we use this as a hack: + my $haveSeenContentType = 0; + + while (1) { + if (time - $timeOfLastSuccessfulRead > $maximumSecondsWithoutOutput) { + $status = dumpToolDidCrash() ? "crashed" : "timedOut"; + last; + } + + my $line = readline($fh); + if (!defined($line)) { + if ($! != EAGAIN) { + $status = "crashed"; + last; + } + + if ($dontWaitForTimeOut) { + last; + } + + # No data ready + usleep($microsecondsToWaitBeforeReadingAgain); + next; + } + + $timeOfLastSuccessfulRead = time; + + if (!$haveSeenContentType && $line =~ /^Content-Type: (\S+)$/) { + $mimeType = $1; + $haveSeenContentType = 1; + next; + } + last if ($line =~ /#EOF/); + + push @output, $line; + } + + setFileHandleNonBlocking($fh, 0); + return { + output => join("", @output), + status => $status, + mimeType => $mimeType, + extension => extensionForMimeType($mimeType) + }; +} + +sub setFileHandleNonBlocking(*$) +{ + my ($fh, $nonBlocking) = @_; + + my $flags = fcntl($fh, F_GETFL, 0) or die "Couldn't get filehandle flags"; + + if ($nonBlocking) { + $flags |= O_NONBLOCK; + } else { + $flags &= ~O_NONBLOCK; + } + + fcntl($fh, F_SETFL, $flags) or die "Couldn't set filehandle flags"; + + return 1; +} + +sub sampleDumpTool() +{ + return unless isOSX(); + return unless $runSample; + + my $outputDirectory = "$ENV{HOME}/Library/Logs/DumpRenderTree"; + -d $outputDirectory or mkdir $outputDirectory; + + my $outputFile = "$outputDirectory/HangReport.txt"; + system "/usr/bin/sample", $dumpToolPID, qw(10 10 -file), $outputFile; +} diff --git a/WebKitTools/Scripts/sort-Xcode-project-file b/WebKitTools/Scripts/sort-Xcode-project-file index e9b7a56..a35fe73 100755 --- a/WebKitTools/Scripts/sort-Xcode-project-file +++ b/WebKitTools/Scripts/sort-Xcode-project-file @@ -31,7 +31,7 @@ use strict; use File::Basename; -use File::Temp; +use File::Temp qw(tempfile); use Getopt::Long; sub sortByFileName($$); @@ -64,12 +64,11 @@ for my $projectFile (@ARGV) { next; } - my $OUT = new File::Temp( + my ($OUT, $tempFileName) = tempfile( + basename($projectFile) . "-XXXXXXXX", DIR => dirname($projectFile), - TEMPLATE => basename($projectFile) . "-XXXXXXXX", UNLINK => 0, ); - my $tempFileName = $OUT->filename(); # Clean up temp file in case of die() $SIG{__DIE__} = sub { diff --git a/WebKitTools/Scripts/sunspider-compare-results b/WebKitTools/Scripts/sunspider-compare-results index cf18aae..ec0863a 100755 --- a/WebKitTools/Scripts/sunspider-compare-results +++ b/WebKitTools/Scripts/sunspider-compare-results @@ -57,13 +57,13 @@ if ($showHelp) { @ARGV = map { File::Spec->rel2abs($_) } @ARGV; -sub buildTestKJS +sub buildJSC { if (!defined($root)){ chdirWebKit(); - my $buildResult = system "WebKitTools/Scripts/build-testkjs", "--" . $configuration; + my $buildResult = system "WebKitTools/Scripts/build-jsc", "--" . $configuration; if ($buildResult) { - print STDERR "Compiling testkjs failed!\n"; + print STDERR "Compiling jsc failed!\n"; exit WEXITSTATUS($buildResult); } } @@ -77,15 +77,15 @@ sub setupEnvironmentForExecution($) # FIXME: Other platforms may wish to augment this method to use LD_LIBRARY_PATH, etc. } -sub testKJSPath($) +sub jscPath($) { my ($productDir) = @_; - my $testkjsName = "testkjs"; - $testkjsName .= "_debug" if (isCygwin() && ($configuration eq "Debug")); - return "$productDir/$testkjsName"; + my $jscName = "jsc"; + $jscName .= "_debug" if (isCygwin() && ($configuration eq "Debug")); + return "$productDir/$jscName"; } -buildTestKJS(); +buildJSC(); chdirWebKit(); chdir("SunSpider"); @@ -95,7 +95,7 @@ my $productDir = productDir(); $productDir .= "/JavaScriptCore" if (isQt() or isGtk()); setupEnvironmentForExecution($productDir); -my @args = ("--shell", testKJSPath($productDir)); +my @args = ("--shell", jscPath($productDir)); # This code could be removed if we chose to pass extra args to sunspider instead of Xcode exec "./sunspider-compare-results", @args, @ARGV; diff --git a/WebKitTools/Scripts/svn-apply b/WebKitTools/Scripts/svn-apply index 5845917..d43d525 100755 --- a/WebKitTools/Scripts/svn-apply +++ b/WebKitTools/Scripts/svn-apply @@ -76,7 +76,7 @@ sub handleBinaryChange($$); sub isDirectoryEmptyForRemoval($); sub patch($); sub removeDirectoriesIfNeeded(); -sub setChangeLogDate($); +sub setChangeLogDateAndReviewer($$); sub svnStatus($); # Project time zone for Cupertino, CA, US @@ -84,8 +84,9 @@ my $changeLogTimeZone = "PST8PDT"; my $merge = 0; my $showHelp = 0; -if (!GetOptions("merge!" => \$merge, "help!" => \$showHelp) || $showHelp) { - print STDERR basename($0) . " [-h|--help] [-m|--merge] patch1 [patch2 ...]\n"; +my $reviewer; +if (!GetOptions("merge!" => \$merge, "help!" => \$showHelp, "reviewer=s" => \$reviewer) || $showHelp) { + print STDERR basename($0) . " [-h|--help] [-m|--merge] [-r|--reviewer name] patch1 [patch2 ...]\n"; exit 1; } @@ -106,8 +107,8 @@ my $filter; my $indexPath; my $patch; while (<>) { - s/\r//g; - chomp; + s/([\n\r]+)$//mg; + my $eol = $1; if (!defined($indexPath) && m#^diff --git a/#) { $filter = \&gitdiff2svndiff; } @@ -139,7 +140,7 @@ while (<>) { } } $patch .= $_; - $patch .= "\n"; + $patch .= $eol; } if ($patch && !$copiedFromPath) { @@ -346,7 +347,7 @@ sub patch($) # Standard patch, patch tool can handle this. if (basename($fullPath) eq "ChangeLog") { my $changeLogDotOrigExisted = -f "${fullPath}.orig"; - applyPatch(setChangeLogDate(fixChangeLogPatch($patch)), $fullPath, ["--fuzz=3"]); + applyPatch(setChangeLogDateAndReviewer(fixChangeLogPatch($patch), $reviewer), $fullPath, ["--fuzz=3"]); unlink("${fullPath}.orig") if (! $changeLogDotOrigExisted); } else { applyPatch($patch, $fullPath); @@ -390,9 +391,10 @@ sub removeDirectoriesIfNeeded() } } -sub setChangeLogDate($) +sub setChangeLogDateAndReviewer($$) { my $patch = shift; + my $reviewer = shift; my $savedTimeZone = $ENV{'TZ'}; # Set TZ temporarily so that localtime() is in that time zone $ENV{'TZ'} = $changeLogTimeZone; @@ -403,6 +405,9 @@ sub setChangeLogDate($) delete $ENV{'TZ'}; } $patch =~ s/(\n\+)\d{4}-[^-]{2}-[^-]{2}( )/$1$newDate$2/; + if (defined($reviewer)) { + $patch =~ s/NOBODY \(OOPS!\)/$reviewer/; + } return $patch; } diff --git a/WebKitTools/Scripts/svn-unapply b/WebKitTools/Scripts/svn-unapply index 05910ad..11e3ddb 100755 --- a/WebKitTools/Scripts/svn-unapply +++ b/WebKitTools/Scripts/svn-unapply @@ -88,8 +88,8 @@ my $filter; my $indexPath; my $patch; while (<>) { - s/\r//g; - chomp; + s/([\n\r]+)$//mg; + my $eol = $1; if (!defined($indexPath) && m#^diff --git a/#) { $filter = \&gitdiff2svndiff; } @@ -117,7 +117,7 @@ while (<>) { } } $patch .= $_; - $patch .= "\n"; + $patch .= $eol; } if ($patch) { diff --git a/WebKitTools/Scripts/update-sources-list.py b/WebKitTools/Scripts/update-sources-list.py new file mode 100644 index 0000000..e565059 --- /dev/null +++ b/WebKitTools/Scripts/update-sources-list.py @@ -0,0 +1,93 @@ +#!/usr/bin/python + +# Copyright (C) 2007 Kevin Ollivier 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 COMPUTER, INC. ``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 COMPUTER, INC. OR +# 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. +# +# Make sure any port-independent files added to the Bakefile are +# added to GTK, QT, etc. so that file updates can happen in one place. + +import os, sys +from xml.dom import minidom + +scriptDir = os.path.abspath(sys.path[0]) +wkroot = os.path.abspath(os.path.join(scriptDir, "../..")) + +def getWebCoreFilesDict(): + """ + This method parses the WebCoreSources.bkl file, which has a list of all sources not specific + to any port, and returns the result as a dictionary with items of the form + (groupName, groupFiles). + """ + sources = {} + sources_prefix = "WEBCORE_" + filepath = os.path.join(wkroot, "WebCore/WebCoreSources.bkl") + assert(os.path.exists(filepath)) + + doc = minidom.parse(filepath) + for sourceGroup in doc.getElementsByTagName("set"): + groupName = "" + if sourceGroup.attributes.has_key("var"): + groupName = sourceGroup.attributes["var"].value + groupName = groupName.replace(sources_prefix, "") + + sourcesList = [] + for node in sourceGroup.childNodes: + if node.nodeType == node.TEXT_NODE: + sourcesText = node.nodeValue.strip() + sourcesList = sourcesText.split("\n") + + assert(groupName != "") + assert(sourcesList != []) + + sources[groupName] = sourcesList + + return sources + +def generateWebCoreSourcesGTKAndQT(sources): + """ + Convert the dictionary obtained from getWebCoreFilesDict() into a Unix makefile syntax, + which IIUC is suitable for both GTK and QT build systems. To take advantage of this, + QT and GTK would have to include the file "WebCore/sources.inc" into their makefiles. + """ + makefileString = "" + + for key in sources.keys(): + makefileString += key + "+=" + for source in sources[key]: + makefileString += " \\\n\t\t" + source.strip() + + makefileString += "\n\n" + + makefileString += "BASE_SOURCES +=" + for key in sources.keys(): + makefileString += " \\\n\t\t" + key + + outfile = os.path.join(wkroot, "WebCore/sources.inc") + sourcefile = open(outfile, "w") + sourcefile.write(makefileString) + sourcefile.close() + +sources = getWebCoreFilesDict() +generateWebCoreSourcesGTKAndQT(sources) + +# Coming soon - MSVC and hopefully XCode support! diff --git a/WebKitTools/Scripts/update-webkit b/WebKitTools/Scripts/update-webkit index 6d974b1..e0c0d82 100755 --- a/WebKitTools/Scripts/update-webkit +++ b/WebKitTools/Scripts/update-webkit @@ -81,7 +81,7 @@ sub runSvnUpdate() print $line; push @conflictedChangeLogs, $1 if $line =~ m/^C\s+(.+)\s*$/ && basename($1) eq "ChangeLog"; } - close UPDATE; + close UPDATE or die; if (@conflictedChangeLogs) { print "Attempting to merge conflicted ChangeLogs.\n"; diff --git a/WebKitTools/Scripts/update-webkit-localizable-strings b/WebKitTools/Scripts/update-webkit-localizable-strings index 53037a6..350bf21 100755 --- a/WebKitTools/Scripts/update-webkit-localizable-strings +++ b/WebKitTools/Scripts/update-webkit-localizable-strings @@ -35,6 +35,7 @@ use lib $FindBin::Bin; use webkitdirs; my @directoriesToScan = ("WebKit/mac", "WebKit/win"); +my $fileToUpdate = "WebKit/English.lproj/Localizable.strings"; my $exceptionsFile = "WebKit/StringsNotToBeLocalized.txt"; @ARGV == 0 or die "Usage: " . basename($0) . "\n"; @@ -42,4 +43,4 @@ my $exceptionsFile = "WebKit/StringsNotToBeLocalized.txt"; chdirWebKit(); system "sort -u $exceptionsFile -o $exceptionsFile"; -exec "extract-localizable-strings", $exceptionsFile, @directoriesToScan; +exec "extract-localizable-strings", $exceptionsFile, $fileToUpdate, @directoriesToScan; diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm index ecebf94..728e7c0 100644 --- a/WebKitTools/Scripts/webkitdirs.pm +++ b/WebKitTools/Scripts/webkitdirs.pm @@ -56,6 +56,7 @@ my $osXVersion; my $isQt; my $isGtk; my $isWx; +my $forceRun64Bit; # Variables for Win32 support my $vcBuildPath; @@ -65,7 +66,8 @@ sub determineSourceDir { return if $sourceDir; $sourceDir = $FindBin::Bin; - + $sourceDir =~ s|/+$||; # Remove trailing '/' as we would die later + # walks up path checking each directory to see if it is the main WebKit project dir, # defined by containing JavaScriptCore, WebCore, and WebKit until ((-d "$sourceDir/JavaScriptCore" && -d "$sourceDir/WebCore" && -d "$sourceDir/WebKit") || (-d "$sourceDir/Internal" && -d "$sourceDir/OpenSource")) @@ -178,10 +180,10 @@ sub determineConfigurationProductDir { return if defined $configurationProductDir; determineBaseProductDir(); - if(isCygwin() && !isWx()) { + determineConfiguration(); + if (isCygwin() && !isWx()) { $configurationProductDir = "$baseProductDir/bin"; } else { - determineConfiguration(); $configurationProductDir = "$baseProductDir/$configuration"; } } @@ -267,16 +269,27 @@ sub determinePassedConfiguration { return if $searchedForPassedConfiguration; $searchedForPassedConfiguration = 1; + + my $isWinCairo = grep(/^--cairo-win32$/i, @ARGV); + for my $i (0 .. $#ARGV) { my $opt = $ARGV[$i]; if ($opt =~ /^--debug$/i || $opt =~ /^--devel/i) { splice(@ARGV, $i, 1); $passedConfiguration = "Debug"; + $passedConfiguration .= "_Cairo" if ($isWinCairo && isCygwin()); return; } if ($opt =~ /^--release$/i || $opt =~ /^--deploy/i) { splice(@ARGV, $i, 1); $passedConfiguration = "Release"; + $passedConfiguration .= "_Cairo" if ($isWinCairo && isCygwin()); + return; + } + if ($opt =~ /^--profil(e|ing)$/i) { + splice(@ARGV, $i, 1); + $passedConfiguration = "Profiling"; + $passedConfiguration .= "_Cairo" if ($isWinCairo && isCygwin()); return; } } @@ -315,11 +328,7 @@ sub installedSafariPath if (isOSX()) { $safariBundle = "/Applications/Safari.app"; } elsif (isCygwin()) { - my $findSafariName = "FindSafari"; - $findSafariName .= "_debug" if $configuration ne "Release"; - $findSafariName .= ".exe"; - - $safariBundle = `"$configurationProductDir/$findSafariName"`; + $safariBundle = `"$configurationProductDir/FindSafari.exe"`; $safariBundle =~ s/[\r\n]+$//; $safariBundle = `cygpath -u '$safariBundle'`; $safariBundle =~ s/[\r\n]+$//; @@ -394,8 +403,7 @@ sub hasSVGSupport } if (isGtk() and $path =~ /WebCore/) { - $path .= "/../lib/libWebKitGtk.so" if !$ENV{WEBKITAUTOTOOLS}; - $path .= "/../.libs/libWebKitGtk.so" if $ENV{WEBKITAUTOTOOLS}; + $path .= "/../.libs/webkit-1.0.so"; } my $hasSVGSupport = 0; @@ -512,14 +520,16 @@ sub isDebianBased() sub isCygwin() { - return ($^O eq "cygwin"); + return ($^O eq "cygwin") || 0; } sub isDarwin() { - return ($^O eq "darwin"); + return ($^O eq "darwin") || 0; } +# isOSX() only returns true for Apple's port, not for other ports that can be +# built/run on OS X. sub isOSX() { return isDarwin() unless (isQt() or isGtk() or isWx()); @@ -561,6 +571,11 @@ sub isLeopard() return isOSX() && osXVersion()->{"minor"} == 5; } +sub isSnowLeopard() +{ + return isOSX() && osXVersion()->{"minor"} == 6; +} + sub relativeScriptsDir() { my $scriptDir = File::Spec->catpath("", File::Spec->abs2rel(dirname($0), getcwd()), ""); @@ -694,20 +709,39 @@ sub buildVisualStudioProject return system $vcBuildPath, $winProjectPath, $command, $config; } -sub qtMakeCommand($) +sub retrieveQMakespecVar { - my ($qmakebin) = @_; - chomp(my $mkspec = `$qmakebin -query QMAKE_MKSPECS`); - $mkspec .= "/default"; + my $mkspec = $_[0]; + my $varname = $_[1]; - my $compiler = ""; - open SPEC, "<$mkspec/qmake.conf" or return "make"; + my $compiler = "unknown"; + #print "retrieveMakespecVar " . $mkspec . ", " . $varname . "\n"; + + local *SPEC; + open SPEC, "<$mkspec" or return "make"; while (<SPEC>) { - if ($_ =~ /QMAKE_CC\s*=\s*([^\s]+)/) { + if ($_ =~ /\s*include\((.+)\)/) { + # open the included mkspec + my $oldcwd = getcwd(); + (my $volume, my $directories, my $file) = File::Spec->splitpath($mkspec); + chdir "$volume$directories"; + $compiler = retrieveQMakespecVar($1, $varname); + chdir $oldcwd; + } elsif ($_ =~ /$varname\s*=\s*([^\s]+)/) { $compiler = $1; + last; } } close SPEC; + return $compiler; +} + +sub qtMakeCommand($) +{ + my ($qmakebin) = @_; + chomp(my $mkspec = `$qmakebin -query QMAKE_MKSPECS`); + $mkspec .= "/default"; + my $compiler = retrieveQMakespecVar("$mkspec/qmake.conf", "QMAKE_CC"); #print "default spec: " . $mkspec . "\n"; #print "compiler found: " . $compiler . "\n"; @@ -755,7 +789,7 @@ sub buildAutotoolsProject($@) my $result; if ($clean) { $result = system $make, "distclean"; - return $result; + return 0; } print "Calling configure in " . $dir . "\n\n"; @@ -856,12 +890,7 @@ sub buildGtkProject($$@) die "The Gtk port builds JavaScriptCore, WebCore and WebKit in one shot! Only call it for 'WebKit'.\n"; } - if ($ENV{WEBKITAUTOTOOLS}) { - return buildAutotoolsProject($clean, @buildArgs); - } else { - my @buildArgs = ("CONFIG+=gtk-port", "CONFIG-=qt"); - return buildQMakeProject($clean, @buildArgs); - } + return buildAutotoolsProject($clean, @buildArgs); } sub setPathForRunningWebKitApp @@ -893,7 +922,12 @@ sub runSafari print "Starting Safari with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n"; $ENV{DYLD_FRAMEWORK_PATH} = $productDir; $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; - return system safariPath(), @ARGV; + exportArchPreference(); + if (!isTiger()) { + return system "arch", safariPath(), @ARGV; + } else { + return system safariPath(), @ARGV; + } } if (isCygwin()) { @@ -913,39 +947,38 @@ sub runSafari return 1; } -sub runDrosera +sub setRun64Bit($) { - my ($debugger) = @_; + ($forceRun64Bit) = @_; +} - if (isOSX()) { - return system "$FindBin::Bin/gdb-drosera", @ARGV if $debugger; +sub preferredArchitecture +{ + return unless isOSX(); + + my $framework = shift; + $framework = "WebKit" if !defined($framework); - my $productDir = productDir(); - print "Starting Drosera with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n"; - $ENV{DYLD_FRAMEWORK_PATH} = $productDir; - $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES"; + my $currentArchitecture = `arch`; + chomp($currentArchitecture); - my $droseraPath = "$productDir/Drosera.app/Contents/MacOS/Drosera"; - return system $droseraPath, @ARGV; + my $run64Bit = 0; + if (!defined($forceRun64Bit)) { + my $frameworkPath = builtDylibPathForName($framework); + die "Couldn't find path for $framework" if !defined($frameworkPath); + # The binary is 64-bit if one of the architectures it contains has "64" in the name + $run64Bit = `lipo -info "$frameworkPath"` =~ /(are|architecture):.*64/; } - if (isCygwin()) { - print "Running Drosera\n"; - my $script = "run-drosera-nightly.cmd"; - my $prodDir = productDir(); - my $result = system "cp", "$FindBin::Bin/$script", $prodDir; - return $result if $result; - - my $cwd = getcwd(); - chdir $prodDir; - - my $debuggerFlag = $debugger ? "/debugger" : ""; - $result = system "cmd", "/c", "call $script $debuggerFlag"; - chdir $cwd; - return $result; + if ($forceRun64Bit or $run64Bit) { + return ($currentArchitecture eq "i386") ? "x86_64" : "ppc64"; } + return $currentArchitecture; +} - return 1; +sub exportArchPreference +{ + $ENV{ARCHPREFERENCE} = preferredArchitecture() if isOSX(); } 1; diff --git a/WebKitTools/Scripts/wkstyle b/WebKitTools/Scripts/wkstyle index 690b5fa..4b3447f 100755 --- a/WebKitTools/Scripts/wkstyle +++ b/WebKitTools/Scripts/wkstyle @@ -25,16 +25,36 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -astyle \ +cmdcpp="astyle \ +--unpad=paren \ --style=linux \ +--brackets=linux \ --indent=spaces=4 \ ---convert-tabs \ -$@ +--indent-switches \ +--convert-tabs" + +cmdh="astyle \ +--unpad=paren \ +--style=linux \ +--brackets=break \ +--indent=spaces=4 \ +--convert-tabs" #astyle does not support unpadding so we use sed for i in $@ do echo $i + +ext=`echo $i|awk -F . '{print $NF}'` + +cmd=$cmdcpp + +if [ $ext == "h" ] ; then + cmd=$cmdh +fi + +$cmd $i + #first print the changes we are making sed -n -e ' /( .*/p @@ -59,6 +79,9 @@ s/ )/)/g N s/\n{/ {/ } +#fixup extra tab in constructor initalizer +/^ \+,/{s/^ //} +/^ \+:/{s/^ //} ' $i > $i.sed mv $i.sed $i done diff --git a/WebKitTools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj b/WebKitTools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj index fda0581..67250dd 100644 --- a/WebKitTools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj +++ b/WebKitTools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj @@ -199,7 +199,6 @@ mainGroup = 29B97314FDCFA39411CA2CEA /* WebKit */; projectDirPath = ""; projectRoot = ""; - shouldCheckCompatibility = 1; targets = ( 8D1107260486CEB800E47090 /* WebKit */, 5D650F3309DB8B280075E9A8 /* WebKitNightlyEnabler */, diff --git a/WebKitTools/WinLauncher/WinLauncher.cpp b/WebKitTools/WinLauncher/WinLauncher.cpp new file mode 100644 index 0000000..4d60115 --- /dev/null +++ b/WebKitTools/WinLauncher/WinLauncher.cpp @@ -0,0 +1,408 @@ +/* + * Copyright (C) 2006, 2008 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. OR + * 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. + */ + +#include "stdafx.h" +#include "WinLauncher.h" +#include "WebKit.h" + +#include <commctrl.h> +#include <objbase.h> +#include <shlwapi.h> +#include <wininet.h> + +#define MAX_LOADSTRING 100 +#define URLBAR_HEIGHT 24 + +// Global Variables: +HINSTANCE hInst; // current instance +HWND hMainWnd; +HWND hURLBarWnd; +long DefEditProc; +IWebView* gWebView = 0; +HWND gViewWindow = 0; +WinLauncherWebHost* gWebHost = 0; +TCHAR szTitle[MAX_LOADSTRING]; // The title bar text +TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name + +// Forward declarations of functions included in this code module: +ATOM MyRegisterClass(HINSTANCE hInstance); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK MyEditProc(HWND, UINT, WPARAM, LPARAM); + +static void loadURL(BSTR urlBStr); + +HRESULT WinLauncherWebHost::updateAddressBar(IWebView* webView) +{ + IWebFrame* mainFrame = 0; + IWebDataSource* dataSource = 0; + IWebMutableURLRequest* request = 0; + BSTR frameURL = 0; + + HRESULT hr = S_OK; + + hr = webView->mainFrame(&mainFrame); + if (FAILED(hr)) + goto exit; + + hr = mainFrame->dataSource(&dataSource); + if (FAILED(hr) || !dataSource) + hr = mainFrame->provisionalDataSource(&dataSource); + if (FAILED(hr) || !dataSource) + goto exit; + + hr = dataSource->request(&request); + if (FAILED(hr) || !request) + goto exit; + + hr = request->mainDocumentURL(&frameURL); + if (FAILED(hr)) + goto exit; + + SendMessage(hURLBarWnd, (UINT)WM_SETTEXT, 0, (LPARAM)frameURL); + +exit: + if (mainFrame) + mainFrame->Release(); + if (dataSource) + dataSource->Release(); + if (request) + request->Release(); + SysFreeString(frameURL); + return 0; +} + +HRESULT STDMETHODCALLTYPE WinLauncherWebHost::QueryInterface(REFIID riid, void** ppvObject) +{ + *ppvObject = 0; + if (IsEqualGUID(riid, IID_IUnknown)) + *ppvObject = static_cast<IWebFrameLoadDelegate*>(this); + else if (IsEqualGUID(riid, IID_IWebFrameLoadDelegate)) + *ppvObject = static_cast<IWebFrameLoadDelegate*>(this); + else + return E_NOINTERFACE; + + AddRef(); + return S_OK; +} + +ULONG STDMETHODCALLTYPE WinLauncherWebHost::AddRef(void) +{ + return ++m_refCount; +} + +ULONG STDMETHODCALLTYPE WinLauncherWebHost::Release(void) +{ + ULONG newRef = --m_refCount; + if (!newRef) + delete(this); + + return newRef; +} + +static void resizeSubViews() +{ + RECT rcClient; + GetClientRect(hMainWnd, &rcClient); + MoveWindow(hURLBarWnd, 0, 0, rcClient.right, URLBAR_HEIGHT, TRUE); + MoveWindow(gViewWindow, 0, URLBAR_HEIGHT, rcClient.right, rcClient.bottom - URLBAR_HEIGHT, TRUE); +} + +int APIENTRY _tWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ +#ifdef _CRTDBG_MAP_ALLOC + _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); +#endif + + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + + // TODO: Place code here. + MSG msg; + HACCEL hAccelTable; + + INITCOMMONCONTROLSEX InitCtrlEx; + + InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX); + InitCtrlEx.dwICC = 0x00004000; //ICC_STANDARD_CLASSES; + InitCommonControlsEx(&InitCtrlEx); + + // Initialize global strings + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadString(hInstance, IDC_WINLAUNCHER, szWindowClass, MAX_LOADSTRING); + MyRegisterClass(hInstance); + + // Perform application initialization: + if (!InitInstance (hInstance, nCmdShow)) + return FALSE; + + // Init COM + OleInitialize(NULL); + + hURLBarWnd = CreateWindow(L"EDIT", 0, + WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL, + 0, 0, 0, 0, + hMainWnd, + 0, + hInstance, 0); + + DefEditProc = GetWindowLong(hURLBarWnd, GWL_WNDPROC); + SetWindowLong(hURLBarWnd, GWL_WNDPROC,(long)MyEditProc); + SetFocus(hURLBarWnd); + + HRESULT hr = CoCreateInstance(CLSID_WebView, 0, CLSCTX_ALL, IID_IWebView, (void**)&gWebView); + if (FAILED(hr)) + goto exit; + + gWebHost = new WinLauncherWebHost(); + gWebHost->AddRef(); + hr = gWebView->setFrameLoadDelegate(gWebHost); + if (FAILED(hr)) + goto exit; + + hr = gWebView->setHostWindow((OLE_HANDLE) hMainWnd); + if (FAILED(hr)) + goto exit; + + RECT clientRect; + GetClientRect(hMainWnd, &clientRect); + hr = gWebView->initWithFrame(clientRect, 0, 0); + if (FAILED(hr)) + goto exit; + + IWebFrame* frame; + hr = gWebView->mainFrame(&frame); + if (FAILED(hr)) + goto exit; + static BSTR defaultHTML = 0; + if (!defaultHTML) + defaultHTML = SysAllocString(TEXT("<p style=\"background-color: #00FF00\">Testing</p><img src=\"http://webkit.org/images/icon-gold.png\" alt=\"Face\"><div style=\"border: solid blue\" contenteditable=\"true\">div with blue border</div><ul><li>foo<li>bar<li>baz</ul>")); + frame->loadHTMLString(defaultHTML, 0); + frame->Release(); + + IWebViewPrivate* viewExt; + hr = gWebView->QueryInterface(IID_IWebViewPrivate, (void**)&viewExt); + if (FAILED(hr)) + goto exit; + hr = viewExt->viewWindow((OLE_HANDLE*) &gViewWindow); + viewExt->Release(); + if (FAILED(hr) || !gViewWindow) + goto exit; + + resizeSubViews(); + + ShowWindow(gViewWindow, nCmdShow); + UpdateWindow(gViewWindow); + + hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_WINLAUNCHER)); + + // Main message loop: + while (GetMessage(&msg, NULL, 0, 0)) { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + +exit: + delete gWebView; +#ifdef _CRTDBG_MAP_ALLOC + _CrtDumpMemoryLeaks(); +#endif + + // Shut down COM. + OleUninitialize(); + + return (int) msg.wParam; +} + +ATOM MyRegisterClass(HINSTANCE hInstance) +{ + WNDCLASSEX wcex; + + wcex.cbSize = sizeof(WNDCLASSEX); + + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = WndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = hInstance; + wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_WINLAUNCHER)); + wcex.hCursor = LoadCursor(NULL, IDC_ARROW); + wcex.hbrBackground = 0; + wcex.lpszMenuName = MAKEINTRESOURCE(IDC_WINLAUNCHER); + wcex.lpszClassName = szWindowClass; + wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); + + return RegisterClassEx(&wcex); +} + +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + hInst = hInstance; // Store instance handle in our global variable + + hMainWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); + + if (!hMainWnd) + return FALSE; + + ShowWindow(hMainWnd, nCmdShow); + UpdateWindow(hMainWnd); + + return TRUE; +} + +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + int wmId, wmEvent; + PAINTSTRUCT ps; + HDC hdc; + + switch (message) { + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + // Parse the menu selections: + switch (wmId) { + case IDM_ABOUT: + DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); + break; + case IDM_EXIT: + DestroyWindow(hWnd); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + break; + case WM_DESTROY: + PostQuitMessage(0); + break; + case WM_SIZE: + if (!gWebView) + break; + resizeSubViews(); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + return 0; +} + + +#define MAX_URL_LENGTH 1024 + +LRESULT CALLBACK MyEditProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) { + case WM_CHAR: + if( wParam == 13 ) { // Enter Key + wchar_t strPtr[MAX_URL_LENGTH]; + *((LPWORD)strPtr) = MAX_URL_LENGTH; + int strLen = SendMessage(hDlg, EM_GETLINE, 0, (LPARAM)strPtr); + + BSTR bstr = SysAllocStringLen(strPtr, strLen); + loadURL(bstr); + SysFreeString(bstr); + + return 0; + } else + return (LRESULT)CallWindowProc((WNDPROC)DefEditProc,hDlg,message,wParam,lParam); + break; + default: + return (LRESULT)CallWindowProc((WNDPROC)DefEditProc,hDlg,message,wParam,lParam); + break; + } + return 0; +} + + +// Message handler for about box. +INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + switch (message) { + case WM_INITDIALOG: + return (INT_PTR)TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { + EndDialog(hDlg, LOWORD(wParam)); + return (INT_PTR)TRUE; + } + break; + } + return (INT_PTR)FALSE; +} + +static void loadURL(BSTR urlBStr) +{ + IWebFrame* frame = 0; + IWebMutableURLRequest* request = 0; + static BSTR methodBStr = 0; + + if (!methodBStr) + methodBStr = SysAllocString(TEXT("GET")); + + if (urlBStr && urlBStr[0] && (PathFileExists(urlBStr) || PathIsUNC(urlBStr))) { + TCHAR fileURL[INTERNET_MAX_URL_LENGTH]; + DWORD fileURLLength = sizeof(fileURL)/sizeof(fileURL[0]); + if (SUCCEEDED(UrlCreateFromPath(urlBStr, fileURL, &fileURLLength, 0))) + urlBStr = fileURL; + } + + HRESULT hr = gWebView->mainFrame(&frame); + if (FAILED(hr)) + goto exit; + + hr = CoCreateInstance(CLSID_WebMutableURLRequest, 0, CLSCTX_ALL, IID_IWebMutableURLRequest, (void**)&request); + if (FAILED(hr)) + goto exit; + + hr = request->initWithURL(urlBStr, WebURLRequestUseProtocolCachePolicy, 0); + if (FAILED(hr)) + goto exit; + + hr = request->setHTTPMethod(methodBStr); + if (FAILED(hr)) + goto exit; + + hr = frame->loadRequest(request); + if (FAILED(hr)) + goto exit; + + SetFocus(gViewWindow); + +exit: + if (frame) + frame->Release(); + if (request) + request->Release(); +} diff --git a/WebKitTools/WinLauncher/WinLauncher.h b/WebKitTools/WinLauncher/WinLauncher.h new file mode 100644 index 0000000..1f57bff --- /dev/null +++ b/WebKitTools/WinLauncher/WinLauncher.h @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2006 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. OR + * 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. + */ + +#pragma once + +#include "resource.h" +#include "WebKit.h" + +class WinLauncherWebHost : public IWebFrameLoadDelegate +{ +public: + WinLauncherWebHost() : m_refCount(1) {} + + // IUnknown + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); + virtual ULONG STDMETHODCALLTYPE AddRef(void); + virtual ULONG STDMETHODCALLTYPE Release(void); + + // IWebFrameLoadDelegate + virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame( + /* [in] */ IWebView* webView, + /* [in] */ IWebFrame* /*frame*/) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame( + /* [in] */ IWebView *webView, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError( + /* [in] */ IWebView *webView, + /* [in] */ IWebError *error, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame( + /* [in] */ IWebView *webView, + /* [in] */ IWebFrame *frame) { return updateAddressBar(webView); } + + virtual HRESULT STDMETHODCALLTYPE didReceiveTitle( + /* [in] */ IWebView *webView, + /* [in] */ BSTR title, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didReceiveIcon( + /* [in] */ IWebView *webView, + /* [in] */ OLE_HANDLE hBitmap, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame( + /* [in] */ IWebView* webView, + /* [in] */ IWebFrame* /*frame*/) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError( + /* [in] */ IWebView *webView, + /* [in] */ IWebError *error, + /* [in] */ IWebFrame *forFrame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame( + /* [in] */ IWebView *webView, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL( + /* [in] */ IWebView *webView, + /* [in] */ BSTR url, + /* [in] */ double delaySeconds, + /* [in] */ DATE fireDate, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame( + /* [in] */ IWebView *webView, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual HRESULT STDMETHODCALLTYPE willCloseFrame( + /* [in] */ IWebView *webView, + /* [in] */ IWebFrame *frame) { return S_OK; } + + virtual /* [local] */ HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable( + /* [in] */ IWebView *webView, + /* [in] */ JSContextRef context, + /* [in] */ JSObjectRef windowScriptObject) { return S_OK; } + + // WinLauncherWebHost + +protected: + HRESULT updateAddressBar(IWebView* webView); + +protected: + ULONG m_refCount; +}; diff --git a/WebKitTools/WinLauncher/WinLauncher.ico b/WebKitTools/WinLauncher/WinLauncher.ico Binary files differnew file mode 100644 index 0000000..d551aa3 --- /dev/null +++ b/WebKitTools/WinLauncher/WinLauncher.ico diff --git a/WebKitTools/WinLauncher/WinLauncher.rc b/WebKitTools/WinLauncher/WinLauncher.rc new file mode 100644 index 0000000..f4b2cd4 --- /dev/null +++ b/WebKitTools/WinLauncher/WinLauncher.rc @@ -0,0 +1,136 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_WINLAUNCHER ICON "WinLauncher.ico" +IDI_SMALL ICON "small.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDC_WINLAUNCHER MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "E&xit", IDM_EXIT + END + POPUP "&Help" + BEGIN + MENUITEM "&About ...", IDM_ABOUT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDC_WINLAUNCHER ACCELERATORS +BEGIN + "?", IDM_ABOUT, ASCII, ALT + "/", IDM_ABOUT, ASCII, ALT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOGEX 22, 17, 230, 75 +STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +CAPTION "About" +FONT 8, "System", 0, 0, 0x0 +BEGIN + ICON IDI_WINLAUNCHER,IDC_MYICON,14,9,20,20 + LTEXT "WinLauncher Version 1.1",IDC_STATIC,49,10,119,8,SS_NOPREFIX + LTEXT "Copyright (C) 2008",IDC_STATIC,49,20,119,8 + DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_APP_TITLE "WinLauncher" + IDC_WINLAUNCHER "WINLAUNCHER" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/WebKitTools/WinLauncher/WinLauncher.vcproj b/WebKitTools/WinLauncher/WinLauncher.vcproj new file mode 100644 index 0000000..4aec2c6 --- /dev/null +++ b/WebKitTools/WinLauncher/WinLauncher.vcproj @@ -0,0 +1,260 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="WinLauncher"
+ ProjectGUID="{114FCA11-216B-4C8C-957E-30A75AE80443}"
+ RootNamespace="WinLauncher"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(WebKitOutputDir)\bin"
+ IntermediateDirectory="$(WebKitOutputDir)\obj\$(ProjectName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""$(WebKitOutputDir)\include\WebKit";"$(WebKitOutputDir)\Include";"$(WebKitLibrariesDir)\Include";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(ProjectDir)\..";"$(ProjectDir)";"$(IntDir)\Include";"$(WebKitOutputDir)\obj\WebKit\DerivedSources""
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
+ MinimalRebuild="true"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="2"
+ WarningLevel="1"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkLibraryDependencies="false"
+ AdditionalDependencies="comctl32.lib shlwapi.lib user32.lib ole32.lib oleaut32.lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(ProjectDir)\..\..\..\""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ TypeLibraryFile="$(WebKitOutputDir)\lib\WebKit.tlb"
+ ComponentFileName="WebKit$(WebKitDLLConfigSuffix)"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(WebKitOutputDir)\bin"
+ IntermediateDirectory="$(WebKitOutputDir)\obj\$(ProjectName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""$(WebKitOutputDir)\include\WebKit";"$(WebKitOutputDir)\Include";"$(WebKitLibrariesDir)\Include";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\icu";"$(WebKitLibrariesDir)\Include\icu";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(ProjectDir)\..";"$(ProjectDir)";"$(IntDir)\include";"$(WebKitOutputDir)\obj\WebKit\DerivedSources""
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_WIN32_WINNT=0x501"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="2"
+ WarningLevel="1"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkLibraryDependencies="false"
+ AdditionalOptions="
"
+ AdditionalDependencies="comctl32.lib shlwapi.lib user32.lib ole32.lib oleaut32.lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories=""$(WebKitOutputDir)\lib";"$(ProjectDir)\..\..\..\""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ TypeLibraryFile="$(WebKitOutputDir)\lib\WebKit.tlb"
+ ComponentFileName="WebKit$(WebKitDLLConfigSuffix)"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\stdafx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\WinLauncher.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\Resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\stdafx.h"
+ >
+ </File>
+ <File
+ RelativePath=".\WinLauncher.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath=".\small.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\WinLauncher.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\WinLauncher.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/WebKitTools/WinLauncher/resource.h b/WebKitTools/WinLauncher/resource.h new file mode 100644 index 0000000..6a21684 --- /dev/null +++ b/WebKitTools/WinLauncher/resource.h @@ -0,0 +1,27 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by WinLauncher.rc +// +#define IDC_MYICON 2 +#define IDD_WINLAUNCHER_DIALOG 102 +#define IDS_APP_TITLE 103 +#define IDD_ABOUTBOX 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDI_WINLAUNCHER 107 +#define IDI_SMALL 108 +#define IDC_WINLAUNCHER 109 +#define IDR_MAINFRAME 128 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff --git a/WebKitTools/WinLauncher/small.ico b/WebKitTools/WinLauncher/small.ico Binary files differnew file mode 100644 index 0000000..d551aa3 --- /dev/null +++ b/WebKitTools/WinLauncher/small.ico diff --git a/WebKitTools/WinLauncher/stdafx.cpp b/WebKitTools/WinLauncher/stdafx.cpp new file mode 100644 index 0000000..541dcb1 --- /dev/null +++ b/WebKitTools/WinLauncher/stdafx.cpp @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2006 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. OR + * 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. + */ + +// stdafx.cpp : source file that includes just the standard includes +// Spinneret.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/WebKitTools/WinLauncher/stdafx.h b/WebKitTools/WinLauncher/stdafx.h new file mode 100644 index 0000000..86f76cc --- /dev/null +++ b/WebKitTools/WinLauncher/stdafx.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2006 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. OR + * 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. + */ + +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Allow use of features specific to Windows XP or later. +#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. +#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. +#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. +#endif + +#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. +#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. +#endif + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include <windows.h> + +// C RunTime Header Files +#include <stdlib.h> +#include <malloc.h> +#include <memory.h> +#include <tchar.h> + +#if 0 +// Visual Studio Leak Detection +// <http://msdn2.microsoft.com/en-US/library/e5ewb1h3.aspx> +#if defined(_MSC_VER) && defined(_DEBUG) +#define _CRTDBG_MAP_ALLOC +#include <stdlib.h> +#include <crtdbg.h> +#endif +#endif diff --git a/WebKitTools/mangleme/LICENSE b/WebKitTools/mangleme/LICENSE new file mode 100644 index 0000000..5ab7695 --- /dev/null +++ b/WebKitTools/mangleme/LICENSE @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/WebKitTools/record-memory-win/main.cpp b/WebKitTools/record-memory-win/main.cpp new file mode 100644 index 0000000..e660afe --- /dev/null +++ b/WebKitTools/record-memory-win/main.cpp @@ -0,0 +1,187 @@ +#include <windows.h>
+#include <assert.h>
+#include <psapi.h>
+#include <stdio.h>
+#include <tchar.h>
+#include <time.h>
+#include "Shlwapi.h"
+
+#pragma comment(lib, "psapi.lib")
+#pragma comment(lib, "shlwapi.lib")
+
+bool gSingleProcess = true;
+int gQueryInterval = 5; // seconds
+time_t gDuration = 0; // seconds
+LPTSTR gCommandLine;
+
+HRESULT ProcessArgs(int argc, TCHAR *argv[]);
+HRESULT PrintUsage();
+void UseImage(void (functionForQueryType(HANDLE)));
+void QueryContinuously(HANDLE hProcess);
+time_t ElapsedTime(time_t startTime);
+unsigned int OneQuery(HANDLE hProcess);
+unsigned int OneQueryMP(HANDLE hProcess);
+
+int __cdecl _tmain (int argc, TCHAR *argv[])
+{
+ HRESULT result = ProcessArgs(argc, argv);
+ if (FAILED(result))
+ return result;
+
+ UseImage(QueryContinuously);
+ return S_OK;
+}
+
+HRESULT ProcessArgs(int argc, TCHAR *argv[])
+{
+ LPTSTR argument;
+ for( int count = 1; count < argc; count++ ) {
+ argument = argv[count] ;
+ if (wcsstr(argument, _T("-h")) ||
+ wcsstr(argument, _T("--help")))
+ return PrintUsage();
+ else if (wcsstr(argument, _T("--exe"))) {
+ gCommandLine = argv[++count];
+ if (wcsstr(gCommandLine, _T("chrome.exe")))
+ gSingleProcess = false;
+ } else if (wcsstr(argument, _T("-i")) ||
+ wcsstr(argument, _T("--interval"))) {
+ gQueryInterval = _wtoi(argv[++count]);
+ if (gQueryInterval < 1) {
+ printf("ERROR: invalid interval\n");
+ return E_INVALIDARG;
+ }
+ } else if (wcsstr(argument, _T("-d")) ||
+ wcsstr(argument, _T("--duration"))) {
+ gDuration = _wtoi(argv[++count]);
+ if (gDuration < 1) {
+ printf("ERROR: invalid duration\n");
+ return E_INVALIDARG;
+ }
+ } else {
+ _tprintf(_T("ERROR: unrecognized argument \"%s\"\n"), (LPCTSTR)argument);
+ return PrintUsage();
+ }
+ }
+ if (argc < 2 || !wcslen(gCommandLine) ) {
+ printf("ERROR: executable path is required\n");
+ return PrintUsage();
+ }
+ return S_OK;
+}
+
+HRESULT PrintUsage()
+{
+ printf("record-memory-win --exe EXE_PATH\n");
+ printf(" Launch an executable and print the memory usage (in Private Bytes)\n");
+ printf(" of the process.\n\n");
+ printf("Usage:\n");
+ printf("-h [--help] : Print usage\n");
+ printf("--exe arg : Launch specified image. Required\n");
+ printf("-i [--interval] arg : Print memory usage every arg seconds. Default: 5 seconds\n");
+ printf("-d [--duration] arg : Run for up to arg seconds. Default: no limit\n\n");
+ printf("Examples:\n");
+ printf(" record-memory-win --exe \"C:\\Program Files\\Safari\\Safari.exe\"\n");
+ printf(" record-memory-win --exe Safari.exe -i 10 -d 7200\n");
+ return E_FAIL;
+}
+
+void UseImage(void (functionForQueryType(HANDLE)))
+{
+ STARTUPINFO si = {0};
+ si.cb = sizeof(STARTUPINFO);
+ PROCESS_INFORMATION pi = {0};
+
+ // Start the child process.
+ if(!CreateProcess( NULL, // No module name (use command line)
+ gCommandLine, // Command line
+ NULL, // Process handle not inheritable
+ NULL, // Thread handle not inheritable
+ FALSE, // Set handle inheritance to FALSE
+ 0, // No creation flags
+ NULL, // Use parent's environment block
+ NULL, // Use parent's starting directory
+ &si, // Pointer to STARTUPINFO structure
+ &pi )) // Pointer to PROCESS_INFORMATION structure
+ printf("CreateProcess failed (%d)\n", GetLastError());
+ else {
+ printf("Created process\n");
+ functionForQueryType(pi.hProcess);
+ // Close process and thread handles.
+ CloseHandle( pi.hProcess );
+ CloseHandle( pi.hThread );
+ }
+}
+
+void QueryContinuously(HANDLE hProcess)
+{
+ Sleep(2000); // give the process some time to launch
+ bool pastDuration = false;
+ time_t startTime = time(NULL);
+ unsigned int memUsage = gSingleProcess ? OneQuery(hProcess) : OneQueryMP(hProcess);
+ while(memUsage && !pastDuration) {
+ printf( "%u\n", memUsage );
+ Sleep(gQueryInterval*1000);
+ memUsage = gSingleProcess ? OneQuery(hProcess) : OneQueryMP(hProcess);
+ pastDuration = gDuration > 0 ? ElapsedTime(startTime) > gDuration : false;
+ }
+}
+
+// returns elapsed time in seconds
+time_t ElapsedTime(time_t startTime)
+{
+ time_t currentTime = time(NULL);
+ return currentTime - startTime;
+}
+
+// returns Commit Size (Private Bytes) in bytes
+unsigned int OneQuery(HANDLE hProcess)
+{
+ PROCESS_MEMORY_COUNTERS_EX pmc;
+ if (NULL == hProcess)
+ return 0;
+ if (GetProcessMemoryInfo(hProcess, (PPROCESS_MEMORY_COUNTERS)&pmc, sizeof(pmc)))
+ return (unsigned)pmc.PrivateUsage;
+ return 0;
+}
+
+// returns Commit Size (Private Bytes) in bytes for multi-process executables
+unsigned int OneQueryMP(HANDLE hProcess)
+{
+ unsigned int memUsage = 0;
+ TCHAR monitoredProcessName[MAX_PATH];
+ GetProcessImageFileName(hProcess, monitoredProcessName, sizeof(monitoredProcessName)/sizeof(TCHAR));
+ LPTSTR shortProcessName = PathFindFileName(monitoredProcessName);
+ DWORD aProcesses[1024], cbNeeded, cProcesses;
+ HANDLE hFoundProcess;
+ if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded))
+ return 0;
+
+ // Calculate how many process identifiers were returned.
+ cProcesses = cbNeeded / sizeof(DWORD);
+ // find existing process
+ for (unsigned int i = 0; i < cProcesses; i++)
+ if (aProcesses[i] != 0) {
+ DWORD retVal = 0;
+ TCHAR foundProcessName[MAX_PATH];
+
+ // Get a handle to the process.
+ hFoundProcess = OpenProcess(PROCESS_QUERY_INFORMATION |
+ PROCESS_VM_READ,
+ FALSE, aProcesses[i]);
+
+ // Get the process name.
+ if (NULL != hFoundProcess) {
+ HMODULE hMod;
+ DWORD cbNeeded;
+
+ if (EnumProcessModules(hFoundProcess, &hMod, sizeof(hMod), &cbNeeded)) {
+ GetModuleBaseName(hFoundProcess, hMod, foundProcessName, sizeof(foundProcessName)/sizeof(TCHAR));
+ if (wcsstr(foundProcessName, shortProcessName))
+ memUsage += OneQuery(hFoundProcess);
+ }
+ }
+ CloseHandle(hFoundProcess);
+ }
+ return memUsage;
+}
diff --git a/WebKitTools/wx/browser/browser.bkl b/WebKitTools/wx/browser/browser.bkl index 505d740..0a60fd9 100644 --- a/WebKitTools/wx/browser/browser.bkl +++ b/WebKitTools/wx/browser/browser.bkl @@ -47,7 +47,6 @@ wxWebKit sample application build file <exe id="wxBrowser" template="wxwk,xml2,iconv,xslt,icu,jscore,webcore,wxwebkit,curl,pthreads"> <app-type>gui</app-type> <runtime-libs>dynamic</runtime-libs> - <set var="BUILDDIR">$(WKOUTPUTDIR)/build/wxbrowser-$(FORMAT)</set> <include>$(WK_ROOT)/WebCore/platform/wx</include> <include>$(WK_ROOT)/WebCore/bridge/wx</include> diff --git a/WebKitTools/wx/browser/browser.cpp b/WebKitTools/wx/browser/browser.cpp index 5993432..83f909b 100644 --- a/WebKitTools/wx/browser/browser.cpp +++ b/WebKitTools/wx/browser/browser.cpp @@ -27,7 +27,7 @@ // webkit includes #include "WebView.h" -#include "WebFrame.h" +#include "WebBrowserShell.h" #include "wx/wxprec.h" #ifndef WX_PRECOMP @@ -50,7 +50,7 @@ bool MyApp::OnInit() // create the main application window // see WebKit/wx/WebFrame.cpp for how to write a shell around wxWebView. - wxWebFrame *frame = new wxWebFrame(_T("wxWebKit Test App")); + wxWebBrowserShell *frame = new wxWebBrowserShell(_T("wxWebKit Test App")); #ifndef NDEBUG frame->ShowDebugMenu(true); diff --git a/WebKitTools/wx/build-wxwebkit b/WebKitTools/wx/build-wxwebkit index 05557a8..0fb5b89 100755 --- a/WebKitTools/wx/build-wxwebkit +++ b/WebKitTools/wx/build-wxwebkit @@ -33,7 +33,7 @@ set -o errexit scriptDir="$(cd $(dirname $0);pwd)" WK_ROOT=$scriptDir/../.. -WK_ROOTDIR=$WK_ROOT +WK_ROOTDIR="$WK_ROOT" cd $scriptDir @@ -41,7 +41,13 @@ if [ -z $WEBKITOUTPUTDIR ]; then WEBKITOUTPUTDIR=`cd $WK_ROOT/WebKitTools/Scripts; perl -e "use webkitdirs; print productDir()"` fi -WINDEPS="pthreads/lib/pthreadVC2.dll icu/bin/icuuc34.dll icu/bin/icudt34.dll libcurl/*.dll sqlite3/sqlite3.dll" +WKWINLIBS=WebKitLibraries/win +WINDEPS=" $WKWINLIBS/lib/pthreadVC2.dll" +WINDEPS="$WINDEPS $WKWINLIBS/bin/icuuc34.dll $WKWINLIBS/bin/icudt34.dll $WKWINLIBS/bin/icuin34.dll" +WINDEPS="$WINDEPS $WKWINLIBS/bin/libcurl.dll $WKWINLIBS/bin/libeay32.dll $WKWINLIBS/bin/ssleay32.dll $WKWINLIBS/bin/zlib1.dll" +WINDEPS="$WINDEPS $WKWINLIBS/lib/sqlite3.dll" +WINDEPS="$WINDEPS $WKWINLIBS/bin/libxml2.dll $WKWINLIBS/bin/libxslt.dll" +WINDEPS="$WINDEPS $WKWINLIBS/bin/iconv.dll" # TODO: check that we are running from the root of the source tree... @@ -57,6 +63,9 @@ if [ $OSTYPE == cygwin ]; then echo "Error, you must set WXWIN to your wxWidgets root directory." exit 1 fi + if [ -z $WX_PREFIX ]; then + WX_PREFIX=$WXWIN + fi if [ -z $BAKEFILE_PATHS ]; then export BAKEFILE_PATHS=$WXWIN/build/bakefiles/wxpresets fi @@ -103,6 +112,7 @@ fi #---------------------------------------------------------------------- # process command line args +build_type_set=0 do_bake=0 do_prep=0 @@ -111,6 +121,7 @@ do_build=0 do_clean=0 do_install=0 use_wxgc=0 +debug=1 wxdebug=0 wxpython=0 make_args='' @@ -139,31 +150,62 @@ if [ $do_bake == 0 -a $do_prep == 0 -a $do_build == 0 -a $do_clean == 0 ]; then do_bake=1; do_prep=1; do_build=1 fi +if [ -f $WK_ROOT/WebKitBuild/Configuration ]; then + BUILD_TYPE=`cat $WK_ROOT/WebKitBuild/Configuration` + echo "Configuration is: $BUILD_TYPE" + + if [ $BUILD_TYPE == "Release" ]; then + debug=0 + fi + if [ $BUILD_TYPE == "Debug" ]; then + debug=1 + fi + +fi + function do_make { dir=$1 cxxflags=$2 olddir=$PWD shift shift + # NOTE: If we try to do make clean after the Bakefiles were cleaned out, or before they were + # first generated, we will get errors about missing files, so we need to check that the + # makefile exists before running it. if [ $OSTYPE == cygwin ]; then cd $dir - nmake -f makefile.vc CXXFLAGS="$cxxflags" $@ + if [ -f makefile.vc ]; then + nmake -f makefile.vc CXXFLAGS="$cxxflags" $@ + fi cd $olddir else - make -C $dir -f GNUmakefile $MAKE_ARGS CXXFLAGS="$cxxflags" $@ + if [ -f $dir/GNUmakefile ]; then + make -C $dir -f GNUmakefile $MAKE_ARGS CXXFLAGS="$cxxflags" $@ + fi fi if [ $? != 0 ]; then exit $? fi } +# output the first parameter that is a dir and exists +function find_existing_dir { + for arg in $*; do + tester=$arg + if [ $OSTYPE == cygwin ]; then + tester=`cygpath -u $arg` + fi + if [ -d $tester ]; then + echo $arg + return + fi + done +} + + olddir=$PWD -if [ $do_clean == 1 ]; then - rm -rf $WK_ROOT/JavaScriptCore/DerivedSources - rm -rf $WK_ROOT/WebCore/DerivedSources - rm -rf $WK_ROOT/WebCore/include/JavaScriptCore -else +if [ $do_clean != 1 ]; then mkdir -p $WEBKITOUTPUTDIR/build @@ -230,25 +272,32 @@ if [ $do_build == 1 -o $do_clean == 1 ]; then wxdebug=1 fi - PLATFORM_OS="win" - if [ "${OSTYPE:0:6}" == "darwin" ]; then + if [ "${OSTYPE:0:6}" == "cygwin" ]; then + PLATFORM_OS="win" + elif [ "${OSTYPE:0:6}" == "darwin" ]; then PLATFORM_OS="mac" else PLATFORM_OS="linux" + use_wxgc=1 # Linux requires us to use wxgc to get proper drawing. fi WINDEPS="$WINDEPS $WXWIN/lib/vc_dll/wxmsw28u${WX_EXT}_core_vc.dll $WXWIN/lib/vc_dll/wxbase28u${WX_EXT}_vc.dll" - # NOTE: If we try to do make clean after the Bakefiles were cleaned out, or before they were - # first generated, we will get errors about missing files. - # FIXME: Make the check more robust. - if [ -f $WK_ROOT/JavaScriptCore/GNUmakefile ]; then - do_make $WK_ROOT/JavaScriptCore "-DBUILDING_WX__=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args - do_make $WK_ROOT/WebCore "-DBUILDING_WX__=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args - do_make $WK_ROOT/WebKit/wx "-DBUILDING_WX__=1 -DWXMAKINGDLL_WEBKIT=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args - do_make $WK_ROOT/WebKitTools/wx/browser "-DBUILDING_WX__=1 -DWXUSINGDLL_WEBKIT=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args + do_make $WK_ROOT/JavaScriptCore "-DBUILDING_WX__=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args + + mkdir -p $WEBKITOUTPUTDIR/JavaScriptCore + cp -p $WK_ROOT/JavaScriptCore/API/*.h $WEBKITOUTPUTDIR/JavaScriptCore/ + + do_make $WK_ROOT/WebCore "-DBUILDING_WX__=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug WEBKIT_ROOT=$WK_ROOTDIR DEBUG=$debug PLATFORM_OS=$PLATFORM_OS $other_args + do_make $WK_ROOT/WebKit/wx "-DBUILDING_WX__=1 -DWXMAKINGDLL_WEBKIT=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args + do_make $WK_ROOT/WebKitTools/wx/browser "-DBUILDING_WX__=1 -DWXUSINGDLL_WEBKIT=1 $WXGC_DEFINE" WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS $other_args + + if [ $do_clean == 1 ]; then + rm -rf $WK_ROOT/JavaScriptCore/DerivedSources + rm -rf $WK_ROOT/WebCore/DerivedSources + rm -rf $WK_ROOT/WebCore/include/JavaScriptCore fi - + if [ $do_build == 1 ]; then if [ "${OSTYPE:0:6}" = "darwin" ]; then cd $WEBKITOUTPUTDIR @@ -262,7 +311,9 @@ if [ $do_build == 1 -o $do_clean == 1 ]; then fi if [ $wxpython == 1 ]; then - SWIG=`which swig` + if [ -z $SWIG ]; then + SWIG=`which swig` + fi if [ ! -f "$SWIG" ]; then echo "ERROR: Cannot find SWIG. Make sure that SWIG 1.3.29 is located on your path."; @@ -276,12 +327,29 @@ if [ $do_build == 1 -o $do_clean == 1 ]; then if [ "${OSTYPE:0:6}" == "cygwin" ]; then WEBKIT_INCLUDE="-I`cygpath -d $WK_ROOT/WebKit/wx`" fi - $SWIG $SWIG_FLAGS -I$WX_PREFIX/include/wx-2.8/wx/wxPython/i_files $WEBKIT_INCLUDE -o webview.cpp webview.i - #$SWIG -I$WX_PREFIX/include/wx-2.8/wx/wxPython/i_files $WEBKIT_INCLUDE -xml -o webview.xml webview.i - - PY_INCLUDE=`python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc()"` - PY_VERSION=`python -c "import sys; print str(sys.version_info[0]) + str(sys.version_info[1])"` + # Determine which include path to use for wxPython's *.i files + # Options are: + # wxPython installed on a posix system + # the wxPython win32 devel tarball + # a wx source tree from a tarball where wxPython is in the wx dir + # a wx source tree from SVN where wxPython is a sibling of the wx dir + WXPY_INCLUDE=`find_existing_dir \ + $WX_PREFIX/include/wx-2.8/wx/wxPython/i_files \ + $WX_PREFIX/include/wx/wxPython/i_files \ + $WX_PREFIX/wxPython/src \ + $WX_PREFIX/../wxPython/src` + if [ -z $WXPY_INCLUDE ]; then + echo "ERROR: Unable to find wxPython's *.i files" + exit 1 + fi + + # Run SWIG + $SWIG $SWIG_FLAGS -I$WXPY_INCLUDE $WEBKIT_INCLUDE -o webview.cpp webview.i + cp webview.py $WEBKITOUTPUTDIR/webview.py + + PY_INCLUDE=`python -c "import sys,distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_python_inc())"` + PY_VERSION=`python -c "import sys; sys.stdout.write(str(sys.version_info[0]) + str(sys.version_info[1]))"` PY_LIBDIR=`python -c "import distutils.sysconfig; import sys; sys.stdout.write(distutils.sysconfig.PREFIX)"` if [ "${OSTYPE:0:6}" == "cygwin" ]; then @@ -290,8 +358,8 @@ if [ $do_build == 1 -o $do_clean == 1 ]; then PY_LIBDIR="$PY_LIBDIR/lib" fi - do_make $WK_ROOT/WebKit/wx/bindings/python "-DBUILDING_WX__=1 -DWXUSINGDLL=1 -DWXUSINGDLL_WEBKIT=1 -I$PY_INCLUDE $WXGC_DEFINE" \ - WX_DEBUG=$wxdebug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS PYTHON_VERSION=$PY_VERSION PYTHON_LIBDIR=$PY_LIBDIR $other_args + do_make $WK_ROOT/WebKit/wx/bindings/python "-DBUILDING_WX__=1 -DWXUSINGDLL=1 -DWXUSINGDLL_WEBKIT=1 -I$PY_INCLUDE -I$WX_PREFIX/wxPython/include -I$WX_PREFIX/../wxPython/include $WXGC_DEFINE" \ + WX_DEBUG=$wxdebug DEBUG=$debug WEBKIT_ROOT=$WK_ROOTDIR PLATFORM_OS=$PLATFORM_OS PYTHON_VERSION=$PY_VERSION PYTHON_LIBDIR=$PY_LIBDIR $other_args if [ "${OSTYPE:0:6}" == "cygwin" ]; then if [ -f $WEBKITOUTPUTDIR/_webview.pyd -a -f $WEBKITOUTPUTDIR/_webview.dll ]; then rm $WEBKITOUTPUTDIR/_webview.pyd @@ -304,7 +372,11 @@ if [ $do_build == 1 -o $do_clean == 1 ]; then if [ "$OSTYPE" == "cygwin" ]; then echo "Copying necessary DLLs to run test and sample applications..." cd $WK_ROOT - cp $WINDEPS $WEBKITOUTPUTDIR + cp $WINDEPS `cygpath -u $WEBKITOUTPUTDIR` + chmod +x `cygpath -u $WEBKITOUTPUTDIR/`*.dll + if [ -e `cygpath -u $WEBKITOUTPUTDIR/_webview.dll` ]; then + mv `cygpath -u $WEBKITOUTPUTDIR/_webview.dll` `cygpath -u $WEBKITOUTPUTDIR/_webview.pyd` + fi fi BROWSERAPP="wxBrowser" diff --git a/WebKitTools/wx/install-unix-extras b/WebKitTools/wx/install-unix-extras index ec09f85..19df45c 100755 --- a/WebKitTools/wx/install-unix-extras +++ b/WebKitTools/wx/install-unix-extras @@ -70,7 +70,7 @@ LIBJPEG_VERSION="6b" LIBJPEG_TARBALL="jpegsrc.v$LIBJPEG_VERSION.tar.gz" LIBJPEG_URL="http://www.ijg.org/files/$LIBJPEG_TARBALL" -LIBPNG_VERSION="1.2.24" +LIBPNG_VERSION="1.2.32" LIBPNG_TARBALL="libpng-$LIBPNG_VERSION.tar.gz" LIBPNG_URL="ftp://ftp.simplesystems.org/pub/libpng/png/src/$LIBPNG_TARBALL" |