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

Unified Diff: third_party/WebKit/Source/core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.h

Issue 1857633002: Introduce ForwardGraphemeBoundaryStateMachine (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebasing Created 4 years, 8 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: third_party/WebKit/Source/core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.h
diff --git a/third_party/WebKit/Source/core/editing/state_machines/BackwardGraphemeBoundaryStateMachine.h b/third_party/WebKit/Source/core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.h
similarity index 75%
copy from third_party/WebKit/Source/core/editing/state_machines/BackwardGraphemeBoundaryStateMachine.h
copy to third_party/WebKit/Source/core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.h
index 7db5c0d50573b3304ddb7194a08eb70bdff049d9..d330e10c0fe351d14b0a6c4047884cb38f94d4dd 100644
--- a/third_party/WebKit/Source/core/editing/state_machines/BackwardGraphemeBoundaryStateMachine.h
+++ b/third_party/WebKit/Source/core/editing/state_machines/ForwardGraphemeBoundaryStateMachine.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BackwardGraphemeBoundaryStateMachine_h
-#define BackwardGraphemeBoundaryStateMachine_h
+#ifndef ForwardGraphemeBoundaryStateMachine_h
+#define ForwardGraphemeBoundaryStateMachine_h
#include "core/CoreExport.h"
#include "core/editing/state_machines/TextSegmentationMachineState.h"
@@ -14,12 +14,12 @@
namespace blink {
-class CORE_EXPORT BackwardGraphemeBoundaryStateMachine {
+class CORE_EXPORT ForwardGraphemeBoundaryStateMachine {
STACK_ALLOCATED();
- WTF_MAKE_NONCOPYABLE(BackwardGraphemeBoundaryStateMachine);
+ WTF_MAKE_NONCOPYABLE(ForwardGraphemeBoundaryStateMachine);
public:
- BackwardGraphemeBoundaryStateMachine();
+ ForwardGraphemeBoundaryStateMachine();
// Find boundary offset by feeding preceding text.
// This method must not be called after feedFollowingCodeUnit().
@@ -44,19 +44,22 @@ private:
enum class InternalState;
friend std::ostream& operator<<(std::ostream&, InternalState);
- TextSegmentationMachineState moveToNextState(InternalState nextState);
+ TextSegmentationMachineState moveToNextState(InternalState);
TextSegmentationMachineState staySameState();
- // Updates the internal state to InternalState::Finished then returns
- // TextSegmentationMachineState::Finished.
+ // Updates the internal state to InternalState::Finished then
+ // returnsTextSegmentationMachineState::Finished.
TextSegmentationMachineState finish();
+ // Handles end of text. This method always finishes the state machine.
+ void finishWithEndOfText();
+
// Used for composing supplementary code point with surrogate pairs.
- UChar m_trailSurrogate = 0;
+ UChar m_pendingCodeUnit = 0;
- // The code point immediately after the m_BoundaryOffset.
- UChar32 m_nextCodePoint = 0;
+ // The code point immediately before the m_BoundaryOffset.
+ UChar32 m_prevCodePoint = 0;
// The relative offset from the begging of this state machine.
int m_boundaryOffset = 0;

Powered by Google App Engine
This is Rietveld 408576698