| 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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 | 707 |
| 708 // FIXME: This method passes in a point that has page scale applied but assumes
that (0, 0) | 708 // FIXME: This method passes in a point that has page scale applied but assumes
that (0, 0) |
| 709 // is the top left of the visual viewport. In other words, the point has the Pin
chViewport | 709 // is the top left of the visual viewport. In other words, the point has the Pin
chViewport |
| 710 // scale applied, but not the PinchViewport offset. crbug.com/459591. | 710 // scale applied, but not the PinchViewport offset. crbug.com/459591. |
| 711 WebAXObject WebAXObject::hitTest(const WebPoint& point) const | 711 WebAXObject WebAXObject::hitTest(const WebPoint& point) const |
| 712 { | 712 { |
| 713 if (isDetached()) | 713 if (isDetached()) |
| 714 return WebAXObject(); | 714 return WebAXObject(); |
| 715 | 715 |
| 716 IntPoint contentsPoint = m_private->documentFrameView()->soonToBeRemovedUnsc
aledViewportToContents(point); | 716 IntPoint contentsPoint = m_private->documentFrameView()->soonToBeRemovedUnsc
aledViewportToContents(point); |
| 717 RefPtr<AXObject> hit = m_private->accessibilityHitTest(contentsPoint); | 717 RefPtrWillBeRawPtr<AXObject> hit = m_private->accessibilityHitTest(contentsP
oint); |
| 718 | 718 |
| 719 if (hit) | 719 if (hit) |
| 720 return WebAXObject(hit); | 720 return WebAXObject(hit); |
| 721 | 721 |
| 722 if (m_private->elementRect().contains(contentsPoint)) | 722 if (m_private->elementRect().contains(contentsPoint)) |
| 723 return *this; | 723 return *this; |
| 724 | 724 |
| 725 return WebAXObject(); | 725 return WebAXObject(); |
| 726 } | 726 } |
| 727 | 727 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 { | 1059 { |
| 1060 return deprecatedTitleUIElement(); | 1060 return deprecatedTitleUIElement(); |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 WebString WebAXObject::name(WebAXNameFrom& outNameFrom, WebVector<WebAXObject>&
outNameObjects) | 1063 WebString WebAXObject::name(WebAXNameFrom& outNameFrom, WebVector<WebAXObject>&
outNameObjects) |
| 1064 { | 1064 { |
| 1065 if (isDetached()) | 1065 if (isDetached()) |
| 1066 return WebString(); | 1066 return WebString(); |
| 1067 | 1067 |
| 1068 AXNameFrom nameFrom = AXNameFromAttribute; | 1068 AXNameFrom nameFrom = AXNameFromAttribute; |
| 1069 Vector<AXObject*> nameObjects; | 1069 WillBeHeapVector<RawPtrWillBeMember<AXObject>> nameObjects; |
| 1070 WebString result = m_private->name(nameFrom, nameObjects); | 1070 WebString result = m_private->name(nameFrom, nameObjects); |
| 1071 outNameFrom = static_cast<WebAXNameFrom>(nameFrom); | 1071 outNameFrom = static_cast<WebAXNameFrom>(nameFrom); |
| 1072 | 1072 |
| 1073 WebVector<WebAXObject> webNameObjects(nameObjects.size()); | 1073 WebVector<WebAXObject> webNameObjects(nameObjects.size()); |
| 1074 for (size_t i = 0; i < nameObjects.size(); i++) | 1074 for (size_t i = 0; i < nameObjects.size(); i++) |
| 1075 webNameObjects[i] = WebAXObject(nameObjects[i]); | 1075 webNameObjects[i] = WebAXObject(nameObjects[i]); |
| 1076 outNameObjects.swap(webNameObjects); | 1076 outNameObjects.swap(webNameObjects); |
| 1077 | 1077 |
| 1078 return result; | 1078 return result; |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 WebString WebAXObject::description(WebAXNameFrom nameFrom, WebAXDescriptionFrom&
outDescriptionFrom, WebVector<WebAXObject>& outDescriptionObjects) | 1081 WebString WebAXObject::description(WebAXNameFrom nameFrom, WebAXDescriptionFrom&
outDescriptionFrom, WebVector<WebAXObject>& outDescriptionObjects) |
| 1082 { | 1082 { |
| 1083 if (isDetached()) | 1083 if (isDetached()) |
| 1084 return WebString(); | 1084 return WebString(); |
| 1085 | 1085 |
| 1086 AXDescriptionFrom descriptionFrom; | 1086 AXDescriptionFrom descriptionFrom; |
| 1087 Vector<AXObject*> descriptionObjects; | 1087 WillBeHeapVector<RawPtrWillBeMember<AXObject>> descriptionObjects; |
| 1088 String result = m_private->description(static_cast<AXNameFrom>(nameFrom), de
scriptionFrom, descriptionObjects); | 1088 String result = m_private->description(static_cast<AXNameFrom>(nameFrom), de
scriptionFrom, descriptionObjects); |
| 1089 outDescriptionFrom = static_cast<WebAXDescriptionFrom>(descriptionFrom); | 1089 outDescriptionFrom = static_cast<WebAXDescriptionFrom>(descriptionFrom); |
| 1090 | 1090 |
| 1091 WebVector<WebAXObject> webDescriptionObjects(descriptionObjects.size()); | 1091 WebVector<WebAXObject> webDescriptionObjects(descriptionObjects.size()); |
| 1092 for (size_t i = 0; i < descriptionObjects.size(); i++) | 1092 for (size_t i = 0; i < descriptionObjects.size(); i++) |
| 1093 webDescriptionObjects[i] = WebAXObject(descriptionObjects[i]); | 1093 webDescriptionObjects[i] = WebAXObject(descriptionObjects[i]); |
| 1094 outDescriptionObjects.swap(webDescriptionObjects); | 1094 outDescriptionObjects.swap(webDescriptionObjects); |
| 1095 | 1095 |
| 1096 return result; | 1096 return result; |
| 1097 } | 1097 } |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 if (!isDetached()) | 1564 if (!isDetached()) |
| 1565 m_private->scrollToMakeVisibleWithSubFocus(subfocus); | 1565 m_private->scrollToMakeVisibleWithSubFocus(subfocus); |
| 1566 } | 1566 } |
| 1567 | 1567 |
| 1568 void WebAXObject::scrollToGlobalPoint(const WebPoint& point) const | 1568 void WebAXObject::scrollToGlobalPoint(const WebPoint& point) const |
| 1569 { | 1569 { |
| 1570 if (!isDetached()) | 1570 if (!isDetached()) |
| 1571 m_private->scrollToGlobalPoint(point); | 1571 m_private->scrollToGlobalPoint(point); |
| 1572 } | 1572 } |
| 1573 | 1573 |
| 1574 WebAXObject::WebAXObject(const WTF::PassRefPtr<AXObject>& object) | 1574 WebAXObject::WebAXObject(const PassRefPtrWillBeRawPtr<AXObject>& object) |
| 1575 : m_private(object) | 1575 : m_private(object) |
| 1576 { | 1576 { |
| 1577 } | 1577 } |
| 1578 | 1578 |
| 1579 WebAXObject& WebAXObject::operator=(const WTF::PassRefPtr<AXObject>& object) | 1579 WebAXObject& WebAXObject::operator=(const PassRefPtrWillBeRawPtr<AXObject>& obje
ct) |
| 1580 { | 1580 { |
| 1581 m_private = object; | 1581 m_private = object; |
| 1582 return *this; | 1582 return *this; |
| 1583 } | 1583 } |
| 1584 | 1584 |
| 1585 WebAXObject::operator WTF::PassRefPtr<AXObject>() const | 1585 WebAXObject::operator PassRefPtrWillBeRawPtr<AXObject>() const |
| 1586 { | 1586 { |
| 1587 return m_private.get(); | 1587 return m_private.get(); |
| 1588 } | 1588 } |
| 1589 | 1589 |
| 1590 } // namespace blink | 1590 } // namespace blink |
| OLD | NEW |