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

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

Issue 1577433003: Statistics of LayoutBox rare data reasons Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 3 years, 9 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 return *m_snapAreas; 102 return *m_snapAreas;
103 } 103 }
104 104
105 // Used by BoxPaintInvalidator. Stores the previous content box size and 105 // Used by BoxPaintInvalidator. Stores the previous content box size and
106 // layout overflow rect after the last paint invalidation. They are valid if 106 // layout overflow rect after the last paint invalidation. They are valid if
107 // m_hasPreviousContentBoxSizeAndLayoutOverflowRect is true. 107 // m_hasPreviousContentBoxSizeAndLayoutOverflowRect is true.
108 LayoutSize m_previousContentBoxSize; 108 LayoutSize m_previousContentBoxSize;
109 LayoutRect m_previousLayoutOverflowRect; 109 LayoutRect m_previousLayoutOverflowRect;
110 }; 110 };
111 111
112 CORE_EXPORT int* rareDataReasonCounts();
113
112 // LayoutBox implements the full CSS box model. 114 // LayoutBox implements the full CSS box model.
113 // 115 //
114 // LayoutBoxModelObject only introduces some abstractions for LayoutInline and 116 // LayoutBoxModelObject only introduces some abstractions for LayoutInline and
115 // LayoutBox. The logic for the model is in LayoutBox, e.g. the storage for the 117 // LayoutBox. The logic for the model is in LayoutBox, e.g. the storage for the
116 // rectangle and offset forming the CSS box (m_frameRect) and the getters for 118 // rectangle and offset forming the CSS box (m_frameRect) and the getters for
117 // the different boxes. 119 // the different boxes.
118 // 120 //
119 // LayoutBox is also the uppermost class to support scrollbars, however the 121 // LayoutBox is also the uppermost class to support scrollbars, however the
120 // logic is delegated to PaintLayerScrollableArea. 122 // logic is delegated to PaintLayerScrollableArea.
121 // Per the CSS specification, scrollbars should "be inserted between the inner 123 // Per the CSS specification, scrollbars should "be inserted between the inner
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // MR = margin-right 193 // MR = margin-right
192 // PL = padding-left 194 // PL = padding-left
193 // PR = padding-right 195 // PR = padding-right
194 // SC = scroll corner (contains UI for resizing (see the 'resize' property) 196 // SC = scroll corner (contains UI for resizing (see the 'resize' property)
195 // SW = scrollbar width 197 // SW = scrollbar width
196 // 198 //
197 // Those are just the boxes from the CSS model. Extra boxes are tracked by Blink 199 // Those are just the boxes from the CSS model. Extra boxes are tracked by Blink
198 // (e.g. the overflows). Thus it is paramount to know which box a function is 200 // (e.g. the overflows). Thus it is paramount to know which box a function is
199 // manipulating. Also of critical importance is the coordinate system used (see 201 // manipulating. Also of critical importance is the coordinate system used (see
200 // the COORDINATE SYSTEMS section in LayoutBoxModelObject). 202 // the COORDINATE SYSTEMS section in LayoutBoxModelObject).
203
201 class CORE_EXPORT LayoutBox : public LayoutBoxModelObject { 204 class CORE_EXPORT LayoutBox : public LayoutBoxModelObject {
202 public: 205 public:
203 explicit LayoutBox(ContainerNode*); 206 explicit LayoutBox(ContainerNode*);
204 207
205 PaintLayerType layerTypeRequired() const override; 208 PaintLayerType layerTypeRequired() const override;
206 209
207 bool backgroundIsKnownToBeOpaqueInRect( 210 bool backgroundIsKnownToBeOpaqueInRect(
208 const LayoutRect& localRect) const override; 211 const LayoutRect& localRect) const override;
209 212
210 virtual bool backgroundShouldAlwaysBeClipped() const { return false; } 213 virtual bool backgroundShouldAlwaysBeClipped() const { return false; }
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 // 1551 //
1549 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS in LayoutObject.h for more 1552 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS in LayoutObject.h for more
1550 // details about those widths. 1553 // details about those widths.
1551 virtual void computePreferredLogicalWidths() { 1554 virtual void computePreferredLogicalWidths() {
1552 clearPreferredLogicalWidthsDirty(); 1555 clearPreferredLogicalWidthsDirty();
1553 } 1556 }
1554 1557
1555 LayoutBoxRareData& ensureRareData() { 1558 LayoutBoxRareData& ensureRareData() {
1556 if (!m_rareData) 1559 if (!m_rareData)
1557 m_rareData = WTF::makeUnique<LayoutBoxRareData>(); 1560 m_rareData = WTF::makeUnique<LayoutBoxRareData>();
1561 m_rareStat.addReason(ReasonLBRareData);
1558 return *m_rareData.get(); 1562 return *m_rareData.get();
1559 } 1563 }
1560 1564
1561 bool logicalHeightComputesAsNone(SizeType) const; 1565 bool logicalHeightComputesAsNone(SizeType) const;
1562 1566
1563 bool isBox() const = 1567 bool isBox() const =
1564 delete; // This will catch anyone doing an unnecessary check. 1568 delete; // This will catch anyone doing an unnecessary check.
1565 1569
1566 void locationChanged(); 1570 void locationChanged();
1567 void sizeChanged(); 1571 void sizeChanged();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 // m_inlineBoxWrapper should already be nullptr. Deleting it is a safeguard 1691 // m_inlineBoxWrapper should already be nullptr. Deleting it is a safeguard
1688 // against security issues. Otherwise, there will two line box wrappers 1692 // against security issues. Otherwise, there will two line box wrappers
1689 // keeping the reference to this layoutObject, and only one will be notified 1693 // keeping the reference to this layoutObject, and only one will be notified
1690 // when the layoutObject is getting destroyed. The second line box wrapper 1694 // when the layoutObject is getting destroyed. The second line box wrapper
1691 // will keep a stale reference. 1695 // will keep a stale reference.
1692 if (UNLIKELY(m_inlineBoxWrapper != nullptr)) 1696 if (UNLIKELY(m_inlineBoxWrapper != nullptr))
1693 deleteLineBoxWrapper(); 1697 deleteLineBoxWrapper();
1694 } 1698 }
1695 1699
1696 m_inlineBoxWrapper = boxWrapper; 1700 m_inlineBoxWrapper = boxWrapper;
1701 if (boxWrapper)
1702 m_rareStat.addReason(ReasonLBInlineBoxWrapper);
1697 } 1703 }
1698 1704
1699 inline bool LayoutBox::isForcedFragmentainerBreakValue( 1705 inline bool LayoutBox::isForcedFragmentainerBreakValue(
1700 EBreakBetween breakValue) { 1706 EBreakBetween breakValue) {
1701 return breakValue == EBreakBetween::kColumn || 1707 return breakValue == EBreakBetween::kColumn ||
1702 breakValue == EBreakBetween::kLeft || 1708 breakValue == EBreakBetween::kLeft ||
1703 breakValue == EBreakBetween::kPage || 1709 breakValue == EBreakBetween::kPage ||
1704 breakValue == EBreakBetween::kRecto || 1710 breakValue == EBreakBetween::kRecto ||
1705 breakValue == EBreakBetween::kRight || 1711 breakValue == EBreakBetween::kRight ||
1706 breakValue == EBreakBetween::kVerso; 1712 breakValue == EBreakBetween::kVerso;
1707 } 1713 }
1708 1714
1709 } // namespace blink 1715 } // namespace blink
1710 1716
1711 #endif // LayoutBox_h 1717 #endif // LayoutBox_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.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