diff options
author | Andrei Popescu <andreip@google.com> | 2009-08-19 14:09:30 +0100 |
---|---|---|
committer | Andrei Popescu <andreip@google.com> | 2009-08-19 14:09:30 +0100 |
commit | 058ccc7ba0a4d59b9f6e92808332aa9895425fc7 (patch) | |
tree | 276aad5a2bbc2fd7d65d21bfca42c9de88b3dd20 /WebCore/rendering/RenderBlock.cpp | |
parent | 2796dd1bf3b4b01e7e1d96ea91bd3a212f647579 (diff) | |
download | external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.zip external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.tar.gz external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.tar.bz2 |
Revert "Merge WebKit r47420"
This reverts commit d227fc870c7a697500a3c900c31baf05fb9a8524.
Diffstat (limited to 'WebCore/rendering/RenderBlock.cpp')
-rw-r--r-- | WebCore/rendering/RenderBlock.cpp | 81 |
1 files changed, 30 insertions, 51 deletions
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp index 03f5781..e10c331 100644 --- a/WebCore/rendering/RenderBlock.cpp +++ b/WebCore/rendering/RenderBlock.cpp @@ -33,7 +33,6 @@ #include "HTMLNames.h" #include "HitTestResult.h" #include "InlineTextBox.h" -#include "RenderFlexibleBox.h" #include "RenderImage.h" #include "RenderInline.h" #include "RenderMarquee.h" @@ -735,31 +734,6 @@ void RenderBlock::updateScrollInfoAfterLayout() } } -void RenderBlock::updateOverflowWithShadowAndReflection() -{ - if (hasOverflowClip()) - return; - - int shadowLeft; - int shadowRight; - int shadowTop; - int shadowBottom; - style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft); - - m_overflowLeft = min(m_overflowLeft, shadowLeft); - m_overflowWidth = max(m_overflowWidth, width() + shadowRight); - m_overflowTop = min(m_overflowTop, shadowTop); - m_overflowHeight = max(m_overflowHeight, height() + shadowBottom); - - if (hasReflection()) { - IntRect reflection(reflectionBox()); - m_overflowLeft = min(m_overflowLeft, reflection.x()); - m_overflowWidth = max(m_overflowWidth, reflection.right()); - m_overflowTop = min(m_overflowTop, reflection.y()); - m_overflowHeight = max(m_overflowHeight, reflection.bottom()); - } -} - void RenderBlock::layout() { // Update our first letter info now. @@ -910,7 +884,26 @@ void RenderBlock::layoutBlock(bool relayoutChildren) m_overflowWidth = max(m_overflowWidth, width()); m_overflowHeight = max(m_overflowHeight, height()); - updateOverflowWithShadowAndReflection(); + if (!hasOverflowClip()) { + int shadowLeft; + int shadowRight; + int shadowTop; + int shadowBottom; + style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft); + + m_overflowLeft = min(m_overflowLeft, shadowLeft); + m_overflowWidth = max(m_overflowWidth, width() + shadowRight); + m_overflowTop = min(m_overflowTop, shadowTop); + m_overflowHeight = max(m_overflowHeight, height() + shadowBottom); + + if (hasReflection()) { + IntRect reflection(reflectionBox()); + m_overflowLeft = min(m_overflowLeft, reflection.x()); + m_overflowWidth = max(m_overflowWidth, reflection.right()); + m_overflowTop = min(m_overflowTop, reflection.y()); + m_overflowHeight = max(m_overflowHeight, reflection.bottom()); + } + } statePusher.pop(); @@ -1039,10 +1032,7 @@ bool RenderBlock::handleRunInChild(RenderBox* child) // See if we have a run-in element with inline children. If the // children aren't inline, then just treat the run-in as a normal // block. - if (!child->isRunIn() || !child->childrenInline()) - return false; - // FIXME: We don't handle non-block elements with run-in for now. - if (!child->isRenderBlock()) + if (!child->isRunIn() || !child->childrenInline() && !child->isReplaced()) return false; // Get the next non-positioned/non-floating RenderBlock. @@ -3308,17 +3298,13 @@ int RenderBlock::getClearDelta(RenderBox* child, int yPos) // We also clear floats if we are too big to sit on the same line as a float (and wish to avoid floats by default). // FIXME: Note that the remaining space checks aren't quite accurate, since you should be able to clear only some floats (the minimum # needed // to fit) and not all (we should be using nextFloatBottomBelow and looping). + // Do not allow tables to wrap in quirks or even in almost strict mode + // (ebay on the PLT, finance.yahoo.com in the real world, versiontracker.com forces even almost strict mode not to work) int result = clearSet ? max(0, bottom - yPos) : 0; - if (!result && child->avoidsFloats()) { - int oldYPos = child->y(); - int oldWidth = child->width(); - child->setY(yPos); - child->calcWidth(); - if (child->width() > lineWidth(yPos, false) && child->minPrefWidth() <= availableWidth()) - result = max(0, floatBottom() - yPos); - child->setY(oldYPos); - child->setWidth(oldWidth); - } + if (!result && child->avoidsFloats() && child->style()->width().isFixed() && + child->minPrefWidth() > lineWidth(yPos, false) && child->minPrefWidth() <= availableWidth() && + document()->inStrictMode()) + result = max(0, floatBottom() - yPos); return result; } @@ -5135,20 +5121,13 @@ void RenderBlock::addFocusRingRects(GraphicsContext* graphicsContext, int tx, in ty - y() + inlineContinuation()->containingBlock()->y()); } -RenderBlock* RenderBlock::createAnonymousBlock(bool isFlexibleBox) const +RenderBlock* RenderBlock::createAnonymousBlock() const { RefPtr<RenderStyle> newStyle = RenderStyle::create(); newStyle->inheritFrom(style()); + newStyle->setDisplay(BLOCK); - RenderBlock* newBox = 0; - if (isFlexibleBox) { - newStyle->setDisplay(BOX); - newBox = new (renderArena()) RenderFlexibleBox(document() /* anonymous box */); - } else { - newStyle->setDisplay(BLOCK); - newBox = new (renderArena()) RenderBlock(document() /* anonymous box */); - } - + RenderBlock* newBox = new (renderArena()) RenderBlock(document() /* anonymous box */); newBox->setStyle(newStyle.release()); return newBox; } |