summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderFlowThread.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-01 10:36:58 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-01 10:36:58 +0200
commitb1e9e47fa11f608ae16bc07f97a2acf95bf80272 (patch)
treec88c45e80c9c44506e7cdf9a3bb39ebf82a8cd5b /Source/WebCore/rendering/RenderFlowThread.cpp
parentbe01689f43cf6882cf670d33df49ead1f570c53a (diff)
downloadqtwebkit-b1e9e47fa11f608ae16bc07f97a2acf95bf80272.tar.gz
Imported WebKit commit 499c84c99aa98e9870fa7eaa57db476c6d160d46 (http://svn.webkit.org/repository/webkit/trunk@119200)
Weekly update :). Particularly relevant changes for Qt are the use of the WebCore image decoders and direct usage of libpng/libjpeg if available in the system.
Diffstat (limited to 'Source/WebCore/rendering/RenderFlowThread.cpp')
-rw-r--r--Source/WebCore/rendering/RenderFlowThread.cpp38
1 files changed, 14 insertions, 24 deletions
diff --git a/Source/WebCore/rendering/RenderFlowThread.cpp b/Source/WebCore/rendering/RenderFlowThread.cpp
index 3cffa34d0..507d3b395 100644
--- a/Source/WebCore/rendering/RenderFlowThread.cpp
+++ b/Source/WebCore/rendering/RenderFlowThread.cpp
@@ -51,7 +51,7 @@ RenderFlowThread::RenderFlowThread(Node* node)
, m_regionsInvalidated(false)
, m_regionsHaveUniformLogicalWidth(true)
, m_regionsHaveUniformLogicalHeight(true)
- , m_overflow(false)
+ , m_overset(false)
, m_regionLayoutUpdateEventTimer(this, &RenderFlowThread::regionLayoutUpdateEventTimerFired)
{
ASSERT(node->document()->cssRegionsEnabled());
@@ -169,16 +169,8 @@ void RenderFlowThread::layout()
region->deleteAllRenderBoxRegionInfo();
- LayoutUnit regionLogicalWidth;
- LayoutUnit regionLogicalHeight;
-
- if (isHorizontalWritingMode()) {
- regionLogicalWidth = region->contentWidth();
- regionLogicalHeight = region->contentHeight();
- } else {
- regionLogicalWidth = region->contentHeight();
- regionLogicalHeight = region->contentWidth();
- }
+ LayoutUnit regionLogicalWidth = region->logicalWidthForFlowThreadContent();
+ LayoutUnit regionLogicalHeight = region->logicalHeightForFlowThreadContent();
if (!m_hasValidRegions)
m_hasValidRegions = true;
@@ -199,15 +191,13 @@ void RenderFlowThread::layout()
RenderRegion* region = *iter;
if (!region->isValid())
continue;
- LayoutRect regionRect;
- if (isHorizontalWritingMode()) {
- regionRect = LayoutRect(style()->direction() == LTR ? ZERO_LAYOUT_UNIT : logicalWidth() - region->contentWidth(), logicalHeight, region->contentWidth(), region->contentHeight());
- logicalHeight += regionRect.height();
- } else {
- regionRect = LayoutRect(logicalHeight, style()->direction() == LTR ? ZERO_LAYOUT_UNIT : logicalWidth() - region->contentHeight(), region->contentWidth(), region->contentHeight());
- logicalHeight += regionRect.width();
- }
- region->setRegionRect(regionRect);
+
+ LayoutUnit regionLogicalWidth = region->logicalWidthForFlowThreadContent();
+ LayoutUnit regionLogicalHeight = region->logicalHeightForFlowThreadContent();
+
+ LayoutRect regionRect(style()->direction() == LTR ? ZERO_LAYOUT_UNIT : logicalWidth() - regionLogicalWidth, logicalHeight, regionLogicalWidth, regionLogicalHeight);
+ region->setRegionRect(isHorizontalWritingMode() ? regionRect : regionRect.transposedRect());
+ logicalHeight += regionLogicalHeight;
}
}
}
@@ -235,7 +225,7 @@ void RenderFlowThread::computeLogicalWidth()
if (!region->isValid())
continue;
ASSERT(!region->needsLayout());
- logicalWidth = max(isHorizontalWritingMode() ? region->contentWidth() : region->contentHeight(), logicalWidth);
+ logicalWidth = max(region->logicalWidthForFlowThreadContent(), logicalWidth);
}
setLogicalWidth(logicalWidth);
@@ -245,7 +235,7 @@ void RenderFlowThread::computeLogicalWidth()
if (!region->isValid())
continue;
- LayoutUnit regionLogicalWidth = isHorizontalWritingMode() ? region->contentWidth() : region->contentHeight();
+ LayoutUnit regionLogicalWidth = region->logicalWidthForFlowThreadContent();
if (regionLogicalWidth != logicalWidth) {
LayoutUnit logicalLeft = style()->direction() == LTR ? ZERO_LAYOUT_UNIT : logicalWidth - regionLogicalWidth;
region->setRenderBoxRegionInfo(this, logicalLeft, regionLogicalWidth, false);
@@ -262,7 +252,7 @@ void RenderFlowThread::computeLogicalHeight()
if (!region->isValid())
continue;
ASSERT(!region->needsLayout());
- logicalHeight += isHorizontalWritingMode() ? region->contentHeight() : region->contentWidth();
+ logicalHeight += region->logicalHeightForFlowThreadContent();
}
setLogicalHeight(logicalHeight);
@@ -729,7 +719,7 @@ void RenderFlowThread::computeOverflowStateForRegions(LayoutUnit oldClientAfterE
// With the regions overflow state computed we can also set the overflow for the named flow.
RenderRegion* lastReg = lastRegion();
- m_overflow = lastReg && (lastReg->regionState() == RenderRegion::RegionOverflow);
+ m_overset = lastReg && (lastReg->regionState() == RenderRegion::RegionOverflow);
}
void RenderFlowThread::regionLayoutUpdateEventTimerFired(Timer<RenderFlowThread>*)