Chromium Code Reviews| 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 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 static void clearPercentHeightDescendantsFrom(RenderBox*); | 114 static void clearPercentHeightDescendantsFrom(RenderBox*); |
| 115 static void removePercentHeightDescendantIfNeeded(RenderBox*); | 115 static void removePercentHeightDescendantIfNeeded(RenderBox*); |
| 116 | 116 |
| 117 TrackedRendererListHashSet* percentHeightDescendants() const; | 117 TrackedRendererListHashSet* percentHeightDescendants() const; |
| 118 bool hasPercentHeightDescendants() const | 118 bool hasPercentHeightDescendants() const |
| 119 { | 119 { |
| 120 TrackedRendererListHashSet* descendants = percentHeightDescendants(); | 120 TrackedRendererListHashSet* descendants = percentHeightDescendants(); |
| 121 return descendants && !descendants->isEmpty(); | 121 return descendants && !descendants->isEmpty(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void setHasMarkupTruncation(bool b) { m_hasMarkupTruncation = b; } | |
|
rafaelw
2014/11/28 03:53:50
note that setHasMarkupTruncation was only ever set
ojan
2014/11/28 04:02:23
Yup. deprecated flex + webkit-line-clamp. Did we r
| |
| 125 bool hasMarkupTruncation() const { return m_hasMarkupTruncation; } | |
| 126 | |
| 127 void setHasMarginBeforeQuirk(bool b) { m_hasMarginBeforeQuirk = b; } | 124 void setHasMarginBeforeQuirk(bool b) { m_hasMarginBeforeQuirk = b; } |
| 128 void setHasMarginAfterQuirk(bool b) { m_hasMarginAfterQuirk = b; } | 125 void setHasMarginAfterQuirk(bool b) { m_hasMarginAfterQuirk = b; } |
| 129 | 126 |
| 130 bool hasMarginBeforeQuirk() const { return m_hasMarginBeforeQuirk; } | 127 bool hasMarginBeforeQuirk() const { return m_hasMarginBeforeQuirk; } |
| 131 bool hasMarginAfterQuirk() const { return m_hasMarginAfterQuirk; } | 128 bool hasMarginAfterQuirk() const { return m_hasMarginAfterQuirk; } |
| 132 | 129 |
| 133 bool hasMarginBeforeQuirk(const RenderBox* child) const; | 130 bool hasMarginBeforeQuirk(const RenderBox* child) const; |
| 134 bool hasMarginAfterQuirk(const RenderBox* child) const; | 131 bool hasMarginAfterQuirk(const RenderBox* child) const; |
| 135 | 132 |
| 136 void markPositionedObjectsForLayout(); | 133 void markPositionedObjectsForLayout(); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 152 LayoutRect logicalRightSelectionGap(RenderBlock* rootBlock, const LayoutPoin t& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 149 LayoutRect logicalRightSelectionGap(RenderBlock* rootBlock, const LayoutPoin t& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
| 153 RenderObject* selObj, LayoutUnit logical Right, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*); | 150 RenderObject* selObj, LayoutUnit logical Right, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*); |
| 154 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap); | 151 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap); |
| 155 RenderBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; | 152 RenderBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; |
| 156 | 153 |
| 157 virtual void setSelectionState(SelectionState) override; | 154 virtual void setSelectionState(SelectionState) override; |
| 158 | 155 |
| 159 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co nst LayoutRect& logicalRect); | 156 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co nst LayoutRect& logicalRect); |
| 160 | 157 |
| 161 // Helper methods for computing line counts and heights for line counts. | 158 // Helper methods for computing line counts and heights for line counts. |
| 162 RootInlineBox* lineAtIndex(int) const; | 159 virtual RootInlineBox* lineAtIndex(int) const; |
| 163 int lineCount(const RootInlineBox* = 0, bool* = 0) const; | 160 virtual int lineCount(const RootInlineBox* = 0, bool* = 0) const; |
| 164 int heightForLineCount(int); | 161 virtual int heightForLineCount(int); |
|
ojan
2014/11/28 04:02:23
I wonder what uses these three outside of RenderPa
| |
| 165 void clearTruncation(); | 162 void clearTruncation(); |
| 166 | 163 |
| 167 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const Render Object*, EDisplay = PARAGRAPH); | 164 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const Render Object*, EDisplay = PARAGRAPH); |
| 168 RenderBlock* createAnonymousBlock(EDisplay display = PARAGRAPH) const { retu rn createAnonymousWithParentRendererAndDisplay(this, display); } | 165 RenderBlock* createAnonymousBlock(EDisplay display = PARAGRAPH) const { retu rn createAnonymousWithParentRendererAndDisplay(this, display); } |
| 169 | 166 |
| 170 // Accessors for logical width/height and margins in the containing block's block-flow direction. | 167 // Accessors for logical width/height and margins in the containing block's block-flow direction. |
| 171 LayoutUnit logicalWidthForChild(const RenderBox* child) const { return child ->width(); } | 168 LayoutUnit logicalWidthForChild(const RenderBox* child) const { return child ->width(); } |
| 172 LayoutUnit logicalHeightForChild(const RenderBox* child) const { return chil d->height(); } | 169 LayoutUnit logicalHeightForChild(const RenderBox* child) const { return chil d->height(); } |
| 173 LayoutSize logicalSizeForChild(const RenderBox* child) const { return child- >size(); } | 170 LayoutSize logicalSizeForChild(const RenderBox* child) const { return child- >size(); } |
| 174 LayoutUnit logicalTopForChild(const RenderBox* child) const { return child-> y(); } | 171 LayoutUnit logicalTopForChild(const RenderBox* child) const { return child-> y(); } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 void paintChild(RenderBox*, PaintInfo&, const LayoutPoint&); | 229 void paintChild(RenderBox*, PaintInfo&, const LayoutPoint&); |
| 233 void paintChildAsInlineBlock(RenderBox*, PaintInfo&, const LayoutPoint&); | 230 void paintChildAsInlineBlock(RenderBox*, PaintInfo&, const LayoutPoint&); |
| 234 | 231 |
| 235 virtual void adjustInlineDirectionLineBounds(unsigned /* expansionOpportunit yCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { } | 232 virtual void adjustInlineDirectionLineBounds(unsigned /* expansionOpportunit yCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { } |
| 236 | 233 |
| 237 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const override; | 234 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo utUnit& maxLogicalWidth) const override; |
| 238 virtual void computePreferredLogicalWidths() override; | 235 virtual void computePreferredLogicalWidths() override; |
| 239 | 236 |
| 240 virtual int firstLineBoxBaseline() const override; | 237 virtual int firstLineBoxBaseline() const override; |
| 241 virtual int inlineBlockBaseline(LineDirectionMode) const override; | 238 virtual int inlineBlockBaseline(LineDirectionMode) const override; |
| 242 int lastLineBoxBaseline(LineDirectionMode) const; | 239 virtual int lastLineBoxBaseline(LineDirectionMode) const; |
| 243 | 240 |
| 244 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid e; | 241 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid e; |
| 245 | 242 |
| 246 // Delay update scrollbar until finishDelayUpdateScrollInfo() will be | 243 // Delay update scrollbar until finishDelayUpdateScrollInfo() will be |
| 247 // called. This function is used when a flexbox is laying out its | 244 // called. This function is used when a flexbox is laying out its |
| 248 // descendant. If multiple calls are made to startDelayUpdateScrollInfo(), | 245 // descendant. If multiple calls are made to startDelayUpdateScrollInfo(), |
| 249 // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScro llInfo() | 246 // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScro llInfo() |
| 250 // is called the same number of times. | 247 // is called the same number of times. |
| 251 static void startDelayUpdateScrollInfo(); | 248 static void startDelayUpdateScrollInfo(); |
| 252 static void finishDelayUpdateScrollInfo(); | 249 static void finishDelayUpdateScrollInfo(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 | 337 |
| 341 protected: | 338 protected: |
| 342 RenderObjectChildList m_children; | 339 RenderObjectChildList m_children; |
| 343 RenderLineBoxList m_lineBoxes; // All of the root line boxes created for t his block flow. For example, <div>Hello<br>world.</div> will have two total lin es for the <div>. | 340 RenderLineBoxList m_lineBoxes; // All of the root line boxes created for t his block flow. For example, <div>Hello<br>world.</div> will have two total lin es for the <div>. |
| 344 | 341 |
| 345 LayoutUnit m_pageLogicalOffset; | 342 LayoutUnit m_pageLogicalOffset; |
| 346 | 343 |
| 347 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put in RenderBlockRareData since they are set too frequently. | 344 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put in RenderBlockRareData since they are set too frequently. |
| 348 unsigned m_hasMarginAfterQuirk : 1; | 345 unsigned m_hasMarginAfterQuirk : 1; |
| 349 unsigned m_beingDestroyed : 1; | 346 unsigned m_beingDestroyed : 1; |
| 350 unsigned m_hasMarkupTruncation : 1; | |
| 351 unsigned m_hasBorderOrPaddingLogicalWidthChanged : 1; | 347 unsigned m_hasBorderOrPaddingLogicalWidthChanged : 1; |
| 352 | 348 |
| 353 // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out of RenderBlock | 349 // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out of RenderBlock |
| 354 friend class LineBreaker; | 350 friend class LineBreaker; |
| 355 | 351 |
| 356 // FIXME: This is temporary as we move code that accesses block flow | 352 // FIXME: This is temporary as we move code that accesses block flow |
| 357 // member variables out of RenderBlock and into RenderBlockFlow. | 353 // member variables out of RenderBlock and into RenderBlockFlow. |
| 358 friend class RenderBlockFlow; | 354 friend class RenderBlockFlow; |
| 359 friend class RenderParagraph; | 355 friend class RenderParagraph; |
| 360 }; | 356 }; |
| 361 | 357 |
| 362 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); | 358 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); |
| 363 | 359 |
| 364 } // namespace blink | 360 } // namespace blink |
| 365 | 361 |
| 366 #endif // SKY_ENGINE_CORE_RENDERING_RENDERBLOCK_H_ | 362 #endif // SKY_ENGINE_CORE_RENDERING_RENDERBLOCK_H_ |
| OLD | NEW |