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

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

Issue 210043008: Kill outlineBox (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 computeRectForRepaint(repaintContainer, dirtyRect); 1478 computeRectForRepaint(repaintContainer, dirtyRect);
1479 repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnapp edIntRect(dirtyRect)); 1479 repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnapp edIntRect(dirtyRect));
1480 } 1480 }
1481 1481
1482 IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const 1482 IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const
1483 { 1483 {
1484 return pixelSnappedIntRect(absoluteClippedOverflowRect()); 1484 return pixelSnappedIntRect(absoluteClippedOverflowRect());
1485 } 1485 }
1486 1486
1487 bool RenderObject::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repa intContainer, bool wasSelfLayout, 1487 bool RenderObject::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* repa intContainer, bool wasSelfLayout,
1488 const LayoutRect& oldBounds, const LayoutRect& oldOutlineBox, 1488 const LayoutRect& oldBounds, const LayoutRect* newBoundsPtr)
1489 const LayoutRect* newBoundsPtr, const LayoutRect* newOutlineBoxRectPtr)
1490 { 1489 {
1491 RenderView* v = view(); 1490 RenderView* v = view();
1492 if (v->document().printing()) 1491 if (v->document().printing())
1493 return false; // Don't repaint if we're printing. 1492 return false; // Don't repaint if we're printing.
1494 1493
1495 // This ASSERT fails due to animations. See https://bugs.webkit.org/show_bu g.cgi?id=37048 1494 // This ASSERT fails due to animations. See https://bugs.webkit.org/show_bu g.cgi?id=37048
1496 // ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(re paintContainer)); 1495 // ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(re paintContainer));
1497 LayoutRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectFor Repaint(repaintContainer); 1496 LayoutRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectFor Repaint(repaintContainer);
1498 LayoutRect newOutlineBox;
1499 1497
1500 bool fullRepaint = wasSelfLayout; 1498 bool fullRepaint = wasSelfLayout;
1501 // Presumably a background or a border exists if border-fit:lines was specif ied. 1499 // Presumably a background or a border exists if border-fit:lines was specif ied.
1502 if (!fullRepaint && style()->borderFit() == BorderFitLines) 1500 if (!fullRepaint && style()->borderFit() == BorderFitLines)
1503 fullRepaint = true; 1501 fullRepaint = true;
1504 if (!fullRepaint && style()->hasBorderRadius()) { 1502 if (!fullRepaint && style()->hasBorderRadius()) {
1505 // If a border-radius exists and width/height is smaller than 1503 // If a border-radius exists and width/height is smaller than
1506 // radius width/height, we cannot use delta-repaint. 1504 // radius width/height, we cannot use delta-repaint.
1507 RoundedRect oldRoundedRect = style()->getRoundedBorderFor(oldBounds); 1505 RoundedRect oldRoundedRect = style()->getRoundedBorderFor(oldBounds);
1508 RoundedRect newRoundedRect = style()->getRoundedBorderFor(newBounds); 1506 RoundedRect newRoundedRect = style()->getRoundedBorderFor(newBounds);
1509 fullRepaint = oldRoundedRect.radii() != newRoundedRect.radii(); 1507 fullRepaint = oldRoundedRect.radii() != newRoundedRect.radii();
1510 } 1508 }
1509
1511 if (!fullRepaint) { 1510 if (!fullRepaint) {
1512 // This ASSERT fails due to animations. See https://bugs.webkit.org/sho w_bug.cgi?id=37048 1511 if (mustRepaintBackgroundOrBorder() && (newBounds != oldBounds))
dsinclair 2014/03/25 14:36:06 nit: This can be made part of the if condition on
Julien - ping for review 2014/03/25 21:52:34 Done.
1513 // ASSERT(!newOutlineBoxRectPtr || *newOutlineBoxRectPtr == outlineBound sForRepaint(repaintContainer));
1514 newOutlineBox = newOutlineBoxRectPtr ? *newOutlineBoxRectPtr : outlineBo undsForRepaint(repaintContainer);
1515
1516 if ((hasOutline() && newOutlineBox.location() != oldOutlineBox.location( ))
1517 || (mustRepaintBackgroundOrBorder() && (newBounds != oldBounds || (h asOutline() && newOutlineBox != oldOutlineBox))))
1518 fullRepaint = true; 1512 fullRepaint = true;
1519 } 1513 }
1520 1514
1521 // If there is no intersection between the old and the new bounds, invalidat ing 1515 // If there is no intersection between the old and the new bounds, invalidat ing
1522 // the difference is more expensive than just doing a full repaint. 1516 // the difference is more expensive than just doing a full repaint.
1523 if (!fullRepaint && !newBounds.intersects(oldBounds)) 1517 if (!fullRepaint && !newBounds.intersects(oldBounds))
1524 fullRepaint = true; 1518 fullRepaint = true;
1525 1519
1526 if (!repaintContainer) 1520 if (!repaintContainer)
1527 repaintContainer = v; 1521 repaintContainer = v;
1528 1522
1529 if (fullRepaint) { 1523 if (fullRepaint) {
1530 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds)); 1524 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds));
1531 if (newBounds != oldBounds) 1525 if (newBounds != oldBounds)
1532 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBound s)); 1526 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBound s));
1533 return true; 1527 return true;
1534 } 1528 }
1535 1529
1536 if (newBounds == oldBounds && newOutlineBox == oldOutlineBox) 1530 if (oldBounds == newBounds)
1537 return false; 1531 return false;
1538 1532
1539 LayoutUnit deltaLeft = newBounds.x() - oldBounds.x(); 1533 LayoutUnit deltaLeft = newBounds.x() - oldBounds.x();
1540 if (deltaLeft > 0) 1534 if (deltaLeft > 0)
1541 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), oldBounds.y(), deltaLeft, oldBounds.height())); 1535 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), oldBounds.y(), deltaLeft, oldBounds.height()));
1542 else if (deltaLeft < 0) 1536 else if (deltaLeft < 0)
1543 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), newBounds.y(), -deltaLeft, newBounds.height())); 1537 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), newBounds.y(), -deltaLeft, newBounds.height()));
1544 1538
1545 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); 1539 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX();
1546 if (deltaRight > 0) 1540 if (deltaRight > 0)
1547 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.ma xX(), newBounds.y(), deltaRight, newBounds.height())); 1541 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.ma xX(), newBounds.y(), deltaRight, newBounds.height()));
1548 else if (deltaRight < 0) 1542 else if (deltaRight < 0)
1549 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.ma xX(), oldBounds.y(), -deltaRight, oldBounds.height())); 1543 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.ma xX(), oldBounds.y(), -deltaRight, oldBounds.height()));
1550 1544
1551 LayoutUnit deltaTop = newBounds.y() - oldBounds.y(); 1545 LayoutUnit deltaTop = newBounds.y() - oldBounds.y();
1552 if (deltaTop > 0) 1546 if (deltaTop > 0)
1553 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), oldBounds.y(), oldBounds.width(), deltaTop)); 1547 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), oldBounds.y(), oldBounds.width(), deltaTop));
1554 else if (deltaTop < 0) 1548 else if (deltaTop < 0)
1555 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), newBounds.y(), newBounds.width(), -deltaTop)); 1549 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), newBounds.y(), newBounds.width(), -deltaTop));
1556 1550
1557 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY(); 1551 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY();
1558 if (deltaBottom > 0) 1552 if (deltaBottom > 0)
1559 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), oldBounds.maxY(), newBounds.width(), deltaBottom)); 1553 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x( ), oldBounds.maxY(), newBounds.width(), deltaBottom));
1560 else if (deltaBottom < 0) 1554 else if (deltaBottom < 0)
1561 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), newBounds.maxY(), oldBounds.width(), -deltaBottom)); 1555 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x( ), newBounds.maxY(), oldBounds.width(), -deltaBottom));
1562 1556
1563 if (newOutlineBox == oldOutlineBox) 1557 // FIXME: This is a limitation of our visual overflow being a single rectang le.
1558 if (!style()->boxShadow() && !style()->hasBorderImageOutsets() && !style()-> hasOutline())
1564 return false; 1559 return false;
1565 1560
1566 // We didn't move, but we did change size. Invalidate the delta, which will consist of possibly 1561 // We didn't move, but we did change size. Invalidate the delta, which will consist of possibly
1567 // two rectangles (but typically only one). 1562 // two rectangles (but typically only one).
1568 RenderStyle* outlineStyle = outlineStyleForRepaint(); 1563 RenderStyle* outlineStyle = outlineStyleForRepaint();
1569 LayoutUnit outlineWidth = outlineStyle->outlineSize(); 1564 LayoutUnit outlineWidth = outlineStyle->outlineSize();
1570 LayoutBoxExtent insetShadowExtent = style()->getBoxShadowInsetExtent(); 1565 LayoutBoxExtent insetShadowExtent = style()->getBoxShadowInsetExtent();
1571 LayoutUnit width = absoluteValue(newOutlineBox.width() - oldOutlineBox.width ()); 1566 LayoutUnit width = absoluteValue(newBounds.width() - oldBounds.width());
1572 if (width) { 1567 if (width) {
1573 LayoutUnit shadowLeft; 1568 LayoutUnit shadowLeft;
1574 LayoutUnit shadowRight; 1569 LayoutUnit shadowRight;
1575 style()->getBoxShadowHorizontalExtent(shadowLeft, shadowRight); 1570 style()->getBoxShadowHorizontalExtent(shadowLeft, shadowRight);
1576 int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0; 1571 int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0;
1577 LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit( ); 1572 LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit( );
1578 LayoutUnit minInsetRightShadowExtent = min<LayoutUnit>(-insetShadowExten t.right(), min<LayoutUnit>(newBounds.width(), oldBounds.width())); 1573 LayoutUnit minInsetRightShadowExtent = min<LayoutUnit>(-insetShadowExten t.right(), min<LayoutUnit>(newBounds.width(), oldBounds.width()));
1579 LayoutUnit borderWidth = max<LayoutUnit>(borderRight, max<LayoutUnit>(va lueForLength(style()->borderTopRightRadius().width(), boxWidth), valueForLength( style()->borderBottomRightRadius().width(), boxWidth))); 1574 LayoutUnit borderWidth = max<LayoutUnit>(borderRight, max<LayoutUnit>(va lueForLength(style()->borderTopRightRadius().width(), boxWidth), valueForLength( style()->borderBottomRightRadius().width(), boxWidth)));
1580 LayoutUnit decorationsLeftWidth = max<LayoutUnit>(-outlineStyle->outline Offset(), borderWidth + minInsetRightShadowExtent) + max<LayoutUnit>(outlineWidt h, -shadowLeft); 1575 LayoutUnit decorationsLeftWidth = max<LayoutUnit>(-outlineStyle->outline Offset(), borderWidth + minInsetRightShadowExtent) + max<LayoutUnit>(outlineWidt h, -shadowLeft);
1581 LayoutUnit decorationsRightWidth = max<LayoutUnit>(-outlineStyle->outlin eOffset(), borderWidth + minInsetRightShadowExtent) + max<LayoutUnit>(outlineWid th, shadowRight); 1576 LayoutUnit decorationsRightWidth = max<LayoutUnit>(-outlineStyle->outlin eOffset(), borderWidth + minInsetRightShadowExtent) + max<LayoutUnit>(outlineWid th, shadowRight);
1582 LayoutRect rightRect(newOutlineBox.x() + min(newOutlineBox.width(), oldO utlineBox.width()) - decorationsLeftWidth, 1577 LayoutRect rightRect(newBounds.x() + min(newBounds.width(), oldBounds.wi dth()) - decorationsLeftWidth,
1583 newOutlineBox.y(), 1578 newBounds.y(),
1584 width + decorationsLeftWidth + decorationsRightWidth, 1579 width + decorationsLeftWidth + decorationsRightWidth,
1585 max(newOutlineBox.height(), oldOutlineBox.height())); 1580 max(newBounds.height(), oldBounds.height()));
1586 LayoutUnit right = min<LayoutUnit>(newBounds.maxX(), oldBounds.maxX()); 1581 LayoutUnit right = min<LayoutUnit>(newBounds.maxX(), oldBounds.maxX());
1587 if (rightRect.x() < right) { 1582 if (rightRect.x() < right) {
1588 rightRect.setWidth(min(rightRect.width(), right - rightRect.x())); 1583 rightRect.setWidth(min(rightRect.width(), right - rightRect.x()));
1589 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(rightRec t)); 1584 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(rightRec t));
1590 } 1585 }
1591 } 1586 }
1592 LayoutUnit height = absoluteValue(newOutlineBox.height() - oldOutlineBox.hei ght()); 1587 LayoutUnit height = absoluteValue(newBounds.height() - oldBounds.height());
1593 if (height) { 1588 if (height) {
1594 LayoutUnit shadowTop; 1589 LayoutUnit shadowTop;
1595 LayoutUnit shadowBottom; 1590 LayoutUnit shadowBottom;
1596 style()->getBoxShadowVerticalExtent(shadowTop, shadowBottom); 1591 style()->getBoxShadowVerticalExtent(shadowTop, shadowBottom);
1597 int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0; 1592 int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0;
1598 LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUni t(); 1593 LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUni t();
1599 LayoutUnit minInsetBottomShadowExtent = min<LayoutUnit>(-insetShadowExte nt.bottom(), min<LayoutUnit>(newBounds.height(), oldBounds.height())); 1594 LayoutUnit minInsetBottomShadowExtent = min<LayoutUnit>(-insetShadowExte nt.bottom(), min<LayoutUnit>(newBounds.height(), oldBounds.height()));
1600 LayoutUnit borderHeight = max<LayoutUnit>(borderBottom, max<LayoutUnit>( valueForLength(style()->borderBottomLeftRadius().height(), boxHeight), valueForL ength(style()->borderBottomRightRadius().height(), boxHeight))); 1595 LayoutUnit borderHeight = max<LayoutUnit>(borderBottom, max<LayoutUnit>( valueForLength(style()->borderBottomLeftRadius().height(), boxHeight), valueForL ength(style()->borderBottomRightRadius().height(), boxHeight)));
1601 LayoutUnit decorationsTopHeight = max<LayoutUnit>(-outlineStyle->outline Offset(), borderHeight + minInsetBottomShadowExtent) + max<LayoutUnit>(outlineWi dth, -shadowTop); 1596 LayoutUnit decorationsTopHeight = max<LayoutUnit>(-outlineStyle->outline Offset(), borderHeight + minInsetBottomShadowExtent) + max<LayoutUnit>(outlineWi dth, -shadowTop);
1602 LayoutUnit decorationsBottomHeight = max<LayoutUnit>(-outlineStyle->outl ineOffset(), borderHeight + minInsetBottomShadowExtent) + max<LayoutUnit>(outlin eWidth, shadowBottom); 1597 LayoutUnit decorationsBottomHeight = max<LayoutUnit>(-outlineStyle->outl ineOffset(), borderHeight + minInsetBottomShadowExtent) + max<LayoutUnit>(outlin eWidth, shadowBottom);
1603 LayoutRect bottomRect(newOutlineBox.x(), 1598 LayoutRect bottomRect(newBounds.x(),
1604 min(newOutlineBox.maxY(), oldOutlineBox.maxY()) - decorationsTopHeig ht, 1599 min(newBounds.maxY(), oldBounds.maxY()) - decorationsTopHeight,
1605 max(newOutlineBox.width(), oldOutlineBox.width()), 1600 max(newBounds.width(), oldBounds.width()),
1606 height + decorationsTopHeight + decorationsBottomHeight); 1601 height + decorationsTopHeight + decorationsBottomHeight);
1607 LayoutUnit bottom = min(newBounds.maxY(), oldBounds.maxY()); 1602 LayoutUnit bottom = min(newBounds.maxY(), oldBounds.maxY());
1608 if (bottomRect.y() < bottom) { 1603 if (bottomRect.y() < bottom) {
1609 bottomRect.setHeight(min(bottomRect.height(), bottom - bottomRect.y( ))); 1604 bottomRect.setHeight(min(bottomRect.height(), bottom - bottomRect.y( )));
1610 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(bottomRe ct)); 1605 repaintUsingContainer(repaintContainer, pixelSnappedIntRect(bottomRe ct));
1611 } 1606 }
1612 } 1607 }
1613 return false; 1608 return false;
1614 } 1609 }
1615 1610
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
3126 int RenderObject::previousOffsetForBackwardDeletion(int current) const 3121 int RenderObject::previousOffsetForBackwardDeletion(int current) const
3127 { 3122 {
3128 return current - 1; 3123 return current - 1;
3129 } 3124 }
3130 3125
3131 int RenderObject::nextOffset(int current) const 3126 int RenderObject::nextOffset(int current) const
3132 { 3127 {
3133 return current + 1; 3128 return current + 1;
3134 } 3129 }
3135 3130
3136 void RenderObject::adjustRectForOutline(LayoutRect& rect) const
3137 {
3138 rect.inflate(outlineStyleForRepaint()->outlineSize());
3139 }
3140
3141 bool RenderObject::isInert() const 3131 bool RenderObject::isInert() const
3142 { 3132 {
3143 const RenderObject* renderer = this; 3133 const RenderObject* renderer = this;
3144 while (!renderer->node()) 3134 while (!renderer->node())
3145 renderer = renderer->parent(); 3135 renderer = renderer->parent();
3146 return renderer->node()->isInert(); 3136 return renderer->node()->isInert();
3147 } 3137 }
3148 3138
3149 void RenderObject::imageChanged(ImageResource* image, const IntRect* rect) 3139 void RenderObject::imageChanged(ImageResource* image, const IntRect* rect)
3150 { 3140 {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
3318 { 3308 {
3319 ASSERT_NOT_REACHED(); 3309 ASSERT_NOT_REACHED();
3320 return false; 3310 return false;
3321 } 3311 }
3322 3312
3323 bool RenderObject::isRelayoutBoundaryForInspector() const 3313 bool RenderObject::isRelayoutBoundaryForInspector() const
3324 { 3314 {
3325 return objectIsRelayoutBoundary(this); 3315 return objectIsRelayoutBoundary(this);
3326 } 3316 }
3327 3317
3328 LayoutRect RenderObject::newOutlineRect()
3329 {
3330 ASSERT(hasOutline());
3331
3332 OutlineRects& outlineRects = view()->outlineRects();
3333 OutlineRects::iterator it = outlineRects.find(this);
3334 if (it == outlineRects.end())
3335 return outlineBoundsForRepaint(containerForRepaint());
3336 return it->value->newOutlineRect;
3337 }
3338
3339 void RenderObject::setNewOutlineRect(const LayoutRect& rect)
3340 {
3341 ASSERT(hasOutline());
3342
3343 OutlineRects& outlineRects = view()->outlineRects();
3344 OutlineRects::iterator it = outlineRects.find(this);
3345 if (it == outlineRects.end())
3346 outlineRects.set(this, adoptPtr(new OutlineRectInfo()));
3347
3348 outlineRects.get(this)->newOutlineRect = rect;
3349 }
3350
3351 LayoutRect RenderObject::oldOutlineRect()
3352 {
3353 ASSERT(hasOutline());
3354
3355 OutlineRects& outlineRects = view()->outlineRects();
3356 OutlineRects::iterator it = outlineRects.find(this);
3357 if (it == outlineRects.end())
3358 return LayoutRect();
3359 return it->value->oldOutlineRect;
3360 }
3361
3362 void RenderObject::setOldOutlineRect(const LayoutRect& rect)
3363 {
3364 ASSERT(hasOutline());
3365
3366 OutlineRects& outlineRects = view()->outlineRects();
3367 OutlineRects::iterator it = outlineRects.find(this);
3368 if (it == outlineRects.end())
3369 outlineRects.set(this, adoptPtr(new OutlineRectInfo()));
3370 outlineRects.get(this)->oldOutlineRect = rect;
3371 }
3372
3373 void RenderObject::clearRepaintState() 3318 void RenderObject::clearRepaintState()
3374 { 3319 {
3375 setShouldDoFullRepaintAfterLayout(false); 3320 setShouldDoFullRepaintAfterLayout(false);
3376 setShouldDoFullRepaintIfSelfPaintingLayer(false); 3321 setShouldDoFullRepaintIfSelfPaintingLayer(false);
3377 setShouldRepaintOverflow(false); 3322 setShouldRepaintOverflow(false);
3378 setLayoutDidGetCalled(false); 3323 setLayoutDidGetCalled(false);
3379
3380 OutlineRects& outlineRects = view()->outlineRects();
3381 OutlineRects::iterator it = outlineRects.find(this);
3382 if (it != outlineRects.end())
3383 outlineRects.remove(it);
3384 } 3324 }
3385 3325
3386 } // namespace WebCore 3326 } // namespace WebCore
3387 3327
3388 #ifndef NDEBUG 3328 #ifndef NDEBUG
3389 3329
3390 void showTree(const WebCore::RenderObject* object) 3330 void showTree(const WebCore::RenderObject* object)
3391 { 3331 {
3392 if (object) 3332 if (object)
3393 object->showTreeForThis(); 3333 object->showTreeForThis();
(...skipping 14 matching lines...) Expand all
3408 { 3348 {
3409 if (object1) { 3349 if (object1) {
3410 const WebCore::RenderObject* root = object1; 3350 const WebCore::RenderObject* root = object1;
3411 while (root->parent()) 3351 while (root->parent())
3412 root = root->parent(); 3352 root = root->parent();
3413 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3353 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3414 } 3354 }
3415 } 3355 }
3416 3356
3417 #endif 3357 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698