| 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;
|
|
|