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

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 new function to isContentRichlyEditable. 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
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::isContentRichlyEditable() const
379 {
380 ASSERT(node());
381 ASSERT(m_layoutObject);
382
383 if (node()->isContentRichlyEditable())
384 return true;
385
386 if (isWebArea()) {
387 Document& document = m_layoutObject->document();
388 HTMLElement* body = document.body();
389 if (body && body->isContentRichlyEditable())
390 return true;
391
392 return document.isContentRichlyEditable();
393 }
394
395 return false;
396 }
397
378 bool AXLayoutObject::isLinked() const 398 bool AXLayoutObject::isLinked() const
379 { 399 {
380 if (!isLinkable(*this)) 400 if (!isLinkable(*this))
381 return false; 401 return false;
382 402
383 Element* anchor = anchorElement(); 403 Element* anchor = anchorElement();
384 if (!isHTMLAnchorElement(anchor)) 404 if (!isHTMLAnchorElement(anchor))
385 return false; 405 return false;
386 406
387 return !toHTMLAnchorElement(*anchor).href().isEmpty(); 407 return !toHTMLAnchorElement(*anchor).href().isEmpty();
(...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2488 if (label && label->layoutObject()) { 2508 if (label && label->layoutObject()) {
2489 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2509 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2490 result.unite(labelRect); 2510 result.unite(labelRect);
2491 } 2511 }
2492 } 2512 }
2493 2513
2494 return result; 2514 return result;
2495 } 2515 }
2496 2516
2497 } // namespace blink 2517 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698