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

Side by Side Diff: sky/engine/core/rendering/RenderInline.h

Issue 734813004: Get rid of continuations. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 void deleteLineBoxTree(); 70 void deleteLineBoxTree();
71 71
72 RenderLineBoxList* lineBoxes() { return &m_lineBoxes; } 72 RenderLineBoxList* lineBoxes() { return &m_lineBoxes; }
73 const RenderLineBoxList* lineBoxes() const { return &m_lineBoxes; } 73 const RenderLineBoxList* lineBoxes() const { return &m_lineBoxes; }
74 74
75 InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); } 75 InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); }
76 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } 76 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); }
77 InlineBox* firstLineBoxIncludingCulling() const { return alwaysCreateLineBox es() ? firstLineBox() : culledInlineFirstLineBox(); } 77 InlineBox* firstLineBoxIncludingCulling() const { return alwaysCreateLineBox es() ? firstLineBox() : culledInlineFirstLineBox(); }
78 InlineBox* lastLineBoxIncludingCulling() const { return alwaysCreateLineBoxe s() ? lastLineBox() : culledInlineLastLineBox(); } 78 InlineBox* lastLineBoxIncludingCulling() const { return alwaysCreateLineBoxe s() ? lastLineBox() : culledInlineLastLineBox(); }
79 79
80 virtual RenderBoxModelObject* virtualContinuation() const override final { r eturn continuation(); }
81 RenderInline* inlineElementContinuation() const;
82
83 LayoutSize offsetForInFlowPositionedInline(const RenderBox& child) const; 80 LayoutSize offsetForInFlowPositionedInline(const RenderBox& child) const;
84 81
85 virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& addition alOffset, const RenderLayerModelObject* paintContainer = 0) const override final ; 82 virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& addition alOffset, const RenderLayerModelObject* paintContainer = 0) const override final ;
86 void paintOutline(PaintInfo&, const LayoutPoint&); 83 void paintOutline(PaintInfo&, const LayoutPoint&);
87 84
88 using RenderBoxModelObject::continuation;
89 virtual void setContinuation(RenderBoxModelObject*) override final;
90
91 bool alwaysCreateLineBoxes() const { return alwaysCreateLineBoxesForRenderIn line(); } 85 bool alwaysCreateLineBoxes() const { return alwaysCreateLineBoxesForRenderIn line(); }
92 void setAlwaysCreateLineBoxes(bool alwaysCreateLineBoxes = true) { setAlways CreateLineBoxesForRenderInline(alwaysCreateLineBoxes); } 86 void setAlwaysCreateLineBoxes(bool alwaysCreateLineBoxes = true) { setAlways CreateLineBoxesForRenderInline(alwaysCreateLineBoxes); }
93 void updateAlwaysCreateLineBoxes(bool fullLayout); 87 void updateAlwaysCreateLineBoxes(bool fullLayout);
94 88
95 virtual LayoutRect localCaretRect(InlineBox*, int, LayoutUnit* extraWidthToE ndOfLine) override final; 89 virtual LayoutRect localCaretRect(InlineBox*, int, LayoutUnit* extraWidthToE ndOfLine) override final;
96 90
97 bool hitTestCulledInline(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset); 91 bool hitTestCulledInline(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset);
98 92
99 protected: 93 protected:
100 virtual void willBeDestroyed() override; 94 virtual void willBeDestroyed() override;
(...skipping 12 matching lines...) Expand all
113 107
114 LayoutRect culledInlineVisualOverflowBoundingBox() const; 108 LayoutRect culledInlineVisualOverflowBoundingBox() const;
115 InlineBox* culledInlineFirstLineBox() const; 109 InlineBox* culledInlineFirstLineBox() const;
116 InlineBox* culledInlineLastLineBox() const; 110 InlineBox* culledInlineLastLineBox() const;
117 111
118 template<typename GeneratorContext> 112 template<typename GeneratorContext>
119 void generateLineBoxRects(GeneratorContext& yield) const; 113 void generateLineBoxRects(GeneratorContext& yield) const;
120 template<typename GeneratorContext> 114 template<typename GeneratorContext>
121 void generateCulledLineBoxRects(GeneratorContext& yield, const RenderInline* container) const; 115 void generateCulledLineBoxRects(GeneratorContext& yield, const RenderInline* container) const;
122 116
123 void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChil d);
124 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje ct* beforeChild = 0) override final;
125
126 void splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock,
127 RenderObject* beforeChild, RenderBoxModelObject* oldCont);
128 void splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
129 RenderObject* newChild, RenderBoxModelObject* oldCont);
130
131 virtual void layout() override final { ASSERT_NOT_REACHED(); } // Do nothing for layout() 117 virtual void layout() override final { ASSERT_NOT_REACHED(); } // Do nothing for layout()
132 118
133 virtual void paint(PaintInfo&, const LayoutPoint&) override final; 119 virtual void paint(PaintInfo&, const LayoutPoint&) override final;
134 120
135 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override final; 121 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override final;
136 122
137 virtual LayerType layerTypeRequired() const override { return isRelPositione d() || createsGroup() || hasClipPath() || style()->shouldCompositeForCurrentAnim ations() ? NormalLayer : NoLayer; } 123 virtual LayerType layerTypeRequired() const override { return isRelPositione d() || createsGroup() || hasClipPath() || style()->shouldCompositeForCurrentAnim ations() ? NormalLayer : NoLayer; }
138 124
139 virtual LayoutUnit offsetLeft() const override final; 125 virtual LayoutUnit offsetLeft() const override final;
140 virtual LayoutUnit offsetTop() const override final; 126 virtual LayoutUnit offsetTop() const override final;
(...skipping 14 matching lines...) Expand all
155 return IntRect(0, 0, boundingBox.width(), boundingBox.height()); 141 return IntRect(0, 0, boundingBox.width(), boundingBox.height());
156 } 142 }
157 143
158 virtual InlineFlowBox* createInlineFlowBox(); // Subclassed by SVG and Ruby 144 virtual InlineFlowBox* createInlineFlowBox(); // Subclassed by SVG and Ruby
159 145
160 virtual void dirtyLinesFromChangedChild(RenderObject* child) override final { m_lineBoxes.dirtyLinesFromChangedChild(this, child); } 146 virtual void dirtyLinesFromChangedChild(RenderObject* child) override final { m_lineBoxes.dirtyLinesFromChangedChild(this, child); }
161 147
162 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const override final; 148 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const override final;
163 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const override final; 149 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const override final;
164 150
165 virtual void childBecameNonInline(RenderObject* child) override final;
166
167 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid e final; 151 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid e final;
168 152
169 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override fina l; 153 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override fina l;
170 154
171 virtual void updateFromStyle() override final; 155 virtual void updateFromStyle() override final;
172 156
173 RenderInline* clone() const;
174
175 void paintOutlineForLine(GraphicsContext*, const LayoutPoint&, const LayoutR ect& prevLine, const LayoutRect& thisLine, 157 void paintOutlineForLine(GraphicsContext*, const LayoutPoint&, const LayoutR ect& prevLine, const LayoutRect& thisLine,
176 const LayoutRect& nextLine, const Color); 158 const LayoutRect& nextLine, const Color);
177 RenderBoxModelObject* continuationBefore(RenderObject* beforeChild);
178 159
179 RenderObjectChildList m_children; 160 RenderObjectChildList m_children;
180 RenderLineBoxList m_lineBoxes; // All of the line boxes created for this i nline flow. For example, <i>Hello<br>world.</i> will have two <i> line boxes. 161 RenderLineBoxList m_lineBoxes; // All of the line boxes created for this i nline flow. For example, <i>Hello<br>world.</i> will have two <i> line boxes.
181 }; 162 };
182 163
183 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderInline, isRenderInline()); 164 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderInline, isRenderInline());
184 165
185 } // namespace blink 166 } // namespace blink
186 167
187 #endif // RenderInline_h 168 #endif // RenderInline_h
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBoxModelObject.cpp ('k') | sky/engine/core/rendering/RenderInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698