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

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

Issue 2019583002: Don't include scroll offset in offsetFromLayoutObject for scrolling contents layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() 405 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()
406 && previousPaintInvalidationRect != this->previousPaintInvalidationRect( ) 406 && previousPaintInvalidationRect != this->previousPaintInvalidationRect( )
407 && !usesCompositedScrolling() 407 && !usesCompositedScrolling()
408 && hasOverflowClip()) 408 && hasOverflowClip())
409 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon tainer(); 409 newPaintInvalidationState.setForceSubtreeInvalidationRectUpdateWithinCon tainer();
410 410
411 newPaintInvalidationState.updateForChildren(reason); 411 newPaintInvalidationState.updateForChildren(reason);
412 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); 412 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState);
413 } 413 }
414 414
415 static bool compositedScrollsWithRespectTo(const LayoutObject* layoutObject, con st LayoutBoxModelObject& paintInvalidationContainer)
416 {
417 return paintInvalidationContainer.usesCompositedScrolling() && layoutObject != &paintInvalidationContainer;
418 }
419
415 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r, PaintInvalidationReason invalidationReason, const LayoutObject& object) c onst 420 void LayoutBoxModelObject::setBackingNeedsPaintInvalidationInRect(const LayoutRe ct& r, PaintInvalidationReason invalidationReason, const LayoutObject& object) c onst
416 { 421 {
417 // TODO(wangxianzhu): Enable the following assert after paint invalidation f or spv2 is ready. 422 // TODO(wangxianzhu): Enable the following assert after paint invalidation f or spv2 is ready.
418 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 423 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
419 424
420 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here, 425 // https://bugs.webkit.org/show_bug.cgi?id=61159 describes an unreproducible crash here,
421 // so assert but check that the layer is composited. 426 // so assert but check that the layer is composited.
422 ASSERT(compositingState() != NotComposited); 427 ASSERT(compositingState() != NotComposited);
423 428
424 // FIXME: generalize accessors to backing GraphicsLayers so that this code i s squashing-agnostic. 429 // FIXME: generalize accessors to backing GraphicsLayers so that this code i s squashing-agnostic.
425 if (layer()->groupedMapping()) { 430 if (layer()->groupedMapping()) {
426 LayoutRect paintInvalidationRect = r; 431 LayoutRect paintInvalidationRect = r;
427 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) { 432 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) {
428 // Note: the subpixel accumulation of layer() does not need to be ad ded here. It is already taken into account. 433 // Note: the subpixel accumulation of layer() does not need to be ad ded here. It is already taken into account.
429 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(paintInvalida tionRect), invalidationReason, object); 434 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(paintInvalida tionRect), invalidationReason, object);
430 } 435 }
436 } else if (compositedScrollsWithRespectTo(&object, *this)) {
437 layer()->compositedLayerMapping()->setScrollingContentsNeedDisplayInRect (r, invalidationReason, object);
431 } else { 438 } else {
439 // TODO(chrishtr): we should be able to skip scrolling content layers in this case.
432 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason, object); 440 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason, object);
433 } 441 }
434 } 442 }
435 443
436 void LayoutBoxModelObject::invalidateDisplayItemClientOnBacking(const DisplayIte mClient& displayItemClient, PaintInvalidationReason invalidationReason) const 444 void LayoutBoxModelObject::invalidateDisplayItemClientOnBacking(const DisplayIte mClient& displayItemClient, PaintInvalidationReason invalidationReason, const La youtObject* layoutObject) const
437 { 445 {
438 displayItemClient.setDisplayItemsUncached(); 446 displayItemClient.setDisplayItemsUncached();
439 447
440 // We need to inform the GraphicsLayer about this paint invalidation only wh en we are tracking 448 // We need to inform the GraphicsLayer about this paint invalidation only wh en we are tracking
441 // paint invalidation or ENABLE(ASSERT). 449 // paint invalidation or ENABLE(ASSERT).
442 #if !ENABLE(ASSERT) 450 #if !ENABLE(ASSERT)
443 if (!frameView()->isTrackingPaintInvalidations()) 451 if (!frameView()->isTrackingPaintInvalidations())
444 return; 452 return;
445 #endif 453 #endif
446 454
447 if (layer()->groupedMapping()) { 455 if (layer()->groupedMapping()) {
448 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) 456 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer())
449 squashingLayer->displayItemClientWasInvalidated(displayItemClient, i nvalidationReason); 457 squashingLayer->displayItemClientWasInvalidated(displayItemClient, i nvalidationReason);
450 } else if (CompositedLayerMapping* compositedLayerMapping = layer()->composi tedLayerMapping()) { 458 } else if (CompositedLayerMapping* compositedLayerMapping = layer()->composi tedLayerMapping()) {
451 compositedLayerMapping->displayItemClientWasInvalidated(displayItemClien t, invalidationReason); 459 if (compositedScrollsWithRespectTo(layoutObject, *this))
460 compositedLayerMapping->scrollingDisplayItemClientWasInvalidated(dis playItemClient, invalidationReason);
461 else
462 compositedLayerMapping->displayItemClientWasInvalidated(displayItemC lient, invalidationReason);
452 } 463 }
453 } 464 }
454 465
455 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const 466 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const
456 { 467 {
457 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { 468 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) {
458 // Outlines of out-of-flow positioned descendants are handled in LayoutB lock::addOutlineRects(). 469 // Outlines of out-of-flow positioned descendants are handled in LayoutB lock::addOutlineRects().
459 if (child->isOutOfFlowPositioned()) 470 if (child->isOutOfFlowPositioned())
460 continue; 471 continue;
461 472
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 if (rootElementStyle->hasBackground()) 1129 if (rootElementStyle->hasBackground())
1119 return false; 1130 return false;
1120 1131
1121 if (node() != document().firstBodyElement()) 1132 if (node() != document().firstBodyElement())
1122 return false; 1133 return false;
1123 1134
1124 return true; 1135 return true;
1125 } 1136 }
1126 1137
1127 } // namespace blink 1138 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698