Commit bdf09ee2 authored by nektar's avatar nektar Committed by Commit bot

Added some methods to abstract inline text boxes.

GetNode, IsAXInlineTextBox, Detach.
These will most likely be needed for adding SetSelection support to this class.
R=dmazzoni@chromium.org, cbiesinger@chromium.org

Review-Url: https://codereview.chromium.org/2855043003
Cr-Commit-Position: refs/heads/master@{#471148}
parent df9197b5
......@@ -78,7 +78,7 @@ AbstractInlineTextBox::~AbstractInlineTextBox() {
}
void AbstractInlineTextBox::Detach() {
if (Node* node = line_layout_item_.GetNode()) {
if (Node* node = GetNode()) {
if (AXObjectCache* cache = node->GetDocument().ExistingAXObjectCache())
cache->Remove(this);
}
......
......@@ -79,6 +79,7 @@ class CORE_EXPORT AbstractInlineTextBox
LayoutRect LocalBounds() const;
unsigned Len() const;
Direction GetDirection() const;
Node* GetNode() const { return line_layout_item_.GetNode(); }
void CharacterWidths(Vector<float>&) const;
void GetWordBoundaries(Vector<WordBoundaries>&) const;
String GetText() const;
......
......@@ -34,6 +34,7 @@
namespace blink {
class Node;
class AXObjectCacheImpl;
class AXInlineTextBox final : public AXObject {
......@@ -46,9 +47,13 @@ class AXInlineTextBox final : public AXObject {
static AXInlineTextBox* Create(PassRefPtr<AbstractInlineTextBox>,
AXObjectCacheImpl&);
protected:
void Init() override;
void Detach() override;
bool IsDetached() const override { return !inline_text_box_; }
bool IsAXInlineTextBox() const override { return true; }
public:
AccessibilityRole RoleValue() const override { return kInlineTextBoxRole; }
String GetName(AXNameFrom&,
AXObject::AXObjectVector* name_objects) const override;
......@@ -59,6 +64,7 @@ class AXInlineTextBox final : public AXObject {
SkMatrix44& out_container_transform) const override;
AXObject* ComputeParent() const override;
AccessibilityTextDirection GetTextDirection() const override;
Node* GetNode() const override { return inline_text_box_->GetNode(); }
AXObject* NextOnLine() const override;
AXObject* PreviousOnLine() const override;
......
......@@ -614,6 +614,7 @@ class MODULES_EXPORT AXObject : public GarbageCollectedFinalized<AXObject> {
// Determine subclass type.
virtual bool IsAXNodeObject() const { return false; }
virtual bool IsAXLayoutObject() const { return false; }
virtual bool IsAXInlineTextBox() const { return false; }
virtual bool IsAXListBox() const { return false; }
virtual bool IsAXListBoxOption() const { return false; }
virtual bool IsAXRadioInput() const { return false; }
......
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