Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: sky/engine/core/rendering/RenderBlockFlow.cpp

Issue 762073002: Split more Paragraph-specific code from RenderBlock into RenderParagraph (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cr comments Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/rendering/RenderBlockFlow.h ('k') | sky/engine/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderBlockFlow.cpp
diff --git a/sky/engine/core/rendering/RenderBlockFlow.cpp b/sky/engine/core/rendering/RenderBlockFlow.cpp
index e7e10622b3fa071fa79537488c86e4caa74f3a8f..9cd1a01b7cb5e60dff1fb0770ffc0540e19b49ca 100644
--- a/sky/engine/core/rendering/RenderBlockFlow.cpp
+++ b/sky/engine/core/rendering/RenderBlockFlow.cpp
@@ -260,61 +260,6 @@ void RenderBlockFlow::invalidatePaintForOverflow()
m_paintInvalidationLogicalBottom = 0;
}
-GapRects RenderBlockFlow::inlineSelectionGaps(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
- LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& lastLogicalRight, const PaintInfo* paintInfo)
-{
- GapRects result;
-
- bool containsStart = selectionState() == SelectionStart || selectionState() == SelectionBoth;
-
- if (!firstLineBox()) {
- if (containsStart) {
- // Go ahead and update our lastLogicalTop to be the bottom of the block. <hr>s or empty blocks with height can trip this
- // case.
- lastLogicalTop = rootBlock->blockDirectionOffset(offsetFromRootBlock) + logicalHeight();
- lastLogicalLeft = logicalLeftSelectionOffset(rootBlock, logicalHeight());
- lastLogicalRight = logicalRightSelectionOffset(rootBlock, logicalHeight());
- }
- return result;
- }
-
- RootInlineBox* lastSelectedLine = 0;
- RootInlineBox* curr;
- for (curr = firstRootBox(); curr && !curr->hasSelectedChildren(); curr = curr->nextRootBox()) { }
-
- // Now paint the gaps for the lines.
- for (; curr && curr->hasSelectedChildren(); curr = curr->nextRootBox()) {
- LayoutUnit selTop = curr->selectionTopAdjustedForPrecedingBlock();
- LayoutUnit selHeight = curr->selectionHeightAdjustedForPrecedingBlock();
-
- if (!containsStart && !lastSelectedLine && selectionState() != SelectionStart && selectionState() != SelectionBoth) {
- result.uniteCenter(blockSelectionGap(rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, lastLogicalTop,
- lastLogicalLeft, lastLogicalRight, selTop, paintInfo));
- }
-
- LayoutRect logicalRect(curr->logicalLeft(), selTop, curr->logicalWidth(), selTop + selHeight);
- logicalRect.move(offsetFromRootBlock);
- LayoutRect physicalRect = rootBlock->logicalRectToPhysicalRect(rootBlockPhysicalPosition, logicalRect);
- if (!paintInfo || (physicalRect.y() < paintInfo->rect.maxY() && physicalRect.maxY() > paintInfo->rect.y()))
- result.unite(curr->lineSelectionGap(rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, selTop, selHeight, paintInfo));
-
- lastSelectedLine = curr;
- }
-
- if (containsStart && !lastSelectedLine) {
- // VisibleSelection must start just after our last line.
- lastSelectedLine = lastRootBox();
- }
-
- if (lastSelectedLine && selectionState() != SelectionEnd && selectionState() != SelectionBoth) {
- // Go ahead and update our lastY to be the bottom of the last selected line.
- lastLogicalTop = rootBlock->blockDirectionOffset(offsetFromRootBlock) + lastSelectedLine->selectionBottom();
- lastLogicalLeft = logicalLeftSelectionOffset(rootBlock, lastSelectedLine->selectionBottom());
- lastLogicalRight = logicalRightSelectionOffset(rootBlock, lastSelectedLine->selectionBottom());
- }
- return result;
-}
-
LayoutUnit RenderBlockFlow::logicalLeftSelectionOffset(RenderBlock* rootBlock, LayoutUnit position)
{
LayoutUnit logicalLeft = logicalLeftOffsetForLine(false);
« no previous file with comments | « sky/engine/core/rendering/RenderBlockFlow.h ('k') | sky/engine/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698