summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderBlock.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-15 16:08:57 +0200
commit5466563f4b5b6b86523e3f89bb7f77e5b5270c78 (patch)
tree8caccf7cd03a15207cde3ba282c88bf132482a91 /Source/WebCore/rendering/RenderBlock.cpp
parent33b26980cb24288b5a9f2590ccf32a949281bb79 (diff)
downloadqtwebkit-5466563f4b5b6b86523e3f89bb7f77e5b5270c78.tar.gz
Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)
WebKit update which introduces the QtWebKitWidgets module that contains the WK1 widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're working on completing the entire split as part of https://bugs.webkit.org/show_bug.cgi?id=99314
Diffstat (limited to 'Source/WebCore/rendering/RenderBlock.cpp')
-rwxr-xr-xSource/WebCore/rendering/RenderBlock.cpp67
1 files changed, 37 insertions, 30 deletions
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index 31e640796..07afe74b0 100755
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -62,7 +62,7 @@
#include "TransformState.h"
#include <wtf/StdLibExtras.h>
#if ENABLE(CSS_EXCLUSIONS)
-#include "WrapShapeInfo.h"
+#include "ExclusionShapeInsideInfo.h"
#endif
using namespace std;
@@ -279,7 +279,7 @@ void RenderBlock::willBeDestroyed()
lineGridBox()->destroy(renderArena());
#if ENABLE(CSS_EXCLUSIONS)
- WrapShapeInfo::removeWrapShapeInfoForRenderBlock(this);
+ ExclusionShapeInsideInfo::removeExclusionShapeInsideInfoForRenderBlock(this);
#endif
if (UNLIKELY(gDelayedUpdateScrollInfoSet != 0))
@@ -328,9 +328,9 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
RenderBox::styleDidChange(diff, oldStyle);
#if ENABLE(CSS_EXCLUSIONS)
- // FIXME: Bug 89993: Style changes should affect the WrapShapeInfos for other render blocks that
- // share the same WrapShapeInfo
- updateWrapShapeInfoAfterStyleChange(style()->wrapShapeInside(), oldStyle ? oldStyle->wrapShapeInside() : 0);
+ // FIXME: Bug 89993: Style changes should affect the ExclusionShapeInsideInfos for other render blocks that
+ // share the same ExclusionShapeInsideInfo
+ updateExclusionShapeInsideInfoAfterStyleChange(style()->shapeInside(), oldStyle ? oldStyle->shapeInside() : 0);
#endif
if (!isAnonymousBlock()) {
@@ -1355,6 +1355,15 @@ void RenderBlock::finishDelayUpdateScrollInfo()
void RenderBlock::updateScrollInfoAfterLayout()
{
if (hasOverflowClip()) {
+ if (style()->isFlippedBlocksWritingMode()) {
+ // FIXME: https://bugs.webkit.org/show_bug.cgi?id=97937
+ // Workaround for now. We cannot delay the scroll info for overflow
+ // for items with opposite writing directions, as the contents needs
+ // to overflow in that direction
+ layer()->updateScrollInfoAfterLayout();
+ return;
+ }
+
if (gDelayUpdateScrollInfo)
gDelayedUpdateScrollInfoSet->add(this);
else
@@ -1380,24 +1389,24 @@ void RenderBlock::layout()
}
#if ENABLE(CSS_EXCLUSIONS)
-void RenderBlock::updateWrapShapeInfoAfterStyleChange(const BasicShape* wrapShape, const BasicShape* oldWrapShape)
+void RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape* shapeInside, const BasicShape* oldShapeInside)
{
// FIXME: A future optimization would do a deep comparison for equality.
- if (wrapShape == oldWrapShape)
+ if (shapeInside == oldShapeInside)
return;
- if (wrapShape) {
- WrapShapeInfo* wrapShapeInfo = WrapShapeInfo::ensureWrapShapeInfoForRenderBlock(this);
- wrapShapeInfo->dirtyWrapShapeSize();
+ if (shapeInside) {
+ ExclusionShapeInsideInfo* exclusionShapeInsideInfo = ExclusionShapeInsideInfo::ensureExclusionShapeInsideInfoForRenderBlock(this);
+ exclusionShapeInsideInfo->dirtyShapeSize();
} else
- WrapShapeInfo::removeWrapShapeInfoForRenderBlock(this);
+ ExclusionShapeInsideInfo::removeExclusionShapeInsideInfoForRenderBlock(this);
}
#endif
void RenderBlock::updateRegionsAndExclusionsLogicalSize()
{
#if ENABLE(CSS_EXCLUSIONS)
- if (!inRenderFlowThread() && !wrapShapeInfo())
+ if (!inRenderFlowThread() && !exclusionShapeInsideInfo())
#else
if (!inRenderFlowThread())
#endif
@@ -1426,10 +1435,10 @@ void RenderBlock::updateRegionsAndExclusionsLogicalSize()
#if ENABLE(CSS_EXCLUSIONS)
void RenderBlock::computeExclusionShapeSize()
{
- WrapShapeInfo* wrapShapeInfo = this->wrapShapeInfo();
- if (wrapShapeInfo) {
+ ExclusionShapeInsideInfo* exclusionShapeInsideInfo = this->exclusionShapeInsideInfo();
+ if (exclusionShapeInsideInfo) {
bool percentageLogicalHeightResolvable = percentageLogicalHeightIsResolvableFromBlock(this, false);
- wrapShapeInfo->computeShapeSize(logicalWidth(), percentageLogicalHeightResolvable ? logicalHeight() : ZERO_LAYOUT_UNIT);
+ exclusionShapeInsideInfo->computeShapeSize(logicalWidth(), percentageLogicalHeightResolvable ? logicalHeight() : ZERO_LAYOUT_UNIT);
}
}
#endif
@@ -1534,14 +1543,6 @@ void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
setMarginBeforeQuirk(styleToUse->marginBefore().quirk());
setMarginAfterQuirk(styleToUse->marginAfter().quirk());
-
- Node* n = node();
- if (n && n->hasTagName(formTag) && static_cast<HTMLFormElement*>(n)->isMalformed()) {
- // See if this form is malformed (i.e., unclosed). If so, don't give the form
- // a bottom margin.
- setMaxMarginAfterValues(0, 0);
- }
-
setPaginationStrut(0);
}
@@ -3249,7 +3250,7 @@ bool RenderBlock::isSelectionRoot() const
return false;
}
-GapRects RenderBlock::selectionGapRectsForRepaint(RenderBoxModelObject* repaintContainer)
+GapRects RenderBlock::selectionGapRectsForRepaint(RenderLayerModelObject* repaintContainer)
{
ASSERT(!needsLayout());
@@ -4428,7 +4429,7 @@ void RenderBlock::clearFloats()
RendererToFloatInfoMap::iterator end = floatMap.end();
for (RendererToFloatInfoMap::iterator it = floatMap.begin(); it != end; ++it) {
- FloatingObject* floatingObject = (*it).second;
+ FloatingObject* floatingObject = (*it).value;
if (!floatingObject->isDescendant()) {
changeLogicalTop = 0;
changeLogicalBottom = max(changeLogicalBottom, logicalBottomForFloat(floatingObject));
@@ -5784,6 +5785,7 @@ void RenderBlock::computeInlinePreferredLogicalWidths()
bool addedTextIndent = false; // Only gets added in once.
LayoutUnit textIndent = minimumValueForLength(styleToUse->textIndent(), cw, view());
RenderObject* prevFloat = 0;
+ bool isPrevChildInlineFlow = false;
while (RenderObject* child = childIterator.next()) {
autoWrap = child->isReplaced() ? child->parent()->style()->autoWrap() :
child->style()->autoWrap();
@@ -5872,7 +5874,7 @@ void RenderBlock::computeInlinePreferredLogicalWidths()
clearPreviousFloat = false;
bool canBreakReplacedElement = !child->isImage() || allowImagesToBreak;
- if ((canBreakReplacedElement && (autoWrap || oldAutoWrap)) || clearPreviousFloat) {
+ if ((canBreakReplacedElement && (autoWrap || oldAutoWrap) && !isPrevChildInlineFlow) || clearPreviousFloat) {
updatePreferredWidth(m_minPreferredLogicalWidth, inlineMin);
inlineMin = 0;
}
@@ -5899,7 +5901,7 @@ void RenderBlock::computeInlinePreferredLogicalWidths()
// Add our width to the max.
inlineMax += max<float>(0, childMax);
- if (!autoWrap || !canBreakReplacedElement) {
+ if (!autoWrap || !canBreakReplacedElement || isPrevChildInlineFlow) {
if (child->isFloating())
updatePreferredWidth(m_minPreferredLogicalWidth, childMin);
else
@@ -6026,6 +6028,11 @@ void RenderBlock::computeInlinePreferredLogicalWidths()
addedTextIndent = true;
}
+ if (!child->isText() && child->isRenderInline())
+ isPrevChildInlineFlow = true;
+ else
+ isPrevChildInlineFlow = false;
+
oldAutoWrap = autoWrap;
}
@@ -6763,13 +6770,13 @@ void RenderBlock::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const
// https://bugs.webkit.org/show_bug.cgi?id=46781
FloatRect localRect(0, -collapsedMarginBefore(),
width(), height() + collapsedMarginBefore() + collapsedMarginAfter());
- quads.append(localToAbsoluteQuad(localRect, false, wasFixed));
+ quads.append(localToAbsoluteQuad(localRect, 0 /* mode */, wasFixed));
continuation()->absoluteQuads(quads, wasFixed);
} else
- quads.append(RenderBox::localToAbsoluteQuad(FloatRect(0, 0, width(), height()), false, wasFixed));
+ quads.append(RenderBox::localToAbsoluteQuad(FloatRect(0, 0, width(), height()), 0 /* mode */, wasFixed));
}
-LayoutRect RenderBlock::rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, LayoutUnit outlineWidth) const
+LayoutRect RenderBlock::rectWithOutlineForRepaint(RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const
{
LayoutRect r(RenderBox::rectWithOutlineForRepaint(repaintContainer, outlineWidth));
if (isAnonymousBlockContinuation())