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

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

Issue 208143003: Issue trace events to gather repaint information. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 #include "core/rendering/compositing/RenderLayerCompositor.h" 75 #include "core/rendering/compositing/RenderLayerCompositor.h"
76 #include "core/rendering/style/ContentData.h" 76 #include "core/rendering/style/ContentData.h"
77 #include "core/rendering/style/CursorList.h" 77 #include "core/rendering/style/CursorList.h"
78 #include "core/rendering/style/ShadowList.h" 78 #include "core/rendering/style/ShadowList.h"
79 #include "core/rendering/svg/SVGRenderSupport.h" 79 #include "core/rendering/svg/SVGRenderSupport.h"
80 #include "platform/Partitions.h" 80 #include "platform/Partitions.h"
81 #include "platform/geometry/TransformState.h" 81 #include "platform/geometry/TransformState.h"
82 #include "platform/graphics/GraphicsContext.h" 82 #include "platform/graphics/GraphicsContext.h"
83 #include "wtf/RefCountedLeakCounter.h" 83 #include "wtf/RefCountedLeakCounter.h"
84 #include "wtf/text/StringBuilder.h" 84 #include "wtf/text/StringBuilder.h"
85 #include "wtf/text/WTFString.h"
85 #include <algorithm> 86 #include <algorithm>
86 #ifndef NDEBUG 87 #ifndef NDEBUG
87 #include <stdio.h> 88 #include <stdio.h>
88 #endif 89 #endif
89 90
90 using namespace std; 91 using namespace std;
91 92
92 namespace WebCore { 93 namespace WebCore {
93 94
94 using namespace HTMLNames; 95 using namespace HTMLNames;
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 return repaintContainer; 1359 return repaintContainer;
1359 // If we have already found a repaint container then we will repaint int o that container only if it is part of the same 1360 // If we have already found a repaint container then we will repaint int o that container only if it is part of the same
1360 // flow thread. Otherwise we will need to catch the repaint call and sen d it to the flow thread. 1361 // flow thread. Otherwise we will need to catch the repaint call and sen d it to the flow thread.
1361 RenderFlowThread* repaintContainerFlowThread = repaintContainer ? repain tContainer->flowThreadContainingBlock() : 0; 1362 RenderFlowThread* repaintContainerFlowThread = repaintContainer ? repain tContainer->flowThreadContainingBlock() : 0;
1362 if (!repaintContainerFlowThread || repaintContainerFlowThread != parentR enderFlowThread) 1363 if (!repaintContainerFlowThread || repaintContainerFlowThread != parentR enderFlowThread)
1363 repaintContainer = parentRenderFlowThread; 1364 repaintContainer = parentRenderFlowThread;
1364 } 1365 }
1365 return repaintContainer; 1366 return repaintContainer;
1366 } 1367 }
1367 1368
1368 void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintCo ntainer, const IntRect& r) const 1369 void RenderObject::repaintUsingContainer(const RenderLayerModelObject* repaintCo ntainer, const IntRect& r, InvalidationReason invalidationReason) const
1369 { 1370 {
1371 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject: :repaintUsingContainer()",
1372 "object", TRACE_STR_COPY(this->debugName().ascii().data()),
1373 "info", TRACE_STR_COPY(String::format("rect: %d,%d %dx%d, invalidation_r eason: %s",
1374 r.x(), r.y(), r.width(), r.height(), invalidationReasonToString(inva lidationReason)).ascii().data()));
1375
1370 if (!repaintContainer) { 1376 if (!repaintContainer) {
1371 view()->repaintViewRectangle(r); 1377 view()->repaintViewRectangle(r);
1372 return; 1378 return;
1373 } 1379 }
1374 1380
1375 // FIXME: Don't read compositing state here since we do this in the middle o f recalc/layout. 1381 // FIXME: Don't read compositing state here since we do this in the middle o f recalc/layout.
1376 DisableCompositingQueryAsserts disabler; 1382 DisableCompositingQueryAsserts disabler;
1377 if (repaintContainer->compositingState() == PaintsIntoGroupedBacking) { 1383 if (repaintContainer->compositingState() == PaintsIntoGroupedBacking) {
1378 ASSERT(repaintContainer->groupedMapping()); 1384 ASSERT(repaintContainer->groupedMapping());
1379 ASSERT(repaintContainer->layer()); 1385 ASSERT(repaintContainer->layer());
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 if (!isRooted(&view)) 1442 if (!isRooted(&view))
1437 return; 1443 return;
1438 1444
1439 if (view->document().printing()) 1445 if (view->document().printing())
1440 return; // Don't repaint if we're printing. 1446 return; // Don't repaint if we're printing.
1441 1447
1442 // FIXME: really, we're in the repaint phase here, and the following queries are legal. 1448 // FIXME: really, we're in the repaint phase here, and the following queries are legal.
1443 // Until those states are fully fledged, I'll just disable the ASSERTS. 1449 // Until those states are fully fledged, I'll just disable the ASSERTS.
1444 DisableCompositingQueryAsserts disabler; 1450 DisableCompositingQueryAsserts disabler;
1445 RenderLayerModelObject* repaintContainer = containerForRepaint(); 1451 RenderLayerModelObject* repaintContainer = containerForRepaint();
1446 repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnapp edIntRect(clippedOverflowRectForRepaint(repaintContainer))); 1452 repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnapp edIntRect(clippedOverflowRectForRepaint(repaintContainer)), InvalidationRepaint) ;
1447 } 1453 }
1448 1454
1449 void RenderObject::repaintRectangle(const LayoutRect& r) const 1455 void RenderObject::repaintRectangle(const LayoutRect& r) const
1450 { 1456 {
1451 // Don't repaint if we're unrooted (note that view() still returns the view when unrooted) 1457 // Don't repaint if we're unrooted (note that view() still returns the view when unrooted)
1452 RenderView* view; 1458 RenderView* view;
1453 if (!isRooted(&view)) 1459 if (!isRooted(&view))
1454 return; 1460 return;
1455 1461
1456 if (view->document().printing()) 1462 if (view->document().printing())
1457 return; // Don't repaint if we're printing. 1463 return; // Don't repaint if we're printing.
1458 1464
1459 LayoutRect dirtyRect(r); 1465 LayoutRect dirtyRect(r);
1460 1466
1461 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) { 1467 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) {
1462 // FIXME: layoutDelta needs to be applied in parts before/after transfor ms and 1468 // FIXME: layoutDelta needs to be applied in parts before/after transfor ms and
1463 // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 1469 // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
1464 dirtyRect.move(view->layoutDelta()); 1470 dirtyRect.move(view->layoutDelta());
1465 } 1471 }
1466 1472
1467 RenderLayerModelObject* repaintContainer = containerForRepaint(); 1473 RenderLayerModelObject* repaintContainer = containerForRepaint();
1468 computeRectForRepaint(repaintContainer, dirtyRect); 1474 computeRectForRepaint(repaintContainer, dirtyRect);
1469 repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnapp edIntRect(dirtyRect)); 1475 repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnapp edIntRect(dirtyRect), InvalidationRepaintRectangle);
1470 } 1476 }
1471 1477
1472 IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const 1478 IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const
1473 { 1479 {
1474 return pixelSnappedIntRect(absoluteClippedOverflowRect()); 1480 return pixelSnappedIntRect(absoluteClippedOverflowRect());
1475 } 1481 }
1476 1482
1483 const char* RenderObject::invalidationReasonToString(const InvalidationReason re ason) const
Julien - ping for review 2014/03/31 20:11:04 No need for |const| InvalidationReason as it's pas
dsinclair 2014/03/31 20:22:10 Done.
1484 {
1485 switch (reason) {
1486 case InvalidationIncremental:
1487 return "incremental";
1488 case InvalidationSelfLayout:
1489 return "self layout";
1490 case InvalidationBorderFitLines:
1491 return "border fit lines";
1492 case InvalidationBorderRadius:
1493 return "border radius";
1494 case InvalidationBoundsChangeWithBackground:
1495 return "bounds change with background";
1496 case InvalidationBoundsChange:
1497 return "bounds change";
1498 case InvalidationScroll:
1499 return "scroll";
1500 case InvalidationSelection:
1501 return "selection";
1502 case InvalidationLayer:
1503 return "layer";
1504 case InvalidationRepaint:
1505 return "repaint";
1506 case InvalidationRepaintRectangle:
1507 return "repaint rectangle";
1508 default:
1509 ASSERT_NOT_REACHED();
Julien - ping for review 2014/03/31 20:11:04 FYI, I would remove the 'default' argument as it p
dsinclair 2014/03/31 20:22:10 Done.
1510 }
1511 }
1512
1477 bool RenderObject::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repa intContainer, bool wasSelfLayout, 1513 bool RenderObject::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repa intContainer, bool wasSelfLayout,
1478 const LayoutRect& oldBounds, const LayoutRect* newBoundsPtr) 1514 const LayoutRect& oldBounds, const LayoutRect* newBoundsPtr)
1479 { 1515 {
1480 RenderView* v = view(); 1516 RenderView* v = view();
1481 if (v->document().printing()) 1517 if (v->document().printing())
1482 return false; // Don't repaint if we're printing. 1518 return false; // Don't repaint if we're printing.
1483 1519
1484 // This ASSERT fails due to animations. See https://bugs.webkit.org/show_bu g.cgi?id=37048 1520 // This ASSERT fails due to animations. See https://bugs.webkit.org/show_bu g.cgi?id=37048
1485 // ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(re paintContainer)); 1521 // ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(re paintContainer));
1486 LayoutRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectFor Repaint(repaintContainer); 1522 LayoutRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectFor Repaint(repaintContainer);
1487 1523
1488 bool fullRepaint = wasSelfLayout; 1524 InvalidationReason invalidationReason = wasSelfLayout ? InvalidationSelfLayo ut : InvalidationIncremental;
1525
1489 // Presumably a background or a border exists if border-fit:lines was specif ied. 1526 // Presumably a background or a border exists if border-fit:lines was specif ied.
1490 if (!fullRepaint && style()->borderFit() == BorderFitLines) 1527 if (invalidationReason == InvalidationIncremental && style()->borderFit() == BorderFitLines)
1491 fullRepaint = true; 1528 invalidationReason = InvalidationBorderFitLines;
1492 if (!fullRepaint && style()->hasBorderRadius()) { 1529
1530 if (invalidationReason == InvalidationIncremental&& style()->hasBorderRadius ()) {
Julien - ping for review 2014/03/31 20:11:04 Missing space before &&.
dsinclair 2014/03/31 20:22:10 Done.
1493 // If a border-radius exists and width/height is smaller than 1531 // If a border-radius exists and width/height is smaller than
1494 // radius width/height, we cannot use delta-repaint. 1532 // radius width/height, we cannot use delta-repaint.
1495 RoundedRect oldRoundedRect = style()->getRoundedBorderFor(oldBounds); 1533 RoundedRect oldRoundedRect = style()->getRoundedBorderFor(oldBounds);
1496 RoundedRect newRoundedRect = style()->getRoundedBorderFor(newBounds); 1534 RoundedRect newRoundedRect = style()->getRoundedBorderFor(newBounds);
1497 fullRepaint = oldRoundedRect.radii() != newRoundedRect.radii(); 1535 if (oldRoundedRect.radii() != newRoundedRect.radii())
1536 invalidationReason = InvalidationBorderRadius;
1498 } 1537 }
1499 1538
1500 if (!fullRepaint && (mustRepaintBackgroundOrBorder() && (newBounds != oldBou nds))) 1539 if (invalidationReason == InvalidationIncremental && (mustRepaintBackgroundO rBorder() && (newBounds != oldBounds)))
1501 fullRepaint = true; 1540 invalidationReason = InvalidationBoundsChangeWithBackground;
1502 1541
1503 // If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could 1542 // If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could
1504 // be caused by some layout property (left / top) or some in-flow renderer i nserted / removed before us in the tree. 1543 // be caused by some layout property (left / top) or some in-flow renderer i nserted / removed before us in the tree.
1505 if (!fullRepaint && newBounds.location() != oldBounds.location()) 1544 if (invalidationReason == InvalidationIncremental && newBounds.location() != oldBounds.location())
1506 fullRepaint = true; 1545 invalidationReason = InvalidationBoundsChange;
1507 1546
1508 if (!repaintContainer) 1547 if (!repaintContainer)
1509 repaintContainer = v; 1548 repaintContainer = v;
1510 1549
1511 if (fullRepaint) { 1550 if (invalidationReason != InvalidationIncremental) {
1512 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds)); 1551 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds), invalidationReason);
1513 if (newBounds != oldBounds) 1552 if (newBounds != oldBounds)
1514 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBound s)); 1553 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBound s), invalidationReason);
1515 return true; 1554 return true;
1516 } 1555 }
1517 1556
1518 if (oldBounds == newBounds) 1557 if (oldBounds == newBounds)
1519 return false; 1558 return false;
1520 1559
1521 LayoutUnit deltaLeft = newBounds.x() - oldBounds.x(); 1560 LayoutUnit deltaLeft = newBounds.x() - oldBounds.x();
1522 if (deltaLeft > 0) 1561 if (deltaLeft > 0)
1523 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), oldBounds.y(), deltaLeft, oldBounds.height())); 1562 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), oldBounds.y(), deltaLeft, oldBounds.height()), invalidationReason);
1524 else if (deltaLeft < 0) 1563 else if (deltaLeft < 0)
1525 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), newBounds.y(), -deltaLeft, newBounds.height())); 1564 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), newBounds.y(), -deltaLeft, newBounds.height()), invalidationReason);
1526 1565
1527 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); 1566 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX();
1528 if (deltaRight > 0) 1567 if (deltaRight > 0)
1529 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.ma xX(), newBounds.y(), deltaRight, newBounds.height())); 1568 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.ma xX(), newBounds.y(), deltaRight, newBounds.height()), invalidationReason);
1530 else if (deltaRight < 0) 1569 else if (deltaRight < 0)
1531 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.ma xX(), oldBounds.y(), -deltaRight, oldBounds.height())); 1570 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.ma xX(), oldBounds.y(), -deltaRight, oldBounds.height()), invalidationReason);
1532 1571
1533 LayoutUnit deltaTop = newBounds.y() - oldBounds.y(); 1572 LayoutUnit deltaTop = newBounds.y() - oldBounds.y();
1534 if (deltaTop > 0) 1573 if (deltaTop > 0)
1535 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), oldBounds.y(), oldBounds.width(), deltaTop)); 1574 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), oldBounds.y(), oldBounds.width(), deltaTop), invalidationReason);
1536 else if (deltaTop < 0) 1575 else if (deltaTop < 0)
1537 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), newBounds.y(), newBounds.width(), -deltaTop)); 1576 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), newBounds.y(), newBounds.width(), -deltaTop), invalidationReason);
1538 1577
1539 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY(); 1578 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY();
1540 if (deltaBottom > 0) 1579 if (deltaBottom > 0)
1541 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), oldBounds.maxY(), newBounds.width(), deltaBottom)); 1580 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), oldBounds.maxY(), newBounds.width(), deltaBottom), invalidationReason);
1542 else if (deltaBottom < 0) 1581 else if (deltaBottom < 0)
1543 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), newBounds.maxY(), oldBounds.width(), -deltaBottom)); 1582 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), newBounds.maxY(), oldBounds.width(), -deltaBottom), invalidationReason);
1544 1583
1545 // FIXME: This is a limitation of our visual overflow being a single rectang le. 1584 // FIXME: This is a limitation of our visual overflow being a single rectang le.
1546 if (!style()->boxShadow() && !style()->hasBorderImageOutsets() && !style()-> hasOutline()) 1585 if (!style()->boxShadow() && !style()->hasBorderImageOutsets() && !style()-> hasOutline())
1547 return false; 1586 return false;
1548 1587
1549 // We didn't move, but we did change size. Invalidate the delta, which will consist of possibly 1588 // We didn't move, but we did change size. Invalidate the delta, which will consist of possibly
1550 // two rectangles (but typically only one). 1589 // two rectangles (but typically only one).
1551 RenderStyle* outlineStyle = outlineStyleForRepaint(); 1590 RenderStyle* outlineStyle = outlineStyleForRepaint();
1552 LayoutUnit outlineWidth = outlineStyle->outlineSize(); 1591 LayoutUnit outlineWidth = outlineStyle->outlineSize();
1553 LayoutBoxExtent insetShadowExtent = style()->getBoxShadowInsetExtent(); 1592 LayoutBoxExtent insetShadowExtent = style()->getBoxShadowInsetExtent();
1554 LayoutUnit width = absoluteValue(newBounds.width() - oldBounds.width()); 1593 LayoutUnit width = absoluteValue(newBounds.width() - oldBounds.width());
1555 if (width) { 1594 if (width) {
1556 LayoutUnit shadowLeft; 1595 LayoutUnit shadowLeft;
1557 LayoutUnit shadowRight; 1596 LayoutUnit shadowRight;
1558 style()->getBoxShadowHorizontalExtent(shadowLeft, shadowRight); 1597 style()->getBoxShadowHorizontalExtent(shadowLeft, shadowRight);
1559 int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0; 1598 int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0;
1560 LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit( ); 1599 LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit( );
1561 LayoutUnit minInsetRightShadowExtent = min<LayoutUnit>(-insetShadowExten t.right(), min<LayoutUnit>(newBounds.width(), oldBounds.width())); 1600 LayoutUnit minInsetRightShadowExtent = min<LayoutUnit>(-insetShadowExten t.right(), min<LayoutUnit>(newBounds.width(), oldBounds.width()));
1562 LayoutUnit borderWidth = max<LayoutUnit>(borderRight, max<LayoutUnit>(va lueForLength(style()->borderTopRightRadius().width(), boxWidth), valueForLength( style()->borderBottomRightRadius().width(), boxWidth))); 1601 LayoutUnit borderWidth = max<LayoutUnit>(borderRight, max<LayoutUnit>(va lueForLength(style()->borderTopRightRadius().width(), boxWidth), valueForLength( style()->borderBottomRightRadius().width(), boxWidth)));
1563 LayoutUnit decorationsLeftWidth = max<LayoutUnit>(-outlineStyle->outline Offset(), borderWidth + minInsetRightShadowExtent) + max<LayoutUnit>(outlineWidt h, -shadowLeft); 1602 LayoutUnit decorationsLeftWidth = max<LayoutUnit>(-outlineStyle->outline Offset(), borderWidth + minInsetRightShadowExtent) + max<LayoutUnit>(outlineWidt h, -shadowLeft);
1564 LayoutUnit decorationsRightWidth = max<LayoutUnit>(-outlineStyle->outlin eOffset(), borderWidth + minInsetRightShadowExtent) + max<LayoutUnit>(outlineWid th, shadowRight); 1603 LayoutUnit decorationsRightWidth = max<LayoutUnit>(-outlineStyle->outlin eOffset(), borderWidth + minInsetRightShadowExtent) + max<LayoutUnit>(outlineWid th, shadowRight);
1565 LayoutRect rightRect(newBounds.x() + min(newBounds.width(), oldBounds.wi dth()) - decorationsLeftWidth, 1604 LayoutRect rightRect(newBounds.x() + min(newBounds.width(), oldBounds.wi dth()) - decorationsLeftWidth,
1566 newBounds.y(), 1605 newBounds.y(),
1567 width + decorationsLeftWidth + decorationsRightWidth, 1606 width + decorationsLeftWidth + decorationsRightWidth,
1568 max(newBounds.height(), oldBounds.height())); 1607 max(newBounds.height(), oldBounds.height()));
1569 LayoutUnit right = min<LayoutUnit>(newBounds.maxX(), oldBounds.maxX()); 1608 LayoutUnit right = min<LayoutUnit>(newBounds.maxX(), oldBounds.maxX());
1570 if (rightRect.x() < right) { 1609 if (rightRect.x() < right) {
1571 rightRect.setWidth(min(rightRect.width(), right - rightRect.x())); 1610 rightRect.setWidth(min(rightRect.width(), right - rightRect.x()));
1572 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(rightRec t)); 1611 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(rightRec t), invalidationReason);
1573 } 1612 }
1574 } 1613 }
1575 LayoutUnit height = absoluteValue(newBounds.height() - oldBounds.height()); 1614 LayoutUnit height = absoluteValue(newBounds.height() - oldBounds.height());
1576 if (height) { 1615 if (height) {
1577 LayoutUnit shadowTop; 1616 LayoutUnit shadowTop;
1578 LayoutUnit shadowBottom; 1617 LayoutUnit shadowBottom;
1579 style()->getBoxShadowVerticalExtent(shadowTop, shadowBottom); 1618 style()->getBoxShadowVerticalExtent(shadowTop, shadowBottom);
1580 int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0; 1619 int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0;
1581 LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUni t(); 1620 LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUni t();
1582 LayoutUnit minInsetBottomShadowExtent = min<LayoutUnit>(-insetShadowExte nt.bottom(), min<LayoutUnit>(newBounds.height(), oldBounds.height())); 1621 LayoutUnit minInsetBottomShadowExtent = min<LayoutUnit>(-insetShadowExte nt.bottom(), min<LayoutUnit>(newBounds.height(), oldBounds.height()));
1583 LayoutUnit borderHeight = max<LayoutUnit>(borderBottom, max<LayoutUnit>( valueForLength(style()->borderBottomLeftRadius().height(), boxHeight), valueForL ength(style()->borderBottomRightRadius().height(), boxHeight))); 1622 LayoutUnit borderHeight = max<LayoutUnit>(borderBottom, max<LayoutUnit>( valueForLength(style()->borderBottomLeftRadius().height(), boxHeight), valueForL ength(style()->borderBottomRightRadius().height(), boxHeight)));
1584 LayoutUnit decorationsTopHeight = max<LayoutUnit>(-outlineStyle->outline Offset(), borderHeight + minInsetBottomShadowExtent) + max<LayoutUnit>(outlineWi dth, -shadowTop); 1623 LayoutUnit decorationsTopHeight = max<LayoutUnit>(-outlineStyle->outline Offset(), borderHeight + minInsetBottomShadowExtent) + max<LayoutUnit>(outlineWi dth, -shadowTop);
1585 LayoutUnit decorationsBottomHeight = max<LayoutUnit>(-outlineStyle->outl ineOffset(), borderHeight + minInsetBottomShadowExtent) + max<LayoutUnit>(outlin eWidth, shadowBottom); 1624 LayoutUnit decorationsBottomHeight = max<LayoutUnit>(-outlineStyle->outl ineOffset(), borderHeight + minInsetBottomShadowExtent) + max<LayoutUnit>(outlin eWidth, shadowBottom);
1586 LayoutRect bottomRect(newBounds.x(), 1625 LayoutRect bottomRect(newBounds.x(),
1587 min(newBounds.maxY(), oldBounds.maxY()) - decorationsTopHeight, 1626 min(newBounds.maxY(), oldBounds.maxY()) - decorationsTopHeight,
1588 max(newBounds.width(), oldBounds.width()), 1627 max(newBounds.width(), oldBounds.width()),
1589 height + decorationsTopHeight + decorationsBottomHeight); 1628 height + decorationsTopHeight + decorationsBottomHeight);
1590 LayoutUnit bottom = min(newBounds.maxY(), oldBounds.maxY()); 1629 LayoutUnit bottom = min(newBounds.maxY(), oldBounds.maxY());
1591 if (bottomRect.y() < bottom) { 1630 if (bottomRect.y() < bottom) {
1592 bottomRect.setHeight(min(bottomRect.height(), bottom - bottomRect.y( ))); 1631 bottomRect.setHeight(min(bottomRect.height(), bottom - bottomRect.y( )));
1593 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(bottomRe ct)); 1632 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(bottomRe ct), invalidationReason);
1594 } 1633 }
1595 } 1634 }
1596 return false; 1635 return false;
1597 } 1636 }
1598 1637
1599 void RenderObject::repaintOverflow() 1638 void RenderObject::repaintOverflow()
1600 { 1639 {
1601 } 1640 }
1602 1641
1603 void RenderObject::repaintOverflowIfNeeded() 1642 void RenderObject::repaintOverflowIfNeeded()
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
3329 { 3368 {
3330 if (object1) { 3369 if (object1) {
3331 const WebCore::RenderObject* root = object1; 3370 const WebCore::RenderObject* root = object1;
3332 while (root->parent()) 3371 while (root->parent())
3333 root = root->parent(); 3372 root = root->parent();
3334 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3373 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3335 } 3374 }
3336 } 3375 }
3337 3376
3338 #endif 3377 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698