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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.h

Issue 1544423002: Improve positioned/percentHeight descendant/container tracking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 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, 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 }; 50 };
51 51
52 struct LayoutBoxRareData { 52 struct LayoutBoxRareData {
53 WTF_MAKE_NONCOPYABLE(LayoutBoxRareData); USING_FAST_MALLOC(LayoutBoxRareData ); 53 WTF_MAKE_NONCOPYABLE(LayoutBoxRareData); USING_FAST_MALLOC(LayoutBoxRareData );
54 public: 54 public:
55 LayoutBoxRareData() 55 LayoutBoxRareData()
56 : m_spannerPlaceholder(nullptr) 56 : m_spannerPlaceholder(nullptr)
57 , m_overrideLogicalContentHeight(-1) 57 , m_overrideLogicalContentHeight(-1)
58 , m_overrideLogicalContentWidth(-1) 58 , m_overrideLogicalContentWidth(-1)
59 , m_previousBorderBoxSize(-1, -1) 59 , m_previousBorderBoxSize(-1, -1)
60 , m_percentHeightContainer(nullptr)
60 { 61 {
61 } 62 }
62 63
63 // For spanners, the spanner placeholder that lays us out within the multico l container. 64 // For spanners, the spanner placeholder that lays us out within the multico l container.
64 LayoutMultiColumnSpannerPlaceholder* m_spannerPlaceholder; 65 LayoutMultiColumnSpannerPlaceholder* m_spannerPlaceholder;
65 66
66 LayoutUnit m_overrideLogicalContentHeight; 67 LayoutUnit m_overrideLogicalContentHeight;
67 LayoutUnit m_overrideLogicalContentWidth; 68 LayoutUnit m_overrideLogicalContentWidth;
68 69
69 // Set by LayoutBox::savePreviousBoxSizesIfNeeded(). 70 // Set by LayoutBox::savePreviousBoxSizesIfNeeded().
70 LayoutSize m_previousBorderBoxSize; 71 LayoutSize m_previousBorderBoxSize;
71 LayoutRect m_previousContentBoxRect; 72 LayoutRect m_previousContentBoxRect;
72 LayoutRect m_previousLayoutOverflowRect; 73 LayoutRect m_previousLayoutOverflowRect;
73 74
74 LayoutUnit m_pageLogicalOffset; 75 LayoutUnit m_pageLogicalOffset;
75 76
76 LayoutUnit m_paginationStrut; 77 LayoutUnit m_paginationStrut;
78
79 LayoutBlock* m_percentHeightContainer;
77 }; 80 };
78 81
79 // LayoutBox implements the full CSS box model. 82 // LayoutBox implements the full CSS box model.
80 // 83 //
81 // LayoutBoxModelObject only introduces some abstractions for LayoutInline and 84 // LayoutBoxModelObject only introduces some abstractions for LayoutInline and
82 // LayoutBox. The logic for the model is in LayoutBox, e.g. the storage for the 85 // LayoutBox. The logic for the model is in LayoutBox, e.g. the storage for the
83 // rectangle and offset forming the CSS box (m_frameRect) and the getters for 86 // rectangle and offset forming the CSS box (m_frameRect) and the getters for
84 // the different boxes. 87 // the different boxes.
85 // 88 //
86 // LayoutBox is also the uppermost class to support scrollbars, however the 89 // LayoutBox is also the uppermost class to support scrollbars, however the
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 864
862 void setIntrinsicContentLogicalHeight(LayoutUnit intrinsicContentLogicalHeig ht) const { m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; } 865 void setIntrinsicContentLogicalHeight(LayoutUnit intrinsicContentLogicalHeig ht) const { m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; }
863 866
864 bool canRenderBorderImage() const; 867 bool canRenderBorderImage() const;
865 868
866 void mapLocalToAncestor(const LayoutBoxModelObject* ancestor, TransformState &, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr, const Pai ntInvalidationState* = nullptr) const override; 869 void mapLocalToAncestor(const LayoutBoxModelObject* ancestor, TransformState &, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr, const Pai ntInvalidationState* = nullptr) const override;
867 void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const ove rride; 870 void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const ove rride;
868 871
869 void clearPreviousPaintInvalidationRects() override; 872 void clearPreviousPaintInvalidationRects() override;
870 873
874 LayoutBlock* percentHeightContainer() const { return m_rareData ? m_rareData ->m_percentHeightContainer : nullptr; }
875 void setPercentHeightContainer(LayoutBlock*);
876 void removeFromPercentHeightContainer();
877 void clearPercentHeightDescendants();
878
871 protected: 879 protected:
872 void willBeDestroyed() override; 880 void willBeDestroyed() override;
873 881
874 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid e; 882 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid e;
875 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ; 883 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ;
876 void updateFromStyle() override; 884 void updateFromStyle() override;
877 885
878 // Returns false if it could not cheaply compute the extent (e.g. fixed back ground), in which case the returned rect may be incorrect. 886 // Returns false if it could not cheaply compute the extent (e.g. fixed back ground), in which case the returned rect may be incorrect.
879 // FIXME: make this a const method once the LayoutBox reference in BoxPainte r is const. 887 // FIXME: make this a const method once the LayoutBox reference in BoxPainte r is const.
880 bool getBackgroundPaintedExtent(LayoutRect&) const; 888 bool getBackgroundPaintedExtent(LayoutRect&) const;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 if (UNLIKELY(m_inlineBoxWrapper != nullptr)) 1108 if (UNLIKELY(m_inlineBoxWrapper != nullptr))
1101 deleteLineBoxWrapper(); 1109 deleteLineBoxWrapper();
1102 } 1110 }
1103 1111
1104 m_inlineBoxWrapper = boxWrapper; 1112 m_inlineBoxWrapper = boxWrapper;
1105 } 1113 }
1106 1114
1107 } // namespace blink 1115 } // namespace blink
1108 1116
1109 #endif // LayoutBox_h 1117 #endif // LayoutBox_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698