[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:27:25 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 52a72d83c6167a6f67b9df72f9a68f2a53af8450
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Feb 23 23:33:52 2004 +0000
Fix for 3549772, hangs on border collapsing.
Reviewed by darin
* khtml/rendering/render_object.cpp:
(RenderObject::collectBorders):
* khtml/rendering/render_object.h:
* khtml/rendering/render_table.cpp:
(RenderTable::paint):
(compareBorders):
(RenderTableCell::paint):
(addBorderStyle):
(RenderTableCell::collectBorders):
* khtml/rendering/render_table.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 55def2b..3265fce 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,22 @@
2004-02-23 David Hyatt <hyatt at apple.com>
+ Fix for 3549772, hangs on border collapsing.
+
+ Reviewed by darin
+
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::collectBorders):
+ * khtml/rendering/render_object.h:
+ * khtml/rendering/render_table.cpp:
+ (RenderTable::paint):
+ (compareBorders):
+ (RenderTableCell::paint):
+ (addBorderStyle):
+ (RenderTableCell::collectBorders):
+ * khtml/rendering/render_table.h:
+
+2004-02-23 David Hyatt <hyatt at apple.com>
+
Fix for 3558717, make sure that form elements that are removed from a document also remove themselves
from the form.
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index c6c1b31..2cfac79 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -2116,7 +2116,7 @@ void RenderObject::updateWidgetPositions()
}
#endif
-void RenderObject::collectBorders(QPtrList<CollapsedBorderValue>& borderStyles)
+void RenderObject::collectBorders(QValueList<CollapsedBorderValue>& borderStyles)
{
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
curr->collectBorders(borderStyles);
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 83f291f..4c287cb 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -614,7 +614,7 @@ public:
virtual void setTable(RenderTable*) {};
// Used by collapsed border tables.
- virtual void collectBorders(QPtrList<CollapsedBorderValue>& borderStyles);
+ virtual void collectBorders(QValueList<CollapsedBorderValue>& borderStyles);
// Repaint the entire object. Called when, e.g., the color of a border changes, or when a border
// style changes.
diff --git a/WebCore/khtml/rendering/render_table.cpp b/WebCore/khtml/rendering/render_table.cpp
index 432c3bd..13df08b 100644
--- a/WebCore/khtml/rendering/render_table.cpp
+++ b/WebCore/khtml/rendering/render_table.cpp
@@ -442,18 +442,17 @@ void RenderTable::paint(PaintInfo& i, int _tx, int _ty)
if (child->isTableSection() || child == tCaption)
child->paint(paintInfo, _tx, _ty);
- if (collapseBorders() &&
- (paintAction == PaintActionElementBackground || paintAction == PaintActionChildBackground)
- && style()->visibility() == VISIBLE) {
+ if (collapseBorders() && paintAction == PaintActionChildBackground && style()->visibility() == VISIBLE) {
// Collect all the unique border styles that we want to paint in a sorted list. Once we
// have all the styles sorted, we then do individual passes, painting each style of border
// from lowest precedence to highest precedence.
- QPtrList<CollapsedBorderValue> borderStyles;
- borderStyles.setAutoDelete(true);
- collectBorders(borderStyles);
paintInfo.phase = PaintActionCollapsedTableBorders;
- for (uint i = 0; i < borderStyles.count(); i++) {
- m_currentBorder = borderStyles.at(i);
+ QValueList<CollapsedBorderValue> borderStyles;
+ collectBorders(borderStyles);
+ QValueListIterator<CollapsedBorderValue> it = borderStyles.begin();
+ QValueListIterator<CollapsedBorderValue> end = borderStyles.end();
+ for (; it != end; ++it) {
+ m_currentBorder = &(*it);
for (RenderObject* child = firstChild(); child; child = child->nextSibling())
if (child->isTableSection())
child->paint(paintInfo, _tx, _ty);
@@ -1756,8 +1755,8 @@ void RenderTableCell::setStyle( RenderStyle *style )
// (4) If border styles differ only in color, then a style set on a cell wins over one on a row,
// which wins over a row group, column, column group and, lastly, table. It is undefined which color
// is used when two elements of the same type disagree.
-static const CollapsedBorderValue compareBorders(const CollapsedBorderValue& border1,
- const CollapsedBorderValue& border2)
+static CollapsedBorderValue compareBorders(const CollapsedBorderValue& border1,
+ const CollapsedBorderValue& border2)
{
// Sanity check the values passed in. If either is null, return the other.
if (!border2.exists()) return border1;
@@ -2069,16 +2068,23 @@ void RenderTableCell::paint(PaintInfo& i, int _tx, int _ty)
#endif
_tx += m_x;
- _ty += m_y + _topExtra;
+ _ty += m_y;
// check if we need to do anything at all...
int os = 2*maximalOutlineSize(i.phase);
- if (!overhangingContents() && ((_ty - _topExtra >= i.r.y() + i.r.height() + os)
- || (_ty + m_height + _bottomExtra <= i.r.y() - os))) return;
- RenderBlock::paintObject(i, _tx, _ty);
+ if (!overhangingContents() && ((_ty >= i.r.y() + i.r.height() + os)
+ || (_ty + _topExtra + m_height + _bottomExtra <= i.r.y() - os))) return;
+
+ if (i.phase == PaintActionCollapsedTableBorders && style()->visibility() == VISIBLE) {
+ int w = width();
+ int h = height() + borderTopExtra() + borderBottomExtra();
+ paintCollapsedBorder(i.p, _tx, _ty, w, h);
+ }
+ else
+ RenderBlock::paintObject(i, _tx, _ty + _topExtra);
#ifdef BOX_DEBUG
- ::outlineBox( i.p, _tx, _ty - _topExtra, width(), height() + borderTopExtra() + borderBottomExtra());
+ ::outlineBox( i.p, _tx, _ty, width(), height() + borderTopExtra() + borderBottomExtra());
#endif
}
@@ -2141,31 +2147,25 @@ public:
int count;
};
-static void addBorderStyle(QPtrList<CollapsedBorderValue>& borderStyles, CollapsedBorderValue borderValue)
+static void addBorderStyle(QValueList<CollapsedBorderValue>& borderStyles, CollapsedBorderValue borderValue)
{
- if (!borderValue.exists())
+ if (!borderValue.exists() || borderStyles.contains(borderValue))
return;
- uint count = borderStyles.count();
- if (count == 0)
- borderStyles.append(new CollapsedBorderValue(borderValue));
- else {
- for (uint i = 0; i < count; i++) {
- CollapsedBorderValue* b = borderStyles.at(i);
- if (*b == borderValue)
- return;
- CollapsedBorderValue result = compareBorders(*b, borderValue);
- if (result == *b) {
- borderStyles.insert(i, new CollapsedBorderValue(borderValue));
- return;
- }
+ QValueListIterator<CollapsedBorderValue> it = borderStyles.begin();
+ QValueListIterator<CollapsedBorderValue> end = borderStyles.end();
+ for (; it != end; ++it) {
+ CollapsedBorderValue result = compareBorders(*it, borderValue);
+ if (result == *it) {
+ borderStyles.insert(it, borderValue);
+ return;
}
-
- borderStyles.append(new CollapsedBorderValue(borderValue));
}
+
+ borderStyles.append(borderValue);
}
-void RenderTableCell::collectBorders(QPtrList<CollapsedBorderValue>& borderStyles)
+void RenderTableCell::collectBorders(QValueList<CollapsedBorderValue>& borderStyles)
{
addBorderStyle(borderStyles, collapsedLeftBorder());
addBorderStyle(borderStyles, collapsedRightBorder());
diff --git a/WebCore/khtml/rendering/render_table.h b/WebCore/khtml/rendering/render_table.h
index 2273476..5ed4b08 100644
--- a/WebCore/khtml/rendering/render_table.h
+++ b/WebCore/khtml/rendering/render_table.h
@@ -29,7 +29,6 @@
#define RENDER_TABLE_H
#include <qcolor.h>
-#include <qptrvector.h>
#include "render_box.h"
#include "render_block.h"
@@ -350,7 +349,7 @@ public:
CollapsedBorderValue collapsedRightBorder() const;
CollapsedBorderValue collapsedTopBorder() const;
CollapsedBorderValue collapsedBottomBorder() const;
- virtual void collectBorders(QPtrList<CollapsedBorderValue>& borderStyles);
+ virtual void collectBorders(QValueList<CollapsedBorderValue>& borderStyles);
virtual void updateFromElement();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list