Make sure "auto" is allowed as a valid value when parsing rect shapes (e.g., for...
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Mar 2004 22:34:46 +0000 (22:34 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Mar 2004 22:34:46 +0000 (22:34 +0000)
        Reviewed by rjw

        * khtml/css/cssparser.cpp:
        (CSSParser::parseShape):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@6275 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/fast/clip/016-expected.txt [new file with mode: 0644]
LayoutTests/fast/clip/016.html [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23
WebCore/khtml/css/cssparser.cpp

diff --git a/LayoutTests/fast/clip/016-expected.txt b/LayoutTests/fast/clip/016-expected.txt
new file mode 100644 (file)
index 0000000..bf5c975
--- /dev/null
@@ -0,0 +1,12 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x34
+  RenderBlock {HTML} at (0,0) size 800x34
+    RenderBody {BODY} at (8,8) size 784x18
+      RenderText {TEXT} at (0,0) size 300x18
+        text run at (0,0) width 137: "You should see a 100"
+        text run at (137,0) width 163: "x100 green square below."
+      RenderText {TEXT} at (0,0) size 0x0
+      RenderText {TEXT} at (0,0) size 0x0
+layer at (50,50) size 100x500 backgroundClip at (50,50) size 100x100 clip at (50,50) size 100x100
+  RenderBlock (positioned) {DIV} at (50,50) size 100x500 [bgcolor=#008000]
diff --git a/LayoutTests/fast/clip/016.html b/LayoutTests/fast/clip/016.html
new file mode 100644 (file)
index 0000000..ed7e4c4
--- /dev/null
@@ -0,0 +1,11 @@
+<html>
+<head>
+<style>
+  #clip {position:absolute; background-color: green; top:50px; left:50px; width:100px; height:500px; clip:rect(auto auto 100px auto)}
+</style>
+</head>
+<body>
+You should see a 100x100 green square below.
+<div id="clip"></div>
+</body>
+</html>
index 122336e4bb2254e7dea1088601ed130b664da47d..895c09133d76b59aa0665e2c39c82d0b0b12d791 100644 (file)
@@ -1,3 +1,12 @@
+2004-03-29  David Hyatt  <hyatt@apple.com>
+
+       Make sure "auto" is allowed as a valid value when parsing rect shapes (e.g., for the clip property).
+       
+        Reviewed by rjw
+
+        * khtml/css/cssparser.cpp:
+        (CSSParser::parseShape):
+
 2004-03-29  David Hyatt  <hyatt@apple.com>
 
        Followup fix.  Handle the case where a hard line break occurs right after a soft hyphen.  In this
index 460508889a946d45930bdb8eb74f3c068fe8065e..1daec8eafe2f4889560b211ba57513049f5ae761 100644 (file)
@@ -1409,10 +1409,11 @@ bool CSSParser::parseShape( int propId, bool important )
     int i = 0;
     Value *a = args->current();
     while ( a ) {
-       valid = validUnit( a, FLength, strict );
+       valid = a->id == CSS_VAL_AUTO || validUnit( a, FLength, strict );
        if ( !valid )
            break;
-       CSSPrimitiveValueImpl *length =
+       CSSPrimitiveValueImpl *length = a->id == CSS_VAL_AUTO ?
+            new CSSPrimitiveValueImpl(CSS_VAL_AUTO) :
            new CSSPrimitiveValueImpl( a->fValue, (CSSPrimitiveValue::UnitTypes) a->unit );
        if ( i == 0 )
            rect->setTop( length );