| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 { | 647 { |
| 648 // aria-owns rearranges the accessibility tree rather than just | 648 // aria-owns rearranges the accessibility tree rather than just |
| 649 // exposing an attribute. | 649 // exposing an attribute. |
| 650 | 650 |
| 651 // FIXME(dmazzoni): remove this function after we stop calling it | 651 // FIXME(dmazzoni): remove this function after we stop calling it |
| 652 // from Chromium. http://crbug.com/489590 | 652 // from Chromium. http://crbug.com/489590 |
| 653 | 653 |
| 654 return false; | 654 return false; |
| 655 } | 655 } |
| 656 | 656 |
| 657 WebRect WebAXObject::boundingBoxRect() const | |
| 658 { | |
| 659 if (isDetached()) | |
| 660 return WebRect(); | |
| 661 | |
| 662 #if DCHECK_IS_ON() | |
| 663 DCHECK(isLayoutClean(m_private->getDocument())); | |
| 664 #endif | |
| 665 | |
| 666 return pixelSnappedIntRect(m_private->elementRect()); | |
| 667 } | |
| 668 | |
| 669 WebString WebAXObject::fontFamily() const | 657 WebString WebAXObject::fontFamily() const |
| 670 { | 658 { |
| 671 if (isDetached()) | 659 if (isDetached()) |
| 672 return WebString(); | 660 return WebString(); |
| 673 | 661 |
| 674 return m_private->fontFamily(); | 662 return m_private->fontFamily(); |
| 675 } | 663 } |
| 676 | 664 |
| 677 float WebAXObject::fontSize() const | 665 float WebAXObject::fontSize() const |
| 678 { | 666 { |
| 679 if (isDetached()) | 667 if (isDetached()) |
| 680 return 0.0f; | 668 return 0.0f; |
| 681 | 669 |
| 682 return m_private->fontSize(); | 670 return m_private->fontSize(); |
| 683 } | 671 } |
| 684 | 672 |
| 685 bool WebAXObject::canvasHasFallbackContent() const | 673 bool WebAXObject::canvasHasFallbackContent() const |
| 686 { | 674 { |
| 687 if (isDetached()) | 675 if (isDetached()) |
| 688 return false; | 676 return false; |
| 689 | 677 |
| 690 return m_private->canvasHasFallbackContent(); | 678 return m_private->canvasHasFallbackContent(); |
| 691 } | 679 } |
| 692 | 680 |
| 693 WebPoint WebAXObject::clickPoint() const | |
| 694 { | |
| 695 if (isDetached()) | |
| 696 return WebPoint(); | |
| 697 | |
| 698 return WebPoint(m_private->clickPoint()); | |
| 699 } | |
| 700 | |
| 701 WebAXInvalidState WebAXObject::invalidState() const | 681 WebAXInvalidState WebAXObject::invalidState() const |
| 702 { | 682 { |
| 703 if (isDetached()) | 683 if (isDetached()) |
| 704 return WebAXInvalidStateUndefined; | 684 return WebAXInvalidStateUndefined; |
| 705 | 685 |
| 706 return static_cast<WebAXInvalidState>(m_private->getInvalidState()); | 686 return static_cast<WebAXInvalidState>(m_private->getInvalidState()); |
| 707 } | 687 } |
| 708 | 688 |
| 709 // Only used when invalidState() returns WebAXInvalidStateOther. | 689 // Only used when invalidState() returns WebAXInvalidStateOther. |
| 710 WebString WebAXObject::ariaInvalidValue() const | 690 WebString WebAXObject::ariaInvalidValue() const |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 { | 726 { |
| 747 if (isDetached()) | 727 if (isDetached()) |
| 748 return WebAXObject(); | 728 return WebAXObject(); |
| 749 | 729 |
| 750 IntPoint contentsPoint = m_private->documentFrameView()->soonToBeRemovedUnsc
aledViewportToContents(point); | 730 IntPoint contentsPoint = m_private->documentFrameView()->soonToBeRemovedUnsc
aledViewportToContents(point); |
| 751 AXObject* hit = m_private->accessibilityHitTest(contentsPoint); | 731 AXObject* hit = m_private->accessibilityHitTest(contentsPoint); |
| 752 | 732 |
| 753 if (hit) | 733 if (hit) |
| 754 return WebAXObject(hit); | 734 return WebAXObject(hit); |
| 755 | 735 |
| 756 if (m_private->elementRect().contains(contentsPoint)) | 736 if (m_private->getBoundsInFrameCoordinates().contains(contentsPoint)) |
| 757 return *this; | 737 return *this; |
| 758 | 738 |
| 759 return WebAXObject(); | 739 return WebAXObject(); |
| 760 } | 740 } |
| 761 | 741 |
| 762 WebString WebAXObject::keyboardShortcut() const | 742 WebString WebAXObject::keyboardShortcut() const |
| 763 { | 743 { |
| 764 if (isDetached()) | 744 if (isDetached()) |
| 765 return WebString(); | 745 return WebString(); |
| 766 | 746 |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1581 if (!isDetached()) | 1561 if (!isDetached()) |
| 1582 m_private->scrollToMakeVisibleWithSubFocus(subfocus); | 1562 m_private->scrollToMakeVisibleWithSubFocus(subfocus); |
| 1583 } | 1563 } |
| 1584 | 1564 |
| 1585 void WebAXObject::scrollToGlobalPoint(const WebPoint& point) const | 1565 void WebAXObject::scrollToGlobalPoint(const WebPoint& point) const |
| 1586 { | 1566 { |
| 1587 if (!isDetached()) | 1567 if (!isDetached()) |
| 1588 m_private->scrollToGlobalPoint(point); | 1568 m_private->scrollToGlobalPoint(point); |
| 1589 } | 1569 } |
| 1590 | 1570 |
| 1591 SkMatrix44 WebAXObject::transformFromLocalParentFrame() const | |
| 1592 { | |
| 1593 if (isDetached()) | |
| 1594 return SkMatrix44(); | |
| 1595 | |
| 1596 return m_private->transformFromLocalParentFrame(); | |
| 1597 } | |
| 1598 | |
| 1599 WebAXObject::WebAXObject(AXObject* object) | 1571 WebAXObject::WebAXObject(AXObject* object) |
| 1600 : m_private(object) | 1572 : m_private(object) |
| 1601 { | 1573 { |
| 1602 } | 1574 } |
| 1603 | 1575 |
| 1604 WebAXObject& WebAXObject::operator=(AXObject* object) | 1576 WebAXObject& WebAXObject::operator=(AXObject* object) |
| 1605 { | 1577 { |
| 1606 m_private = object; | 1578 m_private = object; |
| 1607 return *this; | 1579 return *this; |
| 1608 } | 1580 } |
| 1609 | 1581 |
| 1610 WebAXObject::operator AXObject*() const | 1582 WebAXObject::operator AXObject*() const |
| 1611 { | 1583 { |
| 1612 return m_private.get(); | 1584 return m_private.get(); |
| 1613 } | 1585 } |
| 1614 | 1586 |
| 1615 } // namespace blink | 1587 } // namespace blink |
| OLD | NEW |