[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:50:53 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c5334f1a6002c4558d1ae5f13fe9fa4d759b851c
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 8 22:26:08 2003 +0000

    	Fix for 3368672, don't allow frames and framesets to be positioned or relpositioned.
    
            Reviewed by darin
    
            * ChangeLog:
            * khtml/rendering/render_box.cpp:
            (RenderBox::setStyle):
            * khtml/rendering/render_object.cpp:
            (RenderObject::requiresLayer):
            * khtml/rendering/render_object.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4799 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 28c710c..782c454 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,48 @@
+2003-08-08  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3368672, don't allow frames and framesets to be positioned or relpositioned.
+	
+        Reviewed by darin
+
+        * ChangeLog:
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::setStyle):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::requiresLayer):
+        * khtml/rendering/render_object.h:
+
+2003-08-07  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3368463, assert/crash on libraries.uc.edu page.  A stylesheet was making 
+	a <p> a table-column, which is totally nonsensical.  Since this isn't supported in
+	WinIE, it just got ignored.  The fix I chose matches what Mozilla does, which is
+	to not allow table-column renderobjects to have children.
+
+	Fix for 3364412, FM pro file that happens to use a <col> element crashes.  Make sure
+	to patch bidiiterator to have a null check for this bizarre case.  Technically <col>
+	should never have been a table-column, since it's not in the HTML namespace, but
+	that fix will have to wait until we get @namespace support in CSS.
+	
+        Reviewed by john
+
+        * ChangeLog:
+	* khtml/rendering/bidi.cpp
+        * khtml/rendering/render_table.cpp:
+        (RenderTableCol::canHaveChildren):
+        * khtml/rendering/render_table.h:
+
+2003-08-05  Dave Hyatt  <hyatt at apple.com>
+
+	Fix for 3370654.  Make sure the max width computation for blocks with inline children actually
+	ignores non-pre text runs that consist entirely of whitespace.
+	
+        Reviewed by mjs
+
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_text.cpp:
+        (RenderText::trimmedMinMaxWidth):
+        * khtml/rendering/render_text.h:
+
 2003-08-08  John Sullivan  <sullivan at apple.com>
 
 	- fixed 3362481 -- REGRESSION (89-90): clicking in a field causes 
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 28c710c..782c454 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,48 @@
+2003-08-08  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3368672, don't allow frames and framesets to be positioned or relpositioned.
+	
+        Reviewed by darin
+
+        * ChangeLog:
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::setStyle):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::requiresLayer):
+        * khtml/rendering/render_object.h:
+
+2003-08-07  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3368463, assert/crash on libraries.uc.edu page.  A stylesheet was making 
+	a <p> a table-column, which is totally nonsensical.  Since this isn't supported in
+	WinIE, it just got ignored.  The fix I chose matches what Mozilla does, which is
+	to not allow table-column renderobjects to have children.
+
+	Fix for 3364412, FM pro file that happens to use a <col> element crashes.  Make sure
+	to patch bidiiterator to have a null check for this bizarre case.  Technically <col>
+	should never have been a table-column, since it's not in the HTML namespace, but
+	that fix will have to wait until we get @namespace support in CSS.
+	
+        Reviewed by john
+
+        * ChangeLog:
+	* khtml/rendering/bidi.cpp
+        * khtml/rendering/render_table.cpp:
+        (RenderTableCol::canHaveChildren):
+        * khtml/rendering/render_table.h:
+
+2003-08-05  Dave Hyatt  <hyatt at apple.com>
+
+	Fix for 3370654.  Make sure the max width computation for blocks with inline children actually
+	ignores non-pre text runs that consist entirely of whitespace.
+	
+        Reviewed by mjs
+
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_text.cpp:
+        (RenderText::trimmedMinMaxWidth):
+        * khtml/rendering/render_text.h:
+
 2003-08-08  John Sullivan  <sullivan at apple.com>
 
 	- fixed 3362481 -- REGRESSION (89-90): clicking in a field causes 
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index 88aae21..2d20f99 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -275,8 +275,8 @@ static RenderObject *first( RenderObject *par, bool skipInlines = true )
         else
             return o; // Never skip empty inlines.
     }
-        
-    if (!o->isText() && !o->isBR() && !o->isReplaced() && !o->isFloating() && !o->isPositioned())
+
+    if (o && !o->isText() && !o->isBR() && !o->isReplaced() && !o->isFloating() && !o->isPositioned())
         o = Bidinext( par, o, skipInlines );
     return o;
 }
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 1c6582d..1faaeb8 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -1959,6 +1959,22 @@ static int getBorderPaddingMargin(RenderObject* child, bool endOfInline)
     return result;
 }
 
+static void stripTrailingSpace(bool pre,
+                               int& inlineMax, int& inlineMin,
+                               RenderObject* trailingSpaceChild)
+{
+    if (!pre && trailingSpaceChild && trailingSpaceChild->isText()) {
+        // Collapse away the trailing space at the end of a block.
+        RenderText* t = static_cast<RenderText *>(trailingSpaceChild);
+        const Font *f = t->htmlFont( false );
+        QChar space[1]; space[0] = ' ';
+        int spaceWidth = f->width(space, 1, 0);
+        inlineMax -= spaceWidth;
+        if (inlineMin > inlineMax)
+            inlineMin = inlineMax;
+    }
+}
+
 void RenderBlock::calcInlineMinMaxWidth()
 {
     int inlineMax=0;
@@ -1975,7 +1991,6 @@ void RenderBlock::calcInlineMinMaxWidth()
     normal = oldnormal = style()->whiteSpace() == NORMAL;
 
     InlineMinMaxIterator childIterator(this, this);
-    RenderObject* prev = 0;
     bool addedTextIndent = false; // Only gets added in once.
     while (RenderObject* child = childIterator.next())
     {
@@ -2049,7 +2064,7 @@ void RenderBlock::calcInlineMinMaxWidth()
             }
 
             if (!child->isRenderInline() && !child->isText()) {
-                // Case (2). Inline replaced elements.
+                // Case (2). Inline replaced elements and floats.
                 // Go ahead and terminate the current line as far as
                 // minwidth is concerned.
                 childMin += child->minWidth();
@@ -2085,9 +2100,10 @@ void RenderBlock::calcInlineMinMaxWidth()
 
                 // We are no longer stripping whitespace at the start of
                 // a line.
-                if (!child->isFloating())
+                if (!child->isFloating()) {
                     stripFrontSpaces = false;
-                trailingSpaceChild = 0;
+                    trailingSpaceChild = 0;
+                }
             }
             else if (child->isText())
             {
@@ -2106,6 +2122,11 @@ void RenderBlock::calcInlineMinMaxWidth()
                 t->trimmedMinMaxWidth(beginMin, beginWS, endMin, endWS, hasBreakableChar,
                                       hasBreak, beginMax, endMax,
                                       childMin, childMax, stripFrontSpaces);
+
+                // This text object is insignificant and will not be rendered.  Just
+                // continue.
+                if (!hasBreak && childMax == 0) continue;
+                
                 if (stripFrontSpaces)
                     trailingSpaceChild = child;
                 else
@@ -2173,20 +2194,10 @@ void RenderBlock::calcInlineMinMaxWidth()
         }
 
         oldnormal = normal;
-        prev = child;
-    }
-
-    if (trailingSpaceChild && trailingSpaceChild->isText() && !m_pre) {
-        // Collapse away the trailing space at the end of a block.
-        RenderText* t = static_cast<RenderText *>(trailingSpaceChild);
-        const Font *f = t->htmlFont( false );
-        QChar space[1]; space[0] = ' ';
-        int spaceWidth = f->width(space, 1, 0);
-        inlineMax -= spaceWidth;
-        if (inlineMin > inlineMax)
-            inlineMin = inlineMax;
     }
 
+    stripTrailingSpace(m_pre, inlineMax, inlineMin, trailingSpaceChild);
+    
     if(m_minWidth < inlineMin) m_minWidth = inlineMin;
     if(m_maxWidth < inlineMax) m_maxWidth = inlineMax;
     //         kdDebug( 6040 ) << "m_minWidth=" << m_minWidth
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index a7ab9a0..b3686b5 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -95,6 +95,13 @@ void RenderBox::setStyle(RenderStyle *_style)
             workAroundBug3321716(2);
         }
     }
+
+    // Frames and framesets never honor position:relative or position:absolute.  This is necessary to
+    // fix a crash where a site tries to position these objects.
+    if (element() && (element()->id() == ID_FRAME || element()->id() == ID_FRAMESET)) {
+        setPositioned(false);
+        setRelPositioned(false);
+    }
     
     if (requiresLayer()) {
         if (!m_layer) {
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index dbc2270..ddd1324 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -316,6 +316,11 @@ RenderLayer* RenderObject::enclosingLayer()
     return 0;
 }
 
+bool RenderObject::requiresLayer()
+{
+    return isRoot() || isPositioned() || isRelPositioned() || style()->opacity() < 1.0f;
+}
+
 int RenderObject::offsetLeft() const
 {
     int x = xPos();
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index a11ebcf..cfa09e8 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -117,9 +117,7 @@ public:
     RenderLayer* findNextLayer(RenderLayer* parentLayer, RenderObject* startPoint,
                                bool checkParent=true);
     virtual void positionChildLayers() { }
-    virtual bool requiresLayer() {
-        return isRoot() || isPositioned() || isRelPositioned() || style()->opacity() < 1.0f;
-    }
+    virtual bool requiresLayer();
     
     virtual QRect getOverflowClipRect(int tx, int ty) { return QRect(0,0,0,0); }
     virtual QRect getClipRect(int tx, int ty) { return QRect(0,0,0,0); }
diff --git a/WebCore/khtml/rendering/render_table.cpp b/WebCore/khtml/rendering/render_table.cpp
index a146f07..4250c53 100644
--- a/WebCore/khtml/rendering/render_table.cpp
+++ b/WebCore/khtml/rendering/render_table.cpp
@@ -1657,6 +1657,13 @@ void RenderTableCol::updateFromElement()
       _span = ! ( style() && style()->display() == TABLE_COLUMN_GROUP );
 }
 
+bool RenderTableCol::canHaveChildren() const
+{
+    // cols cannot have children.  This is actually necessary to fix a bug
+    // with libraries.uc.edu, which makes a <p> be a table-column.
+    return style()->display() == TABLE_COLUMN_GROUP;
+}
+
 void RenderTableCol::addChild(RenderObject *child, RenderObject *beforeChild)
 {
 #ifdef DEBUG_LAYOUT
diff --git a/WebCore/khtml/rendering/render_table.h b/WebCore/khtml/rendering/render_table.h
index 6501a4c..b2d89e7 100644
--- a/WebCore/khtml/rendering/render_table.h
+++ b/WebCore/khtml/rendering/render_table.h
@@ -395,6 +395,8 @@ public:
 
     virtual void updateFromElement();
 
+    virtual bool canHaveChildren() const;
+    
 #ifndef NDEBUG
     virtual void dump(QTextStream *stream, QString ind = "") const;
 #endif
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index a11504c..6aa2720 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -888,26 +888,28 @@ void RenderText::trimmedMinMaxWidth(short& beginMinW, bool& beginWS,
                                     short& beginMaxW, short& endMaxW,
                                     short& minW, short& maxW, bool& stripFrontSpaces)
 {
-    int len = str->l;
     bool isPre = style()->whiteSpace() == PRE;
     if (isPre)
         stripFrontSpaces = false;
     
+    int len = str->l;
+    if (len == 0 || (stripFrontSpaces && str->containsOnlyWhitespace())) {
+        maxW = 0;
+        hasBreak = false;
+        return;
+    }
+    
     minW = m_minWidth;
     maxW = m_maxWidth;
     beginWS = stripFrontSpaces ? false : m_hasBeginWS;
-    // Handle the case where all space got stripped.
-    endWS = stripFrontSpaces && len > 0 && str->containsOnlyWhitespace() ? false : m_hasEndWS;
+    endWS = m_hasEndWS;
     
     beginMinW = m_beginMinWidth;
     endMinW = m_endMinWidth;
     
     hasBreakableChar = m_hasBreakableChar;
     hasBreak = m_hasBreak;
-    
-    if (len == 0)
-        return;
-        
+
     if (stripFrontSpaces && str->s[0].direction() == QChar::DirWS) {
         const Font *f = htmlFont( false );
         QChar space[1]; space[0] = ' ';
@@ -915,7 +917,7 @@ void RenderText::trimmedMinMaxWidth(short& beginMinW, bool& beginWS,
         maxW -= spaceWidth;
     }
     
-    stripFrontSpaces = !isPre && endWS;
+    stripFrontSpaces = !isPre && m_hasEndWS;
     
     if (style()->whiteSpace() == NOWRAP)
         minW = maxW;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list