<!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>[205708] branches/safari-602-branch</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/205708">205708</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2016-09-09 01:42:03 -0700 (Fri, 09 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/205246">r205246</a>. rdar://problem/28162589</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari602branchLayoutTestsChangeLog">branches/safari-602-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari602branchSourceWebCoreChangeLog">branches/safari-602-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari602branchSourceWebCoreeditingTextIteratorcpp">branches/safari-602-branch/Source/WebCore/editing/TextIterator.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari602branchLayoutTestseditingtextiteratorhiddentextareaselectionquirkexpectedtxt">branches/safari-602-branch/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt</a></li>
<li><a href="#branchessafari602branchLayoutTestseditingtextiteratorhiddentextareaselectionquirkhtml">branches/safari-602-branch/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk.html</a></li>
<li>branches/safari-602-branch/LayoutTests/platform/ios-simulator/editing/text-iterator/</li>
<li><a href="#branchessafari602branchLayoutTestsplatformiossimulatoreditingtextiteratorhiddentextareaselectionquirkexpectedtxt">branches/safari-602-branch/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="branchessafari602branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/LayoutTests/ChangeLog (205707 => 205708)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/ChangeLog        2016-09-09 08:41:58 UTC (rev 205707)
+++ branches/safari-602-branch/LayoutTests/ChangeLog        2016-09-09 08:42:03 UTC (rev 205708)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-09-09 Babak Shafiei <bshafiei@apple.com>
+
+ Merge r205246. rdar://problem/28162589
+
+ 2016-08-31 Antti Koivisto <antti@apple.com>
+
+ REGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins install website
+ https://bugs.webkit.org/show_bug.cgi?id=161386
+ <rdar://problem/27590077>
+
+ 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-31 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r205055. rdar://problem/27933564
</span></span></pre></div>
<a id="branchessafari602branchLayoutTestseditingtextiteratorhiddentextareaselectionquirkexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt (0 => 205708)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt         (rev 0)
+++ branches/safari-602-branch/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt        2016-09-09 08:42:03 UTC (rev 205708)
</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="branchessafari602branchLayoutTestseditingtextiteratorhiddentextareaselectionquirkhtml"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk.html (0 => 205708)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk.html         (rev 0)
+++ branches/safari-602-branch/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk.html        2016-09-09 08:42:03 UTC (rev 205708)
</span><span class="lines">@@ -0,0 +1,101 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<title>Selections in hidden elements</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<link rel='stylesheet' href='../../resources/testharness.css'>
+</head>
+<body>
+<style>
+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;
+}
+</style>
+<container>
+<textarea class=select>test text</textarea>
+<my-text class=select>test text</my-text>
+</container>
+<script>
+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, "test text");
+ else
+ assert_equals(selectionText, "");
+}
+
+var textarea = document.querySelector("textarea");
+var myText = document.querySelector("my-text");
+
+test(function () {
+ checkSelectable(textarea, true);
+}, "Selecting in barely visible textarea");
+
+test(function () {
+ checkSelectable(myText, true);
+}, "Selecting in barely visible div");
+
+document.querySelector("container").classList.add("hide");
+
+test(function () {
+ checkSelectable(textarea, false);
+}, "Selecting in textarea hidden by container");
+
+test(function () {
+ checkSelectable(myText, false);
+}, "Selecting in div hidden by container");
+
+textarea.classList.add("abs");
+myText.classList.add("abs");
+
+test(function () {
+ checkSelectable(textarea, true);
+}, "Selecting in absolute positioned textarea hidden by container");
+
+test(function () {
+ checkSelectable(myText, true);
+}, "Selecting in absolute positioned div hidden by container");
+
+textarea.classList.add("borderBox");
+myText.classList.add("borderBox");
+
+test(function () {
+ checkSelectable(textarea, true);
+}, "Selecting in absolute positioned zero content width textarea hidden by container (quirk behavior)");
+
+test(function () {
+ checkSelectable(myText, false);
+}, "Selecting in absolute positioned zero content width div hidden by container");
+
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari602branchLayoutTestsplatformiossimulatoreditingtextiteratorhiddentextareaselectionquirkexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-602-branch/LayoutTests/platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt (0 => 205708)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/LayoutTests/platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt         (rev 0)
+++ branches/safari-602-branch/LayoutTests/platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt        2016-09-09 08:42:03 UTC (rev 205708)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+
+
+FAIL Selecting in barely visible textarea assert_equals: expected "test text" but got ""
+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 "test text" but got ""
+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 "test text" but got ""
+PASS Selecting in absolute positioned zero content width div hidden by container
+
</ins></span></pre></div>
<a id="branchessafari602branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (205707 => 205708)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/ChangeLog        2016-09-09 08:41:58 UTC (rev 205707)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog        2016-09-09 08:42:03 UTC (rev 205708)
</span><span class="lines">@@ -1,5 +1,29 @@
</span><span class="cx"> 2016-09-09 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r205246. rdar://problem/28162589
+
+ 2016-08-31 Antti Koivisto <antti@apple.com>
+
+ REGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins install website
+ https://bugs.webkit.org/show_bug.cgi?id=161386
+ <rdar://problem/27590077>
+
+ Reviewed by Dan Bernstein.
+
+ This CodeMirror version uses a hidden <textarea> 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):
+
+2016-09-09 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r205417. rdar://problem/28018438
</span><span class="cx">
</span><span class="cx"> 2016-09-03 Wenson Hsieh <wenson_hsieh@apple.com>
</span></span></pre></div>
<a id="branchessafari602branchSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602-branch/Source/WebCore/editing/TextIterator.cpp (205707 => 205708)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602-branch/Source/WebCore/editing/TextIterator.cpp        2016-09-09 08:41:58 UTC (rev 205707)
+++ branches/safari-602-branch/Source/WebCore/editing/TextIterator.cpp        2016-09-09 08:42:03 UTC (rev 205708)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "HTMLParagraphElement.h"
</span><span class="cx"> #include "HTMLProgressElement.h"
</span><ins>+#include "HTMLTextAreaElement.h"
</ins><span class="cx"> #include "HTMLTextFormControlElement.h"
</span><span class="cx"> #include "InlineTextBox.h"
</span><span class="cx"> #include "NodeTraversal.h"
</span><span class="lines">@@ -213,6 +214,11 @@
</span><span class="cx"> auto& box = downcast<RenderBox>(*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<HTMLTextAreaElement>(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>