[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:23:57 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 46de6900543f74417ecdd2018216426521c9610c
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 7 00:24:20 2003 +0000

            Reviewed by Dave.
    
            - fixed 3161953 -- crash in KWQListImpl, DOM::CSSStyleSheetImpl::isLoading on XML page
    
            The problem is that this page has some non-HTML elements, but the code was checking
            only the element ID, not whether it is HTML or not. Also fixed the page's layout.
    
            * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyleSelector):
            Check that the node is an HTML element before checking the ID in two places.
            Without this, we cast the pointer to the wrong type and trash memory.
    
            * khtml/rendering/render_root.cpp:
            (RenderRoot::layout): Set all the children false here, not just firstChild.
            (RenderRoot::docHeight): Take all the children's heights into account, not just firstChild.
            (RenderRoot::docWidth): Take all the children's widths into account, not just firstChild.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3588 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 621a847..7f574b2 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -2,6 +2,24 @@
 
         Reviewed by Dave.
 
+        - fixed 3161953 -- crash in KWQListImpl, DOM::CSSStyleSheetImpl::isLoading on XML page
+
+        The problem is that this page has some non-HTML elements, but the code was checking
+        only the element ID, not whether it is HTML or not. Also fixed the page's layout.
+
+        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyleSelector):
+        Check that the node is an HTML element before checking the ID in two places.
+        Without this, we cast the pointer to the wrong type and trash memory.
+
+        * khtml/rendering/render_root.cpp:
+        (RenderRoot::layout): Set all the children false here, not just firstChild.
+        (RenderRoot::docHeight): Take all the children's heights into account, not just firstChild.
+        (RenderRoot::docWidth): Take all the children's widths into account, not just firstChild.
+
+2003-02-06  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
         - fixed 3165295 -- Hang while triple clicking on page
 
         Flaws in the continuation logic we added to checkSelectionPoint made it take
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 621a847..7f574b2 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -2,6 +2,24 @@
 
         Reviewed by Dave.
 
+        - fixed 3161953 -- crash in KWQListImpl, DOM::CSSStyleSheetImpl::isLoading on XML page
+
+        The problem is that this page has some non-HTML elements, but the code was checking
+        only the element ID, not whether it is HTML or not. Also fixed the page's layout.
+
+        * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyleSelector):
+        Check that the node is an HTML element before checking the ID in two places.
+        Without this, we cast the pointer to the wrong type and trash memory.
+
+        * khtml/rendering/render_root.cpp:
+        (RenderRoot::layout): Set all the children false here, not just firstChild.
+        (RenderRoot::docHeight): Take all the children's heights into account, not just firstChild.
+        (RenderRoot::docWidth): Take all the children's widths into account, not just firstChild.
+
+2003-02-06  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
         - fixed 3165295 -- Hang while triple clicking on page
 
         Flaws in the continuation logic we added to checkSelectionPoint made it take
diff --git a/WebCore/khtml/rendering/render_root.cpp b/WebCore/khtml/rendering/render_root.cpp
index a9343e6..9c15e6b 100644
--- a/WebCore/khtml/rendering/render_root.cpp
+++ b/WebCore/khtml/rendering/render_root.cpp
@@ -125,8 +125,8 @@ void RenderRoot::layout()
     if (m_printingMode)
        m_minWidth = m_width;
 
-    if(firstChild())
-        firstChild()->setLayouted(false);
+    for (RenderObject *c = firstChild(); c; c = c->nextSibling())
+        c->setLayouted(false);
 
 #ifdef SPEED_DEBUG
     QTime qt;
@@ -598,15 +598,18 @@ int RenderRoot::docHeight() const
     else
         h = m_view->visibleHeight();
 
-    RenderObject *fc = firstChild();
-    if(fc) {
-        int dh = fc->height() + fc->marginTop() + fc->marginBottom();
-        int lowestPos = firstChild()->lowestPosition();
-        if( lowestPos > dh )
-            dh = lowestPos;
-        if( dh > h )
-            h = dh;
-    }
+    // FIXME: This doesn't do any margin collapsing.
+    // Instead of this dh computation we should keep the result
+    // when we call RenderBlock::layout.
+    int dh = 0;
+    for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
+        dh += c->height() + c->marginTop() + c->marginBottom();
+        int lowestPos = c->lowestPosition();
+        if( lowestPos > h )
+            h = lowestPos;
+    }
+    if( dh > h )
+        h = dh;
     return h;
 }
 
@@ -618,14 +621,13 @@ int RenderRoot::docWidth() const
     else
         w = m_view->visibleWidth();
 
-    RenderObject *fc = firstChild();
-    if(fc) {
-        int dw = fc->width() + fc->marginLeft() + fc->marginRight();
-        int rightmostPos = fc->rightmostPosition();
-        if( rightmostPos > dw )
-            dw = rightmostPos;
+    for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
+        int dw = c->width() + c->marginLeft() + c->marginRight();
         if( dw > w )
             w = dw;
+        int rightmostPos = c->rightmostPosition();
+        if( rightmostPos > w )
+            w = rightmostPos;
     }
     return w;
 }
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index 703d9a3..aaa58d7 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -1910,7 +1910,7 @@ void DocumentImpl::recalcStyleSelector()
             }
 
         }
-        else if (n->id() == ID_LINK || n->id() == ID_STYLE) {
+        else if (n->isHTMLElement() && (n->id() == ID_LINK || n->id() == ID_STYLE)) {
             ElementImpl *e = static_cast<ElementImpl *>(n);
             QString title = e->getAttribute( ATTR_TITLE ).string();
             bool enabledViaScript = false;
@@ -1954,7 +1954,7 @@ void DocumentImpl::recalcStyleSelector()
                     sheet = 0;
             }
         }
-        else if (n->id() == ID_BODY) {
+        else if (n->isHTMLElement() && n->id() == ID_BODY) {
                 // <BODY> element (doesn't contain styles as such but vlink="..." and friends
                 // are treated as style declarations)
             sheet = static_cast<HTMLBodyElementImpl*>(n)->sheet();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list