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

antti at apple.com antti at apple.com
Wed Dec 22 15:57:13 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 619bcca46027d5e2062212554c1235c011990951
Author: antti at apple.com <antti at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 17 03:24:52 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=31223
    Make primitive values immutable.
    
    Patch by Antti Koivisto <koivisto at iki.fi> on 2010-11-16
    Reviewed by Adam Barth.
    
    Update test cases for behavior change and test computed style too. Note that there are some
    failures in the results demonstrating unrelated bugs in CSSPrimitiveValues.
    
    * fast/dom/script-tests/setPrimitiveValue-exceptions.js:
    (checkThrows):
    * fast/dom/setPrimitiveValue.html:
    * fast/dom/setPrimitiveValue-exceptions-expected.txt
    * fast/dom/setPrimitiveValue-expected.txt
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72166 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 862bc04..008060f 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-16  Antti Koivisto  <koivisto at iki.fi>
+
+        Reviewed by Adam Barth.
+
+        https://bugs.webkit.org/show_bug.cgi?id=31223
+        Make primitive values immutable.
+        
+        Update test cases for behavior change and test computed style too. Note that there are some
+        failures in the results demonstrating unrelated bugs in CSSPrimitiveValues.
+
+        * fast/dom/script-tests/setPrimitiveValue-exceptions.js:
+        (checkThrows):
+        * fast/dom/setPrimitiveValue.html:
+        * fast/dom/setPrimitiveValue-exceptions-expected.txt
+        * fast/dom/setPrimitiveValue-expected.txt
+
 2010-11-16  Mihai Parparita  <mihaip at chromium.org>
 
         Update the pixel expectations for fast/reflections, fast/replaced, fast/ruby, fast/runin, and fast/text for the Mac port.
diff --git a/LayoutTests/fast/dom/script-tests/setPrimitiveValue-exceptions.js b/LayoutTests/fast/dom/script-tests/setPrimitiveValue-exceptions.js
index f93aa9e..8884db2 100644
--- a/LayoutTests/fast/dom/script-tests/setPrimitiveValue-exceptions.js
+++ b/LayoutTests/fast/dom/script-tests/setPrimitiveValue-exceptions.js
@@ -1,52 +1,59 @@
-description("This test ensures that setting primitive values to an inappropriate unit type will throw an exception.");
+description("Test exceptions thrown by the CSSPrimitiveValue APIs. Primitive values are currently immutable (see https://bugs.webkit.org/show_bug.cgi?id=31223)");
 
 var element = document.createElement('div');
 element.id = "test-element"
 document.documentElement.appendChild(element);
 
 var styleElement = document.createElement('style');
-styleElement.innerText = "#test-element { left: 10px; font-family: Times; }";
+styleElement.innerText = "#test-element { position: absolute; left: 10px; font-family: Times; }";
 document.documentElement.appendChild(styleElement);
 
-var style = styleElement.sheet.cssRules[0].style;
-
-var left = style.getPropertyCSSValue("left");
-
-left.setFloatValue(CSSPrimitiveValue.CSS_NUMBER, 25);
-shouldBe("left.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "25");
-
-left.setFloatValue(CSSPrimitiveValue.CSS_DIMENSION, 25);
-shouldBe("left.getFloatValue(CSSPrimitiveValue.CSS_DIMENSION)", "25");
-
-// Work around <http://webkit.org/b/31223> / <rdar://problem/7374538>.
-left.setFloatValue(CSSPrimitiveValue.CSS_PX, 10);
-
-shouldThrow("left.setFloatValue(CSSPrimitiveValue.CSS_UNKNOWN, 25)");
-shouldThrow("left.setFloatValue(CSSPrimitiveValue.CSS_STRING, 25)");
-shouldThrow("left.getFloatValue(CSSPrimitiveValue.CSS_UNKNOWN)");
-shouldThrow("left.getFloatValue(CSSPrimitiveValue.CSS_STRING)");
+function checkThrows(style) {
+    left = style.getPropertyCSSValue("left");
+
+    shouldBe("left.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "10");
+    shouldBe("left.getFloatValue(CSSPrimitiveValue.CSS_DIMENSION)", "10");
+    shouldBe("left.getFloatValue(CSSPrimitiveValue.CSS_PX)", "10");
+
+    shouldThrow("left.setFloatValue(CSSPrimitiveValue.CSS_NUMBER, 25)");
+    shouldThrow("left.setFloatValue(CSSPrimitiveValue.CSS_DIMENSION, 25)");
+    shouldThrow("left.setFloatValue(CSSPrimitiveValue.CSS_PX, 25)");
+    shouldThrow("left.setFloatValue(CSSPrimitiveValue.CSS_UNKNOWN, 25)");
+    shouldThrow("left.setFloatValue(CSSPrimitiveValue.CSS_STRING, 25)");
+    shouldThrow("left.getFloatValue(CSSPrimitiveValue.CSS_UNKNOWN)");
+    shouldThrow("left.getFloatValue(CSSPrimitiveValue.CSS_STRING)");
+
+    shouldThrow("left.getStringValue()");
+    shouldThrow("left.getCounterValue()");
+    shouldThrow("left.getRectValue()");
+    shouldThrow("left.getRGBColorValue()");
+
+    shouldBe("left.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "10");
+    shouldBe("left.getFloatValue(CSSPrimitiveValue.CSS_DIMENSION)", "10");
+    shouldBe("left.getFloatValue(CSSPrimitiveValue.CSS_PX)", "10");
+
+    fontFamily = style.getPropertyCSSValue("font-family")[0];
+    
+    shouldBe("fontFamily.getStringValue()", '"Times"'); 
+
+    shouldThrow("fontFamily.setStringValue(CSSPrimitiveValue.CSS_STRING, 'Hi there!')");
+    shouldThrow("fontFamily.setStringValue(CSSPrimitiveValue.CSS_ATTR, \"G'day!\")");
+    shouldThrow("fontFamily.setStringValue(CSSPrimitiveValue.CSS_UNKNOWN, 'Hi there!')");
+    shouldThrow("fontFamily.setStringValue(CSSPrimitiveValue.CSS_DIMENSION, \"G'day!\")");
+    shouldThrow("fontFamily.setStringValue(CSSPrimitiveValue.CSS_COUNTER, 'Hello, world!')");
+
+    shouldThrow("fontFamily.getFloatValue()");
+    shouldThrow("fontFamily.getCounterValue()");
+    shouldThrow("fontFamily.getRectValue()");
+    shouldThrow("fontFamily.getRGBColorValue()");
+    
+    shouldBe("fontFamily.getStringValue()", '"Times"');
+}
 
-shouldThrow("left.getStringValue()");
-shouldThrow("left.getCounterValue()");
-shouldThrow("left.getRectValue()");
-shouldThrow("left.getRGBColorValue()");
-
-
-var fontFamily = style.getPropertyCSSValue("font-family")[0];
-
-fontFamily.setStringValue(CSSPrimitiveValue.CSS_STRING, "Hi there!");
-shouldBe("fontFamily.getStringValue()", '"Hi there!"');
-
-fontFamily.setStringValue(CSSPrimitiveValue.CSS_ATTR, "G'day!");
-shouldBe("fontFamily.getStringValue()", '"G\'day!"');
-
-shouldThrow("fontFamily.setStringValue(CSSPrimitiveValue.CSS_UNKNOWN, 'Hi there!')");
-shouldThrow("fontFamily.setStringValue(CSSPrimitiveValue.CSS_DIMENSION, \"G'day!\")");
-shouldThrow("fontFamily.setStringValue(CSSPrimitiveValue.CSS_COUNTER, 'Hello, world!')");
+var style = styleElement.sheet.cssRules[0].style;
+checkThrows(style);
 
-shouldThrow("fontFamily.getFloatValue()");
-shouldThrow("fontFamily.getCounterValue()");
-shouldThrow("fontFamily.getRectValue()");
-shouldThrow("fontFamily.getRGBColorValue()");
+var computedStyle = window.getComputedStyle(element, null);
+checkThrows(computedStyle);
 
 successfullyParsed = true;
diff --git a/LayoutTests/fast/dom/setPrimitiveValue-exceptions-expected.txt b/LayoutTests/fast/dom/setPrimitiveValue-exceptions-expected.txt
index 446f2e8..207e558 100644
--- a/LayoutTests/fast/dom/setPrimitiveValue-exceptions-expected.txt
+++ b/LayoutTests/fast/dom/setPrimitiveValue-exceptions-expected.txt
@@ -1,27 +1,64 @@
-This test ensures that setting primitive values to an inappropriate unit type will throw an exception.
+Test exceptions thrown by the CSSPrimitiveValue APIs. Primitive values are currently immutable (see https://bugs.webkit.org/show_bug.cgi?id=31223)
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS left.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 25
-PASS left.getFloatValue(CSSPrimitiveValue.CSS_DIMENSION) is 25
-PASS left.setFloatValue(CSSPrimitiveValue.CSS_UNKNOWN, 25) threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
-PASS left.setFloatValue(CSSPrimitiveValue.CSS_STRING, 25) threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 10
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_DIMENSION) is 10
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_PX) is 10
+PASS left.setFloatValue(CSSPrimitiveValue.CSS_NUMBER, 25) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS left.setFloatValue(CSSPrimitiveValue.CSS_DIMENSION, 25) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS left.setFloatValue(CSSPrimitiveValue.CSS_PX, 25) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS left.setFloatValue(CSSPrimitiveValue.CSS_UNKNOWN, 25) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS left.setFloatValue(CSSPrimitiveValue.CSS_STRING, 25) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
 PASS left.getFloatValue(CSSPrimitiveValue.CSS_UNKNOWN) threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
 PASS left.getFloatValue(CSSPrimitiveValue.CSS_STRING) threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
 PASS left.getStringValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
 PASS left.getCounterValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
 PASS left.getRectValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
 PASS left.getRGBColorValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
-PASS fontFamily.getStringValue() is "Hi there!"
-PASS fontFamily.getStringValue() is "G'day!"
-PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_UNKNOWN, 'Hi there!') threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
-PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_DIMENSION, "G'day!") threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
-PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_COUNTER, 'Hello, world!') threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 10
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_DIMENSION) is 10
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_PX) is 10
+FAIL fontFamily.getStringValue() should be Times. Was .
+PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_STRING, 'Hi there!') threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_ATTR, "G'day!") threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_UNKNOWN, 'Hi there!') threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_DIMENSION, "G'day!") threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_COUNTER, 'Hello, world!') threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
 PASS fontFamily.getFloatValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
 PASS fontFamily.getCounterValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
 PASS fontFamily.getRectValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
 PASS fontFamily.getRGBColorValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
+FAIL fontFamily.getStringValue() should be Times. Was .
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 10
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_DIMENSION) is 10
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_PX) is 10
+PASS left.setFloatValue(CSSPrimitiveValue.CSS_NUMBER, 25) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS left.setFloatValue(CSSPrimitiveValue.CSS_DIMENSION, 25) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS left.setFloatValue(CSSPrimitiveValue.CSS_PX, 25) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS left.setFloatValue(CSSPrimitiveValue.CSS_UNKNOWN, 25) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS left.setFloatValue(CSSPrimitiveValue.CSS_STRING, 25) threw exception Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7.
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_UNKNOWN) threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_STRING) threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
+PASS left.getStringValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
+PASS left.getCounterValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
+PASS left.getRectValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
+PASS left.getRGBColorValue() threw exception Error: INVALID_ACCESS_ERR: DOM Exception 15.
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 10
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_DIMENSION) is 10
+PASS left.getFloatValue(CSSPrimitiveValue.CSS_PX) is 10
+FAIL fontFamily.getStringValue() should be Times. Threw exception TypeError: 'undefined' is not an object (evaluating 'fontFamily.getStringValue')
+PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_STRING, 'Hi there!') threw exception TypeError: 'undefined' is not an object (evaluating 'fontFamily.setStringValue').
+PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_ATTR, "G'day!") threw exception TypeError: 'undefined' is not an object (evaluating 'fontFamily.setStringValue').
+PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_UNKNOWN, 'Hi there!') threw exception TypeError: 'undefined' is not an object (evaluating 'fontFamily.setStringValue').
+PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_DIMENSION, "G'day!") threw exception TypeError: 'undefined' is not an object (evaluating 'fontFamily.setStringValue').
+PASS fontFamily.setStringValue(CSSPrimitiveValue.CSS_COUNTER, 'Hello, world!') threw exception TypeError: 'undefined' is not an object (evaluating 'fontFamily.setStringValue').
+PASS fontFamily.getFloatValue() threw exception TypeError: 'undefined' is not an object (evaluating 'fontFamily.getFloatValue').
+PASS fontFamily.getCounterValue() threw exception TypeError: 'undefined' is not an object (evaluating 'fontFamily.getCounterValue').
+PASS fontFamily.getRectValue() threw exception TypeError: 'undefined' is not an object (evaluating 'fontFamily.getRectValue').
+PASS fontFamily.getRGBColorValue() threw exception TypeError: 'undefined' is not an object (evaluating 'fontFamily.getRGBColorValue').
+FAIL fontFamily.getStringValue() should be Times. Threw exception TypeError: 'undefined' is not an object (evaluating 'fontFamily.getStringValue')
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/dom/setPrimitiveValue.html b/LayoutTests/fast/dom/setPrimitiveValue.html
index 7bdbec0..c409605 100644
--- a/LayoutTests/fast/dom/setPrimitiveValue.html
+++ b/LayoutTests/fast/dom/setPrimitiveValue.html
@@ -5,45 +5,54 @@ div.test {
     position: absolute;
     left: 250px;
     top: 100px;
-    background-image: url(stars.gif);Ê
+    background-image: url(stars.gif);
 }
 </style>
 <script>
+
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
 function runTest() 
 {
-	var helloText = document.getElementById("hello");
-	var positionField = document.getElementById("style position"); 
-	var position = 50.0;
-	
-	var textRule = document.styleSheets[0].cssRules[0];
-	var s = textRule.style;
-	var leftValue = s.getPropertyCSSValue("left");
-	var bgImageValue = s.getPropertyCSSValue("background-image");
-	
-	try
-	{
-		leftValue.setFloatValue(leftValue.primitiveType, parseFloat(position));
-	}
-	catch (e)
-	{
-		alert("setFloatValue " + e.message);
-	}	
+    var helloText = document.getElementById("hello");
+    var positionField = document.getElementById("style position"); 
+    var position = 50.0;
+
+    var textRule = document.styleSheets[0].cssRules[0];
+    var s = textRule.style;
+    var leftValue = s.getPropertyCSSValue("left");
+    var bgImageValue = s.getPropertyCSSValue("background-image");
+    var console = document.getElementById("console");
+
+    try
+    {
+        leftValue.setFloatValue(leftValue.primitiveType, parseFloat(position));
+    }
+    catch (e)
+    {
+        var line = document.createElement("div");
+        line.innerText = "setFloatValue " + e.message;
+        console.appendChild(line);
+    }
 
-	try
-	{
-		bgImageValue.setStringValue(bgImageValue.primitiveType, "stripes.gif");
-	}
-	catch (e)
-	{
-		alert("setStringValue " + e.message);
-	}	
+    try
+    {
+        bgImageValue.setStringValue(bgImageValue.primitiveType, "stripes.gif");
+    }
+    catch (e)
+    {
+        var line = document.createElement("div");
+        line.innerText = "setStringValue " + e.message;
+        console.appendChild(line);
+    }
 }
 
 </script>
 </head>
 <body onload="runTest();">
-This test checks that a primitive CSS values can be set without generating an exception.
-<div class="test" id="hello">Hello world</div>
+Test CSSPrimitiveValue setters.
+<div class="test" id="hello"></div>
 <pre id="console"></pre>
 </body>
 </html>
diff --git a/LayoutTests/platform/mac/fast/dom/setPrimitiveValue-expected.txt b/LayoutTests/platform/mac/fast/dom/setPrimitiveValue-expected.txt
index 43df899..52560a6 100644
--- a/LayoutTests/platform/mac/fast/dom/setPrimitiveValue-expected.txt
+++ b/LayoutTests/platform/mac/fast/dom/setPrimitiveValue-expected.txt
@@ -1,14 +1,3 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x579
-      RenderBlock (anonymous) at (0,0) size 784x18
-        RenderText {#text} at (0,0) size 551x18
-          text run at (0,0) width 551: "This test checks that a primitive CSS values can be set without generating an exception."
-        RenderText {#text} at (0,0) size 0x0
-      RenderBlock {PRE} at (0,31) size 784x0
-layer at (250,100) size 76x18
-  RenderBlock (positioned) {DIV} at (250,100) size 76x18
-    RenderText {#text} at (0,0) size 76x18
-      text run at (0,0) width 76: "Hello world"
+Test CSSPrimitiveValue setters.
+setFloatValue NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7
+setStringValue NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list