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

Side by Side Diff: third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp

Issue 2575423003: Fix geometry mapping issues for float under inline (Closed)
Patch Set: SVG floating Created 3 years, 11 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/PaintInvalidationState.h" 5 #include "core/layout/PaintInvalidationState.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 m_paintInvalidationContainer(parentState.m_paintInvalidationContainer), 91 m_paintInvalidationContainer(parentState.m_paintInvalidationContainer),
92 m_paintInvalidationContainerForStackedContents( 92 m_paintInvalidationContainerForStackedContents(
93 parentState.m_paintInvalidationContainerForStackedContents), 93 parentState.m_paintInvalidationContainerForStackedContents),
94 m_containerForAbsolutePosition( 94 m_containerForAbsolutePosition(
95 currentObject.canContainAbsolutePositionObjects() 95 currentObject.canContainAbsolutePositionObjects()
96 ? currentObject 96 ? currentObject
97 : parentState.m_containerForAbsolutePosition), 97 : parentState.m_containerForAbsolutePosition),
98 m_svgTransform(parentState.m_svgTransform), 98 m_svgTransform(parentState.m_svgTransform),
99 m_pendingDelayedPaintInvalidations( 99 m_pendingDelayedPaintInvalidations(
100 parentState.m_pendingDelayedPaintInvalidations), 100 parentState.m_pendingDelayedPaintInvalidations),
101 m_paintingLayer( 101 m_paintingLayer(parentState.childPaintingLayer(currentObject))
102 currentObject.hasLayer() &&
103 toLayoutBoxModelObject(currentObject).hasSelfPaintingLayer()
104 ? *toLayoutBoxModelObject(currentObject).layer()
105 : parentState.m_paintingLayer)
106 #if ENABLE(ASSERT) 102 #if ENABLE(ASSERT)
107 , 103 ,
108 m_didUpdateForChildren(false) 104 m_didUpdateForChildren(false)
109 #endif 105 #endif
110 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY 106 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY
111 , 107 ,
112 m_canCheckFastPathSlowPathEquality( 108 m_canCheckFastPathSlowPathEquality(
113 parentState.m_canCheckFastPathSlowPathEquality) 109 parentState.m_canCheckFastPathSlowPathEquality)
114 #endif 110 #endif
115 { 111 {
(...skipping 22 matching lines...) Expand all
138 m_paintInvalidationContainerForStackedContents = 134 m_paintInvalidationContainerForStackedContents =
139 toLayoutBoxModelObject(&currentObject); 135 toLayoutBoxModelObject(&currentObject);
140 } else if (currentObject.isLayoutView()) { 136 } else if (currentObject.isLayoutView()) {
141 // m_paintInvalidationContainerForStackedContents is only for stacked 137 // m_paintInvalidationContainerForStackedContents is only for stacked
142 // descendants in its own frame, because it doesn't establish stacking 138 // descendants in its own frame, because it doesn't establish stacking
143 // context for stacked contents in sub-frames. Contents stacked in the root 139 // context for stacked contents in sub-frames. Contents stacked in the root
144 // stacking context in this frame should use this frame's 140 // stacking context in this frame should use this frame's
145 // paintInvalidationContainer. 141 // paintInvalidationContainer.
146 m_paintInvalidationContainerForStackedContents = 142 m_paintInvalidationContainerForStackedContents =
147 m_paintInvalidationContainer; 143 m_paintInvalidationContainer;
144 } else if (currentObject.isFloating() &&
145 !currentObject.parent()->isLayoutBlock()) {
146 // See LayoutObject::paintingLayer() for specialty of floating objects.
147 m_paintInvalidationContainer =
148 &currentObject.containerForPaintInvalidation();
149 m_cachedOffsetsEnabled = false;
148 } else if (currentObject.styleRef().isStacked() && 150 } else if (currentObject.styleRef().isStacked() &&
149 // This is to exclude some objects (e.g. LayoutText) inheriting 151 // This is to exclude some objects (e.g. LayoutText) inheriting
150 // stacked style from parent but aren't actually stacked. 152 // stacked style from parent but aren't actually stacked.
151 currentObject.hasLayer() && 153 currentObject.hasLayer() &&
152 m_paintInvalidationContainer != 154 m_paintInvalidationContainer !=
153 m_paintInvalidationContainerForStackedContents) { 155 m_paintInvalidationContainerForStackedContents) {
154 // The current object is stacked, so we should use 156 // The current object is stacked, so we should use
155 // m_paintInvalidationContainerForStackedContents as its paint invalidation 157 // m_paintInvalidationContainerForStackedContents as its paint invalidation
156 // container on which the current object is painted. 158 // container on which the current object is painted.
157 m_paintInvalidationContainer = 159 m_paintInvalidationContainer =
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 m_paintOffset = LayoutSize(); 225 m_paintOffset = LayoutSize();
224 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY 226 #ifdef CHECK_FAST_PATH_SLOW_PATH_EQUALITY
225 m_canCheckFastPathSlowPathEquality = true; 227 m_canCheckFastPathSlowPathEquality = true;
226 #endif 228 #endif
227 return; 229 return;
228 } 230 }
229 231
230 updateForCurrentObject(parentState); 232 updateForCurrentObject(parentState);
231 } 233 }
232 234
235 PaintLayer& PaintInvalidationState::childPaintingLayer(
236 const LayoutObject& child) const {
237 if (child.hasLayer() && toLayoutBoxModelObject(child).hasSelfPaintingLayer())
238 return *toLayoutBoxModelObject(child).layer();
239 // See LayoutObject::paintingLayer() for specialty of floating objects.
240 if (child.isFloating() && !m_currentObject.isLayoutBlock())
241 return *child.paintingLayer();
242 return m_paintingLayer;
243 }
244
233 void PaintInvalidationState::updateForCurrentObject( 245 void PaintInvalidationState::updateForCurrentObject(
234 const PaintInvalidationState& parentState) { 246 const PaintInvalidationState& parentState) {
235 if (!m_cachedOffsetsEnabled) 247 if (!m_cachedOffsetsEnabled)
236 return; 248 return;
237 249
238 if (m_currentObject.isLayoutView()) { 250 if (m_currentObject.isLayoutView()) {
239 DCHECK(&parentState.m_currentObject == 251 DCHECK(&parentState.m_currentObject ==
240 LayoutAPIShim::layoutObjectFrom( 252 LayoutAPIShim::layoutObjectFrom(
241 toLayoutView(m_currentObject).frame()->ownerLayoutItem())); 253 toLayoutView(m_currentObject).frame()->ownerLayoutItem()));
242 m_paintOffset += 254 m_paintOffset +=
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 } 640 }
629 641
630 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking( 642 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking(
631 const LayoutObject& object, 643 const LayoutObject& object,
632 LayoutRect& rect) const { 644 LayoutRect& rect) const {
633 DCHECK(&object == &m_paintInvalidationState.currentObject()); 645 DCHECK(&object == &m_paintInvalidationState.currentObject());
634 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); 646 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect);
635 } 647 }
636 648
637 } // namespace blink 649 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698