[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

commit-queue at webkit.org commit-queue at webkit.org
Mon Feb 21 00:29:00 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit f13408032e670c8ed00c573dc697a18a80c2cf7b
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 1 01:45:53 2011 +0000

    2011-01-31  Krithigassree Sambamurthy  <krithigassree.sambamurthy at nokia.com>
    
            Reviewed by David Hyatt.
    
            Add background-clip to background shorthand
            https://bugs.webkit.org/show_bug.cgi?id=52080
    
            Added test cases to check whether webkitMaskClip is correctly set when
            declared as a shorthand.
    
            * fast/backgrounds/multiple-backgrounds-computed-style-expected.txt:
            * fast/backgrounds/script-tests/multiple-backgrounds-computed-style.js:
    
            Added test cases to check whether background-clip is set correctly when
            declared as a shorthand.
    
            * fast/css/background-clip-text-expected.txt:
            * fast/css/script-tests/background-clip-text.js:
            (test):
    2011-01-31  Krithigassree Sambamurthy  <krithigassree.sambamurthy at nokia.com>
    
            Reviewed by David Hyatt.
    
            Add background-clip to background shorthand
            https://bugs.webkit.org/show_bug.cgi?id=52080
    
            Added background-clip to background-shorthand. Also made changes to
            include webkitMaskClip to the mask shorthand to keep both in sync.
    
            * css/CSSParser.cpp:
            (WebCore::CSSParser::parseValue):
            (WebCore::CSSParser::parseFillShorthand):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77186 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6376c16..8729307 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,23 @@
+2011-01-31  Krithigassree Sambamurthy  <krithigassree.sambamurthy at nokia.com>
+
+        Reviewed by David Hyatt.
+
+        Add background-clip to background shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=52080
+
+        Added test cases to check whether webkitMaskClip is correctly set when
+        declared as a shorthand.
+
+        * fast/backgrounds/multiple-backgrounds-computed-style-expected.txt:
+        * fast/backgrounds/script-tests/multiple-backgrounds-computed-style.js:
+
+        Added test cases to check whether background-clip is set correctly when
+        declared as a shorthand.
+
+        * fast/css/background-clip-text-expected.txt:
+        * fast/css/script-tests/background-clip-text.js:
+        (test):
+
 2011-01-31  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Adele Peterson.
diff --git a/LayoutTests/fast/backgrounds/multiple-backgrounds-computed-style-expected.txt b/LayoutTests/fast/backgrounds/multiple-backgrounds-computed-style-expected.txt
index 79c2334..884835b 100644
--- a/LayoutTests/fast/backgrounds/multiple-backgrounds-computed-style-expected.txt
+++ b/LayoutTests/fast/backgrounds/multiple-backgrounds-computed-style-expected.txt
@@ -20,6 +20,10 @@ PASS test("backgroundPositionX", "background-position-x: 20px, 10%, right, left,
 PASS test("backgroundPositionY", "background-position-y: 20px, 10%, bottom, top, center;") is "20px, 10%, 100%, 0%, 50%"
 PASS test("webkitMaskImage", "-webkit-mask: none 10px 10px, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC) 20px 20px;") is "none, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC)"
 PASS test("webkitMaskPosition", "-webkit-mask: none 10px 10px, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC) 20px 20px;") is "10px 10px, 20px 20px"
+PASS test("webkitMaskClip", "-webkit-mask: center url() content-box ") is "content-box"
+PASS test("webkitMaskClip", "-webkit-mask: content-box padding-box") is "padding-box"
+PASS test("webkitMaskClip", "-webkit-mask: border-box url() content-box") is "content-box"
+PASS test("webkitMaskClip", "-webkit-mask: url() repeat-x content-box border-box scroll ") is "border-box"
 PASS test("webkitMaskImage", "-webkit-mask-image: none, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC);") is "none, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC)"
 PASS test("webkitMaskSize", "-webkit-mask-size: contain, cover, 20px 10%;") is "contain, cover, 20px 10%"
 PASS test("webkitMaskRepeat", "-webkit-mask-repeat: repeat-x, repeat-y, repeat, no-repeat;") is "repeat-x, repeat-y, repeat, no-repeat"
diff --git a/LayoutTests/fast/backgrounds/script-tests/multiple-backgrounds-computed-style.js b/LayoutTests/fast/backgrounds/script-tests/multiple-backgrounds-computed-style.js
index 40fcda6..ca93bdb 100644
--- a/LayoutTests/fast/backgrounds/script-tests/multiple-backgrounds-computed-style.js
+++ b/LayoutTests/fast/backgrounds/script-tests/multiple-backgrounds-computed-style.js
@@ -35,6 +35,10 @@ shouldBe('test("backgroundPositionY", "background-position-y: 20px, 10%, bottom,
 // mask shorthands
 shouldBe('test("webkitMaskImage", "-webkit-mask: none 10px 10px, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC) 20px 20px;")', '"none, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC)"');
 shouldBe('test("webkitMaskPosition", "-webkit-mask: none 10px 10px, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC) 20px 20px;")', '"10px 10px, 20px 20px"');
+shouldBe('test("webkitMaskClip", "-webkit-mask: center url() content-box ")', '"content-box"');
+shouldBe('test("webkitMaskClip", "-webkit-mask: content-box padding-box")', '"padding-box"');
+shouldBe('test("webkitMaskClip", "-webkit-mask: border-box url() content-box")', '"content-box"');
+shouldBe('test("webkitMaskClip", "-webkit-mask: url() repeat-x content-box border-box scroll ")', '"border-box"');
 
 // mask longhands
 shouldBe('test("webkitMaskImage", "-webkit-mask-image: none, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC);")', '"none, url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC)"');
diff --git a/LayoutTests/fast/css/background-clip-text-expected.txt b/LayoutTests/fast/css/background-clip-text-expected.txt
index 6e11a77..2d5e651 100644
--- a/LayoutTests/fast/css/background-clip-text-expected.txt
+++ b/LayoutTests/fast/css/background-clip-text-expected.txt
@@ -14,8 +14,13 @@ PASS test("-webkit-background-clip: -webkit-text", "background-clip") is null
 PASS test("-webkit-background-clip: -webkit-text", "-webkit-background-clip") is "-webkit-text"
 PASS test("-webkit-background-clip: text", "background-clip") is null
 PASS test("-webkit-background-clip: text", "-webkit-background-clip") is "text"
-PASS test("background: url() padding-box", "background-clip") is "padding-box"
 PASS test("background: url() padding-box", "-webkit-background-clip") is null
+PASS test("-webkit-mask: url() ", "background-clip") is null
+PASS test("background: url() ", "background-clip") is "initial"
+PASS test("background: url() padding-box", "background-clip") is "padding-box"
+PASS test("background: url() padding-box border-box", "background-clip") is "border-box"
+PASS test("background: repeat content-box border-box url() ", "background-clip") is "border-box"
+PASS test("background: padding-box blue content-box url() repeat scroll ", "background-clip") is "content-box"
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/css/script-tests/background-clip-text.js b/LayoutTests/fast/css/script-tests/background-clip-text.js
index 095816b..820674c 100644
--- a/LayoutTests/fast/css/script-tests/background-clip-text.js
+++ b/LayoutTests/fast/css/script-tests/background-clip-text.js
@@ -13,7 +13,6 @@ function test(declaration, property)
     document.body.removeChild(div);
     return result;
 }
-
 shouldBe('test("background-clip: -webkit-text", "background-clip")', '"-webkit-text"');
 shouldBe('test("background-clip: -webkit-text", "-webkit-background-clip")', 'null');
 
@@ -29,8 +28,14 @@ shouldBe('test("-webkit-background-clip: -webkit-text", "-webkit-background-clip
 
 shouldBe('test("-webkit-background-clip: text", "background-clip")', 'null');
 shouldBe('test("-webkit-background-clip: text", "-webkit-background-clip")', '"text"');
+shouldBe('test("background: url() padding-box", "-webkit-background-clip")', 'null');
+
+shouldBe('test("-webkit-mask: url() ", "background-clip")', 'null');
+shouldBe('test("background: url() ", "background-clip")', '"initial"');
 
 shouldBe('test("background: url() padding-box", "background-clip")', '"padding-box"');
-shouldBe('test("background: url() padding-box", "-webkit-background-clip")', 'null');
+shouldBe('test("background: url() padding-box border-box", "background-clip")', '"border-box"');
+shouldBe('test("background: repeat content-box border-box url() ", "background-clip")', '"border-box"');
+shouldBe('test("background: padding-box blue content-box url() repeat scroll ", "background-clip")', '"content-box"');
 
 var successfullyParsed = true;
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 60b3037..04321ef 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-31  Krithigassree Sambamurthy  <krithigassree.sambamurthy at nokia.com>
+
+        Reviewed by David Hyatt.
+
+        Add background-clip to background shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=52080
+
+        Added background-clip to background-shorthand. Also made changes to
+        include webkitMaskClip to the mask shorthand to keep both in sync.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseFillShorthand):
+
 2011-01-31  Darin Adler  <darin at apple.com>
 
         Reviewed by Adele Peterson.
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index ad05836..1ae45f5 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -1613,14 +1613,14 @@ bool CSSParser::parseValue(int propId, bool important)
         // FIXME: Add CSSPropertyBackgroundSize to the shorthand.
         const int properties[] = { CSSPropertyBackgroundImage, CSSPropertyBackgroundRepeat,
                                    CSSPropertyBackgroundAttachment, CSSPropertyBackgroundPosition, CSSPropertyBackgroundOrigin,
-                                   CSSPropertyBackgroundColor };
-        return parseFillShorthand(propId, properties, 6, important);
+                                   CSSPropertyBackgroundClip, CSSPropertyBackgroundColor };
+        return parseFillShorthand(propId, properties, 7, important);
     }
     case CSSPropertyWebkitMask: {
         const int properties[] = { CSSPropertyWebkitMaskImage, CSSPropertyWebkitMaskRepeat,
                                    CSSPropertyWebkitMaskAttachment, CSSPropertyWebkitMaskPosition,
-                                   CSSPropertyWebkitMaskOrigin };
-        return parseFillShorthand(propId, properties, 5, important);
+                                   CSSPropertyWebkitMaskOrigin, CSSPropertyWebkitMaskClip };
+        return parseFillShorthand(propId, properties, 6, important);
     }
     case CSSPropertyBorder:
         // [ 'border-width' || 'border-style' || <color> ] | inherit
@@ -1887,6 +1887,7 @@ bool CSSParser::parseFillShorthand(int propId, const int* properties, int numPro
     RefPtr<CSSValue> clipValue;
     RefPtr<CSSValue> positionYValue;
     RefPtr<CSSValue> repeatYValue;
+    bool foundClip = false;
     int i;
 
     while (m_valueList->current()) {
@@ -1909,7 +1910,7 @@ bool CSSParser::parseFillShorthand(int propId, const int* properties, int numPro
                     if ((properties[i] == CSSPropertyBackgroundOrigin || properties[i] == CSSPropertyWebkitMaskOrigin) && !parsedProperty[i]) {
                         // If background-origin wasn't present, then reset background-clip also.
                         addFillValue(clipValue, CSSInitialValue::createImplicit());
-                    }
+                    }                    
                 }
                 parsedProperty[i] = false;
             }
@@ -1938,6 +1939,11 @@ bool CSSParser::parseFillShorthand(int propId, const int* properties, int numPro
                         else
                             addFillValue(clipValue, CSSInitialValue::createImplicit()); // Some value was used for origin that is not supported by clip. Just reset clip instead.
                     }
+                    if (properties[i] == CSSPropertyBackgroundClip || properties[i] == CSSPropertyWebkitMaskClip) {
+                        // Update clipValue
+                        addFillValue(clipValue, val1.release());
+                        foundClip = true;
+                    }
                 }
             }
         }
@@ -1981,13 +1987,16 @@ bool CSSParser::parseFillShorthand(int propId, const int* properties, int numPro
             addProperty(CSSPropertyWebkitMaskRepeatX, values[i].release(), important);
             // it's OK to call repeatYValue.release() since we only see CSSPropertyBackgroundPosition once
             addProperty(CSSPropertyWebkitMaskRepeatY, repeatYValue.release(), important);
-        } else
+        } else if ((properties[i] == CSSPropertyBackgroundClip || properties[i] == CSSPropertyWebkitMaskClip) && !foundClip)
+            // Value is already set while updating origin
+            continue;
+        else
             addProperty(properties[i], values[i].release(), important);
 
         // Add in clip values when we hit the corresponding origin property.
-        if (properties[i] == CSSPropertyBackgroundOrigin)
+        if (properties[i] == CSSPropertyBackgroundOrigin && !foundClip)
             addProperty(CSSPropertyBackgroundClip, clipValue.release(), important);
-        else  if (properties[i] == CSSPropertyWebkitMaskOrigin)
+        else if (properties[i] == CSSPropertyWebkitMaskOrigin && !foundClip)
             addProperty(CSSPropertyWebkitMaskClip, clipValue.release(), important);
     }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list