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

pfeldman at chromium.org pfeldman at chromium.org
Thu Oct 29 20:45:08 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 1cd066ec5456fc54192b8c3911a8816ac38a677e
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 15 09:40:59 2009 +0000

    2009-10-15  Yury Semikhatsky  <yurys at chromium.org>
    
            Reviewed by Dave Hyatt.
    
            Return correct shorthand property name for
            background-repeat-x, background-repeat-y, background-position-x,
            background-position-y, -webkit-mask-position-x, -webkit-mask-position-y,
            -webkit-mask-repeat-x, -webkit-mask-repeat-y.
    
            https://bugs.webkit.org/show_bug.cgi?id=28972
    
            Test: fast/backgrounds/repeat/background-repeat-shorthand.html
    WebCore
    
            * css/CSSParser.cpp:
            (WebCore::CSSParser::parseValue):
    
    LayoutTests:
            * fast/backgrounds/repeat/background-repeat-shorthand-expected.txt: Added.
            * fast/backgrounds/repeat/background-repeat-shorthand.html: Added.
            * fast/backgrounds/repeat/resources/background-repeat-shorthand.css: Added.
            * fast/backgrounds/repeat/resources/background-repeat-shorthand.js: Added.
            (getShorthand):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49616 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 73e1c26..b5ef943 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2009-10-15  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Dave Hyatt.
+
+        Test that shorthand name is not null for
+        background-repeat-x, background-repeat-y, background-position-x,
+        background-position-y, -webkit-mask-position-x, -webkit-mask-position-y,
+        -webkit-mask-repeat-x, -webkit-mask-repeat-y.
+
+        https://bugs.webkit.org/show_bug.cgi?id=28972
+
+        * fast/backgrounds/repeat/background-repeat-shorthand-expected.txt: Added.
+        * fast/backgrounds/repeat/background-repeat-shorthand.html: Added.
+        * fast/backgrounds/repeat/resources/background-repeat-shorthand.css: Added.
+        * fast/backgrounds/repeat/resources/background-repeat-shorthand.js: Added.
+        (getShorthand):
+
 2009-10-14  Joseph Pecoraro  <joepeck at webkit.org>
 
         Reviewed by Adam Barth.
diff --git a/LayoutTests/fast/backgrounds/repeat/background-repeat-shorthand-expected.txt b/LayoutTests/fast/backgrounds/repeat/background-repeat-shorthand-expected.txt
new file mode 100644
index 0000000..858b7db
--- /dev/null
+++ b/LayoutTests/fast/backgrounds/repeat/background-repeat-shorthand-expected.txt
@@ -0,0 +1,34 @@
+Tests that correct shorthand name is returned for background-repeat-x, background-repeat-y, background-position-x, background-position-y, -webkit-mask-repeat-x,-webkit-mask-repeat-y, -webkit-mask-position-x, -webkit-mask-position-y when corresponding shorthand is used in the style declaration. It tests regression described in this bug.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getShorthand("background-repeat-x", "icon1") is "background-repeat"
+PASS getShorthand("background-repeat-y", "icon1") is "background-repeat"
+PASS getShorthand("background-repeat", "icon1") is null
+PASS getShorthand("background-position-x", "icon1") is "background-position"
+PASS getShorthand("background-position-y", "icon1") is "background-position"
+PASS getShorthand("background-position", "icon1") is null
+PASS getShorthand("-webkit-mask-repeat-x", "icon1") is "-webkit-mask-repeat"
+PASS getShorthand("-webkit-mask-repeat-y", "icon1") is "-webkit-mask-repeat"
+PASS getShorthand("-webkit-mask-repeat", "icon1") is null
+PASS getShorthand("-webkit-mask-position-x", "icon1") is "-webkit-mask-position"
+PASS getShorthand("-webkit-mask-position-y", "icon1") is "-webkit-mask-position"
+PASS getShorthand("-webkit-mask-repeat", "icon1") is null
+Test that shorthand names are null for #icon2 since its styles are declared with longhand properties:
+PASS getShorthand("background-repeat-x", "icon2") is null
+PASS getShorthand("background-repeat-y", "icon2") is null
+PASS getShorthand("background-repeat", "icon2") is null
+PASS getShorthand("background-position-x", "icon2") is null
+PASS getShorthand("background-position-y", "icon2") is null
+PASS getShorthand("background-position", "icon2") is null
+PASS getShorthand("-webkit-mask-repeat-x", "icon2") is null
+PASS getShorthand("-webkit-mask-repeat-y", "icon2") is null
+PASS getShorthand("-webkit-mask-repeat", "icon2") is null
+PASS getShorthand("-webkit-mask-position-x", "icon2") is null
+PASS getShorthand("-webkit-mask-position-y", "icon2") is null
+PASS getShorthand("-webkit-mask-repeat", "icon2") is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/backgrounds/repeat/background-repeat-shorthand.html b/LayoutTests/fast/backgrounds/repeat/background-repeat-shorthand.html
new file mode 100644
index 0000000..94ee58f
--- /dev/null
+++ b/LayoutTests/fast/backgrounds/repeat/background-repeat-shorthand.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/background-repeat-shorthand.css">
+<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>
+<div id="icon1"></div>
+<div id="icon2"></div>
+<script src="resources/background-repeat-shorthand.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/backgrounds/repeat/resources/background-repeat-shorthand.css b/LayoutTests/fast/backgrounds/repeat/resources/background-repeat-shorthand.css
new file mode 100644
index 0000000..a5c34f1
--- /dev/null
+++ b/LayoutTests/fast/backgrounds/repeat/resources/background-repeat-shorthand.css
@@ -0,0 +1,15 @@
+#icon1 {
+    background-image: url(gradient.gif);
+    background-repeat: no-repeat;
+    background-position: 10px 20px;
+    -webkit-mask-repeat: repeat;
+    -webkit-mask-position: 0% 0%;
+}
+
+#icon2 {
+    background-image: url(gradient.gif);
+    background-repeat-x: no-repeat;
+    background-position-x: 10px;
+    -webkit-mask-repeat-x: repeat;
+    -webkit-mask-position-x: 0% 0%;
+}
diff --git a/LayoutTests/fast/backgrounds/repeat/resources/background-repeat-shorthand.js b/LayoutTests/fast/backgrounds/repeat/resources/background-repeat-shorthand.js
new file mode 100644
index 0000000..87594db
--- /dev/null
+++ b/LayoutTests/fast/backgrounds/repeat/resources/background-repeat-shorthand.js
@@ -0,0 +1,51 @@
+description('Tests that correct shorthand name is returned for background-repeat-x, ' +
+            'background-repeat-y, background-position-x, background-position-y, ' +
+            '-webkit-mask-repeat-x,-webkit-mask-repeat-y, -webkit-mask-position-x, ' +
+            '-webkit-mask-position-y when corresponding shorthand is used in the style ' +
+            'declaration. It tests regression described in ' +
+            '<a href="https://bugs.webkit.org/show_bug.cgi?id=28972">this bug</a>.');
+
+function getShorthand(longhand, iconId)
+{
+    var iconDiv = document.getElementById(iconId);
+    var rules = window.getMatchedCSSRules(iconDiv,'',false);
+    return rules[1].style.getPropertyShorthand(longhand);
+}
+
+shouldBe('getShorthand("background-repeat-x", "icon1")', '"background-repeat"');
+shouldBe('getShorthand("background-repeat-y", "icon1")', '"background-repeat"');
+shouldBe('getShorthand("background-repeat", "icon1")', 'null');
+
+shouldBe('getShorthand("background-position-x", "icon1")', '"background-position"');
+shouldBe('getShorthand("background-position-y", "icon1")', '"background-position"');
+shouldBe('getShorthand("background-position", "icon1")', 'null');
+
+shouldBe('getShorthand("-webkit-mask-repeat-x", "icon1")', '"-webkit-mask-repeat"');
+shouldBe('getShorthand("-webkit-mask-repeat-y", "icon1")', '"-webkit-mask-repeat"');
+shouldBe('getShorthand("-webkit-mask-repeat", "icon1")', 'null');
+
+shouldBe('getShorthand("-webkit-mask-position-x", "icon1")', '"-webkit-mask-position"');
+shouldBe('getShorthand("-webkit-mask-position-y", "icon1")', '"-webkit-mask-position"');
+shouldBe('getShorthand("-webkit-mask-repeat", "icon1")', 'null');
+
+
+debug('Test that shorthand names are null for #icon2 since its styles are declared ' +
+      'with longhand properties:');
+shouldBe('getShorthand("background-repeat-x", "icon2")', 'null');
+shouldBe('getShorthand("background-repeat-y", "icon2")', 'null');
+shouldBe('getShorthand("background-repeat", "icon2")', 'null');
+
+shouldBe('getShorthand("background-position-x", "icon2")', 'null');
+shouldBe('getShorthand("background-position-y", "icon2")', 'null');
+shouldBe('getShorthand("background-position", "icon2")', 'null');
+
+shouldBe('getShorthand("-webkit-mask-repeat-x", "icon2")', 'null');
+shouldBe('getShorthand("-webkit-mask-repeat-y", "icon2")', 'null');
+shouldBe('getShorthand("-webkit-mask-repeat", "icon2")', 'null');
+
+shouldBe('getShorthand("-webkit-mask-position-x", "icon2")', 'null');
+shouldBe('getShorthand("-webkit-mask-position-y", "icon2")', 'null');
+shouldBe('getShorthand("-webkit-mask-repeat", "icon2")', 'null');
+
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 367eff8..2ed54e5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2009-10-15  Yury Semikhatsky  <yurys at chromium.org>
+
+        Reviewed by Dave Hyatt.
+
+        Return correct shorthand property name for 
+        background-repeat-x, background-repeat-y, background-position-x,
+        background-position-y, -webkit-mask-position-x, -webkit-mask-position-y,
+        -webkit-mask-repeat-x, -webkit-mask-repeat-y.
+
+        https://bugs.webkit.org/show_bug.cgi?id=28972
+
+        Test: fast/backgrounds/repeat/background-repeat-shorthand.html
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+
 2009-10-14  Mikhail Naganov  <mnaganov at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index fd6cb4d..10949dd 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -893,6 +893,13 @@ bool CSSParser::parseValue(int propId, bool important)
         int propId1, propId2;
         bool result = false;
         if (parseFillProperty(propId, propId1, propId2, val1, val2)) {
+            OwnPtr<ShorthandScope> shorthandScope;
+            if (propId == CSSPropertyBackgroundPosition ||
+                propId == CSSPropertyBackgroundRepeat ||
+                propId == CSSPropertyWebkitMaskPosition ||
+                propId == CSSPropertyWebkitMaskRepeat) {
+                shorthandScope.set(new ShorthandScope(this, propId));
+            }
             addProperty(propId1, val1.release(), important);
             if (val2)
                 addProperty(propId2, val2.release(), important);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list