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