| 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 RootInlineBox& lastRootBox = lastLineBox()->root(); | 600 RootInlineBox& lastRootBox = lastLineBox()->root(); |
| 601 | 601 |
| 602 LayoutUnit logicalTop = firstLineBox()->logicalTopVisualOverflow(firstRootBo
x.lineTop()); | 602 LayoutUnit logicalTop = firstLineBox()->logicalTopVisualOverflow(firstRootBo
x.lineTop()); |
| 603 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; | 603 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; |
| 604 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo
otBox.lineBottom()) - logicalTop; | 604 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo
otBox.lineBottom()) - logicalTop; |
| 605 | 605 |
| 606 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); | 606 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); |
| 607 return rect; | 607 return rect; |
| 608 } | 608 } |
| 609 | 609 |
| 610 LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay
erModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn
validationState) const | |
| 611 { | |
| 612 if (!firstLineBoxIncludingCulling()) | |
| 613 return LayoutRect(); | |
| 614 | |
| 615 LayoutRect paintInvalidationRect(linesVisualOverflowBoundingBox()); | |
| 616 bool hitPaintInvalidationContainer = false; | |
| 617 | |
| 618 // We need to add in the in-flow position offsets of any inlines (including
us) up to our | |
| 619 // containing block. | |
| 620 RenderBlock* cb = containingBlock(); | |
| 621 for (const RenderObject* inlineFlow = this; inlineFlow && inlineFlow->isRend
erInline() && inlineFlow != cb; | |
| 622 inlineFlow = inlineFlow->parent()) { | |
| 623 if (inlineFlow == paintInvalidationContainer) { | |
| 624 hitPaintInvalidationContainer = true; | |
| 625 break; | |
| 626 } | |
| 627 if (inlineFlow->style()->hasInFlowPosition() && inlineFlow->hasLayer()) | |
| 628 paintInvalidationRect.move(toRenderInline(inlineFlow)->layer()->offs
etForInFlowPosition()); | |
| 629 } | |
| 630 | |
| 631 LayoutUnit outlineSize = style()->outlineSize(); | |
| 632 paintInvalidationRect.inflate(outlineSize); | |
| 633 | |
| 634 if (hitPaintInvalidationContainer || !cb) | |
| 635 return paintInvalidationRect; | |
| 636 | |
| 637 if (cb->hasOverflowClip()) | |
| 638 cb->applyCachedClipAndScrollOffsetForPaintInvalidation(paintInvalidation
Rect); | |
| 639 | |
| 640 // FIXME: Passing paintInvalidationState directly to mapRectToPaintInvalidat
ionBacking causes incorrect invalidations. | |
| 641 // Should avoid slowRectMapping by properly adjusting paintInvalidationState
. crbug.com/402994. | |
| 642 ForceHorriblySlowRectMapping slowRectMapping(paintInvalidationState); | |
| 643 cb->mapRectToPaintInvalidationBacking(paintInvalidationContainer, paintInval
idationRect, paintInvalidationState); | |
| 644 | |
| 645 if (outlineSize) { | |
| 646 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()
) { | |
| 647 if (!curr->isText()) | |
| 648 paintInvalidationRect.unite(curr->rectWithOutlineForPaintInvalid
ation(paintInvalidationContainer, outlineSize)); | |
| 649 } | |
| 650 } | |
| 651 | |
| 652 return paintInvalidationRect; | |
| 653 } | |
| 654 | |
| 655 LayoutRect RenderInline::rectWithOutlineForPaintInvalidation(const RenderLayerMo
delObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInval
idationState* paintInvalidationState) const | |
| 656 { | |
| 657 LayoutRect r(RenderBoxModelObject::rectWithOutlineForPaintInvalidation(paint
InvalidationContainer, outlineWidth, paintInvalidationState)); | |
| 658 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { | |
| 659 if (!curr->isText()) | |
| 660 r.unite(curr->rectWithOutlineForPaintInvalidation(paintInvalidationC
ontainer, outlineWidth, paintInvalidationState)); | |
| 661 } | |
| 662 return r; | |
| 663 } | |
| 664 | |
| 665 void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec
t* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* p
aintInvalidationState) const | 610 void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec
t* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* p
aintInvalidationState) const |
| 666 { | 611 { |
| 667 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { | 612 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { |
| 668 if (style()->hasInFlowPosition() && layer()) | 613 if (style()->hasInFlowPosition() && layer()) |
| 669 rect.move(layer()->offsetForInFlowPosition()); | 614 rect.move(layer()->offsetForInFlowPosition()); |
| 670 rect.move(paintInvalidationState->paintOffset()); | 615 rect.move(paintInvalidationState->paintOffset()); |
| 671 if (paintInvalidationState->isClipped()) | 616 if (paintInvalidationState->isClipped()) |
| 672 rect.intersect(paintInvalidationState->clipRect()); | 617 rect.intersect(paintInvalidationState->clipRect()); |
| 673 return; | 618 return; |
| 674 } | 619 } |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 pixelSnappedBox.maxY(), | 1036 pixelSnappedBox.maxY(), |
| 1092 pixelSnappedBox.maxX() + outlineWidth, | 1037 pixelSnappedBox.maxX() + outlineWidth, |
| 1093 pixelSnappedBox.maxY() + outlineWidth, | 1038 pixelSnappedBox.maxY() + outlineWidth, |
| 1094 BSBottom, outlineColor, outlineStyle, | 1039 BSBottom, outlineColor, outlineStyle, |
| 1095 outlineWidth, | 1040 outlineWidth, |
| 1096 outlineWidth, | 1041 outlineWidth, |
| 1097 antialias); | 1042 antialias); |
| 1098 } | 1043 } |
| 1099 | 1044 |
| 1100 } // namespace blink | 1045 } // namespace blink |
| OLD | NEW |