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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintInvalidator.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/paint/PaintInvalidator.h" 5 #include "core/paint/PaintInvalidator.h"
6 6
7 #include "core/editing/FrameSelection.h" 7 #include "core/editing/FrameSelection.h"
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 if (context.paintInvalidationContainer->layer()->groupedMapping()) 193 if (context.paintInvalidationContainer->layer()->groupedMapping())
194 PaintLayer::mapPointInPaintInvalidationContainerToBacking( 194 PaintLayer::mapPointInPaintInvalidationContainerToBacking(
195 *context.paintInvalidationContainer, point); 195 *context.paintInvalidationContainer, point);
196 196
197 return LayoutPoint(point); 197 return LayoutPoint(point);
198 } 198 }
199 199
200 void PaintInvalidator::updatePaintingLayer(const LayoutObject& object, 200 void PaintInvalidator::updatePaintingLayer(const LayoutObject& object,
201 PaintInvalidatorContext& context) { 201 PaintInvalidatorContext& context) {
202 if (object.hasLayer() && 202 if (object.hasLayer() &&
203 toLayoutBoxModelObject(object).hasSelfPaintingLayer()) 203 toLayoutBoxModelObject(object).hasSelfPaintingLayer()) {
204 context.paintingLayer = toLayoutBoxModelObject(object).layer(); 204 context.paintingLayer = toLayoutBoxModelObject(object).layer();
205 } else if (object.isFloating() && !object.parent()->isLayoutBlock()) {
206 // See LayoutObject::paintingLayer() for specialty of floating objects.
207 context.paintingLayer = object.paintingLayer();
208 }
205 209
206 if (object.isLayoutBlockFlow() && toLayoutBlockFlow(object).containsFloats()) 210 if (object.isLayoutBlockFlow() && toLayoutBlockFlow(object).containsFloats())
207 context.paintingLayer->setNeedsPaintPhaseFloat(); 211 context.paintingLayer->setNeedsPaintPhaseFloat();
208 212
209 if (object == context.paintingLayer->layoutObject()) 213 if (object == context.paintingLayer->layoutObject())
210 return; 214 return;
211 215
212 if (object.styleRef().hasOutline()) 216 if (object.styleRef().hasOutline())
213 context.paintingLayer->setNeedsPaintPhaseDescendantOutlines(); 217 context.paintingLayer->setNeedsPaintPhaseDescendantOutlines();
214 218
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // paintInvalidationContainerForStackedContents is only for stacked 280 // paintInvalidationContainerForStackedContents is only for stacked
277 // descendants in its own frame, because it doesn't establish stacking 281 // descendants in its own frame, because it doesn't establish stacking
278 // context for stacked contents in sub-frames. 282 // context for stacked contents in sub-frames.
279 // Contents stacked in the root stacking context in this frame should use 283 // Contents stacked in the root stacking context in this frame should use
280 // this frame's paintInvalidationContainer. 284 // this frame's paintInvalidationContainer.
281 context.paintInvalidationContainerForStackedContents = 285 context.paintInvalidationContainerForStackedContents =
282 context.paintInvalidationContainer; 286 context.paintInvalidationContainer;
283 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) 287 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled())
284 undoFrameViewContentClipAndScroll.emplace( 288 undoFrameViewContentClipAndScroll.emplace(
285 *toLayoutView(object).frameView(), context); 289 *toLayoutView(object).frameView(), context);
290 } else if (object.isFloating() && !object.parent()->isLayoutBlock()) {
291 // See LayoutObject::paintingLayer() for specialty of floating objects.
292 context.paintInvalidationContainer =
293 &object.containerForPaintInvalidation();
286 } else if (object.styleRef().isStacked() && 294 } else if (object.styleRef().isStacked() &&
287 // This is to exclude some objects (e.g. LayoutText) inheriting 295 // This is to exclude some objects (e.g. LayoutText) inheriting
288 // stacked style from parent but aren't actually stacked. 296 // stacked style from parent but aren't actually stacked.
289 object.hasLayer() && 297 object.hasLayer() &&
290 context.paintInvalidationContainer != 298 context.paintInvalidationContainer !=
291 context.paintInvalidationContainerForStackedContents) { 299 context.paintInvalidationContainerForStackedContents) {
292 // The current object is stacked, so we should use 300 // The current object is stacked, so we should use
293 // m_paintInvalidationContainerForStackedContents as its paint invalidation 301 // m_paintInvalidationContainerForStackedContents as its paint invalidation
294 // container on which the current object is painted. 302 // container on which the current object is painted.
295 context.paintInvalidationContainer = 303 context.paintInvalidationContainer =
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; 450 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate;
443 } 451 }
444 452
445 void PaintInvalidator::processPendingDelayedPaintInvalidations() { 453 void PaintInvalidator::processPendingDelayedPaintInvalidations() {
446 for (auto target : m_pendingDelayedPaintInvalidations) 454 for (auto target : m_pendingDelayedPaintInvalidations)
447 target->getMutableForPainting().setShouldDoFullPaintInvalidation( 455 target->getMutableForPainting().setShouldDoFullPaintInvalidation(
448 PaintInvalidationDelayedFull); 456 PaintInvalidationDelayedFull);
449 } 457 }
450 458
451 } // namespace blink 459 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698