Make fast/selectors/040.html actually test background-color painting for ::selection...
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2016 17:58:39 +0000 (17:58 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2016 17:58:39 +0000 (17:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79694

Reviewed by Beth Dakin.

Currently the test case fast/selectors/040.html doesn't actually test that we
honor the background-color of ::selection when run in DRT. In particular, it
doesn't programmatically select any text and hence the DRT results reflect a
paragraph of non-selected text. Instead, we should programmatically select the
test paragraph so that DRT can capture the painting of background-color for ::selection.

* fast/selectors/040-expected.html: Added.
* fast/selectors/040.html:
* platform/efl/fast/selectors/040-expected.png: Removed.
* platform/efl/fast/selectors/040-expected.txt: Removed.
* platform/gtk/fast/selectors/040-expected.png: Removed.
* platform/gtk/fast/selectors/040-expected.txt: Removed.
* platform/ios-simulator/fast/selectors/040-expected.txt: Removed.
* platform/mac/fast/selectors/040-expected.png: Removed.
* platform/mac/fast/selectors/040-expected.txt: Removed.
* platform/win/fast/selectors/040-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@209404 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/selectors/040-expected.html [new file with mode: 0644]
LayoutTests/fast/selectors/040.html
LayoutTests/platform/efl/fast/selectors/040-expected.png [deleted file]
LayoutTests/platform/efl/fast/selectors/040-expected.txt [deleted file]
LayoutTests/platform/gtk/fast/selectors/040-expected.png [deleted file]
LayoutTests/platform/gtk/fast/selectors/040-expected.txt [deleted file]
LayoutTests/platform/ios-simulator/fast/selectors/040-expected.txt [deleted file]
LayoutTests/platform/mac/fast/selectors/040-expected.png [deleted file]
LayoutTests/platform/mac/fast/selectors/040-expected.txt [deleted file]
LayoutTests/platform/win/fast/selectors/040-expected.txt [deleted file]

index d9faf37..9fd5e9c 100644 (file)
@@ -1,5 +1,29 @@
 2016-12-06  Daniel Bates  <dabates@apple.com>
 
+        Make fast/selectors/040.html actually test background-color painting for ::selection when run in DRT
+        https://bugs.webkit.org/show_bug.cgi?id=79694
+
+        Reviewed by Beth Dakin.
+
+        Currently the test case fast/selectors/040.html doesn't actually test that we
+        honor the background-color of ::selection when run in DRT. In particular, it
+        doesn't programmatically select any text and hence the DRT results reflect a
+        paragraph of non-selected text. Instead, we should programmatically select the
+        test paragraph so that DRT can capture the painting of background-color for ::selection.
+
+        * fast/selectors/040-expected.html: Added.
+        * fast/selectors/040.html:
+        * platform/efl/fast/selectors/040-expected.png: Removed.
+        * platform/efl/fast/selectors/040-expected.txt: Removed.
+        * platform/gtk/fast/selectors/040-expected.png: Removed.
+        * platform/gtk/fast/selectors/040-expected.txt: Removed.
+        * platform/ios-simulator/fast/selectors/040-expected.txt: Removed.
+        * platform/mac/fast/selectors/040-expected.png: Removed.
+        * platform/mac/fast/selectors/040-expected.txt: Removed.
+        * platform/win/fast/selectors/040-expected.txt: Removed.
+
+2016-12-06  Daniel Bates  <dabates@apple.com>
+
         Test insecure-xhr-sync-in-main-frame.html fails with CORS error if run before r203542
         https://bugs.webkit.org/show_bug.cgi?id=165407
 
diff --git a/LayoutTests/fast/selectors/040-expected.html b/LayoutTests/fast/selectors/040-expected.html
new file mode 100644 (file)
index 0000000..e45e346
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
+<html>
+ <head>
+  <title>::selection pseudo-element</title>
+  <style type="text/css">
+  .highlight { background-color: rgba(99, 254, 0, 0.95); }
+  </style>
+ </head>
+ <body>
+<!-- This result mimics the text-wrapping that would occur in a window with size 800 x 600 pixels. -->
+<p style="margin-bottom: 0" class="highlight">Any textual selection in this long paragraph should have green background. Any textual selection in this long paragraph</p><p style="margin-top: 0"><span class="highlight">should have green background. Any textual selection in this long paragraph should have green background.</span></p>
+</body>
+</html>
index bb5ff4a..6056cf8 100644 (file)
@@ -2,7 +2,7 @@
 <html>
  <head>
   <title>::selection pseudo-element</title>
-  <style type="text/css">p::selection { background-color : lime }
+  <style type="text/css">p::selection { background-color: rgba(99, 254, 0, 0.95); /* alpha < 1 so that we don't blend the background color with white. */ }
 </style>
   <link rel="first" href="css3-modsel-1.html" title="Groups of selectors">
   <link rel="prev" href="css3-modsel-39b.html" title="::first-letter pseudo-element">
@@ -13,5 +13,9 @@
  </head>
  <body>
 <p>Any textual selection in this long paragraph should have green background. Any textual selection in this long paragraph should have green background. Any textual selection in this long paragraph should have green background.</p>
+<script>
+var p = document.querySelector("p");
+window.getSelection().setBaseAndExtent(p, 0, p, 1);
+</script>
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/LayoutTests/platform/efl/fast/selectors/040-expected.png b/LayoutTests/platform/efl/fast/selectors/040-expected.png
deleted file mode 100644 (file)
index 2a4f044..0000000
Binary files a/LayoutTests/platform/efl/fast/selectors/040-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/efl/fast/selectors/040-expected.txt b/LayoutTests/platform/efl/fast/selectors/040-expected.txt
deleted file mode 100644 (file)
index 0a42033..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x68
-  RenderBlock {HTML} at (0,0) size 800x68
-    RenderBody {BODY} at (8,16) size 784x36
-      RenderBlock {P} at (0,0) size 784x36
-        RenderText {#text} at (0,0) size 754x35
-          text run at (0,0) width 754: "Any textual selection in this long paragraph should have green background. Any textual selection in this long paragraph"
-          text run at (0,18) width 678: "should have green background. Any textual selection in this long paragraph should have green background."
diff --git a/LayoutTests/platform/gtk/fast/selectors/040-expected.png b/LayoutTests/platform/gtk/fast/selectors/040-expected.png
deleted file mode 100644 (file)
index a69c3d6..0000000
Binary files a/LayoutTests/platform/gtk/fast/selectors/040-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/gtk/fast/selectors/040-expected.txt b/LayoutTests/platform/gtk/fast/selectors/040-expected.txt
deleted file mode 100644 (file)
index fdb3fa3..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x66
-  RenderBlock {HTML} at (0,0) size 800x66
-    RenderBody {BODY} at (8,16) size 784x34
-      RenderBlock {P} at (0,0) size 784x34
-        RenderText {#text} at (0,0) size 754x34
-          text run at (0,0) width 754: "Any textual selection in this long paragraph should have green background. Any textual selection in this long paragraph"
-          text run at (0,17) width 678: "should have green background. Any textual selection in this long paragraph should have green background."
diff --git a/LayoutTests/platform/ios-simulator/fast/selectors/040-expected.txt b/LayoutTests/platform/ios-simulator/fast/selectors/040-expected.txt
deleted file mode 100644 (file)
index a7a26dc..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x72
-  RenderBlock {HTML} at (0,0) size 800x72
-    RenderBody {BODY} at (8,16) size 784x40
-      RenderBlock {P} at (0,0) size 784x40
-        RenderText {#text} at (0,0) size 768x39
-          text run at (0,0) width 768: "Any textual selection in this long paragraph should have green background. Any textual selection in this long paragraph"
-          text run at (0,20) width 688: "should have green background. Any textual selection in this long paragraph should have green background."
diff --git a/LayoutTests/platform/mac/fast/selectors/040-expected.png b/LayoutTests/platform/mac/fast/selectors/040-expected.png
deleted file mode 100644 (file)
index 58a7481..0000000
Binary files a/LayoutTests/platform/mac/fast/selectors/040-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/fast/selectors/040-expected.txt b/LayoutTests/platform/mac/fast/selectors/040-expected.txt
deleted file mode 100644 (file)
index d3f291a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x68
-  RenderBlock {HTML} at (0,0) size 800x68
-    RenderBody {BODY} at (8,16) size 784x36
-      RenderBlock {P} at (0,0) size 784x36
-        RenderText {#text} at (0,0) size 768x36
-          text run at (0,0) width 768: "Any textual selection in this long paragraph should have green background. Any textual selection in this long paragraph"
-          text run at (0,18) width 688: "should have green background. Any textual selection in this long paragraph should have green background."
diff --git a/LayoutTests/platform/win/fast/selectors/040-expected.txt b/LayoutTests/platform/win/fast/selectors/040-expected.txt
deleted file mode 100644 (file)
index e22e963..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x68
-  RenderBlock {HTML} at (0,0) size 800x68
-    RenderBody {BODY} at (8,16) size 784x36
-      RenderBlock {P} at (0,0) size 784x36
-        RenderText {#text} at (0,0) size 754x36
-          text run at (0,0) width 754: "Any textual selection in this long paragraph should have green background. Any textual selection in this long paragraph"
-          text run at (0,18) width 678: "should have green background. Any textual selection in this long paragraph should have green background."