Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/LayoutSelection.h |
| diff --git a/third_party/WebKit/Source/core/editing/LayoutSelection.h b/third_party/WebKit/Source/core/editing/LayoutSelection.h |
| index 18de59f5fdf7d88ee2883906bf561c9df2e22177..db981e09b0ed081b14676c869abf101c14952cfc 100644 |
| --- a/third_party/WebKit/Source/core/editing/LayoutSelection.h |
| +++ b/third_party/WebKit/Source/core/editing/LayoutSelection.h |
| @@ -41,6 +41,22 @@ class LayoutSelection final : public GarbageCollected<LayoutSelection> { |
| void SetHasPendingSelection() { has_pending_selection_ = true; } |
| void Commit(LayoutView&); |
| + IntRect SelectionBounds(); |
| + void InvalidatePaintForSelection(); |
| + enum SelectionPaintInvalidationMode { |
| + kPaintInvalidationNewXOROld, |
| + kPaintInvalidationNewMinusOld |
| + }; |
| + void SetSelection( |
| + LayoutObject* start, |
| + int start_pos, |
| + LayoutObject*, |
| + int end_pos, |
| + SelectionPaintInvalidationMode = kPaintInvalidationNewXOROld); |
| + void ClearSelection(); |
| + void SelectionStartEnd(int& start_pos, int& end_pos); |
| + void OnDocumentShutdown(); |
| + |
| DECLARE_TRACE(); |
| private: |
| @@ -53,6 +69,25 @@ class LayoutSelection final : public GarbageCollected<LayoutSelection> { |
| Member<FrameSelection> frame_selection_; |
| bool has_pending_selection_ : 1; |
| + |
| + // The current selection represented as 2 boundaries. |
| + // Selection boundaries are represented in LayoutView by a tuple |
| + // (LayoutObject, DOM node offset). |
| + // See http://www.w3.org/TR/dom/#range for more information. |
| + // |
| + // |m_selectionStartPos| and |m_selectionEndPos| are only valid for |
|
hugoh_UTC2
2017/04/13 06:53:04
Post-merge nit: we should update the comment, now
|
| + // |Text| node without 'transform' or 'first-letter'. |
| + // |
| + // Those are used for selection painting and paint invalidation upon |
| + // selection change. |
| + LayoutObject* selection_start_; |
| + LayoutObject* selection_end_; |
| + |
| + // TODO(yosin): Clarify the meaning of these variables. editing/ passes |
| + // them as offsets in the DOM tree but layout uses them as offset in the |
| + // layout tree. |
| + int selection_start_pos_; |
| + int selection_end_pos_; |
| }; |
| } // namespace blink |