Commit f34db7c8 authored by darin's avatar darin

Reviewed by Dave.

	- fixed the crashing so the layout tests work

        * khtml/rendering/render_layer.h: Add a node pointer result.
        * khtml/rendering/render_layer.cpp: (RenderLayer::elementList):
	Return the node pointer so we can destroy it when done with it.

        * khtml/rendering/render_object.h: Make renderArena() const.
        * khtml/rendering/render_object.cpp: (RenderObject::renderArena): Make it const.

        * kwq/KWQRenderTreeDebug.cpp: (writeLayers): Free the Z layer list when done.
	Without this things just crashed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2684cf6a
2003-01-17 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed the crashing so the layout tests work
* khtml/rendering/render_layer.h: Add a node pointer result.
* khtml/rendering/render_layer.cpp: (RenderLayer::elementList):
Return the node pointer so we can destroy it when done with it.
* khtml/rendering/render_object.h: Make renderArena() const.
* khtml/rendering/render_object.cpp: (RenderObject::renderArena): Make it const.
* kwq/KWQRenderTreeDebug.cpp: (writeLayers): Free the Z layer list when done.
Without this things just crashed.
2003-01-17 Richard Williamson <rjw@apple.com>
Fixed 3126141. Allow pages with plugins to be cached. This is safe
......@@ -9,7 +25,6 @@
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::canCachePage):
=======
2003-01-17 David Hyatt <hyatt@apple.com>
The new table code from Lars. Also includes bug fixes for
......
2003-01-17 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed the crashing so the layout tests work
* khtml/rendering/render_layer.h: Add a node pointer result.
* khtml/rendering/render_layer.cpp: (RenderLayer::elementList):
Return the node pointer so we can destroy it when done with it.
* khtml/rendering/render_object.h: Make renderArena() const.
* khtml/rendering/render_object.cpp: (RenderObject::renderArena): Make it const.
* kwq/KWQRenderTreeDebug.cpp: (writeLayers): Free the Z layer list when done.
Without this things just crashed.
2003-01-17 Richard Williamson <rjw@apple.com>
Fixed 3126141. Allow pages with plugins to be cached. This is safe
......@@ -9,7 +25,6 @@
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::canCachePage):
=======
2003-01-17 David Hyatt <hyatt@apple.com>
The new table code from Lars. Also includes bug fixes for
......
......@@ -674,15 +674,14 @@ void RenderLayer::RenderZTreeNode::detach(RenderArena* renderArena)
renderArena->free(*(size_t *)this, this);
}
QPtrVector<RenderLayer::RenderLayerElement> RenderLayer::elementList()
QPtrVector<RenderLayer::RenderLayerElement> RenderLayer::elementList(RenderZTreeNode *&node)
{
QPtrVector<RenderLayerElement> list;
QRect damageRect(m_x, m_y, m_width, m_height);
RenderZTreeNode *node = constructZTree(damageRect, damageRect, this);
node = constructZTree(damageRect, damageRect, this);
if (node) {
constructLayerList(node, &list);
node->detach(renderer()->renderArena());
}
return list;
......
......@@ -233,7 +233,7 @@ public:
};
// For debugging.
QPtrVector<RenderLayerElement> elementList();
QPtrVector<RenderLayerElement> elementList(RenderZTreeNode *&node);
private:
// The constructZTree function creates a z-tree for a given layer hierarchy
......
......@@ -957,7 +957,8 @@ void RenderObject::removeFromSpecialObjects()
}
}
RenderArena* RenderObject::renderArena() {
RenderArena* RenderObject::renderArena() const
{
DOM::NodeImpl* elt = element();
RenderObject* current = parent();
while (!elt && current) {
......
......@@ -156,7 +156,7 @@ private:
void* operator new(size_t sz) throw();
public:
RenderArena* renderArena();
RenderArena* renderArena() const;
// some helper functions...
virtual bool childrenInline() const { return false; }
......
......@@ -41,6 +41,7 @@ using khtml::RenderTableCell;
using khtml::RenderWidget;
typedef khtml::RenderLayer::RenderLayerElement RenderLayerElement;
typedef khtml::RenderLayer::RenderZTreeNode RenderZTreeNode;
static void writeLayers(QTextStream &ts, const RenderObject &o, int indent = 0);
......@@ -132,10 +133,14 @@ static void write(QTextStream &ts, const RenderLayerElement &e, int indent = 0)
static void writeLayers(QTextStream &ts, const RenderObject &o, int indent)
{
QPtrVector<RenderLayerElement> list = o.layer()->elementList();
RenderZTreeNode *node;
QPtrVector<RenderLayerElement> list = o.layer()->elementList(node);
for (unsigned i = 0; i != list.count(); ++i) {
write(ts, *list[i], indent);
}
if (node) {
node->detach(o.renderArena());
}
}
QString externalRepresentation(const RenderObject *o)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment