WebCore:
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Mar 2009 19:23:00 +0000 (19:23 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Mar 2009 19:23:00 +0000 (19:23 +0000)
2009-03-25  David Hyatt  <hyatt@apple.com>

        Reviewed by Simon Fraser.

        https://bugs.webkit.org/show_bug.cgi?id=24809, background-clip/origin don't use the correct
        values.  Add support for the new values (while preserving the old values for backwards
        compatibility).

        Changed some existing test cases to use the new values.

        * css/CSSParser.cpp:
        (WebCore::CSSParser::parseFillProperty):
        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator EFillBox):
        * css/CSSValueKeywords.in:

LayoutTests:

2009-03-25  David Hyatt  <hyatt@apple.com>

        Reviewed by Simon Fraser.

        Change a few test cases to use the new values just to verify that they work.

        https://bugs.webkit.org/show_bug.cgi?id=24809

        * fast/backgrounds/size/backgroundSize17.html:
        * fast/backgrounds/size/backgroundSize18.html:
        * fast/backgrounds/size/backgroundSize19.html:
        * fast/gradients/simple-gradients.html:

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

LayoutTests/ChangeLog
LayoutTests/fast/backgrounds/size/backgroundSize17.html
LayoutTests/fast/backgrounds/size/backgroundSize18.html
LayoutTests/fast/backgrounds/size/backgroundSize19.html
LayoutTests/fast/gradients/simple-gradients.html
WebCore/ChangeLog
WebCore/css/CSSParser.cpp
WebCore/css/CSSPrimitiveValueMappings.h
WebCore/css/CSSValueKeywords.in

index d852cd8..70cc5f1 100644 (file)
@@ -1,3 +1,16 @@
+2009-03-25  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Change a few test cases to use the new values just to verify that they work.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24809
+
+        * fast/backgrounds/size/backgroundSize17.html:
+        * fast/backgrounds/size/backgroundSize18.html:
+        * fast/backgrounds/size/backgroundSize19.html:
+        * fast/gradients/simple-gradients.html:
+
 2009-03-25  Brett Wilson  <brettw@dhcp-172-22-71-191.mtv.corp.google.com>
 
         Reviewed by Dimitri Glazkov.
index f0b6210..e43b8dd 100644 (file)
@@ -5,11 +5,11 @@
         padding: 10px;
         background: url('resources/flower.jpg');
         -webkit-background-size: 50% auto;
-        -webkit-background-origin: border;
+        -webkit-background-origin: border-box;
     }
 </style>
 </head>
 
 <body>
 <div style="width:500px; height:500px;"></div>
-</body>
\ No newline at end of file
+</body>
index 4281f7d..5197c9c 100644 (file)
@@ -6,11 +6,11 @@
         background: url('resources/flower.jpg');
         -webkit-background-size: 25% auto;
         background-position: center left;
-        -webkit-background-origin: padding;
+        -webkit-background-origin: padding-box;
     }
 </style>
 </head>
 
 <body>
 <div style="width:500px; height:500px;"></div>
-</body>
\ No newline at end of file
+</body>
index 4e43839..fd94bfc 100644 (file)
@@ -6,11 +6,11 @@
         background: url('resources/flower.jpg');
         -webkit-background-size: 100px auto;
         background-position: center;
-        -webkit-background-origin: content;
+        -webkit-background-origin: content-box;
     }
 </style>
 </head>
 
 <body>
 <div style="width:500px; height:500px;"></div>
-</body>
\ No newline at end of file
+</body>
index de3acfb..ecbf65a 100644 (file)
@@ -7,7 +7,7 @@
                        -webkit-gradient(radial, 0 150, 50, 0 140, 90, from(#f4f201), to(rgba(228, 199,0,0)), color-stop(80%, #e4c700)); }
 .linear { width:130px; height:130px; border:2px solid black; padding: 10px; 
            background: -webkit-gradient(linear, left top, left bottom, from(#00abeb), to(#fff), color-stop(0.5, #fff), color-stop(0.5, #66cc00));
-           -webkit-background-origin: padding; -webkit-background-clip: content; }
+           -webkit-background-origin: padding-box; -webkit-background-clip: content-box; }
 }
 </style>
 </head>
index e882897..815e6c6 100644 (file)
@@ -1,3 +1,20 @@
+2009-03-25  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24809, background-clip/origin don't use the correct
+        values.  Add support for the new values (while preserving the old values for backwards
+        compatibility).
+
+        Changed some existing test cases to use the new values.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseFillProperty):
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator EFillBox):
+        * css/CSSValueKeywords.in:
+
 2009-03-25  Brett Wilson  <brettw@dhcp-172-22-71-191.mtv.corp.google.com>
 
         Reviewed by Dimitri Glazkov.
index 4b9b37b..ff5a2ef 100644 (file)
@@ -2239,7 +2239,10 @@ bool CSSParser::parseFillProperty(int propId, int& propId1, int& propId2,
                 case CSSPropertyWebkitBackgroundOrigin:
                 case CSSPropertyWebkitMaskClip:
                 case CSSPropertyWebkitMaskOrigin:
-                    if (val->id == CSSValueBorder || val->id == CSSValuePadding || val->id == CSSValueContent || val->id == CSSValueText) {
+                    // The first three values here are deprecated and should not be allowed to apply when we drop the -webkit-
+                    // from the property names.
+                    if (val->id == CSSValueBorder || val->id == CSSValuePadding || val->id == CSSValueContent ||
+                        val->id == CSSValueBorderBox || val->id == CSSValuePaddingBox || val->id == CSSValueContentBox || val->id == CSSValueText) {
                         currValue = CSSPrimitiveValue::createIdentifier(val->id);
                         m_valueList->next();
                     }
index 15d6a0b..fd1d203 100644 (file)
@@ -297,13 +297,13 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFillBox e)
 {
     switch (e) {
         case BorderFillBox:
-            m_value.ident = CSSValueBorder;
+            m_value.ident = CSSValueBorderBox;
             break;
         case PaddingFillBox:
-            m_value.ident = CSSValuePadding;
+            m_value.ident = CSSValuePaddingBox;
             break;
         case ContentFillBox:
-            m_value.ident = CSSValueContent;
+            m_value.ident = CSSValueContentBox;
             break;
         case TextFillBox:
             m_value.ident = CSSValueText;
@@ -315,10 +315,13 @@ template<> inline CSSPrimitiveValue::operator EFillBox() const
 {
     switch (m_value.ident) {
         case CSSValueBorder:
+        case CSSValueBorderBox:
             return BorderFillBox;
         case CSSValuePadding:
+        case CSSValuePaddingBox:
             return PaddingFillBox;
         case CSSValueContent:
+        case CSSValueContentBox:
             return ContentFillBox;
         case CSSValueText:
             return TextFillBox;
index cc95361..698dffe 100644 (file)
@@ -537,9 +537,13 @@ round
 #
 # CSS_PROP_BACKGROUND_CLIP/ORIGIN
 #
+# border/content/padding are deprecated and ultimately will only apply to the -webkit- form of these properties.
+# border-box/content-box/padding-box should be used instead.
+#
 border
 content
 padding
+padding-box
 
 #
 # CSS_PROP_BOX_SIZING