Chromium Code Reviews| 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) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 SelectionPaintRange(LayoutObject* start_layout_object, | 71 SelectionPaintRange(LayoutObject* start_layout_object, |
| 72 int start_offset, | 72 int start_offset, |
| 73 LayoutObject* end_layout_object, | 73 LayoutObject* end_layout_object, |
| 74 int end_offset); | 74 int end_offset); |
| 75 | 75 |
| 76 bool operator==(const SelectionPaintRange& other) const; | 76 bool operator==(const SelectionPaintRange& other) const; |
| 77 | 77 |
| 78 LayoutObject* StartLayoutObject() const; | 78 LayoutObject* StartLayoutObject() const; |
| 79 int StartOffset() const; | 79 int StartOffset() const; |
| 80 LayoutObject* EndLayoutObject() const; | 80 LayoutObject* EndLayoutObject() const; |
| 81 int EndOffset() const; | 81 int EndOffset() const; |
|
yoichio
2017/06/27 07:54:52
Having LayoutNGBlockFlow, textcontent offset and i
| |
| 82 | 82 |
| 83 bool IsNull() const { return !start_layout_object_; } | 83 bool IsNull() const { return !start_layout_object_; } |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 LayoutObject* start_layout_object_ = nullptr; | 86 LayoutObject* start_layout_object_ = nullptr; |
| 87 int start_offset_ = -1; | 87 int start_offset_ = -1; |
| 88 LayoutObject* end_layout_object_ = nullptr; | 88 LayoutObject* end_layout_object_ = nullptr; |
| 89 int end_offset_ = -1; | 89 int end_offset_ = -1; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 class LayoutSelection final : public GarbageCollected<LayoutSelection> { | 92 class LayoutSelection final : public GarbageCollected<LayoutSelection> { |
| 93 public: | 93 public: |
| 94 static LayoutSelection* Create(FrameSelection& frame_selection) { | 94 static LayoutSelection* Create(FrameSelection& frame_selection) { |
| 95 return new LayoutSelection(frame_selection); | 95 return new LayoutSelection(frame_selection); |
| 96 } | 96 } |
| 97 | 97 |
| 98 bool HasPendingSelection() const { return has_pending_selection_; } | 98 bool HasPendingSelection() const { return has_pending_selection_; } |
| 99 void SetHasPendingSelection() { has_pending_selection_ = true; } | 99 void SetHasPendingSelection() { has_pending_selection_ = true; } |
| 100 void Commit(); | 100 void Commit(); |
| 101 | 101 |
| 102 IntRect SelectionBounds(); | 102 IntRect SelectionBounds(); |
| 103 void InvalidatePaintForSelection(); | 103 void InvalidatePaintForSelection(); |
| 104 | 104 |
| 105 void ClearSelection(); | 105 void ClearSelection(); |
| 106 // TODO(yoichio): Returns pair<Union<NGOffset, DOMOffset>, Union<NGOffset, | |
| 107 // DOMOffset>>. Content of the Union is decided by if | |
| 108 // paint_range_.Start(End)LayoutObject() is NG or not. LayoutObject painter | |
| 109 // calliing this should know if the LayoutObject is NG and | |
| 110 // LayoutObject.SelectionState because SelectionStartEnd().first doesn't make | |
| 111 // sense for SelectionState::kEnd LayoutObject. | |
| 106 std::pair<int, int> SelectionStartEnd(); | 112 std::pair<int, int> SelectionStartEnd(); |
| 107 void OnDocumentShutdown(); | 113 void OnDocumentShutdown(); |
| 108 | 114 |
| 109 DECLARE_TRACE(); | 115 DECLARE_TRACE(); |
| 110 | 116 |
| 111 private: | 117 private: |
| 112 LayoutSelection(FrameSelection&); | 118 LayoutSelection(FrameSelection&); |
| 113 | 119 |
| 114 Member<FrameSelection> frame_selection_; | 120 Member<FrameSelection> frame_selection_; |
| 115 bool has_pending_selection_ : 1; | 121 bool has_pending_selection_ : 1; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 | 153 |
| 148 private: | 154 private: |
| 149 Member<NGTextOffsetMap> offset_map_; | 155 Member<NGTextOffsetMap> offset_map_; |
| 150 | 156 |
| 151 DISALLOW_COPY_AND_ASSIGN(Builder); | 157 DISALLOW_COPY_AND_ASSIGN(Builder); |
| 152 }; | 158 }; |
| 153 | 159 |
| 154 } // namespace blink | 160 } // namespace blink |
| 155 | 161 |
| 156 #endif | 162 #endif |
| OLD | NEW |