[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:34:12 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 0bab2a648ab9f3a833597899b3607426b27b6ca3
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Apr 13 22:57:12 2004 +0000
Fix for 3559764, make sure overflow is applied consistently using a separate bit on render objects, so that
the body scroll quirk can easily disable overflow even when it is present on the style.
Reviewed by kocienda
* khtml/ecma/kjs_dom.cpp:
(DOMNode::putValue):
* khtml/rendering/bidi.cpp:
(khtml::RenderBlock::layoutInlineChildren):
* khtml/rendering/render_block.cpp:
(khtml::RenderBlock::setStyle):
(khtml::RenderBlock::layoutBlock):
(khtml::RenderBlock::layoutBlockChildren):
(khtml::RenderBlock::paintObject):
(khtml::RenderBlock::rightOffset):
(khtml::RenderBlock::lowestPosition):
(khtml::RenderBlock::rightmostPosition):
(khtml::RenderBlock::leftmostPosition):
(khtml::RenderBlock::isPointInScrollbar):
(khtml::RenderBlock::nodeAtPoint):
(khtml::RenderBlock::inRootBlockContext):
* khtml/rendering/render_block.h:
(khtml::RenderBlock::overflowHeight):
(khtml::RenderBlock::overflowWidth):
* khtml/rendering/render_box.cpp:
(RenderBox::setStyle):
(RenderBox::contentWidth):
(RenderBox::contentHeight):
(RenderBox::absolutePosition):
(RenderBox::computeAbsoluteRepaintRect):
(RenderBox::calcAbsoluteVertical):
* khtml/rendering/render_flexbox.cpp:
(khtml::RenderFlexibleBox::layoutBlock):
* khtml/rendering/render_flow.cpp:
(RenderFlow::lowestPosition):
(RenderFlow::rightmostPosition):
(RenderFlow::leftmostPosition):
* khtml/rendering/render_layer.cpp:
(RenderLayer::updateLayerPosition):
(RenderLayer::updateScrollInfoAfterLayout):
(RenderLayer::intersectsDamageRect):
(RenderLayer::containsPoint):
* khtml/rendering/render_object.cpp:
(RenderObject::RenderObject):
(RenderObject::requiresLayer):
(RenderObject::clientWidth):
(RenderObject::clientHeight):
(RenderObject::scrollWidth):
(RenderObject::scrollHeight):
(RenderObject::setStyle):
(RenderObject::absolutePosition):
(RenderObject::nodeAtPoint):
(RenderObject::avoidsFloats):
* khtml/rendering/render_object.h:
(khtml::RenderObject::hasOverflowClip):
(khtml::RenderObject::hasAutoScrollbars):
(khtml::RenderObject::scrollsOverflow):
(khtml::RenderObject::includeScrollbarSize):
(khtml::RenderObject::setHasOverflowClip):
* khtml/rendering/render_style.h:
(khtml::RenderStyle::overflow):
(khtml::RenderStyle::isDisplayReplacedType):
(khtml::RenderStyle::isDisplayInlineType):
* khtml/rendering/render_table.cpp:
(RenderTable::setStyle):
(RenderTableCell::setStyle):
(RenderTableCell::requiresLayer):
* khtml/rendering/render_table.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 4b93c6e..a612e21 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,74 @@
+2004-04-13 David Hyatt <hyatt at apple.com>
+
+ Fix for 3559764, make sure overflow is applied consistently using a separate bit on render objects, so that
+ the body scroll quirk can easily disable overflow even when it is present on the style.
+
+ Reviewed by kocienda
+
+ * khtml/ecma/kjs_dom.cpp:
+ (DOMNode::putValue):
+ * khtml/rendering/bidi.cpp:
+ (khtml::RenderBlock::layoutInlineChildren):
+ * khtml/rendering/render_block.cpp:
+ (khtml::RenderBlock::setStyle):
+ (khtml::RenderBlock::layoutBlock):
+ (khtml::RenderBlock::layoutBlockChildren):
+ (khtml::RenderBlock::paintObject):
+ (khtml::RenderBlock::rightOffset):
+ (khtml::RenderBlock::lowestPosition):
+ (khtml::RenderBlock::rightmostPosition):
+ (khtml::RenderBlock::leftmostPosition):
+ (khtml::RenderBlock::isPointInScrollbar):
+ (khtml::RenderBlock::nodeAtPoint):
+ (khtml::RenderBlock::inRootBlockContext):
+ * khtml/rendering/render_block.h:
+ (khtml::RenderBlock::overflowHeight):
+ (khtml::RenderBlock::overflowWidth):
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::setStyle):
+ (RenderBox::contentWidth):
+ (RenderBox::contentHeight):
+ (RenderBox::absolutePosition):
+ (RenderBox::computeAbsoluteRepaintRect):
+ (RenderBox::calcAbsoluteVertical):
+ * khtml/rendering/render_flexbox.cpp:
+ (khtml::RenderFlexibleBox::layoutBlock):
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::lowestPosition):
+ (RenderFlow::rightmostPosition):
+ (RenderFlow::leftmostPosition):
+ * khtml/rendering/render_layer.cpp:
+ (RenderLayer::updateLayerPosition):
+ (RenderLayer::updateScrollInfoAfterLayout):
+ (RenderLayer::intersectsDamageRect):
+ (RenderLayer::containsPoint):
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::RenderObject):
+ (RenderObject::requiresLayer):
+ (RenderObject::clientWidth):
+ (RenderObject::clientHeight):
+ (RenderObject::scrollWidth):
+ (RenderObject::scrollHeight):
+ (RenderObject::setStyle):
+ (RenderObject::absolutePosition):
+ (RenderObject::nodeAtPoint):
+ (RenderObject::avoidsFloats):
+ * khtml/rendering/render_object.h:
+ (khtml::RenderObject::hasOverflowClip):
+ (khtml::RenderObject::hasAutoScrollbars):
+ (khtml::RenderObject::scrollsOverflow):
+ (khtml::RenderObject::includeScrollbarSize):
+ (khtml::RenderObject::setHasOverflowClip):
+ * khtml/rendering/render_style.h:
+ (khtml::RenderStyle::overflow):
+ (khtml::RenderStyle::isDisplayReplacedType):
+ (khtml::RenderStyle::isDisplayInlineType):
+ * khtml/rendering/render_table.cpp:
+ (RenderTable::setStyle):
+ (RenderTableCell::setStyle):
+ (RenderTableCell::requiresLayer):
+ * khtml/rendering/render_table.h:
+
2004-04-12 David Hyatt <hyatt at apple.com>
Fix for 3556036, make sure that when the position changes via style that all render layer
diff --git a/WebCore/khtml/ecma/kjs_dom.cpp b/WebCore/khtml/ecma/kjs_dom.cpp
index 6d5603a..741d75e 100644
--- a/WebCore/khtml/ecma/kjs_dom.cpp
+++ b/WebCore/khtml/ecma/kjs_dom.cpp
@@ -396,13 +396,13 @@ void DOMNode::putValue(ExecState *exec, int token, const Value& value, int /*att
break;
case ScrollTop: {
khtml::RenderObject *rend = node.handle() ? node.handle()->renderer() : 0L;
- if (rend && rend->layer() && rend->style()->hidesOverflow())
+ if (rend && rend->hasOverflowClip())
rend->layer()->scrollToYOffset(value.toInt32(exec));
break;
}
case ScrollLeft: {
khtml::RenderObject *rend = node.handle() ? node.handle()->renderer() : 0L;
- if (rend && rend->layer() && rend->style()->hidesOverflow())
+ if (rend && rend->hasOverflowClip())
rend->layer()->scrollToXOffset(value.toInt32(exec));
break;
}
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index 2235232..288cf52 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -1322,7 +1322,7 @@ QRect RenderBlock::layoutInlineChildren(bool relayoutChildren)
m_height = borderTop() + paddingTop();
int toAdd = borderBottom() + paddingBottom();
- if (style()->hidesOverflow() && m_layer)
+ if (includeScrollbarSize())
toAdd += m_layer->horizontalScrollbarHeight();
// Figure out if we should clear out our line boxes.
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 29416da..e76b4a4 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -69,9 +69,10 @@ RenderBlock::~RenderBlock()
void RenderBlock::setStyle(RenderStyle* _style)
{
+ setReplaced(_style->isDisplayReplacedType());
+
RenderFlow::setStyle(_style);
- setReplaced(style()->display()==INLINE_BLOCK);
-
+
m_pre = false;
if (_style->whiteSpace() == PRE)
m_pre = true;
@@ -319,13 +320,6 @@ void RenderBlock::removeChild(RenderObject *oldChild)
}
}
-bool RenderBlock::requiresLayer() {
- // FIXME: The bogus table cell check is only here until we figure out how to position
- // table cells properly when they have layers.
- // Note that we also restrict overflow to blocks for now.
- return !isTableCell() && (RenderObject::requiresLayer() || (style()->hidesOverflow() && !isBody()));
-}
-
bool RenderBlock::isSelfCollapsingBlock() const
{
// We are not self-collapsing if we
@@ -436,7 +430,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
m_maxBottomPosMargin = m_maxBottomNegMargin = 0;
}
- if (style()->scrollsOverflow() && m_layer) {
+ if (scrollsOverflow()) {
// For overflow:scroll blocks, ensure we have both scrollbars in place always.
if (style()->overflow() == OSCROLL) {
m_layer->setHasHorizontalScrollbar(true);
@@ -457,9 +451,9 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
// Expand our intrinsic height to encompass floats.
int toAdd = borderBottom() + paddingBottom();
- if (style()->includeScrollbarSize() && m_layer)
+ if (includeScrollbarSize())
toAdd += m_layer->horizontalScrollbarHeight();
- if ( hasOverhangingFloats() && (isInlineBlockOrInlineTable() || isFloatingOrPositioned() || style()->hidesOverflow() ||
+ if ( hasOverhangingFloats() && (isInlineBlockOrInlineTable() || isFloatingOrPositioned() || hasOverflowClip() ||
(parent() && parent()->isFlexibleBox())) )
m_height = floatBottom() + toAdd;
@@ -486,7 +480,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
m_height += borderBottom() + paddingBottom();
}
- if (m_overflowHeight > m_height && !style()->hidesOverflow())
+ if (m_overflowHeight > m_height && !hasOverflowClip())
m_height = m_overflowHeight + borderBottom() + paddingBottom();
}
@@ -507,7 +501,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
// Update our scroll information if we're overflow:auto/scroll/hidden now that we know if
// we overflow or not.
- if (style()->hidesOverflow() && m_layer)
+ if (hasOverflowClip())
m_layer->updateScrollInfoAfterLayout();
// Repaint with our new bounds if they are different from our old bounds.
@@ -533,7 +527,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
xPos = m_width - paddingRight() - borderRight();
int toAdd = borderBottom() + paddingBottom();
- if (style()->includeScrollbarSize() && m_layer)
+ if (includeScrollbarSize())
toAdd += m_layer->horizontalScrollbarHeight();
m_height = borderTop() + paddingTop();
@@ -564,7 +558,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
// For now we only worry about the top border/padding. We will update the variable's
// value when it comes time to check against the bottom border/padding.
bool canCollapseWithChildren = !isCanvas() && !isRoot() && !isPositioned() &&
- !isFloating() && !isTableCell() && !style()->hidesOverflow() && !isInlineBlockOrInlineTable();
+ !isFloating() && !isTableCell() && !hasOverflowClip() && !isInlineBlockOrInlineTable();
bool canCollapseTopWithChildren = canCollapseWithChildren && (m_height == 0);
// If any height other than auto is specified in CSS, then we don't collapse our bottom
@@ -1035,7 +1029,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
if (child->isRenderBlock() && !child->avoidsFloats())
prevFlow = static_cast<RenderBlock*>(child);
- if (child->hasOverhangingFloats() && !child->style()->hidesOverflow()) {
+ if (child->hasOverhangingFloats() && !child->hasOverflowClip()) {
// need to add the child's floats to our floating objects list, but not in the case where
// overflow is auto/scroll
addOverHangingFloats( static_cast<RenderBlock *>(child), -child->xPos(), -child->yPos(), true );
@@ -1248,7 +1242,7 @@ void RenderBlock::paintObject(PaintInfo& i, int _tx, int _ty)
// 2. paint contents
int scrolledX = _tx;
int scrolledY = _ty;
- if (style()->hidesOverflow() && m_layer)
+ if (hasOverflowClip())
m_layer->subtractScrollOffset(scrolledX, scrolledY);
for (RenderObject *child = firstChild(); child; child = child->nextSibling()) {
// Check for page-break-before: always, and if it's set, break and bail.
@@ -1590,7 +1584,7 @@ int
RenderBlock::rightOffset() const
{
int right = m_width - borderRight() - paddingRight();
- if (style()->includeScrollbarSize() && m_layer)
+ if (includeScrollbarSize())
right -= m_layer->verticalScrollbarWidth();
return right;
}
@@ -1666,7 +1660,7 @@ int
RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
{
int bottom = RenderFlow::lowestPosition(includeOverflowInterior, includeSelf);
- if (!includeOverflowInterior && style()->hidesOverflow())
+ if (!includeOverflowInterior && hasOverflowClip())
return bottom;
if (includeSelf && m_overflowHeight > bottom)
bottom = m_overflowHeight;
@@ -1704,7 +1698,7 @@ RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf) cons
int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSelf) const
{
int right = RenderFlow::rightmostPosition(includeOverflowInterior, includeSelf);
- if (!includeOverflowInterior && style()->hidesOverflow())
+ if (!includeOverflowInterior && hasOverflowClip())
return right;
if (includeSelf && m_overflowWidth > right)
right = m_overflowWidth;
@@ -1742,9 +1736,9 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf) const
{
int left = RenderFlow::leftmostPosition(includeOverflowInterior, includeSelf);
- if (!includeOverflowInterior && style()->hidesOverflow())
+ if (!includeOverflowInterior && hasOverflowClip())
return left;
-
+
// FIXME: Check left overflow when we eventually support it.
if (m_floatingObjects) {
@@ -1965,7 +1959,7 @@ int RenderBlock::getClearDelta(RenderObject *child)
bool RenderBlock::isPointInScrollbar(int _x, int _y, int _tx, int _ty)
{
- if (!style()->scrollsOverflow() || !m_layer)
+ if (!scrollsOverflow())
return false;
if (m_layer->verticalScrollbarWidth()) {
@@ -2003,7 +1997,7 @@ bool RenderBlock::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
if (hitTestAction != HitTestSelfOnly && m_floatingObjects && !inScrollbar) {
int stx = _tx + xPos();
int sty = _ty + yPos();
- if (style()->hidesOverflow() && m_layer)
+ if (hasOverflowClip())
m_layer->subtractScrollOffset(stx, sty);
if (isCanvas()) {
stx += static_cast<RenderCanvas*>(this)->view()->contentsX();
@@ -2661,7 +2655,7 @@ void RenderBlock::updateFirstLetter()
bool RenderBlock::inRootBlockContext() const
{
- if (isTableCell() || isFloatingOrPositioned() || style()->hidesOverflow())
+ if (isTableCell() || isFloatingOrPositioned() || hasOverflowClip())
return false;
if (isRoot() || isCanvas())
diff --git a/WebCore/khtml/rendering/render_block.h b/WebCore/khtml/rendering/render_block.h
index 592dbad..5f51f47 100644
--- a/WebCore/khtml/rendering/render_block.h
+++ b/WebCore/khtml/rendering/render_block.h
@@ -56,9 +56,9 @@ public:
// of the block (e.g., a <div style="height:25px"> that has a 100px tall image inside
// it would have an overflow height of borderTop() + paddingTop() + 100px.
virtual int overflowHeight(bool includeInterior=true) const
- { return (!includeInterior && style()->hidesOverflow()) ? m_height : m_overflowHeight; }
+ { return (!includeInterior && hasOverflowClip()) ? m_height : m_overflowHeight; }
virtual int overflowWidth(bool includeInterior=true) const
- { return (!includeInterior && style()->hidesOverflow()) ? m_width : m_overflowWidth; }
+ { return (!includeInterior && hasOverflowClip()) ? m_width : m_overflowWidth; }
virtual void setOverflowHeight(int h) { m_overflowHeight = h; }
virtual void setOverflowWidth(int w) { m_overflowWidth = w; }
@@ -181,9 +181,6 @@ public:
RootInlineBox* firstRootBox() { return static_cast<RootInlineBox*>(m_firstLineBox); }
RootInlineBox* lastRootBox() { return static_cast<RootInlineBox*>(m_lastLineBox); }
- // overrides RenderObject
- virtual bool requiresLayer();
-
// Obtains the nearest enclosing block (including this block) that contributes a first-line style to our inline
// children.
virtual RenderBlock* firstLineBlock() const;
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index 81ca6d8..ccb317a 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -75,7 +75,7 @@ void RenderBox::setStyle(RenderStyle *_style)
setShouldPaintBackgroundOrBorder(true);
setInline(_style->isDisplayInlineType());
-
+
switch(_style->position())
{
case ABSOLUTE:
@@ -92,6 +92,13 @@ void RenderBox::setStyle(RenderStyle *_style)
setRelPositioned(true);
}
+ // FIXME: Note that we restrict overflow to blocks for now. One day table bodies and cells
+ // will need to support overflow.
+ // We also deal with the body scroll quirk here, since it sets the scrollbars for the document.
+ if (_style->overflow() != OVISIBLE && isBlockFlow() && !isTableCell() &&
+ (!document()->isHTMLDocument() || !isBody()))
+ setHasOverflowClip();
+
if (requiresLayer()) {
if (!m_layer) {
m_layer = new (renderArena()) RenderLayer(this);
@@ -141,7 +148,7 @@ int RenderBox::contentWidth() const
int w = m_width - borderLeft() - borderRight();
w -= paddingLeft() + paddingRight();
- if (style()->includeScrollbarSize() && m_layer)
+ if (includeScrollbarSize())
w -= m_layer->verticalScrollbarWidth();
//kdDebug( 6040 ) << "RenderBox::contentWidth(2) = " << w << endl;
@@ -153,7 +160,7 @@ int RenderBox::contentHeight() const
int h = m_height - borderTop() - borderBottom();
h -= paddingTop() + paddingBottom();
- if (style()->includeScrollbarSize() && m_layer)
+ if (includeScrollbarSize())
h -= m_layer->horizontalScrollbarHeight();
return h;
@@ -526,24 +533,22 @@ int RenderBox::containingBlockWidth() const
bool RenderBox::absolutePosition(int &xPos, int &yPos, bool f)
{
- if ( style()->position() == FIXED )
+ if (style()->position() == FIXED)
f = true;
RenderObject *o = container();
- if( o && o->absolutePosition(xPos, yPos, f))
- {
- if (o->style()->hidesOverflow() && o->layer())
+ if (o && o->absolutePosition(xPos, yPos, f)) {
+ if (o->hasOverflowClip())
o->layer()->subtractScrollOffset(xPos, yPos);
- if(!isInline() || isReplaced())
+ if (!isInline() || isReplaced())
xPos += m_x, yPos += m_y;
- if(isRelPositioned())
+ if (isRelPositioned())
relativePositionOffset(xPos, yPos);
return true;
}
- else
- {
+ else {
xPos = yPos = 0;
return false;
}
@@ -635,9 +640,9 @@ void RenderBox::computeAbsoluteRepaintRect(QRect& r, bool f)
RenderObject* o = container();
if (o) {
- // <body> may not have a layer, since it might be applying its overflow value to the
+ // <body> may not have overflow, since it might be applying its overflow value to the
// scrollbars.
- if (o->style()->hidesOverflow() && o->layer()) {
+ if (o->hasOverflowClip()) {
// o->height() is inaccurate if we're in the middle of a layout of |o|, so use the
// layer's size instead. Even if the layer's size is wrong, the layer itself will repaint
// anyway if its size does change.
@@ -1386,7 +1391,7 @@ void RenderBox::calcAbsoluteVertical()
if (m_height<h+pab) //content must still fit
m_height = h+pab;
- if (style()->hidesOverflow() && m_height > h+pab)
+ if (hasOverflowClip() && m_height > h+pab)
m_height = h+pab;
// Do not allow the height to be negative. This can happen when someone specifies both top and bottom
diff --git a/WebCore/khtml/rendering/render_flexbox.cpp b/WebCore/khtml/rendering/render_flexbox.cpp
index 47e70e9..30586c2 100644
--- a/WebCore/khtml/rendering/render_flexbox.cpp
+++ b/WebCore/khtml/rendering/render_flexbox.cpp
@@ -271,7 +271,7 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
initMaxMarginValues();
- if (style()->scrollsOverflow() && m_layer) {
+ if (scrollsOverflow()) {
// For overflow:scroll blocks, ensure we have both scrollbars in place always.
if (style()->overflow() == OSCROLL) {
m_layer->setHasHorizontalScrollbar(true);
@@ -325,7 +325,7 @@ void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
// Update our scrollbars if we're overflow:auto/scroll/hidden now that we know if
// we overflow or not.
- if (style()->hidesOverflow() && m_layer)
+ if (hasOverflowClip())
m_layer->updateScrollInfoAfterLayout();
// Repaint with our new bounds if they are different from our old bounds.
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index e6fa455..653ae22 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -417,7 +417,7 @@ int
RenderFlow::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
{
int bottom = RenderBox::lowestPosition(includeOverflowInterior, includeSelf);
- if (!includeOverflowInterior && style()->hidesOverflow())
+ if (!includeOverflowInterior && hasOverflowClip())
return bottom;
// FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
@@ -437,7 +437,7 @@ RenderFlow::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
int RenderFlow::rightmostPosition(bool includeOverflowInterior, bool includeSelf) const
{
int right = RenderBox::rightmostPosition(includeOverflowInterior, includeSelf);
- if (!includeOverflowInterior && style()->hidesOverflow())
+ if (!includeOverflowInterior && hasOverflowClip())
return right;
// FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
@@ -457,7 +457,7 @@ int RenderFlow::rightmostPosition(bool includeOverflowInterior, bool includeSelf
int RenderFlow::leftmostPosition(bool includeOverflowInterior, bool includeSelf) const
{
int left = RenderBox::leftmostPosition(includeOverflowInterior, includeSelf);
- if (!includeOverflowInterior && style()->hidesOverflow())
+ if (!includeOverflowInterior && hasOverflowClip())
return left;
// FIXME: Come up with a way to use the layer tree to avoid visiting all the kids.
diff --git a/WebCore/khtml/rendering/render_layer.cpp b/WebCore/khtml/rendering/render_layer.cpp
index 8d9806f..b589e6e 100644
--- a/WebCore/khtml/rendering/render_layer.cpp
+++ b/WebCore/khtml/rendering/render_layer.cpp
@@ -190,7 +190,7 @@ void RenderLayer::updateLayerPosition()
setWidth(m_object->width());
setHeight(m_object->height());
- if (!m_object->style()->hidesOverflow()) {
+ if (!m_object->hasOverflowClip()) {
if (m_object->overflowWidth() > m_object->width())
setWidth(m_object->overflowWidth());
if (m_object->overflowHeight() > m_object->height())
@@ -640,7 +640,7 @@ RenderLayer::updateScrollInfoAfterLayout()
}
// overflow:auto may need to lay out again if scrollbars got added/removed.
- bool scrollbarsChanged = (m_object->style()->hasAutoScrollbars()) &&
+ bool scrollbarsChanged = (m_object->hasAutoScrollbars()) &&
(haveHorizontalBar != needHorizontalBar || haveVerticalBar != needVerticalBar);
if (scrollbarsChanged) {
setHasHorizontalScrollbar(needHorizontalBar);
@@ -1015,7 +1015,7 @@ void RenderLayer::calculateRects(const RenderLayer* rootLayer, const QRect& pain
bool RenderLayer::intersectsDamageRect(const QRect& layerBounds, const QRect& damageRect) const
{
return (renderer()->isCanvas() || renderer()->isRoot() || renderer()->isBody() ||
- (renderer()->hasOverhangingFloats() && !renderer()->style()->hidesOverflow()) ||
+ (renderer()->hasOverhangingFloats() && !renderer()->hasOverflowClip()) ||
(renderer()->isInline() && !renderer()->isReplaced()) ||
layerBounds.intersects(damageRect));
}
@@ -1023,7 +1023,7 @@ bool RenderLayer::intersectsDamageRect(const QRect& layerBounds, const QRect& da
bool RenderLayer::containsPoint(int x, int y, const QRect& damageRect) const
{
return (renderer()->isCanvas() || renderer()->isRoot() || renderer()->isBody() ||
- (renderer()->hasOverhangingFloats() && !renderer()->style()->hidesOverflow()) ||
+ (renderer()->hasOverhangingFloats() && !renderer()->hasOverflowClip()) ||
(renderer()->isInline() && !renderer()->isReplaced()) ||
damageRect.contains(x, y));
}
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 2a62bd1..983da89 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -147,7 +147,8 @@ m_inline( true ),
m_replaced( false ),
m_mouseInside( false ),
-m_isSelectionBorder( false )
+m_isSelectionBorder( false ),
+m_hasOverflowClip(false)
{
}
@@ -470,7 +471,8 @@ RenderLayer* RenderObject::enclosingLayer()
bool RenderObject::requiresLayer()
{
- return isRoot() || isPositioned() || isRelPositioned() || style()->opacity() < 1.0f;
+ return isRoot() || isPositioned() || isRelPositioned() || style()->opacity() < 1.0f ||
+ m_hasOverflowClip;
}
RenderBlock* RenderObject::firstLineBlock() const
@@ -537,14 +539,14 @@ int
RenderObject::clientWidth() const
{
return width() - borderLeft() - borderRight() -
- (style()->includeScrollbarSize() && layer() ? layer()->verticalScrollbarWidth() : 0);
+ (includeScrollbarSize() ? layer()->verticalScrollbarWidth() : 0);
}
int
RenderObject::clientHeight() const
{
return height() - borderTop() - borderBottom() -
- (style()->includeScrollbarSize() && layer() ? layer()->horizontalScrollbarHeight() : 0);
+ (includeScrollbarSize() ? layer()->horizontalScrollbarHeight() : 0);
}
// scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the
@@ -552,13 +554,13 @@ RenderObject::clientHeight() const
int
RenderObject::scrollWidth() const
{
- return (style()->hidesOverflow() && layer()) ? layer()->scrollWidth() : overflowWidth();
+ return hasOverflowClip() ? layer()->scrollWidth() : overflowWidth();
}
int
RenderObject::scrollHeight() const
{
- return (style()->hidesOverflow() && layer()) ? layer()->scrollHeight() : overflowHeight();
+ return hasOverflowClip() ? layer()->scrollHeight() : overflowHeight();
}
bool
@@ -1400,6 +1402,7 @@ void RenderObject::setStyle(RenderStyle *style)
m_positioned = false;
m_relPositioned = false;
m_paintBackground = false;
+ m_hasOverflowClip = false;
// no support for changing the display type dynamically... object must be
// detached and re-attached as a different type
//m_inline = true;
@@ -1485,7 +1488,7 @@ bool RenderObject::absolutePosition(int &xPos, int &yPos, bool f)
RenderObject* o = parent();
if (o) {
o->absolutePosition(xPos, yPos, f);
- if (o->style()->hidesOverflow() && o->layer())
+ if (o->hasOverflowClip())
o->layer()->subtractScrollOffset(xPos, yPos);
return true;
}
@@ -1780,7 +1783,7 @@ bool RenderObject::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int _ty,
inside = false;
int stx = _tx + xPos();
int sty = _ty + yPos();
- if (style()->hidesOverflow() && layer())
+ if (hasOverflowClip())
layer()->subtractScrollOffset(stx, sty);
for (RenderObject* child = lastChild(); child; child = child->previousSibling())
if (!child->layer() && !child->isFloating() &&
@@ -2102,7 +2105,7 @@ void RenderObject::collectBorders(QValueList<CollapsedBorderValue>& borderStyles
bool RenderObject::avoidsFloats() const
{
- return isReplaced() || isTable() || style()->hidesOverflow() || isHR() || isFlexibleBox();
+ return isReplaced() || isTable() || hasOverflowClip() || isHR() || isFlexibleBox();
}
bool RenderObject::usesLineWidth() const
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 3bdc19e..0b3fb7e 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -139,8 +139,7 @@ public:
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); }
bool hasClip() { return isPositioned() && style()->hasClip(); }
- bool hasOverflowClip() { return style()->hidesOverflow(); }
-
+
virtual int getBaselineOfFirstLineBox() { return -1; } // Tables and blocks implement this.
virtual InlineFlowBox* getFirstLineBox() { return 0; } // Tables and blocks implement this.
@@ -270,6 +269,14 @@ public:
bool isSelectionBorder() const { return m_isSelectionBorder; }
bool recalcMinMax() const { return m_recalcMinMax; }
+ bool hasOverflowClip() const { return m_hasOverflowClip; }
+ bool hasAutoScrollbars() const { return hasOverflowClip() &&
+ (style()->overflow() == OAUTO || style()->overflow() == OOVERLAY); }
+ bool scrollsOverflow() const { return hasOverflowClip() &&
+ (style()->overflow() == OSCROLL || hasAutoScrollbars()); }
+ bool includeScrollbarSize() const { return hasOverflowClip() &&
+ (style()->overflow() == OSCROLL || style()->overflow() == OAUTO); }
+
RenderStyle* getPseudoStyle(RenderStyle::PseudoId pseudo, RenderStyle* parentStyle = 0) const;
RenderCanvas* canvas() const;
@@ -319,6 +326,7 @@ public:
void setRenderText() { m_isText = true; }
void setReplaced(bool b=true) { m_replaced = b; }
void setIsSelectionBorder(bool b=true) { m_isSelectionBorder = b; }
+ void setHasOverflowClip(bool b = true) { m_hasOverflowClip = b; }
void scheduleRelayout();
@@ -771,6 +779,8 @@ private:
bool m_mouseInside : 1;
bool m_isSelectionBorder : 1;
+ bool m_hasOverflowClip : 1;
+
void arenaDelete(RenderArena *arena, void *objectBase);
// note: do not add unnecessary bitflags, we have 32 bit already!
diff --git a/WebCore/khtml/rendering/render_style.h b/WebCore/khtml/rendering/render_style.h
index b470169..ee1cb95 100644
--- a/WebCore/khtml/rendering/render_style.h
+++ b/WebCore/khtml/rendering/render_style.h
@@ -975,11 +975,6 @@ public:
const QColor & outlineColor() const { return background->outline.color; }
EOverflow overflow() const { return noninherited_flags._overflow; }
- bool hidesOverflow() const { return overflow() != OVISIBLE; }
- bool hasAutoScrollbars() const { return overflow() == OAUTO || overflow() == OOVERLAY; }
- bool scrollsOverflow() const { return overflow() == OSCROLL || hasAutoScrollbars(); }
- bool includeScrollbarSize() const { return overflow() == OSCROLL || overflow() == OAUTO; }
-
EVisibility visibility() const { return inherited_flags._visibility; }
EVerticalAlign verticalAlign() const { return noninherited_flags._vertical_align; }
Length verticalAlignLength() const { return box->vertical_align; }
@@ -1273,9 +1268,11 @@ public:
enum Diff { Equal, NonVisible = Equal, Visible, Position, Layout, CbLayout };
Diff diff( const RenderStyle *other ) const;
+ bool isDisplayReplacedType() {
+ return display() == INLINE_BLOCK || display() == INLINE_BOX || display() == INLINE_TABLE;
+ }
bool isDisplayInlineType() {
- return display() == INLINE || display() == INLINE_BLOCK || display() == INLINE_BOX ||
- display() == INLINE_TABLE;
+ return display() == INLINE || isDisplayReplacedType();
}
bool isOriginalDisplayInlineType() {
return originalDisplay() == INLINE || originalDisplay() == INLINE_BLOCK ||
diff --git a/WebCore/khtml/rendering/render_table.cpp b/WebCore/khtml/rendering/render_table.cpp
index 9d6e83a..db0a432 100644
--- a/WebCore/khtml/rendering/render_table.cpp
+++ b/WebCore/khtml/rendering/render_table.cpp
@@ -82,14 +82,8 @@ RenderTable::~RenderTable()
void RenderTable::setStyle(RenderStyle *_style)
{
ETableLayout oldTableLayout = style() ? style()->tableLayout() : TAUTO;
- if ( _style->display() == INLINE ) _style->setDisplay(INLINE_TABLE);
- if ( _style->display() != INLINE_TABLE ) _style->setDisplay(TABLE);
RenderBlock::setStyle(_style);
- // init RenderObject attributes
- setInline(style()->display()==INLINE_TABLE && !isPositioned());
- setReplaced(style()->display()==INLINE_TABLE);
-
// In the collapsed border model, there is no cell spacing.
hspacing = collapseBorders() ? 0 : style()->horizontalBorderSpacing();
vspacing = collapseBorders() ? 0 : style()->verticalBorderSpacing();
@@ -1741,6 +1735,12 @@ void RenderTableCell::setStyle( RenderStyle *style )
setShouldPaintBackgroundOrBorder(true);
}
+bool RenderTableCell::requiresLayer() {
+ // FIXME: This is only here until we figure out how to position
+ // table cells properly when they have layers.
+ return false;
+}
+
// The following rules apply for resolving conflicts and figuring out which border
// to use.
// (1) Borders with the 'border-style' of 'hidden' take precedence over all other conflicting
diff --git a/WebCore/khtml/rendering/render_table.h b/WebCore/khtml/rendering/render_table.h
index 9d61074..71518bf 100644
--- a/WebCore/khtml/rendering/render_table.h
+++ b/WebCore/khtml/rendering/render_table.h
@@ -319,6 +319,9 @@ public:
virtual const char *renderName() const { return "RenderTableCell"; }
virtual bool isTableCell() const { return true; }
+ // overrides RenderObject
+ virtual bool requiresLayer();
+
// ### FIX these two...
long cellIndex() const { return 0; }
void setCellIndex( long ) { }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list