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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 | 81 |
| 82 enum HitTestFilter { | 82 enum HitTestFilter { |
| 83 HitTestAll, | 83 HitTestAll, |
| 84 HitTestSelf, | 84 HitTestSelf, |
| 85 HitTestDescendants | 85 HitTestDescendants |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 enum MarkingBehavior { | 88 enum MarkingBehavior { |
| 89 MarkOnlyThis, | 89 MarkOnlyThis, |
| 90 MarkContainerChain, | 90 MarkContainerChain, |
| 91 MarkContainerChainInLayout, | |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 enum MapCoordinatesMode { | 94 enum MapCoordinatesMode { |
| 94 IsFixed = 1 << 0, | 95 IsFixed = 1 << 0, |
| 95 UseTransforms = 1 << 1, | 96 UseTransforms = 1 << 1, |
| 96 ApplyContainerFlip = 1 << 2, | 97 ApplyContainerFlip = 1 << 2, |
| 97 TraverseDocumentBoundaries = 1 << 3, | 98 TraverseDocumentBoundaries = 1 << 3, |
| 98 | 99 |
| 99 // Applies to LayoutView::mapLocalToAncestor() and LayoutView::mapToVisualRe ctInAncestorSpace() | 100 // Applies to LayoutView::mapLocalToAncestor() and LayoutView::mapToVisualRe ctInAncestorSpace() |
| 100 // only, to indicate the input point or rect is in frame coordinates instead of frame contents | 101 // only, to indicate the input point or rect is in frame coordinates instead of frame contents |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 803 LayoutObject* container(const LayoutBoxModelObject* ancestor = nullptr, bool * ancestorSkipped = nullptr) const; | 804 LayoutObject* container(const LayoutBoxModelObject* ancestor = nullptr, bool * ancestorSkipped = nullptr) const; |
| 804 // Finds the container as if this object is fixed-position. | 805 // Finds the container as if this object is fixed-position. |
| 805 LayoutBlock* containerForFixedPosition(const LayoutBoxModelObject* ancestor = nullptr, bool* ancestorSkipped = nullptr) const; | 806 LayoutBlock* containerForFixedPosition(const LayoutBoxModelObject* ancestor = nullptr, bool* ancestorSkipped = nullptr) const; |
| 806 // Finds the containing block as if this object is absolute-position. | 807 // Finds the containing block as if this object is absolute-position. |
| 807 LayoutBlock* containingBlockForAbsolutePosition() const; | 808 LayoutBlock* containingBlockForAbsolutePosition() const; |
| 808 | 809 |
| 809 virtual LayoutObject* hoverAncestor() const { return parent(); } | 810 virtual LayoutObject* hoverAncestor() const { return parent(); } |
| 810 | 811 |
| 811 Element* offsetParent() const; | 812 Element* offsetParent() const; |
| 812 | 813 |
| 813 void markContainerChainForLayout(bool scheduleRelayout = true); | 814 void markContainerChainForLayout(bool scheduleRelayout = true, SubtreeLayout Scope* = nullptr); |
| 814 void markContainerChainForLayout(SubtreeLayoutScope*); | |
|
cbiesinger
2016/04/18 15:53:46
Thanks, the three versions of this function have b
kojii
2016/04/19 06:39:08
Great to hear that, thought it's good before, but
| |
| 815 void setNeedsLayout(LayoutInvalidationReasonForTracing, MarkingBehavior = Ma rkContainerChain, SubtreeLayoutScope* = nullptr); | 815 void setNeedsLayout(LayoutInvalidationReasonForTracing, MarkingBehavior = Ma rkContainerChain, SubtreeLayoutScope* = nullptr); |
| 816 void setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReasonForTraci ng, MarkingBehavior = MarkContainerChain, SubtreeLayoutScope* = nullptr); | 816 void setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReasonForTraci ng, MarkingBehavior = MarkContainerChain, SubtreeLayoutScope* = nullptr); |
| 817 void clearNeedsLayout(); | 817 void clearNeedsLayout(); |
| 818 void setChildNeedsLayout(MarkingBehavior = MarkContainerChain, SubtreeLayout Scope* = nullptr); | 818 void setChildNeedsLayout(MarkingBehavior = MarkContainerChain, SubtreeLayout Scope* = nullptr); |
| 819 void setNeedsPositionedMovementLayout(); | 819 void setNeedsPositionedMovementLayout(); |
| 820 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainerChain); | 820 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainerChain); |
| 821 void clearPreferredLogicalWidthsDirty(); | 821 void clearPreferredLogicalWidthsDirty(); |
| 822 | 822 |
| 823 void setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReasonForTracing re ason) | 823 void setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReasonForTracing re ason) |
| 824 { | 824 { |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1599 | 1599 |
| 1600 void updateImage(StyleImage*, StyleImage*); | 1600 void updateImage(StyleImage*, StyleImage*); |
| 1601 | 1601 |
| 1602 void scheduleRelayout(); | 1602 void scheduleRelayout(); |
| 1603 | 1603 |
| 1604 void updateShapeImage(const ShapeValue*, const ShapeValue*); | 1604 void updateShapeImage(const ShapeValue*, const ShapeValue*); |
| 1605 void updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers ); | 1605 void updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers ); |
| 1606 | 1606 |
| 1607 void setNeedsOverflowRecalcAfterStyleChange(); | 1607 void setNeedsOverflowRecalcAfterStyleChange(); |
| 1608 | 1608 |
| 1609 void markContainerChainForLayout(bool scheduleRelayout, SubtreeLayoutScope*) ; | |
| 1610 | |
| 1611 // FIXME: This should be 'markContaingBoxChainForOverflowRecalc when we make LayoutBox | 1609 // FIXME: This should be 'markContaingBoxChainForOverflowRecalc when we make LayoutBox |
| 1612 // recomputeOverflow-capable. crbug.com/437012 and crbug.com/434700. | 1610 // recomputeOverflow-capable. crbug.com/437012 and crbug.com/434700. |
| 1613 inline void markContainingBlocksForOverflowRecalc(); | 1611 inline void markContainingBlocksForOverflowRecalc(); |
| 1614 | 1612 |
| 1615 inline void markAncestorsForPaintInvalidation(); | 1613 inline void markAncestorsForPaintInvalidation(); |
| 1616 | 1614 |
| 1617 inline void invalidateSelectionIfNeeded(const LayoutBoxModelObject& paintInv alidationContainer, const PaintInvalidationState&, PaintInvalidationReason); | 1615 inline void invalidateSelectionIfNeeded(const LayoutBoxModelObject& paintInv alidationContainer, const PaintInvalidationState&, PaintInvalidationReason); |
| 1618 | 1616 |
| 1619 inline void invalidateContainerPreferredLogicalWidths(); | 1617 inline void invalidateContainerPreferredLogicalWidths(); |
| 1620 | 1618 |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2009 ASSERT(!isSetNeedsLayoutForbidden()); | 2007 ASSERT(!isSetNeedsLayoutForbidden()); |
| 2010 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); | 2008 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); |
| 2011 setSelfNeedsLayout(true); | 2009 setSelfNeedsLayout(true); |
| 2012 if (!alreadyNeededLayout) { | 2010 if (!alreadyNeededLayout) { |
| 2013 TRACE_EVENT_INSTANT1( | 2011 TRACE_EVENT_INSTANT1( |
| 2014 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), | 2012 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), |
| 2015 "LayoutInvalidationTracking", | 2013 "LayoutInvalidationTracking", |
| 2016 TRACE_EVENT_SCOPE_THREAD, | 2014 TRACE_EVENT_SCOPE_THREAD, |
| 2017 "data", | 2015 "data", |
| 2018 InspectorLayoutInvalidationTrackingEvent::data(this, reason)); | 2016 InspectorLayoutInvalidationTrackingEvent::data(this, reason)); |
| 2019 if (markParents == MarkContainerChain && (!layouter || layouter->root() != this)) | 2017 if (markParents != MarkOnlyThis && (!layouter || layouter->root() != thi s)) |
| 2020 markContainerChainForLayout(layouter); | 2018 markContainerChainForLayout(!layouter && markParents == MarkContaine rChain, layouter); |
| 2021 } | 2019 } |
| 2022 } | 2020 } |
| 2023 | 2021 |
| 2024 inline void LayoutObject::setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidat ionReasonForTracing reason, MarkingBehavior markParents, SubtreeLayoutScope* lay outer) | 2022 inline void LayoutObject::setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidat ionReasonForTracing reason, MarkingBehavior markParents, SubtreeLayoutScope* lay outer) |
| 2025 { | 2023 { |
| 2026 setNeedsLayout(reason, markParents, layouter); | 2024 setNeedsLayout(reason, markParents, layouter); |
| 2027 setShouldDoFullPaintInvalidation(); | 2025 setShouldDoFullPaintInvalidation(); |
| 2028 } | 2026 } |
| 2029 | 2027 |
| 2030 inline void LayoutObject::clearNeedsLayout() | 2028 inline void LayoutObject::clearNeedsLayout() |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 2046 checkBlockPositionedObjectsNeedLayout(); | 2044 checkBlockPositionedObjectsNeedLayout(); |
| 2047 #endif | 2045 #endif |
| 2048 } | 2046 } |
| 2049 | 2047 |
| 2050 inline void LayoutObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr eeLayoutScope* layouter) | 2048 inline void LayoutObject::setChildNeedsLayout(MarkingBehavior markParents, Subtr eeLayoutScope* layouter) |
| 2051 { | 2049 { |
| 2052 ASSERT(!isSetNeedsLayoutForbidden()); | 2050 ASSERT(!isSetNeedsLayoutForbidden()); |
| 2053 bool alreadyNeededLayout = normalChildNeedsLayout(); | 2051 bool alreadyNeededLayout = normalChildNeedsLayout(); |
| 2054 setNormalChildNeedsLayout(true); | 2052 setNormalChildNeedsLayout(true); |
| 2055 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem ove the MarkingBehavior argument entirely. | 2053 // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and rem ove the MarkingBehavior argument entirely. |
| 2056 if (!alreadyNeededLayout && markParents == MarkContainerChain && (!layouter || layouter->root() != this)) | 2054 if (!alreadyNeededLayout && markParents != MarkOnlyThis && (!layouter || lay outer->root() != this)) |
| 2057 markContainerChainForLayout(layouter); | 2055 markContainerChainForLayout(!layouter && markParents == MarkContainerCha in, layouter); |
| 2058 } | 2056 } |
| 2059 | 2057 |
| 2060 inline void LayoutObject::setNeedsPositionedMovementLayout() | 2058 inline void LayoutObject::setNeedsPositionedMovementLayout() |
| 2061 { | 2059 { |
| 2062 bool alreadyNeededLayout = needsPositionedMovementLayout(); | 2060 bool alreadyNeededLayout = needsPositionedMovementLayout(); |
| 2063 setNeedsPositionedMovementLayout(true); | 2061 setNeedsPositionedMovementLayout(true); |
| 2064 ASSERT(!isSetNeedsLayoutForbidden()); | 2062 ASSERT(!isSetNeedsLayoutForbidden()); |
| 2065 if (!alreadyNeededLayout) | 2063 if (!alreadyNeededLayout) |
| 2066 markContainerChainForLayout(); | 2064 markContainerChainForLayout(); |
| 2067 } | 2065 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2174 void showTree(const blink::LayoutObject*); | 2172 void showTree(const blink::LayoutObject*); |
| 2175 void showLineTree(const blink::LayoutObject*); | 2173 void showLineTree(const blink::LayoutObject*); |
| 2176 void showLayoutTree(const blink::LayoutObject* object1); | 2174 void showLayoutTree(const blink::LayoutObject* object1); |
| 2177 // We don't make object2 an optional parameter so that showLayoutTree | 2175 // We don't make object2 an optional parameter so that showLayoutTree |
| 2178 // can be called from gdb easily. | 2176 // can be called from gdb easily. |
| 2179 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); | 2177 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); |
| 2180 | 2178 |
| 2181 #endif | 2179 #endif |
| 2182 | 2180 |
| 2183 #endif // LayoutObject_h | 2181 #endif // LayoutObject_h |
| OLD | NEW |