chromium/third_party/blink/renderer/core/editing/visible_units_word.cc

/*
 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/editing/visible_units.h"

#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/iterators/text_iterator.h"
#include "third_party/blink/renderer/core/editing/text_offset_mapping.h"
#include "third_party/blink/renderer/core/editing/text_segments.h"
#include "third_party/blink/renderer/core/editing/visible_position.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/text/character.h"
#include "third_party/blink/renderer/platform/text/text_boundaries.h"
#include "third_party/blink/renderer/platform/text/text_break_iterator.h"

namespace blink {

namespace {

// Helpers used during word movement
static bool IsLineBreak(UChar ch) {}

PositionInFlatTree EndOfWordPositionInternal(const PositionInFlatTree& position,
                                             WordSide side) {}

// IMPORTANT: If you update the logic of this algorithm, please also update the
// one in `AbstractInlineTextBox::GetWordBoundariesForText`. The word offsets
// computed over there needs to stay in sync with the ones computed here in
// order for screen readers to announce the right words when using caret
// navigation (ctrl + left/right arrow).
PositionInFlatTree NextWordPositionInternal(
    const PositionInFlatTree& position,
    PlatformWordBehavior platform_word_behavior) {}

PositionInFlatTree PreviousWordPositionInternal(
    const PositionInFlatTree& position) {}

PositionInFlatTree StartOfWordPositionInternal(
    const PositionInFlatTree& position,
    WordSide side) {}
}  // namespace

PositionInFlatTree EndOfWordPosition(const PositionInFlatTree& start,
                                     WordSide side) {}

Position EndOfWordPosition(const Position& position, WordSide side) {}

// ----
// TODO(editing-dev): Because of word boundary can not be an upstream position,
// we should make this function to return |PositionInFlatTree|.
PositionInFlatTreeWithAffinity NextWordPosition(
    const PositionInFlatTree& start,
    PlatformWordBehavior platform_word_behavior) {}

PositionWithAffinity NextWordPosition(
    const Position& start,
    PlatformWordBehavior platform_word_behavior) {}

PositionInFlatTreeWithAffinity PreviousWordPosition(
    const PositionInFlatTree& start) {}

PositionWithAffinity PreviousWordPosition(const Position& start) {}

PositionInFlatTree StartOfWordPosition(const PositionInFlatTree& position,
                                       WordSide side) {}

Position StartOfWordPosition(const Position& position, WordSide side) {}

PositionInFlatTree MiddleOfWordPosition(const PositionInFlatTree& word_start,
                                        const PositionInFlatTree& word_end) {}

Position MiddleOfWordPosition(const Position& word_start,
                              const Position& word_end) {}

bool IsWordBreak(UChar ch) {}
}  // namespace blink