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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // This struct is used when the selection changes to cache the old and new state
of the selection for each RenderObject. | 60 // This struct is used when the selection changes to cache the old and new state
of the selection for each RenderObject. |
61 class RenderSelectionInfo : public RenderSelectionInfoBase { | 61 class RenderSelectionInfo : public RenderSelectionInfoBase { |
62 public: | 62 public: |
63 RenderSelectionInfo(RenderObject* o, bool clipToVisibleContent) | 63 RenderSelectionInfo(RenderObject* o, bool clipToVisibleContent) |
64 : RenderSelectionInfoBase(o) | 64 : RenderSelectionInfoBase(o) |
65 { | 65 { |
66 if (o->canUpdateSelectionOnRootLineBoxes()) { | 66 if (o->canUpdateSelectionOnRootLineBoxes()) { |
67 m_rect = o->selectionRectForPaintInvalidation(m_repaintContainer, cl
ipToVisibleContent); | 67 m_rect = o->selectionRectForPaintInvalidation(m_repaintContainer, cl
ipToVisibleContent); |
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->groupedMapping()) | 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, enclosingInt
Rect(m_rect), InvalidationSelection); | 78 m_object->invalidatePaintUsingContainer(m_repaintContainer, enclosingInt
Rect(m_rect), InvalidationSelection); |
79 } | 79 } |
(...skipping 16 matching lines...) Expand all Loading... |
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 = enclosingIntRect(m_rects); | 102 LayoutRect repaintRect = enclosingIntRect(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->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, enclosingInt
Rect(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 WebCore | 118 } // namespace WebCore |
119 | 119 |
120 | 120 |
121 #endif // RenderSelectionInfo_h | 121 #endif // RenderSelectionInfo_h |
OLD | NEW |