| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 return; | 101 return; |
| 102 } | 102 } |
| 103 | 103 |
| 104 LayoutRect paintRect = LayoutRect(adjustedPaintOffset, size()); | 104 LayoutRect paintRect = LayoutRect(adjustedPaintOffset, size()); |
| 105 if (paintInfo.phase == PaintPhaseForeground && style()->outlineWidth()) | 105 if (paintInfo.phase == PaintPhaseForeground && style()->outlineWidth()) |
| 106 paintOutline(paintInfo, paintRect); | 106 paintOutline(paintInfo, paintRect); |
| 107 | 107 |
| 108 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection && !canHaveChildren()) | 108 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection && !canHaveChildren()) |
| 109 return; | 109 return; |
| 110 | 110 |
| 111 if (!paintInfo.shouldPaintWithinRoot(this)) | |
| 112 return; | |
| 113 | |
| 114 bool drawSelectionTint = selectionState() != SelectionNone; | 111 bool drawSelectionTint = selectionState() != SelectionNone; |
| 115 if (paintInfo.phase == PaintPhaseSelection) { | 112 if (paintInfo.phase == PaintPhaseSelection) { |
| 116 if (selectionState() == SelectionNone) | 113 if (selectionState() == SelectionNone) |
| 117 return; | 114 return; |
| 118 drawSelectionTint = false; | 115 drawSelectionTint = false; |
| 119 } | 116 } |
| 120 | 117 |
| 121 bool completelyClippedOut = false; | 118 bool completelyClippedOut = false; |
| 122 if (style()->hasBorderRadius()) { | 119 if (style()->hasBorderRadius()) { |
| 123 LayoutRect borderRect = LayoutRect(adjustedPaintOffset, size()); | 120 LayoutRect borderRect = LayoutRect(adjustedPaintOffset, size()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 143 // surrounding content. | 140 // surrounding content. |
| 144 if (drawSelectionTint) { | 141 if (drawSelectionTint) { |
| 145 LayoutRect selectionPaintingRect = localSelectionRect(); | 142 LayoutRect selectionPaintingRect = localSelectionRect(); |
| 146 selectionPaintingRect.moveBy(adjustedPaintOffset); | 143 selectionPaintingRect.moveBy(adjustedPaintOffset); |
| 147 paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect),
selectionBackgroundColor()); | 144 paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect),
selectionBackgroundColor()); |
| 148 } | 145 } |
| 149 } | 146 } |
| 150 | 147 |
| 151 bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) | 148 bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) |
| 152 { | 149 { |
| 153 if (!paintInfo.shouldPaintWithinRoot(this)) | |
| 154 return false; | |
| 155 | |
| 156 LayoutPoint adjustedPaintOffset = paintOffset + location(); | 150 LayoutPoint adjustedPaintOffset = paintOffset + location(); |
| 157 | 151 |
| 158 // Early exit if the element touches the edges. | 152 // Early exit if the element touches the edges. |
| 159 LayoutUnit top = adjustedPaintOffset.y() + visualOverflowRect().y(); | 153 LayoutUnit top = adjustedPaintOffset.y() + visualOverflowRect().y(); |
| 160 LayoutUnit bottom = adjustedPaintOffset.y() + visualOverflowRect().maxY(); | 154 LayoutUnit bottom = adjustedPaintOffset.y() + visualOverflowRect().maxY(); |
| 161 if (isSelected() && inlineBoxWrapper()) { | 155 if (isSelected() && inlineBoxWrapper()) { |
| 162 LayoutUnit selTop = paintOffset.y() + inlineBoxWrapper()->root().selecti
onTop(); | 156 LayoutUnit selTop = paintOffset.y() + inlineBoxWrapper()->root().selecti
onTop(); |
| 163 LayoutUnit selBottom = paintOffset.y() + selTop + inlineBoxWrapper()->ro
ot().selectionHeight(); | 157 LayoutUnit selBottom = paintOffset.y() + selTop + inlineBoxWrapper()->ro
ot().selectionHeight(); |
| 164 top = std::min(selTop, top); | 158 top = std::min(selTop, top); |
| 165 bottom = std::max(selBottom, bottom); | 159 bottom = std::max(selBottom, bottom); |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 if (s == SelectionEnd) | 470 if (s == SelectionEnd) |
| 477 return selectionEnd == end; | 471 return selectionEnd == end; |
| 478 if (s == SelectionBoth) | 472 if (s == SelectionBoth) |
| 479 return selectionStart == 0 && selectionEnd == end; | 473 return selectionStart == 0 && selectionEnd == end; |
| 480 | 474 |
| 481 ASSERT(0); | 475 ASSERT(0); |
| 482 return false; | 476 return false; |
| 483 } | 477 } |
| 484 | 478 |
| 485 } | 479 } |
| OLD | NEW |