| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 if (style()->textAlign() == WEBKIT_CENTER || child->style()->marginStartUsin
g(style()).isAuto()) | 338 if (style()->textAlign() == WEBKIT_CENTER || child->style()->marginStartUsin
g(style()).isAuto()) |
| 339 newPosition = std::max(newPosition, positionToAvoidFloats + childMarginS
tart); | 339 newPosition = std::max(newPosition, positionToAvoidFloats + childMarginS
tart); |
| 340 else if (positionToAvoidFloats > initialStartPosition) | 340 else if (positionToAvoidFloats > initialStartPosition) |
| 341 newPosition = std::max(newPosition, positionToAvoidFloats); | 341 newPosition = std::max(newPosition, positionToAvoidFloats); |
| 342 | 342 |
| 343 setLogicalLeftForChild(child, style()->isLeftToRightDirection() ? newPositio
n : totalAvailableLogicalWidth - newPosition - logicalWidthForChild(child)); | 343 setLogicalLeftForChild(child, style()->isLeftToRightDirection() ? newPositio
n : totalAvailableLogicalWidth - newPosition - logicalWidthForChild(child)); |
| 344 } | 344 } |
| 345 | 345 |
| 346 void RenderBlockFlow::setLogicalLeftForChild(RenderBox* child, LayoutUnit logica
lLeft) | 346 void RenderBlockFlow::setLogicalLeftForChild(RenderBox* child, LayoutUnit logica
lLeft) |
| 347 { | 347 { |
| 348 if (isHorizontalWritingMode()) { | 348 child->setX(logicalLeft); |
| 349 child->setX(logicalLeft); | |
| 350 } else { | |
| 351 child->setY(logicalLeft); | |
| 352 } | |
| 353 } | 349 } |
| 354 | 350 |
| 355 void RenderBlockFlow::setLogicalTopForChild(RenderBox* child, LayoutUnit logical
Top) | 351 void RenderBlockFlow::setLogicalTopForChild(RenderBox* child, LayoutUnit logical
Top) |
| 356 { | 352 { |
| 357 if (isHorizontalWritingMode()) { | 353 child->setY(logicalTop); |
| 358 child->setY(logicalTop); | |
| 359 } else { | |
| 360 child->setX(logicalTop); | |
| 361 } | |
| 362 } | 354 } |
| 363 | 355 |
| 364 void RenderBlockFlow::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo,
LayoutUnit& previousFloatLogicalBottom) | 356 void RenderBlockFlow::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo,
LayoutUnit& previousFloatLogicalBottom) |
| 365 { | 357 { |
| 366 LayoutUnit oldPosMarginBefore = maxPositiveMarginBefore(); | 358 LayoutUnit oldPosMarginBefore = maxPositiveMarginBefore(); |
| 367 LayoutUnit oldNegMarginBefore = maxNegativeMarginBefore(); | 359 LayoutUnit oldNegMarginBefore = maxNegativeMarginBefore(); |
| 368 | 360 |
| 369 // The child is a normal flow object. Compute the margins we will use for co
llapsing now. | 361 // The child is a normal flow object. Compute the margins we will use for co
llapsing now. |
| 370 child->computeAndSetBlockDirectionMargins(this); | 362 child->computeAndSetBlockDirectionMargins(this); |
| 371 | 363 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 LayoutUnit childBeforePositive = 0; | 551 LayoutUnit childBeforePositive = 0; |
| 560 LayoutUnit childBeforeNegative = 0; | 552 LayoutUnit childBeforeNegative = 0; |
| 561 LayoutUnit childAfterPositive = 0; | 553 LayoutUnit childAfterPositive = 0; |
| 562 LayoutUnit childAfterNegative = 0; | 554 LayoutUnit childAfterNegative = 0; |
| 563 | 555 |
| 564 LayoutUnit beforeMargin = 0; | 556 LayoutUnit beforeMargin = 0; |
| 565 LayoutUnit afterMargin = 0; | 557 LayoutUnit afterMargin = 0; |
| 566 | 558 |
| 567 RenderBlockFlow* childRenderBlockFlow = child->isRenderBlockFlow() ? toRende
rBlockFlow(child) : 0; | 559 RenderBlockFlow* childRenderBlockFlow = child->isRenderBlockFlow() ? toRende
rBlockFlow(child) : 0; |
| 568 | 560 |
| 569 // If the child has the same directionality as we do, then we can just retur
n its | 561 if (childRenderBlockFlow) { |
| 570 // margins in the same direction. | 562 childBeforePositive = childRenderBlockFlow->maxPositiveMarginBefore(); |
| 571 if (!child->isWritingModeRoot()) { | 563 childBeforeNegative = childRenderBlockFlow->maxNegativeMarginBefore(); |
| 572 if (childRenderBlockFlow) { | 564 childAfterPositive = childRenderBlockFlow->maxPositiveMarginAfter(); |
| 573 childBeforePositive = childRenderBlockFlow->maxPositiveMarginBefore(
); | 565 childAfterNegative = childRenderBlockFlow->maxNegativeMarginAfter(); |
| 574 childBeforeNegative = childRenderBlockFlow->maxNegativeMarginBefore(
); | |
| 575 childAfterPositive = childRenderBlockFlow->maxPositiveMarginAfter(); | |
| 576 childAfterNegative = childRenderBlockFlow->maxNegativeMarginAfter(); | |
| 577 } else { | |
| 578 beforeMargin = child->marginBefore(); | |
| 579 afterMargin = child->marginAfter(); | |
| 580 } | |
| 581 } else if (child->isHorizontalWritingMode() == isHorizontalWritingMode()) { | |
| 582 // The child has a different directionality. If the child is parallel, t
hen it's just | |
| 583 // flipped relative to us. We can use the margins for the opposite edges
. | |
| 584 if (childRenderBlockFlow) { | |
| 585 childBeforePositive = childRenderBlockFlow->maxPositiveMarginAfter()
; | |
| 586 childBeforeNegative = childRenderBlockFlow->maxNegativeMarginAfter()
; | |
| 587 childAfterPositive = childRenderBlockFlow->maxPositiveMarginBefore()
; | |
| 588 childAfterNegative = childRenderBlockFlow->maxNegativeMarginBefore()
; | |
| 589 } else { | |
| 590 beforeMargin = child->marginAfter(); | |
| 591 afterMargin = child->marginBefore(); | |
| 592 } | |
| 593 } else { | 566 } else { |
| 594 // The child is perpendicular to us, which means its margins don't colla
pse but are on the | 567 beforeMargin = child->marginBefore(); |
| 595 // "logical left/right" sides of the child box. We can just return the r
aw margin in this case. | 568 afterMargin = child->marginAfter(); |
| 596 beforeMargin = marginBeforeForChild(child); | |
| 597 afterMargin = marginAfterForChild(child); | |
| 598 } | 569 } |
| 599 | 570 |
| 600 // Resolve uncollapsing margins into their positive/negative buckets. | 571 // Resolve uncollapsing margins into their positive/negative buckets. |
| 601 if (beforeMargin) { | 572 if (beforeMargin) { |
| 602 if (beforeMargin > 0) | 573 if (beforeMargin > 0) |
| 603 childBeforePositive = beforeMargin; | 574 childBeforePositive = beforeMargin; |
| 604 else | 575 else |
| 605 childBeforeNegative = -beforeMargin; | 576 childBeforeNegative = -beforeMargin; |
| 606 } | 577 } |
| 607 if (afterMargin) { | 578 if (afterMargin) { |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 bool logicalTopIntrudesIntoFloat = clearanceForSelfCollapsingBlock > 0 &
& logicalTop < beforeCollapseLogicalTop; | 730 bool logicalTopIntrudesIntoFloat = clearanceForSelfCollapsingBlock > 0 &
& logicalTop < beforeCollapseLogicalTop; |
| 760 if (logicalTopIntrudesIntoFloat && containsFloats() && !child->avoidsFlo
ats() && lowestFloatLogicalBottom() > logicalTop) | 731 if (logicalTopIntrudesIntoFloat && containsFloats() && !child->avoidsFlo
ats() && lowestFloatLogicalBottom() > logicalTop) |
| 761 child->setNeedsLayoutAndFullPaintInvalidation(); | 732 child->setNeedsLayoutAndFullPaintInvalidation(); |
| 762 } | 733 } |
| 763 | 734 |
| 764 return logicalTop; | 735 return logicalTop; |
| 765 } | 736 } |
| 766 | 737 |
| 767 void RenderBlockFlow::adjustPositionedBlock(RenderBox* child, const MarginInfo&
marginInfo) | 738 void RenderBlockFlow::adjustPositionedBlock(RenderBox* child, const MarginInfo&
marginInfo) |
| 768 { | 739 { |
| 769 bool isHorizontal = isHorizontalWritingMode(); | 740 bool hasStaticBlockPosition = child->style()->hasStaticBlockPosition(); |
| 770 bool hasStaticBlockPosition = child->style()->hasStaticBlockPosition(isHoriz
ontal); | |
| 771 | 741 |
| 772 LayoutUnit logicalTop = logicalHeight(); | 742 LayoutUnit logicalTop = logicalHeight(); |
| 773 updateStaticInlinePositionForChild(child, logicalTop); | 743 updateStaticInlinePositionForChild(child, logicalTop); |
| 774 | 744 |
| 775 if (!marginInfo.canCollapseWithMarginBefore()) { | 745 if (!marginInfo.canCollapseWithMarginBefore()) { |
| 776 // Positioned blocks don't collapse margins, so add the margin provided
by | 746 // Positioned blocks don't collapse margins, so add the margin provided
by |
| 777 // the container now. The child's own margin is added later when calcula
ting its logical top. | 747 // the container now. The child's own margin is added later when calcula
ting its logical top. |
| 778 LayoutUnit collapsedBeforePos = marginInfo.positiveMargin(); | 748 LayoutUnit collapsedBeforePos = marginInfo.positiveMargin(); |
| 779 LayoutUnit collapsedBeforeNeg = marginInfo.negativeMargin(); | 749 LayoutUnit collapsedBeforeNeg = marginInfo.negativeMargin(); |
| 780 logicalTop += collapsedBeforePos - collapsedBeforeNeg; | 750 logicalTop += collapsedBeforePos - collapsedBeforeNeg; |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 } | 1021 } |
| 1052 | 1022 |
| 1053 bool RenderBlockFlow::mustDiscardMarginAfter() const | 1023 bool RenderBlockFlow::mustDiscardMarginAfter() const |
| 1054 { | 1024 { |
| 1055 return style()->marginAfterCollapse() == MDISCARD || (m_rareData && m_rareDa
ta->m_discardMarginAfter); | 1025 return style()->marginAfterCollapse() == MDISCARD || (m_rareData && m_rareDa
ta->m_discardMarginAfter); |
| 1056 } | 1026 } |
| 1057 | 1027 |
| 1058 bool RenderBlockFlow::mustDiscardMarginBeforeForChild(const RenderBox* child) co
nst | 1028 bool RenderBlockFlow::mustDiscardMarginBeforeForChild(const RenderBox* child) co
nst |
| 1059 { | 1029 { |
| 1060 ASSERT(!child->selfNeedsLayout()); | 1030 ASSERT(!child->selfNeedsLayout()); |
| 1061 if (!child->isWritingModeRoot()) | 1031 return child->isRenderBlockFlow() ? toRenderBlockFlow(child)->mustDiscardMar
ginBefore() : (child->style()->marginBeforeCollapse() == MDISCARD); |
| 1062 return child->isRenderBlockFlow() ? toRenderBlockFlow(child)->mustDiscar
dMarginBefore() : (child->style()->marginBeforeCollapse() == MDISCARD); | |
| 1063 if (child->isHorizontalWritingMode() == isHorizontalWritingMode()) | |
| 1064 return child->isRenderBlockFlow() ? toRenderBlockFlow(child)->mustDiscar
dMarginAfter() : (child->style()->marginAfterCollapse() == MDISCARD); | |
| 1065 | |
| 1066 // FIXME: We return false here because the implementation is not geometrical
ly complete. We have values only for before/after, not start/end. | |
| 1067 // In case the boxes are perpendicular we assume the property is not specifi
ed. | |
| 1068 return false; | |
| 1069 } | 1032 } |
| 1070 | 1033 |
| 1071 bool RenderBlockFlow::mustDiscardMarginAfterForChild(const RenderBox* child) con
st | 1034 bool RenderBlockFlow::mustDiscardMarginAfterForChild(const RenderBox* child) con
st |
| 1072 { | 1035 { |
| 1073 ASSERT(!child->selfNeedsLayout()); | 1036 ASSERT(!child->selfNeedsLayout()); |
| 1074 if (!child->isWritingModeRoot()) | 1037 return child->isRenderBlockFlow() ? toRenderBlockFlow(child)->mustDiscardMar
ginAfter() : (child->style()->marginAfterCollapse() == MDISCARD); |
| 1075 return child->isRenderBlockFlow() ? toRenderBlockFlow(child)->mustDiscar
dMarginAfter() : (child->style()->marginAfterCollapse() == MDISCARD); | |
| 1076 if (child->isHorizontalWritingMode() == isHorizontalWritingMode()) | |
| 1077 return child->isRenderBlockFlow() ? toRenderBlockFlow(child)->mustDiscar
dMarginBefore() : (child->style()->marginBeforeCollapse() == MDISCARD); | |
| 1078 | |
| 1079 // FIXME: See |mustDiscardMarginBeforeForChild| above. | |
| 1080 return false; | |
| 1081 } | 1038 } |
| 1082 | 1039 |
| 1083 void RenderBlockFlow::setMaxMarginBeforeValues(LayoutUnit pos, LayoutUnit neg) | 1040 void RenderBlockFlow::setMaxMarginBeforeValues(LayoutUnit pos, LayoutUnit neg) |
| 1084 { | 1041 { |
| 1085 if (!m_rareData) { | 1042 if (!m_rareData) { |
| 1086 if (pos == RenderBlockFlowRareData::positiveMarginBeforeDefault(this) &&
neg == RenderBlockFlowRareData::negativeMarginBeforeDefault(this)) | 1043 if (pos == RenderBlockFlowRareData::positiveMarginBeforeDefault(this) &&
neg == RenderBlockFlowRareData::negativeMarginBeforeDefault(this)) |
| 1087 return; | 1044 return; |
| 1088 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); | 1045 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); |
| 1089 } | 1046 } |
| 1090 m_rareData->m_margins.setPositiveMarginBefore(pos); | 1047 m_rareData->m_margins.setPositiveMarginBefore(pos); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1101 m_rareData->m_margins.setPositiveMarginAfter(pos); | 1058 m_rareData->m_margins.setPositiveMarginAfter(pos); |
| 1102 m_rareData->m_margins.setNegativeMarginAfter(neg); | 1059 m_rareData->m_margins.setNegativeMarginAfter(neg); |
| 1103 } | 1060 } |
| 1104 | 1061 |
| 1105 bool RenderBlockFlow::mustSeparateMarginBeforeForChild(const RenderBox* child) c
onst | 1062 bool RenderBlockFlow::mustSeparateMarginBeforeForChild(const RenderBox* child) c
onst |
| 1106 { | 1063 { |
| 1107 ASSERT(!child->selfNeedsLayout()); | 1064 ASSERT(!child->selfNeedsLayout()); |
| 1108 const RenderStyle* childStyle = child->style(); | 1065 const RenderStyle* childStyle = child->style(); |
| 1109 if (!child->isWritingModeRoot()) | 1066 if (!child->isWritingModeRoot()) |
| 1110 return childStyle->marginBeforeCollapse() == MSEPARATE; | 1067 return childStyle->marginBeforeCollapse() == MSEPARATE; |
| 1111 if (child->isHorizontalWritingMode() == isHorizontalWritingMode()) | 1068 return childStyle->marginAfterCollapse() == MSEPARATE; |
| 1112 return childStyle->marginAfterCollapse() == MSEPARATE; | |
| 1113 | |
| 1114 // FIXME: See |mustDiscardMarginBeforeForChild| above. | |
| 1115 return false; | |
| 1116 } | 1069 } |
| 1117 | 1070 |
| 1118 bool RenderBlockFlow::mustSeparateMarginAfterForChild(const RenderBox* child) co
nst | 1071 bool RenderBlockFlow::mustSeparateMarginAfterForChild(const RenderBox* child) co
nst |
| 1119 { | 1072 { |
| 1120 ASSERT(!child->selfNeedsLayout()); | 1073 ASSERT(!child->selfNeedsLayout()); |
| 1121 const RenderStyle* childStyle = child->style(); | 1074 const RenderStyle* childStyle = child->style(); |
| 1122 if (!child->isWritingModeRoot()) | 1075 if (!child->isWritingModeRoot()) |
| 1123 return childStyle->marginAfterCollapse() == MSEPARATE; | 1076 return childStyle->marginAfterCollapse() == MSEPARATE; |
| 1124 if (child->isHorizontalWritingMode() == isHorizontalWritingMode()) | 1077 return childStyle->marginBeforeCollapse() == MSEPARATE; |
| 1125 return childStyle->marginBeforeCollapse() == MSEPARATE; | |
| 1126 | |
| 1127 // FIXME: See |mustDiscardMarginBeforeForChild| above. | |
| 1128 return false; | |
| 1129 } | 1078 } |
| 1130 | 1079 |
| 1131 void RenderBlockFlow::addOverflowFromFloats() | 1080 void RenderBlockFlow::addOverflowFromFloats() |
| 1132 { | 1081 { |
| 1133 // FIXME(sky): Remove this. | 1082 // FIXME(sky): Remove this. |
| 1134 } | 1083 } |
| 1135 | 1084 |
| 1136 void RenderBlockFlow::computeOverflow(LayoutUnit oldClientAfterEdge, bool recomp
uteFloats) | 1085 void RenderBlockFlow::computeOverflow(LayoutUnit oldClientAfterEdge, bool recomp
uteFloats) |
| 1137 { | 1086 { |
| 1138 RenderBlock::computeOverflow(oldClientAfterEdge, recomputeFloats); | 1087 RenderBlock::computeOverflow(oldClientAfterEdge, recomputeFloats); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 LayoutUnit paintInvalidationLogicalLeft = logicalLeftVisualOverflow(); | 1172 LayoutUnit paintInvalidationLogicalLeft = logicalLeftVisualOverflow(); |
| 1224 LayoutUnit paintInvalidationLogicalRight = logicalRightVisualOverflow(); | 1173 LayoutUnit paintInvalidationLogicalRight = logicalRightVisualOverflow(); |
| 1225 if (hasOverflowClip()) { | 1174 if (hasOverflowClip()) { |
| 1226 // If we have clipped overflow, we should use layout overflow as well, s
ince visual overflow from lines didn't propagate to our block's overflow. | 1175 // If we have clipped overflow, we should use layout overflow as well, s
ince visual overflow from lines didn't propagate to our block's overflow. |
| 1227 // Note the old code did this as well but even for overflow:visible. The
addition of hasOverflowClip() at least tightens up the hack a bit. | 1176 // Note the old code did this as well but even for overflow:visible. The
addition of hasOverflowClip() at least tightens up the hack a bit. |
| 1228 // layoutInlineChildren should be patched to compute the entire paint in
validation rect. | 1177 // layoutInlineChildren should be patched to compute the entire paint in
validation rect. |
| 1229 paintInvalidationLogicalLeft = std::min(paintInvalidationLogicalLeft, lo
gicalLeftLayoutOverflow()); | 1178 paintInvalidationLogicalLeft = std::min(paintInvalidationLogicalLeft, lo
gicalLeftLayoutOverflow()); |
| 1230 paintInvalidationLogicalRight = std::max(paintInvalidationLogicalRight,
logicalRightLayoutOverflow()); | 1179 paintInvalidationLogicalRight = std::max(paintInvalidationLogicalRight,
logicalRightLayoutOverflow()); |
| 1231 } | 1180 } |
| 1232 | 1181 |
| 1233 LayoutRect paintInvalidationRect; | 1182 LayoutRect paintInvalidationRect = LayoutRect(paintInvalidationLogicalLeft,
m_paintInvalidationLogicalTop, paintInvalidationLogicalRight - paintInvalidation
LogicalLeft, m_paintInvalidationLogicalBottom - m_paintInvalidationLogicalTop); |
| 1234 if (isHorizontalWritingMode()) | |
| 1235 paintInvalidationRect = LayoutRect(paintInvalidationLogicalLeft, m_paint
InvalidationLogicalTop, paintInvalidationLogicalRight - paintInvalidationLogical
Left, m_paintInvalidationLogicalBottom - m_paintInvalidationLogicalTop); | |
| 1236 else | |
| 1237 paintInvalidationRect = LayoutRect(m_paintInvalidationLogicalTop, paintI
nvalidationLogicalLeft, m_paintInvalidationLogicalBottom - m_paintInvalidationLo
gicalTop, paintInvalidationLogicalRight - paintInvalidationLogicalLeft); | |
| 1238 | 1183 |
| 1239 if (hasOverflowClip()) { | 1184 if (hasOverflowClip()) { |
| 1240 // Adjust the paint invalidation rect for scroll offset | 1185 // Adjust the paint invalidation rect for scroll offset |
| 1241 paintInvalidationRect.move(-scrolledContentOffset()); | 1186 paintInvalidationRect.move(-scrolledContentOffset()); |
| 1242 | 1187 |
| 1243 // Don't allow this rect to spill out of our overflow box. | 1188 // Don't allow this rect to spill out of our overflow box. |
| 1244 paintInvalidationRect.intersect(LayoutRect(LayoutPoint(), size())); | 1189 paintInvalidationRect.intersect(LayoutRect(LayoutPoint(), size())); |
| 1245 } | 1190 } |
| 1246 | 1191 |
| 1247 // Make sure the rect is still non-empty after intersecting for overflow abo
ve | 1192 // Make sure the rect is still non-empty after intersecting for overflow abo
ve |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1430 for (; curr && curr->hasSelectedChildren(); curr = curr->nextRootBox()) { | 1375 for (; curr && curr->hasSelectedChildren(); curr = curr->nextRootBox()) { |
| 1431 LayoutUnit selTop = curr->selectionTopAdjustedForPrecedingBlock(); | 1376 LayoutUnit selTop = curr->selectionTopAdjustedForPrecedingBlock(); |
| 1432 LayoutUnit selHeight = curr->selectionHeightAdjustedForPrecedingBlock(); | 1377 LayoutUnit selHeight = curr->selectionHeightAdjustedForPrecedingBlock(); |
| 1433 | 1378 |
| 1434 if (!containsStart && !lastSelectedLine && selectionState() != Selection
Start && selectionState() != SelectionBoth) { | 1379 if (!containsStart && !lastSelectedLine && selectionState() != Selection
Start && selectionState() != SelectionBoth) { |
| 1435 result.uniteCenter(blockSelectionGap(rootBlock, rootBlockPhysicalPos
ition, offsetFromRootBlock, lastLogicalTop, | 1380 result.uniteCenter(blockSelectionGap(rootBlock, rootBlockPhysicalPos
ition, offsetFromRootBlock, lastLogicalTop, |
| 1436 lastLogicalLeft, lastLogicalRight, selTop, paintInfo)); | 1381 lastLogicalLeft, lastLogicalRight, selTop, paintInfo)); |
| 1437 } | 1382 } |
| 1438 | 1383 |
| 1439 LayoutRect logicalRect(curr->logicalLeft(), selTop, curr->logicalWidth()
, selTop + selHeight); | 1384 LayoutRect logicalRect(curr->logicalLeft(), selTop, curr->logicalWidth()
, selTop + selHeight); |
| 1440 logicalRect.move(isHorizontalWritingMode() ? offsetFromRootBlock : offse
tFromRootBlock.transposedSize()); | 1385 logicalRect.move(offsetFromRootBlock); |
| 1441 LayoutRect physicalRect = rootBlock->logicalRectToPhysicalRect(rootBlock
PhysicalPosition, logicalRect); | 1386 LayoutRect physicalRect = rootBlock->logicalRectToPhysicalRect(rootBlock
PhysicalPosition, logicalRect); |
| 1442 if (!paintInfo || (isHorizontalWritingMode() && physicalRect.y() < paint
Info->rect.maxY() && physicalRect.maxY() > paintInfo->rect.y()) | 1387 if (!paintInfo || (physicalRect.y() < paintInfo->rect.maxY() && physical
Rect.maxY() > paintInfo->rect.y())) |
| 1443 || (!isHorizontalWritingMode() && physicalRect.x() < paintInfo->rect
.maxX() && physicalRect.maxX() > paintInfo->rect.x())) | |
| 1444 result.unite(curr->lineSelectionGap(rootBlock, rootBlockPhysicalPosi
tion, offsetFromRootBlock, selTop, selHeight, paintInfo)); | 1388 result.unite(curr->lineSelectionGap(rootBlock, rootBlockPhysicalPosi
tion, offsetFromRootBlock, selTop, selHeight, paintInfo)); |
| 1445 | 1389 |
| 1446 lastSelectedLine = curr; | 1390 lastSelectedLine = curr; |
| 1447 } | 1391 } |
| 1448 | 1392 |
| 1449 if (containsStart && !lastSelectedLine) { | 1393 if (containsStart && !lastSelectedLine) { |
| 1450 // VisibleSelection must start just after our last line. | 1394 // VisibleSelection must start just after our last line. |
| 1451 lastSelectedLine = lastRootBox(); | 1395 lastSelectedLine = lastRootBox(); |
| 1452 } | 1396 } |
| 1453 | 1397 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() | 1445 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
| 1502 { | 1446 { |
| 1503 if (m_rareData) | 1447 if (m_rareData) |
| 1504 return *m_rareData; | 1448 return *m_rareData; |
| 1505 | 1449 |
| 1506 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); | 1450 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); |
| 1507 return *m_rareData; | 1451 return *m_rareData; |
| 1508 } | 1452 } |
| 1509 | 1453 |
| 1510 } // namespace blink | 1454 } // namespace blink |
| OLD | NEW |