Title: [205708] branches/safari-602-branch

Diff

Modified: branches/safari-602-branch/LayoutTests/ChangeLog (205707 => 205708)


--- 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)
@@ -1,3 +1,21 @@
+2016-09-09  Babak Shafiei  <[email protected]>
+
+        Merge r205246. rdar://problem/28162589
+
+    2016-08-31  Antti Koivisto  <[email protected]>
+
+            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.
+
 2016-08-31  Babak Shafiei  <[email protected]>
 
         Merge r205055. rdar://problem/27933564

Added: branches/safari-602-branch/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt (0 => 205708)


--- 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)
@@ -0,0 +1,11 @@
+
+
+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 
+

Added: branches/safari-602-branch/LayoutTests/editing/text-iterator/hidden-textarea-selection-quirk.html (0 => 205708)


--- 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)
@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Selections in hidden elements</title>
+<script src=""
+<script src=""
+<link rel='stylesheet' href=''>
+</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>

Added: branches/safari-602-branch/LayoutTests/platform/ios-simulator/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt (0 => 205708)


--- 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)
@@ -0,0 +1,11 @@
+
+
+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 
+

Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (205707 => 205708)


--- 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)
@@ -1,5 +1,29 @@
 2016-09-09  Babak Shafiei  <[email protected]>
 
+        Merge r205246. rdar://problem/28162589
+
+    2016-08-31  Antti Koivisto  <[email protected]>
+
+            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  <[email protected]>
+
         Merge r205417. rdar://problem/28018438
 
     2016-09-03  Wenson Hsieh  <[email protected]>

Modified: branches/safari-602-branch/Source/WebCore/editing/TextIterator.cpp (205707 => 205708)


--- 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)
@@ -40,6 +40,7 @@
 #include "HTMLNames.h"
 #include "HTMLParagraphElement.h"
 #include "HTMLProgressElement.h"
+#include "HTMLTextAreaElement.h"
 #include "HTMLTextFormControlElement.h"
 #include "InlineTextBox.h"
 #include "NodeTraversal.h"
@@ -213,6 +214,11 @@
     auto& box = downcast<RenderBox>(*renderer);
     if (!box.hasOverflowClip())
         return false;
+
+    // Quirk to keep copy/paste in the CodeMirror editor version used in Jenkins working.
+    if (is<HTMLTextAreaElement>(node))
+        return box.size().isEmpty();
+
     return box.contentSize().isEmpty();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to