Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1410 MutableForPainting(const LayoutObject& layoutObject) : m_layoutObject(co nst_cast<LayoutObject&>(layoutObject)) { } | 1410 MutableForPainting(const LayoutObject& layoutObject) : m_layoutObject(co nst_cast<LayoutObject&>(layoutObject)) { } |
| 1411 | 1411 |
| 1412 LayoutObject& m_layoutObject; | 1412 LayoutObject& m_layoutObject; |
| 1413 }; | 1413 }; |
| 1414 MutableForPainting getMutableForPainting() const { return MutableForPainting (*this); } | 1414 MutableForPainting getMutableForPainting() const { return MutableForPainting (*this); } |
| 1415 | 1415 |
| 1416 void setIsScrollAnchorObject() { m_bitfields.setIsScrollAnchorObject(true); } | 1416 void setIsScrollAnchorObject() { m_bitfields.setIsScrollAnchorObject(true); } |
| 1417 // Clears the IsScrollAnchorObject bit, unless any ScrollAnchor still refers to us. | 1417 // Clears the IsScrollAnchorObject bit, unless any ScrollAnchor still refers to us. |
| 1418 void maybeClearIsScrollAnchorObject(); | 1418 void maybeClearIsScrollAnchorObject(); |
| 1419 | 1419 |
| 1420 bool hasLayoutAffectingStyleChanged() { return m_bitfields.hasLayoutAffectin gStyleChanged(); } | |
|
ojan
2016/08/16 23:54:32
<bikeshed>This name might be too general. It's not
skobes
2016/08/17 18:50:32
Done.
| |
| 1421 void setHasLayoutAffectingStyleChanged(bool changed) { m_bitfields.setHasLay outAffectingStyleChanged(changed); } | |
| 1422 | |
| 1420 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN eedsOverflowRecalcAfterStyleChange(false); } | 1423 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN eedsOverflowRecalcAfterStyleChange(false); } |
| 1421 | 1424 |
| 1422 bool compositedScrollsWithRespectTo(const LayoutBoxModelObject& paintInvalid ationContainer) const; | 1425 bool compositedScrollsWithRespectTo(const LayoutBoxModelObject& paintInvalid ationContainer) const; |
| 1423 IntSize scrollAdjustmentForPaintInvalidation(const LayoutBoxModelObject& pai ntInvalidationContainer) const; | 1426 IntSize scrollAdjustmentForPaintInvalidation(const LayoutBoxModelObject& pai ntInvalidationContainer) const; |
| 1424 | 1427 |
| 1425 bool previousBackgroundObscured() const { return m_bitfields.previousBackgro undObscured(); } | 1428 bool previousBackgroundObscured() const { return m_bitfields.previousBackgro undObscured(); } |
| 1426 void setPreviousBackgroundObscured(bool b) { m_bitfields.setPreviousBackgrou ndObscured(b); } | 1429 void setPreviousBackgroundObscured(bool b) { m_bitfields.setPreviousBackgrou ndObscured(b); } |
| 1427 | 1430 |
| 1428 protected: | 1431 protected: |
| 1429 enum LayoutObjectType { | 1432 enum LayoutObjectType { |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1731 , m_isInsideFlowThread(false) | 1734 , m_isInsideFlowThread(false) |
| 1732 , m_subtreeChangeListenerRegistered(false) | 1735 , m_subtreeChangeListenerRegistered(false) |
| 1733 , m_notifiedOfSubtreeChange(false) | 1736 , m_notifiedOfSubtreeChange(false) |
| 1734 , m_consumesSubtreeChangeNotification(false) | 1737 , m_consumesSubtreeChangeNotification(false) |
| 1735 , m_childrenInline(false) | 1738 , m_childrenInline(false) |
| 1736 , m_containsInlineWithOutlineAndContinuation(false) | 1739 , m_containsInlineWithOutlineAndContinuation(false) |
| 1737 , m_alwaysCreateLineBoxesForLayoutInline(false) | 1740 , m_alwaysCreateLineBoxesForLayoutInline(false) |
| 1738 , m_previousBackgroundObscured(false) | 1741 , m_previousBackgroundObscured(false) |
| 1739 , m_isBackgroundAttachmentFixedObject(false) | 1742 , m_isBackgroundAttachmentFixedObject(false) |
| 1740 , m_isScrollAnchorObject(false) | 1743 , m_isScrollAnchorObject(false) |
| 1744 , m_hasLayoutAffectingStyleChanged(false) | |
| 1741 , m_hasBoxDecorationBackground(false) | 1745 , m_hasBoxDecorationBackground(false) |
| 1742 , m_positionedState(IsStaticallyPositioned) | 1746 , m_positionedState(IsStaticallyPositioned) |
| 1743 , m_selectionState(SelectionNone) | 1747 , m_selectionState(SelectionNone) |
| 1744 , m_backgroundObscurationState(BackgroundObscurationStatusInvalid) | 1748 , m_backgroundObscurationState(BackgroundObscurationStatusInvalid) |
| 1745 , m_fullPaintInvalidationReason(PaintInvalidationNone) | 1749 , m_fullPaintInvalidationReason(PaintInvalidationNone) |
| 1746 { | 1750 { |
| 1747 } | 1751 } |
| 1748 | 1752 |
| 1749 // 32 bits have been used in the first word, and 18 in the second. | 1753 // 32 bits have been used in the first word, and 18 in the second. |
| 1750 | 1754 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1869 | 1873 |
| 1870 // from LayoutInline | 1874 // from LayoutInline |
| 1871 ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForLayoutInline, AlwaysCreateL ineBoxesForLayoutInline); | 1875 ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForLayoutInline, AlwaysCreateL ineBoxesForLayoutInline); |
| 1872 | 1876 |
| 1873 // Background obscuration status of the previous frame. | 1877 // Background obscuration status of the previous frame. |
| 1874 ADD_BOOLEAN_BITFIELD(previousBackgroundObscured, PreviousBackgroundObscu red); | 1878 ADD_BOOLEAN_BITFIELD(previousBackgroundObscured, PreviousBackgroundObscu red); |
| 1875 | 1879 |
| 1876 ADD_BOOLEAN_BITFIELD(isBackgroundAttachmentFixedObject, IsBackgroundAtta chmentFixedObject); | 1880 ADD_BOOLEAN_BITFIELD(isBackgroundAttachmentFixedObject, IsBackgroundAtta chmentFixedObject); |
| 1877 ADD_BOOLEAN_BITFIELD(isScrollAnchorObject, IsScrollAnchorObject); | 1881 ADD_BOOLEAN_BITFIELD(isScrollAnchorObject, IsScrollAnchorObject); |
| 1878 | 1882 |
| 1883 // This bit is used for scroll anchoring. It indicates whether this Layo utObject has | |
| 1884 // changed the value of one or more CSS properties that may affect its p osition. | |
| 1885 // See http://bit.ly/sanaclap for more info. | |
| 1886 ADD_BOOLEAN_BITFIELD(hasLayoutAffectingStyleChanged, HasLayoutAffectingS tyleChanged); | |
| 1887 | |
| 1879 ADD_BOOLEAN_BITFIELD(hasBoxDecorationBackground, HasBoxDecorationBackgro und); | 1888 ADD_BOOLEAN_BITFIELD(hasBoxDecorationBackground, HasBoxDecorationBackgro und); |
| 1880 | 1889 |
| 1881 private: | 1890 private: |
| 1882 // This is the cached 'position' value of this object | 1891 // This is the cached 'position' value of this object |
| 1883 // (see ComputedStyle::position). | 1892 // (see ComputedStyle::position). |
| 1884 unsigned m_positionedState : 2; // PositionedState | 1893 unsigned m_positionedState : 2; // PositionedState |
| 1885 unsigned m_selectionState : 3; // SelectionState | 1894 unsigned m_selectionState : 3; // SelectionState |
| 1886 // Mutable for getter which lazily update this field. | 1895 // Mutable for getter which lazily update this field. |
| 1887 mutable unsigned m_backgroundObscurationState : 2; // BackgroundObscurat ionState | 1896 mutable unsigned m_backgroundObscurationState : 2; // BackgroundObscurat ionState |
| 1888 unsigned m_fullPaintInvalidationReason : 5; // PaintInvalidationReason | 1897 unsigned m_fullPaintInvalidationReason : 5; // PaintInvalidationReason |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2031 setSelfNeedsLayout(false); | 2040 setSelfNeedsLayout(false); |
| 2032 setPosChildNeedsLayout(false); | 2041 setPosChildNeedsLayout(false); |
| 2033 setNeedsSimplifiedNormalFlowLayout(false); | 2042 setNeedsSimplifiedNormalFlowLayout(false); |
| 2034 setNormalChildNeedsLayout(false); | 2043 setNormalChildNeedsLayout(false); |
| 2035 setNeedsPositionedMovementLayout(false); | 2044 setNeedsPositionedMovementLayout(false); |
| 2036 setAncestorLineBoxDirty(false); | 2045 setAncestorLineBoxDirty(false); |
| 2037 | 2046 |
| 2038 #if ENABLE(ASSERT) | 2047 #if ENABLE(ASSERT) |
| 2039 checkBlockPositionedObjectsNeedLayout(); | 2048 checkBlockPositionedObjectsNeedLayout(); |
| 2040 #endif | 2049 #endif |
| 2050 | |
| 2051 setHasLayoutAffectingStyleChanged(false); | |
| 2041 } | 2052 } |
| 2042 | 2053 |
| 2043 inline void LayoutObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr eeLayoutScope* layouter) | 2054 inline void LayoutObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr eeLayoutScope* layouter) |
| 2044 { | 2055 { |
| 2045 ASSERT(!isSetNeedsLayoutForbidden()); | 2056 ASSERT(!isSetNeedsLayoutForbidden()); |
| 2046 bool alreadyNeededLayout = normalChildNeedsLayout(); | 2057 bool alreadyNeededLayout = normalChildNeedsLayout(); |
| 2047 setNormalChildNeedsLayout(true); | 2058 setNormalChildNeedsLayout(true); |
| 2048 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem ove the MarkingBehavior argument entirely. | 2059 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem ove the MarkingBehavior argument entirely. |
| 2049 if (!alreadyNeededLayout && markParents == MarkContainerChain && (!layouter || layouter->root() != this)) | 2060 if (!alreadyNeededLayout && markParents == MarkContainerChain && (!layouter || layouter->root() != this)) |
| 2050 markContainerChainForLayout(!layouter, layouter); | 2061 markContainerChainForLayout(!layouter, layouter); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2157 void showTree(const blink::LayoutObject*); | 2168 void showTree(const blink::LayoutObject*); |
| 2158 void showLineTree(const blink::LayoutObject*); | 2169 void showLineTree(const blink::LayoutObject*); |
| 2159 void showLayoutTree(const blink::LayoutObject* object1); | 2170 void showLayoutTree(const blink::LayoutObject* object1); |
| 2160 // We don't make object2 an optional parameter so that showLayoutTree | 2171 // We don't make object2 an optional parameter so that showLayoutTree |
| 2161 // can be called from gdb easily. | 2172 // can be called from gdb easily. |
| 2162 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); | 2173 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); |
| 2163 | 2174 |
| 2164 #endif | 2175 #endif |
| 2165 | 2176 |
| 2166 #endif // LayoutObject_h | 2177 #endif // LayoutObject_h |
| OLD | NEW |