Changeset 105176 in webkit
- Timestamp:
- Jan 17, 2012 11:16:24 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 13 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r105172 r105176 1 2012-01-12 David Hyatt <hyatt@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=76197 4 5 Add tests for baseline line grid alignment. 6 7 Reviewed by Simon Fraser. 8 9 * fast/line-grid/line-grid-floating.html: Added. 10 * fast/line-grid/line-grid-inside-columns.html: Added. 11 * fast/line-grid/line-grid-into-floats.html: Added. 12 * fast/line-grid/line-grid-positioned.html: Added. 13 * platform/mac/fast/line-grid: Added. 14 * platform/mac/fast/line-grid/line-grid-floating-expected.png: Added. 15 * platform/mac/fast/line-grid/line-grid-floating-expected.txt: Added. 16 * platform/mac/fast/line-grid/line-grid-inside-columns-expected.png: Added. 17 * platform/mac/fast/line-grid/line-grid-inside-columns-expected.txt: Added. 18 * platform/mac/fast/line-grid/line-grid-into-floats-expected.png: Added. 19 * platform/mac/fast/line-grid/line-grid-into-floats-expected.txt: Added. 20 * platform/mac/fast/line-grid/line-grid-positioned-expected.png: Added. 21 * platform/mac/fast/line-grid/line-grid-positioned-expected.txt: Added. 22 1 23 2012-01-17 Tim Horton <timothy_horton@apple.com> 2 24 -
trunk/Source/WebCore/ChangeLog
r105172 r105176 1 2012-01-12 David Hyatt <hyatt@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=76197 4 5 Implementation of baseline grid alignment. This patch implements line grid tracking in the layout state, 6 and also implements the snapping of lines to baselines. It works with normal flow, positioning and floats and 7 with pagination, as long as the grid is inside the pagination context and not outside. 8 9 Reviewed by Simon Fraser. 10 11 Added a bunch of new tests in fast/line-grid. 12 13 * WebCore.xcodeproj/project.pbxproj: 14 * rendering/InlineFlowBox.h: 15 (WebCore::InlineFlowBox::setHasTextChildren): 16 * rendering/LayoutState.cpp: 17 (WebCore::LayoutState::LayoutState): 18 (WebCore::LayoutState::propagateLineGridInfo): 19 (WebCore::LayoutState::establishLineGrid): 20 * rendering/LayoutState.h: 21 (WebCore::LayoutState::LayoutState): 22 (WebCore::LayoutState::pageLogicalHeight): 23 (WebCore::LayoutState::currentLineGrid): 24 (WebCore::LayoutState::currentLineGridOffset): 25 (WebCore::LayoutState::layoutOffset): 26 (WebCore::LayoutState::needsBlockDirectionLocationSetBeforeLayout): 27 * rendering/RenderBlock.cpp: 28 (WebCore::RenderBlock::layoutBlockChildren): 29 (WebCore::RenderBlock::layoutPositionedObjects): 30 (WebCore::RenderBlock::insertFloatingObject): 31 (WebCore::RenderBlock::positionNewFloats): 32 (WebCore::RenderBlock::pageLogicalTopForOffset): 33 (WebCore::RenderBlock::adjustLinePositionForPagination): 34 * rendering/RenderBlock.h: 35 (WebCore::RenderBlock::lineGridBox): 36 (WebCore::RenderBlock::setLineGridBox): 37 (WebCore::RenderBlock::RenderBlockRareData::RenderBlockRareData): 38 * rendering/RenderBlockLineLayout.cpp: 39 (WebCore::RenderBlock::layoutInlineChildren): 40 (WebCore::RenderBlock::layoutLineGridBox): 41 * rendering/RenderFlowThread.cpp: 42 (WebCore::RenderFlowThread::regionLogicalTopForLine): 43 * rendering/RenderFlowThread.h: 44 * rendering/RenderView.h: 45 (WebCore::RenderView::pushLayoutState): 46 * rendering/RootInlineBox.cpp: 47 (WebCore::RootInlineBox::alignBoxesInBlockDirection): 48 (WebCore::RootInlineBox::lineGridSnapAdjustment): 49 * rendering/RootInlineBox.h: 50 1 51 2012-01-17 Tim Horton <timothy_horton@apple.com> 2 52 -
trunk/Source/WebCore/rendering/InlineFlowBox.h
r103772 r105176 193 193 bool hasTextChildren() const { return m_hasTextChildren; } 194 194 bool hasTextDescendants() const { return m_hasTextDescendants; } 195 void setHasTextChildren() { m_hasTextChildren = true; setHasTextDescendants(); } 195 196 void setHasTextDescendants() { m_hasTextDescendants = true; } 196 197 197 198 void checkConsistency() const; 198 199 void setHasBadChildList(); -
trunk/Source/WebCore/rendering/LayoutState.cpp
r103243 r105176 38 38 LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged, ColumnInfo* columnInfo) 39 39 : m_columnInfo(columnInfo) 40 , m_currentLineGrid(0) 40 41 , m_next(prev) 41 42 #ifndef NDEBUG … … 108 109 109 110 m_isPaginated = m_pageLogicalHeight || m_columnInfo; 110 111 112 // Propagate line grid information. 113 propagateLineGridInfo(renderer); 114 115 // If we have a new grid to track, then add it to our set. 116 if (renderer->style()->lineGrid() != RenderStyle::initialLineGrid() && renderer->isBlockFlow()) 117 establishLineGrid(toRenderBlock(renderer)); 118 111 119 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present. 112 120 } … … 118 126 , m_pageLogicalHeightChanged(regionsChanged) 119 127 , m_columnInfo(0) 128 , m_currentLineGrid(0) 120 129 , m_next(prev) 121 130 #ifndef NDEBUG … … 134 143 , m_pageLogicalHeightChanged(false) 135 144 , m_columnInfo(0) 145 , m_currentLineGrid(0) 136 146 , m_next(0) 137 147 #ifndef NDEBUG … … 197 207 } 198 208 209 void LayoutState::propagateLineGridInfo(RenderBox* renderer) 210 { 211 // Disable line grids for objects we don't support. For now this includes overflow:scroll/auto, inline blocks and 212 // writing mode roots. 213 if (!m_next || renderer->isUnsplittableForPagination()) 214 return; 215 216 m_currentLineGrid = m_next->m_currentLineGrid; 217 m_currentLineGridOffset = m_next->m_currentLineGridOffset; 218 } 219 220 void LayoutState::establishLineGrid(RenderBlock* block) 221 { 222 // First check to see if this grid has been established already. 223 if (m_currentLineGrid) { 224 if (m_currentLineGrid->style()->lineGrid() == block->style()->lineGrid()) 225 return; 226 RenderBlock* currentGrid = m_currentLineGrid; 227 for (LayoutState* currentState = m_next; currentState; currentState = currentState->m_next) { 228 if (currentState->m_currentLineGrid == currentGrid) 229 continue; 230 currentGrid = currentState->m_currentLineGrid; 231 if (currentGrid->style()->lineGrid() == block->style()->lineGrid()) { 232 m_currentLineGrid = currentGrid; 233 m_currentLineGridOffset = currentState->m_currentLineGridOffset; 234 return; 235 } 236 } 237 } 238 239 // We didn't find an already-established grid with this identifier. Our render object establishes the grid. 240 m_currentLineGrid = block; 241 m_currentLineGridOffset = m_layoutOffset; 242 } 243 199 244 } // namespace WebCore -
trunk/Source/WebCore/rendering/LayoutState.h
r103243 r105176 28 28 29 29 #include "LayoutTypes.h" 30 #include <wtf/HashMap.h> 30 31 #include <wtf/Noncopyable.h> 31 32 … … 34 35 class ColumnInfo; 35 36 class RenderArena; 37 class RenderBlock; 36 38 class RenderBox; 37 39 class RenderObject; … … 47 49 , m_pageLogicalHeightChanged(false) 48 50 , m_columnInfo(0) 51 , m_currentLineGrid(0) 49 52 , m_next(0) 50 53 #ifndef NDEBUG … … 76 79 void addForcedColumnBreak(LayoutUnit childLogicalOffset); 77 80 78 boolpageLogicalHeight() const { return m_pageLogicalHeight; }81 LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; } 79 82 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } 83 84 RenderBlock* currentLineGrid() const { return m_currentLineGrid; } 85 LayoutSize currentLineGridOffset() const { return m_currentLineGridOffset; } 86 87 LayoutSize layoutOffset() const { return m_layoutOffset; } 88 89 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_currentLineGrid || (m_isPaginated && m_pageLogicalHeight); } 80 90 81 91 private: 82 92 // The normal operator new is disallowed. 83 93 void* operator new(size_t) throw(); 94 95 void propagateLineGridInfo(RenderBox*); 96 void establishLineGrid(RenderBlock*); 84 97 85 98 public: … … 106 119 ColumnInfo* m_columnInfo; 107 120 121 // The current line grid that we're snapping to and the offset of the start of the grid. 122 RenderBlock* m_currentLineGrid; 123 LayoutSize m_currentLineGridOffset; 124 108 125 LayoutState* m_next; 109 126 #ifndef NDEBUG -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r105120 r105176 198 198 199 199 m_lineBoxes.deleteLineBoxes(renderArena()); 200 201 if (lineGridBox()) 202 lineGridBox()->destroy(renderArena()); 200 203 201 204 if (UNLIKELY(gDelayedUpdateScrollInfoSet != 0)) … … 1988 1991 1989 1992 setLogicalHeight(beforeEdge); 1993 1994 // Lay out our hypothetical grid line as though it occurs at the top of the block. 1995 if (view()->layoutState()->currentLineGrid() == this) 1996 layoutLineGridBox(); 1990 1997 1991 1998 // The margin struct caches all our current margin collapsing state. The compact struct caches state when we encounter compacts, … … 2302 2309 r->setNeedsLayout(false); 2303 2310 2304 // If we are in a flow thread, go ahead and compute a vertical position for our object now.2311 // If we are paginated or in a line grid, go ahead and compute a vertical position for our object now. 2305 2312 // If it's wrong we'll lay out again. 2306 2313 LayoutUnit oldLogicalTop = 0; 2307 bool checkForPaginationRelayout = r->needsLayout() && view()->layoutState()->isPaginated() && view()->layoutState()->pageLogicalHeight();2308 if ( checkForPaginationRelayout) {2314 bool needsBlockDirectionLocationSetBeforeLayout = r->needsLayout() && view()->layoutState()->needsBlockDirectionLocationSetBeforeLayout(); 2315 if (needsBlockDirectionLocationSetBeforeLayout) { 2309 2316 if (isHorizontalWritingMode() == r->isHorizontalWritingMode()) 2310 2317 r->computeLogicalHeight(); … … 2317 2324 2318 2325 // Lay out again if our estimate was wrong. 2319 if ( checkForPaginationRelayout && logicalTopForChild(r) != oldLogicalTop) {2326 if (needsBlockDirectionLocationSetBeforeLayout && logicalTopForChild(r) != oldLogicalTop) { 2320 2327 r->setChildNeedsLayout(true, false); 2321 2328 r->layoutIfNeeded(); … … 3308 3315 o->setChildNeedsLayout(true, false); 3309 3316 3310 bool affectedByPagination = isChildRenderBlock && view()->layoutState()->m_pageLogicalHeight;3311 if (! affectedByPagination|| isWritingModeRoot()) // We are unsplittable if we're a block flow root.3317 bool needsBlockDirectionLocationSetBeforeLayout = isChildRenderBlock && view()->layoutState()->needsBlockDirectionLocationSetBeforeLayout(); 3318 if (!needsBlockDirectionLocationSetBeforeLayout || isWritingModeRoot()) // We are unsplittable if we're a block flow root. 3312 3319 o->layoutIfNeeded(); 3313 3320 else { … … 3489 3496 setLogicalTopForChild(childBox, floatLogicalLocation.y() + marginBeforeForChild(childBox)); 3490 3497 3491 if (view()->layoutState()->isPaginated()) { 3492 RenderBlock* childBlock = childBox->isRenderBlock() ? toRenderBlock(childBox) : 0; 3493 3494 if (!childBox->needsLayout()) 3495 childBox->markForPaginationRelayoutIfNeeded(); 3496 childBox->layoutIfNeeded(); 3497 3498 LayoutState* layoutState = view()->layoutState(); 3499 bool isPaginated = layoutState->isPaginated(); 3500 if (isPaginated && !childBox->needsLayout()) 3501 childBox->markForPaginationRelayoutIfNeeded(); 3502 3503 childBox->layoutIfNeeded(); 3504 3505 if (isPaginated) { 3498 3506 // If we are unsplittable and don't fit, then we need to move down. 3499 3507 // We include our margins as part of the unsplittable area. … … 3503 3511 // Note that an unsplittable child can't also have a pagination strut, so this is 3504 3512 // exclusive with the case above. 3513 RenderBlock* childBlock = childBox->isRenderBlock() ? toRenderBlock(childBox) : 0; 3505 3514 if (childBlock && childBlock->paginationStrut()) { 3506 3515 newLogicalTop += childBlock->paginationStrut(); … … 6391 6400 } 6392 6401 return logicalOffset; 6402 } 6403 6404 LayoutUnit RenderBlock::pageLogicalTopForOffset(LayoutUnit offset) const 6405 { 6406 RenderView* renderView = view(); 6407 LayoutUnit firstPageLogicalTop = isHorizontalWritingMode() ? renderView->layoutState()->m_pageOffset.height() : renderView->layoutState()->m_pageOffset.width(); 6408 LayoutUnit blockLogicalTop = isHorizontalWritingMode() ? renderView->layoutState()->m_layoutOffset.height() : renderView->layoutState()->m_layoutOffset.width(); 6409 6410 LayoutUnit cumulativeOffset = offset + blockLogicalTop; 6411 if (!inRenderFlowThread()) { 6412 LayoutUnit pageLogicalHeight = renderView->layoutState()->pageLogicalHeight(); 6413 if (!pageLogicalHeight) 6414 return 0; 6415 return cumulativeOffset - (cumulativeOffset - firstPageLogicalTop) % pageLogicalHeight; 6416 } 6417 return enclosingRenderFlowThread()->regionLogicalTopForLine(cumulativeOffset); 6393 6418 } 6394 6419 … … 6507 6532 lineBox->setPaginationStrut(remainingLogicalHeight); 6508 6533 } 6509 } 6534 } 6510 6535 } 6511 6536 -
trunk/Source/WebCore/rendering/RenderBlock.h
r105120 r105176 240 240 void setPageLogicalOffset(int); 241 241 242 RootInlineBox* lineGridBox() const { return m_rareData ? m_rareData->m_lineGridBox : 0; } 243 void setLineGridBox(RootInlineBox* box) 244 { 245 if (!m_rareData) 246 m_rareData = adoptPtr(new RenderBlockRareData(this)); 247 if (m_rareData->m_lineGridBox) 248 m_rareData->m_lineGridBox->destroy(renderArena()); 249 m_rareData->m_lineGridBox = box; 250 } 251 void layoutLineGridBox(); 252 242 253 // Accessors for logical width/height and margins in the containing block's block-flow direction. 243 254 enum ApplyLayoutDeltaMode { ApplyLayoutDelta, DoNotApplyLayoutDelta }; … … 472 483 473 484 virtual void updateBeforeAfterContent(PseudoId); 474 485 475 486 virtual RootInlineBox* createRootInlineBox(); // Subclassed by SVG and Ruby. 476 487 … … 896 907 LayoutUnit applyAfterBreak(RenderBox* child, LayoutUnit logicalOffset, MarginInfo&); // If the child has an after break, then return a new offset that shifts to the top of the next page/column. 897 908 909 public: 910 LayoutUnit pageLogicalTopForOffset(LayoutUnit offset) const; 898 911 LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const; 899 912 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBoundaryRule = IncludePageBoundary) const; 913 914 protected: 900 915 bool pushToNextPageWithMinimumLogicalHeight(LayoutUnit& adjustment, LayoutUnit logicalOffset, LayoutUnit minimumLogicalHeight) const; 901 916 … … 1018 1033 , m_paginationStrut(0) 1019 1034 , m_pageLogicalOffset(0) 1035 , m_lineGridBox(0) 1020 1036 { 1021 1037 } … … 1040 1056 1041 1057 MarginValues m_margins; 1042 int m_paginationStrut; 1043 int m_pageLogicalOffset; 1058 LayoutUnit m_paginationStrut; 1059 LayoutUnit m_pageLogicalOffset; 1060 1061 RootInlineBox* m_lineGridBox; 1044 1062 }; 1045 1063 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r104322 r105176 1439 1439 1440 1440 setLogicalHeight(borderBefore() + paddingBefore()); 1441 1442 // Lay out our hypothetical grid line as though it occurs at the top of the block. 1443 if (view()->layoutState() && view()->layoutState()->currentLineGrid() == this) 1444 layoutLineGridBox(); 1441 1445 1442 1446 // Figure out if we should clear out our line boxes. … … 2758 2762 } 2759 2763 2760 } 2764 2765 void RenderBlock::layoutLineGridBox() 2766 { 2767 if (style()->lineGrid() == RenderStyle::initialLineGrid()) { 2768 setLineGridBox(0); 2769 return; 2770 } 2771 2772 setLineGridBox(0); 2773 2774 RootInlineBox* lineGridBox = new (renderArena()) RootInlineBox(this); 2775 lineGridBox->setHasTextChildren(); // Needed to make the line ascent/descent actually be honored in quirks mode. 2776 lineGridBox->setConstructed(); 2777 GlyphOverflowAndFallbackFontsMap textBoxDataMap; 2778 VerticalPositionCache verticalPositionCache; 2779 lineGridBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, verticalPositionCache); 2780 2781 setLineGridBox(lineGridBox); 2782 2783 // FIXME: If any of the characteristics of the box change compared to the old one, then we need to do a deep dirtying 2784 // (similar to what happens when the page height changes). Ideally, though, we only do this if someone is actually snapping 2785 // to this grid. 2786 } 2787 2788 } -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r104965 r105176 555 555 } 556 556 557 LayoutUnit RenderFlowThread::regionLogicalTopForLine(LayoutUnit position) const 558 { 559 RenderRegion* region = renderRegionForLine(position); 560 if (!region) 561 return 0; 562 return isHorizontalWritingMode() ? region->regionRect().y() : region->regionRect().x(); 563 } 564 557 565 LayoutUnit RenderFlowThread::regionLogicalWidthForLine(LayoutUnit position) const 558 566 { -
trunk/Source/WebCore/rendering/RenderFlowThread.h
r104965 r105176 101 101 void repaintRectangleInRegions(const LayoutRect&, bool immediate); 102 102 103 LayoutUnit regionLogicalTopForLine(LayoutUnit position) const; 103 104 LayoutUnit regionLogicalWidthForLine(LayoutUnit position) const; 104 105 LayoutUnit regionLogicalHeightForLine(LayoutUnit position) const; -
trunk/Source/WebCore/rendering/RenderView.h
r104965 r105176 211 211 { 212 212 // We push LayoutState even if layoutState is disabled because it stores layoutDelta too. 213 if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer->hasColumns() || renderer->inRenderFlowThread()) { 213 if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer->hasColumns() || renderer->inRenderFlowThread() 214 || m_layoutState->currentLineGrid() || (renderer->style()->lineGrid() != RenderStyle::initialLineGrid() && renderer->isBlockFlow())) { 214 215 m_layoutState = new (renderArena()) LayoutState(m_layoutState, renderer, offset, pageHeight, pageHeightChanged, colInfo); 215 216 return true; -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r97052 r105176 34 34 #include "RenderArena.h" 35 35 #include "RenderBlock.h" 36 #include "RenderView.h" 36 37 #include "VerticalPositionCache.h" 37 38 #include <wtf/unicode/Unicode.h> … … 286 287 } 287 288 289 LayoutUnit gridSnapAdjustment = lineGridSnapAdjustment(); 290 if (gridSnapAdjustment) { 291 adjustBlockDirectionPosition(gridSnapAdjustment); 292 heightOfBlock += gridSnapAdjustment; 293 } 294 288 295 return heightOfBlock + maxHeight; 289 296 } … … 318 325 319 326 return result; 327 } 328 329 LayoutUnit RootInlineBox::lineGridSnapAdjustment(LayoutUnit delta) const 330 { 331 // If our block doesn't have snapping turned on, do nothing. 332 // FIXME: Implement bounds snapping. 333 if (block()->style()->lineGridSnap() != LineGridSnapBaseline) 334 return 0; 335 336 // Get the current line grid and offset. 337 LayoutState* layoutState = block()->view()->layoutState(); 338 RenderBlock* lineGrid = layoutState->currentLineGrid(); 339 LayoutSize lineGridOffset = layoutState->currentLineGridOffset(); 340 if (!lineGrid || lineGrid->style()->writingMode() != block()->style()->writingMode()) 341 return 0; 342 343 // Get the hypothetical line box used to establish the grid. 344 RootInlineBox* lineGridBox = lineGrid->lineGridBox(); 345 if (!lineGridBox) 346 return 0; 347 348 LayoutUnit lineGridBlockOffset = lineGrid->isHorizontalWritingMode() ? lineGridOffset.height() : lineGridOffset.width(); 349 LayoutUnit blockOffset = block()->isHorizontalWritingMode() ? layoutState->layoutOffset().height() : layoutState->layoutOffset().width(); 350 351 // Now determine our position on the grid. Our baseline needs to be adjusted to the nearest baseline multiple 352 // as established by the line box. 353 // FIXME: Need to handle crazy line-box-contain values that cause the root line box to not be considered. I assume 354 // the grid should honor line-box-contain. 355 LayoutUnit baselineMultiple = lineGridBox->lineBottomWithLeading() - lineGridBox->lineTopWithLeading(); 356 if (!baselineMultiple) 357 return 0; 358 359 LayoutUnit lineGridAscent = lineGrid->style()->fontMetrics().ascent(baselineType()); 360 LayoutUnit firstBaselinePosition = lineGridBlockOffset + lineGridAscent + lineGridBox->logicalTop(); 361 LayoutUnit currentBaselinePosition = blockOffset + logicalTop() + delta + block()->style()->fontMetrics().ascent(baselineType()); 362 363 // If we're paginated, see if we're on a page after the first one. If so, the grid resets on subsequent pages. 364 // FIXME: If the grid is an ancestor of the pagination establisher, then this is incorrect. 365 LayoutUnit pageLogicalTop = 0; 366 if (layoutState->isPaginated() && layoutState->pageLogicalHeight()) { 367 pageLogicalTop = block()->pageLogicalTopForOffset(logicalTop() + delta); 368 if (pageLogicalTop > lineGridBlockOffset + lineGridBox->logicalTop()) 369 firstBaselinePosition = lineGridAscent + pageLogicalTop + lineGridBox->logicalTop() - lineGrid->borderBefore() - lineGrid->paddingBefore(); 370 } 371 372 // If we're above the first line, just push to the first line. 373 if (currentBaselinePosition < firstBaselinePosition) 374 return delta + firstBaselinePosition - currentBaselinePosition; 375 376 // Otherwise we're in the middle of the grid somewhere. Just push to the next line. 377 LayoutUnit baselineOffset = currentBaselinePosition - firstBaselinePosition; 378 LayoutUnit remainder = baselineOffset % baselineMultiple; 379 LayoutUnit result = delta; 380 if (remainder) 381 result += baselineMultiple - remainder; 382 383 // If we aren't paginated we can return the result. 384 if (!layoutState->isPaginated() || !layoutState->pageLogicalHeight() || result == delta) 385 return result; 386 387 // We may have shifted to a new page. We need to do a re-snap when that happens. 388 LayoutUnit newPageLogicalTop = block()->pageLogicalTopForOffset(logicalTop() + result); 389 if (newPageLogicalTop == pageLogicalTop) 390 return result; 391 392 // Put ourselves at the top of the next page to force a snap onto the new grid established by that page. 393 return lineGridSnapAdjustment(newPageLogicalTop - (blockOffset + logicalTop())); 320 394 } 321 395 -
trunk/Source/WebCore/rendering/RootInlineBox.h
r97052 r105176 177 177 Node* getLogicalStartBoxWithNode(InlineBox*&) const; 178 178 Node* getLogicalEndBoxWithNode(InlineBox*&) const; 179 179 180 #ifndef NDEBUG 180 181 virtual const char* boxName() const; … … 182 183 private: 183 184 void setHasEllipsisBox(bool hasEllipsisBox) { m_hasEllipsisBoxOrHyphen = hasEllipsisBox; } 185 186 LayoutUnit lineGridSnapAdjustment(LayoutUnit delta = 0) const; 184 187 185 188 int beforeAnnotationsAdjustment() const;
Note: See TracChangeset
for help on using the changeset viewer.