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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
742 // A positioned object has no effect on the min/max width of its con taining block ever. | 742 // A positioned object has no effect on the min/max width of its con taining block ever. |
743 // We can optimize this case and not go up any further. | 743 // We can optimize this case and not go up any further. |
744 break; | 744 break; |
745 o = container; | 745 o = container; |
746 } | 746 } |
747 } | 747 } |
748 | 748 |
749 void RenderObject::setLayerNeedsFullRepaint() | 749 void RenderObject::setLayerNeedsFullRepaint() |
750 { | 750 { |
751 ASSERT(hasLayer()); | 751 ASSERT(hasLayer()); |
752 toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsF ullRepaint); | 752 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
753 setShouldDoFullRepaintAfterLayout(true); | |
754 else | |
755 toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(Ne edsFullRepaint); | |
753 } | 756 } |
754 | 757 |
755 void RenderObject::setLayerNeedsFullRepaintForPositionedMovementLayout() | 758 void RenderObject::setLayerNeedsFullRepaintForPositionedMovementLayout() |
756 { | 759 { |
757 ASSERT(hasLayer()); | 760 ASSERT(hasLayer()); |
758 toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsF ullRepaintForPositionedMovementLayout); | 761 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
762 setShouldDoFullRepaintAfterLayout(true); | |
763 else | |
764 toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(Ne edsFullRepaintForPositionedMovementLayout); | |
759 } | 765 } |
760 | 766 |
761 RenderBlock* RenderObject::containerForFixedPosition(const RenderLayerModelObjec t* repaintContainer, bool* repaintContainerSkipped) const | 767 RenderBlock* RenderObject::containerForFixedPosition(const RenderLayerModelObjec t* repaintContainer, bool* repaintContainerSkipped) const |
762 { | 768 { |
763 ASSERT(!repaintContainerSkipped || !*repaintContainerSkipped); | 769 ASSERT(!repaintContainerSkipped || !*repaintContainerSkipped); |
764 ASSERT(!isText()); | 770 ASSERT(!isText()); |
765 ASSERT(style()->position() == FixedPosition); | 771 ASSERT(style()->position() == FixedPosition); |
766 | 772 |
767 RenderObject* ancestor = parent(); | 773 RenderObject* ancestor = parent(); |
768 for (; ancestor && !ancestor->canContainFixedPositionObjects(); ancestor = a ncestor->parent()) { | 774 for (; ancestor && !ancestor->canContainFixedPositionObjects(); ancestor = a ncestor->parent()) { |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1587 } | 1593 } |
1588 return false; | 1594 return false; |
1589 } | 1595 } |
1590 | 1596 |
1591 void RenderObject::repaintOverflow() | 1597 void RenderObject::repaintOverflow() |
1592 { | 1598 { |
1593 } | 1599 } |
1594 | 1600 |
1595 bool RenderObject::checkForRepaint() const | 1601 bool RenderObject::checkForRepaint() const |
1596 { | 1602 { |
1597 return !document().view()->needsFullRepaint() && !hasLayer() && everHadLayou t(); | 1603 return !document().view()->needsFullRepaint() && everHadLayout(); |
1598 } | 1604 } |
1599 | 1605 |
1600 bool RenderObject::checkForRepaintDuringLayout() const | 1606 bool RenderObject::checkForRepaintDuringLayout() const |
1601 { | 1607 { |
1602 return !RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && checkForRepai nt(); | 1608 return !RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && checkForRepai nt(); |
1603 } | 1609 } |
1604 | 1610 |
1605 LayoutRect RenderObject::rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const | 1611 LayoutRect RenderObject::rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const |
1606 { | 1612 { |
1607 LayoutRect r(clippedOverflowRectForRepaint(repaintContainer)); | 1613 LayoutRect r(clippedOverflowRectForRepaint(repaintContainer)); |
(...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3301 { | 3307 { |
3302 ASSERT_NOT_REACHED(); | 3308 ASSERT_NOT_REACHED(); |
3303 return false; | 3309 return false; |
3304 } | 3310 } |
3305 | 3311 |
3306 bool RenderObject::isRelayoutBoundaryForInspector() const | 3312 bool RenderObject::isRelayoutBoundaryForInspector() const |
3307 { | 3313 { |
3308 return objectIsRelayoutBoundary(this); | 3314 return objectIsRelayoutBoundary(this); |
3309 } | 3315 } |
3310 | 3316 |
3317 const LayoutRect RenderObject::newOutlineRect() | |
3318 { | |
3319 OutlineRects* outlineRects = view()->outlineRects(); | |
esprehn
2014/02/28 02:54:33
ditto, you need a "hasOutlineRects" bitfield to gu
dsinclair
2014/02/28 18:58:24
ack.
| |
3320 OutlineRects::iterator it = outlineRects->find(this); | |
3321 if (it == outlineRects->end()) | |
3322 return outlineBoundsForRepaint(containerForRepaint()); | |
3323 return it->value.newOutlineRect; | |
3324 } | |
3325 | |
3326 void RenderObject::setNewOutlineRect(const LayoutRect& rect) | |
3327 { | |
3328 OutlineRects* outlineRects = view()->outlineRects(); | |
3329 OutlineRects::iterator it = outlineRects->find(this); | |
3330 if (it == outlineRects->end()) | |
3331 outlineRects->set(this, OutlineRectInfo()); | |
3332 | |
3333 outlineRects->get(this).newOutlineRect = rect; | |
3334 } | |
3335 | |
3336 const LayoutRect RenderObject::oldOutlineRect() | |
3337 { | |
3338 OutlineRects* outlineRects = view()->outlineRects(); | |
esprehn
2014/02/28 02:54:33
You need to use a bitfield so you don't hit the ha
dsinclair
2014/02/28 18:58:24
I did the check on the other side, I only query th
Julien - ping for review
2014/03/04 18:22:10
Outline is a style property so it won't change dur
| |
3339 OutlineRects::iterator it = outlineRects->find(this); | |
3340 if (it == outlineRects->end()) | |
3341 return LayoutRect(); | |
3342 return it->value.oldOutlineRect; | |
3343 } | |
3344 | |
3345 void RenderObject::setOldOutlineRect(const LayoutRect& rect) | |
3346 { | |
3347 OutlineRects* outlineRects = view()->outlineRects(); | |
3348 OutlineRects::iterator it = outlineRects->find(this); | |
3349 if (it == outlineRects->end()) | |
3350 outlineRects->set(this, OutlineRectInfo()); | |
3351 outlineRects->get(this).oldOutlineRect = rect; | |
3352 } | |
3353 | |
3354 void RenderObject::clearRepaintState() | |
3355 { | |
3356 setShouldDoFullRepaintAfterLayout(false); | |
3357 setShouldRepaintOverflowIfNeeded(false); | |
3358 setLayoutDidGetCalled(false); | |
3359 | |
3360 OutlineRects* outlineRects = view()->outlineRects(); | |
3361 OutlineRects::iterator it = outlineRects->find(this); | |
3362 if (it != outlineRects->end()) | |
3363 outlineRects->remove(it); | |
3364 } | |
3365 | |
3311 } // namespace WebCore | 3366 } // namespace WebCore |
3312 | 3367 |
3313 #ifndef NDEBUG | 3368 #ifndef NDEBUG |
3314 | 3369 |
3315 void showTree(const WebCore::RenderObject* object) | 3370 void showTree(const WebCore::RenderObject* object) |
3316 { | 3371 { |
3317 if (object) | 3372 if (object) |
3318 object->showTreeForThis(); | 3373 object->showTreeForThis(); |
3319 } | 3374 } |
3320 | 3375 |
(...skipping 12 matching lines...) Expand all Loading... | |
3333 { | 3388 { |
3334 if (object1) { | 3389 if (object1) { |
3335 const WebCore::RenderObject* root = object1; | 3390 const WebCore::RenderObject* root = object1; |
3336 while (root->parent()) | 3391 while (root->parent()) |
3337 root = root->parent(); | 3392 root = root->parent(); |
3338 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3393 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3339 } | 3394 } |
3340 } | 3395 } |
3341 | 3396 |
3342 #endif | 3397 #endif |
OLD | NEW |