Title: [199884] trunk
Revision
199884
Author
hy...@apple.com
Date
2016-04-22 11:27:23 -0700 (Fri, 22 Apr 2016)

Log Message

Source/WebCore:
 -webkit-image-set doesn't work inside CSS variables
https://bugs.webkit.org/show_bug.cgi?id=156915
<rdar://problem/25473972>

Reviewed by Zalan Bujtas.

Added new tests in fast/hidpi.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::equals):
(WebCore::CSSPrimitiveValue::buildParserValue):

LayoutTests:
-webkit-image-set doesn't work inside CSS variables
https://bugs.webkit.org/show_bug.cgi?id=156915
<rdar://problem/25473972>

Reviewed by Zalan Bujtas.

* fast/hidpi/image-srcset-simple-in-variable-1x-expected.txt: Added.
* fast/hidpi/image-srcset-simple-in-variable-1x.html: Added.
* fast/hidpi/image-srcset-simple-in-variable-2x-expected.txt: Added.
* fast/hidpi/image-srcset-simple-in-variable-2x.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (199883 => 199884)


--- trunk/LayoutTests/ChangeLog	2016-04-22 18:17:32 UTC (rev 199883)
+++ trunk/LayoutTests/ChangeLog	2016-04-22 18:27:23 UTC (rev 199884)
@@ -1,3 +1,16 @@
+2016-04-22  Dave Hyatt  <hy...@apple.com>
+
+        -webkit-image-set doesn't work inside CSS variables
+        https://bugs.webkit.org/show_bug.cgi?id=156915
+        <rdar://problem/25473972>
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/hidpi/image-srcset-simple-in-variable-1x-expected.txt: Added.
+        * fast/hidpi/image-srcset-simple-in-variable-1x.html: Added.
+        * fast/hidpi/image-srcset-simple-in-variable-2x-expected.txt: Added.
+        * fast/hidpi/image-srcset-simple-in-variable-2x.html: Added.
+
 2016-04-22  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r199877.

Added: trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-1x-expected.txt (0 => 199884)


--- trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-1x-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-1x-expected.txt	2016-04-22 18:27:23 UTC (rev 199884)
@@ -0,0 +1,3 @@
+PASS document.getElementById("foo").clientWidth==400 is true
+This test passes if the image below says 1x with a reddish background when the deviceScaleFactor is 1, and if says 2x with a greenish background when the deviceScaleFactor is 2.
+

Added: trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-1x.html (0 => 199884)


--- trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-1x.html	                        (rev 0)
+++ trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-1x.html	2016-04-22 18:27:23 UTC (rev 199884)
@@ -0,0 +1,26 @@
+<html>
+<head>
+<script>
+    window.targetScaleFactor = 1;
+</script>
+<script src=""
+<script src=""
+<script>
+    if (window.testRunner)
+        testRunner.dumpAsText();
+
+    function runTest()
+    {
+        shouldBeTrue('document.getElementById("foo").clientWidth==400');
+    }
+</script>
+<style>
+    #foo { --image-set: -webkit-image-set(url(resources/image-set-1x.png) 1x, url(resources/deleteButton.png) 3x, url(resources/image-set-2x.png) 2x); }
+</style>
+</head>
+
+<body id="body">
+    <div>This test passes if the image below says 1x with a reddish background when the deviceScaleFactor is 1, and if says 2x with a greenish background when the deviceScaleFactor is 2.</div>
+    <img id="foo" src="" style="content:var(--image-set)">
+</body>
+</html>

Added: trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-2x-expected.txt (0 => 199884)


--- trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-2x-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-2x-expected.txt	2016-04-22 18:27:23 UTC (rev 199884)
@@ -0,0 +1,3 @@
+PASS document.getElementById("foo").clientWidth==200 is true
+This test passes if the image below says 1x with a reddish background when the deviceScaleFactor is 1, and if says 2x with a greenish background when the deviceScaleFactor is 2.
+

Added: trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-2x.html (0 => 199884)


--- trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-2x.html	                        (rev 0)
+++ trunk/LayoutTests/fast/hidpi/image-srcset-simple-in-variable-2x.html	2016-04-22 18:27:23 UTC (rev 199884)
@@ -0,0 +1,23 @@
+<html>
+<head>
+<script>
+    window.targetScaleFactor = 2;
+</script>
+<script src=""
+<script src=""
+<script>
+    function runTest()
+    {
+        shouldBeTrue('document.getElementById("foo").clientWidth==200');
+    }
+</script>
+<style>
+    #foo { --image-set: -webkit-image-set(url(resources/blue-100-px-square.png) 1x, url(resources/deleteButton.png) 3x, url(resources/green-400-px-square.png) 2x); }
+</style>
+</head>
+
+<body id="body">
+    <div>This test passes if the image below says 1x with a reddish background when the deviceScaleFactor is 1, and if says 2x with a greenish background when the deviceScaleFactor is 2.</div>
+    <img id="foo" src="" style="content:var(--image-set)">
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (199883 => 199884)


--- trunk/Source/WebCore/ChangeLog	2016-04-22 18:17:32 UTC (rev 199883)
+++ trunk/Source/WebCore/ChangeLog	2016-04-22 18:27:23 UTC (rev 199884)
@@ -1,3 +1,17 @@
+2016-04-22  Dave Hyatt  <hy...@apple.com>
+
+         -webkit-image-set doesn't work inside CSS variables
+        https://bugs.webkit.org/show_bug.cgi?id=156915
+        <rdar://problem/25473972>
+
+        Reviewed by Zalan Bujtas.
+
+        Added new tests in fast/hidpi.
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::equals):
+        (WebCore::CSSPrimitiveValue::buildParserValue):
+
 2016-04-22  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r199877.

Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (199883 => 199884)


--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2016-04-22 18:17:32 UTC (rev 199883)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2016-04-22 18:27:23 UTC (rev 199884)
@@ -1329,13 +1329,13 @@
     case CSS_VW:
     case CSS_VH:
     case CSS_VMIN:
-    case CSS_DIMENSION:
     case CSS_FR:
         return m_value.num == other.m_value.num;
     case CSS_PROPERTY_ID:
         return propertyName(m_value.propertyID) == propertyName(other.m_value.propertyID);
     case CSS_VALUE_ID:
         return valueName(m_value.valueID) == valueName(other.m_value.valueID);
+    case CSS_DIMENSION:
     case CSS_STRING:
     case CSS_URI:
     case CSS_ATTR:
@@ -1414,7 +1414,6 @@
     case CSS_VW:
     case CSS_VH:
     case CSS_VMIN:
-    case CSS_DIMENSION:
     case CSS_FR:
         result->fValue = m_value.num;
         result->unit = m_primitiveUnitType;
@@ -1428,6 +1427,7 @@
         result->iValue = m_value.parserOperator;
         result->unit = CSSParserValue::Operator;
         break;
+    case CSS_DIMENSION:
     case CSS_STRING:
     case CSS_URI:
     case CSS_ATTR:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to