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

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

Issue 2250523003: Implement SANACLAP (http://bit.ly/sanaclap). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve comment Created 4 years, 4 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) 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
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 scrollAnchorDisablingStyleChanged() { return m_bitfields.scrollAnchorDi sablingStyleChanged(); }
1421 void setScrollAnchorDisablingStyleChanged(bool changed) { m_bitfields.setScr ollAnchorDisablingStyleChanged(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
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_scrollAnchorDisablingStyleChanged(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
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 // Whether changes in this LayoutObject's CSS properties since the last layout should
1884 // suppress any adjustments that would be made during the next layout by ScrollAnchor
1885 // objects for which this LayoutObject is on the path from the anchor no de to the
1886 // scroller. See http://bit.ly/sanaclap for more info.
1887 ADD_BOOLEAN_BITFIELD(scrollAnchorDisablingStyleChanged, ScrollAnchorDisa blingStyleChanged);
1888
1879 ADD_BOOLEAN_BITFIELD(hasBoxDecorationBackground, HasBoxDecorationBackgro und); 1889 ADD_BOOLEAN_BITFIELD(hasBoxDecorationBackground, HasBoxDecorationBackgro und);
1880 1890
1881 private: 1891 private:
1882 // This is the cached 'position' value of this object 1892 // This is the cached 'position' value of this object
1883 // (see ComputedStyle::position). 1893 // (see ComputedStyle::position).
1884 unsigned m_positionedState : 2; // PositionedState 1894 unsigned m_positionedState : 2; // PositionedState
1885 unsigned m_selectionState : 3; // SelectionState 1895 unsigned m_selectionState : 3; // SelectionState
1886 // Mutable for getter which lazily update this field. 1896 // Mutable for getter which lazily update this field.
1887 mutable unsigned m_backgroundObscurationState : 2; // BackgroundObscurat ionState 1897 mutable unsigned m_backgroundObscurationState : 2; // BackgroundObscurat ionState
1888 unsigned m_fullPaintInvalidationReason : 5; // PaintInvalidationReason 1898 unsigned m_fullPaintInvalidationReason : 5; // PaintInvalidationReason
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 setSelfNeedsLayout(false); 2041 setSelfNeedsLayout(false);
2032 setPosChildNeedsLayout(false); 2042 setPosChildNeedsLayout(false);
2033 setNeedsSimplifiedNormalFlowLayout(false); 2043 setNeedsSimplifiedNormalFlowLayout(false);
2034 setNormalChildNeedsLayout(false); 2044 setNormalChildNeedsLayout(false);
2035 setNeedsPositionedMovementLayout(false); 2045 setNeedsPositionedMovementLayout(false);
2036 setAncestorLineBoxDirty(false); 2046 setAncestorLineBoxDirty(false);
2037 2047
2038 #if ENABLE(ASSERT) 2048 #if ENABLE(ASSERT)
2039 checkBlockPositionedObjectsNeedLayout(); 2049 checkBlockPositionedObjectsNeedLayout();
2040 #endif 2050 #endif
2051
2052 setScrollAnchorDisablingStyleChanged(false);
2041 } 2053 }
2042 2054
2043 inline void LayoutObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr eeLayoutScope* layouter) 2055 inline void LayoutObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr eeLayoutScope* layouter)
2044 { 2056 {
2045 ASSERT(!isSetNeedsLayoutForbidden()); 2057 ASSERT(!isSetNeedsLayoutForbidden());
2046 bool alreadyNeededLayout = normalChildNeedsLayout(); 2058 bool alreadyNeededLayout = normalChildNeedsLayout();
2047 setNormalChildNeedsLayout(true); 2059 setNormalChildNeedsLayout(true);
2048 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem ove the MarkingBehavior argument entirely. 2060 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem ove the MarkingBehavior argument entirely.
2049 if (!alreadyNeededLayout && markParents == MarkContainerChain && (!layouter || layouter->root() != this)) 2061 if (!alreadyNeededLayout && markParents == MarkContainerChain && (!layouter || layouter->root() != this))
2050 markContainerChainForLayout(!layouter, layouter); 2062 markContainerChainForLayout(!layouter, layouter);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 void showTree(const blink::LayoutObject*); 2169 void showTree(const blink::LayoutObject*);
2158 void showLineTree(const blink::LayoutObject*); 2170 void showLineTree(const blink::LayoutObject*);
2159 void showLayoutTree(const blink::LayoutObject* object1); 2171 void showLayoutTree(const blink::LayoutObject* object1);
2160 // We don't make object2 an optional parameter so that showLayoutTree 2172 // We don't make object2 an optional parameter so that showLayoutTree
2161 // can be called from gdb easily. 2173 // can be called from gdb easily.
2162 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 2174 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
2163 2175
2164 #endif 2176 #endif
2165 2177
2166 #endif // LayoutObject_h 2178 #endif // LayoutObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698