<!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>[194075] branches/safari-601-branch/Source</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/194075">194075</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2015-12-14 16:35:16 -0800 (Mon, 14 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/188386">r188386</a>. rdar://problem/23816165</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchSourceWTFChangeLog">branches/safari-601-branch/Source/WTF/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWTFwtfOptionalh">branches/safari-601-branch/Source/WTF/wtf/Optional.h</a></li>
<li><a href="#branchessafari601branchSourceWebCoreChangeLog">branches/safari-601-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebCoreloaderFrameLoadercpp">branches/safari-601-branch/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCorepageWindowFeaturescpp">branches/safari-601-branch/Source/WebCore/page/WindowFeatures.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCorepageWindowFeaturesh">branches/safari-601-branch/Source/WebCore/page/WindowFeatures.h</a></li>
<li><a href="#branchessafari601branchSourceWebKitmacChangeLog">branches/safari-601-branch/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebKitmacWebCoreSupportWebChromeClientmm">branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm</a></li>
<li><a href="#branchessafari601branchSourceWebKitwinChangeLog">branches/safari-601-branch/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebKitwinWebCoreSupportWebChromeClientcpp">branches/safari-601-branch/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebKit2ChangeLog">branches/safari-601-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebKit2SharedWebCoreArgumentCoderscpp">branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebKit2UIProcessAPICWKPagecpp">branches/safari-601-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebKit2UIProcessAPICocoaWKWindowFeaturesmm">branches/safari-601-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWindowFeatures.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WTF/ChangeLog (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WTF/ChangeLog        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WTF/ChangeLog        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-12-08  Harris Papadopoulos  &lt;cpapadopoulos@apple.com&gt;
+
+        Merge r188386. rdar://problem/23816165
+
+    2015-08-12  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+            Use WTF::Optional in WindowFeatures
+            https://bugs.webkit.org/show_bug.cgi?id=147956
+
+            Reviewed by Sam Weinig.
+
+            Add new operators to WTF::Optional to make it more like std::optional.
+
+            * wtf/Optional.h:
+            (WTF::Optional::operator-&gt;):
+            (WTF::Optional::operator*):
+
</ins><span class="cx"> 2015-10-08  Lucas Forschler  &lt;lforschler@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r189633. rdar://problem/22824646
</span></span></pre></div>
<a id="branchessafari601branchSourceWTFwtfOptionalh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WTF/wtf/Optional.h (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WTF/wtf/Optional.h        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WTF/wtf/Optional.h        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -133,6 +133,21 @@
</span><span class="cx"> 
</span><span class="cx">     explicit operator bool() const { return m_isEngaged; }
</span><span class="cx"> 
</span><ins>+    const T* operator-&gt;() const
+    {
+        ASSERT(m_isEngaged);
+        return asPtr()-&gt;operator-&gt;();
+    }
+
+    T* operator-&gt;()
+    {
+        ASSERT(m_isEngaged);
+        return asPtr()-&gt;operator-&gt;();
+    }
+
+    const T&amp; operator*() const { return value(); }
+    T&amp; operator*() { return value(); }
+
</ins><span class="cx">     T&amp; value()
</span><span class="cx">     {
</span><span class="cx">         ASSERT(m_isEngaged);
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/ChangeLog        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2015-12-08  Harris Papadopoulos  &lt;cpapadopoulos@apple.com&gt;
+
+        Merge r188386. rdar://problem/23816165
+
+    2015-08-12  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+            Use WTF::Optional in WindowFeatures
+            https://bugs.webkit.org/show_bug.cgi?id=147956
+
+            Reviewed by Sam Weinig.
+
+            * loader/FrameLoader.cpp:
+            (WebCore::createWindow):
+            * page/WindowFeatures.cpp:
+            (WebCore::WindowFeatures::WindowFeatures):
+            (WebCore::WindowFeatures::setWindowFeature):
+            (WebCore::WindowFeatures::boolFeature):
+            (WebCore::WindowFeatures::floatFeature):
+            (WebCore::WindowFeatures::parseDialogFeatures):
+            * page/WindowFeatures.h:
+            (WebCore::WindowFeatures::WindowFeatures):
+
</ins><span class="cx"> 2015-12-14  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r194001. rdar://problem/23581577
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/loader/FrameLoader.cpp (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/loader/FrameLoader.cpp        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebCore/loader/FrameLoader.cpp        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -3546,15 +3546,15 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     FloatSize viewportSize = page-&gt;chrome().pageRect().size();
</span><span class="cx">     FloatRect windowRect = page-&gt;chrome().windowRect();
</span><del>-    if (features.xSet)
-        windowRect.setX(features.x);
-    if (features.ySet)
-        windowRect.setY(features.y);
</del><ins>+    if (features.x)
+        windowRect.setX(*features.x);
+    if (features.y)
+        windowRect.setY(*features.y);
</ins><span class="cx">     // Zero width and height mean using default size, not minumum one.
</span><del>-    if (features.widthSet &amp;&amp; features.width)
-        windowRect.setWidth(features.width + (windowRect.width() - viewportSize.width()));
-    if (features.heightSet &amp;&amp; features.height)
-        windowRect.setHeight(features.height + (windowRect.height() - viewportSize.height()));
</del><ins>+    if (features.width &amp;&amp; *features.width)
+        windowRect.setWidth(*features.width + (windowRect.width() - viewportSize.width()));
+    if (features.height &amp;&amp; *features.height)
+        windowRect.setHeight(*features.height + (windowRect.height() - viewportSize.height()));
</ins><span class="cx"> 
</span><span class="cx">     // Ensure non-NaN values, minimum size as well as being within valid screen area.
</span><span class="cx">     FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect);
</span><span class="lines">@@ -3566,10 +3566,10 @@
</span><span class="cx">     // On iOS, width and height refer to the viewport dimensions.
</span><span class="cx">     ViewportArguments arguments;
</span><span class="cx">     // Zero width and height mean using default size, not minimum one.
</span><del>-    if (features.widthSet &amp;&amp; features.width)
-        arguments.width = features.width;
-    if (features.heightSet &amp;&amp; features.height)
-        arguments.height = features.height;
</del><ins>+    if (features.width &amp;&amp; *features.width)
+        arguments.width = *features.width;
+    if (features.height &amp;&amp; *features.height)
+        arguments.height = *features.height;
</ins><span class="cx">     frame-&gt;setViewportArguments(arguments);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCorepageWindowFeaturescpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/page/WindowFeatures.cpp (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/page/WindowFeatures.cpp        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebCore/page/WindowFeatures.cpp        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -37,15 +37,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WindowFeatures::WindowFeatures(const String&amp; features)
</span><del>-    : x(0)
-    , xSet(false)
-    , y(0)
-    , ySet(false)
-    , width(0)
-    , widthSet(false)
-    , height(0)
-    , heightSet(false)
-    , resizable(true)
</del><ins>+    : resizable(true)
</ins><span class="cx">     , fullscreen(false)
</span><span class="cx">     , dialog(false)
</span><span class="cx"> {
</span><span class="lines">@@ -134,19 +126,15 @@
</span><span class="cx">     // We treat keyString of &quot;resizable&quot; here as an additional feature rather than setting resizeable to true.
</span><span class="cx">     // This is consistent with Firefox, but could also be handled at another level.
</span><span class="cx"> 
</span><del>-    if (keyString == &quot;left&quot; || keyString == &quot;screenx&quot;) {
-        xSet = true;
</del><ins>+    if (keyString == &quot;left&quot; || keyString == &quot;screenx&quot;)
</ins><span class="cx">         x = value;
</span><del>-    } else if (keyString == &quot;top&quot; || keyString == &quot;screeny&quot;) {
-        ySet = true;
</del><ins>+    else if (keyString == &quot;top&quot; || keyString == &quot;screeny&quot;)
</ins><span class="cx">         y = value;
</span><del>-    } else if (keyString == &quot;width&quot; || keyString == &quot;innerwidth&quot;) {
-        widthSet = true;
</del><ins>+    else if (keyString == &quot;width&quot; || keyString == &quot;innerwidth&quot;)
</ins><span class="cx">         width = value;
</span><del>-    } else if (keyString == &quot;height&quot; || keyString == &quot;innerheight&quot;) {
-        heightSet = true;
</del><ins>+    else if (keyString == &quot;height&quot; || keyString == &quot;innerheight&quot;)
</ins><span class="cx">         height = value;
</span><del>-    } else if (keyString == &quot;menubar&quot;)
</del><ins>+    else if (keyString == &quot;menubar&quot;)
</ins><span class="cx">         menuBarVisible = value;
</span><span class="cx">     else if (keyString == &quot;toolbar&quot;)
</span><span class="cx">         toolBarVisible = value;
</span><span class="lines">@@ -163,16 +151,13 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WindowFeatures::WindowFeatures(const String&amp; dialogFeaturesString, const FloatRect&amp; screenAvailableRect)
</span><del>-    : widthSet(true)
-    , heightSet(true)
-    , menuBarVisible(false)
</del><ins>+    : menuBarVisible(false)
</ins><span class="cx">     , toolBarVisible(false)
</span><span class="cx">     , locationBarVisible(false)
</span><span class="cx">     , fullscreen(false)
</span><span class="cx">     , dialog(true)
</span><span class="cx"> {
</span><del>-    DialogFeaturesMap features;
-    parseDialogFeatures(dialogFeaturesString, features);
</del><ins>+    auto features = parseDialogFeatures(dialogFeaturesString);
</ins><span class="cx"> 
</span><span class="cx">     const bool trusted = false;
</span><span class="cx"> 
</span><span class="lines">@@ -187,20 +172,20 @@
</span><span class="cx">     width = floatFeature(features, &quot;dialogwidth&quot;, 100, screenAvailableRect.width(), 620); // default here came from frame size of dialog in MacIE
</span><span class="cx">     height = floatFeature(features, &quot;dialogheight&quot;, 100, screenAvailableRect.height(), 450); // default here came from frame size of dialog in MacIE
</span><span class="cx"> 
</span><del>-    x = floatFeature(features, &quot;dialogleft&quot;, screenAvailableRect.x(), screenAvailableRect.maxX() - width, -1);
-    xSet = x &gt; 0;
-    y = floatFeature(features, &quot;dialogtop&quot;, screenAvailableRect.y(), screenAvailableRect.maxY() - height, -1);
-    ySet = y &gt; 0;
</del><ins>+    auto dialogLeft = floatFeature(features, &quot;dialogleft&quot;, screenAvailableRect.x(), screenAvailableRect.maxX() - *width, -1);
+    if (dialogLeft &gt; 0)
+        x = dialogLeft;
</ins><span class="cx"> 
</span><ins>+    auto dialogTop = floatFeature(features, &quot;dialogtop&quot;, screenAvailableRect.y(), screenAvailableRect.maxY() - *height, -1);
+    if (dialogTop &gt; 0)
+        y = dialogTop;
+
</ins><span class="cx">     if (boolFeature(features, &quot;center&quot;, true)) {
</span><del>-        if (!xSet) {
-            x = screenAvailableRect.x() + (screenAvailableRect.width() - width) / 2;
-            xSet = true;
-        }
-        if (!ySet) {
-            y = screenAvailableRect.y() + (screenAvailableRect.height() - height) / 2;
-            ySet = true;
-        }
</del><ins>+        if (!x)
+            x = screenAvailableRect.x() + (screenAvailableRect.width() - *width) / 2;
+
+        if (!y)
+            y = screenAvailableRect.y() + (screenAvailableRect.height() - *height) / 2;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     resizable = boolFeature(features, &quot;resizable&quot;);
</span><span class="lines">@@ -208,20 +193,22 @@
</span><span class="cx">     statusBarVisible = boolFeature(features, &quot;status&quot;, !trusted);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WindowFeatures::boolFeature(const DialogFeaturesMap&amp; features, const char* key, bool defaultValue)
</del><ins>+bool WindowFeatures::boolFeature(const HashMap&lt;String, String&gt;&amp; features, const char* key, bool defaultValue)
</ins><span class="cx"> {
</span><del>-    DialogFeaturesMap::const_iterator it = features.find(key);
</del><ins>+    auto it = features.find(key);
</ins><span class="cx">     if (it == features.end())
</span><span class="cx">         return defaultValue;
</span><ins>+
</ins><span class="cx">     const String&amp; value = it-&gt;value;
</span><span class="cx">     return value.isNull() || value == &quot;1&quot; || value == &quot;yes&quot; || value == &quot;on&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-float WindowFeatures::floatFeature(const DialogFeaturesMap&amp; features, const char* key, float min, float max, float defaultValue)
</del><ins>+float WindowFeatures::floatFeature(const HashMap&lt;String, String&gt;&amp; features, const char* key, float min, float max, float defaultValue)
</ins><span class="cx"> {
</span><del>-    DialogFeaturesMap::const_iterator it = features.find(key);
</del><ins>+    auto it = features.find(key);
</ins><span class="cx">     if (it == features.end())
</span><span class="cx">         return defaultValue;
</span><ins>+
</ins><span class="cx">     // FIXME: The toDouble function does not offer a way to tell &quot;0q&quot; from string with no digits in it: Both
</span><span class="cx">     // return the number 0 and false for ok. But &quot;0q&quot; should yield the minimum rather than the default.
</span><span class="cx">     bool ok;
</span><span class="lines">@@ -232,14 +219,18 @@
</span><span class="cx">         return min;
</span><span class="cx">     if (parsedNumber &gt; max)
</span><span class="cx">         return max;
</span><ins>+
</ins><span class="cx">     // FIXME: Seems strange to cast a double to int and then convert back to a float. Why is this a good idea?
</span><span class="cx">     return static_cast&lt;int&gt;(parsedNumber);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WindowFeatures::parseDialogFeatures(const String&amp; string, DialogFeaturesMap&amp; map)
</del><ins>+HashMap&lt;String, String&gt; WindowFeatures::parseDialogFeatures(const String&amp; string)
</ins><span class="cx"> {
</span><ins>+    HashMap&lt;String, String&gt; features;
+
</ins><span class="cx">     Vector&lt;String&gt; vector;
</span><span class="cx">     string.split(';', vector);
</span><ins>+
</ins><span class="cx">     for (auto&amp; featureString : vector) {
</span><span class="cx">         size_t separatorPosition = featureString.find('=');
</span><span class="cx">         size_t colonPosition = featureString.find(':');
</span><span class="lines">@@ -257,8 +248,10 @@
</span><span class="cx">             value = value.left(value.find(' '));
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        map.set(key, value);
</del><ins>+        features.set(key, value);
</ins><span class="cx">     }
</span><ins>+
+    return features;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCorepageWindowFeaturesh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/page/WindowFeatures.h (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/page/WindowFeatures.h        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebCore/page/WindowFeatures.h        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -29,8 +29,11 @@
</span><span class="cx"> #ifndef WindowFeatures_h
</span><span class="cx"> #define WindowFeatures_h
</span><span class="cx"> 
</span><ins>+#include &lt;wtf/Forward.h&gt;
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><del>-#include &lt;wtf/text/WTFString.h&gt;
</del><ins>+#include &lt;wtf/Optional.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/StringHash.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -38,15 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> struct WindowFeatures {
</span><span class="cx">     WindowFeatures()
</span><del>-        : x(0)
-        , xSet(false)
-        , y(0)
-        , ySet(false)
-        , width(0)
-        , widthSet(false)
-        , height(0)
-        , heightSet(false)
-        , menuBarVisible(true)
</del><ins>+        : menuBarVisible(true)
</ins><span class="cx">         , statusBarVisible(true)
</span><span class="cx">         , toolBarVisible(true)
</span><span class="cx">         , locationBarVisible(true)
</span><span class="lines">@@ -59,14 +54,10 @@
</span><span class="cx">     explicit WindowFeatures(const String&amp; windowFeaturesString);
</span><span class="cx">     WindowFeatures(const String&amp; dialogFeaturesString, const FloatRect&amp; screenAvailableRect);
</span><span class="cx"> 
</span><del>-    float x;
-    bool xSet;
-    float y;
-    bool ySet;
-    float width;
-    bool widthSet;
-    float height;
-    bool heightSet;
</del><ins>+    Optional&lt;float&gt; x;
+    Optional&lt;float&gt; y;
+    Optional&lt;float&gt; width;
+    Optional&lt;float&gt; height;
</ins><span class="cx"> 
</span><span class="cx">     bool menuBarVisible;
</span><span class="cx">     bool statusBarVisible;
</span><span class="lines">@@ -81,10 +72,9 @@
</span><span class="cx">     Vector&lt;String&gt; additionalFeatures;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    typedef HashMap&lt;String, String&gt; DialogFeaturesMap;
-    static void parseDialogFeatures(const String&amp;, HashMap&lt;String, String&gt;&amp;);
-    static bool boolFeature(const DialogFeaturesMap&amp;, const char* key, bool defaultValue = false);
-    static float floatFeature(const DialogFeaturesMap&amp;, const char* key, float min, float max, float defaultValue);
</del><ins>+    static HashMap&lt;String, String&gt; parseDialogFeatures(const String&amp;);
+    static bool boolFeature(const HashMap&lt;String, String&gt;&amp;, const char* key, bool defaultValue = false);
+    static float floatFeature(const HashMap&lt;String, String&gt;&amp;, const char* key, float min, float max, float defaultValue);
</ins><span class="cx">     void setWindowFeature(const String&amp; keyString, const String&amp; valueString);
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit/mac/ChangeLog (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit/mac/ChangeLog        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebKit/mac/ChangeLog        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-12-08  Harris Papadopoulos  &lt;cpapadopoulos@apple.com&gt;
+
+        Merge r188386. rdar://problem/23816165
+
+    2015-08-12  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+            Use WTF::Optional in WindowFeatures
+            https://bugs.webkit.org/show_bug.cgi?id=147956
+
+            Reviewed by Sam Weinig.
+
+            * WebCoreSupport/WebChromeClient.mm:
+            (WebChromeClient::createWindow):
+
</ins><span class="cx"> 2015-12-11  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r191084. rdar://problem/23715623
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKitmacWebCoreSupportWebChromeClientmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -240,10 +240,10 @@
</span><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx">     if ([delegate respondsToSelector:@selector(webView:createWebViewWithRequest:windowFeatures:)]) {
</span><del>-        NSNumber *x = features.xSet ? [[NSNumber alloc] initWithFloat:features.x] : nil;
-        NSNumber *y = features.ySet ? [[NSNumber alloc] initWithFloat:features.y] : nil;
-        NSNumber *width = features.widthSet ? [[NSNumber alloc] initWithFloat:features.width] : nil;
-        NSNumber *height = features.heightSet ? [[NSNumber alloc] initWithFloat:features.height] : nil;
</del><ins>+        NSNumber *x = features.x ? [[NSNumber alloc] initWithFloat:*features.x] : nil;
+        NSNumber *y = features.y ? [[NSNumber alloc] initWithFloat:*features.y] : nil;
+        NSNumber *width = features.width ? [[NSNumber alloc] initWithFloat:*features.width] : nil;
+        NSNumber *height = features.height ? [[NSNumber alloc] initWithFloat:*features.height] : nil;
</ins><span class="cx">         NSNumber *menuBarVisible = [[NSNumber alloc] initWithBool:features.menuBarVisible];
</span><span class="cx">         NSNumber *statusBarVisible = [[NSNumber alloc] initWithBool:features.statusBarVisible];
</span><span class="cx">         NSNumber *toolBarVisible = [[NSNumber alloc] initWithBool:features.toolBarVisible];
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit/win/ChangeLog (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit/win/ChangeLog        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebKit/win/ChangeLog        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-12-08  Harris Papadopoulos  &lt;cpapadopoulos@apple.com&gt;
+
+        Merge r188386. rdar://problem/23816165
+
+    2015-08-12  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+            Use WTF::Optional in WindowFeatures
+            https://bugs.webkit.org/show_bug.cgi?id=147956
+
+            Reviewed by Sam Weinig.
+
+            * WebCoreSupport/WebChromeClient.cpp:
+            (createWindowFeaturesPropertyBag):
+
</ins><span class="cx"> 2015-09-25  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r190235. rdar://problem/22852382
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKitwinWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -170,14 +170,14 @@
</span><span class="cx"> static COMPtr&lt;IPropertyBag&gt; createWindowFeaturesPropertyBag(const WindowFeatures&amp; features)
</span><span class="cx"> {
</span><span class="cx">     HashMap&lt;String, COMVariant&gt; map;
</span><del>-    if (features.xSet)
-        map.set(WebWindowFeaturesXKey, features.x);
-    if (features.ySet)
-        map.set(WebWindowFeaturesYKey, features.y);
-    if (features.widthSet)
-        map.set(WebWindowFeaturesWidthKey, features.width);
-    if (features.heightSet)
-        map.set(WebWindowFeaturesHeightKey, features.height);
</del><ins>+    if (features.x)
+        map.set(WebWindowFeaturesXKey, *features.x);
+    if (features.y)
+        map.set(WebWindowFeaturesYKey, *features.y);
+    if (features.width)
+        map.set(WebWindowFeaturesWidthKey, *features.width);
+    if (features.height)
+        map.set(WebWindowFeaturesHeightKey, *features.height);
</ins><span class="cx">     map.set(WebWindowFeaturesMenuBarVisibleKey, features.menuBarVisible);
</span><span class="cx">     map.set(WebWindowFeaturesStatusBarVisibleKey, features.statusBarVisible);
</span><span class="cx">     map.set(WebWindowFeaturesToolBarVisibleKey, features.toolBarVisible);
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit2/ChangeLog (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit2/ChangeLog        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebKit2/ChangeLog        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -1,5 +1,24 @@
</span><span class="cx"> 2015-12-08  Harris Papadopoulos  &lt;cpapadopoulos@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r188386. rdar://problem/23816165
+
+    2015-08-12  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+            Use WTF::Optional in WindowFeatures
+            https://bugs.webkit.org/show_bug.cgi?id=147956
+
+            Reviewed by Sam Weinig.
+
+            * Shared/WebCoreArgumentCoders.cpp:
+            (IPC::ArgumentCoder&lt;WindowFeatures&gt;::encode): Deleted.
+            (IPC::ArgumentCoder&lt;WindowFeatures&gt;::decode): Deleted.
+            * UIProcess/API/C/WKPage.cpp:
+            (WKPageSetPageUIClient):
+            * UIProcess/API/Cocoa/WKWindowFeatures.mm:
+            (-[WKWindowFeatures _initWithWindowFeatures:]):
+
+2015-12-08  Harris Papadopoulos  &lt;cpapadopoulos@apple.com&gt;
+
</ins><span class="cx">         Merge r188228. rdar://problem/23816165
</span><span class="cx"> 
</span><span class="cx">     2015-08-08  Sam Weinig  &lt;sam@webkit.org&gt;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -977,10 +977,6 @@
</span><span class="cx">     encoder &lt;&lt; windowFeatures.y;
</span><span class="cx">     encoder &lt;&lt; windowFeatures.width;
</span><span class="cx">     encoder &lt;&lt; windowFeatures.height;
</span><del>-    encoder &lt;&lt; windowFeatures.xSet;
-    encoder &lt;&lt; windowFeatures.ySet;
-    encoder &lt;&lt; windowFeatures.widthSet;
-    encoder &lt;&lt; windowFeatures.heightSet;
</del><span class="cx">     encoder &lt;&lt; windowFeatures.menuBarVisible;
</span><span class="cx">     encoder &lt;&lt; windowFeatures.statusBarVisible;
</span><span class="cx">     encoder &lt;&lt; windowFeatures.toolBarVisible;
</span><span class="lines">@@ -1001,14 +997,6 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(windowFeatures.height))
</span><span class="cx">         return false;
</span><del>-    if (!decoder.decode(windowFeatures.xSet))
-        return false;
-    if (!decoder.decode(windowFeatures.ySet))
-        return false;
-    if (!decoder.decode(windowFeatures.widthSet))
-        return false;
-    if (!decoder.decode(windowFeatures.heightSet))
-        return false;
</del><span class="cx">     if (!decoder.decode(windowFeatures.menuBarVisible))
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(windowFeatures.statusBarVisible))
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit2UIProcessAPICWKPagecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -1350,14 +1350,14 @@
</span><span class="cx">                 return 0;
</span><span class="cx"> 
</span><span class="cx">             API::Dictionary::MapType map;
</span><del>-            if (windowFeatures.xSet)
-                map.set(&quot;x&quot;, API::Double::create(windowFeatures.x));
-            if (windowFeatures.ySet)
-                map.set(&quot;y&quot;, API::Double::create(windowFeatures.y));
-            if (windowFeatures.widthSet)
-                map.set(&quot;width&quot;, API::Double::create(windowFeatures.width));
-            if (windowFeatures.heightSet)
-                map.set(&quot;height&quot;, API::Double::create(windowFeatures.height));
</del><ins>+            if (windowFeatures.x)
+                map.set(&quot;x&quot;, API::Double::create(*windowFeatures.x));
+            if (windowFeatures.y)
+                map.set(&quot;y&quot;, API::Double::create(*windowFeatures.y));
+            if (windowFeatures.width)
+                map.set(&quot;width&quot;, API::Double::create(*windowFeatures.width));
+            if (windowFeatures.height)
+                map.set(&quot;height&quot;, API::Double::create(*windowFeatures.height));
</ins><span class="cx">             map.set(&quot;menuBarVisible&quot;, API::Boolean::create(windowFeatures.menuBarVisible));
</span><span class="cx">             map.set(&quot;statusBarVisible&quot;, API::Boolean::create(windowFeatures.statusBarVisible));
</span><span class="cx">             map.set(&quot;toolBarVisible&quot;, API::Boolean::create(windowFeatures.toolBarVisible));
</span></span></pre></div>
<a id="branchessafari601branchSourceWebKit2UIProcessAPICocoaWKWindowFeaturesmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWindowFeatures.mm (194074 => 194075)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWindowFeatures.mm        2015-12-15 00:35:10 UTC (rev 194074)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWindowFeatures.mm        2015-12-15 00:35:16 UTC (rev 194075)
</span><span class="lines">@@ -55,14 +55,14 @@
</span><span class="cx">     _toolbarsVisibility = @(windowFeatures.toolBarVisible || windowFeatures.locationBarVisible);
</span><span class="cx">     _allowsResizing = @(windowFeatures.resizable);
</span><span class="cx"> 
</span><del>-    if (windowFeatures.xSet)
-        _x = @(windowFeatures.x);
-    if (windowFeatures.ySet)
-        _y = @(windowFeatures.y);
-    if (windowFeatures.widthSet)
-        _width = @(windowFeatures.width);
-    if (windowFeatures.heightSet)
-        _height = @(windowFeatures.height);
</del><ins>+    if (windowFeatures.x)
+        _x = @(*windowFeatures.x);
+    if (windowFeatures.y)
+        _y = @(*windowFeatures.y);
+    if (windowFeatures.width)
+        _width = @(*windowFeatures.width);
+    if (windowFeatures.height)
+        _height = @(*windowFeatures.height);
</ins><span class="cx"> 
</span><span class="cx">     return self;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>