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

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: Fix windows build break Created 4 years, 11 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_inlineBoxWrapper(nullptr) 56 : m_inlineBoxWrapper(nullptr)
57 , m_spannerPlaceholder(nullptr) 57 , m_spannerPlaceholder(nullptr)
58 , m_overrideLogicalContentHeight(-1) 58 , m_overrideLogicalContentHeight(-1)
59 , m_overrideLogicalContentWidth(-1) 59 , m_overrideLogicalContentWidth(-1)
60 , m_previousBorderBoxSize(-1, -1) 60 , m_previousBorderBoxSize(-1, -1)
61 , m_percentHeightContainer(nullptr)
61 { 62 {
62 } 63 }
63 64
64 // For inline replaced elements, the inline box that owns us. 65 // For inline replaced elements, the inline box that owns us.
65 InlineBox* m_inlineBoxWrapper; 66 InlineBox* m_inlineBoxWrapper;
66 67
67 // For spanners, the spanner placeholder that lays us out within the multico l container. 68 // For spanners, the spanner placeholder that lays us out within the multico l container.
68 LayoutMultiColumnSpannerPlaceholder* m_spannerPlaceholder; 69 LayoutMultiColumnSpannerPlaceholder* m_spannerPlaceholder;
69 70
70 LayoutUnit m_overrideLogicalContentHeight; 71 LayoutUnit m_overrideLogicalContentHeight;
71 LayoutUnit m_overrideLogicalContentWidth; 72 LayoutUnit m_overrideLogicalContentWidth;
72 73
73 // Set by LayoutBox::savePreviousBoxSizesIfNeeded(). 74 // Set by LayoutBox::savePreviousBoxSizesIfNeeded().
74 LayoutSize m_previousBorderBoxSize; 75 LayoutSize m_previousBorderBoxSize;
75 LayoutRect m_previousContentBoxRect; 76 LayoutRect m_previousContentBoxRect;
76 LayoutRect m_previousLayoutOverflowRect; 77 LayoutRect m_previousLayoutOverflowRect;
77 78
78 LayoutUnit m_pageLogicalOffset; 79 LayoutUnit m_pageLogicalOffset;
79 80
80 LayoutUnit m_paginationStrut; 81 LayoutUnit m_paginationStrut;
82
83 LayoutBlock* m_percentHeightContainer;
81 }; 84 };
82 85
83 // LayoutBox implements the full CSS box model. 86 // LayoutBox implements the full CSS box model.
84 // 87 //
85 // LayoutBoxModelObject only introduces some abstractions for LayoutInline and 88 // LayoutBoxModelObject only introduces some abstractions for LayoutInline and
86 // LayoutBox. The logic for the model is in LayoutBox, e.g. the storage for the 89 // LayoutBox. The logic for the model is in LayoutBox, e.g. the storage for the
87 // rectangle and offset forming the CSS box (m_frameRect) and the getters for 90 // rectangle and offset forming the CSS box (m_frameRect) and the getters for
88 // the different boxes. 91 // the different boxes.
89 // 92 //
90 // LayoutBox is also the uppermost class to support scrollbars, however the 93 // LayoutBox is also the uppermost class to support scrollbars, however the
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 845
843 void setIntrinsicContentLogicalHeight(LayoutUnit intrinsicContentLogicalHeig ht) const { m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; } 846 void setIntrinsicContentLogicalHeight(LayoutUnit intrinsicContentLogicalHeig ht) const { m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; }
844 847
845 bool canRenderBorderImage() const; 848 bool canRenderBorderImage() const;
846 849
847 void mapLocalToAncestor(const LayoutBoxModelObject* ancestor, TransformState &, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr, const Pai ntInvalidationState* = nullptr) const override; 850 void mapLocalToAncestor(const LayoutBoxModelObject* ancestor, TransformState &, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr, const Pai ntInvalidationState* = nullptr) const override;
848 void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const ove rride; 851 void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const ove rride;
849 852
850 void clearPreviousPaintInvalidationRects() override; 853 void clearPreviousPaintInvalidationRects() override;
851 854
855 LayoutBlock* percentHeightContainer() const { return m_rareData ? m_rareData ->m_percentHeightContainer : nullptr; }
856 void setPercentHeightContainer(LayoutBlock*);
857 void removeFromPercentHeightContainer();
858 void clearPercentHeightDescendants();
859
852 protected: 860 protected:
853 void willBeDestroyed() override; 861 void willBeDestroyed() override;
854 862
855 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid e; 863 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid e;
856 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ; 864 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override ;
857 void updateFromStyle() override; 865 void updateFromStyle() override;
858 866
859 // Returns false if it could not cheaply compute the extent (e.g. fixed back ground), in which case the returned rect may be incorrect. 867 // Returns false if it could not cheaply compute the extent (e.g. fixed back ground), in which case the returned rect may be incorrect.
860 // FIXME: make this a const method once the LayoutBox reference in BoxPainte r is const. 868 // FIXME: make this a const method once the LayoutBox reference in BoxPainte r is const.
861 bool getBackgroundPaintedExtent(LayoutRect&) const; 869 bool getBackgroundPaintedExtent(LayoutRect&) const;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 if (UNLIKELY(inlineBoxWrapper() != nullptr)) 1075 if (UNLIKELY(inlineBoxWrapper() != nullptr))
1068 deleteLineBoxWrapper(); 1076 deleteLineBoxWrapper();
1069 } 1077 }
1070 1078
1071 ensureRareData().m_inlineBoxWrapper = boxWrapper; 1079 ensureRareData().m_inlineBoxWrapper = boxWrapper;
1072 } 1080 }
1073 1081
1074 } // namespace blink 1082 } // namespace blink
1075 1083
1076 #endif // LayoutBox_h 1084 #endif // LayoutBox_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698