[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:44:07 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c73b8476e1014c9750399b09449cc0b8f6abf02a
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jun 4 23:27:38 2004 +0000

    	Add support for auto values in flex transitions.  Add support for mapping the back end values to
    	front end values.  Next it's time to actually try to use this stuff in render_flexbox.
    
            Reviewed by darin
    
            * khtml/css/css_valueimpl.cpp:
            (length):
            * khtml/css/css_valueimpl.h:
            (DOM::FlexGroupTransitionValueImpl::isAuto):
            * khtml/css/cssparser.cpp:
            (FlexGroupTransitionParseContext::length):
            (FlexGroupTransitionParseContext::commitAutoValue):
            (FlexGroupTransitionParseContext::commitValue):
            (CSSParser::parseFlexGroupTransition):
            * khtml/css/cssstyleselector.cpp:
            (khtml::CSSStyleSelector::applyProperty):
            * khtml/rendering/render_style.cpp:
            (FlexGroupTransitionData::operator==):
            * khtml/rendering/render_style.h:
            (khtml::FlexGroupTransitionData::next):
            (khtml::FlexGroupTransitionData::isAuto):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6778 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 8bba597..8681242 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,27 @@
+2004-06-04  David Hyatt  <hyatt at apple.com>
+
+	Add support for auto values in flex transitions.  Add support for mapping the back end values to
+	front end values.  Next it's time to actually try to use this stuff in render_flexbox.
+	
+        Reviewed by darin
+
+        * khtml/css/css_valueimpl.cpp:
+        (length):
+        * khtml/css/css_valueimpl.h:
+        (DOM::FlexGroupTransitionValueImpl::isAuto):
+        * khtml/css/cssparser.cpp:
+        (FlexGroupTransitionParseContext::length):
+        (FlexGroupTransitionParseContext::commitAutoValue):
+        (FlexGroupTransitionParseContext::commitValue):
+        (CSSParser::parseFlexGroupTransition):
+        * khtml/css/cssstyleselector.cpp:
+        (khtml::CSSStyleSelector::applyProperty):
+        * khtml/rendering/render_style.cpp:
+        (FlexGroupTransitionData::operator==):
+        * khtml/rendering/render_style.h:
+        (khtml::FlexGroupTransitionData::next):
+        (khtml::FlexGroupTransitionData::isAuto):
+
 === Safari-143 ===
 
 2004-06-04  Kevin Decker  <kdecker at apple.com>
diff --git a/WebCore/khtml/css/css_valueimpl.cpp b/WebCore/khtml/css/css_valueimpl.cpp
index 6954430..a8ca4a2 100644
--- a/WebCore/khtml/css/css_valueimpl.cpp
+++ b/WebCore/khtml/css/css_valueimpl.cpp
@@ -1032,10 +1032,14 @@ DOMString ShadowValueImpl::cssText() const
 }
 
 // Used for box-flex-transition-group
+FlexGroupTransitionValueImpl::FlexGroupTransitionValueImpl()
+:autoValue(true), group1(0), group2(0), length(0)
+{}
+
 FlexGroupTransitionValueImpl::FlexGroupTransitionValueImpl(unsigned int _group1, 
                                                            unsigned int _group2,
                                                            CSSPrimitiveValueImpl* _length)
-:group1(_group1), group2(_group2), length(_length)
+:autoValue(false), group1(_group1), group2(_group2), length(_length)
 {}
 
 FlexGroupTransitionValueImpl::~FlexGroupTransitionValueImpl()
diff --git a/WebCore/khtml/css/css_valueimpl.h b/WebCore/khtml/css/css_valueimpl.h
index 6b9453e..129fa49 100644
--- a/WebCore/khtml/css/css_valueimpl.h
+++ b/WebCore/khtml/css/css_valueimpl.h
@@ -356,6 +356,7 @@ public:
 class FlexGroupTransitionValueImpl : public CSSValueImpl
 {
 public:
+    FlexGroupTransitionValueImpl();
     FlexGroupTransitionValueImpl(unsigned int _group1, 
                                  unsigned int _group2,
                                  CSSPrimitiveValueImpl* _length);
@@ -365,6 +366,9 @@ public:
     
     virtual DOM::DOMString cssText() const;
     
+    bool isAuto() const { return autoValue; }
+
+    bool autoValue;
     unsigned int group1;
     unsigned int group2;
     CSSPrimitiveValueImpl* length;
diff --git a/WebCore/khtml/css/cssparser.cpp b/WebCore/khtml/css/cssparser.cpp
index 08967ae..570030c 100644
--- a/WebCore/khtml/css/cssparser.cpp
+++ b/WebCore/khtml/css/cssparser.cpp
@@ -1935,7 +1935,7 @@ bool CSSParser::parseShadow(int propId, bool important)
 struct FlexGroupTransitionParseContext {
     FlexGroupTransitionParseContext()
     :values(0), allowGroup1(true), allowSlash(false), allowGroup2(false), allowLength(false),
-     allowBreak(true), group1(0), group2(0), length(0)
+     allowBreak(true),  autoValue(false), group1(0), group2(0), length(0)
     {}
     
     ~FlexGroupTransitionParseContext() {
@@ -1976,21 +1976,29 @@ struct FlexGroupTransitionParseContext {
         allowBreak = true;
     }
 
+    void commitAutoValue() {
+        autoValue = true;
+        allowSlash = allowGroup1 = allowGroup2 = allowLength = false;
+        allowBreak = true;
+    }
+
     void commitValue() {
         // Handle the ,, case gracefully by doing nothing.
-        if ((group1 || group2) && length) {
+        if (autoValue || ((group1 || group2) && length)) {
             if (!values)
                 values = new CSSValueListImpl();
             
             // Construct the current shadow value and add it to the list.
-            values->append(new FlexGroupTransitionValueImpl(group1, group2, length));
+            values->append(autoValue ? 
+                           new FlexGroupTransitionValueImpl() :
+                           new FlexGroupTransitionValueImpl(group1, group2, length));
         }
         
         // Now reset for the next shadow value.
         group1 = group2 = 0;
         length = 0;
         allowGroup1 = allowBreak = true;
-        allowSlash = allowGroup2 = allowLength = false;
+        allowSlash = allowGroup2 = allowLength = autoValue = false;
     }
     
     CSSValueListImpl* values;
@@ -1999,6 +2007,9 @@ struct FlexGroupTransitionParseContext {
     bool allowGroup2;
     bool allowLength;
     bool allowBreak;
+
+    // The current value data
+    bool autoValue;
     unsigned int group1;
     unsigned int group2;
     CSSPrimitiveValueImpl* length;
@@ -2025,6 +2036,13 @@ bool CSSParser::parseFlexGroupTransition(int propId, bool important)
             // The value is good.  Commit it.
             context.commitValue();
         }
+        // See if an auto value was specified
+        else if (val->id == CSS_VAL_AUTO) {
+            if (context.allowGroup1)
+                context.commitAutoValue();
+            else
+                return context.failed();
+        }
         // Check to see if we're a non-negative number.
         else if (validUnit(val, FInteger|FNonNeg, true)) {
             if (context.allowGroup())
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index 16248fa..4c59e8c 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -3421,6 +3421,39 @@ void CSSStyleSelector::applyProperty( int id, DOM::CSSValueImpl *value )
             return; // Error case.
         style->setBoxOrdinalGroup((unsigned int)(primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER)));
         return;
+    case CSS_PROP__KHTML_BOX_FLEX_GROUP_TRANSITION: {
+        if (isInherit) {
+            style->setBoxFlexGroupTransition(parentStyle->boxFlexGroupTransition() ? 
+                                             new FlexGroupTransitionData(*parentStyle->boxFlexGroupTransition()) : 0);
+            return;
+        }
+        else if (isInitial) {
+            style->setBoxFlexGroupTransition(0);
+            return;
+        }
+
+        if (!value->isValueList()) return;
+        CSSValueListImpl *list = static_cast<CSSValueListImpl *>(value);
+        int len = list->length();
+        for (int i = 0; i < len; i++) {
+            FlexGroupTransitionValueImpl *item = static_cast<FlexGroupTransitionValueImpl*>(list->item(i));
+            FlexGroupTransitionData* transitionData;
+            if (item->isAuto())
+                transitionData = new FlexGroupTransitionData();
+            else {
+                int type = item->length->primitiveType();
+                Length l;
+                if (type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)
+                    l = Length(primitiveValue->computeLength(style, paintDeviceMetrics), Fixed, false);
+                else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
+                    l = Length((int)primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
+                transitionData = new FlexGroupTransitionData(item->group1, item->group2, l);
+            }
+            style->setBoxFlexGroupTransition(transitionData, i != 0);
+        }
+            
+        return;
+    }
     case CSS_PROP__KHTML_MARQUEE:
         if (value->cssValueType() != CSSValue::CSS_INHERIT || !parentNode) return;
         style->setMarqueeDirection(parentStyle->marqueeDirection());
diff --git a/WebCore/khtml/rendering/render_style.cpp b/WebCore/khtml/rendering/render_style.cpp
index 467a0f5..deb2e6e 100644
--- a/WebCore/khtml/rendering/render_style.cpp
+++ b/WebCore/khtml/rendering/render_style.cpp
@@ -924,5 +924,5 @@ bool FlexGroupTransitionData::operator==(const FlexGroupTransitionData& o) const
         (next && o.next && *next != *o.next))
         return false;
     
-    return group1 == o.group1 && group2 == o.group2 && length == o.length;
+    return autoValue == o.autoValue && group1 == o.group1 && group2 == o.group2 && length == o.length;
 }
diff --git a/WebCore/khtml/rendering/render_style.h b/WebCore/khtml/rendering/render_style.h
index c38676d..94a2dce 100644
--- a/WebCore/khtml/rendering/render_style.h
+++ b/WebCore/khtml/rendering/render_style.h
@@ -453,8 +453,9 @@ public:
 
 // This struct holds information about flex group transitions for the box-flex-group-transition property.
 struct FlexGroupTransitionData {
+    FlexGroupTransitionData() :autoValue(true), group1(0), group2(0), next(0) {}
     FlexGroupTransitionData(unsigned int _group1, unsigned int _group2, Length _l)
-    :group1(_group1), group2(_group2), length(_l), next(0) {}
+    :autoValue(false), group1(_group1), group2(_group2), length(_l), next(0) {}
     FlexGroupTransitionData(const FlexGroupTransitionData& o);
     
     ~FlexGroupTransitionData() { delete next; }
@@ -464,6 +465,9 @@ struct FlexGroupTransitionData {
         return !(*this == o);
     }
     
+    bool isAuto() const { return autoValue; }
+    
+    bool autoValue;
     unsigned int group1;
     unsigned int group2;
     Length length;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list