[REGRESSION] Value 'none' breaks multiple background-image display
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Jul 2011 16:54:03 +0000 (16:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Jul 2011 16:54:03 +0000 (16:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=59274

Patch by Mihnea Ovidenie <mihnea@adobe.com> on 2011-07-18
Reviewed by Simon Fraser.

When taking fast path for simple color background, we should draw
the background only if it is the last in the list of backgrounds.
Otherwise, it will obscure the previously drawn backgrounds.

Source/WebCore:

Test: fast/backgrounds/background-fast-path-simple-color.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):

LayoutTests:

* fast/backgrounds/background-fast-path-simple-color-expected.png: Added.
* fast/backgrounds/background-fast-path-simple-color-expected.txt: Added.
* fast/backgrounds/background-fast-path-simple-color.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/backgrounds/background-fast-path-simple-color-expected.png [new file with mode: 0644]
LayoutTests/fast/backgrounds/background-fast-path-simple-color-expected.txt [new file with mode: 0644]
LayoutTests/fast/backgrounds/background-fast-path-simple-color.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBoxModelObject.cpp

index a0736e5..ebd46e7 100644 (file)
@@ -1,3 +1,18 @@
+2011-07-18  Mihnea Ovidenie  <mihnea@adobe.com>
+
+        [REGRESSION] Value 'none' breaks multiple background-image display
+        https://bugs.webkit.org/show_bug.cgi?id=59274
+
+        Reviewed by Simon Fraser.
+
+        When taking fast path for simple color background, we should draw
+        the background only if it is the last in the list of backgrounds.
+        Otherwise, it will obscure the previously drawn backgrounds.
+
+        * fast/backgrounds/background-fast-path-simple-color-expected.png: Added.
+        * fast/backgrounds/background-fast-path-simple-color-expected.txt: Added.
+        * fast/backgrounds/background-fast-path-simple-color.html: Added.
+
 2011-07-18  Yi Shen  <yi.4.shen@nokia.com>
 
         [Qt] ASSERTION FAILED in ResourceHandle::setDefersLoading causes crash
diff --git a/LayoutTests/fast/backgrounds/background-fast-path-simple-color-expected.png b/LayoutTests/fast/backgrounds/background-fast-path-simple-color-expected.png
new file mode 100644 (file)
index 0000000..2852dc6
Binary files /dev/null and b/LayoutTests/fast/backgrounds/background-fast-path-simple-color-expected.png differ
diff --git a/LayoutTests/fast/backgrounds/background-fast-path-simple-color-expected.txt b/LayoutTests/fast/backgrounds/background-fast-path-simple-color-expected.txt
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/LayoutTests/fast/backgrounds/background-fast-path-simple-color.html b/LayoutTests/fast/backgrounds/background-fast-path-simple-color.html
new file mode 100644 (file)
index 0000000..6e689f9
--- /dev/null
@@ -0,0 +1,30 @@
+<!doctype html>
+<html>
+<head>
+<!--
+Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=59274">https://bugs.webkit.org/show_bug.cgi?id=59274</a>
+The test passes if you see a green rectangle below.
+-->
+<style type="text/css" media="screen">
+    div {
+        width:100px;
+        height:100px;
+        display:block;
+        background-repeat:no-repeat;
+        background-image:none, url(../../http/tests/multipart/resources/green-100x100.png);
+        background-position:0px 0px, 0px 0px;
+    }
+
+    div:first-child {
+        background-color: red;
+    }
+</style>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText(true);
+</script>
+</head>
+<body>
+<div></div>
+</body>
+</html>
index 984472b..cdb0566 100644 (file)
@@ -1,3 +1,19 @@
+2011-07-18  Mihnea Ovidenie  <mihnea@adobe.com>
+
+        [REGRESSION] Value 'none' breaks multiple background-image display
+        https://bugs.webkit.org/show_bug.cgi?id=59274
+
+        Reviewed by Simon Fraser.
+
+        When taking fast path for simple color background, we should draw
+        the background only if it is the last in the list of backgrounds.
+        Otherwise, it will obscure the previously drawn backgrounds.
+
+        Test: fast/backgrounds/background-fast-path-simple-color.html
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+
 2011-07-18  Yi Shen  <yi.4.shen@nokia.com>
 
         [Qt] ASSERTION FAILED in ResourceHandle::setDefersLoading causes crash
index 6c9ef56..a2af017 100644 (file)
@@ -626,7 +626,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
     bool colorVisible = bgColor.isValid() && bgColor.alpha() > 0;
     
     // Fast path for drawing simple color backgrounds.
-    if (!isRoot && !clippedWithLocalScrolling && !shouldPaintBackgroundImage && isBorderFill) {
+    if (!isRoot && !clippedWithLocalScrolling && !shouldPaintBackgroundImage && isBorderFill && !bgLayer->next()) {
         if (!colorVisible)
             return;