Fix for 3718697, crash clicking on JS tab at alaskaair.com.
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Jul 2004 21:40:43 +0000 (21:40 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Jul 2004 21:40:43 +0000 (21:40 +0000)
        Reviewed by kocienda

        * khtml/rendering/render_flow.cpp:
        (RenderFlow::detach):
        (RenderFlow::dirtyLinesFromChangedChild):
        * khtml/rendering/render_flow.h:
        * khtml/rendering/render_object.cpp:
        (RenderObject::dirtyLinesFromChangedChild):
        * khtml/rendering/render_object.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7052 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_flow.cpp
WebCore/khtml/rendering/render_flow.h
WebCore/khtml/rendering/render_object.cpp
WebCore/khtml/rendering/render_object.h

index 3b9cda3..96f100d 100644 (file)
@@ -1,3 +1,17 @@
+2004-07-19  David Hyatt  <hyatt@apple.com>
+
+       Fix for 3718697, crash clicking on JS tab at alaskaair.com.
+       
+        Reviewed by kocienda
+
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::detach):
+        (RenderFlow::dirtyLinesFromChangedChild):
+        * khtml/rendering/render_flow.h:
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::dirtyLinesFromChangedChild):
+        * khtml/rendering/render_object.h:
+
 2004-07-16  David Hyatt  <hyatt@apple.com>
 
        Fix for 3726471, need to ensure that it's safe to do updateRendering from within layout, since isContentEditable
index eee92be..ab6021a 100644 (file)
@@ -182,21 +182,27 @@ void RenderFlow::deleteLineBoxes()
 
 void RenderFlow::detach()
 {
-    if (!documentBeingDestroyed() && m_firstLineBox && m_firstLineBox->parent()) {
-        for (InlineRunBox* box = m_firstLineBox; box; box = box->nextLineBox())
-            box->parent()->removeChild(box);
+    if (!documentBeingDestroyed()) {
+        if (m_firstLineBox) {
+            if (m_firstLineBox->parent()) {
+                for (InlineRunBox* box = m_firstLineBox; box; box = box->nextLineBox())
+                    box->parent()->removeChild(box);
+            }
+        }
+        else if (isInline() && parent())
+            parent()->dirtyLinesFromChangedChild(this, false);
     }
 
     deleteLineBoxes();
     RenderBox::detach();
 }
 
-void RenderFlow::dirtyLinesFromChangedChild(RenderObject* child)
+void RenderFlow::dirtyLinesFromChangedChild(RenderObject* child, bool adding)
 {
     if (!parent() || selfNeedsLayout() || isTable())
         return;
     
-    if (!isInline() && (!child->nextSibling() || !firstLineBox())) {
+    if (adding && !isInline() && (!child->nextSibling() || !firstLineBox())) {
         // An append onto the end of a block or we don't have any lines anyway.  
         // In this case we don't have to dirty any specific lines.
         static_cast<RenderBlock*>(this)->setLinesAppended();
index 9bb6b26..7d0ec4b 100644 (file)
@@ -62,7 +62,7 @@ public:
     void deleteLineBoxes();
     virtual void detach();
 
-    virtual void dirtyLinesFromChangedChild(RenderObject* child);
+    virtual void dirtyLinesFromChangedChild(RenderObject* child, bool adding = true);
     
     virtual short lineHeight(bool firstLine, bool isRootLineBox=false) const;
     
index 66397f4..5396d49 100644 (file)
@@ -1288,7 +1288,7 @@ void RenderObject::computeAbsoluteRepaintRect(QRect& r, bool f)
         return parent()->computeAbsoluteRepaintRect(r, f);
 }
 
-void RenderObject::dirtyLinesFromChangedChild(RenderObject* child)
+void RenderObject::dirtyLinesFromChangedChild(RenderObject* child, bool adding)
 {
 }
 
index 925e263..6e71dc7 100644 (file)
@@ -488,7 +488,7 @@ public:
     
     virtual DOM::Position positionForCoordinates(int x, int y);
     
-    virtual void dirtyLinesFromChangedChild(RenderObject* child);
+    virtual void dirtyLinesFromChangedChild(RenderObject* child, bool adding = true);
     
     // set the style of the object.
     virtual void setStyle(RenderStyle *style);