| 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 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 return clippedOverflowRect(paintInvalidationContainer); | 1043 return clippedOverflowRect(paintInvalidationContainer); |
| 1044 } | 1044 } |
| 1045 | 1045 |
| 1046 LayoutRect LayoutInline::clippedOverflowRect(const LayoutBoxModelObject* paintIn
validationContainer, const PaintInvalidationState* paintInvalidationState) const | 1046 LayoutRect LayoutInline::clippedOverflowRect(const LayoutBoxModelObject* paintIn
validationContainer, const PaintInvalidationState* paintInvalidationState) const |
| 1047 { | 1047 { |
| 1048 const LayoutBoxModelObject* continuation = this->continuation(); | 1048 const LayoutBoxModelObject* continuation = this->continuation(); |
| 1049 if ((!firstLineBoxIncludingCulling() && !continuation) || style()->visibilit
y() != VISIBLE) | 1049 if ((!firstLineBoxIncludingCulling() && !continuation) || style()->visibilit
y() != VISIBLE) |
| 1050 return LayoutRect(); | 1050 return LayoutRect(); |
| 1051 | 1051 |
| 1052 LayoutRect overflowRect(linesVisualOverflowBoundingBox()); | 1052 LayoutRect overflowRect(linesVisualOverflowBoundingBox()); |
| 1053 mapRectToPaintInvalidationBacking(paintInvalidationContainer, overflowRect,
paintInvalidationState); | |
| 1054 | 1053 |
| 1055 LayoutUnit outlineOutset = style()->outlineOutsetExtent(); | 1054 LayoutUnit outlineOutset = style()->outlineOutsetExtent(); |
| 1056 if (outlineOutset) { | 1055 if (outlineOutset) { |
| 1057 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()
) { | 1056 Vector<LayoutRect> rects; |
| 1058 if (!curr->isText()) | 1057 addOutlineRectsForChildrenAndContinuations(rects, LayoutPoint()); |
| 1059 overflowRect.unite(curr->rectWithOutlineForPaintInvalidation(pai
ntInvalidationContainer, outlineOutset)); | 1058 LayoutRect outlineRect = unionRect(rects); |
| 1059 if (!outlineRect.isEmpty()) { |
| 1060 outlineRect.inflate(outlineOutset); |
| 1061 overflowRect.unite(outlineRect); |
| 1060 } | 1062 } |
| 1061 | |
| 1062 if (continuation && !continuation->isInline() && continuation->parent()) | |
| 1063 overflowRect.unite(continuation->rectWithOutlineForPaintInvalidation
(paintInvalidationContainer, outlineOutset)); | |
| 1064 } | 1063 } |
| 1065 | 1064 |
| 1065 mapRectToPaintInvalidationBacking(paintInvalidationContainer, overflowRect,
paintInvalidationState); |
| 1066 return overflowRect; | 1066 return overflowRect; |
| 1067 } | 1067 } |
| 1068 | 1068 |
| 1069 LayoutRect LayoutInline::rectWithOutlineForPaintInvalidation(const LayoutBoxMode
lObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalid
ationState* paintInvalidationState) const | |
| 1070 { | |
| 1071 LayoutRect r(LayoutBoxModelObject::rectWithOutlineForPaintInvalidation(paint
InvalidationContainer, outlineWidth, paintInvalidationState)); | |
| 1072 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) { | |
| 1073 if (!curr->isText()) | |
| 1074 r.unite(curr->rectWithOutlineForPaintInvalidation(paintInvalidationC
ontainer, outlineWidth, paintInvalidationState)); | |
| 1075 } | |
| 1076 return r; | |
| 1077 } | |
| 1078 | |
| 1079 void LayoutInline::mapRectToPaintInvalidationBacking(const LayoutBoxModelObject*
paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* pai
ntInvalidationState) const | 1069 void LayoutInline::mapRectToPaintInvalidationBacking(const LayoutBoxModelObject*
paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* pai
ntInvalidationState) const |
| 1080 { | 1070 { |
| 1081 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { | 1071 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain
tInvalidationContainer)) { |
| 1082 if (style()->hasInFlowPosition() && layer()) | 1072 if (style()->hasInFlowPosition() && layer()) |
| 1083 rect.move(layer()->offsetForInFlowPosition()); | 1073 rect.move(layer()->offsetForInFlowPosition()); |
| 1084 rect.move(paintInvalidationState->paintOffset()); | 1074 rect.move(paintInvalidationState->paintOffset()); |
| 1085 if (paintInvalidationState->isClipped()) | 1075 if (paintInvalidationState->isClipped()) |
| 1086 rect.intersect(paintInvalidationState->clipRect()); | 1076 rect.intersect(paintInvalidationState->clipRect()); |
| 1087 return; | 1077 return; |
| 1088 } | 1078 } |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 { | 1361 { |
| 1372 if (!rect.isEmpty()) | 1362 if (!rect.isEmpty()) |
| 1373 AbsoluteLayoutRectsGeneratorContext::operator()(rect); | 1363 AbsoluteLayoutRectsGeneratorContext::operator()(rect); |
| 1374 } | 1364 } |
| 1375 }; | 1365 }; |
| 1376 | 1366 |
| 1377 } // unnamed namespace | 1367 } // unnamed namespace |
| 1378 | 1368 |
| 1379 void LayoutInline::addOutlineRects(Vector<LayoutRect>& rects, const LayoutPoint&
additionalOffset) const | 1369 void LayoutInline::addOutlineRects(Vector<LayoutRect>& rects, const LayoutPoint&
additionalOffset) const |
| 1380 { | 1370 { |
| 1381 // Add line boxes only if this object is the first object of addOutlineRects
(). | 1371 AbsoluteLayoutRectsIgnoringEmptyRectsGeneratorContext context(rects, additio
nalOffset); |
| 1382 // Otherwise the parent (LayoutBlockFlow or LayoutInline) should have added
line box rects | 1372 generateLineBoxRects(context); |
| 1383 // covering those of this object. | |
| 1384 if (rects.isEmpty()) { | |
| 1385 AbsoluteLayoutRectsIgnoringEmptyRectsGeneratorContext context(rects, add
itionalOffset); | |
| 1386 generateLineBoxRects(context); | |
| 1387 } | |
| 1388 | 1373 |
| 1374 addOutlineRectsForChildrenAndContinuations(rects, additionalOffset); |
| 1375 } |
| 1376 |
| 1377 void LayoutInline::addOutlineRectsForChildrenAndContinuations(Vector<LayoutRect>
& rects, const LayoutPoint& additionalOffset) const |
| 1378 { |
| 1389 addOutlineRectsForNormalChildren(rects, additionalOffset); | 1379 addOutlineRectsForNormalChildren(rects, additionalOffset); |
| 1380 addOutlineRectsForContinuations(rects, additionalOffset); |
| 1381 } |
| 1390 | 1382 |
| 1383 void LayoutInline::addOutlineRectsForContinuations(Vector<LayoutRect>& rects, co
nst LayoutPoint& additionalOffset) const |
| 1384 { |
| 1391 if (LayoutBoxModelObject* continuation = this->continuation()) { | 1385 if (LayoutBoxModelObject* continuation = this->continuation()) { |
| 1392 if (continuation->isInline()) | 1386 if (continuation->isInline()) |
| 1393 continuation->addOutlineRects(rects, additionalOffset + (continuatio
n->containingBlock()->location() - containingBlock()->location())); | 1387 continuation->addOutlineRects(rects, additionalOffset + (continuatio
n->containingBlock()->location() - containingBlock()->location())); |
| 1394 else | 1388 else |
| 1395 continuation->addOutlineRects(rects, additionalOffset + (toLayoutBox
(continuation)->location() - containingBlock()->location())); | 1389 continuation->addOutlineRects(rects, additionalOffset + (toLayoutBox
(continuation)->location() - containingBlock()->location())); |
| 1396 } | 1390 } |
| 1397 } | 1391 } |
| 1398 | 1392 |
| 1399 void LayoutInline::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layo
utPoint& layerOffset) const | 1393 void LayoutInline::computeSelfHitTestRects(Vector<LayoutRect>& rects, const Layo
utPoint& layerOffset) const |
| 1400 { | 1394 { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1427 } | 1421 } |
| 1428 | 1422 |
| 1429 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain
tInvalidationContainer) const | 1423 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain
tInvalidationContainer) const |
| 1430 { | 1424 { |
| 1431 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine
r); | 1425 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine
r); |
| 1432 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) | 1426 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) |
| 1433 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); | 1427 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); |
| 1434 } | 1428 } |
| 1435 | 1429 |
| 1436 } // namespace blink | 1430 } // namespace blink |
| OLD | NEW |