[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

mitz at apple.com mitz at apple.com
Thu Oct 29 20:49:37 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 197799cfbe5655236d87b796bdc9542a0cf8f6a9
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 21 16:47:57 2009 +0000

    WebCore: Fixed background-clip parsing regressions introduced in r46240.
    
    Reviewed by Sam Weinig.
    
    Test: fast/css/background-clip-text.html
    
    * css/CSSParser.cpp:
    (WebCore::parseBackgroundClip): Added this helper method.
    (WebCore::CSSParser::parseFillShorthand): Use parseBackgroundClip() to
    reparse the value. The old code called parseFillProperty() again, which
    didn’t work, because parseFillProperty() advances the value list.
    (WebCore::CSSParser::parseFillProperty): Changed to use
    parseBackgroundClip().
    * css/CSSPrimitiveValueMappings.h:
    (WebCore::CSSPrimitiveValue::operator EFillBox): Added a case for
    CSSValueWebkitText.
    
    LayoutTests: Added a background-clip parsing test that would have caught some
    regressions that were introduced in r46240.
    
    Reviewed by Sam Weinig.
    
    * fast/css/background-clip-text-expected.txt: Added.
    * fast/css/background-clip-text.html: Added.
    * fast/css/script-tests: Added.
    * fast/css/script-tests/TEMPLATE.html: Copied from LayoutTests/fast/backgrounds/repeat/script-tests/TEMPLATE.html.
    * fast/css/script-tests/background-clip-text.js: Added.
    (test):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49906 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 71c6275..4e8a9b1 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2009-10-21  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Added a background-clip parsing test that would have caught some
+        regressions that were introduced in r46240.
+
+        * fast/css/background-clip-text-expected.txt: Added.
+        * fast/css/background-clip-text.html: Added.
+        * fast/css/script-tests: Added.
+        * fast/css/script-tests/TEMPLATE.html: Copied from LayoutTests/fast/backgrounds/repeat/script-tests/TEMPLATE.html.
+        * fast/css/script-tests/background-clip-text.js: Added.
+        (test):
+
 2009-10-21  Xan Lopez  <xlopez at igalia.com>
 
         Skip another failing test.
diff --git a/LayoutTests/fast/css/background-clip-text-expected.txt b/LayoutTests/fast/css/background-clip-text-expected.txt
new file mode 100644
index 0000000..d00cd7e
--- /dev/null
+++ b/LayoutTests/fast/css/background-clip-text-expected.txt
@@ -0,0 +1,19 @@
+This tests checks that the '-webkit-text' and 'text' keywords are parsed correctly in the 'background-clip' and '-webkit-background-clip' properties, and that 'background-clip' is parsed correctly in the 'background' shorthand.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS test("background-clip: -webkit-text", "background-clip") is "-webkit-text"
+PASS test("background-clip: -webkit-text", "-webkit-background-clip") is null
+PASS test("background-clip: text", "background-clip") is null
+PASS test("background-clip: text", "-webkit-background-clip") is null
+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 successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/background-clip-text.html b/LayoutTests/fast/css/background-clip-text.html
new file mode 100644
index 0000000..b0b216f
--- /dev/null
+++ b/LayoutTests/fast/css/background-clip-text.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/background-clip-text.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/canvas/script-tests/TEMPLATE.html b/LayoutTests/fast/css/script-tests/TEMPLATE.html
similarity index 100%
copy from LayoutTests/fast/canvas/script-tests/TEMPLATE.html
copy to LayoutTests/fast/css/script-tests/TEMPLATE.html
diff --git a/LayoutTests/fast/css/script-tests/background-clip-text.js b/LayoutTests/fast/css/script-tests/background-clip-text.js
new file mode 100644
index 0000000..00005fa
--- /dev/null
+++ b/LayoutTests/fast/css/script-tests/background-clip-text.js
@@ -0,0 +1,32 @@
+description("This tests checks that the '-webkit-text' and 'text' keywords are \
+    parsed correctly in the 'background-clip' and '-webkit-background-clip' \
+    properties, and that 'background-clip' is parsed correctly in the \
+    'background' shorthand.");
+
+function test(declaration, property)
+{
+    var div = document.createElement("div");
+    div.setAttribute("style", declaration);
+    document.body.appendChild(div);
+    
+    var result = div.style.getPropertyValue(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');
+
+shouldBe('test("background-clip: text", "background-clip")', 'null');
+shouldBe('test("background-clip: text", "-webkit-background-clip")', 'null');
+
+shouldBe('test("-webkit-background-clip: -webkit-text", "background-clip")', 'null');
+shouldBe('test("-webkit-background-clip: -webkit-text", "-webkit-background-clip")', '"-webkit-text"');
+
+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", "background-clip")', '"padding-box"');
+shouldBe('test("background: url() padding-box", "-webkit-background-clip")', 'null');
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cf0e6ba..4990105 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2009-10-21  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Fixed background-clip parsing regressions introduced in r46240.
+
+        Test: fast/css/background-clip-text.html
+
+        * css/CSSParser.cpp:
+        (WebCore::parseBackgroundClip): Added this helper method.
+        (WebCore::CSSParser::parseFillShorthand): Use parseBackgroundClip() to
+        reparse the value. The old code called parseFillProperty() again, which
+        didn’t work, because parseFillProperty() advances the value list.
+        (WebCore::CSSParser::parseFillProperty): Changed to use
+        parseBackgroundClip().
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::operator EFillBox): Added a case for
+        CSSValueWebkitText.
+
 2009-10-21  Alexander Pavlov  <apavlov at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index 10949dd..02b1ad8 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -1726,6 +1726,15 @@ void CSSParser::addFillValue(RefPtr<CSSValue>& lval, PassRefPtr<CSSValue> rval)
         lval = rval;
 }
 
+static bool parseBackgroundClip(CSSParserValue* parserValue, RefPtr<CSSValue>& cssValue)
+{
+    if (parserValue->id == CSSValueBorderBox || parserValue->id == CSSValuePaddingBox || parserValue->id == CSSValueWebkitText) {
+        cssValue = CSSPrimitiveValue::createIdentifier(parserValue->id);
+        return true;
+    }
+    return false;
+}
+
 const int cMaxFillProperties = 9;
 
 bool CSSParser::parseFillShorthand(int propId, const int* properties, int numProperties, bool important)
@@ -1777,6 +1786,7 @@ bool CSSParser::parseFillShorthand(int propId, const int* properties, int numPro
                 RefPtr<CSSValue> val1;
                 RefPtr<CSSValue> val2;
                 int propId1, propId2;
+                CSSParserValue* parserValue = m_valueList->current();
                 if (parseFillProperty(properties[i], propId1, propId2, val1, val2)) {
                     parsedProperty[i] = found = true;
                     addFillValue(values[i], val1.release());
@@ -1786,7 +1796,7 @@ bool CSSParser::parseFillShorthand(int propId, const int* properties, int numPro
                         addFillValue(repeatYValue, val2.release());
                     if (properties[i] == CSSPropertyBackgroundOrigin || properties[i] == CSSPropertyWebkitMaskOrigin) {
                         // Reparse the value as a clip, and see if we succeed.
-                        if (parseFillProperty(CSSPropertyBackgroundClip, propId1, propId2, val1, val2))
+                        if (parseBackgroundClip(parserValue, val1))
                             addFillValue(clipValue, val1.release()); // The property parsed successfully.
                         else
                             addFillValue(clipValue, CSSInitialValue::createImplicit()); // Some value was used for origin that is not supported by clip. Just reset clip instead.
@@ -2425,10 +2435,8 @@ bool CSSParser::parseFillProperty(int propId, int& propId1, int& propId2,
                     }
                     break;
                 case CSSPropertyBackgroundClip:
-                    if (val->id == CSSValueBorderBox || val->id == CSSValuePaddingBox || val->id == CSSValueWebkitText) {
-                        currValue = CSSPrimitiveValue::createIdentifier(val->id);
+                    if (parseBackgroundClip(val, currValue))
                         m_valueList->next();
-                    }
                     break;
                 case CSSPropertyBackgroundOrigin:
                     if (val->id == CSSValueBorderBox || val->id == CSSValuePaddingBox || val->id == CSSValueContentBox) {
diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h
index 3616aa5..f0a5b60 100644
--- a/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/WebCore/css/CSSPrimitiveValueMappings.h
@@ -378,6 +378,7 @@ template<> inline CSSPrimitiveValue::operator EFillBox() const
         case CSSValueContentBox:
             return ContentFillBox;
         case CSSValueText:
+        case CSSValueWebkitText:
             return TextFillBox;
         default:
             ASSERT_NOT_REACHED();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list