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 15 matching lines...) Expand all Loading... | |
| 26 #ifndef RenderObject_h | 26 #ifndef RenderObject_h |
| 27 #define RenderObject_h | 27 #define RenderObject_h |
| 28 | 28 |
| 29 #include "core/dom/Document.h" | 29 #include "core/dom/Document.h" |
| 30 #include "core/dom/DocumentLifecycle.h" | 30 #include "core/dom/DocumentLifecycle.h" |
| 31 #include "core/dom/Element.h" | 31 #include "core/dom/Element.h" |
| 32 #include "core/editing/TextAffinity.h" | 32 #include "core/editing/TextAffinity.h" |
| 33 #include "core/fetch/ImageResourceClient.h" | 33 #include "core/fetch/ImageResourceClient.h" |
| 34 #include "core/html/HTMLElement.h" | 34 #include "core/html/HTMLElement.h" |
| 35 #include "core/rendering/HitTestRequest.h" | 35 #include "core/rendering/HitTestRequest.h" |
| 36 #include "core/rendering/PaintInvalidationState.h" | |
| 36 #include "core/rendering/PaintPhase.h" | 37 #include "core/rendering/PaintPhase.h" |
| 37 #include "core/rendering/RenderObjectChildList.h" | 38 #include "core/rendering/RenderObjectChildList.h" |
| 38 #include "core/rendering/ScrollAlignment.h" | 39 #include "core/rendering/ScrollAlignment.h" |
| 39 #include "core/rendering/SubtreeLayoutScope.h" | 40 #include "core/rendering/SubtreeLayoutScope.h" |
| 40 #include "core/rendering/compositing/CompositingState.h" | 41 #include "core/rendering/compositing/CompositingState.h" |
| 41 #include "core/rendering/compositing/CompositingTriggers.h" | 42 #include "core/rendering/compositing/CompositingTriggers.h" |
| 42 #include "core/rendering/style/RenderStyle.h" | 43 #include "core/rendering/style/RenderStyle.h" |
| 43 #include "core/rendering/style/StyleInheritedData.h" | 44 #include "core/rendering/style/StyleInheritedData.h" |
| 44 #include "platform/geometry/FloatQuad.h" | 45 #include "platform/geometry/FloatQuad.h" |
| 45 #include "platform/geometry/LayoutRect.h" | 46 #include "platform/geometry/LayoutRect.h" |
| 46 #include "platform/graphics/CompositingReasons.h" | 47 #include "platform/graphics/CompositingReasons.h" |
| 47 #include "platform/transforms/TransformationMatrix.h" | 48 #include "platform/transforms/TransformationMatrix.h" |
| 48 | 49 |
| 49 namespace blink { | 50 namespace blink { |
| 50 | 51 |
| 51 class AffineTransform; | 52 class AffineTransform; |
| 52 class Cursor; | 53 class Cursor; |
| 53 class Document; | 54 class Document; |
| 54 class HitTestLocation; | 55 class HitTestLocation; |
| 55 class HitTestResult; | 56 class HitTestResult; |
| 56 class InlineBox; | 57 class InlineBox; |
| 57 class InlineFlowBox; | 58 class InlineFlowBox; |
| 58 class PaintInvalidationState; | |
| 59 class Position; | 59 class Position; |
| 60 class PositionWithAffinity; | 60 class PositionWithAffinity; |
| 61 class PseudoStyleRequest; | 61 class PseudoStyleRequest; |
| 62 class RenderBoxModelObject; | 62 class RenderBoxModelObject; |
| 63 class RenderBlock; | 63 class RenderBlock; |
| 64 class RenderFlowThread; | 64 class RenderFlowThread; |
| 65 class RenderGeometryMap; | 65 class RenderGeometryMap; |
| 66 class RenderLayer; | 66 class RenderLayer; |
| 67 class RenderLayerModelObject; | 67 class RenderLayerModelObject; |
| 68 class RenderView; | 68 class RenderView; |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1029 { | 1029 { |
| 1030 m_bitfields.setShouldDoFullPaintInvalidationIfSelfPaintingLayer(b); | 1030 m_bitfields.setShouldDoFullPaintInvalidationIfSelfPaintingLayer(b); |
| 1031 | 1031 |
| 1032 if (b) | 1032 if (b) |
| 1033 markContainingBlockChainForPaintInvalidation(); | 1033 markContainingBlockChainForPaintInvalidation(); |
| 1034 } | 1034 } |
| 1035 | 1035 |
| 1036 bool onlyNeededPositionedMovementLayout() const { return m_bitfields.onlyNee dedPositionedMovementLayout(); } | 1036 bool onlyNeededPositionedMovementLayout() const { return m_bitfields.onlyNee dedPositionedMovementLayout(); } |
| 1037 void setOnlyNeededPositionedMovementLayout(bool b) { m_bitfields.setOnlyNeed edPositionedMovementLayout(b); } | 1037 void setOnlyNeededPositionedMovementLayout(bool b) { m_bitfields.setOnlyNeed edPositionedMovementLayout(b); } |
| 1038 | 1038 |
| 1039 void clearPaintInvalidationState(); | 1039 void clearPaintInvalidationState(const PaintInvalidationState&); |
| 1040 | 1040 |
| 1041 // layoutDidGetCalled indicates whether this render object was re-laid-out | 1041 // layoutDidGetCalled indicates whether this render object was re-laid-out |
| 1042 // since the last call to setLayoutDidGetCalled(false) on this object. | 1042 // since the last call to setLayoutDidGetCalled(false) on this object. |
| 1043 bool layoutDidGetCalled() const { return m_bitfields.layoutDidGetCalled(); } | 1043 bool layoutDidGetCalled() const { return m_bitfields.layoutDidGetCalled(); } |
| 1044 void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); } | 1044 void setLayoutDidGetCalled(bool b) { m_bitfields.setLayoutDidGetCalled(b); } |
| 1045 | 1045 |
| 1046 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); } | 1046 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval idation(); } |
| 1047 void setMayNeedPaintInvalidation(bool b) | 1047 void setMayNeedPaintInvalidation(bool b) |
| 1048 { | 1048 { |
| 1049 m_bitfields.setMayNeedPaintInvalidation(b); | 1049 m_bitfields.setMayNeedPaintInvalidation(b); |
| 1050 | 1050 |
| 1051 // Make sure our parent is marked as needing invalidation. | 1051 // Make sure our parent is marked as needing invalidation. |
| 1052 if (b) | 1052 if (b) |
| 1053 markContainingBlockChainForPaintInvalidation(); | 1053 markContainingBlockChainForPaintInvalidation(); |
| 1054 } | 1054 } |
| 1055 | 1055 |
| 1056 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout BecauseOfChildren(); } | 1056 bool neededLayoutBecauseOfChildren() const { return m_bitfields.neededLayout BecauseOfChildren(); } |
| 1057 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB ecauseOfChildren(b); } | 1057 void setNeededLayoutBecauseOfChildren(bool b) { m_bitfields.setNeededLayoutB ecauseOfChildren(b); } |
| 1058 | 1058 |
| 1059 bool shouldCheckForPaintInvalidation() | 1059 bool shouldCheckForPaintInvalidation(const PaintInvalidationState& paintInva lidationState) |
| 1060 { | 1060 { |
| 1061 return layoutDidGetCalled() || mayNeedPaintInvalidation() || shouldDoFul lPaintInvalidation() || shouldDoFullPaintInvalidationIfSelfPaintingLayer(); | 1061 return paintInvalidationState.forceCheckForPaintInvalidation() || layout DidGetCalled() || mayNeedPaintInvalidation() || shouldDoFullPaintInvalidation() || shouldDoFullPaintInvalidationIfSelfPaintingLayer(); |
| 1062 } | 1062 } |
| 1063 | 1063 |
| 1064 bool supportsLayoutStateCachedOffsets() const { return !hasColumns() && !has Transform() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); } | 1064 bool supportsLayoutStateCachedOffsets() const { return !hasColumns() && !has Transform() && !hasReflection() && !style()->isFlippedBlocksWritingMode(); } |
| 1065 | 1065 |
| 1066 void setNeedsOverflowRecalcAfterStyleChange(); | 1066 void setNeedsOverflowRecalcAfterStyleChange(); |
| 1067 void markContainingBlocksForOverflowRecalc(); | 1067 void markContainingBlocksForOverflowRecalc(); |
| 1068 | 1068 |
| 1069 protected: | 1069 protected: |
| 1070 inline bool layerCreationAllowedForSubtree() const; | 1070 inline bool layerCreationAllowedForSubtree() const; |
| 1071 | 1071 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1148 bool paintInvalidationStateIsDirty() const | 1148 bool paintInvalidationStateIsDirty() const |
| 1149 { | 1149 { |
| 1150 return layoutDidGetCalled() || shouldDoFullPaintInvalidation() || should DoFullPaintInvalidationIfSelfPaintingLayer() | 1150 return layoutDidGetCalled() || shouldDoFullPaintInvalidation() || should DoFullPaintInvalidationIfSelfPaintingLayer() |
| 1151 || onlyNeededPositionedMovementLayout() || neededLayoutBecauseOfChil dren() || mayNeedPaintInvalidation(); | 1151 || onlyNeededPositionedMovementLayout() || neededLayoutBecauseOfChil dren() || mayNeedPaintInvalidation(); |
| 1152 } | 1152 } |
| 1153 #endif | 1153 #endif |
| 1154 const char* invalidationReasonToString(InvalidationReason) const; | 1154 const char* invalidationReasonToString(InvalidationReason) const; |
| 1155 | 1155 |
| 1156 void markContainingBlockChainForPaintInvalidation() | 1156 void markContainingBlockChainForPaintInvalidation() |
| 1157 { | 1157 { |
| 1158 for (RenderObject* container = this->container(); container && !containe r->shouldCheckForPaintInvalidation(); container = container->container()) | 1158 for (RenderObject* container = this->container(); container && !containe r->mayNeedPaintInvalidation() && !container->layoutDidGetCalled(); container = c ontainer->container()) |
|
Julien - ping for review
2014/08/01 21:20:01
Won't this make us over-mark as we used to break e
abarth-chromium
2014/08/01 21:22:52
Sure. I'll undo this part of the change. The dow
| |
| 1159 container->setMayNeedPaintInvalidation(true); | 1159 container->setMayNeedPaintInvalidation(true); |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 static bool isAllowedToModifyRenderTreeStructure(Document&); | 1162 static bool isAllowedToModifyRenderTreeStructure(Document&); |
| 1163 | 1163 |
| 1164 RefPtr<RenderStyle> m_style; | 1164 RefPtr<RenderStyle> m_style; |
| 1165 | 1165 |
| 1166 Node* m_node; | 1166 Node* m_node; |
| 1167 | 1167 |
| 1168 RenderObject* m_parent; | 1168 RenderObject* m_parent; |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1532 void showTree(const blink::RenderObject*); | 1532 void showTree(const blink::RenderObject*); |
| 1533 void showLineTree(const blink::RenderObject*); | 1533 void showLineTree(const blink::RenderObject*); |
| 1534 void showRenderTree(const blink::RenderObject* object1); | 1534 void showRenderTree(const blink::RenderObject* object1); |
| 1535 // We don't make object2 an optional parameter so that showRenderTree | 1535 // We don't make object2 an optional parameter so that showRenderTree |
| 1536 // can be called from gdb easily. | 1536 // can be called from gdb easily. |
| 1537 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2); | 1537 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2); |
| 1538 | 1538 |
| 1539 #endif | 1539 #endif |
| 1540 | 1540 |
| 1541 #endif // RenderObject_h | 1541 #endif // RenderObject_h |
| OLD | NEW |