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

Unified Diff: sky/engine/core/rendering/RenderParagraph.h

Issue 1068683002: Delete RenderBlockFlow. (Closed) Base URL: https://github.com/domokit/mojo.git@block
Patch Set: Remove unused float-related code instead of moving it. Created 5 years, 8 months 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/RenderObject.cpp ('k') | sky/engine/core/rendering/RenderParagraph.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderParagraph.h
diff --git a/sky/engine/core/rendering/RenderParagraph.h b/sky/engine/core/rendering/RenderParagraph.h
index 739e964791291ee451be9f928412cb42f27800cd..1913492c71e944b4c7c29a71f80545e2ab91d15e 100644
--- a/sky/engine/core/rendering/RenderParagraph.h
+++ b/sky/engine/core/rendering/RenderParagraph.h
@@ -6,30 +6,64 @@
#define SKY_ENGINE_CORE_RENDERING_RENDERPARAGRAPH_H_
#include "sky/engine/core/dom/ContainerNode.h"
-#include "sky/engine/core/rendering/RenderBlockFlow.h"
+#include "sky/engine/core/rendering/RenderBlock.h"
+#include "sky/engine/core/rendering/line/TrailingObjects.h"
namespace blink {
+struct BidiRun;
class ContainerNode;
+// class InlineBidiResolver;
+class InlineIterator;
-class RenderParagraph final : public RenderBlockFlow {
+class RenderParagraph final : public RenderBlock {
public:
explicit RenderParagraph(ContainerNode*);
virtual ~RenderParagraph();
static RenderParagraph* createAnonymous(Document&);
- bool isRenderParagraph() const override { return true; }
+ bool isRenderParagraph() const final { return true; }
+
+ void layout() final;
+
+ LayoutUnit logicalRightOffsetForLine(bool shouldIndentText) const
+ {
+ LayoutUnit right = logicalRightOffsetForContent();
+ if (shouldIndentText && !style()->isLeftToRightDirection())
+ right -= textIndentOffset();
+ return right;
+ }
+ LayoutUnit logicalLeftOffsetForLine(bool shouldIndentText) const
+ {
+ LayoutUnit left = logicalLeftOffsetForContent();
+ if (shouldIndentText && style()->isLeftToRightDirection())
+ left += textIndentOffset();
+ return left;
+ }
+
+ LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, LayoutUnit position) final;
+ LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, LayoutUnit position) final;
virtual RootInlineBox* lineAtIndex(int) const;
virtual int lineCount(const RootInlineBox* = 0, bool* = 0) const;
+ void deleteLineBoxTree() final;
+
GapRects inlineSelectionGaps(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& lastLogicalRight, const PaintInfo*);
-protected:
- void layoutChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutUnit beforeEdge, LayoutUnit afterEdge) final;
+ static bool shouldSkipCreatingRunsForObject(RenderObject* obj)
+ {
+ return obj->isOutOfFlowPositioned() && !obj->style()->isOriginalDisplayInlineType() && !obj->container()->isRenderInline();
+ }
+ // TODO(ojan): Remove the need for these.
+ using RenderBlock::lineBoxes;
+ using RenderBlock::firstLineBox;
+ using RenderBlock::lastRootBox;
+
+protected:
void addOverflowFromChildren() final;
void simplifiedNormalFlowLayout() final;
@@ -48,9 +82,16 @@ protected:
private:
virtual const char* renderName() const override;
+ void layoutChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutUnit beforeEdge, LayoutUnit afterEdge);
+
void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBottom, RootInlineBox* highest = 0);
+ void updateLogicalWidthForAlignment(const ETextAlign&, const RootInlineBox*, BidiRun* trailingSpaceRun, float& logicalLeft, float& totalLogicalWidth, float& availableLogicalWidth, unsigned expansionOpportunityCount);
+
+ RootInlineBox* createAndAppendRootInlineBox();
+ RootInlineBox* createRootInlineBox();
InlineFlowBox* createLineBoxes(RenderObject*, const LineInfo&, InlineBox* childBox);
+ InlineBox* createInlineBoxForRenderer(RenderObject*, bool isRootLineBox, bool isOnlyRun = false);
RootInlineBox* constructLine(BidiRunList<BidiRun>&, const LineInfo&);
void computeInlineDirectionPositionsForLine(RootInlineBox*, const LineInfo&, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap&, VerticalPositionCache&, WordMeasurements&);
BidiRun* computeInlineDirectionPositionsForSegment(RootInlineBox*, const LineInfo&, ETextAlign, float& logicalLeft,
@@ -62,7 +103,6 @@ private:
void layoutRunsAndFloatsInRange(LineLayoutState&, InlineBidiResolver&,
const InlineIterator& cleanLineStart, const BidiStatus& cleanLineBidiStatus);
void linkToEndLineIfNeeded(LineLayoutState&);
- void checkFloatsInCleanLine(RootInlineBox*, Vector<FloatWithRect>&, size_t& floatIndex, bool& encounteredNewFloat, bool& dirtiedByFloat);
RootInlineBox* determineStartPosition(LineLayoutState&, InlineBidiResolver&);
void determineEndPosition(LineLayoutState&, RootInlineBox* startBox, InlineIterator& cleanLineStart, BidiStatus& cleanLineBidiStatus);
bool checkPaginationAndFloatsAtEndLine(LineLayoutState&);
« no previous file with comments | « sky/engine/core/rendering/RenderObject.cpp ('k') | sky/engine/core/rendering/RenderParagraph.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698