| OLD | NEW |
| 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/rendering/RenderLineBoxList.h" | 29 #include "core/rendering/RenderLineBoxList.h" |
| 30 | 30 |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 class RenderInline : public RenderBoxModelObject { | 33 class RenderInline : public RenderBoxModelObject { |
| 34 public: | 34 public: |
| 35 explicit RenderInline(Element*); | 35 explicit RenderInline(Element*); |
| 36 | 36 |
| 37 static RenderInline* createAnonymous(Document*); | 37 static RenderInline* createAnonymous(Document*); |
| 38 | 38 |
| 39 RenderObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } | 39 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } |
| 40 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } | 40 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } |
| 41 | 41 |
| 42 // If you have a RenderInline, use firstChild or lastChild instead. | 42 // If you have a RenderInline, use firstChild or lastChild instead. |
| 43 void slowFirstChild() const = delete; | 43 void slowFirstChild() const = delete; |
| 44 void slowLastChild() const = delete; | 44 void slowLastChild() const = delete; |
| 45 | 45 |
| 46 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
override; | 46 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = 0)
override; |
| 47 | 47 |
| 48 Element* node() const { return toElement(RenderBoxModelObject::node()); } | 48 Element* node() const { return toElement(RenderBoxModelObject::node()); } |
| 49 | 49 |
| 50 virtual LayoutRectOutsets marginBoxOutsets() const override final; | 50 virtual LayoutRectOutsets marginBoxOutsets() const override final; |
| 51 virtual LayoutUnit marginLeft() const override final; | 51 virtual LayoutUnit marginLeft() const override final; |
| 52 virtual LayoutUnit marginRight() const override final; | 52 virtual LayoutUnit marginRight() const override final; |
| 53 virtual LayoutUnit marginTop() const override final; | 53 virtual LayoutUnit marginTop() const override final; |
| 54 virtual LayoutUnit marginBottom() const override final; | 54 virtual LayoutUnit marginBottom() const override final; |
| 55 virtual LayoutUnit marginBefore(const RenderStyle* otherStyle = 0) const ove
rride final; | 55 virtual LayoutUnit marginBefore(const RenderStyle* otherStyle = 0) const ove
rride final; |
| 56 virtual LayoutUnit marginAfter(const RenderStyle* otherStyle = 0) const over
ride final; | 56 virtual LayoutUnit marginAfter(const RenderStyle* otherStyle = 0) const over
ride final; |
| 57 virtual LayoutUnit marginStart(const RenderStyle* otherStyle = 0) const over
ride final; | 57 virtual LayoutUnit marginStart(const RenderStyle* otherStyle = 0) const over
ride final; |
| 58 virtual LayoutUnit marginEnd(const RenderStyle* otherStyle = 0) const overri
de final; | 58 virtual LayoutUnit marginEnd(const RenderStyle* otherStyle = 0) const overri
de final; |
| 59 | 59 |
| 60 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override final; | 60 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override final; |
| 61 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const overrid
e; | 61 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const overrid
e; |
| 62 | 62 |
| 63 virtual LayoutSize offsetFromContainer(const RenderObject*, const LayoutPoin
t&, bool* offsetDependsOnPoint = 0) const override final; | 63 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin
t&, bool* offsetDependsOnPoint = 0) const override final; |
| 64 | 64 |
| 65 IntRect linesBoundingBox() const; | 65 IntRect linesBoundingBox() const; |
| 66 LayoutRect linesVisualOverflowBoundingBox() const; | 66 LayoutRect linesVisualOverflowBoundingBox() const; |
| 67 | 67 |
| 68 InlineFlowBox* createAndAppendInlineFlowBox(); | 68 InlineFlowBox* createAndAppendInlineFlowBox(); |
| 69 | 69 |
| 70 void dirtyLineBoxes(bool fullLayout); | 70 void dirtyLineBoxes(bool fullLayout); |
| 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; } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 100 protected: | 100 protected: |
| 101 virtual void willBeDestroyed() override; | 101 virtual void willBeDestroyed() override; |
| 102 | 102 |
| 103 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov
erride; | 103 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov
erride; |
| 104 | 104 |
| 105 virtual void computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layout
Point& layerOffset) const override; | 105 virtual void computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layout
Point& layerOffset) const override; |
| 106 | 106 |
| 107 virtual void invalidateDisplayItemClients(DisplayItemList*) const override; | 107 virtual void invalidateDisplayItemClients(DisplayItemList*) const override; |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 virtual RenderObjectChildList* virtualChildren() override final { return chi
ldren(); } | 110 virtual LayoutObjectChildList* virtualChildren() override final { return chi
ldren(); } |
| 111 virtual const RenderObjectChildList* virtualChildren() const override final
{ return children(); } | 111 virtual const LayoutObjectChildList* virtualChildren() const override final
{ return children(); } |
| 112 const RenderObjectChildList* children() const { return &m_children; } | 112 const LayoutObjectChildList* children() const { return &m_children; } |
| 113 RenderObjectChildList* children() { return &m_children; } | 113 LayoutObjectChildList* children() { return &m_children; } |
| 114 | 114 |
| 115 virtual const char* renderName() const override; | 115 virtual const char* renderName() const override; |
| 116 | 116 |
| 117 virtual bool isRenderInline() const override final { return true; } | 117 virtual bool isRenderInline() const override final { return true; } |
| 118 | 118 |
| 119 LayoutRect culledInlineVisualOverflowBoundingBox() const; | 119 LayoutRect culledInlineVisualOverflowBoundingBox() const; |
| 120 InlineBox* culledInlineFirstLineBox() const; | 120 InlineBox* culledInlineFirstLineBox() const; |
| 121 InlineBox* culledInlineLastLineBox() const; | 121 InlineBox* culledInlineLastLineBox() const; |
| 122 | 122 |
| 123 template<typename GeneratorContext> | 123 template<typename GeneratorContext> |
| 124 void generateLineBoxRects(GeneratorContext& yield) const; | 124 void generateLineBoxRects(GeneratorContext& yield) const; |
| 125 template<typename GeneratorContext> | 125 template<typename GeneratorContext> |
| 126 void generateCulledLineBoxRects(GeneratorContext& yield, const RenderInline*
container) const; | 126 void generateCulledLineBoxRects(GeneratorContext& yield, const RenderInline*
container) const; |
| 127 | 127 |
| 128 void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChil
d); | 128 void addChildToContinuation(LayoutObject* newChild, LayoutObject* beforeChil
d); |
| 129 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje
ct* beforeChild = 0) override final; | 129 virtual void addChildIgnoringContinuation(LayoutObject* newChild, LayoutObje
ct* beforeChild = 0) override final; |
| 130 | 130 |
| 131 void moveChildrenToIgnoringContinuation(RenderInline* to, RenderObject* star
tChild); | 131 void moveChildrenToIgnoringContinuation(RenderInline* to, LayoutObject* star
tChild); |
| 132 | 132 |
| 133 void splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock*
middleBlock, | 133 void splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock*
middleBlock, |
| 134 RenderObject* beforeChild, RenderBoxModelObject* oldCont); | 134 LayoutObject* beforeChild, RenderBoxModelObject* oldCont); |
| 135 void splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox, | 135 void splitFlow(LayoutObject* beforeChild, RenderBlock* newBlockBox, |
| 136 RenderObject* newChild, RenderBoxModelObject* oldCont); | 136 LayoutObject* newChild, RenderBoxModelObject* oldCont); |
| 137 | 137 |
| 138 virtual void layout() override final { ASSERT_NOT_REACHED(); } // Do nothing
for layout() | 138 virtual void layout() override final { ASSERT_NOT_REACHED(); } // Do nothing
for layout() |
| 139 | 139 |
| 140 virtual void paint(const PaintInfo&, const LayoutPoint&) override final; | 140 virtual void paint(const PaintInfo&, const LayoutPoint&) override final; |
| 141 | 141 |
| 142 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override final; | 142 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override final; |
| 143 | 143 |
| 144 virtual LayerType layerTypeRequired() const override { return isRelPositione
d() || createsGroup() || hasClipPath() || style()->shouldCompositeForCurrentAnim
ations() ? NormalLayer : NoLayer; } | 144 virtual LayerType layerTypeRequired() const override { return isRelPositione
d() || createsGroup() || hasClipPath() || style()->shouldCompositeForCurrentAnim
ations() ? NormalLayer : NoLayer; } |
| 145 | 145 |
| 146 virtual LayoutUnit offsetLeft() const override final; | 146 virtual LayoutUnit offsetLeft() const override final; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 162 virtual PositionWithAffinity positionForPoint(const LayoutPoint&) override f
inal; | 162 virtual PositionWithAffinity positionForPoint(const LayoutPoint&) override f
inal; |
| 163 | 163 |
| 164 virtual IntRect borderBoundingBox() const override final | 164 virtual IntRect borderBoundingBox() const override final |
| 165 { | 165 { |
| 166 IntRect boundingBox = linesBoundingBox(); | 166 IntRect boundingBox = linesBoundingBox(); |
| 167 return IntRect(0, 0, boundingBox.width(), boundingBox.height()); | 167 return IntRect(0, 0, boundingBox.width(), boundingBox.height()); |
| 168 } | 168 } |
| 169 | 169 |
| 170 virtual InlineFlowBox* createInlineFlowBox(); // Subclassed by SVG and Ruby | 170 virtual InlineFlowBox* createInlineFlowBox(); // Subclassed by SVG and Ruby |
| 171 | 171 |
| 172 virtual void dirtyLinesFromChangedChild(RenderObject* child) override final
{ m_lineBoxes.dirtyLinesFromChangedChild(this, child); } | 172 virtual void dirtyLinesFromChangedChild(LayoutObject* child) override final
{ m_lineBoxes.dirtyLinesFromChangedChild(this, child); } |
| 173 | 173 |
| 174 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const override final; | 174 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const override final; |
| 175 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const override final; | 175 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const override final; |
| 176 | 176 |
| 177 virtual void childBecameNonInline(RenderObject* child) override final; | 177 virtual void childBecameNonInline(LayoutObject* child) override final; |
| 178 | 178 |
| 179 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid
e final; | 179 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid
e final; |
| 180 | 180 |
| 181 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override fina
l; | 181 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override fina
l; |
| 182 | 182 |
| 183 virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&) override fin
al; | 183 virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&) override fin
al; |
| 184 | 184 |
| 185 virtual void updateFromStyle() override final; | 185 virtual void updateFromStyle() override final; |
| 186 | 186 |
| 187 RenderInline* clone() const; | 187 RenderInline* clone() const; |
| 188 | 188 |
| 189 RenderBoxModelObject* continuationBefore(RenderObject* beforeChild); | 189 RenderBoxModelObject* continuationBefore(LayoutObject* beforeChild); |
| 190 | 190 |
| 191 RenderObjectChildList m_children; | 191 LayoutObjectChildList m_children; |
| 192 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. | 192 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. |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderInline, isRenderInline()); | 195 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(RenderInline, isRenderInline()); |
| 196 | 196 |
| 197 } // namespace blink | 197 } // namespace blink |
| 198 | 198 |
| 199 #endif // RenderInline_h | 199 #endif // RenderInline_h |
| OLD | NEW |