[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

rwlbuis at webkit.org rwlbuis at webkit.org
Wed Dec 22 16:35:58 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 358232e51114f430b6a57553045e028bcca47cd3
Author: rwlbuis at webkit.org <rwlbuis at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Nov 27 09:15:13 2010 +0000

    2010-11-26  Rob Buis  <rwlbuis at gmail.com>
    
            Reviewed by Simon Fraser.
    
            Percentage z offset in transform-origin should make the property invalid
            https://bugs.webkit.org/show_bug.cgi?id=48704
    
            Discard transform-origin property when parsing invalid Z value.
    
            Test: fast/css/transform-origin-parsing.html
    
            * css/CSSParser.cpp:
            (WebCore::CSSParser::parseTransformOriginShorthand):
            (WebCore::CSSParser::parseTransformOrigin):
            * css/CSSParser.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72776 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7df4ef1..b9c1e5e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-26  Rob Buis  <rwlbuis at gmail.com>
+
+        Reviewed by Simon Fraser.
+
+        Add test for:
+        Percentage z offset in transform-origin should make the property invalid
+        https://bugs.webkit.org/show_bug.cgi?id=48704
+
+        * fast/css/script-tests/transform-origin-parsing.js: Added.
+        (test):
+        * fast/css/transform-origin-parsing-expected.txt: Added.
+        * fast/css/transform-origin-parsing.html: Added.
+
 2010-11-26  Ilya Tikhonovsky  <loislo at chromium.org>
 
         Unreviewed fix for chromium test expectations.
diff --git a/LayoutTests/fast/css/script-tests/transform-origin-parsing.js b/LayoutTests/fast/css/script-tests/transform-origin-parsing.js
new file mode 100644
index 0000000..770a386
--- /dev/null
+++ b/LayoutTests/fast/css/script-tests/transform-origin-parsing.js
@@ -0,0 +1,23 @@
+description("This tests checks parsing of the '-webkit-transform-origin' property \
+    and in particular that specifying invalid z values discards the property.");
+
+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("-webkit-transform-origin: 10% 10% 10%", "-webkit-transform-origin")', 'null');
+shouldBe('test("-webkit-transform-origin: 10% 10% 10px", "-webkit-transform-origin")', '"10% 10% 10px"');
+shouldBe('test("-webkit-transform-origin: 10px 10px 10%", "-webkit-transform-origin")', 'null');
+shouldBe('test("-webkit-transform-origin: 10px 10px 10px", "-webkit-transform-origin")', '"10px 10px 10px"');
+shouldBe('test("-webkit-transform-origin: left top 10%", "-webkit-transform-origin")', 'null');
+shouldBe('test("-webkit-transform-origin: left top 10px", "-webkit-transform-origin")', '"0% 0% 10px"');
+shouldBe('test("-webkit-transform-origin: left top left", "-webkit-transform-origin")', 'null');
+
+var successfullyParsed = true;
diff --git a/LayoutTests/fast/css/transform-origin-parsing-expected.txt b/LayoutTests/fast/css/transform-origin-parsing-expected.txt
new file mode 100644
index 0000000..5418c2b
--- /dev/null
+++ b/LayoutTests/fast/css/transform-origin-parsing-expected.txt
@@ -0,0 +1,16 @@
+This tests checks parsing of the '-webkit-transform-origin' property and in particular that specifying invalid z values discards the property.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS test("-webkit-transform-origin: 10% 10% 10%", "-webkit-transform-origin") is null
+PASS test("-webkit-transform-origin: 10% 10% 10px", "-webkit-transform-origin") is "10% 10% 10px"
+PASS test("-webkit-transform-origin: 10px 10px 10%", "-webkit-transform-origin") is null
+PASS test("-webkit-transform-origin: 10px 10px 10px", "-webkit-transform-origin") is "10px 10px 10px"
+PASS test("-webkit-transform-origin: left top 10%", "-webkit-transform-origin") is null
+PASS test("-webkit-transform-origin: left top 10px", "-webkit-transform-origin") is "0% 0% 10px"
+PASS test("-webkit-transform-origin: left top left", "-webkit-transform-origin") is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/transform-origin-parsing.html b/LayoutTests/fast/css/transform-origin-parsing.html
new file mode 100644
index 0000000..0abdad5
--- /dev/null
+++ b/LayoutTests/fast/css/transform-origin-parsing.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/transform-origin-parsing.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7bd9848..2cbef04 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-26  Rob Buis  <rwlbuis at gmail.com>
+
+        Reviewed by Simon Fraser.
+
+        Percentage z offset in transform-origin should make the property invalid
+        https://bugs.webkit.org/show_bug.cgi?id=48704
+
+        Discard transform-origin property when parsing invalid Z value.
+
+        Test: fast/css/transform-origin-parsing.html
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseTransformOriginShorthand):
+        (WebCore::CSSParser::parseTransformOrigin):
+        * css/CSSParser.h:
+
 2010-11-26  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Antti Koivisto.
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index 2622c5f..f7a5918 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -2846,16 +2846,21 @@ PassRefPtr<CSSValue> CSSParser::parseAnimationProperty()
     return 0;
 }
 
-void CSSParser::parseTransformOriginShorthand(RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2, RefPtr<CSSValue>& value3)
+bool CSSParser::parseTransformOriginShorthand(RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2, RefPtr<CSSValue>& value3)
 {
     parseFillPosition(value1, value2);
 
     // now get z
-    if (m_valueList->current() && validUnit(m_valueList->current(), FLength, m_strict))
-        value3 = CSSPrimitiveValue::create(m_valueList->current()->fValue,
-                                         (CSSPrimitiveValue::UnitTypes)m_valueList->current()->unit);
-    if (value3)
-        m_valueList->next();
+    if (m_valueList->current()) {
+        if (validUnit(m_valueList->current(), FLength, m_strict)) {
+            value3 = CSSPrimitiveValue::create(m_valueList->current()->fValue,
+                                             (CSSPrimitiveValue::UnitTypes)m_valueList->current()->unit);
+            m_valueList->next();
+            return true;
+        }
+        return false;
+    }
+    return true;
 }
 
 bool CSSParser::parseCubicBezierTimingFunctionValue(CSSParserValueList*& args, double& result)
@@ -5013,7 +5018,8 @@ bool CSSParser::parseTransformOrigin(int propId, int& propId1, int& propId2, int
 
     switch (propId) {
         case CSSPropertyWebkitTransformOrigin:
-            parseTransformOriginShorthand(value, value2, value3);
+            if (!parseTransformOriginShorthand(value, value2, value3))
+                return false;
             // parseTransformOriginShorthand advances the m_valueList pointer
             break;
         case CSSPropertyWebkitTransformOriginX: {
diff --git a/WebCore/css/CSSParser.h b/WebCore/css/CSSParser.h
index acf97f2..191249c 100644
--- a/WebCore/css/CSSParser.h
+++ b/WebCore/css/CSSParser.h
@@ -105,7 +105,7 @@ namespace WebCore {
         PassRefPtr<CSSValue> parseAnimationProperty();
         PassRefPtr<CSSValue> parseAnimationTimingFunction();
 
-        void parseTransformOriginShorthand(RefPtr<CSSValue>&, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
+        bool parseTransformOriginShorthand(RefPtr<CSSValue>&, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
         bool parseCubicBezierTimingFunctionValue(CSSParserValueList*& args, double& result);
         bool parseAnimationProperty(int propId, RefPtr<CSSValue>&);
         bool parseTransitionShorthand(bool important);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list