Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Issue 2841093002: Algorithm for deciding if a frame's selection should be hidden (Closed)
Patch Set: Nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/LayoutSelection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/LayoutSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
index cd5cc26b30d141b990834a5611edc212cd91e2f3..fa026847b68ccf871ac68b6d899e8b8e618efefb 100644
--- a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
@@ -35,7 +35,6 @@ namespace blink {
LayoutSelection::LayoutSelection(FrameSelection& frame_selection)
: frame_selection_(&frame_selection),
has_pending_selection_(false),
- force_hide_(false),
selection_start_(nullptr),
selection_end_(nullptr),
selection_start_pos_(-1),
@@ -316,14 +315,6 @@ void LayoutSelection::ClearSelection() {
SetSelection(0, -1, 0, -1, kPaintInvalidationNewMinusOld);
}
-void LayoutSelection::SetHasPendingSelection(PaintHint hint) {
- has_pending_selection_ = true;
- if (hint == PaintHint::kHide)
- force_hide_ = true;
- else if (hint == PaintHint::kPaint)
- force_hide_ = false;
-}
-
void LayoutSelection::Commit() {
if (!HasPendingSelection())
return;
@@ -339,7 +330,7 @@ void LayoutSelection::Commit() {
const VisibleSelectionInFlatTree& selection =
CreateVisibleSelection(CalcVisibleSelection(original_selection));
- if (!selection.IsRange() || force_hide_) {
+ if (!selection.IsRange() || frame_selection_->IsHidden()) {
ClearSelection();
return;
}
@@ -377,7 +368,6 @@ void LayoutSelection::Commit() {
void LayoutSelection::OnDocumentShutdown() {
has_pending_selection_ = false;
- force_hide_ = false;
selection_start_ = nullptr;
selection_end_ = nullptr;
selection_start_pos_ = -1;
« no previous file with comments | « third_party/WebKit/Source/core/editing/LayoutSelection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698