<!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>[180429] 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/180429">180429</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-02-20 11:17:51 -0800 (Fri, 20 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WebEditingTester] Hook up key equivalents for new window action
https://bugs.webkit.org/show_bug.cgi?id=141828

Reviewed by Enrica Casucci.

* WebEditingTester/AppDelegate.h:
* WebEditingTester/AppDelegate.m:
(-[WebEditingAppDelegate applicationDidFinishLaunching:]):
(-[WebEditingAppDelegate newEditor:]):
(-[WebEditingAppDelegate _defaultWebDocumentControllerClass]):
(-[WebEditingAppDelegate toggleUseWK2ByDefault:]):
(-[WebEditingAppDelegate _updateNewWindowKeyEquivalents]):
(defaultConfiguration): Deleted.
(-[WebEditingAppDelegate applicationWillTerminate:]): Deleted.
Move WKWebViewConfiguration setup into WK2WebDocumentController.
Remove unused application termination code.
Update new-window menu item key equivalents when launching and when
changing the use-WebKit2-by-default setting.
Make WebDocumentController subclasses all initialized the same way,
and use that to factor out alloc/init.
Rename loadContent to loadHTMLString for future use.

* WebEditingTester/MainMenu.xib:
Add default key equivalents.
Cmd-N will always make the default kind of window (controlled by the pref).
Cmd-Opt-N will always make the other kind.
The menu items are configured as alternates so they only show up if you
press alt (just like in MiniBrowser).

* WebEditingTester/WK1WebDocumentController.m:
(-[WK1WebDocumentController loadHTMLString:]):
(-[WK1WebDocumentController loadContent]): Deleted.
* WebEditingTester/WK2WebDocumentController.h:
* WebEditingTester/WK2WebDocumentController.m:
(defaultConfiguration):
(-[WK2WebDocumentController awakeFromNib]):
(-[WK2WebDocumentController loadHTMLString:]):
(-[WK2WebDocumentController initWithConfiguration:]): Deleted.
(-[WK2WebDocumentController dealloc]): Deleted.
* WebEditingTester/WebDocumentController.h:
* WebEditingTester/WebDocumentController.m:
(-[WebDocumentController init]):
(-[WebDocumentController initWithWindow:]):
(+[WebDocumentController defaultEditingSource]):
(-[WebDocumentController loadHTMLString:]):
(-[WebDocumentController windowDidLoad]): Deleted.
(-[WebDocumentController defaultEditingSource]): Deleted.
(-[WebDocumentController applicationTerminating]): Deleted.
(-[WebDocumentController loadContent]): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebEditingTesterAppDelegateh">trunk/Tools/WebEditingTester/AppDelegate.h</a></li>
<li><a href="#trunkToolsWebEditingTesterAppDelegatem">trunk/Tools/WebEditingTester/AppDelegate.m</a></li>
<li><a href="#trunkToolsWebEditingTesterMainMenuxib">trunk/Tools/WebEditingTester/MainMenu.xib</a></li>
<li><a href="#trunkToolsWebEditingTesterWK1WebDocumentControllerm">trunk/Tools/WebEditingTester/WK1WebDocumentController.m</a></li>
<li><a href="#trunkToolsWebEditingTesterWK2WebDocumentControllerh">trunk/Tools/WebEditingTester/WK2WebDocumentController.h</a></li>
<li><a href="#trunkToolsWebEditingTesterWK2WebDocumentControllerm">trunk/Tools/WebEditingTester/WK2WebDocumentController.m</a></li>
<li><a href="#trunkToolsWebEditingTesterWebDocumentControllerh">trunk/Tools/WebEditingTester/WebDocumentController.h</a></li>
<li><a href="#trunkToolsWebEditingTesterWebDocumentControllerm">trunk/Tools/WebEditingTester/WebDocumentController.m</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (180428 => 180429)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-02-20 19:16:21 UTC (rev 180428)
+++ trunk/Tools/ChangeLog        2015-02-20 19:17:51 UTC (rev 180429)
</span><span class="lines">@@ -1,5 +1,57 @@
</span><span class="cx"> 2015-02-20  Timothy Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        [WebEditingTester] Hook up key equivalents for new window action
+        https://bugs.webkit.org/show_bug.cgi?id=141828
+
+        Reviewed by Enrica Casucci.
+
+        * WebEditingTester/AppDelegate.h:
+        * WebEditingTester/AppDelegate.m:
+        (-[WebEditingAppDelegate applicationDidFinishLaunching:]):
+        (-[WebEditingAppDelegate newEditor:]):
+        (-[WebEditingAppDelegate _defaultWebDocumentControllerClass]):
+        (-[WebEditingAppDelegate toggleUseWK2ByDefault:]):
+        (-[WebEditingAppDelegate _updateNewWindowKeyEquivalents]):
+        (defaultConfiguration): Deleted.
+        (-[WebEditingAppDelegate applicationWillTerminate:]): Deleted.
+        Move WKWebViewConfiguration setup into WK2WebDocumentController.
+        Remove unused application termination code.
+        Update new-window menu item key equivalents when launching and when
+        changing the use-WebKit2-by-default setting.
+        Make WebDocumentController subclasses all initialized the same way,
+        and use that to factor out alloc/init.
+        Rename loadContent to loadHTMLString for future use.
+
+        * WebEditingTester/MainMenu.xib:
+        Add default key equivalents.
+        Cmd-N will always make the default kind of window (controlled by the pref).
+        Cmd-Opt-N will always make the other kind.
+        The menu items are configured as alternates so they only show up if you
+        press alt (just like in MiniBrowser).
+
+        * WebEditingTester/WK1WebDocumentController.m:
+        (-[WK1WebDocumentController loadHTMLString:]):
+        (-[WK1WebDocumentController loadContent]): Deleted.
+        * WebEditingTester/WK2WebDocumentController.h:
+        * WebEditingTester/WK2WebDocumentController.m:
+        (defaultConfiguration):
+        (-[WK2WebDocumentController awakeFromNib]):
+        (-[WK2WebDocumentController loadHTMLString:]):
+        (-[WK2WebDocumentController initWithConfiguration:]): Deleted.
+        (-[WK2WebDocumentController dealloc]): Deleted.
+        * WebEditingTester/WebDocumentController.h:
+        * WebEditingTester/WebDocumentController.m:
+        (-[WebDocumentController init]):
+        (-[WebDocumentController initWithWindow:]):
+        (+[WebDocumentController defaultEditingSource]):
+        (-[WebDocumentController loadHTMLString:]):
+        (-[WebDocumentController windowDidLoad]): Deleted.
+        (-[WebDocumentController defaultEditingSource]): Deleted.
+        (-[WebDocumentController applicationTerminating]): Deleted.
+        (-[WebDocumentController loadContent]): Deleted.
+
+2015-02-20  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
</ins><span class="cx">         [WebEditingTester] ARC-ify WebEditingTester
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=141827
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebEditingTesterAppDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebEditingTester/AppDelegate.h (180428 => 180429)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebEditingTester/AppDelegate.h        2015-02-20 19:16:21 UTC (rev 180428)
+++ trunk/Tools/WebEditingTester/AppDelegate.h        2015-02-20 19:17:51 UTC (rev 180429)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx">     IBOutlet NSMenuItem *_newWK2EditorItem;
</span><span class="cx">     IBOutlet NSPanel *_operationsPanel;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> - (IBAction)newEditor:(id)sender;
</span><span class="cx"> - (IBAction)showOperations:(id)sender;
</span><span class="cx"> - (IBAction)toggleUseWK2ByDefault:(id)sender;
</span></span></pre></div>
<a id="trunkToolsWebEditingTesterAppDelegatem"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebEditingTester/AppDelegate.m (180428 => 180429)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebEditingTester/AppDelegate.m        2015-02-20 19:16:21 UTC (rev 180428)
+++ trunk/Tools/WebEditingTester/AppDelegate.m        2015-02-20 19:17:51 UTC (rev 180429)
</span><span class="lines">@@ -28,10 +28,6 @@
</span><span class="cx"> #import &quot;EditingOperations.h&quot;
</span><span class="cx"> #import &quot;WK1WebDocumentController.h&quot;
</span><span class="cx"> #import &quot;WK2WebDocumentController.h&quot;
</span><del>-#import &lt;WebKit/WKPreferencesPrivate.h&gt;
-#import &lt;WebKit/WKWebViewConfigurationPrivate.h&gt;
-#import &lt;WebKit/WebKit.h&gt;
-#import &lt;WebKit/_WKWebsiteDataStore.h&gt;
</del><span class="cx"> 
</span><span class="cx"> static NSString * const UseWebKit2ByDefaultPreferenceKey = @&quot;UseWebKit2ByDefault&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -45,49 +41,27 @@
</span><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static WKWebViewConfiguration *defaultConfiguration()
-{
-    static WKWebViewConfiguration *configuration;
-    
-    if (!configuration) {
-        configuration = [[WKWebViewConfiguration alloc] init];
-        configuration.preferences._fullScreenEnabled = YES;
-        configuration.preferences._developerExtrasEnabled = YES;
-    }
-    
-    return configuration;
-}
-
-
</del><span class="cx"> - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
</span><span class="cx"> {
</span><span class="cx">     [self newEditor:self];
</span><ins>+    [self _updateNewWindowKeyEquivalents];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)applicationWillTerminate:(NSNotification *)aNotification
-{
-    for (WebDocumentController *documents in _webDocuments)
-        [documents applicationTerminating];
-}
-
</del><span class="cx"> - (IBAction)newEditor:(id)sender
</span><span class="cx"> {
</span><del>-    BOOL useWebKit2 = NO;
</del><ins>+    Class controllerClass;
</ins><span class="cx"> 
</span><span class="cx">     if (sender == self)
</span><del>-        useWebKit2 = [self useWebKit2ByDefault];
</del><ins>+        controllerClass = self._defaultWebDocumentControllerClass;
</ins><span class="cx">     else if (sender == _newWK2EditorItem)
</span><del>-        useWebKit2 = YES;
</del><ins>+        controllerClass = [WK2WebDocumentController class];
+    else if (sender == _newWK1EditorItem)
+        controllerClass = [WK1WebDocumentController class];
</ins><span class="cx">     
</span><del>-    WebDocumentController *controller = nil;
-    if (useWebKit2)
-        controller = [[WK2WebDocumentController alloc] initWithConfiguration:defaultConfiguration()];
-    else
-        controller = [[WK1WebDocumentController alloc] initWithWindowNibName:@&quot;WebDocument&quot;];
-    
</del><ins>+    WebDocumentController *controller = [[controllerClass alloc] init];
</ins><span class="cx">     [[controller window] makeKeyAndOrderFront:sender];
</span><span class="cx">     [_webDocuments addObject:controller];
</span><del>-    [controller loadContent];
</del><ins>+    [controller loadHTMLString:[WebDocumentController defaultEditingSource]];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (IBAction)showOperations:(id)sender
</span><span class="lines">@@ -138,6 +112,11 @@
</span><span class="cx">     [_operationsPanel orderFront:nil];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (Class)_defaultWebDocumentControllerClass
+{
+    return self.useWebKit2ByDefault ? [WK2WebDocumentController class] : [WK1WebDocumentController class];
+}
+
</ins><span class="cx"> - (BOOL)useWebKit2ByDefault
</span><span class="cx"> {
</span><span class="cx">     return [[NSUserDefaults standardUserDefaults] boolForKey:UseWebKit2ByDefaultPreferenceKey];
</span><span class="lines">@@ -147,6 +126,7 @@
</span><span class="cx"> {
</span><span class="cx">     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
</span><span class="cx">     [defaults setBool:![defaults boolForKey:UseWebKit2ByDefaultPreferenceKey] forKey:UseWebKit2ByDefaultPreferenceKey];
</span><ins>+    [self _updateNewWindowKeyEquivalents];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
</span><span class="lines">@@ -159,4 +139,15 @@
</span><span class="cx">     return YES;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_updateNewWindowKeyEquivalents
+{
+    if (self.useWebKit2ByDefault) {
+        [_newWK1EditorItem setKeyEquivalentModifierMask:NSCommandKeyMask | NSAlternateKeyMask];
+        [_newWK2EditorItem setKeyEquivalentModifierMask:NSCommandKeyMask];
+    } else {
+        [_newWK1EditorItem setKeyEquivalentModifierMask:NSCommandKeyMask];
+        [_newWK2EditorItem setKeyEquivalentModifierMask:NSCommandKeyMask | NSAlternateKeyMask];
+    }
+}
+
</ins><span class="cx"> @end
</span></span></pre></div>
<a id="trunkToolsWebEditingTesterMainMenuxib"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebEditingTester/MainMenu.xib (180428 => 180429)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebEditingTester/MainMenu.xib        2015-02-20 19:16:21 UTC (rev 180428)
+++ trunk/Tools/WebEditingTester/MainMenu.xib        2015-02-20 19:17:51 UTC (rev 180429)
</span><span class="lines">@@ -69,14 +69,13 @@
</span><span class="cx">                     &lt;modifierMask key=&quot;keyEquivalentModifierMask&quot;/&gt;
</span><span class="cx">                     &lt;menu key=&quot;submenu&quot; title=&quot;File&quot; id=&quot;bib-Uj-vzu&quot;&gt;
</span><span class="cx">                         &lt;items&gt;
</span><del>-                            &lt;menuItem title=&quot;New WK1 Editor&quot; id=&quot;2Pd-3X-Tvf&quot; userLabel=&quot;New WK1 Editor&quot;&gt;
-                                &lt;modifierMask key=&quot;keyEquivalentModifierMask&quot;/&gt;
</del><ins>+                            &lt;menuItem title=&quot;New WK1 Editor&quot; keyEquivalent=&quot;n&quot; id=&quot;2Pd-3X-Tvf&quot; userLabel=&quot;New WK1 Editor&quot;&gt;
</ins><span class="cx">                                 &lt;connections&gt;
</span><span class="cx">                                     &lt;action selector=&quot;newEditor:&quot; target=&quot;Voe-Tx-rLC&quot; id=&quot;21m-3B-oXY&quot;/&gt;
</span><span class="cx">                                 &lt;/connections&gt;
</span><span class="cx">                             &lt;/menuItem&gt;
</span><del>-                            &lt;menuItem title=&quot;New WK2 Editor&quot; id=&quot;kzr-0m-cAu&quot; userLabel=&quot;New WK2 Editor&quot;&gt;
-                                &lt;modifierMask key=&quot;keyEquivalentModifierMask&quot;/&gt;
</del><ins>+                            &lt;menuItem title=&quot;New WK2 Editor&quot; alternate=&quot;YES&quot; keyEquivalent=&quot;n&quot; id=&quot;kzr-0m-cAu&quot; userLabel=&quot;New WK2 Editor&quot;&gt;
+                                &lt;modifierMask key=&quot;keyEquivalentModifierMask&quot; option=&quot;YES&quot; command=&quot;YES&quot;/&gt;
</ins><span class="cx">                                 &lt;connections&gt;
</span><span class="cx">                                     &lt;action selector=&quot;newEditor:&quot; target=&quot;Voe-Tx-rLC&quot; id=&quot;Za3-gM-3R7&quot;/&gt;
</span><span class="cx">                                 &lt;/connections&gt;
</span></span></pre></div>
<a id="trunkToolsWebEditingTesterWK1WebDocumentControllerm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebEditingTester/WK1WebDocumentController.m (180428 => 180429)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebEditingTester/WK1WebDocumentController.m        2015-02-20 19:16:21 UTC (rev 180428)
+++ trunk/Tools/WebEditingTester/WK1WebDocumentController.m        2015-02-20 19:17:51 UTC (rev 180429)
</span><span class="lines">@@ -52,9 +52,9 @@
</span><span class="cx">     [containerView addSubview:_webView];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)loadContent
</del><ins>+- (void)loadHTMLString:(NSString *)content
</ins><span class="cx"> {
</span><del>-    [[_webView mainFrame] loadHTMLString:[self defaultEditingSource] 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="trunkToolsWebEditingTesterWK2WebDocumentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebEditingTester/WK2WebDocumentController.h (180428 => 180429)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebEditingTester/WK2WebDocumentController.h        2015-02-20 19:16:21 UTC (rev 180428)
+++ trunk/Tools/WebEditingTester/WK2WebDocumentController.h        2015-02-20 19:17:51 UTC (rev 180429)
</span><span class="lines">@@ -29,7 +29,5 @@
</span><span class="cx"> 
</span><span class="cx"> @interface WK2WebDocumentController : WebDocumentController&lt;WebDocument&gt;
</span><span class="cx"> 
</span><del>-- (instancetype)initWithConfiguration:(WKWebViewConfiguration *)configuration;
-
</del><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebEditingTesterWK2WebDocumentControllerm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebEditingTester/WK2WebDocumentController.m (180428 => 180429)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebEditingTester/WK2WebDocumentController.m        2015-02-20 19:16:21 UTC (rev 180428)
+++ trunk/Tools/WebEditingTester/WK2WebDocumentController.m        2015-02-20 19:17:51 UTC (rev 180429)
</span><span class="lines">@@ -38,18 +38,20 @@
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation WK2WebDocumentController {
</span><del>-    WKWebViewConfiguration *_configuration;
</del><span class="cx">     WKWebView *_webView;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (instancetype)initWithConfiguration:(WKWebViewConfiguration *)configuration
</del><ins>+static WKWebViewConfiguration *defaultConfiguration()
</ins><span class="cx"> {
</span><del>-    if (!(self = [super initWithWindowNibName:@&quot;WebDocument&quot;]))
-        return nil;
-    _configuration = [configuration copy];
-    
-    return self;
-    
</del><ins>+    static WKWebViewConfiguration *configuration;
+
+    if (!configuration) {
+        configuration = [[WKWebViewConfiguration alloc] init];
+        configuration.preferences._fullScreenEnabled = YES;
+        configuration.preferences._developerExtrasEnabled = YES;
+    }
+
+    return configuration;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (IBAction)pasteAsMarkup:(id)sender
</span><span class="lines">@@ -59,7 +61,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)awakeFromNib
</span><span class="cx"> {
</span><del>-    _webView = [[WKWebView alloc] initWithFrame:[containerView bounds] configuration:_configuration];
</del><ins>+    _webView = [[WKWebView alloc] initWithFrame:[containerView bounds] configuration:defaultConfiguration()];
</ins><span class="cx">     [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
</span><span class="cx">     [_webView _setEditable:YES];
</span><span class="cx">     [_webView setUIDelegate:self];
</span><span class="lines">@@ -68,9 +70,9 @@
</span><span class="cx">     [self.window setTitle:@&quot;WebEditor [WK2]&quot;];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)loadContent
</del><ins>+- (void)loadHTMLString:(NSString *)content
</ins><span class="cx"> {
</span><del>-    [_webView loadHTMLString:[self defaultEditingSource] baseURL:nil];
</del><ins>+    [_webView loadHTMLString:content baseURL:nil];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkToolsWebEditingTesterWebDocumentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebEditingTester/WebDocumentController.h (180428 => 180429)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebEditingTester/WebDocumentController.h        2015-02-20 19:16:21 UTC (rev 180428)
+++ trunk/Tools/WebEditingTester/WebDocumentController.h        2015-02-20 19:17:51 UTC (rev 180429)
</span><span class="lines">@@ -33,9 +33,10 @@
</span><span class="cx"> {
</span><span class="cx">     IBOutlet NSView *containerView;
</span><span class="cx"> }
</span><del>-- (NSString *)defaultEditingSource;
-- (void)applicationTerminating;
-- (void)loadContent;
</del><span class="cx"> 
</span><ins>++ (NSString *)defaultEditingSource;
+
+- (void)loadHTMLString:(NSString *)content;
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebEditingTesterWebDocumentControllerm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebEditingTester/WebDocumentController.m (180428 => 180429)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebEditingTester/WebDocumentController.m        2015-02-20 19:16:21 UTC (rev 180428)
+++ trunk/Tools/WebEditingTester/WebDocumentController.m        2015-02-20 19:17:51 UTC (rev 180429)
</span><span class="lines">@@ -27,29 +27,28 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WebDocumentController
</span><span class="cx"> 
</span><ins>+- (instancetype)init
+{
+    if (!(self = [super initWithWindowNibName:@&quot;WebDocument&quot;]))
+        return nil;
+
+    return self;
+}
+
</ins><span class="cx"> - (id)initWithWindow:(NSWindow *)window
</span><span class="cx"> {
</span><span class="cx">     self = [super initWithWindow:window];
</span><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)windowDidLoad
-{    
-    [super windowDidLoad];
-}
-
-- (const NSString *)defaultEditingSource
</del><ins>++ (const NSString *)defaultEditingSource
</ins><span class="cx"> {
</span><span class="cx">     const static NSString *source = @&quot;&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;&quot;;
</span><span class="cx">     return source;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)applicationTerminating
</del><ins>+- (void)loadHTMLString:(NSString *)content
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)loadContent
-{
-}
-
</del><span class="cx"> @end
</span></span></pre>
</div>
</div>

</body>
</html>