[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:42:47 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 870bddae68795fba47b994ac089f7dfed0cd4977
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed May 21 23:37:33 2003 +0000

    	Fix for 3257990, attributes in HTML should always be case-insensitive
    	when matching CSS attribute selectors.  Instead of relying on
    	the strict mode check, I patched the code to use an isXMLDoc
    	bool instead.
    
    	Also fixing a problem where <pre>s are mistakenly justifying their
    	text when text-align: justify is set.
    
            Reviewed by kocienda
    
            * ChangeLog:
            * khtml/css/cssstyleselector.cpp:
            * khtml/css/cssstyleselector.h:
            * khtml/rendering/bidi.cpp:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4407 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 1d05d7b..1e9ad9e 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,20 @@
+2003-05-21  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3257990, attributes in HTML should always be case-insensitive
+	when matching CSS attribute selectors.  Instead of relying on 
+	the strict mode check, I patched the code to use an isXMLDoc
+	bool instead.
+
+	Also fixing a problem where <pre>s are mistakenly justifying their
+	text when text-align: justify is set.
+	
+        Reviewed by kocienda
+
+        * ChangeLog:
+        * khtml/css/cssstyleselector.cpp:
+        * khtml/css/cssstyleselector.h:
+        * khtml/rendering/bidi.cpp:
+
 2003-05-21  Vicki Murley  <vicki at apple.com>
 
         Reviewed by john 
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 1d05d7b..1e9ad9e 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2003-05-21  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3257990, attributes in HTML should always be case-insensitive
+	when matching CSS attribute selectors.  Instead of relying on 
+	the strict mode check, I patched the code to use an isXMLDoc
+	bool instead.
+
+	Also fixing a problem where <pre>s are mistakenly justifying their
+	text when text-align: justify is set.
+	
+        Reviewed by kocienda
+
+        * ChangeLog:
+        * khtml/css/cssstyleselector.cpp:
+        * khtml/css/cssstyleselector.h:
+        * khtml/rendering/bidi.cpp:
+
 2003-05-21  Vicki Murley  <vicki at apple.com>
 
         Reviewed by john 
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index fcbb766..282bd7d 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -335,6 +335,7 @@ RenderStyle *CSSStyleSelector::styleForElement(ElementImpl *e)
     parentNode = e->parentNode();
     parentStyle = ( parentNode && parentNode->renderer()) ? parentNode->renderer()->style() : 0;
     view = element->getDocument()->view();
+    isXMLDoc = !element->getDocument()->isHTMLDocument();
     part = view->part();
     settings = part->settings();
     paintDeviceMetrics = element->getDocument()->paintDeviceMetrics();
@@ -768,8 +769,8 @@ bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl
         {
         case CSSSelector::Exact:
         case CSSSelector::Id:
-	    if( (strictParsing && strcmp(sel->value, value) ) ||
-                (!strictParsing && strcasecmp(sel->value, value)))
+	    if( (isXMLDoc && strcmp(sel->value, value) ) ||
+                (!isXMLDoc && strcasecmp(sel->value, value)))
                 return false;
             break;
         case CSSSelector::Set:
@@ -781,8 +782,8 @@ bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl
                 // There is no list, just a single item.  We can avoid
                 // allocing QStrings and just treat this as an exact
                 // match check.
-                if( (strictParsing && strcmp(sel->value, value) ) ||
-                     (!strictParsing && strcasecmp(sel->value, value)))
+                if( (isXMLDoc && strcmp(sel->value, value) ) ||
+                     (!isXMLDoc && strcasecmp(sel->value, value)))
                     return false;
                 break;
             }
@@ -794,7 +795,7 @@ bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl
             
             QString str = value.string();
             QString selStr = sel->value.string();
-            int pos = str.find(selStr, 0, strictParsing);
+            int pos = str.find(selStr, 0, isXMLDoc);
             if(pos == -1) return false;
             if(pos && str[pos-1] != ' ') return false;
             pos += selStr.length();
@@ -806,7 +807,7 @@ bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl
             //kdDebug( 6080 ) << "checking for contains match" << endl;
             QString str = value.string();
             QString selStr = sel->value.string();
-            int pos = str.find(selStr, 0, strictParsing);
+            int pos = str.find(selStr, 0, isXMLDoc);
             if(pos == -1) return false;
             break;
         }
@@ -815,7 +816,7 @@ bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl
             //kdDebug( 6080 ) << "checking for beginswith match" << endl;
             QString str = value.string();
             QString selStr = sel->value.string();
-            int pos = str.find(selStr, 0, strictParsing);
+            int pos = str.find(selStr, 0, isXMLDoc);
             if(pos != 0) return false;
             break;
         }
@@ -824,8 +825,8 @@ bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl
             //kdDebug( 6080 ) << "checking for endswith match" << endl;
             QString str = value.string();
             QString selStr = sel->value.string();
-	    if (strictParsing && !str.endsWith(selStr)) return false;
-	    if (!strictParsing) {
+	    if (isXMLDoc && !str.endsWith(selStr)) return false;
+	    if (!isXMLDoc) {
 	        int pos = str.length() - selStr.length();
 		if (pos < 0 || pos != str.find(selStr, pos, false) )
 		    return false;
@@ -839,7 +840,7 @@ bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl
             QString selStr = sel->value.string();
             if(str.length() < selStr.length()) return false;
             // Check if str begins with selStr:
-            if(str.find(selStr, 0, strictParsing) != 0) return false;
+            if(str.find(selStr, 0, isXMLDoc) != 0) return false;
             // It does. Check for exact match or following '-':
             if(str.length() != selStr.length()
                 && str[selStr.length()] != '-') return false;
diff --git a/WebCore/khtml/css/cssstyleselector.h b/WebCore/khtml/css/cssstyleselector.h
index ad7b9e2..0ef6056 100644
--- a/WebCore/khtml/css/cssstyleselector.h
+++ b/WebCore/khtml/css/cssstyleselector.h
@@ -228,7 +228,8 @@ public:
 	QValueList<int>     m_fixedFontSizes;
 
 	bool fontDirty;
-	
+        bool isXMLDoc;
+        
 	void applyRule(int id, DOM::CSSValueImpl *value);
     };
 
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index 2b1b430..39f4555 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -676,11 +676,16 @@ void RenderBlock::computeHorizontalPositionsForLine(InlineFlowBox* lineBox, Bidi
                 for ( int i = r->start; i < r->stop; i++ )
                     if ( static_cast<RenderText *>(r->obj)->text()[i].direction() == QChar::DirWS )
                         spaces++;
+
                 KHTMLAssert(spaces <= numSpaces);
-                spaceAdd = (availableWidth - totWidth)*spaces/numSpaces;
+
+                // Only justify text with white-space: normal.
+                if (r->obj->style()->whiteSpace() != PRE) {
+                    spaceAdd = (availableWidth - totWidth)*spaces/numSpaces;
+                    static_cast<TextRun*>(r->box)->setSpaceAdd(spaceAdd);
+                    totWidth += spaceAdd;
+                }
                 numSpaces -= spaces;
-                totWidth += spaceAdd;
-                static_cast<TextRun*>(r->box)->setSpaceAdd(spaceAdd);
             }
         }
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list