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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.h ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 static bool isLinkable(const AXObject& object) 368 static bool isLinkable(const AXObject& object)
369 { 369 {
370 if (!object.layoutObject()) 370 if (!object.layoutObject())
371 return false; 371 return false;
372 372
373 // See https://wiki.mozilla.org/Accessibility/AT-Windows-API for the element s 373 // See https://wiki.mozilla.org/Accessibility/AT-Windows-API for the element s
374 // Mozilla considers linkable. 374 // Mozilla considers linkable.
375 return object.isLink() || object.isImage() || object.layoutObject()->isText( ); 375 return object.isLink() || object.isImage() || object.layoutObject()->isText( );
376 } 376 }
377 377
378 bool AXLayoutObject::isRichlyEditable() const
379 {
380 ASSERT(node());
381 ASSERT(m_layoutObject);
382
383 // Requires m_layoutObject to be present because it relies on style
384 // user-modify. Don't move this logic to AXNodeObject.
385 // TODO(nektar): Implement support in AXNodeObject for aria-hidden and canva s.
386 if (node()->isContentRichlyEditable())
387 return true;
388
389 if (isWebArea()) {
390 Document& document = m_layoutObject->document();
391 HTMLElement* body = document.body();
392 if (body && body->isContentRichlyEditable())
393 return true;
394
395 return document.isContentRichlyEditable();
396 }
397
398 return false;
399 }
400
378 bool AXLayoutObject::isLinked() const 401 bool AXLayoutObject::isLinked() const
379 { 402 {
380 if (!isLinkable(*this)) 403 if (!isLinkable(*this))
381 return false; 404 return false;
382 405
383 Element* anchor = anchorElement(); 406 Element* anchor = anchorElement();
384 if (!isHTMLAnchorElement(anchor)) 407 if (!isHTMLAnchorElement(anchor))
385 return false; 408 return false;
386 409
387 return !toHTMLAnchorElement(*anchor).href().isEmpty(); 410 return !toHTMLAnchorElement(*anchor).href().isEmpty();
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2484 if (label && label->layoutObject()) { 2507 if (label && label->layoutObject()) {
2485 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2508 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2486 result.unite(labelRect); 2509 result.unite(labelRect);
2487 } 2510 }
2488 } 2511 }
2489 2512
2490 return result; 2513 return result;
2491 } 2514 }
2492 2515
2493 } // namespace blink 2516 } // namespace blink
OLDNEW
« 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