Title: [135556] trunk
Revision
135556
Author
[email protected]
Date
2012-11-22 21:08:42 -0800 (Thu, 22 Nov 2012)

Log Message

-webkit-mask shorthand switches -webkit-mask-clip and -webkit-mask-origin values
https://bugs.webkit.org/show_bug.cgi?id=103083

Reviewed by Antti Koivisto.

Source/WebCore:

The order of CSSPropertyWebkitMaskOrigin and CSSPropertyWebkitMaskClip was not correct
for property value. Just changed the order in the property array to match behavior of
background and CSS Masking spec.

Test: fast/masking/parsing-mask.html

* css/StylePropertyShorthand.cpp:
(WebCore::webkitMaskShorthand):

LayoutTests:

Add parser tests for -webkit-mask property.

* fast/masking/parsing-mask-expected.txt: Added.
* fast/masking/parsing-mask.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (135555 => 135556)


--- trunk/LayoutTests/ChangeLog	2012-11-23 04:54:43 UTC (rev 135555)
+++ trunk/LayoutTests/ChangeLog	2012-11-23 05:08:42 UTC (rev 135556)
@@ -1,3 +1,15 @@
+2012-11-22  Dirk Schulze  <[email protected]>
+
+        -webkit-mask shorthand switches -webkit-mask-clip and -webkit-mask-origin values
+        https://bugs.webkit.org/show_bug.cgi?id=103083
+
+        Reviewed by Antti Koivisto.
+
+        Add parser tests for -webkit-mask property.
+
+        * fast/masking/parsing-mask-expected.txt: Added.
+        * fast/masking/parsing-mask.html: Added.
+
 2012-11-22  John Mellor  <[email protected]>
 
         Text Autosizing: Improve handling of nested comments on reddit.com

Added: trunk/LayoutTests/fast/masking/parsing-mask-expected.txt (0 => 135556)


--- trunk/LayoutTests/fast/masking/parsing-mask-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/masking/parsing-mask-expected.txt	2012-11-23 05:08:42 UTC (rev 135556)
@@ -0,0 +1,66 @@
+Test that clip-path shapes accept different length units
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS innerStyle("-webkit-mask", "none") is "none"
+PASS innerStyle("-webkit-mask", "none, none") is "none, none"
+PASS innerStyle("-webkit-mask", "none, none, none") is "none, none, none"
+PASS innerStyle("-webkit-mask", "url(file:///image.png), none") is "url(file:///image.png), none"
+PASS innerStyle("-webkit-mask", "none, url(file:///image.png)") is "none, url(file:///image.png)"
+PASS innerStyle("-webkit-mask", "top left") is "0% 0%"
+PASS innerStyle("-webkit-mask", "bottom right") is "100% 100%"
+PASS innerStyle("-webkit-mask", "left bottom") is "0% 100%"
+PASS innerStyle("-webkit-mask", "right top") is "100% 0%"
+PASS innerStyle("-webkit-mask", "center") is "50% 50%"
+PASS innerStyle("-webkit-mask", "none top") is "none 50% 0%"
+PASS innerStyle("-webkit-mask", "none bottom") is "none 50% 100%"
+PASS innerStyle("-webkit-mask", "none right") is "none 100% 50%"
+PASS innerStyle("-webkit-mask", "none top right") is "none 100% 0%"
+PASS innerStyle("-webkit-mask", "none bottom left") is "none 0% 100%"
+PASS innerStyle("-webkit-mask", "none right") is "none 100% 50%"
+PASS innerStyle("-webkit-mask", "none left") is "none 0% 50%"
+PASS innerStyle("-webkit-mask", "center 50%") is "50% 50%"
+PASS innerStyle("-webkit-mask", "50px 50%") is "50px 50%"
+PASS innerStyle("-webkit-mask", "center left") is "0% 50%"
+PASS innerStyle("-webkit-mask", "top center") is "50% 0%"
+PASS innerStyle("-webkit-mask", "repeat-x") is "repeat no-repeat"
+PASS innerStyle("-webkit-mask", "repeat-y") is "no-repeat repeat"
+PASS innerStyle("-webkit-mask", "repeat") is "repeat repeat"
+PASS innerStyle("-webkit-mask", "space") is "space space"
+PASS innerStyle("-webkit-mask", "no-repeat") is "no-repeat no-repeat"
+PASS innerStyle("-webkit-mask", "repeat space") is "repeat space"
+PASS innerStyle("-webkit-mask", "repeat round") is "repeat round"
+PASS innerStyle("-webkit-mask", "repeat no-repeat") is "repeat no-repeat"
+PASS innerStyle("-webkit-mask", "repeat space, repeat-x") is "repeat space, repeat no-repeat"
+PASS innerStyle("-webkit-mask", "repeat none") is "none repeat repeat"
+PASS innerStyle("-webkit-mask", "none repeat") is "none repeat repeat"
+PASS innerStyle("-webkit-mask", "padding-box") is "padding-box padding-box"
+PASS innerStyle("-webkit-mask", "border-box") is "border-box border-box"
+PASS innerStyle("-webkit-mask", "content-box") is "content-box content-box"
+PASS innerStyle("-webkit-mask", "padding-box none") is "none padding-box padding-box"
+PASS innerStyle("-webkit-mask", "none padding-box") is "none padding-box padding-box"
+PASS innerStyle("-webkit-mask", "padding-box content-box") is "padding-box content-box"
+PASS innerStyle("-webkit-mask", "content-box content-box") is "content-box content-box"
+PASS innerStyle("-webkit-mask", "padding-box border-box") is "padding-box border-box"
+PASS innerStyle("-webkit-mask", "padding-box border-box none") is "none padding-box border-box"
+PASS innerStyle("-webkit-mask", "none padding-box border-box") is "none padding-box border-box"
+PASS innerStyle("-webkit-mask", "none padding-box content-box") is "none padding-box content-box"
+PASS innerStyle("-webkit-mask", "none padding-box") is "none padding-box padding-box"
+PASS innerStyle("-webkit-mask", "none top") is "none 50% 0%"
+PASS innerStyle("-webkit-mask", "none border-box left top") is "none 0% 0% border-box border-box"
+PASS innerStyle("-webkit-mask", "top none left") is null
+PASS innerStyle("-webkit-mask", "right none bottom") is null
+PASS innerStyle("-webkit-mask", "right right") is null
+PASS innerStyle("-webkit-mask", "left left") is null
+PASS innerStyle("-webkit-mask", "top top") is null
+PASS innerStyle("-webkit-mask", "bottom bottom") is null
+PASS innerStyle("-webkit-mask", "50% none 50%") is null
+PASS innerStyle("-webkit-mask", "repeat-x repeat-x") is null
+PASS innerStyle("-webkit-mask", "space repeat-y") is null
+PASS innerStyle("-webkit-mask", "repeat space space") is null
+PASS innerStyle("-webkit-mask", "padding-box border-box content-box") is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/masking/parsing-mask.html (0 => 135556)


--- trunk/LayoutTests/fast/masking/parsing-mask.html	                        (rev 0)
+++ trunk/LayoutTests/fast/masking/parsing-mask.html	2012-11-23 05:08:42 UTC (rev 135556)
@@ -0,0 +1,129 @@
+<!DOCTYPE html>
+<html>
+<style>
+* { font-size: 16px; }
+div { font-size: 8px; }
+</style>
+<body>
+<script src=""
+<script>
+description('Test that clip-path shapes accept different length units');
+
+function computedStyle(property, value) {
+    var div = document.createElement("div");
+    document.body.appendChild(div);
+    div.style.setProperty(property, value);
+    var computedValue = getComputedStyle(div).getPropertyValue(property);
+    document.body.removeChild(div);
+    return computedValue;
+}
+
+function innerStyle(property, value) {
+    var div = document.createElement("div");
+    div.style.setProperty(property, value);
+    return div.style.getPropertyValue(property);
+}
+
+function testComputed(property, value, expected) {
+    shouldBeEqualToString('computedStyle("' + property + '", "' + value + '")', expected);
+}
+
+function testInner(property, value, expected) {
+    if (expected === null)
+        shouldBeNull('innerStyle("' + property + '", "' + value + '")');
+    else
+        shouldBeEqualToString('innerStyle("' + property + '", "' + value + '")', expected);
+}
+
+function negativeTest(property, value) {
+    testInner(property, value, null);
+    // FIXME: Computed style not yet implemented.
+    // testComputed(property, value, 'none');
+}
+
+// test mask-image
+testInner("-webkit-mask", "none", "none");
+testInner("-webkit-mask", "none, none", "none, none");
+testInner("-webkit-mask", "none, none, none", "none, none, none");
+testInner("-webkit-mask", "url(file:///image.png), none", "url(file:///image.png), none");
+testInner("-webkit-mask", "none, url(file:///image.png)", "none, url(file:///image.png)");
+
+
+// test mask-position
+testInner("-webkit-mask", "top left", "0% 0%");
+testInner("-webkit-mask", "bottom right", "100% 100%");
+testInner("-webkit-mask", "left bottom", "0% 100%");
+testInner("-webkit-mask", "right top", "100% 0%");
+testInner("-webkit-mask", "center", "50% 50%");
+testInner("-webkit-mask", "none top", "none 50% 0%");
+testInner("-webkit-mask", "none bottom", "none 50% 100%");
+testInner("-webkit-mask", "none right", "none 100% 50%");
+testInner("-webkit-mask", "none top right", "none 100% 0%");
+testInner("-webkit-mask", "none bottom left", "none 0% 100%");
+testInner("-webkit-mask", "none right", "none 100% 50%");
+testInner("-webkit-mask", "none left", "none 0% 50%");
+testInner("-webkit-mask", "center 50%", "50% 50%");
+testInner("-webkit-mask", "50px 50%", "50px 50%");
+testInner("-webkit-mask", "center left", "0% 50%");
+testInner("-webkit-mask", "top center", "50% 0%");
+
+// test mask-repeat
+testInner("-webkit-mask", "repeat-x", "repeat no-repeat");
+testInner("-webkit-mask", "repeat-y", "no-repeat repeat");
+testInner("-webkit-mask", "repeat", "repeat repeat");
+testInner("-webkit-mask", "space", "space space");
+testInner("-webkit-mask", "no-repeat", "no-repeat no-repeat");
+testInner("-webkit-mask", "repeat space", "repeat space");
+testInner("-webkit-mask", "repeat round", "repeat round");
+testInner("-webkit-mask", "repeat no-repeat", "repeat no-repeat");
+testInner("-webkit-mask", "repeat space, repeat-x", "repeat space, repeat no-repeat");
+testInner("-webkit-mask", "repeat none", "none repeat repeat");
+testInner("-webkit-mask", "none repeat", "none repeat repeat");
+
+// test mask-origin / mask-clip
+testInner("-webkit-mask", "padding-box", "padding-box padding-box");
+testInner("-webkit-mask", "border-box", "border-box border-box");
+testInner("-webkit-mask", "content-box", "content-box content-box");
+testInner("-webkit-mask", "padding-box none", "none padding-box padding-box");
+testInner("-webkit-mask", "none padding-box", "none padding-box padding-box");
+testInner("-webkit-mask", "padding-box content-box", "padding-box content-box");
+testInner("-webkit-mask", "content-box content-box", "content-box content-box");
+testInner("-webkit-mask", "padding-box border-box", "padding-box border-box");
+testInner("-webkit-mask", "padding-box border-box none", "none padding-box border-box");
+testInner("-webkit-mask", "none padding-box border-box", "none padding-box border-box");
+
+// FIXME: mask-size not part of the shorthand yet.
+// https://bugs.webkit.org/show_bug.cgi?id=103020
+
+// combinations
+testInner("-webkit-mask", "none padding-box content-box", "none padding-box content-box");
+testInner("-webkit-mask", "none padding-box", "none padding-box padding-box");
+testInner("-webkit-mask", "none top", "none 50% 0%");
+testInner("-webkit-mask", "none border-box left top", "none 0% 0% border-box border-box");
+
+
+// FIXME: Computed style not yet implemented.
+// testComputed("-webkit-mask", "", "");
+// https://bugs.webkit.org/show_bug.cgi?id=103021
+
+// negative tests
+negativeTest("-webkit-mask", "top none left");
+negativeTest("-webkit-mask", "right none bottom");
+negativeTest("-webkit-mask", "right right");
+negativeTest("-webkit-mask", "left left");
+negativeTest("-webkit-mask", "top top");
+negativeTest("-webkit-mask", "bottom bottom");
+negativeTest("-webkit-mask", "50% none 50%");
+negativeTest("-webkit-mask", "repeat-x repeat-x");
+negativeTest("-webkit-mask", "space repeat-y");
+negativeTest("-webkit-mask", "repeat space space");
+negativeTest("-webkit-mask", "padding-box border-box content-box");
+
+// FIXME: Add negative tests for mask-attachment, which should not be supported.
+// https://bugs.webkit.org/show_bug.cgi?id=67137
+
+
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (135555 => 135556)


--- trunk/Source/WebCore/ChangeLog	2012-11-23 04:54:43 UTC (rev 135555)
+++ trunk/Source/WebCore/ChangeLog	2012-11-23 05:08:42 UTC (rev 135556)
@@ -1,3 +1,19 @@
+2012-11-22  Dirk Schulze  <[email protected]>
+
+        -webkit-mask shorthand switches -webkit-mask-clip and -webkit-mask-origin values
+        https://bugs.webkit.org/show_bug.cgi?id=103083
+
+        Reviewed by Antti Koivisto.
+
+        The order of CSSPropertyWebkitMaskOrigin and CSSPropertyWebkitMaskClip was not correct
+        for property value. Just changed the order in the property array to match behavior of
+        background and CSS Masking spec.
+
+        Test: fast/masking/parsing-mask.html
+
+        * css/StylePropertyShorthand.cpp:
+        (WebCore::webkitMaskShorthand):
+
 2012-11-22  John Mellor  <[email protected]>
 
         Text Autosizing: Improve handling of nested comments on reddit.com

Modified: trunk/Source/WebCore/css/StylePropertyShorthand.cpp (135555 => 135556)


--- trunk/Source/WebCore/css/StylePropertyShorthand.cpp	2012-11-23 04:54:43 UTC (rev 135555)
+++ trunk/Source/WebCore/css/StylePropertyShorthand.cpp	2012-11-23 05:08:42 UTC (rev 135556)
@@ -375,8 +375,8 @@
         CSSPropertyWebkitMaskAttachment,
         CSSPropertyWebkitMaskPositionX,
         CSSPropertyWebkitMaskPositionY,
-        CSSPropertyWebkitMaskClip,
-        CSSPropertyWebkitMaskOrigin
+        CSSPropertyWebkitMaskOrigin,
+        CSSPropertyWebkitMaskClip
     };
     DEFINE_STATIC_LOCAL(StylePropertyShorthand, webkitMaskLonghands, (maskProperties, WTF_ARRAY_LENGTH(maskProperties)));
     return webkitMaskLonghands;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to