| 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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 RootInlineBox& lastRootBox = lastLineBox()->root(); | 591 RootInlineBox& lastRootBox = lastLineBox()->root(); |
| 592 | 592 |
| 593 LayoutUnit logicalTop = firstLineBox()->logicalTopVisualOverflow(firstRootBo
x.lineTop()); | 593 LayoutUnit logicalTop = firstLineBox()->logicalTopVisualOverflow(firstRootBo
x.lineTop()); |
| 594 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; | 594 LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; |
| 595 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo
otBox.lineBottom()) - logicalTop; | 595 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo
otBox.lineBottom()) - logicalTop; |
| 596 | 596 |
| 597 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); | 597 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); |
| 598 return rect; | 598 return rect; |
| 599 } | 599 } |
| 600 | 600 |
| 601 void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec
t* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* p
aintInvalidationState) const | |
| 602 { | |
| 603 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { | |
| 604 if (style()->hasInFlowPosition() && layer()) | |
| 605 rect.move(layer()->offsetForInFlowPosition()); | |
| 606 rect.move(paintInvalidationState->paintOffset()); | |
| 607 if (paintInvalidationState->isClipped()) | |
| 608 rect.intersect(paintInvalidationState->clipRect()); | |
| 609 return; | |
| 610 } | |
| 611 | |
| 612 if (paintInvalidationContainer == this) | |
| 613 return; | |
| 614 | |
| 615 bool containerSkipped; | |
| 616 RenderObject* o = container(paintInvalidationContainer, &containerSkipped); | |
| 617 if (!o) | |
| 618 return; | |
| 619 | |
| 620 LayoutPoint topLeft = rect.location(); | |
| 621 | |
| 622 if (style()->hasInFlowPosition() && layer()) { | |
| 623 // Apply the in-flow position offset when invalidating a rectangle. The
layer | |
| 624 // is translated, but the render box isn't, so we need to do this to get
the | |
| 625 // right dirty rect. Since this is called from RenderObject::setStyle, t
he relative position | |
| 626 // flag on the RenderObject has been cleared, so use the one on the styl
e(). | |
| 627 topLeft += layer()->offsetForInFlowPosition(); | |
| 628 } | |
| 629 | |
| 630 // FIXME: We ignore the lightweight clipping rect that controls use, since i
f |o| is in mid-layout, | |
| 631 // its controlClipRect will be wrong. For overflow clip we use the values ca
ched by the layer. | |
| 632 rect.setLocation(topLeft); | |
| 633 if (o->hasOverflowClip()) { | |
| 634 RenderBox* containerBox = toRenderBox(o); | |
| 635 containerBox->applyCachedClipAndScrollOffsetForPaintInvalidation(rect); | |
| 636 if (rect.isEmpty()) | |
| 637 return; | |
| 638 } | |
| 639 | |
| 640 if (containerSkipped) { | |
| 641 // If the paintInvalidationContainer is below o, then we need to map the
rect into paintInvalidationContainer's coordinates. | |
| 642 LayoutSize containerOffset = paintInvalidationContainer->offsetFromAnces
torContainer(o); | |
| 643 rect.move(-containerOffset); | |
| 644 return; | |
| 645 } | |
| 646 | |
| 647 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paint
InvalidationState); | |
| 648 } | |
| 649 | |
| 650 LayoutSize RenderInline::offsetFromContainer(const RenderObject* container, cons
t LayoutPoint& point, bool* offsetDependsOnPoint) const | 601 LayoutSize RenderInline::offsetFromContainer(const RenderObject* container, cons
t LayoutPoint& point, bool* offsetDependsOnPoint) const |
| 651 { | 602 { |
| 652 ASSERT(container == this->container()); | 603 ASSERT(container == this->container()); |
| 653 | 604 |
| 654 LayoutSize offset; | 605 LayoutSize offset; |
| 655 if (isRelPositioned()) | 606 if (isRelPositioned()) |
| 656 offset += offsetForInFlowPosition(); | 607 offset += offsetForInFlowPosition(); |
| 657 | 608 |
| 658 if (container->hasOverflowClip()) | 609 if (container->hasOverflowClip()) |
| 659 offset -= toRenderBox(container)->scrolledContentOffset(); | 610 offset -= toRenderBox(container)->scrolledContentOffset(); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 pixelSnappedBox.maxY(), | 963 pixelSnappedBox.maxY(), |
| 1013 pixelSnappedBox.maxX() + outlineWidth, | 964 pixelSnappedBox.maxX() + outlineWidth, |
| 1014 pixelSnappedBox.maxY() + outlineWidth, | 965 pixelSnappedBox.maxY() + outlineWidth, |
| 1015 BSBottom, outlineColor, outlineStyle, | 966 BSBottom, outlineColor, outlineStyle, |
| 1016 outlineWidth, | 967 outlineWidth, |
| 1017 outlineWidth, | 968 outlineWidth, |
| 1018 antialias); | 969 antialias); |
| 1019 } | 970 } |
| 1020 | 971 |
| 1021 } // namespace blink | 972 } // namespace blink |
| OLD | NEW |