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, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2003, 2006, 2007 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 12 matching lines...) Expand all Loading... | |
23 #ifndef RenderBox_h | 23 #ifndef RenderBox_h |
24 #define RenderBox_h | 24 #define RenderBox_h |
25 | 25 |
26 #include "core/rendering/RenderBoxModelObject.h" | 26 #include "core/rendering/RenderBoxModelObject.h" |
27 #include "core/rendering/RenderOverflow.h" | 27 #include "core/rendering/RenderOverflow.h" |
28 #include "core/rendering/shapes/ShapeOutsideInfo.h" | 28 #include "core/rendering/shapes/ShapeOutsideInfo.h" |
29 #include "platform/scroll/ScrollTypes.h" | 29 #include "platform/scroll/ScrollTypes.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class RenderMultiColumnSpannerPlaceholder; | |
34 | |
33 struct PaintInfo; | 35 struct PaintInfo; |
34 | 36 |
35 enum SizeType { MainOrPreferredSize, MinSize, MaxSize }; | 37 enum SizeType { MainOrPreferredSize, MinSize, MaxSize }; |
36 enum AvailableLogicalHeightType { ExcludeMarginBorderPadding, IncludeMarginBorde rPadding }; | 38 enum AvailableLogicalHeightType { ExcludeMarginBorderPadding, IncludeMarginBorde rPadding }; |
37 enum OverlayScrollbarSizeRelevancy { IgnoreOverlayScrollbarSize, IncludeOverlayS crollbarSize }; | 39 enum OverlayScrollbarSizeRelevancy { IgnoreOverlayScrollbarSize, IncludeOverlayS crollbarSize }; |
38 enum MarginDirection { BlockDirection, InlineDirection }; | 40 enum MarginDirection { BlockDirection, InlineDirection }; |
39 | 41 |
40 enum ShouldComputePreferred { ComputeActual, ComputePreferred }; | 42 enum ShouldComputePreferred { ComputeActual, ComputePreferred }; |
41 | 43 |
42 enum ScrollOffsetClamping { | 44 enum ScrollOffsetClamping { |
43 ScrollOffsetUnclamped, | 45 ScrollOffsetUnclamped, |
44 ScrollOffsetClamped | 46 ScrollOffsetClamped |
45 }; | 47 }; |
46 | 48 |
47 struct RenderBoxRareData { | 49 struct RenderBoxRareData { |
48 WTF_MAKE_NONCOPYABLE(RenderBoxRareData); WTF_MAKE_FAST_ALLOCATED; | 50 WTF_MAKE_NONCOPYABLE(RenderBoxRareData); WTF_MAKE_FAST_ALLOCATED; |
49 public: | 51 public: |
50 RenderBoxRareData() | 52 RenderBoxRareData() |
51 : m_inlineBoxWrapper(0) | 53 : m_inlineBoxWrapper(0) |
54 , m_spannerPlaceholder(0) | |
52 , m_overrideLogicalContentHeight(-1) | 55 , m_overrideLogicalContentHeight(-1) |
53 , m_overrideLogicalContentWidth(-1) | 56 , m_overrideLogicalContentWidth(-1) |
54 , m_previousBorderBoxSize(-1, -1) | 57 , m_previousBorderBoxSize(-1, -1) |
55 { | 58 { |
56 } | 59 } |
57 | 60 |
58 // For inline replaced elements, the inline box that owns us. | 61 // For inline replaced elements, the inline box that owns us. |
59 InlineBox* m_inlineBoxWrapper; | 62 InlineBox* m_inlineBoxWrapper; |
60 | 63 |
64 // For spanners, the spanner placeholder that lays us out within the multico l container. | |
65 RenderMultiColumnSpannerPlaceholder* m_spannerPlaceholder; | |
66 | |
61 LayoutUnit m_overrideLogicalContentHeight; | 67 LayoutUnit m_overrideLogicalContentHeight; |
62 LayoutUnit m_overrideLogicalContentWidth; | 68 LayoutUnit m_overrideLogicalContentWidth; |
63 | 69 |
64 // Set by RenderBox::updatePreviousBorderBoxSizeIfNeeded(). | 70 // Set by RenderBox::updatePreviousBorderBoxSizeIfNeeded(). |
65 LayoutSize m_previousBorderBoxSize; | 71 LayoutSize m_previousBorderBoxSize; |
66 }; | 72 }; |
67 | 73 |
68 class RenderBox : public RenderBoxModelObject { | 74 class RenderBox : public RenderBoxModelObject { |
69 public: | 75 public: |
70 explicit RenderBox(ContainerNode*); | 76 explicit RenderBox(ContainerNode*); |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
389 virtual InlineBox* createInlineBox(); | 395 virtual InlineBox* createInlineBox(); |
390 void dirtyLineBoxes(bool fullLayout); | 396 void dirtyLineBoxes(bool fullLayout); |
391 | 397 |
392 // For inline replaced elements, this function returns the inline box that o wns us. Enables | 398 // For inline replaced elements, this function returns the inline box that o wns us. Enables |
393 // the replaced RenderObject to quickly determine what line it is contained on and to easily | 399 // the replaced RenderObject to quickly determine what line it is contained on and to easily |
394 // iterate over structures on the line. | 400 // iterate over structures on the line. |
395 InlineBox* inlineBoxWrapper() const { return m_rareData ? m_rareData->m_inli neBoxWrapper : 0; } | 401 InlineBox* inlineBoxWrapper() const { return m_rareData ? m_rareData->m_inli neBoxWrapper : 0; } |
396 void setInlineBoxWrapper(InlineBox*); | 402 void setInlineBoxWrapper(InlineBox*); |
397 void deleteLineBoxWrapper(); | 403 void deleteLineBoxWrapper(); |
398 | 404 |
405 void setSpannerPlaceholder(RenderMultiColumnSpannerPlaceholder*); | |
406 virtual RenderMultiColumnSpannerPlaceholder* spannerPlaceholder() const over ride final { return m_rareData ? m_rareData->m_spannerPlaceholder : 0; } | |
Julien - ping for review
2014/12/11 19:09:37
We just put final per https://groups.google.com/a/
mstensho (USE GERRIT)
2014/12/11 21:01:14
Done.
| |
407 | |
399 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons t override; | 408 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons t override; |
400 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const o verride; | 409 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const o verride; |
401 virtual void invalidatePaintForOverhangingFloats(bool paintAllDescendants); | 410 virtual void invalidatePaintForOverhangingFloats(bool paintAllDescendants); |
402 | 411 |
403 virtual LayoutUnit containingBlockLogicalWidthForContent() const override; | 412 virtual LayoutUnit containingBlockLogicalWidthForContent() const override; |
404 LayoutUnit containingBlockLogicalHeightForContent(AvailableLogicalHeightType ) const; | 413 LayoutUnit containingBlockLogicalHeightForContent(AvailableLogicalHeightType ) const; |
405 | 414 |
406 LayoutUnit containingBlockAvailableLineWidth() const; | 415 LayoutUnit containingBlockAvailableLineWidth() const; |
407 LayoutUnit perpendicularContainingBlockLogicalHeight() const; | 416 LayoutUnit perpendicularContainingBlockLogicalHeight() const; |
408 | 417 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
646 void markShapeOutsideDependentsForLayout() | 655 void markShapeOutsideDependentsForLayout() |
647 { | 656 { |
648 if (isFloating()) | 657 if (isFloating()) |
649 removeFloatingOrPositionedChildFromBlockLists(); | 658 removeFloatingOrPositionedChildFromBlockLists(); |
650 } | 659 } |
651 | 660 |
652 bool backgroundHasOpaqueTopLayer() const; | 661 bool backgroundHasOpaqueTopLayer() const; |
653 | 662 |
654 void setIntrinsicContentLogicalHeight(LayoutUnit intrinsicContentLogicalHeig ht) const { m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; } | 663 void setIntrinsicContentLogicalHeight(LayoutUnit intrinsicContentLogicalHeig ht) const { m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; } |
655 protected: | 664 protected: |
665 virtual void willBeRemovedFromTree() override; | |
656 virtual void willBeDestroyed() override; | 666 virtual void willBeDestroyed() override; |
657 | 667 |
658 | |
659 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) o verride; | 668 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) o verride; |
660 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov erride; | 669 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov erride; |
661 virtual void updateFromStyle() override; | 670 virtual void updateFromStyle() override; |
662 | 671 |
663 // Returns false if it could not cheaply compute the extent (e.g. fixed back ground), in which case the returned rect may be incorrect. | 672 // Returns false if it could not cheaply compute the extent (e.g. fixed back ground), in which case the returned rect may be incorrect. |
664 // FIXME: make this a const method once the RenderBox reference in BoxPainte r is const. | 673 // FIXME: make this a const method once the RenderBox reference in BoxPainte r is const. |
665 bool getBackgroundPaintedExtent(LayoutRect&); | 674 bool getBackgroundPaintedExtent(LayoutRect&); |
666 virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned maxDepthToTest) const; | 675 virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned maxDepthToTest) const; |
667 virtual bool computeBackgroundIsKnownToBeObscured() override; | 676 virtual bool computeBackgroundIsKnownToBeObscured() override; |
668 | 677 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
813 if (UNLIKELY(inlineBoxWrapper() != 0)) | 822 if (UNLIKELY(inlineBoxWrapper() != 0)) |
814 deleteLineBoxWrapper(); | 823 deleteLineBoxWrapper(); |
815 } | 824 } |
816 | 825 |
817 ensureRareData().m_inlineBoxWrapper = boxWrapper; | 826 ensureRareData().m_inlineBoxWrapper = boxWrapper; |
818 } | 827 } |
819 | 828 |
820 } // namespace blink | 829 } // namespace blink |
821 | 830 |
822 #endif // RenderBox_h | 831 #endif // RenderBox_h |
OLD | NEW |