[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 07:31:32 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit eea8c4d34bc0282dd2ea0c15bb5ed61d392ecea3
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Mar 26 01:11:47 2003 +0000

    	Fix font-family parsing to match the spec (and other browsers).
    
    	This fixes bugs 3197584 and 3207760.
    
    	Also fix pseudos to be lower-cased.  Fixes 3208303.
    
            Reviewed by darin
    
            * khtml/css/css_valueimpl.h:
            * khtml/css/cssparser.cpp:
            (CSSParser::parseFontFamily):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3919 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index c3c2126..278ee16 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,17 @@
+2003-03-25  David Hyatt  <hyatt at apple.com>
+
+	Fix font-family parsing to match the spec (and other browsers).
+
+	This fixes bugs 3197584 and 3207760.
+
+	Also fix pseudos to be lower-cased.  Fixes 3208303.
+	
+        Reviewed by darin
+
+        * khtml/css/css_valueimpl.h:
+        * khtml/css/cssparser.cpp:
+        (CSSParser::parseFontFamily):
+
 2003-03-24  Trey Matteson  <trey at apple.com>
 
 	Pass -seg_addr_table_filename <FILENAME> to ld.  This makes our frameworks in
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c3c2126..278ee16 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2003-03-25  David Hyatt  <hyatt at apple.com>
+
+	Fix font-family parsing to match the spec (and other browsers).
+
+	This fixes bugs 3197584 and 3207760.
+
+	Also fix pseudos to be lower-cased.  Fixes 3208303.
+	
+        Reviewed by darin
+
+        * khtml/css/css_valueimpl.h:
+        * khtml/css/cssparser.cpp:
+        (CSSParser::parseFontFamily):
+
 2003-03-24  Trey Matteson  <trey at apple.com>
 
 	Pass -seg_addr_table_filename <FILENAME> to ld.  This makes our frameworks in
diff --git a/WebCore/khtml/css/css_base.cpp b/WebCore/khtml/css/css_base.cpp
index 895e252..fcfcc6e 100644
--- a/WebCore/khtml/css/css_base.cpp
+++ b/WebCore/khtml/css/css_base.cpp
@@ -165,6 +165,7 @@ void CSSSelector::extractPseudoType() const
         return;
     _pseudoType = PseudoOther;
     if (!value.isEmpty()) {
+        value = value.lower();
         switch (value[0]) {
             case 'a':
                 if (value == "active")
diff --git a/WebCore/khtml/css/css_valueimpl.h b/WebCore/khtml/css/css_valueimpl.h
index 6bbee20..c537f92 100644
--- a/WebCore/khtml/css/css_valueimpl.h
+++ b/WebCore/khtml/css/css_valueimpl.h
@@ -295,7 +295,7 @@ public:
     FontFamilyValueImpl( const QString &string);
     const QString &fontName() const { return parsedFontName; }
     int genericFamilyType() const { return _genericFamilyType; }
-protected:
+
     QString parsedFontName;
 private:
     int _genericFamilyType;
diff --git a/WebCore/khtml/css/cssparser.cpp b/WebCore/khtml/css/cssparser.cpp
index 62b292e..78433f4 100644
--- a/WebCore/khtml/css/cssparser.cpp
+++ b/WebCore/khtml/css/cssparser.cpp
@@ -1446,26 +1446,60 @@ CSSValueListImpl *CSSParser::parseFontFamily()
 //     kdDebug( 6080 ) << "CSSParser::parseFontFamily current=" << valueList->currentValue << endl;
     CSSValueListImpl *list = new CSSValueListImpl;
     Value *value = valueList->current();
+    FontFamilyValueImpl* currFamily = 0;
     while ( value ) {
 // 	kdDebug( 6080 ) << "got value " << value->id << " / "
 // 			<< (value->unit == CSSPrimitiveValue::CSS_STRING ||
 // 			    value->unit == CSSPrimitiveValue::CSS_IDENT ? qString( value->string ) : QString::null )
 // 			<< endl;
-	int id = value->id;
-	if ( id >= CSS_VAL_SERIF && id <= CSS_VAL__KONQ_BODY )
-	    list->append( new CSSPrimitiveValueImpl( id ) );
-	else if ( value->unit == CSSPrimitiveValue::CSS_STRING ||
-		  value->unit == CSSPrimitiveValue::CSS_IDENT )
-	    list->append( new FontFamilyValueImpl( qString( value->string ) ) );
+        Value* nextValue = valueList->next();
+        bool nextValBreaksFont = !nextValue ||
+                                 (nextValue->unit == Value::Operator && nextValue->iValue == ',');
+        bool nextValIsFontName = nextValue &&
+            ((nextValue->id >= CSS_VAL_SERIF && nextValue->id <= CSS_VAL__KONQ_BODY) ||
+            (nextValue->unit == CSSPrimitiveValue::CSS_STRING || nextValue->unit == CSSPrimitiveValue::CSS_IDENT));
+
+        if (value->id >= CSS_VAL_SERIF && value->id <= CSS_VAL__KONQ_BODY) {
+            if (currFamily) {
+                currFamily->parsedFontName += ' ';
+                currFamily->parsedFontName += qString(value->string);
+            }
+            else if (nextValBreaksFont || !nextValIsFontName)
+                list->append(new CSSPrimitiveValueImpl(value->id));
+            else
+                list->append(currFamily = new FontFamilyValueImpl(qString( value->string)));
+        }
+        else if (value->unit == CSSPrimitiveValue::CSS_STRING) {
+            // Strings never share in a family name.
+            currFamily = 0;
+            list->append(new FontFamilyValueImpl(qString( value->string)));
+        }
+        else if (value->unit == CSSPrimitiveValue::CSS_IDENT) {
+            if (currFamily) {
+                currFamily->parsedFontName += ' ';
+                currFamily->parsedFontName += qString(value->string);
+            }
+            else if (nextValBreaksFont || !nextValIsFontName)
+                list->append(new FontFamilyValueImpl(qString( value->string)));
+            else
+                list->append(currFamily = new FontFamilyValueImpl(qString(value->string)));
+        }
 	else {
 // 	    kdDebug( 6080 ) << "invalid family part" << endl;
 	    break;
 	}
-	value = valueList->next();
-	if ( !value || value->unit != Value::Operator || value->iValue != ',' ) {
-	    break;
-	}
-	value = valueList->next();
+	
+        if (!nextValue)
+            break;
+
+        if (nextValBreaksFont) {
+            value = valueList->next();
+            currFamily = 0;
+        }
+        else if (nextValIsFontName)
+            value = nextValue;
+        else
+            break;
     }
     if ( !list->length() ) {
 	delete list;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list