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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "core/rendering/style/RenderStyle.h" | 47 #include "core/rendering/style/RenderStyle.h" |
48 #include "platform/PlatformKeyboardEvent.h" | 48 #include "platform/PlatformKeyboardEvent.h" |
49 #include "public/platform/WebPoint.h" | 49 #include "public/platform/WebPoint.h" |
50 #include "public/platform/WebRect.h" | 50 #include "public/platform/WebRect.h" |
51 #include "public/platform/WebString.h" | 51 #include "public/platform/WebString.h" |
52 #include "public/platform/WebURL.h" | 52 #include "public/platform/WebURL.h" |
53 #include "public/web/WebDocument.h" | 53 #include "public/web/WebDocument.h" |
54 #include "public/web/WebNode.h" | 54 #include "public/web/WebNode.h" |
55 #include "wtf/text/StringBuilder.h" | 55 #include "wtf/text/StringBuilder.h" |
56 | 56 |
57 using namespace WebCore; | 57 using namespace blink; |
58 | 58 |
59 namespace blink { | 59 namespace blink { |
60 | 60 |
61 void WebAXObject::reset() | 61 void WebAXObject::reset() |
62 { | 62 { |
63 m_private.reset(); | 63 m_private.reset(); |
64 } | 64 } |
65 | 65 |
66 void WebAXObject::assign(const blink::WebAXObject& other) | 66 void WebAXObject::assign(const blink::WebAXObject& other) |
67 { | 67 { |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 } | 954 } |
955 | 955 |
956 WebAXObject WebAXObject::cellForColumnAndRow(unsigned column, unsigned row) cons
t | 956 WebAXObject WebAXObject::cellForColumnAndRow(unsigned column, unsigned row) cons
t |
957 { | 957 { |
958 if (isDetached()) | 958 if (isDetached()) |
959 return WebAXObject(); | 959 return WebAXObject(); |
960 | 960 |
961 if (!m_private->isAXTable()) | 961 if (!m_private->isAXTable()) |
962 return WebAXObject(); | 962 return WebAXObject(); |
963 | 963 |
964 WebCore::AXTableCell* cell = toAXTable(m_private.get())->cellForColumnAndRow
(column, row); | 964 blink::AXTableCell* cell = toAXTable(m_private.get())->cellForColumnAndRow(c
olumn, row); |
965 return WebAXObject(static_cast<WebCore::AXObject*>(cell)); | 965 return WebAXObject(static_cast<blink::AXObject*>(cell)); |
966 } | 966 } |
967 | 967 |
968 WebAXObject WebAXObject::headerContainerObject() const | 968 WebAXObject WebAXObject::headerContainerObject() const |
969 { | 969 { |
970 if (isDetached()) | 970 if (isDetached()) |
971 return WebAXObject(); | 971 return WebAXObject(); |
972 | 972 |
973 if (!m_private->isAXTable()) | 973 if (!m_private->isAXTable()) |
974 return WebAXObject(); | 974 return WebAXObject(); |
975 | 975 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 } | 1007 } |
1008 | 1008 |
1009 unsigned WebAXObject::rowIndex() const | 1009 unsigned WebAXObject::rowIndex() const |
1010 { | 1010 { |
1011 if (isDetached()) | 1011 if (isDetached()) |
1012 return 0; | 1012 return 0; |
1013 | 1013 |
1014 if (!m_private->isTableRow()) | 1014 if (!m_private->isTableRow()) |
1015 return 0; | 1015 return 0; |
1016 | 1016 |
1017 return WebCore::toAXTableRow(m_private.get())->rowIndex(); | 1017 return blink::toAXTableRow(m_private.get())->rowIndex(); |
1018 } | 1018 } |
1019 | 1019 |
1020 WebAXObject WebAXObject::rowHeader() const | 1020 WebAXObject WebAXObject::rowHeader() const |
1021 { | 1021 { |
1022 if (isDetached()) | 1022 if (isDetached()) |
1023 return WebAXObject(); | 1023 return WebAXObject(); |
1024 | 1024 |
1025 if (!m_private->isTableRow()) | 1025 if (!m_private->isTableRow()) |
1026 return WebAXObject(); | 1026 return WebAXObject(); |
1027 | 1027 |
1028 return WebAXObject(WebCore::toAXTableRow(m_private.get())->headerObject()); | 1028 return WebAXObject(blink::toAXTableRow(m_private.get())->headerObject()); |
1029 } | 1029 } |
1030 | 1030 |
1031 unsigned WebAXObject::columnIndex() const | 1031 unsigned WebAXObject::columnIndex() const |
1032 { | 1032 { |
1033 if (isDetached()) | 1033 if (isDetached()) |
1034 return 0; | 1034 return 0; |
1035 | 1035 |
1036 if (m_private->roleValue() != ColumnRole) | 1036 if (m_private->roleValue() != ColumnRole) |
1037 return 0; | 1037 return 0; |
1038 | 1038 |
1039 return WebCore::toAXTableColumn(m_private.get())->columnIndex(); | 1039 return blink::toAXTableColumn(m_private.get())->columnIndex(); |
1040 } | 1040 } |
1041 | 1041 |
1042 WebAXObject WebAXObject::columnHeader() const | 1042 WebAXObject WebAXObject::columnHeader() const |
1043 { | 1043 { |
1044 if (isDetached()) | 1044 if (isDetached()) |
1045 return WebAXObject(); | 1045 return WebAXObject(); |
1046 | 1046 |
1047 if (m_private->roleValue() != ColumnRole) | 1047 if (m_private->roleValue() != ColumnRole) |
1048 return WebAXObject(); | 1048 return WebAXObject(); |
1049 | 1049 |
1050 return WebAXObject(WebCore::toAXTableColumn(m_private.get())->headerObject()
); | 1050 return WebAXObject(blink::toAXTableColumn(m_private.get())->headerObject()); |
1051 } | 1051 } |
1052 | 1052 |
1053 unsigned WebAXObject::cellColumnIndex() const | 1053 unsigned WebAXObject::cellColumnIndex() const |
1054 { | 1054 { |
1055 if (isDetached()) | 1055 if (isDetached()) |
1056 return 0; | 1056 return 0; |
1057 | 1057 |
1058 if (!m_private->isTableCell()) | 1058 if (!m_private->isTableCell()) |
1059 return 0; | 1059 return 0; |
1060 | 1060 |
1061 pair<unsigned, unsigned> columnRange; | 1061 pair<unsigned, unsigned> columnRange; |
1062 WebCore::toAXTableCell(m_private.get())->columnIndexRange(columnRange); | 1062 blink::toAXTableCell(m_private.get())->columnIndexRange(columnRange); |
1063 return columnRange.first; | 1063 return columnRange.first; |
1064 } | 1064 } |
1065 | 1065 |
1066 unsigned WebAXObject::cellColumnSpan() const | 1066 unsigned WebAXObject::cellColumnSpan() const |
1067 { | 1067 { |
1068 if (isDetached()) | 1068 if (isDetached()) |
1069 return 0; | 1069 return 0; |
1070 | 1070 |
1071 if (!m_private->isTableCell()) | 1071 if (!m_private->isTableCell()) |
1072 return 0; | 1072 return 0; |
1073 | 1073 |
1074 pair<unsigned, unsigned> columnRange; | 1074 pair<unsigned, unsigned> columnRange; |
1075 WebCore::toAXTableCell(m_private.get())->columnIndexRange(columnRange); | 1075 blink::toAXTableCell(m_private.get())->columnIndexRange(columnRange); |
1076 return columnRange.second; | 1076 return columnRange.second; |
1077 } | 1077 } |
1078 | 1078 |
1079 unsigned WebAXObject::cellRowIndex() const | 1079 unsigned WebAXObject::cellRowIndex() const |
1080 { | 1080 { |
1081 if (isDetached()) | 1081 if (isDetached()) |
1082 return 0; | 1082 return 0; |
1083 | 1083 |
1084 if (!m_private->isTableCell()) | 1084 if (!m_private->isTableCell()) |
1085 return 0; | 1085 return 0; |
1086 | 1086 |
1087 pair<unsigned, unsigned> rowRange; | 1087 pair<unsigned, unsigned> rowRange; |
1088 WebCore::toAXTableCell(m_private.get())->rowIndexRange(rowRange); | 1088 blink::toAXTableCell(m_private.get())->rowIndexRange(rowRange); |
1089 return rowRange.first; | 1089 return rowRange.first; |
1090 } | 1090 } |
1091 | 1091 |
1092 unsigned WebAXObject::cellRowSpan() const | 1092 unsigned WebAXObject::cellRowSpan() const |
1093 { | 1093 { |
1094 if (isDetached()) | 1094 if (isDetached()) |
1095 return 0; | 1095 return 0; |
1096 | 1096 |
1097 if (!m_private->isTableCell()) | 1097 if (!m_private->isTableCell()) |
1098 return 0; | 1098 return 0; |
1099 | 1099 |
1100 pair<unsigned, unsigned> rowRange; | 1100 pair<unsigned, unsigned> rowRange; |
1101 WebCore::toAXTableCell(m_private.get())->rowIndexRange(rowRange); | 1101 blink::toAXTableCell(m_private.get())->rowIndexRange(rowRange); |
1102 return rowRange.second; | 1102 return rowRange.second; |
1103 } | 1103 } |
1104 | 1104 |
1105 WebAXTextDirection WebAXObject::textDirection() const | 1105 WebAXTextDirection WebAXObject::textDirection() const |
1106 { | 1106 { |
1107 if (isDetached()) | 1107 if (isDetached()) |
1108 return WebAXTextDirectionLR; | 1108 return WebAXTextDirectionLR; |
1109 | 1109 |
1110 return static_cast<WebAXTextDirection>(m_private->textDirection()); | 1110 return static_cast<WebAXTextDirection>(m_private->textDirection()); |
1111 } | 1111 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 if (!isDetached()) | 1154 if (!isDetached()) |
1155 m_private->scrollToMakeVisibleWithSubFocus(subfocus); | 1155 m_private->scrollToMakeVisibleWithSubFocus(subfocus); |
1156 } | 1156 } |
1157 | 1157 |
1158 void WebAXObject::scrollToGlobalPoint(const WebPoint& point) const | 1158 void WebAXObject::scrollToGlobalPoint(const WebPoint& point) const |
1159 { | 1159 { |
1160 if (!isDetached()) | 1160 if (!isDetached()) |
1161 m_private->scrollToGlobalPoint(point); | 1161 m_private->scrollToGlobalPoint(point); |
1162 } | 1162 } |
1163 | 1163 |
1164 WebAXObject::WebAXObject(const WTF::PassRefPtr<WebCore::AXObject>& object) | 1164 WebAXObject::WebAXObject(const WTF::PassRefPtr<blink::AXObject>& object) |
1165 : m_private(object) | 1165 : m_private(object) |
1166 { | 1166 { |
1167 } | 1167 } |
1168 | 1168 |
1169 WebAXObject& WebAXObject::operator=(const WTF::PassRefPtr<WebCore::AXObject>& ob
ject) | 1169 WebAXObject& WebAXObject::operator=(const WTF::PassRefPtr<blink::AXObject>& obje
ct) |
1170 { | 1170 { |
1171 m_private = object; | 1171 m_private = object; |
1172 return *this; | 1172 return *this; |
1173 } | 1173 } |
1174 | 1174 |
1175 WebAXObject::operator WTF::PassRefPtr<WebCore::AXObject>() const | 1175 WebAXObject::operator WTF::PassRefPtr<blink::AXObject>() const |
1176 { | 1176 { |
1177 return m_private.get(); | 1177 return m_private.get(); |
1178 } | 1178 } |
1179 | 1179 |
1180 } // namespace blink | 1180 } // namespace blink |
OLD | NEW |