Changeset 76726 in webkit
- Timestamp:
- Jan 26, 2011 3:10:57 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 104 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r76723 r76726 1 2011-01-26 Dave Hyatt <hyatt@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 https://bugs.webkit.org/show_bug.cgi?id=46421, make multi-column layout work with vertical text. 6 7 Added new tests in fast/multicol/vertical-lr and fast/multicol/vertical-rl. 8 9 * fast/multicol/break-properties-expected.txt: 10 * fast/multicol/break-properties.html: 11 * fast/multicol/float-truncation.html: 12 * fast/multicol/vertical-lr: Added. 13 * fast/multicol/vertical-lr/border-padding-pagination.html: Added. 14 * fast/multicol/vertical-lr/break-properties-expected.txt: Added. 15 * fast/multicol/vertical-lr/break-properties.html: Added. 16 * fast/multicol/vertical-lr/column-break-with-balancing.html: Added. 17 * fast/multicol/vertical-lr/column-count-with-rules.html: Added. 18 * fast/multicol/vertical-lr/column-rules.html: Added. 19 * fast/multicol/vertical-lr/float-avoidance.html: Added. 20 * fast/multicol/vertical-lr/float-multicol.html: Added. 21 * fast/multicol/vertical-lr/float-paginate-complex.html: Added. 22 * fast/multicol/vertical-lr/float-paginate.html: Added. 23 * fast/multicol/vertical-lr/float-truncation-expected.txt: Added. 24 * fast/multicol/vertical-lr/float-truncation.html: Added. 25 * fast/multicol/vertical-lr/gap-non-negative-expected.txt: Added. 26 * fast/multicol/vertical-lr/gap-non-negative.html: Added. 27 * fast/multicol/vertical-lr/image-inside-nested-blocks-with-border-expected.txt: Added. 28 * fast/multicol/vertical-lr/image-inside-nested-blocks-with-border.html: Added. 29 * fast/multicol/vertical-lr/nested-columns.html: Added. 30 * fast/multicol/vertical-lr/resources: Added. 31 * fast/multicol/vertical-lr/resources/blimp.png: Added. 32 * fast/multicol/vertical-lr/unsplittable-inline-block.html: Added. 33 * fast/multicol/vertical-rl: Added. 34 * fast/multicol/vertical-rl/border-padding-pagination.html: Added. 35 * fast/multicol/vertical-rl/break-properties-expected.txt: Added. 36 * fast/multicol/vertical-rl/break-properties.html: Added. 37 * fast/multicol/vertical-rl/column-break-with-balancing.html: Added. 38 * fast/multicol/vertical-rl/column-count-with-rules.html: Added. 39 * fast/multicol/vertical-rl/column-rules.html: Added. 40 * fast/multicol/vertical-rl/float-avoidance.html: Added. 41 * fast/multicol/vertical-rl/float-multicol.html: Added. 42 * fast/multicol/vertical-rl/float-paginate-complex.html: Added. 43 * fast/multicol/vertical-rl/float-paginate.html: Added. 44 * fast/multicol/vertical-rl/float-truncation-expected.txt: Added. 45 * fast/multicol/vertical-rl/float-truncation.html: Added. 46 * fast/multicol/vertical-rl/gap-non-negative-expected.txt: Added. 47 * fast/multicol/vertical-rl/gap-non-negative.html: Added. 48 * fast/multicol/vertical-rl/image-inside-nested-blocks-with-border-expected.txt: Added. 49 * fast/multicol/vertical-rl/image-inside-nested-blocks-with-border.html: Added. 50 * fast/multicol/vertical-rl/nested-columns.html: Added. 51 * fast/multicol/vertical-rl/resources: Added. 52 * fast/multicol/vertical-rl/resources/blimp.png: Added. 53 * fast/multicol/vertical-rl/unsplittable-inline-block.html: Added. 54 * platform/mac/fast/multicol/vertical-lr: Added. 55 * platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.checksum: Added. 56 * platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.png: Added. 57 * platform/mac/fast/multicol/vertical-lr/border-padding-pagination-expected.txt: Added. 58 * platform/mac/fast/multicol/vertical-lr/column-break-with-balancing-expected.checksum: Added. 59 * platform/mac/fast/multicol/vertical-lr/column-break-with-balancing-expected.png: Added. 60 * platform/mac/fast/multicol/vertical-lr/column-break-with-balancing-expected.txt: Added. 61 * platform/mac/fast/multicol/vertical-lr/column-count-with-rules-expected.checksum: Added. 62 * platform/mac/fast/multicol/vertical-lr/column-count-with-rules-expected.png: Added. 63 * platform/mac/fast/multicol/vertical-lr/column-count-with-rules-expected.txt: Added. 64 * platform/mac/fast/multicol/vertical-lr/column-rules-expected.checksum: Added. 65 * platform/mac/fast/multicol/vertical-lr/column-rules-expected.png: Added. 66 * platform/mac/fast/multicol/vertical-lr/column-rules-expected.txt: Added. 67 * platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.checksum: Added. 68 * platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.png: Added. 69 * platform/mac/fast/multicol/vertical-lr/float-avoidance-expected.txt: Added. 70 * platform/mac/fast/multicol/vertical-lr/float-multicol-expected.checksum: Added. 71 * platform/mac/fast/multicol/vertical-lr/float-multicol-expected.png: Added. 72 * platform/mac/fast/multicol/vertical-lr/float-multicol-expected.txt: Added. 73 * platform/mac/fast/multicol/vertical-lr/float-paginate-complex-expected.checksum: Added. 74 * platform/mac/fast/multicol/vertical-lr/float-paginate-complex-expected.png: Added. 75 * platform/mac/fast/multicol/vertical-lr/float-paginate-complex-expected.txt: Added. 76 * platform/mac/fast/multicol/vertical-lr/float-paginate-expected.checksum: Added. 77 * platform/mac/fast/multicol/vertical-lr/float-paginate-expected.png: Added. 78 * platform/mac/fast/multicol/vertical-lr/float-paginate-expected.txt: Added. 79 * platform/mac/fast/multicol/vertical-lr/nested-columns-expected.checksum: Added. 80 * platform/mac/fast/multicol/vertical-lr/nested-columns-expected.png: Added. 81 * platform/mac/fast/multicol/vertical-lr/nested-columns-expected.txt: Added. 82 * platform/mac/fast/multicol/vertical-lr/unsplittable-inline-block-expected.checksum: Added. 83 * platform/mac/fast/multicol/vertical-lr/unsplittable-inline-block-expected.png: Added. 84 * platform/mac/fast/multicol/vertical-lr/unsplittable-inline-block-expected.txt: Added. 85 * platform/mac/fast/multicol/vertical-rl: Added. 86 * platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.checksum: Added. 87 * platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.png: Added. 88 * platform/mac/fast/multicol/vertical-rl/border-padding-pagination-expected.txt: Added. 89 * platform/mac/fast/multicol/vertical-rl/column-break-with-balancing-expected.checksum: Added. 90 * platform/mac/fast/multicol/vertical-rl/column-break-with-balancing-expected.png: Added. 91 * platform/mac/fast/multicol/vertical-rl/column-break-with-balancing-expected.txt: Added. 92 * platform/mac/fast/multicol/vertical-rl/column-count-with-rules-expected.checksum: Added. 93 * platform/mac/fast/multicol/vertical-rl/column-count-with-rules-expected.png: Added. 94 * platform/mac/fast/multicol/vertical-rl/column-count-with-rules-expected.txt: Added. 95 * platform/mac/fast/multicol/vertical-rl/column-rules-expected.checksum: Added. 96 * platform/mac/fast/multicol/vertical-rl/column-rules-expected.png: Added. 97 * platform/mac/fast/multicol/vertical-rl/column-rules-expected.txt: Added. 98 * platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.checksum: Added. 99 * platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.png: Added. 100 * platform/mac/fast/multicol/vertical-rl/float-avoidance-expected.txt: Added. 101 * platform/mac/fast/multicol/vertical-rl/float-multicol-expected.checksum: Added. 102 * platform/mac/fast/multicol/vertical-rl/float-multicol-expected.png: Added. 103 * platform/mac/fast/multicol/vertical-rl/float-multicol-expected.txt: Added. 104 * platform/mac/fast/multicol/vertical-rl/float-paginate-complex-expected.checksum: Added. 105 * platform/mac/fast/multicol/vertical-rl/float-paginate-complex-expected.png: Added. 106 * platform/mac/fast/multicol/vertical-rl/float-paginate-complex-expected.txt: Added. 107 * platform/mac/fast/multicol/vertical-rl/float-paginate-expected.checksum: Added. 108 * platform/mac/fast/multicol/vertical-rl/float-paginate-expected.png: Added. 109 * platform/mac/fast/multicol/vertical-rl/float-paginate-expected.txt: Added. 110 * platform/mac/fast/multicol/vertical-rl/nested-columns-expected.checksum: Added. 111 * platform/mac/fast/multicol/vertical-rl/nested-columns-expected.png: Added. 112 * platform/mac/fast/multicol/vertical-rl/nested-columns-expected.txt: Added. 113 * platform/mac/fast/multicol/vertical-rl/unsplittable-inline-block-expected.checksum: Added. 114 * platform/mac/fast/multicol/vertical-rl/unsplittable-inline-block-expected.png: Added. 115 * platform/mac/fast/multicol/vertical-rl/unsplittable-inline-block-expected.txt: Added. 116 1 117 2011-01-26 Tony Chang <tony@chromium.org> 2 118 -
trunk/LayoutTests/fast/multicol/break-properties-expected.txt
r62632 r76726 1 1 PASS: 'break-before' is at (218, 8) 2 2 PASS: 'after-break' is at (428, 8) 3 FAIL: 'no-break' is at (428, 68) instead of (533 ,8)4 3 -
trunk/LayoutTests/fast/multicol/break-properties.html
r61065 r76726 33 33 testBoxPosition("break-before", 218, 8); 34 34 testBoxPosition("after-break", 428, 8); 35 testBoxPosition("no-break", 533, 8);36 35 </script> -
trunk/LayoutTests/fast/multicol/float-truncation.html
r67660 r76726 1 <html> 2 <head> 1 3 <style> 2 4 div.columns { … … 18 20 } 19 21 </style> 22 </head> 23 <body> 20 24 <div id="tests"> 21 25 <div class="columns" style="height: 80px;"> -
trunk/Source/WebCore/ChangeLog
r76724 r76726 1 2011-01-26 Dave Hyatt <hyatt@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 https://bugs.webkit.org/show_bug.cgi?id=46421, make multi-column layout work with vertical text. 6 7 Added new tests in fast/multicol/vertical-lr and fast/multicol/vertical-rl. 8 9 * css/html.css: 10 Update p, blockquote and h1-h6 to respect directionality so that column layout tests that use those 11 elements work properly. 12 13 * rendering/InlineFlowBox.cpp: 14 (WebCore::InlineFlowBox::placeBoxesInBlockDirection): 15 Fix a flipping bug with the computation of lineTopIncludingMargins where it could be incorrectly shrunk 16 in some cases (causing lines to all stack on top of one another). 17 18 * rendering/InlineTextBox.h: 19 (WebCore::InlineTextBox::calculateBoundaries): 20 Fix calculateBoundaries to be physical rather than logical. 21 22 * rendering/LayoutState.cpp: 23 (WebCore::LayoutState::addForcedColumnBreak): 24 * rendering/LayoutState.h: 25 Rename childY to childLogicalOffset. 26 27 * rendering/RenderBlock.cpp: 28 (WebCore::RenderBlock::layoutBlock): 29 (WebCore::RenderBlock::addOverflowFromChildren): 30 (WebCore::RenderBlock::addOverflowFromFloats): 31 (WebCore::RenderBlock::collapseMargins): 32 (WebCore::RenderBlock::estimateLogicalTopPosition): 33 (WebCore::RenderBlock::layoutBlockChild): 34 (WebCore::RenderBlock::markForPaginationRelayoutIfNeeded): 35 (WebCore::RenderBlock::paintColumnRules): 36 (WebCore::RenderBlock::paintColumnContents): 37 (WebCore::RenderBlock::paintFloats): 38 (WebCore::RenderBlock::selectionGaps): 39 (WebCore::RenderBlock::removeFloatingObjectsBelow): 40 (WebCore::RenderBlock::addOverhangingFloats): 41 (WebCore::RenderBlock::hitTestFloats): 42 (WebCore::RenderBlock::hitTestColumns): 43 (WebCore::RenderBlock::calcColumnWidth): 44 (WebCore::RenderBlock::desiredColumnWidth): 45 (WebCore::RenderBlock::columnRectAt): 46 (WebCore::RenderBlock::layoutColumns): 47 (WebCore::RenderBlock::adjustPointToColumnContents): 48 (WebCore::RenderBlock::adjustRectForColumns): 49 (WebCore::RenderBlock::flipForWritingModeIncludingColumns): 50 (WebCore::RenderBlock::adjustForColumns): 51 (WebCore::RenderBlock::adjustForBorderFit): 52 (WebCore::RenderBlock::nextPageLogicalTop): 53 (WebCore::RenderBlock::applyBeforeBreak): 54 (WebCore::RenderBlock::applyAfterBreak): 55 (WebCore::RenderBlock::adjustForUnsplittableChild): 56 (WebCore::RenderBlock::adjustLinePositionForPagination): 57 * rendering/RenderBlock.h: 58 (WebCore::RenderBlock::logicalRightOffsetForContent): 59 (WebCore::RenderBlock::logicalLeftOffsetForContent): 60 (WebCore::RenderBlock::leftForFloatIncludingMargin): 61 (WebCore::RenderBlock::topForFloatIncludingMargin): 62 * rendering/RenderBlockLineLayout.cpp: 63 (WebCore::RenderBlock::layoutInlineChildren): 64 (WebCore::RenderBlock::determineStartPosition): 65 Reworking of all the RenderBlock column functions to support flipping and vertical modes. 66 67 * rendering/RenderBox.cpp: 68 (WebCore::RenderBox::offsetFromContainer): 69 (WebCore::RenderBox::flipForWritingModeIncludingColumns): 70 Patch offsetFromContainer to be aware of flipped block writing modes when dealing with column layouts. 71 72 * rendering/RenderBox.h: 73 (WebCore::RenderBox::clientLogicalBottom): 74 Fix a bug in clientLogicalBottom where it didn't add in the right border/padding. 75 76 * rendering/RenderFlexibleBox.cpp: 77 (WebCore::RenderFlexibleBox::layoutBlock): 78 Better terminology for pagination. 79 80 * rendering/RenderInline.cpp: 81 (WebCore::RenderInline::offsetFromContainer): 82 (WebCore::RenderInline::mapLocalToContainer): 83 * rendering/RenderLayer.cpp: 84 (WebCore::RenderLayer::paintChildLayerIntoColumns): 85 (WebCore::RenderLayer::hitTestChildLayerColumns): 86 (WebCore::RenderLayer::localBoundingBox): 87 (WebCore::RenderLayer::boundingBox): 88 Patch painting in RenderLayers to be vertical-text-aware. 89 90 * rendering/RenderObject.cpp: 91 (WebCore::RenderObject::mapLocalToContainer): 92 Add code to be flipped block-aware with columns. 93 94 * rendering/RenderTable.cpp: 95 (WebCore::RenderTable::layout): 96 * rendering/RenderTableRow.cpp: 97 (WebCore::RenderTableRow::layout): 98 * rendering/RenderTableSection.cpp: 99 (WebCore::RenderTableSection::layoutRows): 100 Fix pagination to use better terminology. 101 102 * rendering/RenderText.cpp: 103 (WebCore::RenderText::absoluteQuads): 104 (WebCore::RenderText::absoluteQuadsForRange): 105 Fix a bug where vertical text wasn't taken into account. 106 1 107 2011-01-26 Dimitri Glazkov <dglazkov@chromium.org> 2 108 -
trunk/Source/WebCore/css/html.css
r75940 r76726 62 62 p { 63 63 display: block; 64 margin: 1.0__qem 0px 64 -webkit-margin-before: 1__qem; 65 -webkit-margin-after: 1__qem; 66 -webkit-margin-start: 0; 67 -webkit-margin-end: 0; 65 68 } 66 69 … … 88 91 blockquote { 89 92 display: block; 90 margin: 1__qem 40px 1em 40px 93 -webkit-margin-before: 1__qem; 94 -webkit-margin-after: 1em; 95 -webkit-margin-start: 40px; 96 -webkit-margin-end: 40px; 91 97 } 92 98 … … 97 103 figure { 98 104 display: block; 99 margin: 1em 40px 1em 40px 105 -webkit-margin-before: 1em; 106 -webkit-margin-after: 1em; 107 -webkit-margin-start: 40px; 108 -webkit-margin-end: 40px; 100 109 } 101 110 … … 122 131 hr { 123 132 display: block; 124 margin: 0.5em auto; 133 -webkit-margin-before: 0.5em; 134 -webkit-margin-after: 0.5em; 135 -webkit-margin-start: auto; 136 -webkit-margin-end: auto; 125 137 border-style: inset; 126 138 border-width: 1px … … 136 148 display: block; 137 149 font-size: 2em; 138 margin: .67__qem 0 .67em 0; 150 -webkit-margin-before: 0.67__qem; 151 -webkit-margin-after: 0.67em; 152 -webkit-margin-start: 0; 153 -webkit-margin-end: 0; 139 154 font-weight: bold 140 155 } … … 143 158 display: block; 144 159 font-size: 1.5em; 145 margin: .83__qem 0 .83em 0; 160 -webkit-margin-before: 0.83__qem; 161 -webkit-margin-after: 0.83em; 162 -webkit-margin-start: 0; 163 -webkit-margin-end: 0; 146 164 font-weight: bold 147 165 } … … 150 168 display: block; 151 169 font-size: 1.17em; 152 margin: 1__qem 0 1em 0; 170 -webkit-margin-before: 1__qem; 171 -webkit-margin-after: 1em; 172 -webkit-margin-start: 0; 173 -webkit-margin-end: 0; 153 174 font-weight: bold 154 175 } … … 156 177 h4 { 157 178 display: block; 158 margin: 1.33__qem 0 1.33em 0; 179 -webkit-margin-before: 1.33__qem; 180 -webkit-margin-after: 1.33em; 181 -webkit-margin-start: 0; 182 -webkit-margin-end: 0; 159 183 font-weight: bold 160 184 } … … 163 187 display: block; 164 188 font-size: .83em; 165 margin: 1.67__qem 0 1.67em 0; 189 -webkit-margin-before: 1.67__qem; 190 -webkit-margin-after: 1.67em; 191 -webkit-margin-start: 0; 192 -webkit-margin-end: 0; 166 193 font-weight: bold 167 194 } … … 170 197 display: block; 171 198 font-size: .67em; 172 margin: 2.33__qem 0 2.33em 0; 199 -webkit-margin-before: 2.33__qem; 200 -webkit-margin-after: 2.33em; 201 -webkit-margin-start: 0; 202 -webkit-margin-end: 0; 173 203 font-weight: bold 174 204 } -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r76442 r76726 605 605 606 606 int newLogicalTop = curr->logicalTop(); 607 int newLogicalTopIncludingMargins ;607 int newLogicalTopIncludingMargins = newLogicalTop; 608 608 int boxHeight = curr->logicalHeight(); 609 609 int boxHeightIncludingMargins = boxHeight; -
trunk/Source/WebCore/rendering/InlineTextBox.h
r75257 r76726 82 82 83 83 public: 84 virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), logicalWidth(), logicalHeight()); }84 virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), width(), height()); } 85 85 86 86 virtual IntRect selectionRect(int absx, int absy, int startPos, int endPos); -
trunk/Source/WebCore/rendering/LayoutState.cpp
r74121 r76726 168 168 } 169 169 170 void LayoutState::addForcedColumnBreak(int child Y)170 void LayoutState::addForcedColumnBreak(int childLogicalOffset) 171 171 { 172 172 if (!m_columnInfo || m_columnInfo->columnHeight()) 173 173 return; 174 m_columnInfo->addForcedBreak(pageLogicalOffset(child Y));174 m_columnInfo->addForcedBreak(pageLogicalOffset(childLogicalOffset)); 175 175 } 176 176 -
trunk/Source/WebCore/rendering/LayoutState.h
r76248 r76726 72 72 int pageLogicalOffset(int childLogicalOffset) const; 73 73 74 void addForcedColumnBreak(int child Y);74 void addForcedColumnBreak(int childLogicalOffset); 75 75 76 76 bool pageLogicalHeight() const { return m_pageLogicalHeight; } -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r76442 r76726 1260 1260 1261 1261 if (view()->layoutState()->m_pageLogicalHeight) 1262 setPageLogicalOffset(view()->layoutState()->pageLogicalOffset( y()));1262 setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(logicalTop())); 1263 1263 1264 1264 updateLayerTransform(); … … 1323 1323 if (columnCount(colInfo)) { 1324 1324 IntRect lastRect = columnRectAt(colInfo, columnCount(colInfo) - 1); 1325 int overflowLeft = !style()->isLeftToRightDirection() ? min(0, lastRect.x()) : 0; 1326 int overflowRight = style()->isLeftToRightDirection() ? max(width(), lastRect.x() + lastRect.width()) : 0; 1327 int overflowHeight = borderTop() + paddingTop() + colInfo->columnHeight(); 1328 addLayoutOverflow(IntRect(overflowLeft, 0, overflowRight - overflowLeft, overflowHeight)); 1325 if (style()->isHorizontalWritingMode()) { 1326 int overflowLeft = !style()->isLeftToRightDirection() ? min(0, lastRect.x()) : 0; 1327 int overflowRight = style()->isLeftToRightDirection() ? max(width(), lastRect.right()) : 0; 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.bottom()) : 0; 1334 int overflowWidth = borderBefore() + paddingBefore() + colInfo->columnHeight(); 1335 addLayoutOverflow(IntRect(0, overflowTop, overflowWidth, overflowBottom - overflowTop)); 1336 } 1329 1337 } 1330 1338 } … … 1376 1384 for (; (r = it.current()); ++it) { 1377 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 1388 return; … … 1642 1650 if (paginated && logicalTop > beforeCollapseLogicalTop) { 1643 1651 int oldLogicalTop = logicalTop; 1644 logicalTop = min(logicalTop, nextPage Top(beforeCollapseLogicalTop));1652 logicalTop = min(logicalTop, nextPageLogicalTop(beforeCollapseLogicalTop)); 1645 1653 setLogicalHeight(logicalHeight() + (logicalTop - oldLogicalTop)); 1646 1654 } … … 1712 1720 // page. 1713 1721 if (paginated && logicalTopEstimate > logicalHeight()) 1714 logicalTopEstimate = min(logicalTopEstimate, nextPage Top(logicalHeight()));1722 logicalTopEstimate = min(logicalTopEstimate, nextPageLogicalTop(logicalHeight())); 1715 1723 1716 1724 logicalTopEstimate += getClearDelta(child, logicalTopEstimate); … … 2055 2063 if (paginated) { 2056 2064 // Check for an after page/column break. 2057 int newHeight = applyAfterBreak(child, height(), marginInfo);2065 int newHeight = applyAfterBreak(child, logicalHeight(), marginInfo); 2058 2066 if (newHeight != height()) 2059 2067 setLogicalHeight(newHeight); … … 2152 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 2163 setChildNeedsLayout(true, false); 2156 2164 } … … 2229 2237 ColumnInfo* colInfo = columnInfo(); 2230 2238 unsigned colCount = columnCount(colInfo); 2231 int curr XOffset = style()->isLeftToRightDirection() ? 0 : contentWidth();2232 int ruleAdd = borderLeft() + paddingLeft();2233 int rule X = style()->isLeftToRightDirection() ? 0 : contentWidth();2239 int currLogicalLeftOffset = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth(); 2240 int ruleAdd = logicalLeftOffsetForContent(); 2241 int ruleLogicalLeft = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth(); 2234 2242 for (unsigned i = 0; i < colCount; i++) { 2235 2243 IntRect colRect = columnRectAt(colInfo, i); 2236 2244 2245 int inlineDirectionSize = style()->isHorizontalWritingMode() ? colRect.width() : colRect.height(); 2246 2237 2247 // Move to the next position. 2238 2248 if (style()->isLeftToRightDirection()) { 2239 rule X += colRect.width()+ colGap / 2;2240 curr XOffset += colRect.width()+ colGap;2249 ruleLogicalLeft += inlineDirectionSize + colGap / 2; 2250 currLogicalLeftOffset += inlineDirectionSize + colGap; 2241 2251 } else { 2242 rule X -= (colRect.width()+ colGap / 2);2243 curr XOffset -= (colRect.width()+ colGap);2252 ruleLogicalLeft -= (inlineDirectionSize + colGap / 2); 2253 currLogicalLeftOffset -= (inlineDirectionSize + colGap); 2244 2254 } 2245 2255 2246 2256 // Now paint the column rule. 2247 2257 if (i < colCount - 1) { 2248 int rule Start = tx + ruleX - ruleWidth / 2 + ruleAdd;2249 int rule End = ruleStart + ruleWidth;2250 int ruleTop = ty + borderTop() + paddingTop();2251 int ruleBottom = ruleTop + contentHeight();2252 drawLineForBoxSide(paintInfo.context, rule Start, ruleTop, ruleEnd, ruleBottom,2258 int ruleLeft = style()->isHorizontalWritingMode() ? tx + ruleLogicalLeft - ruleWidth / 2 + ruleAdd : tx + borderBefore() + paddingBefore(); 2259 int ruleRight = style()->isHorizontalWritingMode() ? ruleLeft + ruleWidth : ruleLeft + contentWidth(); 2260 int ruleTop = style()->isHorizontalWritingMode() ? ty + borderTop() + paddingTop() : ty + ruleLogicalLeft - ruleWidth / 2 + ruleAdd; 2261 int ruleBottom = style()->isHorizontalWritingMode() ? ruleTop + contentHeight() : ruleTop + ruleWidth; 2262 drawLineForBoxSide(paintInfo.context, ruleLeft, ruleTop, ruleRight, ruleBottom, 2253 2263 style()->isLeftToRightDirection() ? BSLeft : BSRight, ruleColor, ruleStyle, 0, 0); 2254 2264 } 2255 2265 2256 rule X = currXOffset;2266 ruleLogicalLeft = currLogicalLeftOffset; 2257 2267 } 2258 2268 } … … 2262 2272 // We need to do multiple passes, breaking up our child painting into strips. 2263 2273 GraphicsContext* context = paintInfo.context; 2264 int colGap = columnGap();2265 2274 ColumnInfo* colInfo = columnInfo(); 2266 2275 unsigned colCount = columnCount(colInfo); 2267 2276 if (!colCount) 2268 2277 return; 2269 int currXOffset = style()->isLeftToRightDirection() ? 0 : contentWidth() - columnRectAt(colInfo, 0).width(); 2270 int currYOffset = 0; 2278 int currLogicalTopOffset = 0; 2271 2279 for (unsigned i = 0; i < colCount; i++) { 2272 2280 // For each rect, we clip to the rect, and then we adjust our coords. 2273 2281 IntRect colRect = columnRectAt(colInfo, i); 2282 flipForWritingMode(colRect); 2283 int logicalLeftOffset = (style()->isHorizontalWritingMode() ? colRect.x() : colRect.y()) - logicalLeftOffsetForContent(); 2284 IntSize offset = style()->isHorizontalWritingMode() ? IntSize(logicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, logicalLeftOffset); 2274 2285 colRect.move(tx, ty); 2275 2286 PaintInfo info(paintInfo); … … 2282 2293 // like overflow:hidden. 2283 2294 context->clip(colRect); 2284 2295 2285 2296 // Adjust our x and y when painting. 2286 int finalX = tx + currXOffset;2287 int finalY = ty + currYOffset;2297 int finalX = tx + offset.width(); 2298 int finalY = ty + offset.height(); 2288 2299 if (paintingFloats) 2289 2300 paintFloats(info, finalX, finalY, paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip); … … 2293 2304 context->restore(); 2294 2305 } 2295 2296 // Move to the next position.2297 if (style()->is LeftToRightDirection())2298 curr XOffset += colRect.width() + colGap;2306 2307 int blockDelta = (style()->isHorizontalWritingMode() ? colRect.height() : colRect.width()); 2308 if (style()->isFlippedBlocksWritingMode()) 2309 currLogicalTopOffset += blockDelta; 2299 2310 else 2300 currXOffset -= (colRect.width() + colGap); 2301 2302 currYOffset -= colRect.height(); 2311 currLogicalTopOffset -= blockDelta; 2303 2312 } 2304 2313 } … … 2477 2486 } 2478 2487 2488 IntPoint RenderBlock::flipFloatForWritingMode(const FloatingObject* child, const IntPoint& point) const 2489 { 2490 if (!style()->isFlippedBlocksWritingMode()) 2491 return point; 2492 2493 // This is similar to the ParentToChildFlippingAdjustment in RenderBox::flipForWritingMode. We have to subtract out our left/top offsets twice, since 2494 // it's going to get added back in. We hide this complication here so that the calling code looks normal for the unflipped 2495 // case. 2496 if (style()->isHorizontalWritingMode()) 2497 return IntPoint(point.x(), point.y() + height() - child->renderer()->height() - 2 * topForFloatIncludingMargin(child)); 2498 return IntPoint(point.x() + width() - child->width() - 2 * leftForFloatIncludingMargin(child), point.y()); 2499 } 2500 2479 2501 void RenderBlock::paintFloats(PaintInfo& paintInfo, int tx, int ty, bool preservePhase) 2480 2502 { … … 2489 2511 PaintInfo currentPaintInfo(paintInfo); 2490 2512 currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground; 2491 IntPoint childPoint = flipF orWritingMode(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);2513 IntPoint childPoint = flipFloatForWritingMode(r, IntPoint(tx + leftForFloatIncludingMargin(r) - r->m_renderer->x(), ty + topForFloatIncludingMargin(r) - r->m_renderer->y())); 2492 2514 r->m_renderer->paint(currentPaintInfo, childPoint.x(), childPoint.y()); 2493 2515 if (!preservePhase) { … … 2723 2745 for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); it.current(); ++it) { 2724 2746 FloatingObject* r = it.current(); 2725 IntRect floatBox = IntRect(offsetFromRootBlock.width() + r->left() + r->m_renderer->marginLeft(),2726 offsetFromRootBlock.height() + r->top() + r->m_renderer->marginTop(),2747 IntRect floatBox = IntRect(offsetFromRootBlock.width() + leftForFloatIncludingMargin(r), 2748 offsetFromRootBlock.height() + topForFloatIncludingMargin(r), 2727 2749 r->m_renderer->width(), r->m_renderer->height()); 2728 2750 rootBlock->flipForWritingMode(floatBox); … … 3094 3116 } 3095 3117 3096 void RenderBlock::removeFloatingObjectsBelow(FloatingObject* lastFloat, int y)3118 void RenderBlock::removeFloatingObjectsBelow(FloatingObject* lastFloat, int logicalOffset) 3097 3119 { 3098 3120 if (!m_floatingObjects) … … 3100 3122 3101 3123 FloatingObject* curr = m_floatingObjects->last(); 3102 while (curr != lastFloat && (!curr->isPlaced() || curr->top() >= y)) {3124 while (curr != lastFloat && (!curr->isPlaced() || logicalTopForFloat(curr) >= logicalOffset)) { 3103 3125 m_floatingObjects->removeLast(); 3104 3126 curr = m_floatingObjects->last(); … … 3612 3634 // child now. 3613 3635 if (r->m_isDescendant) 3614 child->addOverflowFromChild(r->m_renderer, IntSize( r->left() + r->m_renderer->marginLeft(), r->top() + r->m_renderer->marginTop()));3636 child->addOverflowFromChild(r->m_renderer, IntSize(leftForFloatIncludingMargin(r), topForFloatIncludingMargin(r))); 3615 3637 } 3616 3638 } … … 3850 3872 for (it.toLast(); (floatingObject = it.current()); --it) { 3851 3873 if (floatingObject->m_shouldPaint && !floatingObject->m_renderer->hasSelfPaintingLayer()) { 3852 int xOffset = floatingObject->left() + floatingObject->m_renderer->marginLeft() - floatingObject->m_renderer->x();3853 int yOffset = floatingObject->top() + floatingObject->m_renderer->marginTop() - floatingObject->m_renderer->y();3854 IntPoint childPoint = flipF orWritingMode(floatingObject->m_renderer, IntPoint(tx + xOffset, ty + yOffset), ParentToChildFlippingAdjustment);3874 int xOffset = leftForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->x(); 3875 int yOffset = topForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->y(); 3876 IntPoint childPoint = flipFloatForWritingMode(floatingObject, IntPoint(tx + xOffset, ty + yOffset)); 3855 3877 if (floatingObject->m_renderer->hitTest(request, result, IntPoint(x, y), childPoint.x(), childPoint.y())) { 3856 3878 updateHitTestResult(result, IntPoint(x - childPoint.x(), y - childPoint.y())); … … 3870 3892 if (!colCount) 3871 3893 return false; 3872 int l eft = borderLeft() + paddingLeft();3873 int curr YOffset = 0;3894 int logicalLeft = logicalLeftOffsetForContent(); 3895 int currLogicalTopOffset = 0; 3874 3896 int i; 3875 for (i = 0; i < colCount; i++) 3876 currYOffset -= columnRectAt(colInfo, i).height(); 3897 bool isHorizontal = style()->isHorizontalWritingMode(); 3898 for (i = 0; i < colCount; i++) { 3899 IntRect colRect = columnRectAt(colInfo, i); 3900 int blockDelta = (isHorizontal ? colRect.height() : colRect.width()); 3901 if (style()->isFlippedBlocksWritingMode()) 3902 currLogicalTopOffset += blockDelta; 3903 else 3904 currLogicalTopOffset -= blockDelta; 3905 } 3877 3906 for (i = colCount - 1; i >= 0; i--) { 3878 3907 IntRect colRect = columnRectAt(colInfo, i); 3879 int currXOffset = colRect.x() - left; 3880 currYOffset += colRect.height(); 3908 flipForWritingMode(colRect); 3909 int currLogicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - logicalLeft; 3910 int blockDelta = (isHorizontal ? colRect.height() : colRect.width()); 3911 if (style()->isFlippedBlocksWritingMode()) 3912 currLogicalTopOffset -= blockDelta; 3913 else 3914 currLogicalTopOffset += blockDelta; 3881 3915 colRect.move(tx, ty); 3882 3916 … … 3885 3919 // Adjust tx and ty to change where we hit test. 3886 3920 3887 int finalX = tx + currXOffset; 3888 int finalY = ty + currYOffset; 3921 IntSize offset = isHorizontal ? IntSize(currLogicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, currLogicalLeftOffset); 3922 int finalX = tx + offset.width(); 3923 int finalY = ty + offset.height(); 3889 3924 if (result.isRectBasedTest() && !colRect.contains(result.rectForPoint(x, y))) 3890 3925 hitTestContents(request, result, x, y, finalX, finalY, hitTestAction); … … 4106 4141 // Calculate our column width and column count. 4107 4142 unsigned desiredColumnCount = 1; 4108 int desiredColumnWidth = content Width();4143 int desiredColumnWidth = contentLogicalWidth(); 4109 4144 4110 4145 // For now, we don't support multi-column layouts when printing, since we have to do a lot of work for proper pagination. … … 4181 4216 { 4182 4217 if (!hasColumns()) 4183 return content Width();4218 return contentLogicalWidth(); 4184 4219 return gColumnInfoMap->get(this)->desiredColumnWidth(); 4185 4220 } … … 4210 4245 4211 4246 // Compute the appropriate rect based off our information. 4212 int col Width = colInfo->desiredColumnWidth();4213 int col Height = colInfo->columnHeight();4214 int col Top = borderTop() + paddingTop();4247 int colLogicalWidth = colInfo->desiredColumnWidth(); 4248 int colLogicalHeight = colInfo->columnHeight(); 4249 int colLogicalTop = borderBefore() + paddingBefore(); 4215 4250 int colGap = columnGap(); 4216 int colLeft = style()->isLeftToRightDirection() ? 4217 borderLeft() + paddingLeft() + (index * (colWidth + colGap)) 4218 : borderLeft() + paddingLeft() + contentWidth() - colWidth - (index * (colWidth + colGap)); 4219 return IntRect(colLeft, colTop, colWidth, colHeight); 4251 int colLogicalLeft = style()->isLeftToRightDirection() ? 4252 logicalLeftOffsetForContent() + (index * (colLogicalWidth + colGap)) 4253 : logicalLeftOffsetForContent() + contentLogicalWidth() - colLogicalWidth - (index * (colLogicalWidth + colGap)); 4254 IntRect rect(colLogicalLeft, colLogicalTop, colLogicalWidth, colLogicalHeight); 4255 if (style()->isHorizontalWritingMode()) 4256 return IntRect(colLogicalLeft, colLogicalTop, colLogicalWidth, colLogicalHeight); 4257 return IntRect(colLogicalTop, colLogicalLeft, colLogicalHeight, colLogicalWidth); 4220 4258 } 4221 4259 … … 4237 4275 if (!pageLogicalHeight) { 4238 4276 int distanceBetweenBreaks = max(colInfo->maximumDistanceBetweenForcedBreaks(), 4239 view()->layoutState()->pageLogicalOffset(border Top() + paddingTop() + contentHeight()) - colInfo->forcedBreakOffset());4277 view()->layoutState()->pageLogicalOffset(borderBefore() + paddingBefore() + contentLogicalHeight()) - colInfo->forcedBreakOffset()); 4240 4278 columnHeight = max(colInfo->minimumColumnHeight(), distanceBetweenBreaks); 4241 4279 } 4242 } else if (content Height() > pageLogicalHeight * desiredColumnCount) {4280 } else if (contentLogicalHeight() > pageLogicalHeight * desiredColumnCount) { 4243 4281 // Now that we know the intrinsic height of the columns, we have to rebalance them. 4244 columnHeight = max(colInfo->minimumColumnHeight(), (int)ceilf((float)content Height() / desiredColumnCount));4282 columnHeight = max(colInfo->minimumColumnHeight(), (int)ceilf((float)contentLogicalHeight() / desiredColumnCount)); 4245 4283 } 4246 4284 … … 4254 4292 4255 4293 if (pageLogicalHeight) 4256 colInfo->setColumnCountAndHeight(ceilf((float)content Height() / pageLogicalHeight), pageLogicalHeight);4294 colInfo->setColumnCountAndHeight(ceilf((float)contentLogicalHeight() / pageLogicalHeight), pageLogicalHeight); 4257 4295 4258 4296 if (columnCount(colInfo)) { 4259 setLogicalHeight(border Top() + paddingTop() + colInfo->columnHeight() + borderBottom() + paddingBottom() + horizontalScrollbarHeight());4297 setLogicalHeight(borderBefore() + paddingBefore() + colInfo->columnHeight() + borderAfter() + paddingAfter() + scrollbarLogicalHeight()); 4260 4298 m_overflow.clear(); 4261 4299 } … … 4276 4314 // Determine which columns we intersect. 4277 4315 int colGap = columnGap(); 4278 int leftGap = colGap / 2;4316 int halfColGap = colGap / 2; 4279 4317 IntPoint columnPoint(columnRectAt(colInfo, 0).location()); 4280 int yOffset = 0;4318 int logicalOffset = 0; 4281 4319 for (unsigned i = 0; i < colInfo->columnCount(); i++) { 4282 4320 // Add in half the column gap to the left and right of the rect. 4283 4321 IntRect colRect = columnRectAt(colInfo, i); 4284 IntRect gapAndColumnRect(colRect.x() - leftGap, colRect.y(), colRect.width() + colGap, colRect.height()); 4285 4286 if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.right()) { 4287 // FIXME: The clamping that follows is not completely right for right-to-left 4288 // content. 4289 // Clamp everything above the column to its top left. 4290 if (point.y() < gapAndColumnRect.y()) 4291 point = gapAndColumnRect.location(); 4292 // Clamp everything below the column to the next column's top left. If there is 4293 // no next column, this still maps to just after this column. 4294 else if (point.y() >= gapAndColumnRect.bottom()) { 4295 point = gapAndColumnRect.location(); 4296 point.move(0, gapAndColumnRect.height()); 4322 if (style()->isHorizontalWritingMode()) { 4323 IntRect gapAndColumnRect(colRect.x() - halfColGap, colRect.y(), colRect.width() + colGap, colRect.height()); 4324 if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.right()) { 4325 // FIXME: The clamping that follows is not completely right for right-to-left 4326 // content. 4327 // Clamp everything above the column to its top left. 4328 if (point.y() < gapAndColumnRect.y()) 4329 point = gapAndColumnRect.location(); 4330 // Clamp everything below the column to the next column's top left. If there is 4331 // no next column, this still maps to just after this column. 4332 else if (point.y() >= gapAndColumnRect.bottom()) { 4333 point = gapAndColumnRect.location(); 4334 point.move(0, gapAndColumnRect.height()); 4335 } 4336 4337 // We're inside the column. Translate the x and y into our column coordinate space. 4338 point.move(columnPoint.x() - colRect.x(), logicalOffset); 4339 return; 4297 4340 } 4298 4299 // We're inside the column. Translate the x and y into our column coordinate space. 4300 point.move(columnPoint.x() - colRect.x(), yOffset); 4301 return; 4302 } 4303 4304 // Move to the next position. 4305 yOffset += colRect.height(); 4341 4342 // Move to the next position. 4343 logicalOffset += colRect.height(); 4344 } else { 4345 IntRect gapAndColumnRect(colRect.x(), colRect.y() - halfColGap, colRect.width(), colRect.height() + colGap); 4346 if (point.y() >= gapAndColumnRect.y() && point.y() < gapAndColumnRect.bottom()) { 4347 // FIXME: The clamping that follows is not completely right for right-to-left 4348 // content. 4349 // Clamp everything above the column to its top left. 4350 if (point.x() < gapAndColumnRect.x()) 4351 point = gapAndColumnRect.location(); 4352 // Clamp everything below the column to the next column's top left. If there is 4353 // no next column, this still maps to just after this column. 4354 else if (point.x() >= gapAndColumnRect.right()) { 4355 point = gapAndColumnRect.location(); 4356 point.move(gapAndColumnRect.width(), 0); 4357 } 4358 4359 // We're inside the column. Translate the x and y into our column coordinate space. 4360 point.move(logicalOffset, columnPoint.y() - colRect.y()); 4361 return; 4362 } 4363 4364 // Move to the next position. 4365 logicalOffset += colRect.width(); 4366 } 4306 4367 } 4307 4368 } … … 4323 4384 return; 4324 4385 4325 int l eft = borderLeft() + paddingLeft();4326 4327 int currYOffset = 0; 4386 int logicalLeft = logicalLeftOffsetForContent(); 4387 int currLogicalOffset = 0; 4388 4328 4389 for (unsigned i = 0; i < colCount; i++) { 4329 4390 IntRect colRect = columnRectAt(colInfo, i); 4330 int currXOffset = colRect.x() - left;4331 4332 4391 IntRect repaintRect = r; 4333 repaintRect.move(currXOffset, currYOffset); 4334 4392 if (style()->isHorizontalWritingMode()) { 4393 int currXOffset = colRect.x() - logicalLeft; 4394 repaintRect.move(currXOffset, currLogicalOffset); 4395 currLogicalOffset -= colRect.height(); 4396 } else { 4397 int currYOffset = colRect.y() - logicalLeft; 4398 repaintRect.move(currLogicalOffset, currYOffset); 4399 currLogicalOffset -= colRect.width(); 4400 } 4335 4401 repaintRect.intersect(colRect); 4336 4337 4402 result.unite(repaintRect); 4338 4339 // Move to the next position.4340 currYOffset -= colRect.height();4341 4403 } 4342 4404 4343 4405 r = result; 4406 } 4407 4408 IntPoint RenderBlock::flipForWritingModeIncludingColumns(const IntPoint& point) const 4409 { 4410 ASSERT(hasColumns()); 4411 if (!hasColumns() || !style()->isFlippedBlocksWritingMode()) 4412 return point; 4413 ColumnInfo* colInfo = columnInfo(); 4414 int columnLogicalHeight = colInfo->columnHeight(); 4415 int expandedLogicalHeight = borderBefore() + paddingBefore() + columnCount(colInfo) * columnLogicalHeight + borderAfter() + paddingAfter() + scrollbarLogicalHeight(); 4416 if (style()->isHorizontalWritingMode()) 4417 return IntPoint(point.x(), expandedLogicalHeight - point.y()); 4418 return IntPoint(expandedLogicalHeight - point.x(), point.y()); 4419 } 4420 4421 void RenderBlock::flipForWritingModeIncludingColumns(IntRect& rect) const 4422 { 4423 ASSERT(hasColumns()); 4424 if (!hasColumns() || !style()->isFlippedBlocksWritingMode()) 4425 return; 4426 4427 ColumnInfo* colInfo = columnInfo(); 4428 int columnLogicalHeight = colInfo->columnHeight(); 4429 int expandedLogicalHeight = borderBefore() + paddingBefore() + columnCount(colInfo) * columnLogicalHeight + borderAfter() + paddingAfter() + scrollbarLogicalHeight(); 4430 if (style()->isHorizontalWritingMode()) 4431 rect.setY(expandedLogicalHeight - rect.bottom()); 4432 else 4433 rect.setX(expandedLogicalHeight - rect.right()); 4344 4434 } 4345 4435 … … 4351 4441 ColumnInfo* colInfo = columnInfo(); 4352 4442 4353 int left = borderLeft() + paddingLeft(); 4354 int yOffset = 0; 4443 int logicalLeft = logicalLeftOffsetForContent(); 4355 4444 size_t colCount = columnCount(colInfo); 4445 int colLogicalWidth = colInfo->desiredColumnWidth(); 4446 int colLogicalHeight = colInfo->columnHeight(); 4447 4356 4448 for (size_t i = 0; i < colCount; ++i) { 4357 IntRect columnRect = columnRectAt(colInfo, i); 4358 int xOffset = columnRect.x() - left; 4359 if (point.y() < columnRect.bottom() + yOffset) { 4360 offset.expand(xOffset, -yOffset); 4361 return; 4362 } 4363 4364 yOffset += columnRect.height(); 4449 // Compute the edges for a given column in the block progression direction. 4450 IntRect sliceRect = IntRect(logicalLeft, borderBefore() + paddingBefore() + i * colLogicalHeight, colLogicalWidth, colLogicalHeight); 4451 if (!style()->isHorizontalWritingMode()) 4452 sliceRect = sliceRect.transposedRect(); 4453 4454 // 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). 4455 flipForWritingModeIncludingColumns(sliceRect); 4456 4457 int logicalOffset = style()->isFlippedBlocksWritingMode() ? (colCount - 1 - i) * colLogicalHeight : i * colLogicalHeight; 4458 4459 // Now we're in the same coordinate space as the point. See if it is inside the rectangle. 4460 if (style()->isHorizontalWritingMode()) { 4461 if (point.y() >= sliceRect.y() && point.y() < sliceRect.bottom()) { 4462 offset.expand(columnRectAt(colInfo, i).x() - logicalLeft, -logicalOffset); 4463 return; 4464 } 4465 } else { 4466 if (point.x() >= sliceRect.x() && point.x() < sliceRect.right()) { 4467 offset.expand(-logicalOffset, columnRectAt(colInfo, i).y() - logicalLeft); 4468 return; 4469 } 4470 } 4365 4471 } 4366 4472 } … … 4502 4608 { 4503 4609 RenderStyle* cstyle = child->style(); 4504 int result = 0; 4505 bool leftSide = (cstyle->isLeftToRightDirection()) ? !endOfInline : endOfInline; 4506 result += getBPMWidth((leftSide ? child->marginLeft() : child->marginRight()), 4507 (leftSide ? cstyle->marginLeft() : 4508 cstyle->marginRight())); 4509 result += getBPMWidth((leftSide ? child->paddingLeft() : child->paddingRight()), 4510 (leftSide ? cstyle->paddingLeft() : 4511 cstyle->paddingRight())); 4512 result += leftSide ? child->borderLeft() : child->borderRight(); 4513 return result; 4610 if (endOfInline) 4611 return getBPMWidth(child->marginEnd(), cstyle->marginEnd()) + 4612 getBPMWidth(child->paddingEnd(), cstyle->paddingEnd()) + 4613 child->borderEnd(); 4614 return getBPMWidth(child->marginStart(), cstyle->marginStart()) + 4615 getBPMWidth(child->paddingStart(), cstyle->paddingStart()) + 4616 child->borderStart(); 4514 4617 } 4515 4618 … … 4534 4637 int inlineMin = 0; 4535 4638 4536 int cw = containingBlock()->content Width();4639 int cw = containingBlock()->contentLogicalWidth(); 4537 4640 4538 4641 // If we are at the start of a line, we want to ignore all white-space. … … 4544 4647 // very specific cirucumstances (in order to match common WinIE renderings). 4545 4648 // Not supporting the quirk has caused us to mis-render some real sites. (See Bugzilla 10517.) 4546 bool allowImagesToBreak = !document()->inQuirksMode() || !isTableCell() || !style()-> width().isIntrinsicOrAuto();4649 bool allowImagesToBreak = !document()->inQuirksMode() || !isTableCell() || !style()->logicalWidth().isIntrinsicOrAuto(); 4547 4650 4548 4651 bool autoWrap, oldAutoWrap; … … 4612 4715 // Inline replaced elts add in their margins to their min/max values. 4613 4716 int margins = 0; 4614 Length leftMargin = cstyle->marginLeft();4615 Length rightMargin = cstyle->marginRight();4616 if ( leftMargin.isFixed())4617 margins += leftMargin.value();4618 if ( rightMargin.isFixed())4619 margins += rightMargin.value();4717 Length startMargin = cstyle->marginStart(); 4718 Length endMargin = cstyle->marginEnd(); 4719 if (startMargin.isFixed()) 4720 margins += startMargin.value(); 4721 if (endMargin.isFixed()) 4722 margins += endMargin.value(); 4620 4723 childMin += margins; 4621 4724 childMax += margins; … … 4656 4759 addedTextIndent = true; 4657 4760 ti = style()->textIndent().calcMinValue(cw); 4658 childMin +=ti;4659 childMax +=ti;4761 childMin += ti; 4762 childMax += ti; 4660 4763 } 4661 4764 … … 4819 4922 // Auto and percentage margins simply become 0 when computing min/max width. 4820 4923 // Fixed margins can be added in as is. 4821 Length ml = child->style()->marginLeft(); 4822 Length mr = child->style()->marginRight(); 4823 int margin = 0, marginLeft = 0, marginRight = 0; 4824 if (ml.isFixed()) 4825 marginLeft += ml.value(); 4826 if (mr.isFixed()) 4827 marginRight += mr.value(); 4828 margin = marginLeft + marginRight; 4924 Length startMarginLength = child->style()->marginStart(); 4925 Length endMarginLength = child->style()->marginEnd(); 4926 int margin = 0; 4927 int marginStart = 0; 4928 int marginEnd = 0; 4929 if (startMarginLength.isFixed()) 4930 marginStart += startMarginLength.value(); 4931 if (endMarginLength.isFixed()) 4932 marginEnd += endMarginLength.value(); 4933 margin = marginStart + marginEnd; 4829 4934 4830 4935 int w = child->minPreferredLogicalWidth() + margin; … … 4842 4947 // margins of the object. For negative margins, we will attempt to overlap the float if the negative margin 4843 4948 // is smaller than the float width. 4844 int maxLeft = marginLeft > 0 ? max(floatLeftWidth, marginLeft) : floatLeftWidth + marginLeft; 4845 int maxRight = marginRight > 0 ? max(floatRightWidth, marginRight) : floatRightWidth + marginRight; 4949 bool ltr = containingBlock()->style()->isLeftToRightDirection(); 4950 int marginLogicalLeft = ltr ? marginStart : marginEnd; 4951 int marginLogicalRight = ltr ? marginEnd : marginStart; 4952 int maxLeft = marginLogicalLeft > 0 ? max(floatLeftWidth, marginLogicalLeft) : floatLeftWidth + marginLogicalLeft; 4953 int maxRight = marginLogicalRight > 0 ? max(floatRightWidth, marginLogicalRight) : floatRightWidth + marginLogicalRight; 4846 4954 w = child->maxPreferredLogicalWidth() + maxLeft + maxRight; 4847 4955 w = max(w, floatLeftWidth + floatRightWidth); … … 4873 4981 // We can achieve this effect by making the maxwidth of blocks that contain tables 4874 4982 // with percentage widths be infinite (as long as they are not inside a table cell). 4875 if (document()->inQuirksMode() && child->style()-> width().isPercent() &&4983 if (document()->inQuirksMode() && child->style()->logicalWidth().isPercent() && 4876 4984 !isTableCell() && child->isTable() && m_maxPreferredLogicalWidth < BLOCK_MAX_WIDTH) { 4877 4985 RenderBlock* cb = containingBlock(); … … 5371 5479 // Only examine the object if our m_shouldPaint flag is set. 5372 5480 if (r->m_shouldPaint) { 5373 int floatLeft = r->left() - r->m_renderer->x() + r->m_renderer->marginLeft();5481 int floatLeft = leftForFloatIncludingMargin(r) - r->m_renderer->x(); 5374 5482 int floatRight = floatLeft + r->m_renderer->width(); 5375 5483 left = min(left, floatLeft); … … 5726 5834 } 5727 5835 5728 int RenderBlock::nextPage Top(int yPos) const5836 int RenderBlock::nextPageLogicalTop(int logicalOffset) const 5729 5837 { 5730 5838 LayoutState* layoutState = view()->layoutState(); 5731 5839 if (!layoutState->m_pageLogicalHeight) 5732 return yPos;5733 5734 // The yPosis in our coordinate space. We can add in our pushed offset.5840 return logicalOffset; 5841 5842 // The logicalOffset is in our coordinate space. We can add in our pushed offset. 5735 5843 int pageLogicalHeight = layoutState->m_pageLogicalHeight; 5736 int remainingHeight = (pageLogicalHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageLogicalHeight) % pageLogicalHeight; 5737 return yPos + remainingHeight; 5844 IntSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset; 5845 int offset = style()->isHorizontalWritingMode() ? delta.height() : delta.width(); 5846 int remainingLogicalHeight = (pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight) % pageLogicalHeight; 5847 return logicalOffset + remainingLogicalHeight; 5738 5848 } 5739 5849 … … 5752 5862 } 5753 5863 5754 int RenderBlock::applyBeforeBreak(RenderBox* child, int yPos)5864 int RenderBlock::applyBeforeBreak(RenderBox* child, int logicalOffset) 5755 5865 { 5756 5866 // FIXME: Add page break checking here when we support printing. … … 5760 5870 if (checkBeforeAlways && inNormalFlow(child)) { 5761 5871 if (checkColumnBreaks) 5762 view()->layoutState()->addForcedColumnBreak( yPos);5763 return nextPage Top(yPos);5764 } 5765 return yPos;5766 } 5767 5768 int RenderBlock::applyAfterBreak(RenderBox* child, int yPos, MarginInfo& marginInfo)5872 view()->layoutState()->addForcedColumnBreak(logicalOffset); 5873 return nextPageLogicalTop(logicalOffset); 5874 } 5875 return logicalOffset; 5876 } 5877 5878 int RenderBlock::applyAfterBreak(RenderBox* child, int logicalOffset, MarginInfo& marginInfo) 5769 5879 { 5770 5880 // FIXME: Add page break checking here when we support printing. … … 5775 5885 marginInfo.setMarginAfterQuirk(true); // Cause margins to be discarded for any following content. 5776 5886 if (checkColumnBreaks) 5777 view()->layoutState()->addForcedColumnBreak( yPos);5778 return nextPage Top(yPos);5779 } 5780 return yPos;5781 } 5782 5783 int RenderBlock::adjustForUnsplittableChild(RenderBox* child, int yPos, bool includeMargins)5887 view()->layoutState()->addForcedColumnBreak(logicalOffset); 5888 return nextPageLogicalTop(logicalOffset); 5889 } 5890 return logicalOffset; 5891 } 5892 5893 int RenderBlock::adjustForUnsplittableChild(RenderBox* child, int logicalOffset, bool includeMargins) 5784 5894 { 5785 5895 bool isUnsplittable = child->isReplaced() || child->scrollsOverflow(); 5786 5896 if (!isUnsplittable) 5787 return yPos;5788 int child Height = child->height() + (includeMargins ? child->marginTop() + child->marginBottom() : 0);5897 return logicalOffset; 5898 int childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : 0); 5789 5899 LayoutState* layoutState = view()->layoutState(); 5790 5900 if (layoutState->m_columnInfo) 5791 layoutState->m_columnInfo->updateMinimumColumnHeight(child Height);5901 layoutState->m_columnInfo->updateMinimumColumnHeight(childLogicalHeight); 5792 5902 int pageLogicalHeight = layoutState->m_pageLogicalHeight; 5793 if (!pageLogicalHeight || childHeight > pageLogicalHeight) 5794 return yPos; 5795 int remainingHeight = (pageLogicalHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageLogicalHeight) % pageLogicalHeight; 5796 if (remainingHeight < childHeight) 5797 return yPos + remainingHeight; 5798 return yPos; 5903 if (!pageLogicalHeight || childLogicalHeight > pageLogicalHeight) 5904 return logicalOffset; 5905 IntSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset; 5906 int offset = style()->isHorizontalWritingMode() ? delta.height() : delta.width(); 5907 int remainingLogicalHeight = (pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight) % pageLogicalHeight; 5908 if (remainingLogicalHeight < childLogicalHeight) 5909 return logicalOffset + remainingLogicalHeight; 5910 return logicalOffset; 5799 5911 } 5800 5912 … … 5819 5931 LayoutState* layoutState = view()->layoutState(); 5820 5932 int pageLogicalHeight = layoutState->m_pageLogicalHeight; 5821 int yPos = lineBox->topVisualOverflow();5822 int lineHeight = lineBox-> bottomVisualOverflow() - yPos;5933 int logicalOffset = lineBox->logicalTopVisualOverflow(); 5934 int lineHeight = lineBox->logicalBottomVisualOverflow() - logicalOffset; 5823 5935 if (layoutState->m_columnInfo) 5824 5936 layoutState->m_columnInfo->updateMinimumColumnHeight(lineHeight); 5825 yPos+= delta;5937 logicalOffset += delta; 5826 5938 lineBox->setPaginationStrut(0); 5827 5939 if (!pageLogicalHeight || lineHeight > pageLogicalHeight) 5828 5940 return; 5829 int remainingHeight = pageLogicalHeight - ((layoutState->m_layoutOffset - layoutState->m_pageOffset).height() + yPos) % pageLogicalHeight; 5830 if (remainingHeight < lineHeight) { 5831 int totalHeight = lineHeight + max(0, yPos); 5832 if (lineBox == firstRootBox() && totalHeight < pageLogicalHeight && !isPositioned() && !isTableCell()) 5833 setPaginationStrut(remainingHeight + max(0, yPos)); 5941 IntSize offsetDelta = layoutState->m_layoutOffset - layoutState->m_pageOffset; 5942 int offset = style()->isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width(); 5943 int remainingLogicalHeight = pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight; 5944 if (remainingLogicalHeight < lineHeight) { 5945 int totalLogicalHeight = lineHeight + max(0, logicalOffset); 5946 if (lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeight && !isPositioned() && !isTableCell()) 5947 setPaginationStrut(remainingLogicalHeight + max(0, logicalOffset)); 5834 5948 else { 5835 delta += remaining Height;5836 lineBox->setPaginationStrut(remaining Height);5949 delta += remainingLogicalHeight; 5950 lineBox->setPaginationStrut(remainingLogicalHeight); 5837 5951 } 5838 5952 } -
trunk/Source/WebCore/rendering/RenderBlock.h
r76438 r76726 107 107 virtual int availableLogicalWidth() const; 108 108 109 IntPoint flipForWritingModeIncludingColumns(const IntPoint&) const; 110 void flipForWritingModeIncludingColumns(IntRect&) const; 111 109 112 RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(firstLineBox()); } 110 113 RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(lastLineBox()); } … … 213 216 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*verticalScrollbarChanged*/) { }; 214 217 218 int logicalRightOffsetForContent() const { return style()->isHorizontalWritingMode() ? borderLeft() + paddingLeft() + availableLogicalWidth() : borderTop() + paddingTop() + availableLogicalWidth(); } 219 int logicalLeftOffsetForContent() const { return style()->isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); } 220 215 221 protected: 216 222 // These functions are only used internally to manipulate the render tree structure via remove/insert/appendChildNode. … … 262 268 virtual void paintObject(PaintInfo&, int tx, int ty); 263 269 264 int logicalRightOffsetForContent() const { return style()->isHorizontalWritingMode() ? borderLeft() + paddingLeft() + availableLogicalWidth() : borderTop() + paddingTop() + availableLogicalWidth(); }265 int logicalLeftOffsetForContent() const { return style()->isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }266 270 int logicalRightOffsetForLine(int position, int fixedOffset, bool applyTextIndent = true, int* logicalHeightRemaining = 0) const; 267 271 int logicalLeftOffsetForLine(int position, int fixedOffset, bool applyTextIndent = true, int* logicalHeightRemaining = 0) const; … … 400 404 int width() const { return m_frameRect.width(); } 401 405 int height() const { return m_frameRect.height(); } 402 406 403 407 void setLeft(int left) { m_frameRect.setX(left); } 404 408 void setTop(int top) { m_frameRect.setY(top); } … … 418 422 }; 419 423 420 int logicalTopForFloat(FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->top() : child->left(); } 421 int logicalBottomForFloat(FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->bottom() : child->right(); } 422 int logicalLeftForFloat(FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->left() : child->top(); } 423 int logicalRightForFloat(FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->right() : child->bottom(); } 424 int logicalWidthForFloat(FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->width() : child->height(); } 424 IntPoint flipFloatForWritingMode(const FloatingObject*, const IntPoint&) const; 425 426 int logicalTopForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->top() : child->left(); } 427 int logicalBottomForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->bottom() : child->right(); } 428 int logicalLeftForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->left() : child->top(); } 429 int logicalRightForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->right() : child->bottom(); } 430 int logicalWidthForFloat(const FloatingObject* child) const { return style()->isHorizontalWritingMode() ? child->width() : child->height(); } 425 431 void setLogicalTopForFloat(FloatingObject* child, int logicalTop) 426 432 { … … 450 456 else 451 457 child->setHeight(logicalWidth); 458 } 459 460 int leftForFloatIncludingMargin(const FloatingObject* child) const 461 { 462 if (style()->isHorizontalWritingMode()) 463 return child->left() + child->renderer()->marginLeft(); 464 else 465 return child->left() + marginBeforeForChild(child->renderer()); 466 } 467 468 int topForFloatIncludingMargin(const FloatingObject* child) const 469 { 470 if (style()->isHorizontalWritingMode()) 471 return child->top() + marginBeforeForChild(child->renderer()); 472 else 473 return child->top() + child->renderer()->marginTop(); 452 474 } 453 475 … … 489 511 FloatingObject* insertFloatingObject(RenderBox*); 490 512 void removeFloatingObject(RenderBox*); 491 void removeFloatingObjectsBelow(FloatingObject*, int y);513 void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset); 492 514 493 515 // Called from lineWidth, to position the floats added in the last line. … … 668 690 669 691 // Pagination routines. 670 int nextPage Top(int yPos) const; // Returns the top of the next page following yPos.671 int applyBeforeBreak(RenderBox* child, int yPos); // If the child has a before break, then return a new yPos that shifts to the top of the next page/column.672 int applyAfterBreak(RenderBox* child, int yPos, MarginInfo& marginInfo); // If the child has an after break, then return a new yPosthat shifts to the top of the next page/column.673 int adjustForUnsplittableChild(RenderBox* child, int yPos, bool includeMargins = false); // If the child is unsplittable and can't fit on the current page, return the top of the next page/column.674 void adjustLinePositionForPagination(RootInlineBox*, int& delta Y); // Computes a deltaYvalue that put a line at the top of the next page if it doesn't fit on the current page.692 int nextPageLogicalTop(int logicalOffset) const; // Returns the top of the next page following logicalOffset. 693 int applyBeforeBreak(RenderBox* child, int logicalOffset); // If the child has a before break, then return a new yPos that shifts to the top of the next page/column. 694 int applyAfterBreak(RenderBox* child, int logicalOffset, MarginInfo& marginInfo); // If the child has an after break, then return a new offset that shifts to the top of the next page/column. 695 int adjustForUnsplittableChild(RenderBox* child, int logicalOffset, bool includeMargins = false); // If the child is unsplittable and can't fit on the current page, return the top of the next page/column. 696 void adjustLinePositionForPagination(RootInlineBox*, int& deltaOffset); // Computes a deltaOffset value that put a line at the top of the next page if it doesn't fit on the current page. 675 697 676 698 typedef PositionedObjectsListHashSet::const_iterator Iterator; -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r76414 r76726 791 791 if (adjustment) { 792 792 int oldLineWidth = availableLogicalWidthForLine(oldLogicalHeight, firstLine); 793 lineBox->adjust Position(0,adjustment);793 lineBox->adjustBlockDirectionPosition(adjustment); 794 794 if (useRepaintBounds) // This can only be a positive adjustment, so no need to update repaintTop. 795 795 repaintLogicalBottom = max(repaintLogicalBottom, afterSideVisualOverflowForLine(lineBox)); … … 849 849 repaintLogicalTop = min(repaintLogicalTop, beforeSideVisualOverflowForLine(line) + min(delta, 0)); 850 850 repaintLogicalBottom = max(repaintLogicalBottom, afterSideVisualOverflowForLine(line) + max(delta, 0)); 851 line->adjust Position(0,delta);851 line->adjustBlockDirectionPosition(delta); 852 852 } 853 853 if (Vector<RenderBox*>* cleanLineFloats = line->floatsPtr()) { … … 966 966 repaintLogicalTop = min(repaintLogicalTop, beforeSideVisualOverflowForLine(curr) + min(paginationDelta, 0)); 967 967 repaintLogicalBottom = max(repaintLogicalBottom, afterSideVisualOverflowForLine(curr) + max(paginationDelta, 0)); 968 curr->adjust Position(0,paginationDelta);968 curr->adjustBlockDirectionPosition(paginationDelta); 969 969 } 970 970 } -
trunk/Source/WebCore/rendering/RenderBox.cpp
r76633 r76726 1269 1269 if (!isInline() || isReplaced()) { 1270 1270 if (style()->position() != AbsolutePosition && style()->position() != FixedPosition) { 1271 o->adjustForColumns(offset, IntPoint(point.x() + x(), point.y() + y())); 1272 offset += locationOffsetIncludingFlipping(); 1271 if (o->hasColumns()) { 1272 IntRect columnRect(frameRect()); 1273 toRenderBlock(o)->flipForWritingModeIncludingColumns(columnRect); 1274 offset += IntSize(columnRect.location().x(), columnRect.location().y()); 1275 columnRect.move(point.x(), point.y()); 1276 o->adjustForColumns(offset, columnRect.location()); 1277 } else 1278 offset += locationOffsetIncludingFlipping(); 1273 1279 } else 1274 1280 offset += locationOffset(); … … 3329 3335 } 3330 3336 3337 IntPoint RenderBox::flipForWritingModeIncludingColumns(const IntPoint& point) const 3338 { 3339 if (!hasColumns() || !style()->isFlippedBlocksWritingMode()) 3340 return flipForWritingMode(point); 3341 return toRenderBlock(this)->flipForWritingModeIncludingColumns(point); 3342 } 3343 3331 3344 IntSize RenderBox::flipForWritingMode(const IntSize& offset) const 3332 3345 { -
trunk/Source/WebCore/rendering/RenderBox.h
r76141 r76726 173 173 int clientWidth() const; 174 174 int clientHeight() const; 175 int clientLogicalBottom() const { return style()->isHorizontalWritingMode() ? clientTop() + clientHeight() : clientLeft() + clientWidth(); }175 int clientLogicalBottom() const { return borderBefore() + (style()->isHorizontalWritingMode() ? clientHeight() : clientWidth()); } 176 176 IntRect clientBoxRect() const { return IntRect(clientLeft(), clientTop(), clientWidth(), clientHeight()); } 177 177 … … 379 379 int flipForWritingMode(int position) const; // The offset is in the block direction (y for horizontal writing modes, x for vertical writing modes). 380 380 IntPoint flipForWritingMode(const IntPoint&) const; 381 IntPoint flipForWritingModeIncludingColumns(const IntPoint&) const; 381 382 IntSize flipForWritingMode(const IntSize&) const; 382 383 void flipForWritingMode(IntRect&) const; -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r76170 r76726 281 281 282 282 if (view()->layoutState()->pageLogicalHeight()) 283 setPageLogicalOffset(view()->layoutState()->pageLogicalOffset( y()));283 setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(logicalTop())); 284 284 285 285 // Update our scrollbars if we're overflow:auto/scroll/hidden now that we know if -
trunk/Source/WebCore/rendering/RenderInline.cpp
r76442 r76726 750 750 { 751 751 ASSERT(container == this->container()); 752 752 753 753 IntSize offset; 754 754 if (isRelPositioned()) … … 783 783 if (!o) 784 784 return; 785 786 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()); 787 if (o->isBox() && o->style()->isFlippedBlocksWritingMode()) 788 transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(roundedIntPoint(transformState.mappedPoint())) - centerPoint); 785 789 786 790 IntSize containerOffset = offsetFromContainer(o, roundedIntPoint(transformState.mappedPoint())); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r76669 r76726 2570 2570 columnBlock->layer()->convertToLayerCoords(rootLayer, layerX, layerY); 2571 2571 2572 bool isHorizontal = columnBlock->style()->isHorizontalWritingMode(); 2573 2572 2574 ColumnInfo* colInfo = columnBlock->columnInfo(); 2573 2575 unsigned colCount = columnBlock->columnCount(colInfo); 2574 int curr YOffset = 0;2576 int currLogicalTopOffset = 0; 2575 2577 for (unsigned i = 0; i < colCount; i++) { 2576 2578 // For each rect, we clip to the rect, and then we adjust our coords. 2577 2579 IntRect colRect = columnBlock->columnRectAt(colInfo, i); 2578 int currXOffset = colRect.x() - (columnBlock->borderLeft() + columnBlock->paddingLeft()); 2580 columnBlock->flipForWritingMode(colRect); 2581 int logicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - columnBlock->logicalLeftOffsetForContent(); 2582 IntSize offset = isHorizontal ? IntSize(logicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, logicalLeftOffset); 2583 2579 2584 colRect.move(layerX, layerY); 2580 2585 … … 2596 2601 oldTransform = *childLayer->transform(); 2597 2602 TransformationMatrix newTransform(oldTransform); 2598 newTransform.translateRight( currXOffset, currYOffset);2603 newTransform.translateRight(offset.width(), offset.height()); 2599 2604 2600 2605 childLayer->m_transform.set(new TransformationMatrix(newTransform)); … … 2611 2616 columnLayers[colIndex - 1]->convertToLayerCoords(rootLayer, childX, childY); 2612 2617 TransformationMatrix transform; 2613 transform.translateRight(childX + currXOffset, childY + currYOffset);2618 transform.translateRight(childX + offset.width(), childY + offset.height()); 2614 2619 2615 2620 // Apply the transform. … … 2626 2631 2627 2632 // Move to the next position. 2628 currYOffset -= colRect.height(); 2633 int blockDelta = isHorizontal ? colRect.height() : colRect.width(); 2634 if (columnBlock->style()->isFlippedBlocksWritingMode()) 2635 currLogicalTopOffset += blockDelta; 2636 else 2637 currLogicalTopOffset -= blockDelta; 2629 2638 } 2630 2639 } … … 3039 3048 3040 3049 // We have to go backwards from the last column to the first. 3041 int left = columnBlock->borderLeft() + columnBlock->paddingLeft(); 3042 int currYOffset = 0; 3050 bool isHorizontal = columnBlock->style()->isHorizontalWritingMode(); 3051 int logicalLeft = columnBlock->logicalLeftOffsetForContent(); 3052 int currLogicalTopOffset = 0; 3043 3053 int i; 3044 for (i = 0; i < colCount; i++) 3045 currYOffset -= columnBlock->columnRectAt(colInfo, i).height(); 3054 for (i = 0; i < colCount; i++) { 3055 IntRect colRect = columnBlock->columnRectAt(colInfo, i); 3056 int blockDelta = (isHorizontal ? colRect.height() : colRect.width()); 3057 if (columnBlock->style()->isFlippedBlocksWritingMode()) 3058 currLogicalTopOffset += blockDelta; 3059 else 3060 currLogicalTopOffset -= blockDelta; 3061 } 3046 3062 for (i = colCount - 1; i >= 0; i--) { 3047 3063 // For each rect, we clip to the rect, and then we adjust our coords. 3048 3064 IntRect colRect = columnBlock->columnRectAt(colInfo, i); 3049 int currXOffset = colRect.x() - left; 3050 currYOffset += colRect.height(); 3065 columnBlock->flipForWritingMode(colRect); 3066 int currLogicalLeftOffset = (isHorizontal ? colRect.x() : colRect.y()) - logicalLeft; 3067 int blockDelta = (isHorizontal ? colRect.height() : colRect.width()); 3068 if (columnBlock->style()->isFlippedBlocksWritingMode()) 3069 currLogicalTopOffset -= blockDelta; 3070 else 3071 currLogicalTopOffset += blockDelta; 3051 3072 colRect.move(layerX, layerY); 3052 3073 … … 3054 3075 localClipRect.intersect(colRect); 3055 3076 3077 IntSize offset = isHorizontal ? IntSize(currLogicalLeftOffset, currLogicalTopOffset) : IntSize(currLogicalTopOffset, currLogicalLeftOffset); 3078 3056 3079 if (!localClipRect.isEmpty() && localClipRect.intersects(result.rectForPoint(hitTestPoint))) { 3057 3080 RenderLayer* hitLayer = 0; … … 3063 3086 oldTransform = *childLayer->transform(); 3064 3087 TransformationMatrix newTransform(oldTransform); 3065 newTransform.translateRight( currXOffset, currYOffset);3088 newTransform.translateRight(offset.width(), offset.height()); 3066 3089 3067 3090 childLayer->m_transform.set(new TransformationMatrix(newTransform)); … … 3076 3099 RenderLayer* nextLayer = columnLayers[columnIndex - 1]; 3077 3100 RefPtr<HitTestingTransformState> newTransformState = nextLayer->createLocalTransformState(rootLayer, nextLayer, localClipRect, hitTestPoint, transformState); 3078 newTransformState->translate( currXOffset, currYOffset, HitTestingTransformState::AccumulateTransform);3101 newTransformState->translate(offset.width(), offset.height(), HitTestingTransformState::AccumulateTransform); 3079 3102 IntPoint localPoint = roundedIntPoint(newTransformState->mappedPoint()); 3080 3103 IntRect localHitTestRect = newTransformState->mappedQuad().enclosingBoundingBox(); … … 3346 3369 // floats. 3347 3370 IntRect result; 3348 if (renderer()->isRenderInline()) { 3349 // Go from our first line box to our last line box. 3350 RenderInline* inlineFlow = toRenderInline(renderer()); 3351 InlineFlowBox* firstBox = inlineFlow->firstLineBox(); 3352 if (!firstBox) 3353 return result; 3354 int top = firstBox->topVisualOverflow(); 3355 int bottom = inlineFlow->lastLineBox()->bottomVisualOverflow(); 3356 int left = firstBox->x(); 3357 for (InlineFlowBox* curr = firstBox->nextLineBox(); curr; curr = curr->nextLineBox()) 3358 left = min(left, curr->x()); 3359 result = IntRect(left, top, width(), bottom - top); 3360 } else if (renderer()->isTableRow()) { 3371 if (renderer()->isRenderInline()) 3372 result = toRenderInline(renderer())->linesVisualOverflowBoundingBox(); 3373 else if (renderer()->isTableRow()) { 3361 3374 // Our bounding box is just the union of all of our cells' border/overflow rects. 3362 3375 for (RenderObject* child = renderer()->firstChild(); child; child = child->nextSibling()) { … … 3394 3407 { 3395 3408 IntRect result = localBoundingBox(); 3396 3409 if (renderer()->isBox()) 3410 renderBox()->flipForWritingMode(result); 3411 else 3412 renderer()->containingBlock()->flipForWritingMode(result); 3397 3413 int deltaX = 0, deltaY = 0; 3398 3414 convertToLayerCoords(ancestorLayer, deltaX, deltaY); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r76537 r76726 1948 1948 return; 1949 1949 1950 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()); 1951 if (o->isBox() && o->style()->isFlippedBlocksWritingMode()) 1952 transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(roundedIntPoint(transformState.mappedPoint())) - centerPoint); 1953 1950 1954 IntSize columnOffset; 1951 1955 o->adjustForColumns(columnOffset, roundedIntPoint(transformState.mappedPoint())); -
trunk/Source/WebCore/rendering/RenderTable.cpp
r75837 r76726 395 395 396 396 if (view()->layoutState()->pageLogicalHeight()) 397 setPageLogicalOffset(view()->layoutState()->pageLogicalOffset( y()));397 setPageLogicalOffset(view()->layoutState()->pageLogicalOffset(logicalTop())); 398 398 399 399 bool didFullRepaint = repainter.repaintAfterLayout(); -
trunk/Source/WebCore/rendering/RenderTableRow.cpp
r75837 r76726 126 126 if (child->isTableCell()) { 127 127 RenderTableCell* cell = toRenderTableCell(child); 128 if (!cell->needsLayout() && paginated && view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(cell-> y()) != cell->pageLogicalOffset())128 if (!cell->needsLayout() && paginated && view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(cell->logicalTop()) != cell->pageLogicalOffset()) 129 129 cell->setChildNeedsLayout(true, false); 130 130 -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r76276 r76726 618 618 cell->setNeedsLayout(true, false); 619 619 620 if (!cell->needsLayout() && view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(cell-> y()) != cell->pageLogicalOffset())620 if (!cell->needsLayout() && view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(cell->logicalTop()) != cell->pageLogicalOffset()) 621 621 cell->setChildNeedsLayout(true, false); 622 622 -
trunk/Source/WebCore/rendering/RenderText.cpp
r76202 r76726 346 346 // Shorten the width of this text box if it ends in an ellipsis. 347 347 IntRect ellipsisRect = (option == ClipToEllipsis) ? ellipsisRectForBox(box, 0, textLength()) : IntRect(); 348 if (!ellipsisRect.isEmpty()) 349 boundaries.setWidth(ellipsisRect.right() - boundaries.x()); 348 if (!ellipsisRect.isEmpty()) { 349 if (style()->isHorizontalWritingMode()) 350 boundaries.setWidth(ellipsisRect.right() - boundaries.x()); 351 else 352 boundaries.setHeight(ellipsisRect.bottom() - boundaries.y()); 353 } 350 354 quads.append(localToAbsoluteQuad(FloatRect(boundaries))); 351 355 } … … 375 379 if (useSelectionHeight) { 376 380 IntRect selectionRect = box->selectionRect(0, 0, start, end); 377 r.setHeight(selectionRect.height()); 378 r.setY(selectionRect.y()); 381 if (box->isHorizontal()) { 382 r.setHeight(selectionRect.height()); 383 r.setY(selectionRect.y()); 384 } else { 385 r.setWidth(selectionRect.width()); 386 r.setX(selectionRect.x()); 387 } 379 388 } 380 389 quads.append(localToAbsoluteQuad(FloatRect(r))); … … 385 394 if (!useSelectionHeight) { 386 395 // change the height and y position because selectionRect uses selection-specific values 387 r.setHeight(box->logicalHeight()); 388 r.setY(box->y()); 396 if (box->isHorizontal()) { 397 r.setHeight(box->logicalHeight()); 398 r.setY(box->y()); 399 } else { 400 r.setWidth(box->logicalHeight()); 401 r.setX(box->x()); 402 } 389 403 } 390 404 quads.append(localToAbsoluteQuad(FloatRect(r)));
Note: See TracChangeset
for help on using the changeset viewer.