OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013, Google Inc. All rights reserved. | 2 * Copyright (C) 2013, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 16 matching lines...) Expand all Loading... |
27 */ | 27 */ |
28 | 28 |
29 #ifndef AXInlineTextBox_h | 29 #ifndef AXInlineTextBox_h |
30 #define AXInlineTextBox_h | 30 #define AXInlineTextBox_h |
31 | 31 |
32 #include "core/layout/line/AbstractInlineTextBox.h" | 32 #include "core/layout/line/AbstractInlineTextBox.h" |
33 #include "modules/accessibility/AXObject.h" | 33 #include "modules/accessibility/AXObject.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
| 37 class Node; |
37 class AXObjectCacheImpl; | 38 class AXObjectCacheImpl; |
38 | 39 |
39 class AXInlineTextBox final : public AXObject { | 40 class AXInlineTextBox final : public AXObject { |
40 WTF_MAKE_NONCOPYABLE(AXInlineTextBox); | 41 WTF_MAKE_NONCOPYABLE(AXInlineTextBox); |
41 | 42 |
42 private: | 43 private: |
43 AXInlineTextBox(PassRefPtr<AbstractInlineTextBox>, AXObjectCacheImpl&); | 44 AXInlineTextBox(PassRefPtr<AbstractInlineTextBox>, AXObjectCacheImpl&); |
44 | 45 |
45 public: | 46 public: |
46 static AXInlineTextBox* Create(PassRefPtr<AbstractInlineTextBox>, | 47 static AXInlineTextBox* Create(PassRefPtr<AbstractInlineTextBox>, |
47 AXObjectCacheImpl&); | 48 AXObjectCacheImpl&); |
48 | 49 |
| 50 protected: |
49 void Init() override; | 51 void Init() override; |
50 void Detach() override; | 52 void Detach() override; |
| 53 bool IsDetached() const override { return !inline_text_box_; } |
| 54 bool IsAXInlineTextBox() const override { return true; } |
51 | 55 |
| 56 public: |
52 AccessibilityRole RoleValue() const override { return kInlineTextBoxRole; } | 57 AccessibilityRole RoleValue() const override { return kInlineTextBoxRole; } |
53 String GetName(AXNameFrom&, | 58 String GetName(AXNameFrom&, |
54 AXObject::AXObjectVector* name_objects) const override; | 59 AXObject::AXObjectVector* name_objects) const override; |
55 void TextCharacterOffsets(Vector<int>&) const override; | 60 void TextCharacterOffsets(Vector<int>&) const override; |
56 void GetWordBoundaries(Vector<AXRange>&) const override; | 61 void GetWordBoundaries(Vector<AXRange>&) const override; |
57 void GetRelativeBounds(AXObject** out_container, | 62 void GetRelativeBounds(AXObject** out_container, |
58 FloatRect& out_bounds_in_container, | 63 FloatRect& out_bounds_in_container, |
59 SkMatrix44& out_container_transform) const override; | 64 SkMatrix44& out_container_transform) const override; |
60 AXObject* ComputeParent() const override; | 65 AXObject* ComputeParent() const override; |
61 AccessibilityTextDirection GetTextDirection() const override; | 66 AccessibilityTextDirection GetTextDirection() const override; |
| 67 Node* GetNode() const override { return inline_text_box_->GetNode(); } |
62 AXObject* NextOnLine() const override; | 68 AXObject* NextOnLine() const override; |
63 AXObject* PreviousOnLine() const override; | 69 AXObject* PreviousOnLine() const override; |
64 | 70 |
65 private: | 71 private: |
66 RefPtr<AbstractInlineTextBox> inline_text_box_; | 72 RefPtr<AbstractInlineTextBox> inline_text_box_; |
67 | 73 |
68 bool ComputeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override; | 74 bool ComputeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override; |
69 }; | 75 }; |
70 | 76 |
71 } // namespace blink | 77 } // namespace blink |
72 | 78 |
73 #endif // AXInlineTextBox_h | 79 #endif // AXInlineTextBox_h |
OLD | NEW |