| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) |
| 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
| 5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 { | 113 { |
| 114 ReplacedPainter(*this).paint(paintInfo, paintOffset); | 114 ReplacedPainter(*this).paint(paintInfo, paintOffset); |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool LayoutReplaced::shouldPaint(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) const | 117 bool LayoutReplaced::shouldPaint(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) const |
| 118 { | 118 { |
| 119 if (paintInfo.phase != PaintPhaseForeground && !shouldPaintSelfOutline(paint
Info.phase) | 119 if (paintInfo.phase != PaintPhaseForeground && !shouldPaintSelfOutline(paint
Info.phase) |
| 120 && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPha
seMask && paintInfo.phase != PaintPhaseClippingMask) | 120 && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPha
seMask && paintInfo.phase != PaintPhaseClippingMask) |
| 121 return false; | 121 return false; |
| 122 | 122 |
| 123 if (!paintInfo.shouldPaintWithinRoot(this)) | |
| 124 return false; | |
| 125 | |
| 126 // if we're invisible or haven't received a layout yet, then just bail. | 123 // if we're invisible or haven't received a layout yet, then just bail. |
| 127 if (style()->visibility() != VISIBLE) | 124 if (style()->visibility() != VISIBLE) |
| 128 return false; | 125 return false; |
| 129 | 126 |
| 130 LayoutRect paintRect(visualOverflowRect()); | 127 LayoutRect paintRect(visualOverflowRect()); |
| 131 paintRect.unite(localSelectionRect()); | 128 paintRect.unite(localSelectionRect()); |
| 132 paintRect.moveBy(paintOffset + location()); | 129 paintRect.moveBy(paintOffset + location()); |
| 133 | 130 |
| 134 if (!paintInfo.cullRect().intersectsCullRect(paintRect)) | 131 if (!paintInfo.cullRect().intersectsCullRect(paintRect)) |
| 135 return false; | 132 return false; |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 // We only include the space below the baseline in our layer's cached paint
invalidation rect if the | 466 // We only include the space below the baseline in our layer's cached paint
invalidation rect if the |
| 470 // image is selected. Since the selection state has changed update the rect. | 467 // image is selected. Since the selection state has changed update the rect. |
| 471 if (hasLayer()) | 468 if (hasLayer()) |
| 472 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(containe
rForPaintInvalidation())); | 469 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(containe
rForPaintInvalidation())); |
| 473 | 470 |
| 474 if (canUpdateSelectionOnRootLineBoxes()) | 471 if (canUpdateSelectionOnRootLineBoxes()) |
| 475 inlineBoxWrapper()->root().setHasSelectedChildren(state != SelectionNone
); | 472 inlineBoxWrapper()->root().setHasSelectedChildren(state != SelectionNone
); |
| 476 } | 473 } |
| 477 | 474 |
| 478 } | 475 } |
| OLD | NEW |