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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h

Issue 2968803002: EXPERIMENT TextIterator built on Layout NG offset mapping
Patch Set: Mon Jul 17 15:55:29 PDT 2017 Created 3 years, 5 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 | « no previous file | third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h
index 48d15960197d1099e7449fd7e9019c226bf81f71..90eacccc550748118c6d1bfdae10bcdf163d0a7e 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h
@@ -7,12 +7,15 @@
#include "core/dom/Text.h"
#include "core/editing/iterators/TextIteratorBehavior.h"
+#include "core/layout/ng/inline/ng_offset_mapping_builder.h"
+#include "core/layout/ng/inline/ng_offset_mapping_result.h"
#include "platform/heap/Handle.h"
#include "platform/wtf/Vector.h"
namespace blink {
class InlineTextBox;
+class LayoutNGBlockFlow;
class LayoutText;
class LayoutTextFragment;
class TextIteratorTextState;
@@ -56,6 +59,8 @@ class TextIteratorTextNodeHandler final
size_t RestoreCollapsedTrailingSpace(InlineTextBox* next_text_box,
size_t subrun_end);
+ void HandleTextNodeInNGBlockFlow(const LayoutNGBlockFlow&);
+
// Used when the visibility of the style should not affect text gathering.
bool IgnoresStyleVisibility() const {
return behavior_.IgnoresStyleVisibility();
@@ -76,6 +81,15 @@ class TextIteratorTextNodeHandler final
int offset_ = 0;
int end_offset_ = 0;
+ // The current containing block if the text node is laid out with LayoutNG.
+ const LayoutNGBlockFlow* ng_block_flow_ = nullptr;
+
+ // The DOM to text content offset mapping in the containing block if the text
+ // node is laid out with LayoutNG.
+ // TODO(xiaochengh): The offset mapping should be managed in its own cached,
+ // not directly by its clients.
+ NGOffsetMappingResult mapping_result_;
+
InlineTextBox* text_box_ = nullptr;
// Remember if we are in the middle of handling a pre-formatted text node.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698