[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 08:39:02 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 13e37fce6f801e71e3d6d953d80bdf80decdcb0f
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue May 11 20:29:19 2004 +0000

    	Fix makeChildrenNonInline so that it does not wrap floats unless an inline is actually found.
    
            Fix block minmaxwidth to add together contiguous runs of floats.
    
    	Fix the content image loader to not destroy the image when removed from the document.
    
            Reviewed by darin
    
            * ChangeLog:
            * khtml/html/html_imageimpl.cpp:
            (HTMLImageLoader::~HTMLImageLoader):
            (HTMLImageElementImpl::detach):
            * khtml/html/html_imageimpl.h:
            (DOM::):
            * khtml/html/html_objectimpl.cpp:
            (HTMLObjectElementImpl::createRenderer):
            * khtml/html/html_objectimpl.h:
            * khtml/rendering/render_block.cpp:
            (khtml::getInlineRun):
            (khtml::RenderBlock::calcInlineMinMaxWidth):
            (khtml::RenderBlock::calcBlockMinMaxWidth):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6577 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 94d47d3..44637a7 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,41 @@
+2004-05-11  David Hyatt  <hyatt at apple.com>
+
+	Fix makeChildrenNonInline so that it does not wrap floats unless an inline is actually found.
+
+        Fix block minmaxwidth to add together contiguous runs of floats.
+
+	Fix the content image loader to not destroy the image when removed from the document.
+
+        Reviewed by darin
+	
+        * ChangeLog:
+        * khtml/html/html_imageimpl.cpp:
+        (HTMLImageLoader::~HTMLImageLoader):
+        (HTMLImageElementImpl::detach):
+        * khtml/html/html_imageimpl.h:
+        (DOM::):
+        * khtml/html/html_objectimpl.cpp:
+        (HTMLObjectElementImpl::createRenderer):
+        * khtml/html/html_objectimpl.h:
+        * khtml/rendering/render_block.cpp:
+        (khtml::getInlineRun):
+        (khtml::RenderBlock::calcInlineMinMaxWidth):
+        (khtml::RenderBlock::calcBlockMinMaxWidth):
+
+2004-05-06  David Hyatt  <hyatt at apple.com>
+
+	Fix makeChildrenNonInline so that it does not wrap floats unless an inline is actually found.
+
+	Fix block minmaxwidth to add together contiguous runs of floats.
+
+	Fix the content image loader to not destroy the image when removed from the document.
+	
+        Reviewed by darin
+
+        * khtml/rendering/render_block.cpp:
+        (khtml::getInlineRun):
+        (khtml::RenderBlock::calcBlockMinMaxWidth):
+
 2004-05-11  Vicki Murley  <vicki at apple.com>
 
         Reviewed by Vicki (fixed by Darin).
@@ -100,7 +138,6 @@
         building with a case sensitive file system. I could have changed this to "qcstring.h",
         but it seemed better to use the header's real name since we're inside KWQ here.
 
->>>>>>> 1.2754
 2004-05-07  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/khtml/html/html_imageimpl.cpp b/WebCore/khtml/html/html_imageimpl.cpp
index a7bfd43..6ff2711 100644
--- a/WebCore/khtml/html/html_imageimpl.cpp
+++ b/WebCore/khtml/html/html_imageimpl.cpp
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
  *           (C) 1999 Antti Koivisto (koivisto at kde.org)
- * Copyright (C) 2003 Apple Computer, Inc.
+ * Copyright (C) 2004 Apple Computer, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -59,6 +59,8 @@ HTMLImageLoader::~HTMLImageLoader()
 {
     if (m_image)
         m_image->deref(this);
+    if (m_element->getDocument())
+        m_element->getDocument()->removeImage(this);
 }
 
 void HTMLImageLoader::updateFromElement()
@@ -91,18 +93,6 @@ void HTMLImageLoader::updateFromElement()
     }
 }
 
-void HTMLImageLoader::removedFromDocument()
-{
-    if (m_image) {
-        m_image->deref(this);
-        m_image = 0;
-        m_element->getDocument()->removeImage(this);
-    }
-    
-    m_firedLoad = true;
-    m_imageComplete = true;
-}
-
 void HTMLImageLoader::dispatchLoadEvent()
 {
     if (!m_firedLoad) {
@@ -320,11 +310,6 @@ void HTMLImageElementImpl::detach()
     HTMLElementImpl::detach();
 }
 
-void HTMLImageElementImpl::removedFromDocument()
-{
-    m_imageLoader.removedFromDocument();
-}
-
 long HTMLImageElementImpl::width() const
 {
     if (!m_render) {
diff --git a/WebCore/khtml/html/html_imageimpl.h b/WebCore/khtml/html/html_imageimpl.h
index 654724b..753ffb4 100644
--- a/WebCore/khtml/html/html_imageimpl.h
+++ b/WebCore/khtml/html/html_imageimpl.h
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
  *           (C) 1999 Antti Koivisto (koivisto at kde.org)
+ * Copyright (C) 2004 Apple Computer, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -46,8 +47,7 @@ public:
     virtual ~HTMLImageLoader();
 
     void updateFromElement();
-    void removedFromDocument();
-    
+
     void dispatchLoadEvent();
 
     ElementImpl* element() const { return m_element; }
@@ -80,8 +80,7 @@ public:
     virtual void attach();
     virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
     virtual void detach();
-    virtual void removedFromDocument();
-    
+
     long width() const;
     long height() const;
 
diff --git a/WebCore/khtml/html/html_objectimpl.cpp b/WebCore/khtml/html/html_objectimpl.cpp
index 4c48f34..5ef77e7 100644
--- a/WebCore/khtml/html/html_objectimpl.cpp
+++ b/WebCore/khtml/html/html_objectimpl.cpp
@@ -4,7 +4,7 @@
  * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
  *           (C) 1999 Antti Koivisto (koivisto at kde.org)
  *           (C) 2000 Stefan Schimanski (1Stein at gmx.de)
- * Copyright (C) 2003 Apple Computer, Inc.
+ * Copyright (C) 2004 Apple Computer, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -450,11 +450,6 @@ RenderObject *HTMLObjectElementImpl::createRenderer(RenderArena *arena, RenderSt
     return new (arena) RenderPartObject(this);
 }
 
-void HTMLObjectElementImpl::removedFromDocument()
-{
-    m_imageLoader.removedFromDocument();
-}
-
 void HTMLObjectElementImpl::attach()
 {
     HTMLElementImpl::attach();
diff --git a/WebCore/khtml/html/html_objectimpl.h b/WebCore/khtml/html/html_objectimpl.h
index b6cf307..33fac92 100644
--- a/WebCore/khtml/html/html_objectimpl.h
+++ b/WebCore/khtml/html/html_objectimpl.h
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
  *           (C) 1999 Antti Koivisto (koivisto at kde.org)
+ * Copyright (C) 2004 Apple Computer, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -118,8 +119,6 @@ public:
     virtual khtml::RenderObject *createRenderer(RenderArena *, khtml::RenderStyle *);
     virtual void detach();
     
-    virtual void removedFromDocument();
-    
     virtual void recalcStyle( StyleChange ch );
 
     DocumentImpl* contentDocument() const;
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index c440613..780ffab 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -208,11 +208,19 @@ static void getInlineRun(RenderObject* start, RenderObject* stop,
 
     inlineRunStart = inlineRunEnd = curr;
 
+    bool sawInline = curr->isInline();
+    
     curr = curr->nextSibling();
     while (curr && (curr->isInline() || curr->isFloatingOrPositioned()) && (curr != stop)) {
         inlineRunEnd = curr;
+        if (curr->isInline())
+            sawInline = true;
         curr = curr->nextSibling();
     }
+    
+    // Need to really see an inline in order to do any work.
+    if (!sawInline)
+        inlineRunStart = inlineRunEnd = 0;
 }
 
 void RenderBlock::makeChildrenNonInline(RenderObject *insertionPoint)
@@ -2309,12 +2317,12 @@ void RenderBlock::calcInlineMinMaxWidth()
 
     InlineMinMaxIterator childIterator(this, this);
     bool addedTextIndent = false; // Only gets added in once.
+    RenderObject* prevFloat = 0;
     while (RenderObject* child = childIterator.next())
     {
         normal = child->style()->whiteSpace() == NORMAL;
 
-        if( !child->isBR() )
-        {
+        if (!child->isBR()) {
             // Step One: determine whether or not we need to go ahead and
             // terminate our current line.  Each discrete chunk can become
             // the new min-width, if it is the widest chunk seen so far, and
@@ -2392,6 +2400,18 @@ void RenderBlock::calcInlineMinMaxWidth()
                     inlineMin = 0;
                 }
 
+                // Check our "clear" setting.  If we're supposed to clear the previous float, then
+                // go ahead and terminate maxwidth as well.
+                if (child->isFloating()) {
+                    if (prevFloat &&
+                        ((prevFloat->style()->floating() == FLEFT && (child->style()->clear() & CLEFT)) ||
+                         (prevFloat->style()->floating() == FRIGHT && (child->style()->clear() & CRIGHT)))) {
+                        m_maxWidth = kMax(inlineMax, m_maxWidth);
+                        inlineMax = 0;
+                    }
+                    prevFloat = child;
+                }
+                
                 // Add in text-indent.  This is added in only once.
                 int ti = 0;
                 if (!addedTextIndent) {
@@ -2530,14 +2550,22 @@ void RenderBlock::calcBlockMinMaxWidth()
     bool nowrap = style()->whiteSpace() == NOWRAP;
 
     RenderObject *child = firstChild();
-    while(child != 0)
-    {
+    RenderObject* prevFloat = 0;
+    int floatWidths = 0;
+    while (child) {
         // Positioned children don't affect the min/max width
         if (child->isPositioned()) {
             child = child->nextSibling();
             continue;
         }
 
+        if (prevFloat && (!child->isFloating() || 
+                          (prevFloat->style()->floating() == FLEFT && (child->style()->clear() & CLEFT)) ||
+                          (prevFloat->style()->floating() == FRIGHT && (child->style()->clear() & CRIGHT)))) {
+            m_maxWidth = kMax(floatWidths, m_maxWidth);
+            floatWidths = 0;
+        }
+
         Length ml = child->style()->marginLeft();
         Length mr = child->style()->marginRight();
 
@@ -2567,14 +2595,17 @@ void RenderBlock::calcBlockMinMaxWidth()
         if (margin < 0) margin = 0;
 
         int w = child->minWidth() + margin;
-        if(m_minWidth < w) m_minWidth = w;
+        if (m_minWidth < w) m_minWidth = w;
         // IE ignores tables for calculation of nowrap. Makes some sense.
-        if ( nowrap && !child->isTable() && m_maxWidth < w )
+        if (nowrap && !child->isTable() && m_maxWidth < w)
             m_maxWidth = w;
 
         w = child->maxWidth() + margin;
 
-        if(m_maxWidth < w) m_maxWidth = w;
+        if (child->isFloating())
+            floatWidths += w;
+        else if (m_maxWidth < w)
+            m_maxWidth = w;
 
         // A very specific WinIE quirk.
         // Example:
@@ -2598,8 +2629,12 @@ void RenderBlock::calcBlockMinMaxWidth()
                 m_maxWidth = BLOCK_MAX_WIDTH;
         }
         
+        if (child->isFloating())
+            prevFloat = child;
         child = child->nextSibling();
     }
+    
+    m_maxWidth = kMax(floatWidths, m_maxWidth);
 }
 
 short RenderBlock::lineHeight(bool b, bool isRootLineBox) const

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list