| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // FIXME: groupedMapping() leaks the squashing abstraction. See Rend
erBlockSelectionInfo for more details. | 68 // FIXME: groupedMapping() leaks the squashing abstraction. See Rend
erBlockSelectionInfo for more details. |
| 69 if (m_repaintContainer && m_repaintContainer->layer()->groupedMappin
g()) | 69 if (m_repaintContainer && m_repaintContainer->layer()->groupedMappin
g()) |
| 70 RenderLayer::mapRectToPaintInvalidationBacking(m_repaintContaine
r, m_repaintContainer, m_rect); | 70 RenderLayer::mapRectToPaintInvalidationBacking(m_repaintContaine
r, m_repaintContainer, m_rect); |
| 71 } else { | 71 } else { |
| 72 m_rect = LayoutRect(); | 72 m_rect = LayoutRect(); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 void repaint() | 76 void repaint() |
| 77 { | 77 { |
| 78 m_object->invalidatePaintUsingContainer(m_repaintContainer, m_rect, Inva
lidationSelection); | 78 m_object->invalidatePaintUsingContainer(m_repaintContainer, enclosingInt
Rect(m_rect), InvalidationSelection); |
| 79 } | 79 } |
| 80 | 80 |
| 81 LayoutRect rect() const { return m_rect; } | 81 LayoutRect rect() const { return m_rect; } |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 LayoutRect m_rect; // relative to repaint container | 84 LayoutRect m_rect; // relative to repaint container |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 | 87 |
| 88 // This struct is used when the selection changes to cache the old and new state
of the selection for each RenderBlock. | 88 // This struct is used when the selection changes to cache the old and new state
of the selection for each RenderBlock. |
| 89 class RenderBlockSelectionInfo : public RenderSelectionInfoBase { | 89 class RenderBlockSelectionInfo : public RenderSelectionInfoBase { |
| 90 public: | 90 public: |
| 91 RenderBlockSelectionInfo(RenderBlock* b) | 91 RenderBlockSelectionInfo(RenderBlock* b) |
| 92 : RenderSelectionInfoBase(b) | 92 : RenderSelectionInfoBase(b) |
| 93 { | 93 { |
| 94 if (b->canUpdateSelectionOnRootLineBoxes()) | 94 if (b->canUpdateSelectionOnRootLineBoxes()) |
| 95 m_rects = block()->selectionGapRectsForRepaint(m_repaintContainer); | 95 m_rects = block()->selectionGapRectsForRepaint(m_repaintContainer); |
| 96 else | 96 else |
| 97 m_rects = GapRects(); | 97 m_rects = GapRects(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void repaint() | 100 void repaint() |
| 101 { | 101 { |
| 102 LayoutRect repaintRect = m_rects; | 102 LayoutRect repaintRect = m_rects; |
| 103 // FIXME: this is leaking the squashing abstraction. However, removing t
he groupedMapping() condiitional causes | 103 // FIXME: this is leaking the squashing abstraction. However, removing t
he groupedMapping() condiitional causes |
| 104 // RenderBox::mapRectToPaintInvalidationBacking to get called, which mak
es rect adjustments even if you pass the same | 104 // RenderBox::mapRectToPaintInvalidationBacking to get called, which mak
es rect adjustments even if you pass the same |
| 105 // repaintContainer as the render object. Find out why it does that and
fix. | 105 // repaintContainer as the render object. Find out why it does that and
fix. |
| 106 if (m_repaintContainer && m_repaintContainer->layer()->groupedMapping()) | 106 if (m_repaintContainer && m_repaintContainer->layer()->groupedMapping()) |
| 107 RenderLayer::mapRectToPaintInvalidationBacking(m_repaintContainer, m
_repaintContainer, repaintRect); | 107 RenderLayer::mapRectToPaintInvalidationBacking(m_repaintContainer, m
_repaintContainer, repaintRect); |
| 108 m_object->invalidatePaintUsingContainer(m_repaintContainer, repaintRect,
InvalidationSelection); | 108 m_object->invalidatePaintUsingContainer(m_repaintContainer, enclosingInt
Rect(repaintRect), InvalidationSelection); |
| 109 } | 109 } |
| 110 | 110 |
| 111 RenderBlock* block() const { return toRenderBlock(m_object); } | 111 RenderBlock* block() const { return toRenderBlock(m_object); } |
| 112 GapRects rects() const { return m_rects; } | 112 GapRects rects() const { return m_rects; } |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 GapRects m_rects; // relative to repaint container | 115 GapRects m_rects; // relative to repaint container |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace blink | 118 } // namespace blink |
| 119 | 119 |
| 120 | 120 |
| 121 #endif // RenderSelectionInfo_h | 121 #endif // RenderSelectionInfo_h |
| OLD | NEW |