Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(952)

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp

Issue 2372823002: Fix a case where the accessible bounding box of an inline text box was wrong. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 AXObject::detach(); 59 AXObject::detach();
60 m_inlineTextBox = nullptr; 60 m_inlineTextBox = nullptr;
61 } 61 }
62 62
63 void AXInlineTextBox::getRelativeBounds(AXObject** outContainer, FloatRect& outB oundsInContainer, SkMatrix44& outContainerTransform) const 63 void AXInlineTextBox::getRelativeBounds(AXObject** outContainer, FloatRect& outB oundsInContainer, SkMatrix44& outContainerTransform) const
64 { 64 {
65 *outContainer = nullptr; 65 *outContainer = nullptr;
66 outBoundsInContainer = FloatRect(); 66 outBoundsInContainer = FloatRect();
67 outContainerTransform.setIdentity(); 67 outContainerTransform.setIdentity();
68 68
69 if (!m_inlineTextBox) 69 if (!m_inlineTextBox || !parentObject() || !parentObject()->getLayoutObject( ))
chrishtr 2016/09/26 23:42:51 Why are these conditionals needed?
dmazzoni 2016/09/27 16:07:47 In general, accessibility objects outlive layout o
70 return; 70 return;
71 71
72 *outContainer = parentObject(); 72 *outContainer = parentObject();
73 outBoundsInContainer = FloatRect(m_inlineTextBox->localBounds()); 73 outBoundsInContainer = FloatRect(m_inlineTextBox->localBounds());
74 LayoutObject* parentLayoutObject = parentObject()->getLayoutObject();
75 outBoundsInContainer.moveBy(-parentLayoutObject->localBoundingBoxRectForAcce ssibility().location());
74 } 76 }
75 77
76 bool AXInlineTextBox::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReaso ns) const 78 bool AXInlineTextBox::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReaso ns) const
77 { 79 {
78 AXObject* parent = parentObject(); 80 AXObject* parent = parentObject();
79 if (!parent) 81 if (!parent)
80 return false; 82 return false;
81 83
82 if (!parent->accessibilityIsIgnored()) 84 if (!parent->accessibilityIsIgnored())
83 return false; 85 return false;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (previousOnLine) 178 if (previousOnLine)
177 return m_axObjectCache->getOrCreate(previousOnLine.get()); 179 return m_axObjectCache->getOrCreate(previousOnLine.get());
178 180
179 if (!m_inlineTextBox->isFirst()) 181 if (!m_inlineTextBox->isFirst())
180 return 0; 182 return 0;
181 183
182 return parentObject()->previousOnLine(); 184 return parentObject()->previousOnLine();
183 } 185 }
184 186
185 } // namespace blink 187 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698