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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 rect = rect.transposedRect(); | 1019 rect = rect.transposedRect(); |
1020 return rect; | 1020 return rect; |
1021 } | 1021 } |
1022 | 1022 |
1023 LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay
erModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn
validationState) const | 1023 LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay
erModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn
validationState) const |
1024 { | 1024 { |
1025 if ((!firstLineBoxIncludingCulling() && !continuation()) || style()->visibil
ity() != VISIBLE) | 1025 if ((!firstLineBoxIncludingCulling() && !continuation()) || style()->visibil
ity() != VISIBLE) |
1026 return LayoutRect(); | 1026 return LayoutRect(); |
1027 | 1027 |
1028 LayoutRect paintInvalidationRect(linesVisualOverflowBoundingBox()); | 1028 LayoutRect paintInvalidationRect(linesVisualOverflowBoundingBox()); |
1029 bool hitPaintInvalidationContainer = false; | |
1030 | |
1031 // We need to add in the in-flow position offsets of any inlines (including
us) up to our | |
1032 // containing block. | |
1033 RenderBlock* cb = containingBlock(); | |
1034 for (const RenderObject* inlineFlow = this; inlineFlow && inlineFlow->isRend
erInline() && inlineFlow != cb; | |
1035 inlineFlow = inlineFlow->parent()) { | |
1036 if (inlineFlow == paintInvalidationContainer) { | |
1037 hitPaintInvalidationContainer = true; | |
1038 break; | |
1039 } | |
1040 if (inlineFlow->style()->hasInFlowPosition() && inlineFlow->hasLayer()) | |
1041 paintInvalidationRect.move(toRenderInline(inlineFlow)->layer()->offs
etForInFlowPosition()); | |
1042 } | |
1043 | 1029 |
1044 LayoutUnit outlineSize = style()->outlineSize(); | 1030 LayoutUnit outlineSize = style()->outlineSize(); |
1045 paintInvalidationRect.inflate(outlineSize); | 1031 paintInvalidationRect.inflate(outlineSize); |
1046 | 1032 |
1047 if (hitPaintInvalidationContainer || !cb) | 1033 mapRectToPaintInvalidationBacking(paintInvalidationContainer, paintInvalidat
ionRect, paintInvalidationState); |
1048 return paintInvalidationRect; | |
1049 | |
1050 if (cb->hasColumns()) | |
1051 cb->adjustRectForColumns(paintInvalidationRect); | |
1052 | |
1053 if (cb->hasOverflowClip()) | |
1054 cb->applyCachedClipAndScrollOffsetForPaintInvalidation(paintInvalidation
Rect); | |
1055 | |
1056 // FIXME: Passing paintInvalidationState directly to mapRectToPaintInvalidat
ionBacking causes incorrect invalidations. | |
1057 // Should avoid slowRectMapping by properly adjusting paintInvalidationState
. crbug.com/402994. | |
1058 ForceHorriblySlowRectMapping slowRectMapping(paintInvalidationState); | |
1059 cb->mapRectToPaintInvalidationBacking(paintInvalidationContainer, paintInval
idationRect, paintInvalidationState); | |
1060 | 1034 |
1061 if (outlineSize) { | 1035 if (outlineSize) { |
1062 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()
) { | 1036 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()
) { |
1063 if (!curr->isText()) | 1037 if (!curr->isText()) |
1064 paintInvalidationRect.unite(curr->rectWithOutlineForPaintInvalid
ation(paintInvalidationContainer, outlineSize)); | 1038 paintInvalidationRect.unite(curr->rectWithOutlineForPaintInvalid
ation(paintInvalidationContainer, outlineSize)); |
1065 } | 1039 } |
1066 | 1040 |
1067 if (continuation() && !continuation()->isInline() && continuation()->par
ent()) | 1041 if (continuation() && !continuation()->isInline() && continuation()->par
ent()) |
1068 paintInvalidationRect.unite(continuation()->rectWithOutlineForPaintI
nvalidation(paintInvalidationContainer, outlineSize)); | 1042 paintInvalidationRect.unite(continuation()->rectWithOutlineForPaintI
nvalidation(paintInvalidationContainer, outlineSize)); |
1069 } | 1043 } |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1597 container = this; | 1571 container = this; |
1598 | 1572 |
1599 FloatPoint absPos = container->localToAbsolute(); | 1573 FloatPoint absPos = container->localToAbsolute(); |
1600 region.bounds.setX(absPos.x() + region.bounds.x()); | 1574 region.bounds.setX(absPos.x() + region.bounds.x()); |
1601 region.bounds.setY(absPos.y() + region.bounds.y()); | 1575 region.bounds.setY(absPos.y() + region.bounds.y()); |
1602 | 1576 |
1603 regions.append(region); | 1577 regions.append(region); |
1604 } | 1578 } |
1605 | 1579 |
1606 } // namespace blink | 1580 } // namespace blink |
OLD | NEW |