<!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>[205603] releases/WebKitGTK/webkit-2.14</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/205603">205603</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-08 01:00:34 -0700 (Thu, 08 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/205246">r205246</a> - REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/201701">r201701</a>): Unable to copy from CodeMirror editor version used in Jenkins install website
https://bugs.webkit.org/show_bug.cgi?id=161386
&lt;rdar://problem/27590077&gt;

Reviewed by Dan Bernstein.

Source/WebCore:

This CodeMirror version uses a hidden &lt;textarea&gt; to implement copy/paste. The textarea has width:1px; border-width:1px.
Jenkins page has also has a stylesheet that contains * { box-sizing:border-box } and as a result the textarea content
width gets computed as 0. With <a href="http://trac.webkit.org/projects/webkit/changeset/201701">r201701</a> we use content size instead of box size for clipping and the textarea content is
(correctly) considered invisible.

Add a quirk that allows this to continue working.

Test: editing/text-iterator/hidden-textarea-selection-quirk.html

* editing/TextIterator.cpp:
(WebCore::fullyClipsContents):

LayoutTests:

* editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Added.
* editing/text-iterator/hidden-textarea-selection-quirk.html: Added.
* platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Added.

    textarea.select() doesn't select the text content on iOS.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreeditingTextIteratorcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/editing/TextIterator.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214LayoutTestseditingtextiteratorhiddentextareaselectionquirkexpectedtxt">releases/WebKitGTK/webkit-2.14/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit214LayoutTestseditingtextiteratorhiddentextareaselectionquirkhtml">releases/WebKitGTK/webkit-2.14/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk.html</a></li>
<li>releases/WebKitGTK/webkit-2.14/LayoutTests/platform/ios-simulator/editing/text-iterator/</li>
<li><a href="#releasesWebKitGTKwebkit214LayoutTestsplatformiossimulatoreditingtextiteratorhiddentextareaselectionquirkexpectedtxt">releases/WebKitGTK/webkit-2.14/LayoutTests/platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit214LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog (205602 => 205603)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog        2016-09-08 07:58:55 UTC (rev 205602)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog        2016-09-08 08:00:34 UTC (rev 205603)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-08-31  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        REGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins install website
+        https://bugs.webkit.org/show_bug.cgi?id=161386
+        &lt;rdar://problem/27590077&gt;
+
+        Reviewed by Dan Bernstein.
+
+        * editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Added.
+        * editing/text-iterator/hidden-textarea-selection-quirk.html: Added.
+        * platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Added.
+
+            textarea.select() doesn't select the text content on iOS.
+
</ins><span class="cx"> 2016-08-30  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Object.setPrototypeOf() should throw when used on a cross-origin Window / Location object
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214LayoutTestseditingtextiteratorhiddentextareaselectionquirkexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.14/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt (0 => 205603)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt        2016-09-08 08:00:34 UTC (rev 205603)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+
+
+PASS Selecting in barely visible textarea 
+PASS Selecting in barely visible div 
+PASS Selecting in textarea hidden by container 
+PASS Selecting in div hidden by container 
+PASS Selecting in absolute positioned textarea hidden by container 
+PASS Selecting in absolute positioned div hidden by container 
+PASS Selecting in absolute positioned zero content width textarea hidden by container (quirk behavior) 
+PASS Selecting in absolute positioned zero content width div hidden by container 
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214LayoutTestseditingtextiteratorhiddentextareaselectionquirkhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.14/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk.html (0 => 205603)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk.html        2016-09-08 08:00:34 UTC (rev 205603)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;Selections in hidden elements&lt;/title&gt;
+&lt;script src=&quot;../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;link rel='stylesheet' href='../../resources/testharness.css'&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;style&gt;
+container, my-text {
+    display: block;
+}
+
+.hide {
+    position:relative;
+    overflow:hidden;
+    height:0px;
+    width:10px;
+}
+.select {
+    height:11px;
+    width:1px;
+    padding:0px;
+    border:1px solid blue;
+    box-sizing:content-box;
+    overflow:hidden;
+}
+.abs {
+    position: absolute;
+}
+.borderBox {
+    box-sizing:border-box;
+}
+&lt;/style&gt;
+&lt;container&gt;
+&lt;textarea class=select&gt;test text&lt;/textarea&gt;
+&lt;my-text class=select&gt;test text&lt;/my-text&gt;
+&lt;/container&gt;
+&lt;script&gt;
+function checkSelectable(element, expected)
+{
+    var selection = document.getSelection();
+    if (element.select)
+        element.select();
+    else
+        selection.selectAllChildren(element);
+
+    var selectionText = selection.toString();
+    if (expected)
+        assert_equals(selectionText, &quot;test text&quot;);
+    else
+        assert_equals(selectionText, &quot;&quot;);
+}
+
+var textarea = document.querySelector(&quot;textarea&quot;);
+var myText = document.querySelector(&quot;my-text&quot;);
+
+test(function () {
+    checkSelectable(textarea, true);
+}, &quot;Selecting in barely visible textarea&quot;);
+
+test(function () {
+    checkSelectable(myText, true);
+}, &quot;Selecting in barely visible div&quot;);
+
+document.querySelector(&quot;container&quot;).classList.add(&quot;hide&quot;);
+
+test(function () {
+    checkSelectable(textarea, false);
+}, &quot;Selecting in textarea hidden by container&quot;);
+
+test(function () {
+    checkSelectable(myText, false);
+}, &quot;Selecting in div hidden by container&quot;);
+
+textarea.classList.add(&quot;abs&quot;);
+myText.classList.add(&quot;abs&quot;);
+
+test(function () {
+    checkSelectable(textarea, true);
+}, &quot;Selecting in absolute positioned textarea hidden by container&quot;);
+
+test(function () {
+    checkSelectable(myText, true);
+}, &quot;Selecting in absolute positioned div hidden by container&quot;);
+
+textarea.classList.add(&quot;borderBox&quot;);
+myText.classList.add(&quot;borderBox&quot;);
+
+test(function () {
+    checkSelectable(textarea, true);
+}, &quot;Selecting in absolute positioned zero content width textarea hidden by container (quirk behavior)&quot;);
+
+test(function () {
+    checkSelectable(myText, false);
+}, &quot;Selecting in absolute positioned zero content width div hidden by container&quot;);
+
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214LayoutTestsplatformiossimulatoreditingtextiteratorhiddentextareaselectionquirkexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.14/LayoutTests/platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt (0 => 205603)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/LayoutTests/platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt        2016-09-08 08:00:34 UTC (rev 205603)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+
+
+FAIL Selecting in barely visible textarea assert_equals: expected &quot;test text&quot; but got &quot;&quot;
+PASS Selecting in barely visible div 
+PASS Selecting in textarea hidden by container 
+PASS Selecting in div hidden by container 
+FAIL Selecting in absolute positioned textarea hidden by container assert_equals: expected &quot;test text&quot; but got &quot;&quot;
+PASS Selecting in absolute positioned div hidden by container 
+FAIL Selecting in absolute positioned zero content width textarea hidden by container (quirk behavior) assert_equals: expected &quot;test text&quot; but got &quot;&quot;
+PASS Selecting in absolute positioned zero content width div hidden by container 
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (205602 => 205603)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-09-08 07:58:55 UTC (rev 205602)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-09-08 08:00:34 UTC (rev 205603)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-08-31  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        REGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins install website
+        https://bugs.webkit.org/show_bug.cgi?id=161386
+        &lt;rdar://problem/27590077&gt;
+
+        Reviewed by Dan Bernstein.
+
+        This CodeMirror version uses a hidden &lt;textarea&gt; to implement copy/paste. The textarea has width:1px; border-width:1px.
+        Jenkins page has also has a stylesheet that contains * { box-sizing:border-box } and as a result the textarea content
+        width gets computed as 0. With r201701 we use content size instead of box size for clipping and the textarea content is
+        (correctly) considered invisible.
+
+        Add a quirk that allows this to continue working.
+
+        Test: editing/text-iterator/hidden-textarea-selection-quirk.html
+
+        * editing/TextIterator.cpp:
+        (WebCore::fullyClipsContents):
+
</ins><span class="cx"> 2016-08-30  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make PendingScript as ref-counted
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/editing/TextIterator.cpp (205602 => 205603)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/editing/TextIterator.cpp        2016-09-08 07:58:55 UTC (rev 205602)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/editing/TextIterator.cpp        2016-09-08 08:00:34 UTC (rev 205603)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;HTMLParagraphElement.h&quot;
</span><span class="cx"> #include &quot;HTMLProgressElement.h&quot;
</span><ins>+#include &quot;HTMLTextAreaElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLTextFormControlElement.h&quot;
</span><span class="cx"> #include &quot;InlineTextBox.h&quot;
</span><span class="cx"> #include &quot;NodeTraversal.h&quot;
</span><span class="lines">@@ -213,6 +214,11 @@
</span><span class="cx">     auto&amp; box = downcast&lt;RenderBox&gt;(*renderer);
</span><span class="cx">     if (!box.hasOverflowClip())
</span><span class="cx">         return false;
</span><ins>+
+    // Quirk to keep copy/paste in the CodeMirror editor version used in Jenkins working.
+    if (is&lt;HTMLTextAreaElement&gt;(node))
+        return box.size().isEmpty();
+
</ins><span class="cx">     return box.contentSize().isEmpty();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>