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

Unified Diff: Source/modules/accessibility/AXLayoutObject.cpp

Issue 1156353003: Added ability to distinguished between rich and plain text editables on accessibility objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed to isRichlyEditable. Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.h ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXLayoutObject.cpp
diff --git a/Source/modules/accessibility/AXLayoutObject.cpp b/Source/modules/accessibility/AXLayoutObject.cpp
index 04a1ced44250973f3cc69c4fcd0e4ebf42015e0c..b8e73ec7d5a6117307a07432d4070ccfeeab38e5 100644
--- a/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/Source/modules/accessibility/AXLayoutObject.cpp
@@ -375,6 +375,29 @@ static bool isLinkable(const AXObject& object)
return object.isLink() || object.isImage() || object.layoutObject()->isText();
}
+bool AXLayoutObject::isRichlyEditable() const
+{
+ ASSERT(node());
+ ASSERT(m_layoutObject);
+
+ // Requires m_layoutObject to be present because it relies on style
+ // user-modify. Don't move this logic to AXNodeObject.
+ // TODO(nektar): Implement support in AXNodeObject for aria-hidden and canvas.
+ if (node()->isContentRichlyEditable())
+ return true;
+
+ if (isWebArea()) {
+ Document& document = m_layoutObject->document();
+ HTMLElement* body = document.body();
+ if (body && body->isContentRichlyEditable())
+ return true;
+
+ return document.isContentRichlyEditable();
+ }
+
+ return false;
+}
+
bool AXLayoutObject::isLinked() const
{
if (!isLinkable(*this))
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.h ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698