[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.1/kdelibs/khtml/css
From: Maks Orlovich <maksim () kde ! org>
Date: 2008-08-06 23:10:37
Message-ID: 1218064237.032181.25407.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 843320 by orlovich:
Proper parsing and RenderStyle construction for clip:rect(.. auto ...).
RenderBox part still needs fixing, but lets get this into SVN so I don't
lose it.
CCBUG:166830
M +10 -5 cssparser.cpp
M +12 -4 cssstyleselector.cpp
--- branches/KDE/4.1/kdelibs/khtml/css/cssparser.cpp #843319:843320
@@ -1743,11 +1743,16 @@
int i = 0;
Value *a = args->current();
while ( a ) {
- valid = validUnit( a, FLength, strict );
- if ( !valid )
- break;
- CSSPrimitiveValueImpl *length =
- new CSSPrimitiveValueImpl( a->fValue, (CSSPrimitiveValue::UnitTypes) a->unit );
+ CSSPrimitiveValueImpl *length;
+ if ( a->id == CSS_VAL_AUTO ) {
+ length = new CSSPrimitiveValueImpl( CSS_VAL_AUTO );
+ } else {
+ valid = validUnit( a, FLength, strict );
+ if ( !valid )
+ break;
+ length = new CSSPrimitiveValueImpl( a->fValue, (CSSPrimitiveValue::UnitTypes) a->unit );
+ }
+
if ( i == 0 )
rect->setTop( length );
else if ( i == 1 )
--- branches/KDE/4.1/kdelibs/khtml/css/cssstyleselector.cpp #843319:843320
@@ -3322,10 +3322,18 @@
RectImpl *rect = primitiveValue->getRectValue();
if (rect) {
hasClip = true;
- top = convertToLength( rect->top(), style, logicalDpiY );
- right = convertToLength( rect->right(), style, logicalDpiY );
- bottom = convertToLength( rect->bottom(), style, logicalDpiY );
- left = convertToLength( rect->left(), style, logicalDpiY );
+ // As a convention, we pass in auto as Length(Variable). See RenderBox::clipRect
+ top = rect->top()->getIdent() == CSS_VAL_AUTO ? Length(Variable)
+ : convertToLength( rect->top(), style, logicalDpiY );
+
+ right = rect->right()->getIdent() == CSS_VAL_AUTO ? Length(Variable)
+ : convertToLength( rect->right(), style, logicalDpiY );
+
+ bottom = rect->bottom()->getIdent() == CSS_VAL_AUTO ? Length(Variable)
+ : convertToLength( rect->bottom(), style, logicalDpiY );
+
+ left = rect->left()->getIdent() == CSS_VAL_AUTO ? Length(Variable)
+ : convertToLength( rect->left(), style, logicalDpiY );
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic