[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:40:16 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 390427ade7b25dca3c0ef23296c1236bcab7f024
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat May 3 18:33:42 2003 +0000
Rename layouted to needsLayout. Add a layoutIfNeeded method
and start using it in places that do if (needsLayout()) layout();
Reviewed by kocienda
* khtml/ecma/kjs_dom.cpp:
(DOMNode::getValueProperty):
* khtml/html/html_baseimpl.cpp:
(HTMLFrameSetElementImpl::recalcStyle):
* khtml/html/html_documentimpl.cpp:
(HTMLDocumentImpl::close):
* khtml/html/html_imageimpl.cpp:
(HTMLImageElementImpl::width):
(HTMLImageElementImpl::height):
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::parseAttribute):
* khtml/khtmlview.cpp:
(KHTMLView::layout):
(KHTMLView::print):
(KHTMLView::timerEvent):
* khtml/rendering/bidi.cpp:
* khtml/rendering/render_applet.cpp:
(RenderApplet::layout):
(RenderEmptyApplet::layout):
* khtml/rendering/render_block.cpp:
* khtml/rendering/render_box.cpp:
(RenderBox::close):
* khtml/rendering/render_container.cpp:
(RenderContainer::addChild):
(RenderContainer::removeChildNode):
(RenderContainer::removeChild):
(RenderContainer::appendChildNode):
(RenderContainer::insertChildNode):
(RenderContainer::layout):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_form.cpp:
(RenderFormElement::layout):
(RenderSubmitButton::updateFromElement):
(RenderSelect::updateFromElement):
(RenderSelect::calcMinMaxWidth):
(RenderSelect::layout):
* khtml/rendering/render_frames.cpp:
(RenderFrameSet::layout):
(RenderFrameSet::positionFrames):
(RenderFrameSet::userResize):
(RenderFrameSet::canResize):
(RenderPart::setWidget):
(RenderPartObject::updateWidget):
(RenderPartObject::layout):
* khtml/rendering/render_image.cpp:
(RenderImage::setPixmap):
(RenderImage::layout):
* khtml/rendering/render_inline.cpp:
(RenderInline::addChildToFlow):
(RenderInline::splitInlines):
(RenderInline::splitFlow):
* khtml/rendering/render_layer.cpp:
(RenderLayer::checkScrollbarsAfterLayout):
* khtml/rendering/render_list.cpp:
(RenderListItem::layout):
(RenderListMarker::setStyle):
(RenderListMarker::layout):
(RenderListMarker::setPixmap):
* khtml/rendering/render_object.cpp:
(RenderObject::RenderObject):
(RenderObject::setNeedsLayout):
(RenderObject::information):
(RenderObject::dump):
(RenderObject::setStyle):
(RenderObject::invalidateLayout):
(RenderObject::detach):
* khtml/rendering/render_object.h:
* khtml/rendering/render_replaced.cpp:
(RenderReplaced::paint):
(RenderWidget::setQWidget):
(RenderWidget::layout):
* khtml/rendering/render_root.cpp:
* khtml/rendering/render_table.cpp:
(RenderTable::addChild):
(RenderTable::layout):
(RenderTable::paint):
(RenderTable::close):
(RenderTable::splitColumn):
(RenderTable::appendColumn):
(RenderTable::recalcSections):
(RenderTableSection::addChild):
(RenderTableSection::setCellWidths):
(RenderTableSection::layoutRows):
(RenderTableSection::recalcCells):
(RenderTableRow::addChild):
(RenderTableRow::layout):
(RenderTableCell::paint):
* khtml/rendering/render_text.cpp:
(RenderText::setText):
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::recalcStyle):
(DocumentImpl::updateStyleSelector):
* khtml/xml/dom_nodeimpl.cpp:
(NodeBaseImpl::insertBefore):
(NodeBaseImpl::replaceChild):
(NodeBaseImpl::appendChild):
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::forceLayoutForPageWidth):
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge needsLayout]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index f981acb..e9c3530 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,111 @@
+2003-05-03 David Hyatt <hyatt at apple.com>
+
+ Rename layouted to needsLayout. Add a layoutIfNeeded method
+ and start using it in places that do if (needsLayout()) layout();
+
+ Reviewed by kocienda
+
+ * khtml/ecma/kjs_dom.cpp:
+ (DOMNode::getValueProperty):
+ * khtml/html/html_baseimpl.cpp:
+ (HTMLFrameSetElementImpl::recalcStyle):
+ * khtml/html/html_documentimpl.cpp:
+ (HTMLDocumentImpl::close):
+ * khtml/html/html_imageimpl.cpp:
+ (HTMLImageElementImpl::width):
+ (HTMLImageElementImpl::height):
+ * khtml/html/html_tableimpl.cpp:
+ (HTMLTableElementImpl::parseAttribute):
+ * khtml/khtmlview.cpp:
+ (KHTMLView::layout):
+ (KHTMLView::print):
+ (KHTMLView::timerEvent):
+ * khtml/rendering/bidi.cpp:
+ * khtml/rendering/render_applet.cpp:
+ (RenderApplet::layout):
+ (RenderEmptyApplet::layout):
+ * khtml/rendering/render_block.cpp:
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::close):
+ * khtml/rendering/render_container.cpp:
+ (RenderContainer::addChild):
+ (RenderContainer::removeChildNode):
+ (RenderContainer::removeChild):
+ (RenderContainer::appendChildNode):
+ (RenderContainer::insertChildNode):
+ (RenderContainer::layout):
+ * khtml/rendering/render_flow.h:
+ * khtml/rendering/render_form.cpp:
+ (RenderFormElement::layout):
+ (RenderSubmitButton::updateFromElement):
+ (RenderSelect::updateFromElement):
+ (RenderSelect::calcMinMaxWidth):
+ (RenderSelect::layout):
+ * khtml/rendering/render_frames.cpp:
+ (RenderFrameSet::layout):
+ (RenderFrameSet::positionFrames):
+ (RenderFrameSet::userResize):
+ (RenderFrameSet::canResize):
+ (RenderPart::setWidget):
+ (RenderPartObject::updateWidget):
+ (RenderPartObject::layout):
+ * khtml/rendering/render_image.cpp:
+ (RenderImage::setPixmap):
+ (RenderImage::layout):
+ * khtml/rendering/render_inline.cpp:
+ (RenderInline::addChildToFlow):
+ (RenderInline::splitInlines):
+ (RenderInline::splitFlow):
+ * khtml/rendering/render_layer.cpp:
+ (RenderLayer::checkScrollbarsAfterLayout):
+ * khtml/rendering/render_list.cpp:
+ (RenderListItem::layout):
+ (RenderListMarker::setStyle):
+ (RenderListMarker::layout):
+ (RenderListMarker::setPixmap):
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::RenderObject):
+ (RenderObject::setNeedsLayout):
+ (RenderObject::information):
+ (RenderObject::dump):
+ (RenderObject::setStyle):
+ (RenderObject::invalidateLayout):
+ (RenderObject::detach):
+ * khtml/rendering/render_object.h:
+ * khtml/rendering/render_replaced.cpp:
+ (RenderReplaced::paint):
+ (RenderWidget::setQWidget):
+ (RenderWidget::layout):
+ * khtml/rendering/render_root.cpp:
+ * khtml/rendering/render_table.cpp:
+ (RenderTable::addChild):
+ (RenderTable::layout):
+ (RenderTable::paint):
+ (RenderTable::close):
+ (RenderTable::splitColumn):
+ (RenderTable::appendColumn):
+ (RenderTable::recalcSections):
+ (RenderTableSection::addChild):
+ (RenderTableSection::setCellWidths):
+ (RenderTableSection::layoutRows):
+ (RenderTableSection::recalcCells):
+ (RenderTableRow::addChild):
+ (RenderTableRow::layout):
+ (RenderTableCell::paint):
+ * khtml/rendering/render_text.cpp:
+ (RenderText::setText):
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::recalcStyle):
+ (DocumentImpl::updateStyleSelector):
+ * khtml/xml/dom_nodeimpl.cpp:
+ (NodeBaseImpl::insertBefore):
+ (NodeBaseImpl::replaceChild):
+ (NodeBaseImpl::appendChild):
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::forceLayoutForPageWidth):
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge needsLayout]):
+
2003-05-02 Maciej Stachowiak <mjs at apple.com>
Reviewed by Richard.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index f981acb..e9c3530 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,111 @@
+2003-05-03 David Hyatt <hyatt at apple.com>
+
+ Rename layouted to needsLayout. Add a layoutIfNeeded method
+ and start using it in places that do if (needsLayout()) layout();
+
+ Reviewed by kocienda
+
+ * khtml/ecma/kjs_dom.cpp:
+ (DOMNode::getValueProperty):
+ * khtml/html/html_baseimpl.cpp:
+ (HTMLFrameSetElementImpl::recalcStyle):
+ * khtml/html/html_documentimpl.cpp:
+ (HTMLDocumentImpl::close):
+ * khtml/html/html_imageimpl.cpp:
+ (HTMLImageElementImpl::width):
+ (HTMLImageElementImpl::height):
+ * khtml/html/html_tableimpl.cpp:
+ (HTMLTableElementImpl::parseAttribute):
+ * khtml/khtmlview.cpp:
+ (KHTMLView::layout):
+ (KHTMLView::print):
+ (KHTMLView::timerEvent):
+ * khtml/rendering/bidi.cpp:
+ * khtml/rendering/render_applet.cpp:
+ (RenderApplet::layout):
+ (RenderEmptyApplet::layout):
+ * khtml/rendering/render_block.cpp:
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::close):
+ * khtml/rendering/render_container.cpp:
+ (RenderContainer::addChild):
+ (RenderContainer::removeChildNode):
+ (RenderContainer::removeChild):
+ (RenderContainer::appendChildNode):
+ (RenderContainer::insertChildNode):
+ (RenderContainer::layout):
+ * khtml/rendering/render_flow.h:
+ * khtml/rendering/render_form.cpp:
+ (RenderFormElement::layout):
+ (RenderSubmitButton::updateFromElement):
+ (RenderSelect::updateFromElement):
+ (RenderSelect::calcMinMaxWidth):
+ (RenderSelect::layout):
+ * khtml/rendering/render_frames.cpp:
+ (RenderFrameSet::layout):
+ (RenderFrameSet::positionFrames):
+ (RenderFrameSet::userResize):
+ (RenderFrameSet::canResize):
+ (RenderPart::setWidget):
+ (RenderPartObject::updateWidget):
+ (RenderPartObject::layout):
+ * khtml/rendering/render_image.cpp:
+ (RenderImage::setPixmap):
+ (RenderImage::layout):
+ * khtml/rendering/render_inline.cpp:
+ (RenderInline::addChildToFlow):
+ (RenderInline::splitInlines):
+ (RenderInline::splitFlow):
+ * khtml/rendering/render_layer.cpp:
+ (RenderLayer::checkScrollbarsAfterLayout):
+ * khtml/rendering/render_list.cpp:
+ (RenderListItem::layout):
+ (RenderListMarker::setStyle):
+ (RenderListMarker::layout):
+ (RenderListMarker::setPixmap):
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::RenderObject):
+ (RenderObject::setNeedsLayout):
+ (RenderObject::information):
+ (RenderObject::dump):
+ (RenderObject::setStyle):
+ (RenderObject::invalidateLayout):
+ (RenderObject::detach):
+ * khtml/rendering/render_object.h:
+ * khtml/rendering/render_replaced.cpp:
+ (RenderReplaced::paint):
+ (RenderWidget::setQWidget):
+ (RenderWidget::layout):
+ * khtml/rendering/render_root.cpp:
+ * khtml/rendering/render_table.cpp:
+ (RenderTable::addChild):
+ (RenderTable::layout):
+ (RenderTable::paint):
+ (RenderTable::close):
+ (RenderTable::splitColumn):
+ (RenderTable::appendColumn):
+ (RenderTable::recalcSections):
+ (RenderTableSection::addChild):
+ (RenderTableSection::setCellWidths):
+ (RenderTableSection::layoutRows):
+ (RenderTableSection::recalcCells):
+ (RenderTableRow::addChild):
+ (RenderTableRow::layout):
+ (RenderTableCell::paint):
+ * khtml/rendering/render_text.cpp:
+ (RenderText::setText):
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::recalcStyle):
+ (DocumentImpl::updateStyleSelector):
+ * khtml/xml/dom_nodeimpl.cpp:
+ (NodeBaseImpl::insertBefore):
+ (NodeBaseImpl::replaceChild):
+ (NodeBaseImpl::appendChild):
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::forceLayoutForPageWidth):
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge needsLayout]):
+
2003-05-02 Maciej Stachowiak <mjs at apple.com>
Reviewed by Richard.
diff --git a/WebCore/khtml/ecma/kjs_dom.cpp b/WebCore/khtml/ecma/kjs_dom.cpp
index 48089fb..b6dfa24 100644
--- a/WebCore/khtml/ecma/kjs_dom.cpp
+++ b/WebCore/khtml/ecma/kjs_dom.cpp
@@ -236,7 +236,7 @@ Value DOMNode::getValueProperty(ExecState *exec, int token) const
v = docimpl->view();
docimpl->updateRendering();
// Only do a layout if changes have occurred that make it necessary.
- if ( v && docimpl->renderer() && !docimpl->renderer()->layouted() )
+ if ( v && docimpl->renderer() && docimpl->renderer()->needsLayout() )
docimpl->view()->layout();
}
diff --git a/WebCore/khtml/html/html_baseimpl.cpp b/WebCore/khtml/html/html_baseimpl.cpp
index 3a08d56..280d174 100644
--- a/WebCore/khtml/html/html_baseimpl.cpp
+++ b/WebCore/khtml/html/html_baseimpl.cpp
@@ -598,7 +598,7 @@ void HTMLFrameSetElementImpl::detach()
void HTMLFrameSetElementImpl::recalcStyle( StyleChange ch )
{
if (changed() && m_render) {
- m_render->setLayouted(false);
+ m_render->setNeedsLayout(true);
// m_render->layout();
setChanged(false);
}
diff --git a/WebCore/khtml/html/html_documentimpl.cpp b/WebCore/khtml/html/html_documentimpl.cpp
index f93d981..f548dea 100644
--- a/WebCore/khtml/html/html_documentimpl.cpp
+++ b/WebCore/khtml/html/html_documentimpl.cpp
@@ -376,8 +376,7 @@ void HTMLDocumentImpl::close()
// Always do a layout/repaint after loading.
if (renderer()) {
- if (!renderer()->layouted())
- renderer()->layout();
+ renderer()->layoutIfNeeded();
renderer()->repaint();
}
}
diff --git a/WebCore/khtml/html/html_imageimpl.cpp b/WebCore/khtml/html/html_imageimpl.cpp
index dc53c5a..37b9341 100644
--- a/WebCore/khtml/html/html_imageimpl.cpp
+++ b/WebCore/khtml/html/html_imageimpl.cpp
@@ -221,7 +221,7 @@ long HTMLImageElementImpl::width() const
if (!m_render) return getAttribute(ATTR_WIDTH).toInt();
// ### make a unified call for this
- if (changed() || !m_render->layouted()) {
+ if (changed() || m_render->needsLayout()) {
getDocument()->updateRendering();
if (getDocument()->view())
getDocument()->view()->layout();
@@ -235,7 +235,7 @@ long HTMLImageElementImpl::height() const
if (!m_render) return getAttribute(ATTR_HEIGHT).toInt();
// ### make a unified call for this
- if (changed() || !m_render->layouted()) {
+ if (changed() || m_render->needsLayout()) {
getDocument()->updateRendering();
if (getDocument()->view())
getDocument()->view()->layout();
diff --git a/WebCore/khtml/html/html_tableimpl.cpp b/WebCore/khtml/html/html_tableimpl.cpp
index 4037cd0..4adfcf3 100644
--- a/WebCore/khtml/html/html_tableimpl.cpp
+++ b/WebCore/khtml/html/html_tableimpl.cpp
@@ -495,7 +495,7 @@ void HTMLTableElementImpl::parseAttribute(AttributeImpl *attr)
padding = 1;
if (m_render && m_render->isTable()) {
static_cast<RenderTable *>(m_render)->setCellPadding(padding);
- m_render->setLayouted(false);
+ m_render->setNeedsLayout(true);
}
break;
case ATTR_COLS:
diff --git a/WebCore/khtml/khtmlview.cpp b/WebCore/khtml/khtmlview.cpp
index 049fe45..a99fe32 100644
--- a/WebCore/khtml/khtmlview.cpp
+++ b/WebCore/khtml/khtmlview.cpp
@@ -406,7 +406,7 @@ void KHTMLView::layout()
if(body && body->renderer() && body->id() == ID_FRAMESET) {
QScrollView::setVScrollBarMode(AlwaysOff);
QScrollView::setHScrollBarMode(AlwaysOff);
- body->renderer()->setLayouted(false);
+ body->renderer()->setNeedsLayout(true);
}
}
@@ -415,8 +415,7 @@ void KHTMLView::layout()
//QTime qt;
//qt.start();
- root->setMinMaxKnown(false);
- root->setLayouted(false);
+ root->setNeedsLayoutAndMinMaxRecalc();
// avoid recursing into relayouts because of scrollbar-flicker
root->layout();
@@ -1122,8 +1121,7 @@ void KHTMLView::print()
m_part->xmlDocImpl()->styleSelector()->computeFontSizes(&metrics, 100);
m_part->xmlDocImpl()->updateStyleSelector();
root->setPrintImages( printer->option("kde-khtml-printimages") == "true");
- root->setLayouted( false );
- root->setMinMaxKnown( false );
+ root->setNeedsLayoutAndMinMaxRecalc();
root->layout();
// ok. now print the pages.
@@ -1539,10 +1537,10 @@ void KHTMLView::timerEvent ( QTimerEvent *e )
khtml::RenderRoot* root = static_cast<khtml::RenderRoot *>(document->renderer());
if (root){
// Do not allow a full layout if we had a clip object set.
- if ( !root->layouted() && !m_layoutObject) {
+ if ( root->needsLayout() && !m_layoutObject) {
killTimer(d->repaintTimerId);
d->repaintTimerId = 0;
- //qDebug("not layouted, delaying repaint");
+ //qDebug("needs layout, delaying repaint");
scheduleRelayout();
return;
}
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index 20c4935..1b9a831 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -1217,11 +1217,11 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren)
if(o->isReplaced() || o->isFloating() || o->isPositioned()) {
//kdDebug(6041) << "layouting replaced or floating child" << endl;
if (relayoutChildren || o->style()->width().isPercent() || o->style()->height().isPercent())
- o->setLayouted(false);
+ o->setNeedsLayout(true);
if (o->isPositioned())
o->containingBlock()->insertPositionedObject(o);
- else if( !o->layouted() )
- o->layout();
+ else
+ o->layoutIfNeeded();
}
else if(o->isText()) // FIXME: Should be able to combine deleteLineBoxes/Runs
static_cast<RenderText *>(o)->deleteRuns();
diff --git a/WebCore/khtml/rendering/render_applet.cpp b/WebCore/khtml/rendering/render_applet.cpp
index e8a79fe..3f49fd3 100644
--- a/WebCore/khtml/rendering/render_applet.cpp
+++ b/WebCore/khtml/rendering/render_applet.cpp
@@ -90,7 +90,7 @@ void RenderApplet::layout()
{
//kdDebug(6100) << "RenderApplet::layout" << endl;
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
calcWidth();
@@ -123,7 +123,7 @@ void RenderApplet::layout()
tmp->showApplet();
}
- setLayouted();
+ setNeedsLayout(false);
}
void RenderApplet::processArguments(const QMap<QString, QString> &args)
@@ -183,7 +183,7 @@ int RenderEmptyApplet::intrinsicHeight() const
void RenderEmptyApplet::layout()
{
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
calcWidth();
@@ -196,6 +196,6 @@ void RenderEmptyApplet::layout()
m_height-marginTop()-marginBottom()-paddingTop()-paddingBottom());
}
- setLayouted();
+ setNeedsLayout(false);
}
#endif
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index ee80455..b373fbc 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -96,7 +96,7 @@ void RenderBlock::setStyle(RenderStyle* _style)
void RenderBlock::addChildToFlow(RenderObject* newChild, RenderObject* beforeChild)
{
- setLayouted( false );
+ setNeedsLayout(true);
bool madeBoxesNonInline = FALSE;
@@ -156,8 +156,7 @@ void RenderBlock::addChildToFlow(RenderObject* newChild, RenderObject* beforeChi
if (newChild->isInline()) {
beforeChild->parent()->addChild(newChild,beforeChild);
- newChild->setLayouted( false );
- newChild->setMinMaxKnown( false );
+ newChild->setNeedsLayoutAndMinMaxRecalc();
return;
}
else if (beforeChild->parent()->firstChild() != beforeChild)
@@ -166,8 +165,8 @@ void RenderBlock::addChildToFlow(RenderObject* newChild, RenderObject* beforeChi
return addChildToFlow(newChild, beforeChild->parent());
}
- // prevent non-layouted elements from getting painted by pushing them far above the top of the
- // page
+ // prevent elements that haven't received a layout yet from getting painted by pushing
+ // them far above the top of the page
if (!newChild->isInline())
newChild->setPos(newChild->xPos(), -500000);
@@ -198,16 +197,14 @@ void RenderBlock::addChildToFlow(RenderObject* newChild, RenderObject* beforeChi
if (beforeChild) {
if (beforeChild->previousSibling() && beforeChild->previousSibling()->isAnonymousBox()) {
beforeChild->previousSibling()->addChild(newChild);
- newChild->setLayouted( false );
- newChild->setMinMaxKnown( false );
+ newChild->setNeedsLayoutAndMinMaxRecalc();
return;
}
}
else {
if (m_last && m_last->isAnonymousBox()) {
m_last->addChild(newChild);
- newChild->setLayouted( false );
- newChild->setMinMaxKnown( false );
+ newChild->setNeedsLayoutAndMinMaxRecalc();
return;
}
}
@@ -225,8 +222,7 @@ void RenderBlock::addChildToFlow(RenderObject* newChild, RenderObject* beforeChi
newBox->addChild(newChild);
newBox->setPos(newBox->xPos(), -500000);
- newChild->setLayouted( false );
- newChild->setMinMaxKnown( false );
+ newChild->setNeedsLayoutAndMinMaxRecalc();
return;
}
else {
@@ -242,8 +238,7 @@ void RenderBlock::addChildToFlow(RenderObject* newChild, RenderObject* beforeChi
RenderBox::addChild(newChild,beforeChild);
// ### care about aligned stuff
- newChild->setLayouted( false );
- newChild->setMinMaxKnown( false );
+ newChild->setNeedsLayoutAndMinMaxRecalc();
if ( madeBoxesNonInline )
removeLeftoverAnonymousBoxes();
@@ -327,10 +322,10 @@ void RenderBlock::makeChildrenNonInline(RenderObject *insertionPoint)
box->appendChildNode(removeChildNode(inlineRunEnd));
box->close();
box->setPos(box->xPos(), -500000);
- box->setLayouted(false);
+ box->setNeedsLayout(true);
}
- setLayouted(false);
+ setNeedsLayout(true);
}
void RenderBlock::removeChild(RenderObject *oldChild)
@@ -351,11 +346,9 @@ void RenderBlock::removeChild(RenderObject *oldChild)
RenderObject* no = o;
o = no->nextSibling();
prev->appendChildNode(next->removeChildNode(no));
- no->setLayouted(false);
- no->setMinMaxKnown(false);
+ no->setNeedsLayoutAndMinMaxRecalc();
}
- prev->setLayouted(false);
- prev->setMinMaxKnown(false);
+ prev->setNeedsLayoutAndMinMaxRecalc();
// Nuke the now-empty block.
next->detach(renderArena());
@@ -376,12 +369,10 @@ void RenderBlock::removeChild(RenderObject *oldChild)
RenderObject* no = o;
o = no->nextSibling();
appendChildNode(anonBlock->removeChildNode(no));
- no->setLayouted(false);
- no->setMinMaxKnown(false);
+ no->setNeedsLayoutAndMinMaxRecalc();
}
- setLayouted(false);
- setMinMaxKnown(false);
-
+ setNeedsLayoutAndMinMaxRecalc();
+
// Nuke the now-empty block.
anonBlock->detach(renderArena());
}
@@ -399,7 +390,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
// kdDebug( 6040 ) << renderName() << " " << this << "::layoutBlock() start" << endl;
// QTime t;
// t.start();
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
if (isInline()) // Inline <form>s inside various table elements can cause us to
@@ -414,11 +405,11 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
relayoutChildren = true;
// kdDebug( 6040 ) << floatingObjects << "," << oldWidth << ","
- // << m_width << ","<< layouted() << "," << isAnonymousBox() << ","
+ // << m_width << ","<< needsLayout() << "," << isAnonymousBox() << ","
// << overhangingContents() << "," << isPositioned() << endl;
#ifdef DEBUG_LAYOUT
- kdDebug( 6040 ) << renderName() << "(RenderBlock) " << this << " ::layout() width=" << m_width << ", layouted=" << layouted() << endl;
+ kdDebug( 6040 ) << renderName() << "(RenderBlock) " << this << " ::layout() width=" << m_width << ", needsLayout=" << needsLayout() << endl;
if(containingBlock() == static_cast<RenderObject *>(this))
kdDebug( 6040 ) << renderName() << ": containingBlock == this" << endl;
#endif
@@ -538,7 +529,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
if (style()->scrollsOverflow() && m_layer)
m_layer->checkScrollbarsAfterLayout();
- setLayouted();
+ setNeedsLayout(false);
}
void RenderBlock::layoutBlockChildren( bool relayoutChildren )
@@ -616,7 +607,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
// take care in case we inherited floats
if (child && floatBottom() > m_height)
- child->setLayouted(false);
+ child->setNeedsLayout(true);
// QTime t;
// t.start();
@@ -626,9 +617,9 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
// make sure we relayout children if we need it.
if ( relayoutChildren || floatBottom() > m_y ||
(child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent())))
- child->setLayouted(false);
+ child->setNeedsLayout(true);
- // kdDebug( 6040 ) << " " << child->renderName() << " loop " << child << ", " << child->isInline() << ", " << child->layouted() << endl;
+ // kdDebug( 6040 ) << " " << child->renderName() << " loop " << child << ", " << child->isInline() << ", " << child->needsLayout() << endl;
// kdDebug( 6040 ) << t.elapsed() << endl;
// ### might be some layouts are done two times... FIX that.
@@ -637,11 +628,9 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
child->containingBlock()->insertPositionedObject(child);
child = child->nextSibling();
continue;
- } else if ( child->isReplaced() ) {
- if ( !child->layouted() )
- child->layout();
- }
-
+ } else if (child->isReplaced())
+ child->layoutIfNeeded();
+
if ( child->isFloating() ) {
insertFloatingObject( child );
@@ -758,7 +747,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
{
yPosEstimate += QMAX(prevFlow->collapsedMarginBottom(), child->marginTop());
if (prevFlow->yPos()+prevFlow->floatBottom() > yPosEstimate)
- child->setLayouted(false);
+ child->setNeedsLayout(true);
else
prevFlow=0;
}
@@ -767,8 +756,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
// Go ahead and position the child as though it didn't collapse with the top.
child->setPos(child->xPos(), yPosEstimate);
- if ( !child->layouted() )
- child->layout();
+ child->layoutIfNeeded();
// Now determine the correct ypos based off examination of collapsing margin
// values.
@@ -860,14 +848,13 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
// property set, when the child shifts to clear an item, its width can
// change (because it has more available line width).
// So go ahead an mark the item as dirty.
- child->setLayouted(false);
+ child->setNeedsLayout(true);
if (child->containsFloats() || containsFloats())
child->markAllDescendantsWithFloatsForLayout();
// Our guess was wrong. Make the child lay itself out again.
- if (!child->layouted())
- child->layout();
+ child->layoutIfNeeded();
}
}
@@ -897,11 +884,10 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
// property set, when the child shifts to clear an item, its width can
// change (because it has more available line width).
// So go ahead an mark the item as dirty.
- child->setLayouted(false);
+ child->setNeedsLayout(true);
if (child->containsFloats())
child->markAllDescendantsWithFloatsForLayout();
- if (!child->layouted())
- child->layout();
+ child->layoutIfNeeded();
}
// Reset the top margin contributor to false if we encountered
@@ -1029,9 +1015,9 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
m_bottomMarginQuirk = true;
}
- setLayouted();
+ setNeedsLayout(false);
- // kdDebug( 6040 ) << "layouted = " << layouted_ << endl;
+ // kdDebug( 6040 ) << "needsLayout = " << needsLayout_ << endl;
}
void RenderBlock::layoutPositionedObjects(bool relayoutChildren)
@@ -1043,9 +1029,8 @@ void RenderBlock::layoutPositionedObjects(bool relayoutChildren)
for ( ; (r = it.current()); ++it ) {
//kdDebug(6040) << " have a positioned object" << endl;
if ( relayoutChildren )
- r->setLayouted( false );
- if ( !r->layouted() )
- r->layout();
+ r->setNeedsLayout(true);
+ r->layoutIfNeeded();
}
}
}
@@ -1219,8 +1204,7 @@ void RenderBlock::insertFloatingObject(RenderObject *o)
FloatingObject *newObj;
if (o->isFloating()) {
// floating object
- if ( !o->layouted() )
- o->layout();
+ o->layoutIfNeeded();
if(o->style()->floating() == FLEFT)
newObj = new FloatingObject(FloatingObject::FloatLeft);
@@ -1712,7 +1696,7 @@ bool RenderBlock::containsFloat(RenderObject* o)
void RenderBlock::markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove)
{
- setLayouted(false);
+ setNeedsLayout(true);
if (floatToRemove)
removeFloatingObject(floatToRemove);
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index feb89f7..9bc3641 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -403,8 +403,7 @@ QRect RenderBox::getClipRect(int tx, int ty)
void RenderBox::close()
{
- setMinMaxKnown(false);
- setLayouted( false );
+ setNeedsLayoutAndMinMaxRecalc();
}
short RenderBox::containingBlockWidth() const
diff --git a/WebCore/khtml/rendering/render_container.cpp b/WebCore/khtml/rendering/render_container.cpp
index 7ef94d5..b3f18c5 100644
--- a/WebCore/khtml/rendering/render_container.cpp
+++ b/WebCore/khtml/rendering/render_container.cpp
@@ -147,8 +147,7 @@ void RenderContainer::addChild(RenderObject *newChild, RenderObject *beforeChild
// just add it...
insertChildNode(newChild, beforeChild);
}
- newChild->setLayouted( false );
- newChild->setMinMaxKnown( false );
+ newChild->setNeedsLayoutAndMinMaxRecalc();
}
RenderObject* RenderContainer::removeChildNode(RenderObject* oldChild)
@@ -191,8 +190,7 @@ RenderObject* RenderContainer::removeChildNode(RenderObject* oldChild)
oldChild->setNextSibling(0);
oldChild->setParent(0);
- setMinMaxKnown( false );
- setLayouted( false );
+ setNeedsLayoutAndMinMaxRecalc();
return oldChild;
}
@@ -200,7 +198,7 @@ RenderObject* RenderContainer::removeChildNode(RenderObject* oldChild)
void RenderContainer::removeChild(RenderObject *oldChild)
{
removeChildNode(oldChild);
- setLayouted(false);
+ setNeedsLayout(true);
}
void RenderContainer::insertPseudoChild(RenderStyle::PseudoId type, RenderObject* child)
@@ -284,9 +282,8 @@ void RenderContainer::appendChildNode(RenderObject* newChild)
// Keep our layer hierarchy updated.
RenderLayer* layer = enclosingLayer();
newChild->addLayers(layer, newChild);
-
- newChild->setMinMaxKnown( false );
- newChild->setLayouted( false );
+
+ newChild->setNeedsLayoutAndMinMaxRecalc();
}
void RenderContainer::insertChildNode(RenderObject* child, RenderObject* beforeChild)
@@ -315,24 +312,22 @@ void RenderContainer::insertChildNode(RenderObject* child, RenderObject* beforeC
// Keep our layer hierarchy updated.
RenderLayer* layer = enclosingLayer();
child->addLayers(layer, child);
-
- child->setMinMaxKnown( false );
- child->setLayouted( false );
+
+ child->setNeedsLayoutAndMinMaxRecalc();
}
void RenderContainer::layout()
{
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
RenderObject *child = firstChild();
while( child ) {
- if( !child->layouted() )
- child->layout();
+ child->layoutIfNeeded();
child = child->nextSibling();
}
- setLayouted();
+ setNeedsLayout(false);
}
void RenderContainer::removeLeftoverAnonymousBoxes()
diff --git a/WebCore/khtml/rendering/render_flow.h b/WebCore/khtml/rendering/render_flow.h
index d0b3cfe..ad4ba0e 100644
--- a/WebCore/khtml/rendering/render_flow.h
+++ b/WebCore/khtml/rendering/render_flow.h
@@ -34,7 +34,7 @@ namespace khtml {
* all geometry managing stuff is only in the block elements.
*
* Inline elements don't layout themselves, but the whole paragraph
- * gets layouted by the surrounding block element. This is, because
+ * gets flowed by the surrounding block element. This is, because
* one needs to know the whole paragraph to calculate bidirectional
* behaviour of text, so putting the layouting routines in the inline
* elements is impossible.
diff --git a/WebCore/khtml/rendering/render_form.cpp b/WebCore/khtml/rendering/render_form.cpp
index 21ef6ce..25e03a5 100644
--- a/WebCore/khtml/rendering/render_form.cpp
+++ b/WebCore/khtml/rendering/render_form.cpp
@@ -145,7 +145,7 @@ void RenderFormElement::updateFromElement()
void RenderFormElement::layout()
{
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
// minimum height
@@ -160,7 +160,7 @@ void RenderFormElement::layout()
m_height-borderLeft()-borderRight()-paddingLeft()-paddingRight());
if ( !style()->width().isPercent() )
- setLayouted();
+ setNeedsLayout(false);
}
void RenderFormElement::slotClicked()
@@ -345,10 +345,8 @@ void RenderSubmitButton::updateFromElement()
QString oldText = static_cast<QPushButton*>(m_widget)->text();
QString newText = rawText();
static_cast<QPushButton*>(m_widget)->setText(newText);
- if ( oldText != newText ) {
- setMinMaxKnown(false);
- setLayouted(false);
- }
+ if ( oldText != newText )
+ setNeedsLayoutAndMinMaxRecalc();
RenderFormElement::updateFromElement();
}
@@ -844,8 +842,7 @@ void RenderSelect::updateFromElement()
if (m_useListBox)
static_cast<KListBox*>(m_widget)->endBatchInsert();
#endif
- setMinMaxKnown(false);
- setLayouted(false);
+ setNeedsLayoutAndMinMaxRecalc();
m_optionsChanged = false;
}
@@ -881,10 +878,8 @@ void RenderSelect::calcMinMaxWidth()
// ### ugly HACK FIXME!!!
setMinMaxKnown();
- if ( !layouted() )
- layout();
- setLayouted( false );
- setMinMaxKnown( false );
+ layoutIfNeeded();
+ setNeedsLayoutAndMinMaxRecalc();
// ### end FIXME
RenderFormElement::calcMinMaxWidth();
@@ -892,7 +887,7 @@ void RenderSelect::calcMinMaxWidth()
void RenderSelect::layout( )
{
- KHTMLAssert(!layouted());
+ KHTMLAssert(needsLayout());
KHTMLAssert(minMaxKnown());
// ### maintain selection properly between type/size changes, and work
@@ -943,7 +938,7 @@ void RenderSelect::layout( )
}
/// uuh, ignore the following line..
- setLayouted( false );
+ setNeedsLayout(true);
RenderFormElement::layout();
// and now disable the widget in case there is no <option> given
diff --git a/WebCore/khtml/rendering/render_frames.cpp b/WebCore/khtml/rendering/render_frames.cpp
index 32f1bb3..8a9188b 100644
--- a/WebCore/khtml/rendering/render_frames.cpp
+++ b/WebCore/khtml/rendering/render_frames.cpp
@@ -98,7 +98,7 @@ bool RenderFrameSet::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _t
void RenderFrameSet::layout( )
{
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
if ( !parent()->isFrameSet() ) {
@@ -271,7 +271,7 @@ void RenderFrameSet::layout( )
}
RenderContainer::layout();
end2:
- setLayouted();
+ setNeedsLayout(false);
}
void RenderFrameSet::positionFrames()
@@ -301,7 +301,7 @@ void RenderFrameSet::positionFrames()
if ((m_gridLayout[1][c] != child->width()) || (m_gridLayout[0][r] != child->height())) {
child->setWidth( m_gridLayout[1][c] );
child->setHeight( m_gridLayout[0][r] );
- child->setLayouted(false);
+ child->setNeedsLayout(true);
child->layout();
}
@@ -317,11 +317,11 @@ void RenderFrameSet::positionFrames()
}
// all the remaining frames are hidden to avoid ugly
- // spurious nonlayouted frames
+ // spurious unflowed frames
while ( child ) {
child->setWidth( 0 );
child->setHeight( 0 );
- child->setLayouted();
+ child->setNeedsLayout(false);
child = child->nextSibling();
}
@@ -329,7 +329,7 @@ void RenderFrameSet::positionFrames()
bool RenderFrameSet::userResize( MouseEventImpl *evt )
{
- if (!layouted()) return false;
+ if (needsLayout()) return false;
bool res = false;
int _x = evt->clientX();
@@ -434,7 +434,7 @@ bool RenderFrameSet::userResize( MouseEventImpl *evt )
// this just schedules the relayout
// important, otherwise the moving indicator is not correctly erased
- setLayouted(false);
+ setNeedsLayout(true);
}
else if (m_resizing || evt->id() == EventImpl::MOUSEUP_EVENT) {
@@ -516,8 +516,8 @@ void RenderFrameSet::setResizing(bool e)
bool RenderFrameSet::canResize( int _x, int _y )
{
- // if we're not layouted, the gridLayout doesn't contain useful data
- if (!layouted() || !m_gridLayout[0] || !m_gridLayout[1] ) return false;
+ // if we haven't received a layout, then the gridLayout doesn't contain useful data yet
+ if (needsLayout() || !m_gridLayout[0] || !m_gridLayout[1] ) return false;
// check if we're over a horizontal or vertical boundary
int pos = m_gridLayout[1][0];
@@ -568,8 +568,7 @@ void RenderPart::setWidget( QWidget *widget )
if(widget->inherits("KHTMLView"))
connect( widget, SIGNAL( cleared() ), this, SLOT( slotViewCleared() ) );
- setLayouted( false );
- setMinMaxKnown( false );
+ setNeedsLayoutAndMinMaxRecalc();
// make sure the scrollbars are set correctly for restore
// ### find better fix
@@ -657,8 +656,7 @@ void RenderPartObject::updateWidget()
QStringList params;
KHTMLPart *part = m_view->part();
- setMinMaxKnown(false);
- setLayouted(false);
+ setNeedsLayoutAndMinMaxRecalc();
// ### this should be constant true - move iframe to somewhere else
if (element()->id() == ID_OBJECT || element()->id() == ID_EMBED) {
@@ -929,7 +927,7 @@ void RenderPartObject::slotPartLoadingErrorNotify()
void RenderPartObject::layout( )
{
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
#if !APPLE_CHANGES
@@ -942,7 +940,7 @@ void RenderPartObject::layout( )
RenderPart::layout();
- setLayouted();
+ setNeedsLayout(false);
}
void RenderPartObject::slotViewCleared()
diff --git a/WebCore/khtml/rendering/render_image.cpp b/WebCore/khtml/rendering/render_image.cpp
index c96f12c..a87ae1f 100644
--- a/WebCore/khtml/rendering/render_image.cpp
+++ b/WebCore/khtml/rendering/render_image.cpp
@@ -155,7 +155,7 @@ void RenderImage::setPixmap( const QPixmap &p, const QRect& r, CachedImage *o)
if(needlayout)
{
- setLayouted(false);
+ setNeedsLayout(true);
setMinMaxKnown(false);
// kdDebug( 6040 ) << "m_width: : " << m_width << " height: " << m_height << endl;
@@ -307,7 +307,7 @@ void RenderImage::paintObject(QPainter *p, int /*_x*/, int /*_y*/, int /*_w*/, i
void RenderImage::layout()
{
- KHTMLAssert(!layouted());
+ KHTMLAssert(needsLayout());
KHTMLAssert( minMaxKnown() );
short oldwidth = m_width;
@@ -335,7 +335,7 @@ void RenderImage::layout()
if ( m_width != oldwidth || m_height != oldheight )
resizeCache = QPixmap();
- setLayouted();
+ setNeedsLayout(false);
}
void RenderImage::notifyFinished(CachedObject *finishedObj)
diff --git a/WebCore/khtml/rendering/render_inline.cpp b/WebCore/khtml/rendering/render_inline.cpp
index ca501ef..2533c8a 100644
--- a/WebCore/khtml/rendering/render_inline.cpp
+++ b/WebCore/khtml/rendering/render_inline.cpp
@@ -66,7 +66,7 @@ void RenderInline::setStyle(RenderStyle* _style)
void RenderInline::addChildToFlow(RenderObject* newChild, RenderObject* beforeChild)
{
- setLayouted( false );
+ setNeedsLayout(true);
if (!newChild->isText() && newChild->style()->position() != STATIC)
setOverhangingContents();
@@ -91,9 +91,8 @@ void RenderInline::addChildToFlow(RenderObject* newChild, RenderObject* beforeCh
}
RenderBox::addChild(newChild,beforeChild);
-
- newChild->setLayouted( false );
- newChild->setMinMaxKnown( false );
+
+ newChild->setNeedsLayoutAndMinMaxRecalc();
}
static RenderInline* cloneInline(RenderFlow* src)
@@ -118,8 +117,7 @@ void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
RenderObject* tmp = o;
o = tmp->nextSibling();
clone->appendChildNode(removeChildNode(tmp));
- tmp->setLayouted(false);
- tmp->setMinMaxKnown(false);
+ tmp->setNeedsLayoutAndMinMaxRecalc();
}
// Hook |clone| up as the continuation of the middle block.
@@ -150,8 +148,7 @@ void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
RenderObject* tmp = o;
o = tmp->nextSibling();
clone->appendChildNode(curr->removeChildNode(tmp));
- tmp->setLayouted(false);
- tmp->setMinMaxKnown(false);
+ tmp->setNeedsLayoutAndMinMaxRecalc();
}
// Keep walking up the chain.
@@ -218,8 +215,7 @@ void RenderInline::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox
RenderObject* no = o;
o = no->nextSibling();
pre->appendChildNode(block->removeChildNode(no));
- no->setLayouted(false);
- no->setMinMaxKnown(false);
+ no->setNeedsLayoutAndMinMaxRecalc();
}
}
@@ -239,16 +235,15 @@ void RenderInline::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox
// XXXdwh is any of this even necessary? I don't think it is.
pre->close();
pre->setPos(0, -500000);
- pre->setLayouted(false);
+ pre->setNeedsLayout(true);
newBlockBox->close();
newBlockBox->setPos(0, -500000);
- newBlockBox->setLayouted(false);
+ newBlockBox->setNeedsLayout(true);
post->close();
post->setPos(0, -500000);
- post->setLayouted(false);
+ post->setNeedsLayout(true);
- block->setLayouted(false);
- block->setMinMaxKnown(false);
+ block->setNeedsLayoutAndMinMaxRecalc();
}
void RenderInline::paint(QPainter *p, int _x, int _y, int _w, int _h,
diff --git a/WebCore/khtml/rendering/render_layer.cpp b/WebCore/khtml/rendering/render_layer.cpp
index bb2e596..901048c 100644
--- a/WebCore/khtml/rendering/render_layer.cpp
+++ b/WebCore/khtml/rendering/render_layer.cpp
@@ -472,7 +472,7 @@ RenderLayer::checkScrollbarsAfterLayout()
setHasHorizontalScrollbar(needHorizontalBar);
setHasVerticalScrollbar(needVerticalBar);
- m_object->setLayouted(false);
+ m_object->setNeedsLayout(true);
if (m_object->isRenderBlock())
static_cast<RenderBlock*>(m_object)->layoutBlock(true);
else
diff --git a/WebCore/khtml/rendering/render_list.cpp b/WebCore/khtml/rendering/render_list.cpp
index 0947b1e..2d874fa 100644
--- a/WebCore/khtml/rendering/render_list.cpp
+++ b/WebCore/khtml/rendering/render_list.cpp
@@ -263,7 +263,7 @@ void RenderListItem::calcMinMaxWidth()
void RenderListItem::layout( )
{
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
updateMarkerLocation();
@@ -310,10 +310,9 @@ RenderListMarker::~RenderListMarker()
void RenderListMarker::setStyle(RenderStyle *s)
{
- if ( s && style() && s->listStylePosition() != style()->listStylePosition() ) {
- setLayouted( false );
- setMinMaxKnown( false );
- }
+ if ( s && style() && s->listStylePosition() != style()->listStylePosition() )
+ setNeedsLayoutAndMinMaxRecalc();
+
RenderBox::setStyle(s);
if ( m_listImage != style()->listStyleImage() ) {
@@ -483,11 +482,11 @@ void RenderListMarker::paintObject(QPainter *p, int, int _y,
void RenderListMarker::layout()
{
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
// ### KHTMLAssert( minMaxKnown() );
if ( !minMaxKnown() )
calcMinMaxWidth();
- setLayouted();
+ setNeedsLayout(false);
}
void RenderListMarker::setPixmap( const QPixmap &p, const QRect& r, CachedImage *o)
@@ -498,10 +497,7 @@ void RenderListMarker::setPixmap( const QPixmap &p, const QRect& r, CachedImage
}
if(m_width != m_listImage->pixmap_size().width() || m_height != m_listImage->pixmap_size().height())
- {
- setLayouted(false);
- setMinMaxKnown(false);
- }
+ setNeedsLayoutAndMinMaxRecalc();
else
repaintRectangle(0, 0, m_width, m_height);
}
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 8b9edf0..b17c01d 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -128,7 +128,7 @@ m_parent( 0 ),
m_previous( 0 ),
m_next( 0 ),
m_verticalPosition( PositionUndefined ),
-m_layouted( false ),
+m_needsLayout( true ),
m_unused( false ),
m_minMaxKnown( false ),
m_floating( false ),
@@ -384,10 +384,10 @@ void RenderObject::markAllDescendantsWithFloatsForLayout(RenderObject*)
{
}
-void RenderObject::setLayouted(bool b)
+void RenderObject::setNeedsLayout(bool b)
{
- m_layouted = b;
- if (b) {
+ m_needsLayout = b;
+ if (!b) {
RenderLayer* l = layer();
if (l) {
l->setWidth(width());
@@ -400,7 +400,7 @@ void RenderObject::setLayouted(bool b)
RenderObject *root = this;
// If an attempt is made to
- // setLayouted(false) an object inside a clipped (overflow:hidden) object, we
+ // setNeedsLayout(true) an object inside a clipped (overflow:hidden) object, we
// have to make sure to repaint only the clipped rectangle.
// We do this by passing an argument to scheduleRelayout. This hint really
// shouldn't be needed, and it's unfortunate that it is necessary. -dwh
@@ -410,7 +410,7 @@ void RenderObject::setLayouted(bool b)
while( o ) {
root = o;
- o->m_layouted = false;
+ o->m_needsLayout = true;
if (o->style()->hidesOverflow() && !clippedObj)
clippedObj = o;
o = o->container();
@@ -824,7 +824,7 @@ QString RenderObject::information() const
if (isRelPositioned()) ts << "rp ";
if (isPositioned()) ts << "ps ";
if (overhangingContents()) ts << "oc ";
- if (layouted()) ts << "lt ";
+ if (needsLayout()) ts << "nl ";
if (m_recalcMinMax) ts << "rmm ";
if (mouseInside()) ts << "mi ";
if (style() && style()->zIndex()) ts << "zI: " << style()->zIndex();
@@ -871,7 +871,7 @@ void RenderObject::dump(QTextStream *stream, QString ind) const
if (isInline()) { *stream << " inline"; }
if (isReplaced()) { *stream << " replaced"; }
if (shouldPaintBackgroundOrBorder()) { *stream << " paintBackground"; }
- if (layouted()) { *stream << " layouted"; }
+ if (needsLayout()) { *stream << " needsLayout"; }
if (minMaxKnown()) { *stream << " minMaxKnown"; }
if (overhangingContents()) { *stream << " overhangingContents"; }
if (hasFirstLine()) { *stream << " hasFirstLine"; }
@@ -980,8 +980,7 @@ void RenderObject::setStyle(RenderStyle *style)
if ( d >= RenderStyle::Position && m_parent ) {
//qDebug("triggering relayout");
- setMinMaxKnown(false);
- setLayouted(false);
+ setNeedsLayoutAndMinMaxRecalc();
} else if ( m_parent && !isText()) {
//qDebug("triggering repaint");
repaint();
@@ -1131,8 +1130,8 @@ RenderObject *RenderObject::container() const
void RenderObject::invalidateLayout()
{
kdDebug() << "RenderObject::invalidateLayout " << renderName() << endl;
- setLayouted(false);
- if (m_parent && m_parent->layouted())
+ setNeedsLayout(true);
+ if (m_parent && !m_parent->needsLayout())
m_parent->invalidateLayout();
}
#endif
@@ -1175,7 +1174,7 @@ void RenderObject::detach(RenderArena* renderArena)
{
// If we're an overflow:hidden object that currently needs layout, we need
// to make sure the view isn't holding on to us.
- if (!layouted() && style()->hidesOverflow()) {
+ if (needsLayout() && style()->hidesOverflow()) {
RenderRoot* r = root();
if (r && r->view()->layoutObject() == this)
r->view()->unscheduleRelayout();
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 33e3e45..5922298 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -210,7 +210,7 @@ public:
bool mouseInside() const;
bool isReplaced() const { return m_replaced; } // a "replaced" element (see CSS)
bool shouldPaintBackgroundOrBorder() const { return m_paintBackground; }
- bool layouted() const { return m_layouted; }
+ bool needsLayout() const { return m_needsLayout; }
bool minMaxKnown() const{ return m_minMaxKnown; }
bool overhangingContents() const { return m_overhangingContents; }
bool hasFirstLine() const { return m_hasFirstLine; }
@@ -230,7 +230,7 @@ public:
void setOverhangingContents(bool p=true);
virtual void markAllDescendantsWithFloatsForLayout(RenderObject* floatToRemove = 0);
- void setLayouted(bool b=true);
+ void setNeedsLayout(bool b);
void setMinMaxKnown(bool b=true) {
m_minMaxKnown = b;
@@ -244,6 +244,12 @@ public:
}
}
}
+
+ void setNeedsLayoutAndMinMaxRecalc() {
+ setMinMaxKnown(false);
+ setNeedsLayout(true);
+ }
+
void setPositioned(bool b=true) { m_positioned = b; }
void setRelPositioned(bool b=true) { m_relPositioned = b; }
void setFloating(bool b=true) { m_floating = b; }
@@ -317,14 +323,17 @@ public:
* This function should cause the Element to calculate its
* width and height and the layout of its content
*
- * when the Element calls setLayouted(true), layout() is no
+ * when the Element calls setNeedsLayout(false), layout() is no
* longer called during relayouts, as long as there is no
- * style sheet change. When that occurs, isLayouted will be
- * set to false and the Element receives layout() calls
+ * style sheet change. When that occurs, m_needsLayout will be
+ * set to true and the Element receives layout() calls
* again.
*/
virtual void layout() = 0;
+ /* This function performs a layout only if one is needed. */
+ void layoutIfNeeded() { if (needsLayout()) layout(); }
+
// used for element state updates that can not be fixed with a
// repaint and do not need a relayout
virtual void updateFromElement() {};
@@ -595,8 +604,8 @@ private:
short m_verticalPosition;
- bool m_layouted : 1;
- bool m_unused : 1;
+ bool m_needsLayout : 1;
+ bool m_unused : 1;
bool m_minMaxKnown : 1;
bool m_floating : 1;
diff --git a/WebCore/khtml/rendering/render_replaced.cpp b/WebCore/khtml/rendering/render_replaced.cpp
index 32710d0..5cb81df 100644
--- a/WebCore/khtml/rendering/render_replaced.cpp
+++ b/WebCore/khtml/rendering/render_replaced.cpp
@@ -59,7 +59,7 @@ void RenderReplaced::paint(QPainter *p, int _x, int _y, int _w, int _h,
if (paintAction != PaintActionForeground)
return;
- // not visible or nont even once layouted?
+ // if we're invisible or haven't received a layout yet, then just bail.
if (style()->visibility() != VISIBLE || m_y <= -500000) return;
_tx += m_x;
@@ -182,9 +182,9 @@ void RenderWidget::setQWidget(QWidget *widget)
if (m_widget) {
connect( m_widget, SIGNAL( destroyed()), this, SLOT( slotWidgetDestructed()));
m_widget->installEventFilter(this);
- // if we're already layouted, apply the calculated space to the
+ // if we've already received a layout, apply the calculated space to the
// widget immediately
- if (layouted()) {
+ if (!needsLayout()) {
resizeWidget( m_widget,
m_width-borderLeft()-borderRight()-paddingLeft()-paddingRight(),
m_height-borderLeft()-borderRight()-paddingLeft()-paddingRight() );
@@ -198,7 +198,7 @@ void RenderWidget::setQWidget(QWidget *widget)
void RenderWidget::layout( )
{
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
if ( m_widget ) {
resizeWidget( m_widget,
@@ -206,7 +206,7 @@ void RenderWidget::layout( )
m_height-borderLeft()-borderRight()-paddingLeft()-paddingRight() );
}
- setLayouted();
+ setNeedsLayout(false);
}
#if APPLE_CHANGES
diff --git a/WebCore/khtml/rendering/render_root.cpp b/WebCore/khtml/rendering/render_root.cpp
index 2576fdc..9e54481 100644
--- a/WebCore/khtml/rendering/render_root.cpp
+++ b/WebCore/khtml/rendering/render_root.cpp
@@ -126,7 +126,7 @@ void RenderRoot::layout()
m_minWidth = m_width;
for (RenderObject *c = firstChild(); c; c = c->nextSibling())
- c->setLayouted(false);
+ c->setNeedsLayout(true);
#ifdef SPEED_DEBUG
QTime qt;
@@ -177,7 +177,7 @@ void RenderRoot::layout()
layer()->setHeight(m_height);
layer()->setWidth(m_width);
- setLayouted();
+ setNeedsLayout(false);
}
bool RenderRoot::absolutePosition(int &xPos, int &yPos, bool f)
@@ -273,7 +273,7 @@ void RenderRoot::repaint(bool immediate)
if (immediate) {
m_view->resizeContents(docWidth(), docHeight());
m_view->unscheduleRepaint();
- if (!layouted()) {
+ if (needsLayout()) {
m_view->scheduleRelayout();
return;
}
@@ -288,7 +288,7 @@ void RenderRoot::repaint(bool immediate)
void RenderRoot::close()
{
- setLayouted( false );
+ setNeedsLayout(true);
if (m_view) {
m_view->layout();
}
diff --git a/WebCore/khtml/rendering/render_table.cpp b/WebCore/khtml/rendering/render_table.cpp
index f09a1a7..418671a 100644
--- a/WebCore/khtml/rendering/render_table.cpp
+++ b/WebCore/khtml/rendering/render_table.cpp
@@ -185,9 +185,8 @@ void RenderTable::addChild(RenderObject *child, RenderObject *beforeChild)
}
}
o->addChild(child);
- child->setLayouted( false );
- child->setMinMaxKnown( false );
- return;
+ child->setNeedsLayoutAndMinMaxRecalc();
+ return;
}
RenderContainer::addChild(child,beforeChild);
}
@@ -229,11 +228,11 @@ void RenderTable::calcWidth()
void RenderTable::layout()
{
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
KHTMLAssert( !needSectionRecalc );
- //kdDebug( 6040 ) << renderName() << "(Table)"<< this << " ::layout0() width=" << width() << ", layouted=" << layouted() << endl;
+ //kdDebug( 6040 ) << renderName() << "(Table)"<< this << " ::layout0() width=" << width() << ", needsLayout=" << needsLayout() << endl;
m_height = 0;
initMaxMarginValues();
@@ -259,7 +258,7 @@ void RenderTable::layout()
RenderObject *child = firstChild();
while( child ) {
- if ( !child->layouted() && !(child->element() && child->element()->id() == ID_FORM))
+ if ( child->needsLayout() && !(child->element() && child->element()->id() == ID_FORM))
child->layout();
if ( child->isTableSection() ) {
static_cast<RenderTableSection *>(child)->calcRowHeight();
@@ -363,8 +362,7 @@ void RenderTable::layout()
// ### only pass true if width or height changed.
layoutPositionedObjects( true );
- setLayouted();
-
+ setNeedsLayout(false);
}
void RenderTable::setCellWidths()
@@ -384,7 +382,7 @@ void RenderTable::setCellWidths()
void RenderTable::paint( QPainter *p, int _x, int _y,
int _w, int _h, int _tx, int _ty, PaintAction paintAction)
{
- if (!layouted())
+ if (needsLayout())
return;
_tx += xPos();
@@ -443,8 +441,7 @@ void RenderTable::calcMinMaxWidth()
void RenderTable::close()
{
// kdDebug( 6040 ) << "RenderTable::close()" << endl;
- setLayouted(false);
- setMinMaxKnown(false);
+ setNeedsLayoutAndMinMaxRecalc();
}
int RenderTable::borderTopExtra()
@@ -498,8 +495,7 @@ void RenderTable::splitColumn( int pos, int firstSpan )
child = child->nextSibling();
}
columnPos.resize( numEffCols()+1 );
- setMinMaxKnown( false );
- setLayouted( false );
+ setNeedsLayoutAndMinMaxRecalc();
}
void RenderTable::appendColumn( int span )
@@ -529,8 +525,7 @@ void RenderTable::appendColumn( int span )
child = child->nextSibling();
}
columnPos.resize( numEffCols()+1 );
- setMinMaxKnown( false );
- setLayouted( false );
+ setNeedsLayoutAndMinMaxRecalc();
}
RenderTableCol *RenderTable::colElement( int col ) {
@@ -573,7 +568,7 @@ void RenderTable::recalcSections()
case TABLE_CAPTION:
if (!tCaption) {
tCaption = static_cast<RenderBlock*>(child);
- tCaption->setLayouted(false);
+ tCaption->setNeedsLayout(true);
}
break;
case TABLE_COLUMN:
@@ -613,7 +608,7 @@ void RenderTable::recalcSections()
child = child->nextSibling();
}
needSectionRecalc = false;
- setLayouted( false );
+ setNeedsLayout(true);
}
RenderObject* RenderTable::removeChildNode(RenderObject* child)
@@ -757,8 +752,7 @@ void RenderTableSection::addChild(RenderObject *child, RenderObject *beforeChild
}
}
row->addChild(child);
- child->setLayouted( false );
- child->setMinMaxKnown( false );
+ child->setNeedsLayoutAndMinMaxRecalc();
return;
}
@@ -929,7 +923,7 @@ void RenderTableSection::setCellWidths()
#endif
int oldWidth = cell->width();
if ( w != oldWidth ) {
- cell->setLayouted(false);
+ cell->setNeedsLayout(true);
cell->setWidth( w );
}
}
@@ -1113,15 +1107,14 @@ int RenderTableSection::layoutRows( int toAdd )
RenderObject* o = cell->firstChild();
while (o) {
if (o->style()->height().isPercent()) {
- o->setLayouted(false);
+ o->setNeedsLayout(true);
cellChildrenFlex = true;
}
o = o->nextSibling();
}
if (cellChildrenFlex) {
cell->setCellPercentageHeight(rHeight);
- if (!cell->layouted())
- cell->layout();
+ cell->layoutIfNeeded();
// Alignment within a cell is based off the calculated
// height, which becomes irrelevant once the cell has
@@ -1260,7 +1253,7 @@ void RenderTableSection::recalcCells()
row = row->nextSibling();
}
needCellRecalc = false;
- setLayouted( false );
+ setNeedsLayout(true);
}
void RenderTableSection::clearGrid()
@@ -1349,8 +1342,7 @@ void RenderTableRow::addChild(RenderObject *child, RenderObject *beforeChild)
addChild(cell, beforeChild);
}
cell->addChild(child);
- child->setLayouted( false );
- child->setMinMaxKnown( false );
+ child->setNeedsLayoutAndMinMaxRecalc();
return;
} else
cell = static_cast<RenderTableCell *>(child);
@@ -1380,12 +1372,12 @@ void RenderTableRow::dump(QTextStream *stream, QString ind) const
void RenderTableRow::layout()
{
- KHTMLAssert( !layouted() );
+ KHTMLAssert( needsLayout() );
KHTMLAssert( minMaxKnown() );
RenderObject *child = firstChild();
while( child ) {
- if ( child->isTableCell() && !child->layouted() ) {
+ if ( child->isTableCell() && child->needsLayout() ) {
RenderTableCell *cell = static_cast<RenderTableCell *>(child);
cell->calcVerticalMargins();
cell->layout();
@@ -1394,7 +1386,7 @@ void RenderTableRow::layout()
}
child = child->nextSibling();
}
- setLayouted();
+ setNeedsLayout(false);
}
void RenderTableRow::repaint(bool immediate)
@@ -1561,7 +1553,7 @@ void RenderTableCell::paint(QPainter *p, int _x, int _y,
kdDebug( 6040 ) << renderName() << "(RenderTableCell)::paint() w/h = (" << width() << "/" << height() << ")" << " _y/_h=" << _y << "/" << _h << endl;
#endif
- if (!layouted()) return;
+ if (needsLayout()) return;
_tx += m_x;
_ty += m_y + _topExtra;
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index 273e6f5..4100497 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -1134,7 +1134,8 @@ void RenderText::setText(DOMStringImpl *text, bool force)
KHTMLAssert(!isBR() || (str->l == 1 && (*str->s) == '\n'));
KHTMLAssert(!str->l || str->s);
- setLayouted(false);
+ setNeedsLayout(true);
+
#ifdef BIDI_DEBUG
QConstString cstr(str->s, str->l);
kdDebug( 6040 ) << "RenderText::setText( " << cstr.string().length() << " ) '" << cstr.string() << "'" << endl;
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index d7ed68c..3f689ea 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -955,8 +955,7 @@ void DocumentImpl::recalcStyle( StyleChange change )
// ### should be done by the rendering tree itself,
// this way is rather crude and CPU intensive
if ( changed() ) {
- renderer()->setLayouted( false );
- renderer()->setMinMaxKnown( false );
+ renderer()->setNeedsLayoutAndMinMaxRecalc();
renderer()->layout();
renderer()->repaint();
}
@@ -1877,10 +1876,8 @@ void DocumentImpl::updateStyleSelector()
m_styleSelectorDirty = true;
#endif
- if ( renderer() ) {
- renderer()->setLayouted( false );
- renderer()->setMinMaxKnown( false );
- }
+ if (renderer())
+ renderer()->setNeedsLayoutAndMinMaxRecalc();
}
diff --git a/WebCore/khtml/xml/dom_nodeimpl.cpp b/WebCore/khtml/xml/dom_nodeimpl.cpp
index a3a815c..c2ef3ca 100644
--- a/WebCore/khtml/xml/dom_nodeimpl.cpp
+++ b/WebCore/khtml/xml/dom_nodeimpl.cpp
@@ -1186,7 +1186,7 @@ NodeImpl *NodeBaseImpl::insertBefore ( NodeImpl *newChild, NodeImpl *refChild, i
// isn't scheduled, and you end up with stale data (especially
// with inline runs of text). -dwh
if (child->renderer())
- child->renderer()->setLayouted(false);
+ child->renderer()->setNeedsLayout(true);
}
// Dispatch the mutation events
@@ -1260,7 +1260,7 @@ NodeImpl *NodeBaseImpl::replaceChild ( NodeImpl *newChild, NodeImpl *oldChild, i
// isn't scheduled, and you end up with stale data (especially
// with inline runs of text). -dwh
if (child->renderer())
- child->renderer()->setLayouted(false);
+ child->renderer()->setNeedsLayout(true);
}
// Dispatch the mutation events
@@ -1413,7 +1413,7 @@ NodeImpl *NodeBaseImpl::appendChild ( NodeImpl *newChild, int &exceptioncode )
// isn't scheduled, and you end up with stale data (especially
// with inline runs of text). -dwh
if (child->renderer())
- child->renderer()->setLayouted(false);
+ child->renderer()->setNeedsLayout(true);
}
// Dispatch the mutation events
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 748196e..ccf4634 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -1148,8 +1148,7 @@ void KWQKHTMLPart::forceLayoutForPageWidth(float pageWidth)
if (root) {
// This magic is basically copied from khtmlview::print
root->setWidth((int)ceil(pageWidth));
- root->setLayouted(false);
- root->setMinMaxKnown(false);
+ root->setNeedsLayoutAndMinMaxRecalc();
forceLayout();
}
}
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index cac8aed..75c0779 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -898,7 +898,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(id <WebDOMElement>element)
- (BOOL)needsLayout
{
RenderObject *renderer = _part->renderer();
- return renderer ? !renderer->layouted() : false;
+ return renderer ? renderer->needsLayout() : false;
}
- (BOOL)interceptKeyEvent:(NSEvent *)event toView:(NSView *)view
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list