| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 RenderObject* object() const { return m_object.get(); } | 49 RenderObject* object() const { return m_object.get(); } |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 RawPtrWillBeMember<RenderObject> m_object; | 52 RawPtrWillBeMember<RenderObject> m_object; |
| 53 RawPtrWillBeMember<const RenderLayerModelObject> m_paintInvalidationContaine
r; | 53 RawPtrWillBeMember<const RenderLayerModelObject> m_paintInvalidationContaine
r; |
| 54 RenderObject::SelectionState m_state; | 54 RenderObject::SelectionState m_state; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // This struct is used when the selection changes to cache the old and new state
of the selection for each RenderObject. | 57 // This struct is used when the selection changes to cache the old and new state
of the selection for each RenderObject. |
| 58 class RenderSelectionInfo FINAL : public RenderSelectionInfoBase { | 58 class RenderSelectionInfo final : public RenderSelectionInfoBase { |
| 59 public: | 59 public: |
| 60 RenderSelectionInfo(RenderObject* o) | 60 RenderSelectionInfo(RenderObject* o) |
| 61 : RenderSelectionInfoBase(o) | 61 : RenderSelectionInfoBase(o) |
| 62 { | 62 { |
| 63 if (m_paintInvalidationContainer && o->canUpdateSelectionOnRootLineBoxes
()) { | 63 if (m_paintInvalidationContainer && o->canUpdateSelectionOnRootLineBoxes
()) { |
| 64 m_rect = o->selectionRectForPaintInvalidation(m_paintInvalidationCon
tainer); | 64 m_rect = o->selectionRectForPaintInvalidation(m_paintInvalidationCon
tainer); |
| 65 // FIXME: groupedMapping() leaks the squashing abstraction. See Rend
erBlockSelectionInfo for more details. | 65 // FIXME: groupedMapping() leaks the squashing abstraction. See Rend
erBlockSelectionInfo for more details. |
| 66 if (m_paintInvalidationContainer->layer()->groupedMapping()) | 66 if (m_paintInvalidationContainer->layer()->groupedMapping()) |
| 67 RenderLayer::mapRectToPaintBackingCoordinates(m_paintInvalidatio
nContainer, m_rect); | 67 RenderLayer::mapRectToPaintBackingCoordinates(m_paintInvalidatio
nContainer, m_rect); |
| 68 } else { | 68 } else { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 91 ASSERT(m_paintInvalidationContainer == other.m_paintInvalidationContaine
r); | 91 ASSERT(m_paintInvalidationContainer == other.m_paintInvalidationContaine
r); |
| 92 | 92 |
| 93 return m_state != other.m_state || m_rect != other.m_rect; | 93 return m_state != other.m_state || m_rect != other.m_rect; |
| 94 } | 94 } |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 LayoutRect m_rect; // relative to paint invalidation container | 97 LayoutRect m_rect; // relative to paint invalidation container |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 // This struct is used when the selection changes to cache the old and new state
of the selection for each RenderBlock. | 100 // This struct is used when the selection changes to cache the old and new state
of the selection for each RenderBlock. |
| 101 class RenderBlockSelectionInfo FINAL : public RenderSelectionInfoBase { | 101 class RenderBlockSelectionInfo final : public RenderSelectionInfoBase { |
| 102 public: | 102 public: |
| 103 RenderBlockSelectionInfo(RenderBlock* b) | 103 RenderBlockSelectionInfo(RenderBlock* b) |
| 104 : RenderSelectionInfoBase(b) | 104 : RenderSelectionInfoBase(b) |
| 105 { | 105 { |
| 106 if (m_paintInvalidationContainer && b->canUpdateSelectionOnRootLineBoxes
()) | 106 if (m_paintInvalidationContainer && b->canUpdateSelectionOnRootLineBoxes
()) |
| 107 m_rects = block()->selectionGapRectsForPaintInvalidation(m_paintInva
lidationContainer); | 107 m_rects = block()->selectionGapRectsForPaintInvalidation(m_paintInva
lidationContainer); |
| 108 else | 108 else |
| 109 m_rects = GapRects(); | 109 m_rects = GapRects(); |
| 110 } | 110 } |
| 111 | 111 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 132 private: | 132 private: |
| 133 RenderBlock* block() const { return toRenderBlock(m_object); } | 133 RenderBlock* block() const { return toRenderBlock(m_object); } |
| 134 | 134 |
| 135 GapRects m_rects; // relative to paint invalidation container | 135 GapRects m_rects; // relative to paint invalidation container |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace blink | 138 } // namespace blink |
| 139 | 139 |
| 140 | 140 |
| 141 #endif // RenderSelectionInfo_h | 141 #endif // RenderSelectionInfo_h |
| OLD | NEW |