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

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


The following commit has been merged in the debian/unstable branch:
commit 3aaa7d9f757a091ea42157c4d57196832631c23e
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Dec 15 23:02:44 2002 +0000

            Reviewed by Dave.
    
    	- fixed ==/= typo in QFontMetrics that caused a part of my recent speedup to not take effect
    	- fixed 3128582 -- REGRESSION: Crash on planetquake.com
    
            * kwq/KWQFontMetrics.mm:
    	(QFontMetricsPrivate::setFont): Fix a horrifying "== instead of =" mistake.
            (QFontMetrics::ascent): Give an ERROR message, don't crash, when this is called on a
    	font metrics object that hasn't been updated to work for a particular font.
            (QFontMetrics::descent): Ditto.
            (QFontMetrics::lineSpacing): Ditto.
            (QFontMetrics::xHeight): Ditto.
            (QFontMetrics::width): Ditto.
            (QFontMetrics::floatWidth): Ditto.
            (QFontMetrics::floatCharacterWidths): Ditto.
    
            * khtml/html/html_inlineimpl.cpp: (HTMLBRElementImpl::attach):
    	Eliminated what was causing us to hit the above. BR elements need to respect display() == NONE.
    
    	- fixed the fix for operator==; needs to work even if the pseudo type was
    	  extracted already for one of the two, and not the other
    
            * khtml/css/cssparser.cpp:
            (CSSSelector::extractPseudoType): Only do work when the selector is Pseudo.
            (CSSSelector::operator==): Call pseudoType() instead of going right at _pseudoType.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3063 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 1a9a178..e91bed2 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,31 @@
+2002-12-15  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
+	- fixed ==/= typo in QFontMetrics that caused a part of my recent speedup to not take effect
+	- fixed 3128582 -- REGRESSION: Crash on planetquake.com
+
+        * kwq/KWQFontMetrics.mm:
+	(QFontMetricsPrivate::setFont): Fix a horrifying "== instead of =" mistake.
+        (QFontMetrics::ascent): Give an ERROR message, don't crash, when this is called on a
+	font metrics object that hasn't been updated to work for a particular font.
+        (QFontMetrics::descent): Ditto.
+        (QFontMetrics::lineSpacing): Ditto.
+        (QFontMetrics::xHeight): Ditto.
+        (QFontMetrics::width): Ditto.
+        (QFontMetrics::floatWidth): Ditto.
+        (QFontMetrics::floatCharacterWidths): Ditto.
+
+        * khtml/html/html_inlineimpl.cpp: (HTMLBRElementImpl::attach):
+	Eliminated what was causing us to hit the above. BR elements need to respect display() == NONE.
+
+	- fixed the fix for operator==; needs to work even if the pseudo type was
+	  extracted already for one of the two, and not the other
+
+        * khtml/css/cssparser.cpp:
+        (CSSSelector::extractPseudoType): Only do work when the selector is Pseudo.
+        (CSSSelector::operator==): Call pseudoType() instead of going right at _pseudoType.
+
 2002-12-15  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3128402, missing content on voodooextreme.  Don't allow
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 1a9a178..e91bed2 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,31 @@
+2002-12-15  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
+	- fixed ==/= typo in QFontMetrics that caused a part of my recent speedup to not take effect
+	- fixed 3128582 -- REGRESSION: Crash on planetquake.com
+
+        * kwq/KWQFontMetrics.mm:
+	(QFontMetricsPrivate::setFont): Fix a horrifying "== instead of =" mistake.
+        (QFontMetrics::ascent): Give an ERROR message, don't crash, when this is called on a
+	font metrics object that hasn't been updated to work for a particular font.
+        (QFontMetrics::descent): Ditto.
+        (QFontMetrics::lineSpacing): Ditto.
+        (QFontMetrics::xHeight): Ditto.
+        (QFontMetrics::width): Ditto.
+        (QFontMetrics::floatWidth): Ditto.
+        (QFontMetrics::floatCharacterWidths): Ditto.
+
+        * khtml/html/html_inlineimpl.cpp: (HTMLBRElementImpl::attach):
+	Eliminated what was causing us to hit the above. BR elements need to respect display() == NONE.
+
+	- fixed the fix for operator==; needs to work even if the pseudo type was
+	  extracted already for one of the two, and not the other
+
+        * khtml/css/cssparser.cpp:
+        (CSSSelector::extractPseudoType): Only do work when the selector is Pseudo.
+        (CSSSelector::operator==): Call pseudoType() instead of going right at _pseudoType.
+
 2002-12-15  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3128402, missing content on voodooextreme.  Don't allow
diff --git a/WebCore/khtml/css/cssparser.cpp b/WebCore/khtml/css/cssparser.cpp
index d083964..a0fc871 100644
--- a/WebCore/khtml/css/cssparser.cpp
+++ b/WebCore/khtml/css/cssparser.cpp
@@ -3072,6 +3072,8 @@ unsigned int CSSSelector::specificity()
 
 void CSSSelector::extractPseudoType() const
 {
+    if (match != Pseudo)
+        return;
     _pseudoType = PseudoOther;
     if (!value.isEmpty()) {
         switch (value[0]) {
@@ -3127,7 +3129,8 @@ bool CSSSelector::operator == ( const CSSSelector &other )
 	if ( sel1->tag != sel2->tag || sel1->attr != sel2->attr ||
 	     sel1->relation != sel2->relation || sel1->match != sel2->match ||
 	     sel1->nonCSSHint != sel2->nonCSSHint ||
-	     sel1->value != sel2->value || sel1->_pseudoType != sel2->_pseudoType)
+	     sel1->value != sel2->value ||
+             sel1->pseudoType() != sel2->pseudoType())
 	    return false;
 	sel1 = sel1->tagHistory;
 	sel2 = sel2->tagHistory;
diff --git a/WebCore/khtml/html/html_inlineimpl.cpp b/WebCore/khtml/html/html_inlineimpl.cpp
index 0910124..d1ff620 100644
--- a/WebCore/khtml/html/html_inlineimpl.cpp
+++ b/WebCore/khtml/html/html_inlineimpl.cpp
@@ -219,11 +219,16 @@ void HTMLBRElementImpl::attach()
     assert(!m_render);
     assert(parentNode());
 
-    if (parentNode()->renderer()) {
-        m_render = new (getDocument()->renderArena()) RenderBR(this);
-        m_render->setStyle(getDocument()->styleSelector()->styleForElement(this));
-        parentNode()->renderer()->addChild(m_render, nextRenderer());
+    RenderObject *parentRenderer = parentNode()->renderer();
+    if (parentRenderer) {
+        RenderStyle *style = getDocument()->styleSelector()->styleForElement(this);
+        if (style->display() != NONE) {
+            m_render = new (getDocument()->renderArena()) RenderBR(this);
+            m_render->setStyle(style);
+            parentRenderer->addChild(m_render, nextRenderer());
+        }
     }
+    
     NodeImpl::attach();
 }
 
diff --git a/WebCore/kwq/KWQFontMetrics.mm b/WebCore/kwq/KWQFontMetrics.mm
index 6f38dd9..7324a78 100644
--- a/WebCore/kwq/KWQFontMetrics.mm
+++ b/WebCore/kwq/KWQFontMetrics.mm
@@ -28,10 +28,11 @@
 #import <Cocoa/Cocoa.h>
 
 #import "KWQFont.h"
-#import "WebCoreTextRendererFactory.h"
-#import "WebCoreTextRenderer.h"
 #import "KWQLogging.h"
 
+#import "WebCoreTextRenderer.h"
+#import "WebCoreTextRendererFactory.h"
+
 struct QFontMetricsPrivate
 {
     QFontMetricsPrivate(const QFont &font)
@@ -56,7 +57,7 @@ struct QFontMetricsPrivate
         if (_font == font) {
             return;
         }
-        _font == font;
+        _font = font;
         [_renderer release];
         _renderer = nil;
     }
@@ -106,11 +107,21 @@ void QFontMetrics::setFont(const QFont &font)
 
 int QFontMetrics::ascent() const
 {
+    if (data.isNull()) {
+        ERROR("called ascent on an empty QFontMetrics");
+        return 0;
+    }
+    
     return [data->getRenderer() ascent];
 }
 
 int QFontMetrics::descent() const
 {
+    if (data.isNull()) {
+        ERROR("called descent on an empty QFontMetrics");
+        return 0;
+    }
+    
     return [data->getRenderer() descent];
 }
 
@@ -123,16 +134,29 @@ int QFontMetrics::height() const
 
 int QFontMetrics::lineSpacing() const
 {
+    if (data.isNull()) {
+        ERROR("called lineSpacing on an empty QFontMetrics");
+        return 0;
+    }
     return [data->getRenderer() lineSpacing];
 }
 
 float QFontMetrics::xHeight() const
 {
+    if (data.isNull()) {
+        ERROR("called xHeight on an empty QFontMetrics");
+        return 0;
+    }
     return [data->getRenderer() xHeight];
 }
 
 int QFontMetrics::width(QChar qc) const
 {
+    if (data.isNull()) {
+        ERROR("called width on an empty QFontMetrics");
+        return 0;
+    }
+    
     UniChar c = qc.unicode();
 
     CREATE_FAMILY_ARRAY(data->font(), families);
@@ -147,6 +171,11 @@ int QFontMetrics::charWidth(const QString &s, int pos) const
 
 int QFontMetrics::width(char c) const
 {
+    if (data.isNull()) {
+        ERROR("called width on an empty QFontMetrics");
+        return 0;
+    }
+    
     UniChar ch = (uchar) c;
 
     CREATE_FAMILY_ARRAY(data->font(), families);
@@ -156,6 +185,11 @@ int QFontMetrics::width(char c) const
 
 int QFontMetrics::width(const QString &qstring, int len) const
 {
+    if (data.isNull()) {
+        ERROR("called width on an empty QFontMetrics");
+        return 0;
+    }
+    
     CREATE_FAMILY_ARRAY(data->font(), families);
 
     return ROUND_TO_INT([data->getRenderer() floatWidthForCharacters:(const UniChar *)qstring.unicode() stringLength:len fromCharacterPosition:0 numberOfCharacters:len withPadding: 0 applyRounding:YES attemptFontSubstitution: YES widths: 0 letterSpacing:0 wordSpacing:0 fontFamilies: families]);
@@ -163,6 +197,11 @@ int QFontMetrics::width(const QString &qstring, int len) const
 
 int QFontMetrics::width(const QChar *uchars, int len) const
 {
+    if (data.isNull()) {
+        ERROR("called width on an empty QFontMetrics");
+        return 0;
+    }
+    
     CREATE_FAMILY_ARRAY(data->font(), families);
 
     return ROUND_TO_INT([data->getRenderer() floatWidthForCharacters:(const UniChar *)uchars stringLength:len fromCharacterPosition:0 numberOfCharacters:len withPadding: 0 applyRounding:YES attemptFontSubstitution: YES widths: 0 letterSpacing:0 wordSpacing:0 fontFamilies: families]);
@@ -170,6 +209,11 @@ int QFontMetrics::width(const QChar *uchars, int len) const
 
 float QFontMetrics::floatWidth(const QChar *uchars, int slen, int pos, int len, int letterSpacing, int wordSpacing) const
 {
+    if (data.isNull()) {
+        ERROR("called floatWidth on an empty QFontMetrics");
+        return 0;
+    }
+    
     CREATE_FAMILY_ARRAY(data->font(), families);
 
     return [data->getRenderer() floatWidthForCharacters:(const UniChar *)uchars stringLength:slen fromCharacterPosition:pos numberOfCharacters:len withPadding: 0 applyRounding: YES attemptFontSubstitution: YES widths: 0 letterSpacing:letterSpacing wordSpacing:wordSpacing fontFamilies: families];
@@ -177,6 +221,11 @@ float QFontMetrics::floatWidth(const QChar *uchars, int slen, int pos, int len,
 
 float QFontMetrics::floatCharacterWidths(const QChar *uchars, int slen, int pos, int len, int toAdd, float *buffer, int letterSpacing, int wordSpacing) const
 {
+    if (data.isNull()) {
+        ERROR("called floatCharacterWidths on an empty QFontMetrics");
+        return 0;
+    }
+    
     CREATE_FAMILY_ARRAY(data->font(), families);
     
     return [data->getRenderer() floatWidthForCharacters:(const UniChar *)uchars stringLength:slen fromCharacterPosition:pos numberOfCharacters:len withPadding: toAdd applyRounding: YES attemptFontSubstitution: YES widths: (float *)buffer letterSpacing:letterSpacing wordSpacing: wordSpacing fontFamilies: families];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list