Changeset 180436 in webkit
- Timestamp:
- Feb 20, 2015, 11:45:52 AM (10 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r180429 r180436 1 2015-02-20 Simon Fraser <simon.fraser@apple.com> 2 3 [WebEditingTester] @properties, dot syntax, and remember the window position 4 https://bugs.webkit.org/show_bug.cgi?id=141843 5 6 Reviewed by Tim Horton. 7 8 Modernize a bit with more dot syntax, use @property for the web views, 9 and give the main window an Autosave name so it remembers the widow position. 10 11 * WebEditingTester/WK1WebDocumentController.m: 12 (-[WK1WebDocumentController awakeFromNib]): 13 (-[WK1WebDocumentController loadHTMLString:]): 14 * WebEditingTester/WK2WebDocumentController.m: 15 (-[WK2WebDocumentController awakeFromNib]): 16 * WebEditingTester/WebDocument.xib: 17 1 18 2015-02-20 Timothy Horton <timothy_horton@apple.com> 2 19 -
trunk/Tools/WebEditingTester/WK1WebDocumentController.m
r180429 r180436 32 32 #import <WebKit/WebViewPrivate.h> 33 33 34 @implementation WK1WebDocumentController { 35 WebView *_webView; 36 } 34 @interface WK1WebDocumentController() 35 @property (nonatomic, strong) WebView *webView; 36 @end 37 38 @implementation WK1WebDocumentController 37 39 38 40 - (void)awakeFromNib 39 41 { 40 _webView = [[WebView alloc] initWithFrame:[containerView bounds] frameName:nil groupName:@"WebEditingTester"];41 [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];42 self.webView = [[WebView alloc] initWithFrame:[containerView bounds] frameName:nil groupName:@"WebEditingTester"]; 43 _webView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; 42 44 43 [_webView setEditable:YES];44 [_webView setUIDelegate:self];45 _webView.editable = YES; 46 _webView.UIDelegate = self; 45 47 46 [[WebPreferences standardPreferences] setFullScreenEnabled:YES]; 47 [[WebPreferences standardPreferences] setDeveloperExtrasEnabled:YES]; 48 [[WebPreferences standardPreferences] setImageControlsEnabled:YES]; 49 [[WebPreferences standardPreferences] setServiceControlsEnabled:YES]; 48 WebPreferences *preferences = [WebPreferences standardPreferences]; 49 preferences.fullScreenEnabled = YES; 50 preferences.developerExtrasEnabled = YES; 51 preferences.imageControlsEnabled = YES; 52 preferences.serviceControlsEnabled = YES; 50 53 51 [self.window setTitle:@"WebEditor [WK1]"];54 self.window.title = @"WebEditor [WK1]"; 52 55 [containerView addSubview:_webView]; 53 56 } … … 55 58 - (void)loadHTMLString:(NSString *)content 56 59 { 57 [ [_webView mainFrame]loadHTMLString:content baseURL:nil];60 [_webView.mainFrame loadHTMLString:content baseURL:nil]; 58 61 } 59 62 -
trunk/Tools/WebEditingTester/WK2WebDocumentController.m
r180429 r180436 36 36 37 37 @interface WK2WebDocumentController () <WKUIDelegate> 38 @property (nonatomic, strong) WKWebView *webView; 38 39 @end 39 40 40 @implementation WK2WebDocumentController { 41 WKWebView *_webView; 42 } 41 @implementation WK2WebDocumentController 43 42 44 43 static WKWebViewConfiguration *defaultConfiguration() … … 62 61 - (void)awakeFromNib 63 62 { 64 _webView = [[WKWebView alloc] initWithFrame:[containerView bounds] configuration:defaultConfiguration()];65 [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];66 [_webView _setEditable:YES];67 [_webView setUIDelegate:self];63 self.webView = [[WKWebView alloc] initWithFrame:[containerView bounds] configuration:defaultConfiguration()]; 64 _webView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; 65 _webView._editable = YES; 66 _webView.UIDelegate = self; 68 67 69 68 [containerView addSubview:_webView]; 70 [self.window setTitle:@"WebEditor [WK2]"];69 self.window.title = @"WebEditor [WK2]"; 71 70 } 72 71 -
trunk/Tools/WebEditingTester/WebDocument.xib
r180348 r180436 1 1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> 2 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion=" 8034" systemVersion="14D87" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">2 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7504.2" systemVersion="14D77" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> 3 3 <dependencies> 4 <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version=" 8034"/>4 <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7504.2"/> 5 5 </dependencies> 6 6 <objects> … … 13 13 <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> 14 14 <customObject id="-3" userLabel="Application" customClass="NSObject"/> 15 <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" animationBehavior="default" id="xOd-HO-29H" userLabel="Window">15 <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" frameAutosaveName="Main Window" animationBehavior="default" id="xOd-HO-29H" userLabel="Window"> 16 16 <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/> 17 17 <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> 18 <rect key="contentRect" x="1 33" y="235" width="507" height="413"/>18 <rect key="contentRect" x="115" y="862" width="507" height="413"/> 19 19 <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/> 20 20 <value key="minSize" type="size" width="94" height="86"/>
Note:
See TracChangeset
for help on using the changeset viewer.