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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 { | 116 { |
117 if (isDetached()) | 117 if (isDetached()) |
118 return -1; | 118 return -1; |
119 | 119 |
120 return m_private->axObjectID(); | 120 return m_private->axObjectID(); |
121 } | 121 } |
122 | 122 |
123 bool WebAXObject::updateLayoutAndCheckValidity() | 123 bool WebAXObject::updateLayoutAndCheckValidity() |
124 { | 124 { |
125 if (!isDetached()) { | 125 if (!isDetached()) { |
126 Document* document = m_private->document(); | 126 Document* document = m_private->getDocument(); |
127 if (!document || !document->topDocument().view()) | 127 if (!document || !document->topDocument().view()) |
128 return false; | 128 return false; |
129 document->view()->updateAllLifecyclePhases(); | 129 document->view()->updateAllLifecyclePhases(); |
130 } | 130 } |
131 | 131 |
132 // Doing a layout can cause this object to be invalid, so check again. | 132 // Doing a layout can cause this object to be invalid, so check again. |
133 return !isDetached(); | 133 return !isDetached(); |
134 } | 134 } |
135 | 135 |
136 WebString WebAXObject::actionVerb() const | 136 WebString WebAXObject::actionVerb() const |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 // from Chromium. http://crbug.com/489590 | 624 // from Chromium. http://crbug.com/489590 |
625 | 625 |
626 return false; | 626 return false; |
627 } | 627 } |
628 | 628 |
629 WebRect WebAXObject::boundingBoxRect() const | 629 WebRect WebAXObject::boundingBoxRect() const |
630 { | 630 { |
631 if (isDetached()) | 631 if (isDetached()) |
632 return WebRect(); | 632 return WebRect(); |
633 | 633 |
634 ASSERT(isLayoutClean(m_private->document())); | 634 ASSERT(isLayoutClean(m_private->getDocument())); |
635 | 635 |
636 return pixelSnappedIntRect(m_private->elementRect()); | 636 return pixelSnappedIntRect(m_private->elementRect()); |
637 } | 637 } |
638 | 638 |
639 float WebAXObject::fontSize() const | 639 float WebAXObject::fontSize() const |
640 { | 640 { |
641 if (isDetached()) | 641 if (isDetached()) |
642 return 0.0f; | 642 return 0.0f; |
643 | 643 |
644 return m_private->fontSize(); | 644 return m_private->fontSize(); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 return; | 916 return; |
917 | 917 |
918 m_private->setValue(value); | 918 m_private->setValue(value); |
919 } | 919 } |
920 | 920 |
921 void WebAXObject::showContextMenu() const | 921 void WebAXObject::showContextMenu() const |
922 { | 922 { |
923 if (isDetached()) | 923 if (isDetached()) |
924 return; | 924 return; |
925 | 925 |
926 Node* node = m_private->node(); | 926 Node* node = m_private->getNode(); |
927 if (!node) | 927 if (!node) |
928 return; | 928 return; |
929 | 929 |
930 Element* element = nullptr; | 930 Element* element = nullptr; |
931 if (node->isElementNode()) { | 931 if (node->isElementNode()) { |
932 element = toElement(node); | 932 element = toElement(node); |
933 } else { | 933 } else { |
934 node->updateDistribution(); | 934 node->updateDistribution(); |
935 ContainerNode* parent = FlatTreeTraversal::parent(*node); | 935 ContainerNode* parent = FlatTreeTraversal::parent(*node); |
936 ASSERT_WITH_SECURITY_IMPLICATION(parent->isElementNode()); | 936 ASSERT_WITH_SECURITY_IMPLICATION(parent->isElementNode()); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 return 0.0; | 1075 return 0.0; |
1076 | 1076 |
1077 return m_private->minValueForRange(); | 1077 return m_private->minValueForRange(); |
1078 } | 1078 } |
1079 | 1079 |
1080 WebNode WebAXObject::node() const | 1080 WebNode WebAXObject::node() const |
1081 { | 1081 { |
1082 if (isDetached()) | 1082 if (isDetached()) |
1083 return WebNode(); | 1083 return WebNode(); |
1084 | 1084 |
1085 Node* node = m_private->node(); | 1085 Node* node = m_private->getNode(); |
1086 if (!node) | 1086 if (!node) |
1087 return WebNode(); | 1087 return WebNode(); |
1088 | 1088 |
1089 return WebNode(node); | 1089 return WebNode(node); |
1090 } | 1090 } |
1091 | 1091 |
1092 WebDocument WebAXObject::document() const | 1092 WebDocument WebAXObject::document() const |
1093 { | 1093 { |
1094 if (isDetached()) | 1094 if (isDetached()) |
1095 return WebDocument(); | 1095 return WebDocument(); |
1096 | 1096 |
1097 Document* document = m_private->document(); | 1097 Document* document = m_private->getDocument(); |
1098 if (!document) | 1098 if (!document) |
1099 return WebDocument(); | 1099 return WebDocument(); |
1100 | 1100 |
1101 return WebDocument(document); | 1101 return WebDocument(document); |
1102 } | 1102 } |
1103 | 1103 |
1104 bool WebAXObject::hasComputedStyle() const | 1104 bool WebAXObject::hasComputedStyle() const |
1105 { | 1105 { |
1106 if (isDetached()) | 1106 if (isDetached()) |
1107 return false; | 1107 return false; |
1108 | 1108 |
1109 Document* document = m_private->document(); | 1109 Document* document = m_private->getDocument(); |
1110 if (document) | 1110 if (document) |
1111 document->updateLayoutTree(); | 1111 document->updateLayoutTree(); |
1112 | 1112 |
1113 Node* node = m_private->node(); | 1113 Node* node = m_private->getNode(); |
1114 if (!node) | 1114 if (!node) |
1115 return false; | 1115 return false; |
1116 | 1116 |
1117 return node->ensureComputedStyle(); | 1117 return node->ensureComputedStyle(); |
1118 } | 1118 } |
1119 | 1119 |
1120 WebString WebAXObject::computedStyleDisplay() const | 1120 WebString WebAXObject::computedStyleDisplay() const |
1121 { | 1121 { |
1122 if (isDetached()) | 1122 if (isDetached()) |
1123 return WebString(); | 1123 return WebString(); |
1124 | 1124 |
1125 Document* document = m_private->document(); | 1125 Document* document = m_private->getDocument(); |
1126 if (document) | 1126 if (document) |
1127 document->updateLayoutTree(); | 1127 document->updateLayoutTree(); |
1128 | 1128 |
1129 Node* node = m_private->node(); | 1129 Node* node = m_private->getNode(); |
1130 if (!node) | 1130 if (!node) |
1131 return WebString(); | 1131 return WebString(); |
1132 | 1132 |
1133 const ComputedStyle* computedStyle = node->ensureComputedStyle(); | 1133 const ComputedStyle* computedStyle = node->ensureComputedStyle(); |
1134 if (!computedStyle) | 1134 if (!computedStyle) |
1135 return WebString(); | 1135 return WebString(); |
1136 | 1136 |
1137 return WebString(CSSPrimitiveValue::create(computedStyle->display())->cssTex
t()); | 1137 return WebString(CSSPrimitiveValue::create(computedStyle->display())->cssTex
t()); |
1138 } | 1138 } |
1139 | 1139 |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 m_private = object; | 1508 m_private = object; |
1509 return *this; | 1509 return *this; |
1510 } | 1510 } |
1511 | 1511 |
1512 WebAXObject::operator AXObject*() const | 1512 WebAXObject::operator AXObject*() const |
1513 { | 1513 { |
1514 return m_private.get(); | 1514 return m_private.get(); |
1515 } | 1515 } |
1516 | 1516 |
1517 } // namespace blink | 1517 } // namespace blink |
OLD | NEW |