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) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
4 * reserved. | 4 * reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 LayoutSelection::LayoutSelection(FrameSelection& frame_selection) | 35 LayoutSelection::LayoutSelection(FrameSelection& frame_selection) |
36 : frame_selection_(&frame_selection), | 36 : frame_selection_(&frame_selection), |
37 has_pending_selection_(false), | 37 has_pending_selection_(false), |
38 force_hide_(false), | 38 force_hide_(false), |
39 selection_start_(nullptr), | 39 selection_start_(nullptr), |
40 selection_end_(nullptr), | 40 selection_end_(nullptr), |
41 selection_start_pos_(-1), | 41 selection_start_pos_(-1), |
42 selection_end_pos_(-1) {} | 42 selection_end_pos_(-1) {} |
43 | 43 |
44 const VisibleSelection& LayoutSelection::GetVisibleSelection() const { | |
45 return frame_selection_->ComputeVisibleSelectionInDOMTree(); | |
46 } | |
47 | |
48 SelectionInFlatTree LayoutSelection::CalcVisibleSelection( | 44 SelectionInFlatTree LayoutSelection::CalcVisibleSelection( |
49 const VisibleSelectionInFlatTree& original_selection) const { | 45 const VisibleSelectionInFlatTree& original_selection) const { |
50 const PositionInFlatTree& start = original_selection.Start(); | 46 const PositionInFlatTree& start = original_selection.Start(); |
51 const PositionInFlatTree& end = original_selection.end(); | 47 const PositionInFlatTree& end = original_selection.end(); |
52 SelectionType selection_type = original_selection.GetSelectionType(); | 48 SelectionType selection_type = original_selection.GetSelectionType(); |
53 const TextAffinity affinity = original_selection.Affinity(); | 49 const TextAffinity affinity = original_selection.Affinity(); |
54 | 50 |
55 bool paint_block_cursor = | 51 bool paint_block_cursor = |
56 frame_selection_->ShouldShowBlockCursor() && | 52 frame_selection_->ShouldShowBlockCursor() && |
57 selection_type == SelectionType::kCaretSelection && | 53 selection_type == SelectionType::kCaretSelection && |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 | 443 |
448 o->SetShouldInvalidateSelection(); | 444 o->SetShouldInvalidateSelection(); |
449 } | 445 } |
450 } | 446 } |
451 | 447 |
452 DEFINE_TRACE(LayoutSelection) { | 448 DEFINE_TRACE(LayoutSelection) { |
453 visitor->Trace(frame_selection_); | 449 visitor->Trace(frame_selection_); |
454 } | 450 } |
455 | 451 |
456 } // namespace blink | 452 } // namespace blink |
OLD | NEW |