| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |