<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[180436] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/180436">180436</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-02-20 11:45:52 -0800 (Fri, 20 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebEditingTester] @properties, dot syntax, and remember the window position
https://bugs.webkit.org/show_bug.cgi?id=141843

Reviewed by Tim Horton.

Modernize a bit with more dot syntax, use @property for the web views,
and give the main window an Autosave name so it remembers the widow position.

* WebEditingTester/WK1WebDocumentController.m:
(-[WK1WebDocumentController awakeFromNib]):
(-[WK1WebDocumentController loadHTMLString:]):
* WebEditingTester/WK2WebDocumentController.m:
(-[WK2WebDocumentController awakeFromNib]):
* WebEditingTester/WebDocument.xib:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebEditingTesterWK1WebDocumentControllerm">trunk/Tools/WebEditingTester/WK1WebDocumentController.m</a></li>
<li><a href="#trunkToolsWebEditingTesterWK2WebDocumentControllerm">trunk/Tools/WebEditingTester/WK2WebDocumentController.m</a></li>
<li><a href="#trunkToolsWebEditingTesterWebDocumentxib">trunk/Tools/WebEditingTester/WebDocument.xib</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (180435 => 180436)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-02-20 19:43:08 UTC (rev 180435)
+++ trunk/Tools/ChangeLog        2015-02-20 19:45:52 UTC (rev 180436)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-02-20  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        [WebEditingTester] @properties, dot syntax, and remember the window position
+        https://bugs.webkit.org/show_bug.cgi?id=141843
+
+        Reviewed by Tim Horton.
+        
+        Modernize a bit with more dot syntax, use @property for the web views,
+        and give the main window an Autosave name so it remembers the widow position.
+
+        * WebEditingTester/WK1WebDocumentController.m:
+        (-[WK1WebDocumentController awakeFromNib]):
+        (-[WK1WebDocumentController loadHTMLString:]):
+        * WebEditingTester/WK2WebDocumentController.m:
+        (-[WK2WebDocumentController awakeFromNib]):
+        * WebEditingTester/WebDocument.xib:
+
</ins><span class="cx"> 2015-02-20  Timothy Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WebEditingTester] Hook up key equivalents for new window action
</span></span></pre></div>
<a id="trunkToolsWebEditingTesterWK1WebDocumentControllerm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebEditingTester/WK1WebDocumentController.m (180435 => 180436)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebEditingTester/WK1WebDocumentController.m        2015-02-20 19:43:08 UTC (rev 180435)
+++ trunk/Tools/WebEditingTester/WK1WebDocumentController.m        2015-02-20 19:45:52 UTC (rev 180436)
</span><span class="lines">@@ -31,30 +31,33 @@
</span><span class="cx"> #import &lt;WebKit/WebPreferenceKeysPrivate.h&gt;
</span><span class="cx"> #import &lt;WebKit/WebViewPrivate.h&gt;
</span><span class="cx"> 
</span><del>-@implementation WK1WebDocumentController {
-    WebView *_webView;
-}
</del><ins>+@interface WK1WebDocumentController()
+@property (nonatomic, strong) WebView *webView;
+@end
</ins><span class="cx"> 
</span><ins>+@implementation WK1WebDocumentController
+
</ins><span class="cx"> - (void)awakeFromNib
</span><span class="cx"> {
</span><del>-    _webView = [[WebView alloc] initWithFrame:[containerView bounds] frameName:nil groupName:@&quot;WebEditingTester&quot;];
-    [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
</del><ins>+    self.webView = [[WebView alloc] initWithFrame:[containerView bounds] frameName:nil groupName:@&quot;WebEditingTester&quot;];
+    _webView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
</ins><span class="cx">     
</span><del>-    [_webView setEditable:YES];
-    [_webView setUIDelegate:self];
</del><ins>+    _webView.editable = YES;
+    _webView.UIDelegate = self;
</ins><span class="cx">     
</span><del>-    [[WebPreferences standardPreferences] setFullScreenEnabled:YES];
-    [[WebPreferences standardPreferences] setDeveloperExtrasEnabled:YES];
-    [[WebPreferences standardPreferences] setImageControlsEnabled:YES];
-    [[WebPreferences standardPreferences] setServiceControlsEnabled:YES];
</del><ins>+    WebPreferences *preferences = [WebPreferences standardPreferences];
+    preferences.fullScreenEnabled = YES;
+    preferences.developerExtrasEnabled = YES;
+    preferences.imageControlsEnabled = YES;
+    preferences.serviceControlsEnabled = YES;
</ins><span class="cx">     
</span><del>-    [self.window setTitle:@&quot;WebEditor [WK1]&quot;];
</del><ins>+    self.window.title = @&quot;WebEditor [WK1]&quot;;
</ins><span class="cx">     [containerView addSubview:_webView];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)loadHTMLString:(NSString *)content
</span><span class="cx"> {
</span><del>-    [[_webView mainFrame] loadHTMLString:content baseURL:nil];
</del><ins>+    [_webView.mainFrame loadHTMLString:content baseURL:nil];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (IBAction)pasteAsMarkup:(id)sender
</span></span></pre></div>
<a id="trunkToolsWebEditingTesterWK2WebDocumentControllerm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebEditingTester/WK2WebDocumentController.m (180435 => 180436)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebEditingTester/WK2WebDocumentController.m        2015-02-20 19:43:08 UTC (rev 180435)
+++ trunk/Tools/WebEditingTester/WK2WebDocumentController.m        2015-02-20 19:45:52 UTC (rev 180436)
</span><span class="lines">@@ -35,11 +35,10 @@
</span><span class="cx"> #import &lt;WebKit/_WKWebsiteDataStore.h&gt;
</span><span class="cx"> 
</span><span class="cx"> @interface WK2WebDocumentController () &lt;WKUIDelegate&gt;
</span><ins>+@property (nonatomic, strong) WKWebView *webView;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><del>-@implementation WK2WebDocumentController {
-    WKWebView *_webView;
-}
</del><ins>+@implementation WK2WebDocumentController
</ins><span class="cx"> 
</span><span class="cx"> static WKWebViewConfiguration *defaultConfiguration()
</span><span class="cx"> {
</span><span class="lines">@@ -61,13 +60,13 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)awakeFromNib
</span><span class="cx"> {
</span><del>-    _webView = [[WKWebView alloc] initWithFrame:[containerView bounds] configuration:defaultConfiguration()];
-    [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
-    [_webView _setEditable:YES];
-    [_webView setUIDelegate:self];
</del><ins>+    self.webView = [[WKWebView alloc] initWithFrame:[containerView bounds] configuration:defaultConfiguration()];
+    _webView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
+    _webView._editable = YES;
+    _webView.UIDelegate = self;
</ins><span class="cx">     
</span><span class="cx">     [containerView addSubview:_webView];
</span><del>-    [self.window setTitle:@&quot;WebEditor [WK2]&quot;];
</del><ins>+    self.window.title = @&quot;WebEditor [WK2]&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)loadHTMLString:(NSString *)content
</span></span></pre></div>
<a id="trunkToolsWebEditingTesterWebDocumentxib"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebEditingTester/WebDocument.xib (180435 => 180436)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebEditingTester/WebDocument.xib        2015-02-20 19:43:08 UTC (rev 180435)
+++ trunk/Tools/WebEditingTester/WebDocument.xib        2015-02-20 19:45:52 UTC (rev 180436)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
</span><del>-&lt;document type=&quot;com.apple.InterfaceBuilder3.Cocoa.XIB&quot; version=&quot;3.0&quot; toolsVersion=&quot;8034&quot; systemVersion=&quot;14D87&quot; targetRuntime=&quot;MacOSX.Cocoa&quot; propertyAccessControl=&quot;none&quot; useAutolayout=&quot;YES&quot; customObjectInstantitationMethod=&quot;direct&quot;&gt;
</del><ins>+&lt;document type=&quot;com.apple.InterfaceBuilder3.Cocoa.XIB&quot; version=&quot;3.0&quot; toolsVersion=&quot;7504.2&quot; systemVersion=&quot;14D77&quot; targetRuntime=&quot;MacOSX.Cocoa&quot; propertyAccessControl=&quot;none&quot; useAutolayout=&quot;YES&quot; customObjectInstantitationMethod=&quot;direct&quot;&gt;
</ins><span class="cx">     &lt;dependencies&gt;
</span><del>-        &lt;plugIn identifier=&quot;com.apple.InterfaceBuilder.CocoaPlugin&quot; version=&quot;8034&quot;/&gt;
</del><ins>+        &lt;plugIn identifier=&quot;com.apple.InterfaceBuilder.CocoaPlugin&quot; version=&quot;7504.2&quot;/&gt;
</ins><span class="cx">     &lt;/dependencies&gt;
</span><span class="cx">     &lt;objects&gt;
</span><span class="cx">         &lt;customObject id=&quot;-2&quot; userLabel=&quot;File's Owner&quot; customClass=&quot;WebDocumentController&quot;&gt;
</span><span class="lines">@@ -12,10 +12,10 @@
</span><span class="cx">         &lt;/customObject&gt;
</span><span class="cx">         &lt;customObject id=&quot;-1&quot; userLabel=&quot;First Responder&quot; customClass=&quot;FirstResponder&quot;/&gt;
</span><span class="cx">         &lt;customObject id=&quot;-3&quot; userLabel=&quot;Application&quot; customClass=&quot;NSObject&quot;/&gt;
</span><del>-        &lt;window title=&quot;Window&quot; allowsToolTipsWhenApplicationIsInactive=&quot;NO&quot; autorecalculatesKeyViewLoop=&quot;NO&quot; animationBehavior=&quot;default&quot; id=&quot;xOd-HO-29H&quot; userLabel=&quot;Window&quot;&gt;
</del><ins>+        &lt;window title=&quot;Window&quot; allowsToolTipsWhenApplicationIsInactive=&quot;NO&quot; autorecalculatesKeyViewLoop=&quot;NO&quot; frameAutosaveName=&quot;Main Window&quot; animationBehavior=&quot;default&quot; id=&quot;xOd-HO-29H&quot; userLabel=&quot;Window&quot;&gt;
</ins><span class="cx">             &lt;windowStyleMask key=&quot;styleMask&quot; titled=&quot;YES&quot; closable=&quot;YES&quot; miniaturizable=&quot;YES&quot; resizable=&quot;YES&quot; fullSizeContentView=&quot;YES&quot;/&gt;
</span><span class="cx">             &lt;windowPositionMask key=&quot;initialPositionMask&quot; leftStrut=&quot;YES&quot; rightStrut=&quot;YES&quot; topStrut=&quot;YES&quot; bottomStrut=&quot;YES&quot;/&gt;
</span><del>-            &lt;rect key=&quot;contentRect&quot; x=&quot;133&quot; y=&quot;235&quot; width=&quot;507&quot; height=&quot;413&quot;/&gt;
</del><ins>+            &lt;rect key=&quot;contentRect&quot; x=&quot;115&quot; y=&quot;862&quot; width=&quot;507&quot; height=&quot;413&quot;/&gt;
</ins><span class="cx">             &lt;rect key=&quot;screenRect&quot; x=&quot;0.0&quot; y=&quot;0.0&quot; width=&quot;2560&quot; height=&quot;1417&quot;/&gt;
</span><span class="cx">             &lt;value key=&quot;minSize&quot; type=&quot;size&quot; width=&quot;94&quot; height=&quot;86&quot;/&gt;
</span><span class="cx">             &lt;view key=&quot;contentView&quot; id=&quot;gIp-Ho-8D9&quot;&gt;
</span></span></pre>
</div>
</div>

</body>
</html>