Commit 47fafff9 authored by yosin@chromium.org's avatar yosin@chromium.org

Move PositionWithAffinity class to editing

This patch moves PositionWithAffinity class to editing/ from dom/Position.h
since it is "affinity" is editing concept rather than DOM concept.

BUG=n/a
TEST=n/a; no behavior changes

Review URL: https://codereview.chromium.org/353603003

git-svn-id: svn://svn.chromium.org/blink/trunk@177035 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 170d98f4
......@@ -1019,6 +1019,8 @@
'editing/MoveSelectionCommand.cpp',
'editing/PlainTextRange.cpp',
'editing/PlainTextRange.h',
'editing/PositionWithAffinity.cpp',
'editing/PositionWithAffinity.h',
'editing/RemoveCSSPropertyCommand.cpp',
'editing/RemoveCSSPropertyCommand.h',
'editing/RemoveFormatCommand.cpp',
......
......@@ -310,33 +310,6 @@ inline bool offsetIsBeforeLastNodeOffset(int offset, Node* anchorNode)
return offset < currentOffset;
}
class PositionWithAffinity {
DISALLOW_ALLOCATION();
public:
PositionWithAffinity()
: m_affinity(DOWNSTREAM)
{
}
PositionWithAffinity(const Position& position, EAffinity affinity = DOWNSTREAM)
: m_position(position)
, m_affinity(affinity)
{
}
EAffinity affinity() const { return m_affinity; }
const Position& position() const { return m_position; }
void trace(Visitor* visitor)
{
visitor->trace(m_position);
}
private:
Position m_position;
EAffinity m_affinity;
};
} // namespace WebCore
#ifndef NDEBUG
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file./*
#include "config.h"
#include "core/editing/PositionWithAffinity.h"
namespace WebCore {
PositionWithAffinity::PositionWithAffinity(const Position& position, EAffinity affinity)
: m_position(position)
, m_affinity(affinity)
{
}
PositionWithAffinity::PositionWithAffinity()
: m_affinity(DOWNSTREAM)
{
}
PositionWithAffinity::~PositionWithAffinity()
{
}
void PositionWithAffinity::trace(Visitor* visitor)
{
visitor->trace(m_position);
}
} // namespace WebCore
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file./*
#ifndef PositionWithAffinity_h
#define PositionWithAffinity_h
#include "core/dom/Position.h"
#include "core/editing/TextAffinity.h"
namespace WebCore {
class PositionWithAffinity {
DISALLOW_ALLOCATION();
public:
PositionWithAffinity(const Position&, EAffinity = DOWNSTREAM);
PositionWithAffinity();
~PositionWithAffinity();
EAffinity affinity() const { return m_affinity; }
const Position& position() const { return m_position; }
void trace(Visitor*);
private:
Position m_position;
EAffinity m_affinity;
};
} // namespace WebCore
#endif // PositionWithAffinity_h
......@@ -26,8 +26,8 @@
#ifndef VisiblePosition_h
#define VisiblePosition_h
#include "core/dom/Position.h"
#include "core/editing/EditingBoundary.h"
#include "core/editing/PositionWithAffinity.h"
#include "platform/heap/Handle.h"
#include "platform/text/TextDirection.h"
......
......@@ -40,6 +40,7 @@ class ExceptionState;
class HTMLElement;
class Node;
class Position;
class PositionWithAffinity;
class Range;
class VisiblePosition;
class VisibleSelection;
......
......@@ -23,6 +23,7 @@
#include "core/rendering/RenderBR.h"
#include "core/dom/Document.h"
#include "core/editing/PositionWithAffinity.h"
#include "core/rendering/RenderView.h"
namespace WebCore {
......
......@@ -24,6 +24,7 @@
#include "core/HTMLNames.h"
#include "core/dom/shadow/ElementShadow.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/editing/PositionWithAffinity.h"
#include "core/fileapi/FileList.h"
#include "core/html/HTMLInputElement.h"
#include "core/rendering/PaintInfo.h"
......
......@@ -23,6 +23,7 @@
#ifndef RenderInline_h
#define RenderInline_h
#include "core/editing/PositionWithAffinity.h"
#include "core/rendering/InlineFlowBox.h"
#include "core/rendering/RenderBoxModelObject.h"
#include "core/rendering/RenderLineBoxList.h"
......
......@@ -28,8 +28,8 @@
#include "core/dom/DocumentLifecycle.h"
#include "core/dom/Element.h"
#include "core/dom/Position.h"
#include "core/dom/StyleEngine.h"
#include "core/editing/TextAffinity.h"
#include "core/fetch/ImageResourceClient.h"
#include "core/rendering/HitTestRequest.h"
#include "core/rendering/PaintPhase.h"
......@@ -55,6 +55,7 @@ class HitTestResult;
class InlineBox;
class InlineFlowBox;
class Position;
class PositionWithAffinity;
class PseudoStyleRequest;
class RenderBoxModelObject;
class RenderBlock;
......
......@@ -24,6 +24,7 @@
#include "config.h"
#include "core/rendering/RenderReplaced.h"
#include "core/editing/PositionWithAffinity.h"
#include "core/rendering/GraphicsContextAnnotator.h"
#include "core/rendering/RenderBlock.h"
#include "core/rendering/RenderImage.h"
......
......@@ -28,6 +28,7 @@
#include "core/rendering/svg/RenderSVGText.h"
#include "core/editing/PositionWithAffinity.h"
#include "core/rendering/HitTestRequest.h"
#include "core/rendering/HitTestResult.h"
#include "core/rendering/PaintInfo.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment