Chromium Code Reviews| Index: content/browser/accessibility/ax_platform_position.cc |
| diff --git a/content/browser/accessibility/ax_platform_position.cc b/content/browser/accessibility/ax_platform_position.cc |
| index 3c8c460c529022aa4f5e9c4dd2554c4ea83a0b7d..c5ed3a87c0e86b22b4f0509aafdf6423b33d2a46 100644 |
| --- a/content/browser/accessibility/ax_platform_position.cc |
| +++ b/content/browser/accessibility/ax_platform_position.cc |
| @@ -99,6 +99,21 @@ int AXPlatformPosition::MaxTextOffset() const { |
| return static_cast<int>(GetInnerText().length()); |
| } |
| +#if defined(OS_WIN) || \ |
|
dmazzoni
2017/03/10 19:32:25
Nit: put the #if inside the function, not outside
|
| + (defined(OS_LINUX) && defined(USE_X11) && !defined(OS_CHROMEOS)) |
| +int AXPlatformPosition::MaxTextOffsetInParent() const { |
| + if (IsNullPosition()) |
| + return INVALID_OFFSET; |
| + if (GetAnchor()->IsTextOnlyObject()) |
| + return MaxTextOffset(); |
| + return 1; |
| +} |
| +#else |
| +int AXPlatformPosition::MaxTextOffsetInParent() const { |
| + return MaxTextOffset(); |
| +} |
| +#endif |
| + |
| bool AXPlatformPosition::IsInLineBreak() const { |
| if (IsNullPosition()) |
| return false; |