Commit 4fa8943e authored by darin@apple.com's avatar darin@apple.com

WebKitTools:

2009-04-20  Darin Adler  <darin@apple.com>

        Reviewed by Sam Weinig.

        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added PlainTextController.h
        and PlainTextController.mm.

        * DumpRenderTree/mac/FrameLoadDelegate.mm:
        (-[FrameLoadDelegate webView:didClearWindowObject:forFrame:]): Added PlainTextController
        as "window.plainText".

        * DumpRenderTree/mac/PlainTextController.h: Added.
        * DumpRenderTree/mac/PlainTextController.mm: Added.

LayoutTests:

2009-04-20  Darin Adler  <darin@apple.com>

        Reviewed by Sam Weinig.

        * fast/dom/Window/window-properties.html: Added a new DumpRenderTree window
        object property, plainText.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 46fc85ac
2009-04-20 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
* fast/dom/Window/window-properties.html: Added a new DumpRenderTree window
object property, plainText.
2009-04-10 Ojan Vafai <ojan@chromium.org>
Reviewed by Dan Bernstein.
......
......@@ -59,6 +59,7 @@ var __skip__ = {
"window.objCController" : 1,
"window.objCPlugin" : 1,
"window.objCPluginFunction" : 1,
"window.plainText" : 1,
"window.textInputController" : 1
};
......
2009-04-20 Darin Adler <darin@apple.com>
Reviewed by Sam Weinig.
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added PlainTextController.h
and PlainTextController.mm.
* DumpRenderTree/mac/FrameLoadDelegate.mm:
(-[FrameLoadDelegate webView:didClearWindowObject:forFrame:]): Added PlainTextController
as "window.plainText".
* DumpRenderTree/mac/PlainTextController.h: Added.
* DumpRenderTree/mac/PlainTextController.mm: Added.
2009-04-20 Steve Falkenburg <sfalken@apple.com>
Separate JavaScriptCore.dll from WebKit.dll.
......
......@@ -44,6 +44,8 @@
5DB9AC9E0F722C3600684641 /* WebKitWeightWatcher700.ttf in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 375F09770DAC3CB600C8B4E5 /* WebKitWeightWatcher700.ttf */; };
5DB9AC9F0F722C3600684641 /* WebKitWeightWatcher800.ttf in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 375F09780DAC3CB600C8B4E5 /* WebKitWeightWatcher800.ttf */; };
5DB9ACA00F722C3600684641 /* WebKitWeightWatcher900.ttf in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 375F09790DAC3CB600C8B4E5 /* WebKitWeightWatcher900.ttf */; };
933BF5AB0F93FA5C000F0441 /* PlainTextController.h in Headers */ = {isa = PBXBuildFile; fileRef = 933BF5A90F93FA5C000F0441 /* PlainTextController.h */; };
933BF5AC0F93FA5C000F0441 /* PlainTextController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 933BF5AA0F93FA5C000F0441 /* PlainTextController.mm */; };
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 */; };
......@@ -177,6 +179,8 @@
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; };
933BF5A90F93FA5C000F0441 /* PlainTextController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlainTextController.h; path = mac/PlainTextController.h; sourceTree = "<group>"; };
933BF5AA0F93FA5C000F0441 /* PlainTextController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlainTextController.mm; path = mac/PlainTextController.mm; sourceTree = "<group>"; };
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>"; };
A817090308B164D300CCB9FB /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
......@@ -352,6 +356,8 @@
BCA18B6E0C9B08DB00114369 /* NavigationController.m */,
BCA18B2F0C9B01B400114369 /* ObjCController.h */,
BCA18B300C9B01B400114369 /* ObjCController.m */,
933BF5A90F93FA5C000F0441 /* PlainTextController.h */,
933BF5AA0F93FA5C000F0441 /* PlainTextController.mm */,
BCA18B3A0C9B024900114369 /* TextInputController.h */,
BCA18B480C9B02C400114369 /* TextInputController.m */,
);
......@@ -506,6 +512,7 @@
BCA18B690C9B08C200114369 /* UIDelegate.h in Headers */,
BC9D90250C97472E0099A4A3 /* WorkQueue.h in Headers */,
BC9D90260C97472E0099A4A3 /* WorkQueueItem.h in Headers */,
933BF5AB0F93FA5C000F0441 /* PlainTextController.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -650,6 +657,7 @@
BCA18B6A0C9B08C200114369 /* UIDelegate.mm in Sources */,
BC9D90240C97472E0099A4A3 /* WorkQueue.cpp in Sources */,
BCA18B260C9B015C00114369 /* WorkQueueItemMac.mm in Sources */,
933BF5AC0F93FA5C000F0441 /* PlainTextController.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -38,6 +38,7 @@
#import "ObjCController.h"
#import "ObjCPlugin.h"
#import "ObjCPluginFunction.h"
#import "PlainTextController.h"
#import "TextInputController.h"
#import "WorkQueue.h"
#import "WorkQueueItem.h"
......@@ -252,24 +253,21 @@
ASSERT(!exception);
// Make Old-Style controllers
AppleScriptController *asc = [[AppleScriptController alloc] initWithWebView:sender];
[obj setValue:asc forKey:@"appleScriptController"];
[asc release];
EventSendingController *esc = [[EventSendingController alloc] init];
[obj setValue:esc forKey:@"eventSender"];
[esc release];
TextInputController *tic = [[TextInputController alloc] initWithWebView:sender];
[obj setValue:tic forKey:@"textInputController"];
[tic release];
[obj setValue:gNavigationController forKey:@"navigationController"];
AppleScriptController *asc = [[AppleScriptController alloc] initWithWebView:sender];
[obj setValue:asc forKey:@"appleScriptController"];
[asc release];
ObjCController *occ = [[ObjCController alloc] init];
[obj setValue:occ forKey:@"objCController"];
[occ release];
[obj setValue:gNavigationController forKey:@"navigationController"];
ObjCPlugin *plugin = [[ObjCPlugin alloc] init];
[obj setValue:plugin forKey:@"objCPlugin"];
[plugin release];
......@@ -277,6 +275,12 @@
ObjCPluginFunction *pluginFunction = [[ObjCPluginFunction alloc] init];
[obj setValue:pluginFunction forKey:@"objCPluginFunction"];
[pluginFunction release];
[obj setValue:[PlainTextController sharedPlainTextController] forKey:@"plainText"];
TextInputController *tic = [[TextInputController alloc] initWithWebView:sender];
[obj setValue:tic forKey:@"textInputController"];
[tic release];
}
- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame
......
/*
* Copyright (C) 2009 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.
*/
@interface PlainTextController : NSObject
+ (PlainTextController *)sharedPlainTextController;
@end
/*
* Copyright (C) 2009 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 "PlainTextController.h"
#import <WebKit/WebKit.h>
@implementation PlainTextController
+ (PlainTextController *)sharedPlainTextController
{
static PlainTextController *controller = [[PlainTextController alloc] init];
return controller;
}
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)selector
{
if (selector == @selector(plainTextForRange:))
return NO;
return YES;
}
+ (NSString *)webScriptNameForSelector:(SEL)selector
{
if (selector == @selector(plainTextForRange:))
return @"plainText";
return nil;
}
- (NSString *)plainTextForRange:(DOMRange *)range
{
if (![range isKindOfClass:[DOMRange class]])
return nil;
return [range text];
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment