<!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>[191757] trunk/Source/WebKit2</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/191757">191757</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-10-29 15:07:42 -0700 (Thu, 29 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>WKView being inside WKWebView leads to weird API issues
https://bugs.webkit.org/show_bug.cgi?id=150174

Reviewed by Darin Adler.

* UIProcess/API/mac/WKView.mm:
(-[WKView browsingContextController]):
(-[WKView validateUserInterfaceItem:]):
(-[WKView saveBackForwardSnapshotForCurrentItem]):
(-[WKView saveBackForwardSnapshotForItem:]):
(-[WKView updateLayer]):
(-[WKView minimumSizeForAutoLayout]):
(-[WKView setMinimumSizeForAutoLayout:]):
(-[WKView shouldExpandToViewHeightForAutoLayout]):
(-[WKView setShouldExpandToViewHeightForAutoLayout:]):
(-[WKView underlayColor]):
(-[WKView setUnderlayColor:]):
(-[WKView _setOverlayScrollbarStyle:]):
(-[WKView _overlayScrollbarStyle]):
(-[WKView _pageExtendedBackgroundColor]):
(-[WKView forceAsyncDrawingAreaSizeUpdate:]):
(-[WKView waitForAsyncDrawingAreaSizeUpdate]):
(-[WKView isUsingUISideCompositing]):
(createSelectorExceptionMap): Deleted.
(commandNameForSelector): Deleted.
(menuItem): Deleted.
(toolbarItem): Deleted.
(-[WKView _setUserInterfaceItemState:enabled:state:]): Deleted.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::createDrawingAreaProxy):
(WebKit::WebViewImpl::isUsingUISideCompositing):
(WebKit::WebViewImpl::forceAsyncDrawingAreaSizeUpdate):
(WebKit::WebViewImpl::waitForAsyncDrawingAreaSizeUpdate):
(WebKit::WebViewImpl::updateLayer):
(WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
(WebKit::WebViewImpl::minimumSizeForAutoLayout):
(WebKit::WebViewImpl::setShouldExpandToViewHeightForAutoLayout):
(WebKit::WebViewImpl::shouldExpandToViewHeightForAutoLayout):
(WebKit::WebViewImpl::setUnderlayColor):
(WebKit::WebViewImpl::underlayColor):
(WebKit::WebViewImpl::pageExtendedBackgroundColor):
(WebKit::WebViewImpl::setOverlayScrollbarStyle):
(WebKit::WebViewImpl::overlayScrollbarStyle):
(WebKit::createSelectorExceptionMap):
(WebKit::commandNameForSelector):
(WebKit::WebViewImpl::executeSavedCommandBySelector):
(WebKit::WebViewImpl::executeEditCommandForSelector):
(WebKit::menuItem):
(WebKit::toolbarItem):
(WebKit::WebViewImpl::validateUserInterfaceItem):
(WebKit::WebViewImpl::setUserInterfaceItemState):
(WebKit::WebViewImpl::browsingContextController):
(WebKit::WebViewImpl::saveBackForwardSnapshotForCurrentItem):
(WebKit::WebViewImpl::saveBackForwardSnapshotForItem):
(WebKit::WebViewImpl::executeEditCommand): Deleted.
Move UI validation and a grab-bag of other things.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebViewImplh">trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebViewImplmm">trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191756 => 191757)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-29 21:54:24 UTC (rev 191756)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-29 22:07:42 UTC (rev 191757)
</span><span class="lines">@@ -1,3 +1,63 @@
</span><ins>+2015-10-29  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        WKView being inside WKWebView leads to weird API issues
+        https://bugs.webkit.org/show_bug.cgi?id=150174
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView browsingContextController]):
+        (-[WKView validateUserInterfaceItem:]):
+        (-[WKView saveBackForwardSnapshotForCurrentItem]):
+        (-[WKView saveBackForwardSnapshotForItem:]):
+        (-[WKView updateLayer]):
+        (-[WKView minimumSizeForAutoLayout]):
+        (-[WKView setMinimumSizeForAutoLayout:]):
+        (-[WKView shouldExpandToViewHeightForAutoLayout]):
+        (-[WKView setShouldExpandToViewHeightForAutoLayout:]):
+        (-[WKView underlayColor]):
+        (-[WKView setUnderlayColor:]):
+        (-[WKView _setOverlayScrollbarStyle:]):
+        (-[WKView _overlayScrollbarStyle]):
+        (-[WKView _pageExtendedBackgroundColor]):
+        (-[WKView forceAsyncDrawingAreaSizeUpdate:]):
+        (-[WKView waitForAsyncDrawingAreaSizeUpdate]):
+        (-[WKView isUsingUISideCompositing]):
+        (createSelectorExceptionMap): Deleted.
+        (commandNameForSelector): Deleted.
+        (menuItem): Deleted.
+        (toolbarItem): Deleted.
+        (-[WKView _setUserInterfaceItemState:enabled:state:]): Deleted.
+        * UIProcess/Cocoa/WebViewImpl.h:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::createDrawingAreaProxy):
+        (WebKit::WebViewImpl::isUsingUISideCompositing):
+        (WebKit::WebViewImpl::forceAsyncDrawingAreaSizeUpdate):
+        (WebKit::WebViewImpl::waitForAsyncDrawingAreaSizeUpdate):
+        (WebKit::WebViewImpl::updateLayer):
+        (WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
+        (WebKit::WebViewImpl::minimumSizeForAutoLayout):
+        (WebKit::WebViewImpl::setShouldExpandToViewHeightForAutoLayout):
+        (WebKit::WebViewImpl::shouldExpandToViewHeightForAutoLayout):
+        (WebKit::WebViewImpl::setUnderlayColor):
+        (WebKit::WebViewImpl::underlayColor):
+        (WebKit::WebViewImpl::pageExtendedBackgroundColor):
+        (WebKit::WebViewImpl::setOverlayScrollbarStyle):
+        (WebKit::WebViewImpl::overlayScrollbarStyle):
+        (WebKit::createSelectorExceptionMap):
+        (WebKit::commandNameForSelector):
+        (WebKit::WebViewImpl::executeSavedCommandBySelector):
+        (WebKit::WebViewImpl::executeEditCommandForSelector):
+        (WebKit::menuItem):
+        (WebKit::toolbarItem):
+        (WebKit::WebViewImpl::validateUserInterfaceItem):
+        (WebKit::WebViewImpl::setUserInterfaceItemState):
+        (WebKit::WebViewImpl::browsingContextController):
+        (WebKit::WebViewImpl::saveBackForwardSnapshotForCurrentItem):
+        (WebKit::WebViewImpl::saveBackForwardSnapshotForItem):
+        (WebKit::WebViewImpl::executeEditCommand): Deleted.
+        Move UI validation and a grab-bag of other things.
+
</ins><span class="cx"> 2015-10-29  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix Mac CMake build
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (191756 => 191757)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-10-29 21:54:24 UTC (rev 191756)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-10-29 22:07:42 UTC (rev 191757)
</span><span class="lines">@@ -106,7 +106,6 @@
</span><span class="cx"> #import &lt;wtf/RunLoop.h&gt;
</span><span class="cx"> 
</span><span class="cx"> /* API internals. */
</span><del>-#import &quot;WKBrowsingContextControllerInternal.h&quot;
</del><span class="cx"> #import &quot;WKBrowsingContextGroupPrivate.h&quot;
</span><span class="cx"> #import &quot;WKProcessGroupPrivate.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -126,14 +125,6 @@
</span><span class="cx"> using namespace WebKit;
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><del>-namespace WebKit {
-
-typedef id &lt;NSValidatedUserInterfaceItem&gt; ValidationItem;
-typedef Vector&lt;RetainPtr&lt;ValidationItem&gt;&gt; ValidationVector;
-typedef HashMap&lt;String, ValidationVector&gt; ValidationMap;
-
-}
-
</del><span class="cx"> #if !USE(ASYNC_NSTEXTINPUTCLIENT)
</span><span class="cx"> struct WKViewInterpretKeyEventsParameters {
</span><span class="cx">     bool eventInterpretationHadSideEffects;
</span><span class="lines">@@ -149,13 +140,6 @@
</span><span class="cx">     RefPtr&lt;WebPageProxy&gt; _page;
</span><span class="cx">     std::unique_ptr&lt;WebViewImpl&gt; _impl;
</span><span class="cx"> 
</span><del>-#if WK_API_ENABLED
-    RetainPtr&lt;WKBrowsingContextController&gt; _browsingContextController;
-#endif
-
-    // For asynchronous validation.
-    ValidationMap _validationMap;
-
</del><span class="cx">     // We keep here the event when resending it to
</span><span class="cx">     // the application to distinguish the case of a new event from one 
</span><span class="cx">     // that has been already sent to WebCore.
</span><span class="lines">@@ -213,15 +197,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><del>-
</del><span class="cx"> - (WKBrowsingContextController *)browsingContextController
</span><span class="cx"> {
</span><del>-    if (!_data-&gt;_browsingContextController)
-        _data-&gt;_browsingContextController = adoptNS([[WKBrowsingContextController alloc] _initWithPageRef:toAPI(_data-&gt;_page.get())]);
-
-    return _data-&gt;_browsingContextController.get();
</del><ins>+    return _data-&gt;_impl-&gt;browsingContextController();
</ins><span class="cx"> }
</span><del>-
</del><span class="cx"> #endif // WK_API_ENABLED
</span><span class="cx"> 
</span><span class="cx"> - (void)setDrawsBackground:(BOOL)drawsBackground
</span><span class="lines">@@ -297,49 +276,8 @@
</span><span class="cx">     [super renewGState];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-typedef HashMap&lt;SEL, String&gt; SelectorNameMap;
</del><ins>+#define WEBCORE_COMMAND(command) - (void)command:(id)sender { _data-&gt;_impl-&gt;executeEditCommandForSelector(_cmd); }
</ins><span class="cx"> 
</span><del>-// Map selectors into Editor command names.
-// This is not needed for any selectors that have the same name as the Editor command.
-static const SelectorNameMap* createSelectorExceptionMap()
-{
-    SelectorNameMap* map = new HashMap&lt;SEL, String&gt;;
-    
-    map-&gt;add(@selector(insertNewlineIgnoringFieldEditor:), &quot;InsertNewline&quot;);
-    map-&gt;add(@selector(insertParagraphSeparator:), &quot;InsertNewline&quot;);
-    map-&gt;add(@selector(insertTabIgnoringFieldEditor:), &quot;InsertTab&quot;);
-    map-&gt;add(@selector(pageDown:), &quot;MovePageDown&quot;);
-    map-&gt;add(@selector(pageDownAndModifySelection:), &quot;MovePageDownAndModifySelection&quot;);
-    map-&gt;add(@selector(pageUp:), &quot;MovePageUp&quot;);
-    map-&gt;add(@selector(pageUpAndModifySelection:), &quot;MovePageUpAndModifySelection&quot;);
-    map-&gt;add(@selector(scrollPageDown:), &quot;ScrollPageForward&quot;);
-    map-&gt;add(@selector(scrollPageUp:), &quot;ScrollPageBackward&quot;);
-    
-    return map;
-}
-
-static String commandNameForSelector(SEL selector)
-{
-    // Check the exception map first.
-    static const SelectorNameMap* exceptionMap = createSelectorExceptionMap();
-    SelectorNameMap::const_iterator it = exceptionMap-&gt;find(selector);
-    if (it != exceptionMap-&gt;end())
-        return it-&gt;value;
-    
-    // Remove the trailing colon.
-    // No need to capitalize the command name since Editor command names are
-    // not case sensitive.
-    const char* selectorName = sel_getName(selector);
-    size_t selectorNameLength = strlen(selectorName);
-    if (selectorNameLength &lt; 2 || selectorName[selectorNameLength - 1] != ':')
-        return String();
-    return String(selectorName, selectorNameLength - 1);
-}
-
-// Editing commands
-
-#define WEBCORE_COMMAND(command) - (void)command:(id)sender { _data-&gt;_impl-&gt;executeEditCommand(commandNameForSelector(_cmd)); }
-
</del><span class="cx"> WEBCORE_COMMAND(alignCenter)
</span><span class="cx"> WEBCORE_COMMAND(alignJustified)
</span><span class="cx"> WEBCORE_COMMAND(alignLeft)
</span><span class="lines">@@ -530,126 +468,9 @@
</span><span class="cx"> 
</span><span class="cx"> */
</span><span class="cx"> 
</span><del>-// Menu items validation
-
-static NSMenuItem *menuItem(id &lt;NSValidatedUserInterfaceItem&gt; item)
-{
-    if (![(NSObject *)item isKindOfClass:[NSMenuItem class]])
-        return nil;
-    return (NSMenuItem *)item;
-}
-
-static NSToolbarItem *toolbarItem(id &lt;NSValidatedUserInterfaceItem&gt; item)
-{
-    if (![(NSObject *)item isKindOfClass:[NSToolbarItem class]])
-        return nil;
-    return (NSToolbarItem *)item;
-}
-
</del><span class="cx"> - (BOOL)validateUserInterfaceItem:(id &lt;NSValidatedUserInterfaceItem&gt;)item
</span><span class="cx"> {
</span><del>-    SEL action = [item action];
-
-    if (action == @selector(showGuessPanel:)) {
-        if (NSMenuItem *menuItem = ::menuItem(item))
-            [menuItem setTitle:contextMenuItemTagShowSpellingPanel(![[[NSSpellChecker sharedSpellChecker] spellingPanel] isVisible])];
-        return _data-&gt;_page-&gt;editorState().isContentEditable;
-    }
-
-    if (action == @selector(checkSpelling:) || action == @selector(changeSpelling:))
-        return _data-&gt;_page-&gt;editorState().isContentEditable;
-
-    if (action == @selector(toggleContinuousSpellChecking:)) {
-        bool enabled = TextChecker::isContinuousSpellCheckingAllowed();
-        bool checked = enabled &amp;&amp; TextChecker::state().isContinuousSpellCheckingEnabled;
-        [menuItem(item) setState:checked ? NSOnState : NSOffState];
-        return enabled;
-    }
-
-    if (action == @selector(toggleGrammarChecking:)) {
-        bool checked = TextChecker::state().isGrammarCheckingEnabled;
-        [menuItem(item) setState:checked ? NSOnState : NSOffState];
-        return YES;
-    }
-
-    if (action == @selector(toggleAutomaticSpellingCorrection:)) {
-        bool checked = TextChecker::state().isAutomaticSpellingCorrectionEnabled;
-        [menuItem(item) setState:checked ? NSOnState : NSOffState];
-        return _data-&gt;_page-&gt;editorState().isContentEditable;
-    }
-
-    if (action == @selector(orderFrontSubstitutionsPanel:)) {
-        if (NSMenuItem *menuItem = ::menuItem(item))
-            [menuItem setTitle:contextMenuItemTagShowSubstitutions(![[[NSSpellChecker sharedSpellChecker] substitutionsPanel] isVisible])];
-        return _data-&gt;_page-&gt;editorState().isContentEditable;
-    }
-
-    if (action == @selector(toggleSmartInsertDelete:)) {
-        bool checked = _data-&gt;_page-&gt;isSmartInsertDeleteEnabled();
-        [menuItem(item) setState:checked ? NSOnState : NSOffState];
-        return _data-&gt;_page-&gt;editorState().isContentEditable;
-    }
-
-    if (action == @selector(toggleAutomaticQuoteSubstitution:)) {
-        bool checked = TextChecker::state().isAutomaticQuoteSubstitutionEnabled;
-        [menuItem(item) setState:checked ? NSOnState : NSOffState];
-        return _data-&gt;_page-&gt;editorState().isContentEditable;
-    }
-
-    if (action == @selector(toggleAutomaticDashSubstitution:)) {
-        bool checked = TextChecker::state().isAutomaticDashSubstitutionEnabled;
-        [menuItem(item) setState:checked ? NSOnState : NSOffState];
-        return _data-&gt;_page-&gt;editorState().isContentEditable;
-    }
-
-    if (action == @selector(toggleAutomaticLinkDetection:)) {
-        bool checked = TextChecker::state().isAutomaticLinkDetectionEnabled;
-        [menuItem(item) setState:checked ? NSOnState : NSOffState];
-        return _data-&gt;_page-&gt;editorState().isContentEditable;
-    }
-
-    if (action == @selector(toggleAutomaticTextReplacement:)) {
-        bool checked = TextChecker::state().isAutomaticTextReplacementEnabled;
-        [menuItem(item) setState:checked ? NSOnState : NSOffState];
-        return _data-&gt;_page-&gt;editorState().isContentEditable;
-    }
-
-    if (action == @selector(uppercaseWord:) || action == @selector(lowercaseWord:) || action == @selector(capitalizeWord:))
-        return _data-&gt;_page-&gt;editorState().selectionIsRange &amp;&amp; _data-&gt;_page-&gt;editorState().isContentEditable;
-    
-    if (action == @selector(stopSpeaking:))
-        return [NSApp isSpeaking];
-    
-    // The centerSelectionInVisibleArea: selector is enabled if there's a selection range or if there's an insertion point in an editable area.
-    if (action == @selector(centerSelectionInVisibleArea:))
-        return _data-&gt;_page-&gt;editorState().selectionIsRange || (_data-&gt;_page-&gt;editorState().isContentEditable &amp;&amp; !_data-&gt;_page-&gt;editorState().selectionIsNone);
-
-    // Next, handle editor commands. Start by returning YES for anything that is not an editor command.
-    // Returning YES is the default thing to do in an AppKit validate method for any selector that is not recognized.
-    String commandName = commandNameForSelector([item action]);
-    if (!Editor::commandIsSupportedFromMenuOrKeyBinding(commandName))
-        return YES;
-
-    // Add this item to the vector of items for a given command that are awaiting validation.
-    ValidationMap::AddResult addResult = _data-&gt;_validationMap.add(commandName, ValidationVector());
-    addResult.iterator-&gt;value.append(item);
-    if (addResult.isNewEntry) {
-        // If we are not already awaiting validation for this command, start the asynchronous validation process.
-        // FIXME: Theoretically, there is a race here; when we get the answer it might be old, from a previous time
-        // we asked for the same command; there is no guarantee the answer is still valid.
-        _data-&gt;_page-&gt;validateCommand(commandName, [self](const String&amp; commandName, bool isEnabled, int32_t state, WebKit::CallbackBase::Error error) {
-            // If the process exits before the command can be validated, we'll be called back with an error.
-            if (error != WebKit::CallbackBase::Error::None)
-                return;
-            
-            [self _setUserInterfaceItemState:commandName enabled:isEnabled state:state];
-        });
-    }
-
-    // Treat as enabled until we get the result back from the web process and _setUserInterfaceItemState is called.
-    // FIXME &lt;rdar://problem/8803459&gt;: This means disabled items will flash enabled at first for a moment.
-    // But returning NO here would be worse; that would make keyboard commands such as command-C fail.
-    return YES;
</del><ins>+    return _data-&gt;_impl-&gt;validateUserInterfaceItem(item);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (IBAction)startSpeaking:(id)sender
</span><span class="lines">@@ -2171,19 +1992,6 @@
</span><span class="cx">     _data-&gt;_impl-&gt;quickLookWithEvent(event);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setUserInterfaceItemState:(NSString *)commandName enabled:(BOOL)isEnabled state:(int)newState
-{
-    ValidationVector items = _data-&gt;_validationMap.take(commandName);
-    size_t size = items.size();
-    for (size_t i = 0; i &lt; size; ++i) {
-        ValidationItem item = items[i].get();
-        [menuItem(item) setState:newState];
-        [menuItem(item) setEnabled:isEnabled];
-        [toolbarItem(item) setEnabled:isEnabled];
-        // FIXME &lt;rdar://problem/8803392&gt;: If the item is neither a menu nor toolbar item, it will be left enabled.
-    }
-}
-
</del><span class="cx"> - (void)_doneWithKeyEvent:(NSEvent *)event eventWasHandled:(BOOL)eventWasHandled
</span><span class="cx"> {
</span><span class="cx">     if ([event type] != NSKeyDown)
</span><span class="lines">@@ -2325,12 +2133,12 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)saveBackForwardSnapshotForCurrentItem
</span><span class="cx"> {
</span><del>-    _data-&gt;_page-&gt;recordNavigationSnapshot();
</del><ins>+    _data-&gt;_impl-&gt;saveBackForwardSnapshotForCurrentItem();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)saveBackForwardSnapshotForItem:(WKBackForwardListItemRef)item
</span><span class="cx"> {
</span><del>-    _data-&gt;_page-&gt;recordNavigationSnapshot(*toImpl(item));
</del><ins>+    _data-&gt;_impl-&gt;saveBackForwardSnapshotForItem(*toImpl(item));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef
</span><span class="lines">@@ -2363,19 +2171,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)updateLayer
</span><span class="cx"> {
</span><del>-    if ([self drawsBackground] &amp;&amp; ![self drawsTransparentBackground])
-        self.layer.backgroundColor = CGColorGetConstantColor(kCGColorWhite);
-    else
-        self.layer.backgroundColor = CGColorGetConstantColor(kCGColorClear);
-
-    // If asynchronous geometry updates have been sent by forceAsyncDrawingAreaSizeUpdate,
-    // then subsequent calls to setFrameSize should not result in us waiting for the did
-    // udpate response if setFrameSize is called.
-    if ([self frameSizeUpdatesDisabled])
-        return;
-
-    if (DrawingAreaProxy* drawingArea = _data-&gt;_page-&gt;drawingArea())
-        drawingArea-&gt;waitForPossibleGeometryUpdate();
</del><ins>+    _data-&gt;_impl-&gt;updateLayer();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (WKPageRef)pageRef
</span><span class="lines">@@ -2431,27 +2227,22 @@
</span><span class="cx"> 
</span><span class="cx"> - (NSSize)minimumSizeForAutoLayout
</span><span class="cx"> {
</span><del>-    return _data-&gt;_page-&gt;minimumLayoutSize();
</del><ins>+    return NSSizeFromCGSize(_data-&gt;_impl-&gt;minimumSizeForAutoLayout());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setMinimumSizeForAutoLayout:(NSSize)minimumSizeForAutoLayout
</span><span class="cx"> {
</span><del>-    BOOL expandsToFit = minimumSizeForAutoLayout.width &gt; 0;
-
-    _data-&gt;_page-&gt;setMinimumLayoutSize(IntSize(minimumSizeForAutoLayout.width, minimumSizeForAutoLayout.height));
-    _data-&gt;_page-&gt;setMainFrameIsScrollable(!expandsToFit);
-
-    [self setShouldClipToVisibleRect:expandsToFit];
</del><ins>+    _data-&gt;_impl-&gt;setMinimumSizeForAutoLayout(NSSizeToCGSize(minimumSizeForAutoLayout));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)shouldExpandToViewHeightForAutoLayout
</span><span class="cx"> {
</span><del>-    return _data-&gt;_page-&gt;autoSizingShouldExpandToViewHeight();
</del><ins>+    return _data-&gt;_impl-&gt;shouldExpandToViewHeightForAutoLayout();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setShouldExpandToViewHeightForAutoLayout:(BOOL)shouldExpand
</span><span class="cx"> {
</span><del>-    return _data-&gt;_page-&gt;setAutoSizingShouldExpandToViewHeight(shouldExpand);
</del><ins>+    return _data-&gt;_impl-&gt;setShouldExpandToViewHeightForAutoLayout(shouldExpand);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)shouldClipToVisibleRect
</span><span class="lines">@@ -2466,16 +2257,12 @@
</span><span class="cx"> 
</span><span class="cx"> - (NSColor *)underlayColor
</span><span class="cx"> {
</span><del>-    Color webColor = _data-&gt;_page-&gt;underlayColor();
-    if (!webColor.isValid())
-        return nil;
-
-    return nsColor(webColor);
</del><ins>+    return _data-&gt;_impl-&gt;underlayColor();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setUnderlayColor:(NSColor *)underlayColor
</span><span class="cx"> {
</span><del>-    _data-&gt;_page-&gt;setUnderlayColor(colorFromNSColor(underlayColor));
</del><ins>+    _data-&gt;_impl-&gt;setUnderlayColor(underlayColor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="lines">@@ -2642,103 +2429,68 @@
</span><span class="cx">     return _data-&gt;_impl-&gt;totalHeightOfBanners();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setOverlayScrollbarStyle:(_WKOverlayScrollbarStyle)scrollbarStyle
</del><ins>+static WTF::Optional&lt;WebCore::ScrollbarOverlayStyle&gt; toCoreScrollbarStyle(_WKOverlayScrollbarStyle scrollbarStyle)
</ins><span class="cx"> {
</span><del>-    WTF::Optional&lt;WebCore::ScrollbarOverlayStyle&gt; coreScrollbarStyle;
-
</del><span class="cx">     switch (scrollbarStyle) {
</span><span class="cx">     case _WKOverlayScrollbarStyleDark:
</span><del>-        coreScrollbarStyle = ScrollbarOverlayStyleDark;
-        break;
</del><ins>+        return WebCore::ScrollbarOverlayStyleDark;
</ins><span class="cx">     case _WKOverlayScrollbarStyleLight:
</span><del>-        coreScrollbarStyle = ScrollbarOverlayStyleLight;
-        break;
</del><ins>+        return WebCore::ScrollbarOverlayStyleLight;
</ins><span class="cx">     case _WKOverlayScrollbarStyleDefault:
</span><del>-        coreScrollbarStyle = ScrollbarOverlayStyleDefault;
-        break;
</del><ins>+        return WebCore::ScrollbarOverlayStyleDefault;
</ins><span class="cx">     case _WKOverlayScrollbarStyleAutomatic:
</span><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    _data-&gt;_page-&gt;setOverlayScrollbarStyle(coreScrollbarStyle);
</del><ins>+    return Nullopt;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (_WKOverlayScrollbarStyle)_overlayScrollbarStyle
</del><ins>+static _WKOverlayScrollbarStyle toAPIScrollbarStyle(WTF::Optional&lt;WebCore::ScrollbarOverlayStyle&gt; coreScrollbarStyle)
</ins><span class="cx"> {
</span><del>-    WTF::Optional&lt;WebCore::ScrollbarOverlayStyle&gt; coreScrollbarStyle = _data-&gt;_page-&gt;overlayScrollbarStyle();
-
</del><span class="cx">     if (!coreScrollbarStyle)
</span><span class="cx">         return _WKOverlayScrollbarStyleAutomatic;
</span><span class="cx"> 
</span><span class="cx">     switch (coreScrollbarStyle.value()) {
</span><del>-    case ScrollbarOverlayStyleDark:
</del><ins>+    case WebCore::ScrollbarOverlayStyleDark:
</ins><span class="cx">         return _WKOverlayScrollbarStyleDark;
</span><del>-    case ScrollbarOverlayStyleLight:
</del><ins>+    case WebCore::ScrollbarOverlayStyleLight:
</ins><span class="cx">         return _WKOverlayScrollbarStyleLight;
</span><del>-    case ScrollbarOverlayStyleDefault:
</del><ins>+    case WebCore::ScrollbarOverlayStyleDefault:
</ins><span class="cx">         return _WKOverlayScrollbarStyleDefault;
</span><span class="cx">     default:
</span><span class="cx">         return _WKOverlayScrollbarStyleAutomatic;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (NSColor *)_pageExtendedBackgroundColor
</del><ins>+- (void)_setOverlayScrollbarStyle:(_WKOverlayScrollbarStyle)scrollbarStyle
</ins><span class="cx"> {
</span><del>-    WebCore::Color color = _data-&gt;_page-&gt;pageExtendedBackgroundColor();
-    if (!color.isValid())
-        return nil;
</del><ins>+    _data-&gt;_impl-&gt;setOverlayScrollbarStyle(toCoreScrollbarStyle(scrollbarStyle));
+}
</ins><span class="cx"> 
</span><del>-    return nsColor(color);
</del><ins>+- (_WKOverlayScrollbarStyle)_overlayScrollbarStyle
+{
+    return toAPIScrollbarStyle(_data-&gt;_impl-&gt;overlayScrollbarStyle());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wmissing-noreturn&quot;
-// This method forces a drawing area geometry update, even if frame size updates are disabled.
-// The updated is performed asynchronously; we don't wait for the geometry update before returning.
-// The area drawn need not match the current frame size - if it differs it will be anchored to the
-// frame according to the current contentAnchor.
-- (void)forceAsyncDrawingAreaSizeUpdate:(NSSize)size
</del><ins>+- (NSColor *)_pageExtendedBackgroundColor
</ins><span class="cx"> {
</span><del>-    // This SPI is only used on 10.9 and below, and is incompatible with the fence-based drawing area size synchronization in 10.10+.
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1090
-    if (_data-&gt;_impl-&gt;clipsToVisibleRect())
-        _data-&gt;_impl-&gt;updateViewExposedRect();
-    _data-&gt;_impl-&gt;setDrawingAreaSize(NSSizeToCGSize(size));
</del><ins>+    return _data-&gt;_impl-&gt;pageExtendedBackgroundColor();
+}
</ins><span class="cx"> 
</span><del>-    // If a geometry update is pending the new update won't be sent. Poll without waiting for any
-    // pending did-update message now, such that the new update can be sent. We do so after setting
-    // the drawing area size such that the latest update is sent.
-    if (DrawingAreaProxy* drawingArea = _data-&gt;_page-&gt;drawingArea())
-        drawingArea-&gt;waitForPossibleGeometryUpdate(std::chrono::milliseconds::zero());
-#else
-    ASSERT_NOT_REACHED();
-#endif
</del><ins>+- (void)forceAsyncDrawingAreaSizeUpdate:(NSSize)size
+{
+    _data-&gt;_impl-&gt;forceAsyncDrawingAreaSizeUpdate(NSSizeToCGSize(size));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)waitForAsyncDrawingAreaSizeUpdate
</span><span class="cx"> {
</span><del>-    // This SPI is only used on 10.9 and below, and is incompatible with the fence-based drawing area size synchronization in 10.10+.
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1090
-    if (DrawingAreaProxy* drawingArea = _data-&gt;_page-&gt;drawingArea()) {
-        // If a geometry update is still pending then the action of receiving the
-        // first geometry update may result in another update being scheduled -
-        // we should wait for this to complete too.
-        drawingArea-&gt;waitForPossibleGeometryUpdate(DrawingAreaProxy::didUpdateBackingStoreStateTimeout() / 2);
-        drawingArea-&gt;waitForPossibleGeometryUpdate(DrawingAreaProxy::didUpdateBackingStoreStateTimeout() / 2);
-    }
-#else
-    ASSERT_NOT_REACHED();
-#endif
</del><ins>+    _data-&gt;_impl-&gt;waitForAsyncDrawingAreaSizeUpdate();
</ins><span class="cx"> }
</span><del>-#pragma clang diagnostic pop
</del><span class="cx"> 
</span><span class="cx"> - (BOOL)isUsingUISideCompositing
</span><span class="cx"> {
</span><del>-    if (DrawingAreaProxy* drawingArea = _data-&gt;_page-&gt;drawingArea())
-        return drawingArea-&gt;type() == DrawingAreaTypeRemoteLayerTree;
-
-    return NO;
</del><ins>+    return _data-&gt;_impl-&gt;isUsingUISideCompositing();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)setAllowsMagnification:(BOOL)allowsMagnification
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h (191756 => 191757)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2015-10-29 21:54:24 UTC (rev 191756)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2015-10-29 22:07:42 UTC (rev 191757)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;PluginComplexTextInputState.h&quot;
</span><span class="cx"> #include &quot;WKLayoutMode.h&quot;
</span><span class="cx"> #include &quot;WebPageProxy.h&quot;
</span><ins>+#include &quot;_WKOverlayScrollbarStyle.h&quot;
</ins><span class="cx"> #include &lt;WebCore/TextIndicatorWindow.h&gt;
</span><span class="cx"> #include &lt;functional&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="lines">@@ -40,6 +41,7 @@
</span><span class="cx"> OBJC_CLASS NSImmediateActionGestureRecognizer;
</span><span class="cx"> OBJC_CLASS NSTextInputContext;
</span><span class="cx"> OBJC_CLASS NSView;
</span><ins>+OBJC_CLASS WKBrowsingContextController;
</ins><span class="cx"> OBJC_CLASS WKEditorUndoTargetObjC;
</span><span class="cx"> OBJC_CLASS WKFullScreenWindowController;
</span><span class="cx"> OBJC_CLASS WKImmediateActionController;
</span><span class="lines">@@ -80,6 +82,10 @@
</span><span class="cx"> class WebPageProxy;
</span><span class="cx"> struct ColorSpaceData;
</span><span class="cx"> 
</span><ins>+typedef id &lt;NSValidatedUserInterfaceItem&gt; ValidationItem;
+typedef Vector&lt;RetainPtr&lt;ValidationItem&gt;&gt; ValidationVector;
+typedef HashMap&lt;String, ValidationVector&gt; ValidationMap;
+
</ins><span class="cx"> class WebViewImpl {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(WebViewImpl);
</span><span class="lines">@@ -119,7 +125,11 @@
</span><span class="cx">     CGSize fixedLayoutSize() const;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;DrawingAreaProxy&gt; createDrawingAreaProxy();
</span><ins>+    bool isUsingUISideCompositing() const;
</ins><span class="cx">     void setDrawingAreaSize(CGSize);
</span><ins>+    void forceAsyncDrawingAreaSizeUpdate(CGSize);
+    void waitForAsyncDrawingAreaSizeUpdate();
+    void updateLayer();
</ins><span class="cx"> 
</span><span class="cx">     void setAutomaticallyAdjustsContentInsets(bool);
</span><span class="cx">     bool automaticallyAdjustsContentInsets() const { return m_automaticallyAdjustsContentInsets; }
</span><span class="lines">@@ -132,6 +142,10 @@
</span><span class="cx">     void setClipsToVisibleRect(bool);
</span><span class="cx">     bool clipsToVisibleRect() const { return m_clipsToVisibleRect; }
</span><span class="cx"> 
</span><ins>+    void setMinimumSizeForAutoLayout(CGSize);
+    CGSize minimumSizeForAutoLayout() const;
+    void setShouldExpandToViewHeightForAutoLayout(bool);
+    bool shouldExpandToViewHeightForAutoLayout() const;
</ins><span class="cx">     void setIntrinsicContentSize(CGSize);
</span><span class="cx">     CGSize intrinsicContentSize() const;
</span><span class="cx"> 
</span><span class="lines">@@ -164,6 +178,13 @@
</span><span class="cx"> 
</span><span class="cx">     ColorSpaceData colorSpace();
</span><span class="cx"> 
</span><ins>+    void setUnderlayColor(NSColor *);
+    NSColor *underlayColor() const;
+    NSColor *pageExtendedBackgroundColor() const;
+
+    void setOverlayScrollbarStyle(WTF::Optional&lt;WebCore::ScrollbarOverlayStyle&gt; scrollbarStyle);
+    WTF::Optional&lt;WebCore::ScrollbarOverlayStyle&gt; overlayScrollbarStyle() const;
+
</ins><span class="cx">     void beginDeferringViewInWindowChanges();
</span><span class="cx">     // FIXME: Merge these two?
</span><span class="cx">     void endDeferringViewInWindowChanges();
</span><span class="lines">@@ -204,7 +225,8 @@
</span><span class="cx">     NSWindow *createFullScreenWindow();
</span><span class="cx"> 
</span><span class="cx">     bool isEditable() const;
</span><del>-    void executeEditCommand(const String&amp; commandName, const String&amp; argument = String());
</del><ins>+    bool executeSavedCommandBySelector(SEL);
+    void executeEditCommandForSelector(SEL, const String&amp; argument = String());
</ins><span class="cx">     void registerEditCommand(RefPtr&lt;WebEditCommandProxy&gt;, WebPageProxy::UndoOrRedo);
</span><span class="cx">     void clearAllEditCommands();
</span><span class="cx">     bool writeSelectionToPasteboard(NSPasteboard *, NSArray *types);
</span><span class="lines">@@ -212,6 +234,7 @@
</span><span class="cx">     void selectionDidChange();
</span><span class="cx">     void startObservingFontPanel();
</span><span class="cx">     void updateFontPanelIfNeeded();
</span><ins>+    bool validateUserInterfaceItem(id &lt;NSValidatedUserInterfaceItem&gt;);
</ins><span class="cx"> 
</span><span class="cx">     void preferencesDidChange();
</span><span class="cx"> 
</span><span class="lines">@@ -274,6 +297,8 @@
</span><span class="cx"> 
</span><span class="cx">     _WKRemoteObjectRegistry *remoteObjectRegistry();
</span><span class="cx">     void destroyRemoteObjectRegistry(); // FIXME: Temporary. Can fold in after we move ownership of WebPageProxy here.
</span><ins>+
+    WKBrowsingContextController *browsingContextController();
</ins><span class="cx"> #endif // WK_API_ENABLED
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="lines">@@ -302,6 +327,8 @@
</span><span class="cx">     NSArray *namesOfPromisedFilesDroppedAtDestination(NSURL *dropDestination);
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;ViewSnapshot&gt; takeViewSnapshot();
</span><ins>+    void saveBackForwardSnapshotForCurrentItem();
+    void saveBackForwardSnapshotForItem(WebBackForwardListItem&amp;);
</ins><span class="cx"> 
</span><span class="cx">     ViewGestureController* gestureController() { return m_gestureController.get(); }
</span><span class="cx">     ViewGestureController&amp; ensureGestureController();
</span><span class="lines">@@ -329,8 +356,6 @@
</span><span class="cx">     void gestureEventWasNotHandledByWebCore(NSEvent *);
</span><span class="cx">     void gestureEventWasNotHandledByWebCoreFromViewOnly(NSEvent *);
</span><span class="cx"> 
</span><del>-    bool executeSavedCommandBySelector(SEL);
-
</del><span class="cx">     void setTotalHeightOfBanners(CGFloat totalHeightOfBanners) { m_totalHeightOfBanners = totalHeightOfBanners; }
</span><span class="cx">     CGFloat totalHeightOfBanners() const { return m_totalHeightOfBanners; }
</span><span class="cx"> 
</span><span class="lines">@@ -351,6 +376,8 @@
</span><span class="cx">     void reparentLayerTreeInThumbnailView();
</span><span class="cx">     void updateThumbnailViewLayer();
</span><span class="cx"> 
</span><ins>+    void setUserInterfaceItemState(NSString *commandName, bool enabled, int state);
+
</ins><span class="cx">     NSView &lt;WebViewImplDelegate&gt; *m_view;
</span><span class="cx">     WebPageProxy&amp; m_page;
</span><span class="cx">     PageClient&amp; m_pageClient;
</span><span class="lines">@@ -385,6 +412,8 @@
</span><span class="cx">     bool m_inSecureInputState { false };
</span><span class="cx">     RetainPtr&lt;WKEditorUndoTargetObjC&gt; m_undoTarget;
</span><span class="cx"> 
</span><ins>+    ValidationMap m_validationMap;
+
</ins><span class="cx">     // The identifier of the plug-in we want to send complex text input to, or 0 if there is none.
</span><span class="cx">     uint64_t m_pluginComplexTextInputIdentifier { 0 };
</span><span class="cx"> 
</span><span class="lines">@@ -435,6 +464,8 @@
</span><span class="cx">     _WKThumbnailView *m_thumbnailView { nullptr };
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;_WKRemoteObjectRegistry&gt; m_remoteObjectRegistry;
</span><ins>+
+    RetainPtr&lt;WKBrowsingContextController&gt; m_browsingContextController;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;ViewGestureController&gt; m_gestureController;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (191756 => 191757)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2015-10-29 21:54:24 UTC (rev 191756)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2015-10-29 22:07:42 UTC (rev 191757)
</span><span class="lines">@@ -41,8 +41,11 @@
</span><span class="cx"> #import &quot;RemoteObjectRegistry.h&quot;
</span><span class="cx"> #import &quot;RemoteObjectRegistryMessages.h&quot;
</span><span class="cx"> #import &quot;StringUtilities.h&quot;
</span><ins>+#import &quot;TextChecker.h&quot;
+#import &quot;TextCheckerState.h&quot;
</ins><span class="cx"> #import &quot;TiledCoreAnimationDrawingAreaProxy.h&quot;
</span><span class="cx"> #import &quot;ViewGestureController.h&quot;
</span><ins>+#import &quot;WKBrowsingContextControllerInternal.h&quot;
</ins><span class="cx"> #import &quot;WKFullScreenWindowController.h&quot;
</span><span class="cx"> #import &quot;WKImmediateActionController.h&quot;
</span><span class="cx"> #import &quot;WKTextInputWindowController.h&quot;
</span><span class="lines">@@ -57,11 +60,14 @@
</span><span class="cx"> #import &quot;_WKThumbnailViewInternal.h&quot;
</span><span class="cx"> #import &lt;HIToolbox/CarbonEventsCore.h&gt;
</span><span class="cx"> #import &lt;WebCore/AXObjectCache.h&gt;
</span><ins>+#import &lt;WebCore/ColorMac.h&gt;
</ins><span class="cx"> #import &lt;WebCore/CoreGraphicsSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/DataDetectorsSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/DictionaryLookup.h&gt;
</span><span class="cx"> #import &lt;WebCore/DragData.h&gt;
</span><ins>+#import &lt;WebCore/Editor.h&gt;
</ins><span class="cx"> #import &lt;WebCore/KeypressCommand.h&gt;
</span><ins>+#import &lt;WebCore/LocalizedStrings.h&gt;
</ins><span class="cx"> #import &lt;WebCore/LookupSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/NSImmediateActionGestureRecognizerSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/NSWindowSPI.h&gt;
</span><span class="lines">@@ -453,14 +459,6 @@
</span><span class="cx">     return m_view.window;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr&lt;WebKit::DrawingAreaProxy&gt; WebViewImpl::createDrawingAreaProxy()
-{
-    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@&quot;WebKit2UseRemoteLayerTreeDrawingArea&quot;] boolValue])
-        return std::make_unique&lt;RemoteLayerTreeDrawingAreaProxy&gt;(m_page);
-
-    return std::make_unique&lt;TiledCoreAnimationDrawingAreaProxy&gt;(m_page);
-}
-
</del><span class="cx"> void WebViewImpl::processDidExit()
</span><span class="cx"> {
</span><span class="cx">     notifyInputContextAboutDiscardedComposition();
</span><span class="lines">@@ -682,6 +680,20 @@
</span><span class="cx">     return m_page.fixedLayoutSize();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+std::unique_ptr&lt;WebKit::DrawingAreaProxy&gt; WebViewImpl::createDrawingAreaProxy()
+{
+    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@&quot;WebKit2UseRemoteLayerTreeDrawingArea&quot;] boolValue])
+        return std::make_unique&lt;RemoteLayerTreeDrawingAreaProxy&gt;(m_page);
+
+    return std::make_unique&lt;TiledCoreAnimationDrawingAreaProxy&gt;(m_page);
+}
+
+bool WebViewImpl::isUsingUISideCompositing() const
+{
+    auto* drawingArea = m_page.drawingArea();
+    return drawingArea &amp;&amp; drawingArea-&gt;type() == DrawingAreaTypeRemoteLayerTree;
+}
+
</ins><span class="cx"> void WebViewImpl::setDrawingAreaSize(CGSize size)
</span><span class="cx"> {
</span><span class="cx">     if (!m_page.drawingArea())
</span><span class="lines">@@ -691,6 +703,64 @@
</span><span class="cx">     m_resizeScrollOffset = CGSizeZero;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wmissing-noreturn&quot;
+// This method forces a drawing area geometry update, even if frame size updates are disabled.
+// The updated is performed asynchronously; we don't wait for the geometry update before returning.
+// The area drawn need not match the current frame size - if it differs it will be anchored to the
+// frame according to the current contentAnchor.
+void WebViewImpl::forceAsyncDrawingAreaSizeUpdate(CGSize size)
+{
+    // This SPI is only used on 10.9 and below, and is incompatible with the fence-based drawing area size synchronization in 10.10+.
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1090
+    if (m_clipsToVisibleRect)
+        updateViewExposedRect();
+    setDrawingAreaSize(size);
+
+    // If a geometry update is pending the new update won't be sent. Poll without waiting for any
+    // pending did-update message now, such that the new update can be sent. We do so after setting
+    // the drawing area size such that the latest update is sent.
+    if (DrawingAreaProxy* drawingArea = m_page.drawingArea())
+        drawingArea-&gt;waitForPossibleGeometryUpdate(std::chrono::milliseconds::zero());
+#else
+    ASSERT_NOT_REACHED();
+#endif
+}
+
+void WebViewImpl::waitForAsyncDrawingAreaSizeUpdate()
+{
+    // This SPI is only used on 10.9 and below, and is incompatible with the fence-based drawing area size synchronization in 10.10+.
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1090
+    if (DrawingAreaProxy* drawingArea = m_page.drawingArea()) {
+        // If a geometry update is still pending then the action of receiving the
+        // first geometry update may result in another update being scheduled -
+        // we should wait for this to complete too.
+        drawingArea-&gt;waitForPossibleGeometryUpdate(DrawingAreaProxy::didUpdateBackingStoreStateTimeout() / 2);
+        drawingArea-&gt;waitForPossibleGeometryUpdate(DrawingAreaProxy::didUpdateBackingStoreStateTimeout() / 2);
+    }
+#else
+    ASSERT_NOT_REACHED();
+#endif
+}
+#pragma clang diagnostic pop
+
+void WebViewImpl::updateLayer()
+{
+    if (drawsBackground() &amp;&amp; !drawsTransparentBackground())
+        m_view.layer.backgroundColor = CGColorGetConstantColor(kCGColorWhite);
+    else
+        m_view.layer.backgroundColor = CGColorGetConstantColor(kCGColorClear);
+
+    // If asynchronous geometry updates have been sent by forceAsyncDrawingAreaSizeUpdate,
+    // then subsequent calls to setFrameSize should not result in us waiting for the did
+    // udpate response if setFrameSize is called.
+    if (frameSizeUpdatesDisabled())
+        return;
+
+    if (DrawingAreaProxy* drawingArea = m_page.drawingArea())
+        drawingArea-&gt;waitForPossibleGeometryUpdate();
+}
+
</ins><span class="cx"> void WebViewImpl::setAutomaticallyAdjustsContentInsets(bool automaticallyAdjustsContentInsets)
</span><span class="cx"> {
</span><span class="cx">     m_automaticallyAdjustsContentInsets = automaticallyAdjustsContentInsets;
</span><span class="lines">@@ -763,6 +833,31 @@
</span><span class="cx">     updateViewExposedRect();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewImpl::setMinimumSizeForAutoLayout(CGSize minimumSizeForAutoLayout)
+{
+    bool expandsToFit = minimumSizeForAutoLayout.width &gt; 0;
+
+    m_page.setMinimumLayoutSize(WebCore::IntSize(minimumSizeForAutoLayout));
+    m_page.setMainFrameIsScrollable(!expandsToFit);
+
+    setClipsToVisibleRect(expandsToFit);
+}
+
+CGSize WebViewImpl::minimumSizeForAutoLayout() const
+{
+    return m_page.minimumLayoutSize();
+}
+
+void WebViewImpl::setShouldExpandToViewHeightForAutoLayout(bool shouldExpandToViewHeightForAutoLayout)
+{
+    m_page.setAutoSizingShouldExpandToViewHeight(shouldExpandToViewHeightForAutoLayout);
+}
+
+bool WebViewImpl::shouldExpandToViewHeightForAutoLayout() const
+{
+    return m_page.autoSizingShouldExpandToViewHeight();
+}
+
</ins><span class="cx"> void WebViewImpl::setIntrinsicContentSize(CGSize intrinsicContentSize)
</span><span class="cx"> {
</span><span class="cx">     // If the intrinsic content size is less than the minimum layout width, the content flowed to fit,
</span><span class="lines">@@ -1052,6 +1147,39 @@
</span><span class="cx">     return colorSpaceData;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewImpl::setUnderlayColor(NSColor *underlayColor)
+{
+    m_page.setUnderlayColor(WebCore::colorFromNSColor(underlayColor));
+}
+
+NSColor *WebViewImpl::underlayColor() const
+{
+    WebCore::Color webColor = m_page.underlayColor();
+    if (!webColor.isValid())
+        return nil;
+
+    return WebCore::nsColor(webColor);
+}
+
+NSColor *WebViewImpl::pageExtendedBackgroundColor() const
+{
+    WebCore::Color color = m_page.pageExtendedBackgroundColor();
+    if (!color.isValid())
+        return nil;
+
+    return WebCore::nsColor(color);
+}
+
+void WebViewImpl::setOverlayScrollbarStyle(WTF::Optional&lt;WebCore::ScrollbarOverlayStyle&gt; scrollbarStyle)
+{
+    m_page.setOverlayScrollbarStyle(scrollbarStyle);
+}
+
+WTF::Optional&lt;WebCore::ScrollbarOverlayStyle&gt; WebViewImpl::overlayScrollbarStyle() const
+{
+    return m_page.overlayScrollbarStyle();
+}
+
</ins><span class="cx"> void WebViewImpl::beginDeferringViewInWindowChanges()
</span><span class="cx"> {
</span><span class="cx">     if (m_shouldDeferViewInWindowChanges) {
</span><span class="lines">@@ -1357,11 +1485,71 @@
</span><span class="cx">     return m_page.isEditable();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebViewImpl::executeEditCommand(const String&amp; commandName, const String&amp; argument)
</del><ins>+typedef HashMap&lt;SEL, String&gt; SelectorNameMap;
+
+// Map selectors into Editor command names.
+// This is not needed for any selectors that have the same name as the Editor command.
+static const SelectorNameMap&amp; selectorExceptionMap()
</ins><span class="cx"> {
</span><del>-    m_page.executeEditCommand(commandName, argument);
</del><ins>+    static NeverDestroyed&lt;SelectorNameMap&gt; map;
+
+    struct SelectorAndCommandName {
+        SEL selector;
+        ASCIILiteral commandName;
+    };
+
+    static const SelectorAndCommandName names[] = {
+        { @selector(insertNewlineIgnoringFieldEditor:), ASCIILiteral(&quot;InsertNewline&quot;) },
+        { @selector(insertParagraphSeparator:), ASCIILiteral(&quot;InsertNewline&quot;) },
+        { @selector(insertTabIgnoringFieldEditor:), ASCIILiteral(&quot;InsertTab&quot;) },
+        { @selector(pageDown:), ASCIILiteral(&quot;MovePageDown&quot;) },
+        { @selector(pageDownAndModifySelection:), ASCIILiteral(&quot;MovePageDownAndModifySelection&quot;) },
+        { @selector(pageUp:), ASCIILiteral(&quot;MovePageUp&quot;) },
+        { @selector(pageUpAndModifySelection:), ASCIILiteral(&quot;MovePageUpAndModifySelection&quot;) },
+        { @selector(scrollPageDown:), ASCIILiteral(&quot;ScrollPageForward&quot;) },
+        { @selector(scrollPageUp:), ASCIILiteral(&quot;ScrollPageBackward&quot;) }
+    };
+
+    for (auto&amp; name : names)
+        map.get().add(name.selector, name.commandName);
+
+    return map;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static String commandNameForSelector(SEL selector)
+{
+    // Check the exception map first.
+    static const SelectorNameMap&amp; exceptionMap = selectorExceptionMap();
+    SelectorNameMap::const_iterator it = exceptionMap.find(selector);
+    if (it != exceptionMap.end())
+        return it-&gt;value;
+
+    // Remove the trailing colon.
+    // No need to capitalize the command name since Editor command names are
+    // not case sensitive.
+    const char* selectorName = sel_getName(selector);
+    size_t selectorNameLength = strlen(selectorName);
+    if (selectorNameLength &lt; 2 || selectorName[selectorNameLength - 1] != ':')
+        return String();
+    return String(selectorName, selectorNameLength - 1);
+}
+
+bool WebViewImpl::executeSavedCommandBySelector(SEL selector)
+{
+    LOG(TextInput, &quot;Executing previously saved command %s&quot;, sel_getName(selector));
+    // The sink does two things: 1) Tells us if the responder went unhandled, and
+    // 2) prevents any NSBeep; we don't ever want to beep here.
+    RetainPtr&lt;WKResponderChainSink&gt; sink = adoptNS([[WKResponderChainSink alloc] initWithResponderChain:m_view]);
+    [m_view _superDoCommandBySelector:selector];
+    [sink detach];
+    return ![sink didReceiveUnhandledCommand];
+}
+
+void WebViewImpl::executeEditCommandForSelector(SEL selector, const String&amp; argument)
+{
+    m_page.executeEditCommand(commandNameForSelector(selector), argument);
+}
+
</ins><span class="cx"> void WebViewImpl::registerEditCommand(RefPtr&lt;WebEditCommandProxy&gt; prpCommand, WebPageProxy::UndoOrRedo undoOrRedo)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;WebEditCommandProxy&gt; command = prpCommand;
</span><span class="lines">@@ -1424,6 +1612,141 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static NSMenuItem *menuItem(id &lt;NSValidatedUserInterfaceItem&gt; item)
+{
+    if (![(NSObject *)item isKindOfClass:[NSMenuItem class]])
+        return nil;
+    return (NSMenuItem *)item;
+}
+
+static NSToolbarItem *toolbarItem(id &lt;NSValidatedUserInterfaceItem&gt; item)
+{
+    if (![(NSObject *)item isKindOfClass:[NSToolbarItem class]])
+        return nil;
+    return (NSToolbarItem *)item;
+}
+
+bool WebViewImpl::validateUserInterfaceItem(id &lt;NSValidatedUserInterfaceItem&gt; item)
+{
+    SEL action = [item action];
+
+    if (action == @selector(showGuessPanel:)) {
+        if (NSMenuItem *menuItem = WebKit::menuItem(item))
+            [menuItem setTitle:WebCore::contextMenuItemTagShowSpellingPanel(![[[NSSpellChecker sharedSpellChecker] spellingPanel] isVisible])];
+        return m_page.editorState().isContentEditable;
+    }
+
+    if (action == @selector(checkSpelling:) || action == @selector(changeSpelling:))
+        return m_page.editorState().isContentEditable;
+
+    if (action == @selector(toggleContinuousSpellChecking:)) {
+        bool enabled = TextChecker::isContinuousSpellCheckingAllowed();
+        bool checked = enabled &amp;&amp; TextChecker::state().isContinuousSpellCheckingEnabled;
+        [menuItem(item) setState:checked ? NSOnState : NSOffState];
+        return enabled;
+    }
+
+    if (action == @selector(toggleGrammarChecking:)) {
+        bool checked = TextChecker::state().isGrammarCheckingEnabled;
+        [menuItem(item) setState:checked ? NSOnState : NSOffState];
+        return true;
+    }
+
+    if (action == @selector(toggleAutomaticSpellingCorrection:)) {
+        bool checked = TextChecker::state().isAutomaticSpellingCorrectionEnabled;
+        [menuItem(item) setState:checked ? NSOnState : NSOffState];
+        return m_page.editorState().isContentEditable;
+    }
+
+    if (action == @selector(orderFrontSubstitutionsPanel:)) {
+        if (NSMenuItem *menuItem = WebKit::menuItem(item))
+            [menuItem setTitle:WebCore::contextMenuItemTagShowSubstitutions(![[[NSSpellChecker sharedSpellChecker] substitutionsPanel] isVisible])];
+        return m_page.editorState().isContentEditable;
+    }
+
+    if (action == @selector(toggleSmartInsertDelete:)) {
+        bool checked = m_page.isSmartInsertDeleteEnabled();
+        [menuItem(item) setState:checked ? NSOnState : NSOffState];
+        return m_page.editorState().isContentEditable;
+    }
+
+    if (action == @selector(toggleAutomaticQuoteSubstitution:)) {
+        bool checked = TextChecker::state().isAutomaticQuoteSubstitutionEnabled;
+        [menuItem(item) setState:checked ? NSOnState : NSOffState];
+        return m_page.editorState().isContentEditable;
+    }
+
+    if (action == @selector(toggleAutomaticDashSubstitution:)) {
+        bool checked = TextChecker::state().isAutomaticDashSubstitutionEnabled;
+        [menuItem(item) setState:checked ? NSOnState : NSOffState];
+        return m_page.editorState().isContentEditable;
+    }
+
+    if (action == @selector(toggleAutomaticLinkDetection:)) {
+        bool checked = TextChecker::state().isAutomaticLinkDetectionEnabled;
+        [menuItem(item) setState:checked ? NSOnState : NSOffState];
+        return m_page.editorState().isContentEditable;
+    }
+
+    if (action == @selector(toggleAutomaticTextReplacement:)) {
+        bool checked = TextChecker::state().isAutomaticTextReplacementEnabled;
+        [menuItem(item) setState:checked ? NSOnState : NSOffState];
+        return m_page.editorState().isContentEditable;
+    }
+
+    if (action == @selector(uppercaseWord:) || action == @selector(lowercaseWord:) || action == @selector(capitalizeWord:))
+        return m_page.editorState().selectionIsRange &amp;&amp; m_page.editorState().isContentEditable;
+
+    if (action == @selector(stopSpeaking:))
+        return [NSApp isSpeaking];
+
+    // The centerSelectionInVisibleArea: selector is enabled if there's a selection range or if there's an insertion point in an editable area.
+    if (action == @selector(centerSelectionInVisibleArea:))
+        return m_page.editorState().selectionIsRange || (m_page.editorState().isContentEditable &amp;&amp; !m_page.editorState().selectionIsNone);
+
+    // Next, handle editor commands. Start by returning true for anything that is not an editor command.
+    // Returning true is the default thing to do in an AppKit validate method for any selector that is not recognized.
+    String commandName = commandNameForSelector([item action]);
+    if (!WebCore::Editor::commandIsSupportedFromMenuOrKeyBinding(commandName))
+        return true;
+
+    // Add this item to the vector of items for a given command that are awaiting validation.
+    ValidationMap::AddResult addResult = m_validationMap.add(commandName, ValidationVector());
+    addResult.iterator-&gt;value.append(item);
+    if (addResult.isNewEntry) {
+        // If we are not already awaiting validation for this command, start the asynchronous validation process.
+        // FIXME: Theoretically, there is a race here; when we get the answer it might be old, from a previous time
+        // we asked for the same command; there is no guarantee the answer is still valid.
+        auto weakThis = createWeakPtr();
+        m_page.validateCommand(commandName, [weakThis](const String&amp; commandName, bool isEnabled, int32_t state, WebKit::CallbackBase::Error error) {
+            if (!weakThis)
+                return;
+
+            // If the process exits before the command can be validated, we'll be called back with an error.
+            if (error != WebKit::CallbackBase::Error::None)
+                return;
+
+            weakThis-&gt;setUserInterfaceItemState(commandName, isEnabled, state);
+        });
+    }
+
+    // Treat as enabled until we get the result back from the web process and _setUserInterfaceItemState is called.
+    // FIXME &lt;rdar://problem/8803459&gt;: This means disabled items will flash enabled at first for a moment.
+    // But returning NO here would be worse; that would make keyboard commands such as command-C fail.
+    return true;
+}
+
+void WebViewImpl::setUserInterfaceItemState(NSString *commandName, bool enabled, int state)
+{
+    ValidationVector items = m_validationMap.take(commandName);
+    for (auto&amp; item : items) {
+        [menuItem(item.get()) setState:state];
+        [menuItem(item.get()) setEnabled:enabled];
+        [toolbarItem(item.get()) setEnabled:enabled];
+        // FIXME &lt;rdar://problem/8803392&gt;: If the item is neither a menu nor toolbar item, it will be left enabled.
+    }
+}
+
</ins><span class="cx"> void WebViewImpl::preferencesDidChange()
</span><span class="cx"> {
</span><span class="cx">     BOOL needsViewFrameInWindowCoordinates = m_page.preferences().pluginsEnabled();
</span><span class="lines">@@ -1908,6 +2231,14 @@
</span><span class="cx">     [m_remoteObjectRegistry _invalidate];
</span><span class="cx">     m_remoteObjectRegistry = nil;
</span><span class="cx"> }
</span><ins>+
+WKBrowsingContextController *WebViewImpl::browsingContextController()
+{
+    if (!m_browsingContextController)
+        m_browsingContextController = adoptNS([[WKBrowsingContextController alloc] _initWithPageRef:toAPI(&amp;m_page)]);
+
+    return m_browsingContextController.get();
+}
</ins><span class="cx"> #endif // WK_API_ENABLED
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="lines">@@ -2294,6 +2625,16 @@
</span><span class="cx">     return ViewSnapshot::create(WTF::move(surface));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewImpl::saveBackForwardSnapshotForCurrentItem()
+{
+    m_page.recordNavigationSnapshot();
+}
+
+void WebViewImpl::saveBackForwardSnapshotForItem(WebBackForwardListItem&amp; item)
+{
+    m_page.recordNavigationSnapshot(item);
+}
+
</ins><span class="cx"> ViewGestureController&amp; WebViewImpl::ensureGestureController()
</span><span class="cx"> {
</span><span class="cx">     if (!m_gestureController)
</span><span class="lines">@@ -2488,17 +2829,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WebViewImpl::executeSavedCommandBySelector(SEL selector)
-{
-    LOG(TextInput, &quot;Executing previously saved command %s&quot;, sel_getName(selector));
-    // The sink does two things: 1) Tells us if the responder went unhandled, and
-    // 2) prevents any NSBeep; we don't ever want to beep here.
-    RetainPtr&lt;WKResponderChainSink&gt; sink = adoptNS([[WKResponderChainSink alloc] initWithResponderChain:m_view]);
-    [m_view _superDoCommandBySelector:selector];
-    [sink detach];
-    return ![sink didReceiveUnhandledCommand];
-}
-
</del><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(MAC)
</span></span></pre>
</div>
</div>

</body>
</html>