REGRESSION (r173283-r173296): Amazon.com front page has no caret in the search field
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jun 2015 21:08:44 +0000 (21:08 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Jun 2015 21:08:44 +0000 (21:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=146073
rdar://problem/21022203

Reviewed by Tim Horton.

Source/WebCore:

Text controls (text inputs and textareas) need backing store even when empty, because
they need to be able to paint a caret.

Test: compositing/backing/form-controls-backing.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):

LayoutTests:

Dump layers for composited text inputs and textareas.

* compositing/backing/form-controls-backing-expected.txt: Added.
* compositing/backing/form-controls-backing.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/compositing/backing/form-controls-backing-expected.txt [new file with mode: 0644]
LayoutTests/compositing/backing/form-controls-backing.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerBacking.cpp

index 9d7ede5..b4e826b 100644 (file)
@@ -1,3 +1,16 @@
+2015-06-17  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r173283-r173296): Amazon.com front page has no caret in the search field
+        https://bugs.webkit.org/show_bug.cgi?id=146073
+        rdar://problem/21022203
+
+        Reviewed by Tim Horton.
+
+        Dump layers for composited text inputs and textareas.
+
+        * compositing/backing/form-controls-backing-expected.txt: Added.
+        * compositing/backing/form-controls-backing.html: Added.
+
 2015-06-17  Zalan Bujtas  <zalan@apple.com>
 
         Selection cache produces invalid result when ancestor has float element.
diff --git a/LayoutTests/compositing/backing/form-controls-backing-expected.txt b/LayoutTests/compositing/backing/form-controls-backing-expected.txt
new file mode 100644 (file)
index 0000000..00b4c7c
--- /dev/null
@@ -0,0 +1,31 @@
+
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 3
+        (GraphicsLayer
+          (position 19.00 19.00)
+          (bounds 20.00 420.00)
+          (contentsOpaque 1)
+        )
+        (GraphicsLayer
+          (position 19.00 19.00)
+          (bounds 202.00 22.00)
+          (contentsOpaque 1)
+          (drawsContent 1)
+        )
+        (GraphicsLayer
+          (position 19.00 59.00)
+          (bounds 204.00 24.00)
+          (contentsOpaque 1)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/compositing/backing/form-controls-backing.html b/LayoutTests/compositing/backing/form-controls-backing.html
new file mode 100644 (file)
index 0000000..46945c3
--- /dev/null
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .container {
+            position: relative;
+            z-index: 1;
+            padding: 10px;
+            width: 400px;
+            height: 400px;
+            border: 1px solid black;
+        }
+
+        input, textarea {
+            position: absolute;
+            border-style: none;
+            outline: 0;
+            height: 20px;
+            width: 200px;
+            background: silver;
+        }
+        
+        .composited {
+            position: absolute;
+            left: 10px;
+            width: 20px;
+            height: 100%;
+            -webkit-transform: translateZ(0);
+            background-color: #eee;
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        function dumpLayers()
+        {
+            var layersResult = document.getElementById('layers');
+            if (window.testRunner)
+                layersResult.innerText = window.internals.layerTreeAsText(document);
+        }
+
+        window.addEventListener('load', dumpLayers, false)
+    </script>
+</head>
+<body>
+
+<div class="container">
+    <div class="composited"></div>
+
+    <input type="text" style="top: 10px"></input>
+    <textarea style="top: 50px"></textarea>
+</div>
+
+<pre id="layers">Layer tree goes here in DRT</pre>
+
+</body>
+</html>
index 87e211d..d5ad0c1 100644 (file)
@@ -1,3 +1,19 @@
+2015-06-17  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r173283-r173296): Amazon.com front page has no caret in the search field
+        https://bugs.webkit.org/show_bug.cgi?id=146073
+        rdar://problem/21022203
+
+        Reviewed by Tim Horton.
+
+        Text controls (text inputs and textareas) need backing store even when empty, because
+        they need to be able to paint a caret.
+
+        Test: compositing/backing/form-controls-backing.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
+
 2015-06-17  Zalan Bujtas  <zalan@apple.com>
 
         Selection cache produces invalid result when ancestor has float element.
index 377a083..85a40db 100644 (file)
@@ -1848,6 +1848,9 @@ bool RenderLayerBacking::isSimpleContainerCompositingLayer() const
     if (renderer().isRenderReplaced() && (!isCompositedPlugin(renderer()) || isRestartedPlugin(renderer())))
         return false;
 
+    if (renderer().isTextControl())
+        return false;
+
     if (paintsBoxDecorations() || paintsChildren())
         return false;