|
Lines 1259-1265
void RenderBlock::layoutBlock(bool relay
Source/WebCore/rendering/RenderBlock.cpp_sec1
|
| 1259 |
statePusher.pop(); |
1259 |
statePusher.pop(); |
| 1260 |
|
1260 |
|
| 1261 |
if (view()->layoutState()->m_pageLogicalHeight) |
1261 |
if (view()->layoutState()->m_pageLogicalHeight) |
| 1262 |
setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(y())); |
1262 |
setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(logicalTop())); |
| 1263 |
|
1263 |
|
| 1264 |
updateLayerTransform(); |
1264 |
updateLayerTransform(); |
| 1265 |
|
1265 |
|
|
Lines 1322-1331
void RenderBlock::addOverflowFromChildre
Source/WebCore/rendering/RenderBlock.cpp_sec2
|
| 1322 |
ColumnInfo* colInfo = columnInfo(); |
1322 |
ColumnInfo* colInfo = columnInfo(); |
| 1323 |
if (columnCount(colInfo)) { |
1323 |
if (columnCount(colInfo)) { |
| 1324 |
IntRect lastRect = columnRectAt(colInfo, columnCount(colInfo) - 1); |
1324 |
IntRect lastRect = columnRectAt(colInfo, columnCount(colInfo) - 1); |
| 1325 |
int overflowLeft = !style()->isLeftToRightDirection() ? min(0, lastRect.x()) : 0; |
1325 |
if (style()->isHorizontalWritingMode()) { |
| 1326 |
int overflowRight = style()->isLeftToRightDirection() ? max(width(), lastRect.x() + lastRect.width()) : 0; |
1326 |
int overflowLeft = !style()->isLeftToRightDirection() ? min(0, lastRect.x()) : 0; |
| 1327 |
int overflowHeight = borderTop() + paddingTop() + colInfo->columnHeight(); |
1327 |
int overflowRight = style()->isLeftToRightDirection() ? max(width(), lastRect.x() + lastRect.width()) : 0; |
| 1328 |
addLayoutOverflow(IntRect(overflowLeft, 0, overflowRight - overflowLeft, overflowHeight)); |
1328 |
int overflowHeight = borderBefore() + paddingBefore() + colInfo->columnHeight(); |
|
|
1329 |
addLayoutOverflow(IntRect(overflowLeft, 0, overflowRight - overflowLeft, overflowHeight)); |
| 1330 |
} else { |
| 1331 |
IntRect lastRect = columnRectAt(colInfo, columnCount(colInfo) - 1); |
| 1332 |
int overflowTop = !style()->isLeftToRightDirection() ? min(0, lastRect.y()) : 0; |
| 1333 |
int overflowBottom = style()->isLeftToRightDirection() ? max(height(), lastRect.y() + lastRect.height()) : 0; |
| 1334 |
int overflowWidth = borderBefore() + paddingBefore() + colInfo->columnHeight(); |
| 1335 |
addLayoutOverflow(IntRect(0, overflowTop, overflowWidth, overflowBottom - overflowTop)); |
| 1336 |
} |
| 1329 |
} |
1337 |
} |
| 1330 |
} |
1338 |
} |
| 1331 |
} |
1339 |
} |
|
Lines 1375-1381
void RenderBlock::addOverflowFromFloats(
Source/WebCore/rendering/RenderBlock.cpp_sec3
|
| 1375 |
DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); |
1383 |
DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); |
| 1376 |
for (; (r = it.current()); ++it) { |
1384 |
for (; (r = it.current()); ++it) { |
| 1377 |
if (r->m_isDescendant) |
1385 |
if (r->m_isDescendant) |
| 1378 |
addOverflowFromChild(r->m_renderer, IntSize(r->left() + r->m_renderer->marginLeft(), r->top() + r->m_renderer->marginTop())); |
1386 |
addOverflowFromChild(r->m_renderer, IntSize(leftForFloatIncludingMargin(r), topForFloatIncludingMargin(r))); |
| 1379 |
} |
1387 |
} |
| 1380 |
return; |
1388 |
return; |
| 1381 |
} |
1389 |
} |
|
Lines 1641-1647
int RenderBlock::collapseMargins(RenderB
Source/WebCore/rendering/RenderBlock.cpp_sec4
|
| 1641 |
bool paginated = view()->layoutState()->isPaginated(); |
1649 |
bool paginated = view()->layoutState()->isPaginated(); |
| 1642 |
if (paginated && logicalTop > beforeCollapseLogicalTop) { |
1650 |
if (paginated && logicalTop > beforeCollapseLogicalTop) { |
| 1643 |
int oldLogicalTop = logicalTop; |
1651 |
int oldLogicalTop = logicalTop; |
| 1644 |
logicalTop = min(logicalTop, nextPageTop(beforeCollapseLogicalTop)); |
1652 |
logicalTop = min(logicalTop, nextPageLogicalTop(beforeCollapseLogicalTop)); |
| 1645 |
setLogicalHeight(logicalHeight() + (logicalTop - oldLogicalTop)); |
1653 |
setLogicalHeight(logicalHeight() + (logicalTop - oldLogicalTop)); |
| 1646 |
} |
1654 |
} |
| 1647 |
return logicalTop; |
1655 |
return logicalTop; |
|
Lines 1711-1717
int RenderBlock::estimateLogicalTopPosit
Source/WebCore/rendering/RenderBlock.cpp_sec5
|
| 1711 |
// Adjust logicalTopEstimate down to the next page if the margins are so large that we don't fit on the current |
1719 |
// Adjust logicalTopEstimate down to the next page if the margins are so large that we don't fit on the current |
| 1712 |
// page. |
1720 |
// page. |
| 1713 |
if (paginated && logicalTopEstimate > logicalHeight()) |
1721 |
if (paginated && logicalTopEstimate > logicalHeight()) |
| 1714 |
logicalTopEstimate = min(logicalTopEstimate, nextPageTop(logicalHeight())); |
1722 |
logicalTopEstimate = min(logicalTopEstimate, nextPageLogicalTop(logicalHeight())); |
| 1715 |
|
1723 |
|
| 1716 |
logicalTopEstimate += getClearDelta(child, logicalTopEstimate); |
1724 |
logicalTopEstimate += getClearDelta(child, logicalTopEstimate); |
| 1717 |
|
1725 |
|
|
Lines 2054-2060
void RenderBlock::layoutBlockChild(Rende
Source/WebCore/rendering/RenderBlock.cpp_sec6
|
| 2054 |
|
2062 |
|
| 2055 |
if (paginated) { |
2063 |
if (paginated) { |
| 2056 |
// Check for an after page/column break. |
2064 |
// Check for an after page/column break. |
| 2057 |
int newHeight = applyAfterBreak(child, height(), marginInfo); |
2065 |
int newHeight = applyAfterBreak(child, logicalHeight(), marginInfo); |
| 2058 |
if (newHeight != height()) |
2066 |
if (newHeight != height()) |
| 2059 |
setLogicalHeight(newHeight); |
2067 |
setLogicalHeight(newHeight); |
| 2060 |
} |
2068 |
} |
|
Lines 2151-2157
void RenderBlock::markForPaginationRelay
Source/WebCore/rendering/RenderBlock.cpp_sec7
|
| 2151 |
if (needsLayout()) |
2159 |
if (needsLayout()) |
| 2152 |
return; |
2160 |
return; |
| 2153 |
|
2161 |
|
| 2154 |
if (view()->layoutState()->pageLogicalHeightChanged() || (view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(y()) != pageLogicalOffset())) |
2162 |
if (view()->layoutState()->pageLogicalHeightChanged() || (view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(logicalTop()) != pageLogicalOffset())) |
| 2155 |
setChildNeedsLayout(true, false); |
2163 |
setChildNeedsLayout(true, false); |
| 2156 |
} |
2164 |
} |
| 2157 |
|
2165 |
|
|
Lines 2228-2259
void RenderBlock::paintColumnRules(Paint
Source/WebCore/rendering/RenderBlock.cpp_sec8
|
| 2228 |
// We need to do multiple passes, breaking up our child painting into strips. |
2236 |
// We need to do multiple passes, breaking up our child painting into strips. |
| 2229 |
ColumnInfo* colInfo = columnInfo(); |
2237 |
ColumnInfo* colInfo = columnInfo(); |
| 2230 |
unsigned colCount = columnCount(colInfo); |
2238 |
unsigned colCount = columnCount(colInfo); |
| 2231 |
int currXOffset = style()->isLeftToRightDirection() ? 0 : contentWidth(); |
2239 |
int currLogicalLeftOffset = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth(); |
| 2232 |
int ruleAdd = borderLeft() + paddingLeft(); |
2240 |
int ruleAdd = logicalLeftOffsetForContent(); |
| 2233 |
int ruleX = style()->isLeftToRightDirection() ? 0 : contentWidth(); |
2241 |
int ruleLogicalLeft = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth(); |
| 2234 |
for (unsigned i = 0; i < colCount; i++) { |
2242 |
for (unsigned i = 0; i < colCount; i++) { |
| 2235 |
IntRect colRect = columnRectAt(colInfo, i); |
2243 |
IntRect colRect = columnRectAt(colInfo, i); |
| 2236 |
|
2244 |
|
|
|
2245 |
int inlineDirectionSize = style()->isHorizontalWritingMode() ? colRect.width() : colRect.height(); |
| 2246 |
|
| 2237 |
// Move to the next position. |
2247 |
// Move to the next position. |
| 2238 |
if (style()->isLeftToRightDirection()) { |
2248 |
if (style()->isLeftToRightDirection()) { |
| 2239 |
ruleX += colRect.width() + colGap / 2; |
2249 |
ruleLogicalLeft += inlineDirectionSize + colGap / 2; |
| 2240 |
currXOffset += colRect.width() + colGap; |
2250 |
currLogicalLeftOffset += inlineDirectionSize + colGap; |
| 2241 |
} else { |
2251 |
} else { |
| 2242 |
ruleX -= (colRect.width() + colGap / 2); |
2252 |
ruleLogicalLeft -= (inlineDirectionSize + colGap / 2); |
| 2243 |
currXOffset -= (colRect.width() + colGap); |
2253 |
currLogicalLeftOffset -= (inlineDirectionSize + colGap); |
| 2244 |
} |
2254 |
} |
| 2245 |
|
2255 |
|
| 2246 |
// Now paint the column rule. |
2256 |
// Now paint the column rule. |
| 2247 |
if (i < colCount - 1) { |
2257 |
if (i < colCount - 1) { |
| 2248 |
int ruleStart = tx + ruleX - ruleWidth / 2 + ruleAdd; |
2258 |
int ruleLeft = style()->isHorizontalWritingMode() ? tx + ruleLogicalLeft - ruleWidth / 2 + ruleAdd : tx + borderBefore() + paddingBefore(); |
| 2249 |
int ruleEnd = ruleStart + ruleWidth; |
2259 |
int ruleRight = style()->isHorizontalWritingMode() ? ruleLeft + ruleWidth : ruleLeft + contentWidth(); |
| 2250 |
int ruleTop = ty + borderTop() + paddingTop(); |
2260 |
int ruleTop = style()->isHorizontalWritingMode() ? ty + borderTop() + paddingTop() : ty + ruleLogicalLeft - ruleWidth / 2 + ruleAdd; |
| 2251 |
int ruleBottom = ruleTop + contentHeight(); |
2261 |
int ruleBottom = style()->isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleWidth; |
| 2252 |
drawLineForBoxSide(paintInfo.context, ruleStart, ruleTop, ruleEnd, ruleBottom, |
2262 |
drawLineForBoxSide(paintInfo.context, ruleLeft, ruleTop, ruleRight, ruleBottom, |
| 2253 |
style()->isLeftToRightDirection() ? BSLeft : BSRight, ruleColor, ruleStyle, 0, 0); |
2263 |
style()->isLeftToRightDirection() ? BSLeft : BSRight, ruleColor, ruleStyle, 0, 0); |
| 2254 |
} |
2264 |
} |
| 2255 |
|
2265 |
|
| 2256 |
ruleX = currXOffset; |
2266 |
ruleLogicalLeft = currLogicalLeftOffset; |
| 2257 |
} |
2267 |
} |
| 2258 |
} |
2268 |
} |
| 2259 |
|
2269 |
|
|
Lines 2261-2276
void RenderBlock::paintColumnContents(Pa
Source/WebCore/rendering/RenderBlock.cpp_sec9
|
| 2261 |
{ |
2271 |
{ |
| 2262 |
// We need to do multiple passes, breaking up our child painting into strips. |
2272 |
// We need to do multiple passes, breaking up our child painting into strips. |
| 2263 |
GraphicsContext* context = paintInfo.context; |
2273 |
GraphicsContext* context = paintInfo.context; |
| 2264 |
int colGap = columnGap(); |
|
|
| 2265 |
ColumnInfo* colInfo = columnInfo(); |
2274 |
ColumnInfo* colInfo = columnInfo(); |
| 2266 |
unsigned colCount = columnCount(colInfo); |
2275 |
unsigned colCount = columnCount(colInfo); |
| 2267 |
if (!colCount) |
2276 |
if (!colCount) |
| 2268 |
return; |
2277 |
return; |
| 2269 |
int currXOffset = style()->isLeftToRightDirection() ? 0 : contentWidth() - columnRectAt(colInfo, 0).width(); |
2278 |
IntRect firstColRect = columnRectAt(colInfo, 0); |
| 2270 |
int currYOffset = 0; |
2279 |
int currLogicalTopOffset = 0; |
| 2271 |
for (unsigned i = 0; i < colCount; i++) { |
2280 |
for (unsigned i = 0; i < colCount; i++) { |
| 2272 |
// For each rect, we clip to the rect, and then we adjust our coords. |
2281 |
// For each rect, we clip to the rect, and then we adjust our coords. |
| 2273 |
IntRect colRect = columnRectAt(colInfo, i); |
2282 |
IntRect colRect = columnRectAt(colInfo, i); |
|
|
2283 |
flipForWritingMode(colRect); |
| 2284 |
int logicalLeftOffset = (style()->isHorizontalWritingMode() ? colRect.x() : colRect.y()) - logicalLeftOffsetForContent(); |
| 2285 |
IntSize offset = style()->isHorizontalWritingMode() ? IntSize(logicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, logicalLeftOffset); |
| 2274 |
colRect.move(tx, ty); |
2286 |
colRect.move(tx, ty); |
| 2275 |
PaintInfo info(paintInfo); |
2287 |
PaintInfo info(paintInfo); |
| 2276 |
info.rect.intersect(colRect); |
2288 |
info.rect.intersect(colRect); |
|
Lines 2281-2290
void RenderBlock::paintColumnContents(Pa
Source/WebCore/rendering/RenderBlock.cpp_sec10
|
| 2281 |
// Each strip pushes a clip, since column boxes are specified as being |
2293 |
// Each strip pushes a clip, since column boxes are specified as being |
| 2282 |
// like overflow:hidden. |
2294 |
// like overflow:hidden. |
| 2283 |
context->clip(colRect); |
2295 |
context->clip(colRect); |
| 2284 |
|
2296 |
|
| 2285 |
// Adjust our x and y when painting. |
2297 |
// Adjust our x and y when painting. |
| 2286 |
int finalX = tx + currXOffset; |
2298 |
int finalX = tx + offset.width(); |
| 2287 |
int finalY = ty + currYOffset; |
2299 |
int finalY = ty + offset.height(); |
| 2288 |
if (paintingFloats) |
2300 |
if (paintingFloats) |
| 2289 |
paintFloats(info, finalX, finalY, paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip); |
2301 |
paintFloats(info, finalX, finalY, paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip); |
| 2290 |
else |
2302 |
else |
|
Lines 2292-2305
void RenderBlock::paintColumnContents(Pa
Source/WebCore/rendering/RenderBlock.cpp_sec11
|
| 2292 |
|
2304 |
|
| 2293 |
context->restore(); |
2305 |
context->restore(); |
| 2294 |
} |
2306 |
} |
| 2295 |
|
2307 |
|
| 2296 |
// Move to the next position. |
2308 |
int blockDelta = (style()->isHorizontalWritingMode() ? colRect.height() : colRect.width()); |
| 2297 |
if (style()->isLeftToRightDirection()) |
2309 |
if (style()->isFlippedBlocksWritingMode()) |
| 2298 |
currXOffset += colRect.width() + colGap; |
2310 |
currLogicalTopOffset += blockDelta; |
| 2299 |
else |
2311 |
else |
| 2300 |
currXOffset -= (colRect.width() + colGap); |
2312 |
currLogicalTopOffset -= blockDelta; |
| 2301 |
|
|
|
| 2302 |
currYOffset -= colRect.height(); |
| 2303 |
} |
2313 |
} |
| 2304 |
} |
2314 |
} |
| 2305 |
|
2315 |
|
|
Lines 2488-2494
void RenderBlock::paintFloats(PaintInfo&
Source/WebCore/rendering/RenderBlock.cpp_sec12
|
| 2488 |
if (r->m_shouldPaint && !r->m_renderer->hasSelfPaintingLayer()) { |
2498 |
if (r->m_shouldPaint && !r->m_renderer->hasSelfPaintingLayer()) { |
| 2489 |
PaintInfo currentPaintInfo(paintInfo); |
2499 |
PaintInfo currentPaintInfo(paintInfo); |
| 2490 |
currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground; |
2500 |
currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground; |
| 2491 |
IntPoint childPoint = flipForWritingMode(r->m_renderer, IntPoint(tx + r->left() + r->m_renderer->marginLeft() - r->m_renderer->x(), ty + r->top() + r->m_renderer->marginTop() - r->m_renderer->y()), ParentToChildFlippingAdjustment); |
2501 |
IntPoint childPoint = flipForWritingMode(r->m_renderer, IntPoint(tx + leftForFloatIncludingMargin(r) - r->m_renderer->x(), ty + topForFloatIncludingMargin(r) - r->m_renderer->y()), ParentToChildFlippingAdjustment); |
| 2492 |
r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y()); |
2502 |
r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y()); |
| 2493 |
if (!preservePhase) { |
2503 |
if (!preservePhase) { |
| 2494 |
currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds; |
2504 |
currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds; |
|
Lines 2722-2729
GapRects RenderBlock::selectionGaps(Rend
Source/WebCore/rendering/RenderBlock.cpp_sec13
|
| 2722 |
if (m_floatingObjects) { |
2732 |
if (m_floatingObjects) { |
| 2723 |
for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); it.current(); ++it) { |
2733 |
for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); it.current(); ++it) { |
| 2724 |
FloatingObject* r = it.current(); |
2734 |
FloatingObject* r = it.current(); |
| 2725 |
IntRect floatBox = IntRect(offsetFromRootBlock.width() + r->left() + r->m_renderer->marginLeft(), |
2735 |
IntRect floatBox = IntRect(offsetFromRootBlock.width() + leftForFloatIncludingMargin(r), |
| 2726 |
offsetFromRootBlock.height() + r->top() + r->m_renderer->marginTop(), |
2736 |
offsetFromRootBlock.height() + topForFloatIncludingMargin(r), |
| 2727 |
r->m_renderer->width(), r->m_renderer->height()); |
2737 |
r->m_renderer->width(), r->m_renderer->height()); |
| 2728 |
rootBlock->flipForWritingMode(floatBox); |
2738 |
rootBlock->flipForWritingMode(floatBox); |
| 2729 |
floatBox.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPosition.y()); |
2739 |
floatBox.move(rootBlockPhysicalPosition.x(), rootBlockPhysicalPosition.y()); |
|
Lines 3093-3105
void RenderBlock::removeFloatingObject(R
Source/WebCore/rendering/RenderBlock.cpp_sec14
|
| 3093 |
} |
3103 |
} |
| 3094 |
} |
3104 |
} |
| 3095 |
|
3105 |
|
| 3096 |
void RenderBlock::removeFloatingObjectsBelow(FloatingObject* lastFloat, int y) |
3106 |
void RenderBlock::removeFloatingObjectsBelow(FloatingObject* lastFloat, int logicalOffset) |
| 3097 |
{ |
3107 |
{ |
| 3098 |
if (!m_floatingObjects) |
3108 |
if (!m_floatingObjects) |
| 3099 |
return; |
3109 |
return; |
| 3100 |
|
3110 |
|
| 3101 |
FloatingObject* curr = m_floatingObjects->last(); |
3111 |
FloatingObject* curr = m_floatingObjects->last(); |
| 3102 |
while (curr != lastFloat && (!curr->isPlaced() || curr->top() >= y)) { |
3112 |
while (curr != lastFloat && (!curr->isPlaced() || logicalTopForFloat(curr) >= logicalOffset)) { |
| 3103 |
m_floatingObjects->removeLast(); |
3113 |
m_floatingObjects->removeLast(); |
| 3104 |
curr = m_floatingObjects->last(); |
3114 |
curr = m_floatingObjects->last(); |
| 3105 |
} |
3115 |
} |
|
Lines 3611-3617
int RenderBlock::addOverhangingFloats(Re
Source/WebCore/rendering/RenderBlock.cpp_sec15
|
| 3611 |
// Since the float doesn't overhang, it didn't get put into our list. We need to go ahead and add its overflow in to the |
3621 |
// Since the float doesn't overhang, it didn't get put into our list. We need to go ahead and add its overflow in to the |
| 3612 |
// child now. |
3622 |
// child now. |
| 3613 |
if (r->m_isDescendant) |
3623 |
if (r->m_isDescendant) |
| 3614 |
child->addOverflowFromChild(r->m_renderer, IntSize(r->left() + r->m_renderer->marginLeft(), r->top() + r->m_renderer->marginTop())); |
3624 |
child->addOverflowFromChild(r->m_renderer, IntSize(leftForFloatIncludingMargin(r), topForFloatIncludingMargin(r))); |
| 3615 |
} |
3625 |
} |
| 3616 |
} |
3626 |
} |
| 3617 |
return lowestFloatLogicalBottom; |
3627 |
return lowestFloatLogicalBottom; |
|
Lines 3849-3856
bool RenderBlock::hitTestFloats(const Hi
Source/WebCore/rendering/RenderBlock.cpp_sec16
|
| 3849 |
DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); |
3859 |
DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); |
| 3850 |
for (it.toLast(); (floatingObject = it.current()); --it) { |
3860 |
for (it.toLast(); (floatingObject = it.current()); --it) { |
| 3851 |
if (floatingObject->m_shouldPaint && !floatingObject->m_renderer->hasSelfPaintingLayer()) { |
3861 |
if (floatingObject->m_shouldPaint && !floatingObject->m_renderer->hasSelfPaintingLayer()) { |
| 3852 |
int xOffset = floatingObject->left() + floatingObject->m_renderer->marginLeft() - floatingObject->m_renderer->x(); |
3862 |
int xOffset = leftForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->x(); |
| 3853 |
int yOffset = floatingObject->top() + floatingObject->m_renderer->marginTop() - floatingObject->m_renderer->y(); |
3863 |
int yOffset = topForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->y(); |
| 3854 |
IntPoint childPoint = flipForWritingMode(floatingObject->m_renderer, IntPoint(tx + xOffset, ty + yOffset), ParentToChildFlippingAdjustment); |
3864 |
IntPoint childPoint = flipForWritingMode(floatingObject->m_renderer, IntPoint(tx + xOffset, ty + yOffset), ParentToChildFlippingAdjustment); |
| 3855 |
if (floatingObject->m_renderer->hitTest(request, result, IntPoint(x, y), childPoint.x(), childPoint.y())) { |
3865 |
if (floatingObject->m_renderer->hitTest(request, result, IntPoint(x, y), childPoint.x(), childPoint.y())) { |
| 3856 |
updateHitTestResult(result, IntPoint(x - childPoint.x(), y - childPoint.y())); |
3866 |
updateHitTestResult(result, IntPoint(x - childPoint.x(), y - childPoint.y())); |
|
Lines 3869-3891
bool RenderBlock::hitTestColumns(const H
Source/WebCore/rendering/RenderBlock.cpp_sec17
|
| 3869 |
int colCount = columnCount(colInfo); |
3879 |
int colCount = columnCount(colInfo); |
| 3870 |
if (!colCount) |
3880 |
if (!colCount) |
| 3871 |
return false; |
3881 |
return false; |
| 3872 |
int left = borderLeft() + paddingLeft(); |
3882 |
int logicalLeft = logicalLeftOffsetForContent(); |
| 3873 |
int currYOffset = 0; |
3883 |
int currLogicalTopOffset = 0; |
| 3874 |
int i; |
3884 |
int i; |
| 3875 |
for (i = 0; i < colCount; i++) |
3885 |
bool isHorizontal = style()->isHorizontalWritingMode(); |
| 3876 |
currYOffset -= columnRectAt(colInfo, i).height(); |
3886 |
for (i = 0; i < colCount; i++) { |
|
|
3887 |
IntRect colRect = columnRectAt(colInfo, i); |
| 3888 |
int blockDelta = (isHorizontal ? colRect.height() : colRect.width()); |
| 3889 |
if (style()->isFlippedBlocksWritingMode()) |
| 3890 |
currLogicalTopOffset += blockDelta; |
| 3891 |
else |
| 3892 |
currLogicalTopOffset -= blockDelta; |
| 3893 |
} |
| 3877 |
for (i = colCount - 1; i >= 0; i--) { |
3894 |
for (i = colCount - 1; i >= 0; i--) { |
| 3878 |
IntRect colRect = columnRectAt(colInfo, i); |
3895 |
IntRect colRect = columnRectAt(colInfo, i); |
| 3879 |
int currXOffset = colRect.x() - left; |
3896 |
flipForWritingMode(colRect); |
| 3880 |
currYOffset += colRect.height(); |
3897 |
int currLogicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - logicalLeft; |
|
|
3898 |
int blockDelta = (isHorizontal ? colRect.height() : colRect.width()); |
| 3899 |
if (style()->isFlippedBlocksWritingMode()) |
| 3900 |
currLogicalTopOffset -= blockDelta; |
| 3901 |
else |
| 3902 |
currLogicalTopOffset += blockDelta; |
| 3881 |
colRect.move(tx, ty); |
3903 |
colRect.move(tx, ty); |
| 3882 |
|
3904 |
|
| 3883 |
if (colRect.intersects(result.rectForPoint(x, y))) { |
3905 |
if (colRect.intersects(result.rectForPoint(x, y))) { |
| 3884 |
// The point is inside this column. |
3906 |
// The point is inside this column. |
| 3885 |
// Adjust tx and ty to change where we hit test. |
3907 |
// Adjust tx and ty to change where we hit test. |
| 3886 |
|
3908 |
|
| 3887 |
int finalX = tx + currXOffset; |
3909 |
IntSize offset = isHorizontal ? IntSize(currLogicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, currLogicalLeftOffset); |
| 3888 |
int finalY = ty + currYOffset; |
3910 |
int finalX = tx + offset.width(); |
|
|
3911 |
int finalY = ty + offset.height(); |
| 3889 |
if (result.isRectBasedTest() && !colRect.contains(result.rectForPoint(x, y))) |
3912 |
if (result.isRectBasedTest() && !colRect.contains(result.rectForPoint(x, y))) |
| 3890 |
hitTestContents(request, result, x, y, finalX, finalY, hitTestAction); |
3913 |
hitTestContents(request, result, x, y, finalX, finalY, hitTestAction); |
| 3891 |
else |
3914 |
else |
|
Lines 4124-4130
void RenderBlock::calcColumnWidth()
Source/WebCore/rendering/RenderBlock.cpp_sec18
|
| 4124 |
{ |
4147 |
{ |
| 4125 |
// Calculate our column width and column count. |
4148 |
// Calculate our column width and column count. |
| 4126 |
unsigned desiredColumnCount = 1; |
4149 |
unsigned desiredColumnCount = 1; |
| 4127 |
int desiredColumnWidth = contentWidth(); |
4150 |
int desiredColumnWidth = contentLogicalWidth(); |
| 4128 |
|
4151 |
|
| 4129 |
// For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination. |
4152 |
// For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination. |
| 4130 |
if (document()->paginated() || (style()->hasAutoColumnCount() && style()->hasAutoColumnWidth())) { |
4153 |
if (document()->paginated() || (style()->hasAutoColumnCount() && style()->hasAutoColumnWidth())) { |
|
Lines 4199-4205
void RenderBlock::setDesiredColumnCountA
Source/WebCore/rendering/RenderBlock.cpp_sec19
|
| 4199 |
int RenderBlock::desiredColumnWidth() const |
4222 |
int RenderBlock::desiredColumnWidth() const |
| 4200 |
{ |
4223 |
{ |
| 4201 |
if (!hasColumns()) |
4224 |
if (!hasColumns()) |
| 4202 |
return contentWidth(); |
4225 |
return contentLogicalWidth(); |
| 4203 |
return gColumnInfoMap->get(this)->desiredColumnWidth(); |
4226 |
return gColumnInfoMap->get(this)->desiredColumnWidth(); |
| 4204 |
} |
4227 |
} |
| 4205 |
|
4228 |
|
|
Lines 4228-4241
IntRect RenderBlock::columnRectAt(Column
Source/WebCore/rendering/RenderBlock.cpp_sec20
|
| 4228 |
ASSERT(hasColumns() && gColumnInfoMap->get(this) == colInfo); |
4251 |
ASSERT(hasColumns() && gColumnInfoMap->get(this) == colInfo); |
| 4229 |
|
4252 |
|
| 4230 |
// Compute the appropriate rect based off our information. |
4253 |
// Compute the appropriate rect based off our information. |
| 4231 |
int colWidth = colInfo->desiredColumnWidth(); |
4254 |
int colLogicalWidth = colInfo->desiredColumnWidth(); |
| 4232 |
int colHeight = colInfo->columnHeight(); |
4255 |
int colLogicalHeight = colInfo->columnHeight(); |
| 4233 |
int colTop = borderTop() + paddingTop(); |
4256 |
int colLogicalTop = borderBefore() + paddingBefore(); |
| 4234 |
int colGap = columnGap(); |
4257 |
int colGap = columnGap(); |
| 4235 |
int colLeft = style()->isLeftToRightDirection() ? |
4258 |
int colLogicalLeft = style()->isLeftToRightDirection() ? |
| 4236 |
borderLeft() + paddingLeft() + (index * (colWidth + colGap)) |
4259 |
logicalLeftOffsetForContent() + (index * (colLogicalWidth + colGap)) |
| 4237 |
: borderLeft() + paddingLeft() + contentWidth() - colWidth - (index * (colWidth + colGap)); |
4260 |
: logicalLeftOffsetForContent() + contentLogicalWidth() - colLogicalWidth - (index * (colLogicalWidth + colGap)); |
| 4238 |
return IntRect(colLeft, colTop, colWidth, colHeight); |
4261 |
IntRect rect(colLogicalLeft, colLogicalTop, colLogicalWidth, colLogicalHeight); |
|
|
4262 |
if (style()->isHorizontalWritingMode()) |
| 4263 |
return IntRect(colLogicalLeft, colLogicalTop, colLogicalWidth, colLogicalHeight); |
| 4264 |
return IntRect(colLogicalTop, colLogicalLeft, colLogicalHeight, colLogicalWidth); |
| 4239 |
} |
4265 |
} |
| 4240 |
|
4266 |
|
| 4241 |
bool RenderBlock::layoutColumns(bool hasSpecifiedPageLogicalHeight, int pageLogicalHeight, LayoutStateMaintainer& statePusher) |
4267 |
bool RenderBlock::layoutColumns(bool hasSpecifiedPageLogicalHeight, int pageLogicalHeight, LayoutStateMaintainer& statePusher) |
|
Lines 4255-4266
bool RenderBlock::layoutColumns(bool has
Source/WebCore/rendering/RenderBlock.cpp_sec21
|
| 4255 |
// maximum page break distance. |
4281 |
// maximum page break distance. |
| 4256 |
if (!pageLogicalHeight) { |
4282 |
if (!pageLogicalHeight) { |
| 4257 |
int distanceBetweenBreaks = max(colInfo->maximumDistanceBetweenForcedBreaks(), |
4283 |
int distanceBetweenBreaks = max(colInfo->maximumDistanceBetweenForcedBreaks(), |
| 4258 |
view()->layoutState()->pageLogicalOffset(borderTop() + paddingTop() + contentHeight()) - colInfo->forcedBreakOffset()); |
4284 |
view()->layoutState()->pageLogicalOffset(borderBefore() + paddingBefore() + contentLogicalHeight()) - colInfo->forcedBreakOffset()); |
| 4259 |
columnHeight = max(colInfo->minimumColumnHeight(), distanceBetweenBreaks); |
4285 |
columnHeight = max(colInfo->minimumColumnHeight(), distanceBetweenBreaks); |
| 4260 |
} |
4286 |
} |
| 4261 |
} else if (contentHeight() > pageLogicalHeight * desiredColumnCount) { |
4287 |
} else if (contentLogicalHeight() > pageLogicalHeight * desiredColumnCount) { |
| 4262 |
// Now that we know the intrinsic height of the columns, we have to rebalance them. |
4288 |
// Now that we know the intrinsic height of the columns, we have to rebalance them. |
| 4263 |
columnHeight = max(colInfo->minimumColumnHeight(), (int)ceilf((float)contentHeight() / desiredColumnCount)); |
4289 |
columnHeight = max(colInfo->minimumColumnHeight(), (int)ceilf((float)contentLogicalHeight() / desiredColumnCount)); |
| 4264 |
} |
4290 |
} |
| 4265 |
|
4291 |
|
| 4266 |
if (columnHeight && columnHeight != pageLogicalHeight) { |
4292 |
if (columnHeight && columnHeight != pageLogicalHeight) { |
|
Lines 4272-4281
bool RenderBlock::layoutColumns(bool has
Source/WebCore/rendering/RenderBlock.cpp_sec22
|
| 4272 |
} |
4298 |
} |
| 4273 |
|
4299 |
|
| 4274 |
if (pageLogicalHeight) |
4300 |
if (pageLogicalHeight) |
| 4275 |
colInfo->setColumnCountAndHeight(ceilf((float)contentHeight() / pageLogicalHeight), pageLogicalHeight); |
4301 |
colInfo->setColumnCountAndHeight(ceilf((float)contentLogicalHeight() / pageLogicalHeight), pageLogicalHeight); |
| 4276 |
|
4302 |
|
| 4277 |
if (columnCount(colInfo)) { |
4303 |
if (columnCount(colInfo)) { |
| 4278 |
setLogicalHeight(borderTop() + paddingTop() + colInfo->columnHeight() + borderBottom() + paddingBottom() + horizontalScrollbarHeight()); |
4304 |
setLogicalHeight(borderBefore() + paddingBefore() + colInfo->columnHeight() + borderAfter() + paddingAfter() + scrollbarLogicalHeight()); |
| 4279 |
m_overflow.clear(); |
4305 |
m_overflow.clear(); |
| 4280 |
} |
4306 |
} |
| 4281 |
|
4307 |
|
|
Lines 4294-4327
void RenderBlock::adjustPointToColumnCon
Source/WebCore/rendering/RenderBlock.cpp_sec23
|
| 4294 |
|
4320 |
|
| 4295 |
// Determine which columns we intersect. |
4321 |
// Determine which columns we intersect. |
| 4296 |
int colGap = columnGap(); |
4322 |
int colGap = columnGap(); |
| 4297 |
int leftGap = colGap / 2; |
4323 |
int halfColGap = colGap / 2; |
| 4298 |
IntPoint columnPoint(columnRectAt(colInfo, 0).location()); |
4324 |
IntPoint columnPoint(columnRectAt(colInfo, 0).location()); |
| 4299 |
int yOffset = 0; |
4325 |
int logicalOffset = 0; |
| 4300 |
for (unsigned i = 0; i < colInfo->columnCount(); i++) { |
4326 |
for (unsigned i = 0; i < colInfo->columnCount(); i++) { |
| 4301 |
// Add in half the column gap to the left and right of the rect. |
4327 |
// Add in half the column gap to the left and right of the rect. |
| 4302 |
IntRect colRect = columnRectAt(colInfo, i); |
4328 |
IntRect colRect = columnRectAt(colInfo, i); |
| 4303 |
IntRect gapAndColumnRect(colRect.x() - leftGap, colRect.y(), colRect.width() + colGap, colRect.height()); |
4329 |
if (style()->isHorizontalWritingMode()) { |
|
|
4330 |
IntRect gapAndColumnRect(colRect.x() - halfColGap, colRect.y(), colRect.width() + colGap, colRect.height()); |
| 4331 |
if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.right()) { |
| 4332 |
// FIXME: The clamping that follows is not completely right for right-to-left |
| 4333 |
// content. |
| 4334 |
// Clamp everything above the column to its top left. |
| 4335 |
if (point.y() < gapAndColumnRect.y()) |
| 4336 |
point = gapAndColumnRect.location(); |
| 4337 |
// Clamp everything below the column to the next column's top left. If there is |
| 4338 |
// no next column, this still maps to just after this column. |
| 4339 |
else if (point.y() >= gapAndColumnRect.bottom()) { |
| 4340 |
point = gapAndColumnRect.location(); |
| 4341 |
point.move(0, gapAndColumnRect.height()); |
| 4342 |
} |
| 4304 |
|
4343 |
|
| 4305 |
if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.right()) { |
4344 |
// We're inside the column. Translate the x and y into our column coordinate space. |
| 4306 |
// FIXME: The clamping that follows is not completely right for right-to-left |
4345 |
point.move(columnPoint.x() - colRect.x(), logicalOffset); |
| 4307 |
// content. |
4346 |
return; |
| 4308 |
// Clamp everything above the column to its top left. |
|
|
| 4309 |
if (point.y() < gapAndColumnRect.y()) |
| 4310 |
point = gapAndColumnRect.location(); |
| 4311 |
// Clamp everything below the column to the next column's top left. If there is |
| 4312 |
// no next column, this still maps to just after this column. |
| 4313 |
else if (point.y() >= gapAndColumnRect.bottom()) { |
| 4314 |
point = gapAndColumnRect.location(); |
| 4315 |
point.move(0, gapAndColumnRect.height()); |
| 4316 |
} |
4347 |
} |
|
|
4348 |
|
| 4349 |
// Move to the next position. |
| 4350 |
logicalOffset += colRect.height(); |
| 4351 |
} else { |
| 4352 |
IntRect gapAndColumnRect(colRect.x(), colRect.y() - halfColGap, colRect.width(), colRect.height() + colGap); |
| 4353 |
if (point.y() >= gapAndColumnRect.y() && point.y() < gapAndColumnRect.bottom()) { |
| 4354 |
// FIXME: The clamping that follows is not completely right for right-to-left |
| 4355 |
// content. |
| 4356 |
// Clamp everything above the column to its top left. |
| 4357 |
if (point.x() < gapAndColumnRect.x()) |
| 4358 |
point = gapAndColumnRect.location(); |
| 4359 |
// Clamp everything below the column to the next column's top left. If there is |
| 4360 |
// no next column, this still maps to just after this column. |
| 4361 |
else if (point.x() >= gapAndColumnRect.right()) { |
| 4362 |
point = gapAndColumnRect.location(); |
| 4363 |
point.move(gapAndColumnRect.width(), 0); |
| 4364 |
} |
| 4317 |
|
4365 |
|
| 4318 |
// We're inside the column. Translate the x and y into our column coordinate space. |
4366 |
// We're inside the column. Translate the x and y into our column coordinate space. |
| 4319 |
point.move(columnPoint.x() - colRect.x(), yOffset); |
4367 |
point.move(logicalOffset, columnPoint.y() - colRect.y()); |
| 4320 |
return; |
4368 |
return; |
|
|
4369 |
} |
| 4370 |
|
| 4371 |
// Move to the next position. |
| 4372 |
logicalOffset += colRect.width(); |
| 4321 |
} |
4373 |
} |
| 4322 |
|
|
|
| 4323 |
// Move to the next position. |
| 4324 |
yOffset += colRect.height(); |
| 4325 |
} |
4374 |
} |
| 4326 |
} |
4375 |
} |
| 4327 |
|
4376 |
|
|
Lines 4341-4367
void RenderBlock::adjustRectForColumns(I
Source/WebCore/rendering/RenderBlock.cpp_sec24
|
| 4341 |
if (!colCount) |
4390 |
if (!colCount) |
| 4342 |
return; |
4391 |
return; |
| 4343 |
|
4392 |
|
| 4344 |
int left = borderLeft() + paddingLeft(); |
4393 |
int logicalLeft = logicalLeftOffsetForContent(); |
| 4345 |
|
4394 |
int currLogicalOffset = 0; |
| 4346 |
int currYOffset = 0; |
4395 |
|
| 4347 |
for (unsigned i = 0; i < colCount; i++) { |
4396 |
for (unsigned i = 0; i < colCount; i++) { |
| 4348 |
IntRect colRect = columnRectAt(colInfo, i); |
4397 |
IntRect colRect = columnRectAt(colInfo, i); |
| 4349 |
int currXOffset = colRect.x() - left; |
|
|
| 4350 |
|
| 4351 |
IntRect repaintRect = r; |
4398 |
IntRect repaintRect = r; |
| 4352 |
repaintRect.move(currXOffset, currYOffset); |
4399 |
if (style()->isHorizontalWritingMode()) { |
| 4353 |
|
4400 |
int currXOffset = colRect.x() - logicalLeft; |
|
|
4401 |
repaintRect.move(currXOffset, currLogicalOffset); |
| 4402 |
currLogicalOffset -= colRect.height(); |
| 4403 |
} else { |
| 4404 |
int currYOffset = colRect.y() - logicalLeft; |
| 4405 |
repaintRect.move(currLogicalOffset, currYOffset); |
| 4406 |
currLogicalOffset -= colRect.width(); |
| 4407 |
} |
| 4354 |
repaintRect.intersect(colRect); |
4408 |
repaintRect.intersect(colRect); |
| 4355 |
|
|
|
| 4356 |
result.unite(repaintRect); |
4409 |
result.unite(repaintRect); |
| 4357 |
|
|
|
| 4358 |
// Move to the next position. |
| 4359 |
currYOffset -= colRect.height(); |
| 4360 |
} |
4410 |
} |
| 4361 |
|
4411 |
|
| 4362 |
r = result; |
4412 |
r = result; |
| 4363 |
} |
4413 |
} |
| 4364 |
|
4414 |
|
|
|
4415 |
IntPoint RenderBlock::flipForWritingModeIncludingColumns(const IntPoint& point) const |
| 4416 |
{ |
| 4417 |
ASSERT(hasColumns()); |
| 4418 |
if (!hasColumns() || !style()->isFlippedBlocksWritingMode()) |
| 4419 |
return point; |
| 4420 |
ColumnInfo* colInfo = columnInfo(); |
| 4421 |
int columnLogicalHeight = colInfo->columnHeight(); |
| 4422 |
int expandedLogicalHeight = borderBefore() + paddingBefore() + columnCount(colInfo) * columnLogicalHeight + borderAfter() + paddingAfter() + scrollbarLogicalHeight(); |
| 4423 |
if (style()->isHorizontalWritingMode()) |
| 4424 |
return IntPoint(point.x(), expandedLogicalHeight - point.y()); |
| 4425 |
return IntPoint(expandedLogicalHeight - point.x(), point.y()); |
| 4426 |
} |
| 4427 |
|
| 4428 |
void RenderBlock::flipForWritingModeIncludingColumns(IntRect& rect) const |
| 4429 |
{ |
| 4430 |
ASSERT(hasColumns()); |
| 4431 |
if (!hasColumns() || !style()->isFlippedBlocksWritingMode()) |
| 4432 |
return; |
| 4433 |
|
| 4434 |
ColumnInfo* colInfo = columnInfo(); |
| 4435 |
int columnLogicalHeight = colInfo->columnHeight(); |
| 4436 |
int expandedLogicalHeight = borderBefore() + paddingBefore() + columnCount(colInfo) * columnLogicalHeight + borderAfter() + paddingAfter() + scrollbarLogicalHeight(); |
| 4437 |
if (style()->isHorizontalWritingMode()) |
| 4438 |
rect.setY(expandedLogicalHeight - rect.bottom()); |
| 4439 |
else |
| 4440 |
rect.setX(expandedLogicalHeight - rect.right()); |
| 4441 |
} |
| 4442 |
|
| 4365 |
void RenderBlock::adjustForColumns(IntSize& offset, const IntPoint& point) const |
4443 |
void RenderBlock::adjustForColumns(IntSize& offset, const IntPoint& point) const |
| 4366 |
{ |
4444 |
{ |
| 4367 |
if (!hasColumns()) |
4445 |
if (!hasColumns()) |
|
Lines 4369-4386
void RenderBlock::adjustForColumns(IntSi
Source/WebCore/rendering/RenderBlock.cpp_sec25
|
| 4369 |
|
4447 |
|
| 4370 |
ColumnInfo* colInfo = columnInfo(); |
4448 |
ColumnInfo* colInfo = columnInfo(); |
| 4371 |
|
4449 |
|
| 4372 |
int left = borderLeft() + paddingLeft(); |
4450 |
int logicalLeft = logicalLeftOffsetForContent(); |
| 4373 |
int yOffset = 0; |
|
|
| 4374 |
size_t colCount = columnCount(colInfo); |
4451 |
size_t colCount = columnCount(colInfo); |
|
|
4452 |
int colLogicalWidth = colInfo->desiredColumnWidth(); |
| 4453 |
int colLogicalHeight = colInfo->columnHeight(); |
| 4454 |
|
| 4375 |
for (size_t i = 0; i < colCount; ++i) { |
4455 |
for (size_t i = 0; i < colCount; ++i) { |
| 4376 |
IntRect columnRect = columnRectAt(colInfo, i); |
4456 |
// Compute the edges for a given column in the block progression direction. |
| 4377 |
int xOffset = columnRect.x() - left; |
4457 |
IntRect sliceRect = IntRect(logicalLeft, borderBefore() + paddingBefore() + i * colLogicalHeight, colLogicalWidth, colLogicalHeight); |
| 4378 |
if (point.y() < columnRect.bottom() + yOffset) { |
4458 |
if (!style()->isHorizontalWritingMode()) |
| 4379 |
offset.expand(xOffset, -yOffset); |
4459 |
sliceRect = sliceRect.transposedRect(); |
| 4380 |
return; |
4460 |
|
| 4381 |
} |
4461 |
// If we have a flipped blocks writing mode, then convert the column so that it's coming from the after edge (either top or left edge). |
|
|
4462 |
flipForWritingModeIncludingColumns(sliceRect); |
| 4463 |
|
| 4464 |
int logicalOffset = style()->isFlippedBlocksWritingMode() ? (colCount - 1 - i) * colLogicalHeight : i * colLogicalHeight; |
| 4382 |
|
4465 |
|
| 4383 |
yOffset += columnRect.height(); |
4466 |
// Now we're in the same coordinate space as the point. See if it is inside the rectangle. |
|
|
4467 |
if (style()->isHorizontalWritingMode()) { |
| 4468 |
if (point.y() >= sliceRect.y() && point.y() < sliceRect.bottom()) { |
| 4469 |
offset.expand(columnRectAt(colInfo, i).x() - logicalLeft, -logicalOffset); |
| 4470 |
return; |
| 4471 |
} |
| 4472 |
} else { |
| 4473 |
if (point.x() >= sliceRect.x() && point.x() < sliceRect.right()) { |
| 4474 |
offset.expand(-logicalOffset, columnRectAt(colInfo, i).y() - logicalLeft); |
| 4475 |
return; |
| 4476 |
} |
| 4477 |
} |
| 4384 |
} |
4478 |
} |
| 4385 |
} |
4479 |
} |
| 4386 |
|
4480 |
|
|
Lines 5385-5391
void RenderBlock::adjustForBorderFit(int
Source/WebCore/rendering/RenderBlock.cpp_sec26
|
| 5385 |
for (; (r = it.current()); ++it) { |
5479 |
for (; (r = it.current()); ++it) { |
| 5386 |
// Only examine the object if our m_shouldPaint flag is set. |
5480 |
// Only examine the object if our m_shouldPaint flag is set. |
| 5387 |
if (r->m_shouldPaint) { |
5481 |
if (r->m_shouldPaint) { |
| 5388 |
int floatLeft = r->left() - r->m_renderer->x() + r->m_renderer->marginLeft(); |
5482 |
int floatLeft = leftForFloatIncludingMargin(r) - r->m_renderer->x(); |
| 5389 |
int floatRight = floatLeft + r->m_renderer->width(); |
5483 |
int floatRight = floatLeft + r->m_renderer->width(); |
| 5390 |
left = min(left, floatLeft); |
5484 |
left = min(left, floatLeft); |
| 5391 |
right = max(right, floatRight); |
5485 |
right = max(right, floatRight); |
|
Lines 5740-5755
RenderBlock* RenderBlock::createAnonymou
Source/WebCore/rendering/RenderBlock.cpp_sec27
|
| 5740 |
return newBox; |
5834 |
return newBox; |
| 5741 |
} |
5835 |
} |
| 5742 |
|
5836 |
|
| 5743 |
int RenderBlock::nextPageTop(int yPos) const |
5837 |
int RenderBlock::nextPageLogicalTop(int logicalOffset) const |
| 5744 |
{ |
5838 |
{ |
| 5745 |
LayoutState* layoutState = view()->layoutState(); |
5839 |
LayoutState* layoutState = view()->layoutState(); |
| 5746 |
if (!layoutState->m_pageLogicalHeight) |
5840 |
if (!layoutState->m_pageLogicalHeight) |
| 5747 |
return yPos; |
5841 |
return logicalOffset; |
| 5748 |
|
5842 |
|
| 5749 |
// The yPos is in our coordinate space. We can add in our pushed offset. |
5843 |
// The logicalOffset is in our coordinate space. We can add in our pushed offset. |
| 5750 |
int pageLogicalHeight = layoutState->m_pageLogicalHeight; |
5844 |
int pageLogicalHeight = layoutState->m_pageLogicalHeight; |
| 5751 |
int remainingHeight = (pageLogicalHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageLogicalHeight) % pageLogicalHeight; |
5845 |
IntSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset; |
| 5752 |
return yPos + remainingHeight; |
5846 |
int offset = style()->isHorizontalWritingMode() ? delta.height() : delta.width(); |
|
|
5847 |
int remainingLogicalHeight = (pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight) % pageLogicalHeight; |
| 5848 |
return logicalOffset + remainingLogicalHeight; |
| 5753 |
} |
5849 |
} |
| 5754 |
|
5850 |
|
| 5755 |
static bool inNormalFlow(RenderBox* child) |
5851 |
static bool inNormalFlow(RenderBox* child) |
|
Lines 5766-5772
static bool inNormalFlow(RenderBox* chil
Source/WebCore/rendering/RenderBlock.cpp_sec28
|
| 5766 |
return true; |
5862 |
return true; |
| 5767 |
} |
5863 |
} |
| 5768 |
|
5864 |
|
| 5769 |
int RenderBlock::applyBeforeBreak(RenderBox* child, int yPos) |
5865 |
int RenderBlock::applyBeforeBreak(RenderBox* child, int logicalOffset) |
| 5770 |
{ |
5866 |
{ |
| 5771 |
// FIXME: Add page break checking here when we support printing. |
5867 |
// FIXME: Add page break checking here when we support printing. |
| 5772 |
bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns(); |
5868 |
bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns(); |
|
Lines 5774-5786
int RenderBlock::applyBeforeBreak(Render
Source/WebCore/rendering/RenderBlock.cpp_sec29
|
| 5774 |
bool checkBeforeAlways = (checkColumnBreaks && child->style()->columnBreakBefore() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakBefore() == PBALWAYS); |
5870 |
bool checkBeforeAlways = (checkColumnBreaks && child->style()->columnBreakBefore() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakBefore() == PBALWAYS); |
| 5775 |
if (checkBeforeAlways && inNormalFlow(child)) { |
5871 |
if (checkBeforeAlways && inNormalFlow(child)) { |
| 5776 |
if (checkColumnBreaks) |
5872 |
if (checkColumnBreaks) |
| 5777 |
view()->layoutState()->addForcedColumnBreak(yPos); |
5873 |
view()->layoutState()->addForcedColumnBreak(logicalOffset); |
| 5778 |
return nextPageTop(yPos); |
5874 |
return nextPageLogicalTop(logicalOffset); |
| 5779 |
} |
5875 |
} |
| 5780 |
return yPos; |
5876 |
return logicalOffset; |
| 5781 |
} |
5877 |
} |
| 5782 |
|
5878 |
|
| 5783 |
int RenderBlock::applyAfterBreak(RenderBox* child, int yPos, MarginInfo& marginInfo) |
5879 |
int RenderBlock::applyAfterBreak(RenderBox* child, int logicalOffset, MarginInfo& marginInfo) |
| 5784 |
{ |
5880 |
{ |
| 5785 |
// FIXME: Add page break checking here when we support printing. |
5881 |
// FIXME: Add page break checking here when we support printing. |
| 5786 |
bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns(); |
5882 |
bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns(); |
|
Lines 5789-5816
int RenderBlock::applyAfterBreak(RenderB
Source/WebCore/rendering/RenderBlock.cpp_sec30
|
| 5789 |
if (checkAfterAlways && inNormalFlow(child)) { |
5885 |
if (checkAfterAlways && inNormalFlow(child)) { |
| 5790 |
marginInfo.setMarginAfterQuirk(true); // Cause margins to be discarded for any following content. |
5886 |
marginInfo.setMarginAfterQuirk(true); // Cause margins to be discarded for any following content. |
| 5791 |
if (checkColumnBreaks) |
5887 |
if (checkColumnBreaks) |
| 5792 |
view()->layoutState()->addForcedColumnBreak(yPos); |
5888 |
view()->layoutState()->addForcedColumnBreak(logicalOffset); |
| 5793 |
return nextPageTop(yPos); |
5889 |
return nextPageLogicalTop(logicalOffset); |
| 5794 |
} |
5890 |
} |
| 5795 |
return yPos; |
5891 |
return logicalOffset; |
| 5796 |
} |
5892 |
} |
| 5797 |
|
5893 |
|
| 5798 |
int RenderBlock::adjustForUnsplittableChild(RenderBox* child, int yPos, bool includeMargins) |
5894 |
int RenderBlock::adjustForUnsplittableChild(RenderBox* child, int logicalOffset, bool includeMargins) |
| 5799 |
{ |
5895 |
{ |
| 5800 |
bool isUnsplittable = child->isReplaced() || child->scrollsOverflow(); |
5896 |
bool isUnsplittable = child->isReplaced() || child->scrollsOverflow(); |
| 5801 |
if (!isUnsplittable) |
5897 |
if (!isUnsplittable) |
| 5802 |
return yPos; |
5898 |
return logicalOffset; |
| 5803 |
int childHeight = child->height() + (includeMargins ? child->marginTop() + child->marginBottom() : 0); |
5899 |
int childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : 0); |
| 5804 |
LayoutState* layoutState = view()->layoutState(); |
5900 |
LayoutState* layoutState = view()->layoutState(); |
| 5805 |
if (layoutState->m_columnInfo) |
5901 |
if (layoutState->m_columnInfo) |
| 5806 |
layoutState->m_columnInfo->updateMinimumColumnHeight(childHeight); |
5902 |
layoutState->m_columnInfo->updateMinimumColumnHeight(childLogicalHeight); |
| 5807 |
int pageLogicalHeight = layoutState->m_pageLogicalHeight; |
5903 |
int pageLogicalHeight = layoutState->m_pageLogicalHeight; |
| 5808 |
if (!pageLogicalHeight || childHeight > pageLogicalHeight) |
5904 |
if (!pageLogicalHeight || childLogicalHeight > pageLogicalHeight) |
| 5809 |
return yPos; |
5905 |
return logicalOffset; |
| 5810 |
int remainingHeight = (pageLogicalHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageLogicalHeight) % pageLogicalHeight; |
5906 |
IntSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset; |
| 5811 |
if (remainingHeight < childHeight) |
5907 |
int offset = style()->isHorizontalWritingMode() ? delta.height() : delta.width(); |
| 5812 |
return yPos + remainingHeight; |
5908 |
int remainingLogicalHeight = (pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight) % pageLogicalHeight; |
| 5813 |
return yPos; |
5909 |
if (remainingLogicalHeight < childLogicalHeight) |
|
|
5910 |
return logicalOffset + remainingLogicalHeight; |
| 5911 |
return logicalOffset; |
| 5814 |
} |
5912 |
} |
| 5815 |
|
5913 |
|
| 5816 |
void RenderBlock::adjustLinePositionForPagination(RootInlineBox* lineBox, int& delta) |
5914 |
void RenderBlock::adjustLinePositionForPagination(RootInlineBox* lineBox, int& delta) |
|
Lines 5833-5854
void RenderBlock::adjustLinePositionForP
Source/WebCore/rendering/RenderBlock.cpp_sec31
|
| 5833 |
// line and all following lines. |
5931 |
// line and all following lines. |
| 5834 |
LayoutState* layoutState = view()->layoutState(); |
5932 |
LayoutState* layoutState = view()->layoutState(); |
| 5835 |
int pageLogicalHeight = layoutState->m_pageLogicalHeight; |
5933 |
int pageLogicalHeight = layoutState->m_pageLogicalHeight; |
| 5836 |
int yPos = lineBox->topVisualOverflow(); |
5934 |
int logicalOffset = lineBox->logicalTopVisualOverflow(); |
| 5837 |
int lineHeight = lineBox->bottomVisualOverflow() - yPos; |
5935 |
int lineHeight = lineBox->logicalBottomVisualOverflow() - logicalOffset; |
| 5838 |
if (layoutState->m_columnInfo) |
5936 |
if (layoutState->m_columnInfo) |
| 5839 |
layoutState->m_columnInfo->updateMinimumColumnHeight(lineHeight); |
5937 |
layoutState->m_columnInfo->updateMinimumColumnHeight(lineHeight); |
| 5840 |
yPos += delta; |
5938 |
logicalOffset += delta; |
| 5841 |
lineBox->setPaginationStrut(0); |
5939 |
lineBox->setPaginationStrut(0); |
| 5842 |
if (!pageLogicalHeight || lineHeight > pageLogicalHeight) |
5940 |
if (!pageLogicalHeight || lineHeight > pageLogicalHeight) |
| 5843 |
return; |
5941 |
return; |
| 5844 |
int remainingHeight = pageLogicalHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageLogicalHeight; |
5942 |
IntSize offsetDelta = layoutState->m_layoutOffset - layoutState->m_pageOffset; |
| 5845 |
if (remainingHeight < lineHeight) { |
5943 |
int offset = style()->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width(); |
| 5846 |
int totalHeight = lineHeight + max(0, yPos); |
5944 |
int remainingLogicalHeight = pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight; |
| 5847 |
if (lineBox == firstRootBox() && totalHeight < pageLogicalHeight && !isPositioned() && !isTableCell()) |
5945 |
if (remainingLogicalHeight < lineHeight) { |
| 5848 |
setPaginationStrut(remainingHeight + max(0, yPos)); |
5946 |
int totalLogicalHeight = lineHeight + max(0, logicalOffset); |
|
|
5947 |
if (lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeight && !isPositioned() && !isTableCell()) |
| 5948 |
setPaginationStrut(remainingLogicalHeight + max(0, logicalOffset)); |
| 5849 |
else { |
5949 |
else { |
| 5850 |
delta += remainingHeight; |
5950 |
delta += remainingLogicalHeight; |
| 5851 |
lineBox->setPaginationStrut(remainingHeight); |
5951 |
lineBox->setPaginationStrut(remainingLogicalHeight); |
| 5852 |
} |
5952 |
} |
| 5853 |
} |
5953 |
} |
| 5854 |
} |
5954 |
} |