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

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 571643002: Enforce that invalidations happen on a rooted tree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 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) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 bool RenderObject::hadPaintInvalidation() const 1433 bool RenderObject::hadPaintInvalidation() const
1434 { 1434 {
1435 if (!firstPaintInvalidationTrackingEnabled()) 1435 if (!firstPaintInvalidationTrackingEnabled())
1436 return true; 1436 return true;
1437 1437
1438 return !renderObjectNeverHadPaintInvalidationSet().contains(this); 1438 return !renderObjectNeverHadPaintInvalidationSet().contains(this);
1439 } 1439 }
1440 1440
1441 const RenderLayerModelObject* RenderObject::containerForPaintInvalidation() cons t 1441 const RenderLayerModelObject* RenderObject::containerForPaintInvalidation() cons t
1442 { 1442 {
1443 if (!isRooted()) 1443 RELEASE_ASSERT(isRooted());
1444 return 0;
1445
1446 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta iner()); 1444 return adjustCompositedContainerForSpecialAncestors(enclosingCompositedConta iner());
1447 } 1445 }
1448 1446
1449 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const 1447 const RenderLayerModelObject* RenderObject::enclosingCompositedContainer() const
1450 { 1448 {
1451 RenderLayerModelObject* container = 0; 1449 RenderLayerModelObject* container = 0;
1452 // FIXME: CompositingState is not necessarily up to date for many callers of this function. 1450 // FIXME: CompositingState is not necessarily up to date for many callers of this function.
1453 DisableCompositingQueryAsserts disabler; 1451 DisableCompositingQueryAsserts disabler;
1454 1452
1455 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForPaint InvalidationCrossingFrameBoundaries()) 1453 if (RenderLayer* compositingLayer = enclosingLayer()->enclosingLayerForPaint InvalidationCrossingFrameBoundaries())
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 LayoutRect RenderObject::computePaintInvalidationRect(const RenderLayerModelObje ct* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationS tate) const 1512 LayoutRect RenderObject::computePaintInvalidationRect(const RenderLayerModelObje ct* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationS tate) const
1515 { 1513 {
1516 return clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, p aintInvalidationState); 1514 return clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, p aintInvalidationState);
1517 } 1515 }
1518 1516
1519 void RenderObject::invalidatePaintUsingContainer(const RenderLayerModelObject* p aintInvalidationContainer, const LayoutRect& r, InvalidationReason invalidationR eason) const 1517 void RenderObject::invalidatePaintUsingContainer(const RenderLayerModelObject* p aintInvalidationContainer, const LayoutRect& r, InvalidationReason invalidationR eason) const
1520 { 1518 {
1521 if (r.isEmpty()) 1519 if (r.isEmpty())
1522 return; 1520 return;
1523 1521
1524 // FIXME: This should be an assert, but editing/selection can trigger this c ase to invalidate 1522 RELEASE_ASSERT(isRooted());
1525 // the selection. crbug.com/368140.
1526 if (!isRooted())
1527 return;
1528 1523
1529 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject: :invalidatePaintUsingContainer()", 1524 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject: :invalidatePaintUsingContainer()",
1530 "object", this->debugName().ascii(), 1525 "object", this->debugName().ascii(),
1531 "info", jsonObjectForPaintInvalidationInfo(r, invalidationReasonToString (invalidationReason))); 1526 "info", jsonObjectForPaintInvalidationInfo(r, invalidationReasonToString (invalidationReason)));
1532 1527
1533 if (paintInvalidationContainer->isRenderFlowThread()) { 1528 if (paintInvalidationContainer->isRenderFlowThread()) {
1534 toRenderFlowThread(paintInvalidationContainer)->paintInvalidationRectang leInRegions(r); 1529 toRenderFlowThread(paintInvalidationContainer)->paintInvalidationRectang leInRegions(r);
1535 return; 1530 return;
1536 } 1531 }
1537 1532
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 1565
1571 LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelOb ject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidatio nState) const 1566 LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelOb ject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidatio nState) const
1572 { 1567 {
1573 if (!paintInvalidationContainer) 1568 if (!paintInvalidationContainer)
1574 return computePaintInvalidationRect(paintInvalidationContainer, paintInv alidationState); 1569 return computePaintInvalidationRect(paintInvalidationContainer, paintInv alidationState);
1575 return RenderLayer::computePaintInvalidationRect(this, paintInvalidationCont ainer->layer(), paintInvalidationState); 1570 return RenderLayer::computePaintInvalidationRect(this, paintInvalidationCont ainer->layer(), paintInvalidationState);
1576 } 1571 }
1577 1572
1578 void RenderObject::invalidatePaintRectangle(const LayoutRect& r) const 1573 void RenderObject::invalidatePaintRectangle(const LayoutRect& r) const
1579 { 1574 {
1580 if (!isRooted()) 1575 RELEASE_ASSERT(isRooted());
1581 return;
1582 1576
1583 if (view()->document().printing()) 1577 if (view()->document().printing())
1584 return; // Don't invalidate paints if we're printing. 1578 return; // Don't invalidate paints if we're printing.
1585 1579
1586 LayoutRect dirtyRect(r); 1580 LayoutRect dirtyRect(r);
1587 1581
1588 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint Invalidation(); 1582 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint Invalidation();
1589 RenderLayer::mapRectToPaintInvalidationBacking(this, paintInvalidationContai ner, dirtyRect); 1583 RenderLayer::mapRectToPaintInvalidationBacking(this, paintInvalidationContai ner, dirtyRect);
1590 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRect, Invalid ationPaintRectangle); 1584 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRect, Invalid ationPaintRectangle);
1591 } 1585 }
(...skipping 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after
3495 { 3489 {
3496 if (object1) { 3490 if (object1) {
3497 const blink::RenderObject* root = object1; 3491 const blink::RenderObject* root = object1;
3498 while (root->parent()) 3492 while (root->parent())
3499 root = root->parent(); 3493 root = root->parent();
3500 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3494 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3501 } 3495 }
3502 } 3496 }
3503 3497
3504 #endif 3498 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698