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

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

Issue 2501833002: Fix bug of animated table col/section/row background (Closed)
Patch Set: - Created 4 years, 1 month 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. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 // Painters can use const methods only, except for these explicitly declared 1669 // Painters can use const methods only, except for these explicitly declared
1670 // methods. 1670 // methods.
1671 class MutableForPainting { 1671 class MutableForPainting {
1672 public: 1672 public:
1673 void clearPaintInvalidationFlags() { 1673 void clearPaintInvalidationFlags() {
1674 m_layoutObject.clearPaintInvalidationFlags(); 1674 m_layoutObject.clearPaintInvalidationFlags();
1675 } 1675 }
1676 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) { 1676 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) {
1677 m_layoutObject.setShouldDoFullPaintInvalidation(reason); 1677 m_layoutObject.setShouldDoFullPaintInvalidation(reason);
1678 } 1678 }
1679 void setBackgroundChangedSinceLastPaintInvalidation() {
1680 m_layoutObject.setBackgroundChangedSinceLastPaintInvalidation();
1681 }
1679 void ensureIsReadyForPaintInvalidation() { 1682 void ensureIsReadyForPaintInvalidation() {
1680 m_layoutObject.ensureIsReadyForPaintInvalidation(); 1683 m_layoutObject.ensureIsReadyForPaintInvalidation();
1681 } 1684 }
1682 1685
1683 void setPreviousVisualRect(const LayoutRect& r) { 1686 void setPreviousVisualRect(const LayoutRect& r) {
1684 m_layoutObject.setPreviousVisualRect(r); 1687 m_layoutObject.setPreviousVisualRect(r);
1685 } 1688 }
1686 void setPreviousPaintOffset(const LayoutPoint& p) { 1689 void setPreviousPaintOffset(const LayoutPoint& p) {
1687 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); 1690 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
1688 m_layoutObject.m_previousPaintOffset = p; 1691 m_layoutObject.m_previousPaintOffset = p;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
1785 bool hasPreviousLocationInBacking() const { 1788 bool hasPreviousLocationInBacking() const {
1786 return m_bitfields.hasPreviousLocationInBacking(); 1789 return m_bitfields.hasPreviousLocationInBacking();
1787 } 1790 }
1788 bool hasPreviousSelectionVisualRect() const { 1791 bool hasPreviousSelectionVisualRect() const {
1789 return m_bitfields.hasPreviousSelectionVisualRect(); 1792 return m_bitfields.hasPreviousSelectionVisualRect();
1790 } 1793 }
1791 bool hasPreviousBoxGeometries() const { 1794 bool hasPreviousBoxGeometries() const {
1792 return m_bitfields.hasPreviousBoxGeometries(); 1795 return m_bitfields.hasPreviousBoxGeometries();
1793 } 1796 }
1794 1797
1798 bool backgroundChangedSinceLastPaintInvalidation() const {
1799 return m_bitfields.backgroundChangedSinceLastPaintInvalidation();
1800 }
1801 void setBackgroundChangedSinceLastPaintInvalidation() {
1802 m_bitfields.setBackgroundChangedSinceLastPaintInvalidation(true);
1803 }
1804
1795 protected: 1805 protected:
1796 enum LayoutObjectType { 1806 enum LayoutObjectType {
1797 LayoutObjectBr, 1807 LayoutObjectBr,
1798 LayoutObjectCanvas, 1808 LayoutObjectCanvas,
1799 LayoutObjectFieldset, 1809 LayoutObjectFieldset,
1800 LayoutObjectCounter, 1810 LayoutObjectCounter,
1801 LayoutObjectDetailsMarker, 1811 LayoutObjectDetailsMarker,
1802 LayoutObjectEmbeddedObject, 1812 LayoutObjectEmbeddedObject,
1803 LayoutObjectFileUploadControl, 1813 LayoutObjectFileUploadControl,
1804 LayoutObjectFrame, 1814 LayoutObjectFrame,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1918 // Add hit-test rects for this layoutObject only to the provided list. 1928 // Add hit-test rects for this layoutObject only to the provided list.
1919 // layerOffset is the offset of this layoutObject within the current layer 1929 // layerOffset is the offset of this layoutObject within the current layer
1920 // that should be used for each result. 1930 // that should be used for each result.
1921 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, 1931 virtual void computeSelfHitTestRects(Vector<LayoutRect>&,
1922 const LayoutPoint& layerOffset) const {} 1932 const LayoutPoint& layerOffset) const {}
1923 1933
1924 void setPreviousVisualRect(const LayoutRect& rect) { 1934 void setPreviousVisualRect(const LayoutRect& rect) {
1925 m_previousVisualRect = rect; 1935 m_previousVisualRect = rect;
1926 } 1936 }
1927 1937
1928 #if ENABLE(ASSERT) 1938 #if DCHECK_IS_ON()
1929 virtual bool paintInvalidationStateIsDirty() const { 1939 virtual bool paintInvalidationStateIsDirty() const {
1930 return shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState(); 1940 return backgroundChangedSinceLastPaintInvalidation() ||
1941 shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
1931 } 1942 }
1932 #endif 1943 #endif
1933 1944
1934 // Called before paint invalidation. 1945 // Called before paint invalidation.
1935 virtual void ensureIsReadyForPaintInvalidation() { DCHECK(!needsLayout()); } 1946 virtual void ensureIsReadyForPaintInvalidation() { DCHECK(!needsLayout()); }
1936 1947
1937 // This function walks the descendants of |this|, following a 1948 // This function walks the descendants of |this|, following a
1938 // layout ordering. 1949 // layout ordering.
1939 // 1950 //
1940 // The ordering is important for PaintInvalidationState, as it requires to be 1951 // The ordering is important for PaintInvalidationState, as it requires to be
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
2128 m_alwaysCreateLineBoxesForLayoutInline(false), 2139 m_alwaysCreateLineBoxesForLayoutInline(false),
2129 m_previousBackgroundObscured(false), 2140 m_previousBackgroundObscured(false),
2130 m_isBackgroundAttachmentFixedObject(false), 2141 m_isBackgroundAttachmentFixedObject(false),
2131 m_isScrollAnchorObject(false), 2142 m_isScrollAnchorObject(false),
2132 m_scrollAnchorDisablingStyleChanged(false), 2143 m_scrollAnchorDisablingStyleChanged(false),
2133 m_hasBoxDecorationBackground(false), 2144 m_hasBoxDecorationBackground(false),
2134 m_hasPreviousLocationInBacking(false), 2145 m_hasPreviousLocationInBacking(false),
2135 m_hasPreviousSelectionVisualRect(false), 2146 m_hasPreviousSelectionVisualRect(false),
2136 m_hasPreviousBoxGeometries(false), 2147 m_hasPreviousBoxGeometries(false),
2137 m_needsPaintPropertyUpdate(true), 2148 m_needsPaintPropertyUpdate(true),
2149 m_backgroundChangedSinceLastPaintInvalidation(false),
2138 m_positionedState(IsStaticallyPositioned), 2150 m_positionedState(IsStaticallyPositioned),
2139 m_selectionState(SelectionNone), 2151 m_selectionState(SelectionNone),
2140 m_backgroundObscurationState(BackgroundObscurationStatusInvalid), 2152 m_backgroundObscurationState(BackgroundObscurationStatusInvalid),
2141 m_fullPaintInvalidationReason(PaintInvalidationNone) {} 2153 m_fullPaintInvalidationReason(PaintInvalidationNone) {}
2142 2154
2143 // Self needs layout means that this layout object is marked for a full 2155 // Self needs layout means that this layout object is marked for a full
2144 // layout. This is the default layout but it is expensive as it recomputes 2156 // layout. This is the default layout but it is expensive as it recomputes
2145 // everything. For CSS boxes, this includes the width (laying out the line 2157 // everything. For CSS boxes, this includes the width (laying out the line
2146 // boxes again), the margins (due to block collapsing margins), the 2158 // boxes again), the margins (due to block collapsing margins), the
2147 // positions, the height and the potential overflow. 2159 // positions, the height and the potential overflow.
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2300 ADD_BOOLEAN_BITFIELD(hasPreviousLocationInBacking, 2312 ADD_BOOLEAN_BITFIELD(hasPreviousLocationInBacking,
2301 HasPreviousLocationInBacking); 2313 HasPreviousLocationInBacking);
2302 ADD_BOOLEAN_BITFIELD(hasPreviousSelectionVisualRect, 2314 ADD_BOOLEAN_BITFIELD(hasPreviousSelectionVisualRect,
2303 HasPreviousSelectionVisualRect); 2315 HasPreviousSelectionVisualRect);
2304 ADD_BOOLEAN_BITFIELD(hasPreviousBoxGeometries, HasPreviousBoxGeometries); 2316 ADD_BOOLEAN_BITFIELD(hasPreviousBoxGeometries, HasPreviousBoxGeometries);
2305 2317
2306 // Whether the paint properties need to be updated. For more details, see 2318 // Whether the paint properties need to be updated. For more details, see
2307 // LayoutObject::needsPaintPropertyUpdate(). 2319 // LayoutObject::needsPaintPropertyUpdate().
2308 ADD_BOOLEAN_BITFIELD(needsPaintPropertyUpdate, NeedsPaintPropertyUpdate); 2320 ADD_BOOLEAN_BITFIELD(needsPaintPropertyUpdate, NeedsPaintPropertyUpdate);
2309 2321
2322 ADD_BOOLEAN_BITFIELD(backgroundChangedSinceLastPaintInvalidation,
2323 BackgroundChangedSinceLastPaintInvalidation);
2324
2310 protected: 2325 protected:
2311 // Use protected to avoid warning about unused variable. 2326 // Use protected to avoid warning about unused variable.
2312 unsigned m_unusedBits : 9; 2327 unsigned m_unusedBits : 8;
2313 2328
2314 private: 2329 private:
2315 // This is the cached 'position' value of this object 2330 // This is the cached 'position' value of this object
2316 // (see ComputedStyle::position). 2331 // (see ComputedStyle::position).
2317 unsigned m_positionedState : 2; // PositionedState 2332 unsigned m_positionedState : 2; // PositionedState
2318 unsigned m_selectionState : 3; // SelectionState 2333 unsigned m_selectionState : 3; // SelectionState
2319 // Mutable for getter which lazily update this field. 2334 // Mutable for getter which lazily update this field.
2320 mutable unsigned 2335 mutable unsigned
2321 m_backgroundObscurationState : 2; // BackgroundObscurationState 2336 m_backgroundObscurationState : 2; // BackgroundObscurationState
2322 unsigned m_fullPaintInvalidationReason : 5; // PaintInvalidationReason 2337 unsigned m_fullPaintInvalidationReason : 5; // PaintInvalidationReason
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
2627 CORE_EXPORT void showLineTree(const blink::LayoutObject*); 2642 CORE_EXPORT void showLineTree(const blink::LayoutObject*);
2628 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); 2643 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1);
2629 // We don't make object2 an optional parameter so that showLayoutTree 2644 // We don't make object2 an optional parameter so that showLayoutTree
2630 // can be called from gdb easily. 2645 // can be called from gdb easily.
2631 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, 2646 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1,
2632 const blink::LayoutObject* object2); 2647 const blink::LayoutObject* object2);
2633 2648
2634 #endif 2649 #endif
2635 2650
2636 #endif // LayoutObject_h 2651 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698