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

Unified Diff: Source/core/layout/compositing/CompositedSelection.h

Issue 929213004: Plumb selection bounds as a single unit (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Refactor WebSelection to align with Frame/VisibleSelection Created 5 years, 9 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
Index: Source/core/layout/compositing/CompositedSelection.h
diff --git a/Source/core/layout/compositing/CompositedSelectionBound.h b/Source/core/layout/compositing/CompositedSelection.h
similarity index 68%
copy from Source/core/layout/compositing/CompositedSelectionBound.h
copy to Source/core/layout/compositing/CompositedSelection.h
index d9cc88a412fa983f32f4f8a587f8d281ceafb718..52f6b693ef01a8162327fa3b47cdbcdf3d5b208c 100644
--- a/Source/core/layout/compositing/CompositedSelectionBound.h
+++ b/Source/core/layout/compositing/CompositedSelection.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 Google Inc. All rights reserved.
+ * Copyright (C) 2015 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -28,37 +28,37 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CompositedSelectionBound_h
-#define CompositedSelectionBound_h
+#ifndef CompositedSelection_h
+#define CompositedSelection_h
+#include "core/editing/SelectionType.h"
+#include "core/layout/compositing/CompositedSelectionBound.h"
#include "platform/geometry/FloatPoint.h"
#include "platform/graphics/GraphicsLayer.h"
namespace blink {
-struct CompositedSelectionBound {
- enum Type {
- Caret,
- SelectionLeft,
- SelectionRight
- };
+// The active selection region, containing compositing data for the selection
+// end points as well as metadata for the selection region.
+// See |WebSelection|.
+struct CompositedSelection {
- CompositedSelectionBound()
- : type(Caret)
- , layer(nullptr)
+ CompositedSelection()
+ : type(NoSelection)
+ , isBaseFirst(false)
+ , isEditable(false)
+ , isEditableRegionEmpty(false)
{
}
- Type type;
-
- // The structure describes the position of a caret in space of the GraphicsLayer the caret resides in.
- // Where edgeTopInLayer is the top point of the caret, usually on the ascend line of the line box,
- // and edgeBottomInLayer it the bottom point, on the baseline of the line box.
- GraphicsLayer* layer;
- FloatPoint edgeTopInLayer;
- FloatPoint edgeBottomInLayer;
+ SelectionType type;
+ CompositedSelectionBound base;
+ CompositedSelectionBound extent;
+ bool isBaseFirst;
+ bool isEditable;
+ bool isEditableRegionEmpty;
};
} // namespace blink
-#endif
+#endif // CompositedSelection_h

Powered by Google App Engine
This is Rietveld 408576698