OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 String Internals::rangeAsText(const Range* range, ExceptionState& exceptionState
) | 1120 String Internals::rangeAsText(const Range* range, ExceptionState& exceptionState
) |
1121 { | 1121 { |
1122 if (!range) { | 1122 if (!range) { |
1123 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Range")); | 1123 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Range")); |
1124 return String(); | 1124 return String(); |
1125 } | 1125 } |
1126 | 1126 |
1127 return range->text(); | 1127 return range->text(); |
1128 } | 1128 } |
1129 | 1129 |
1130 PassRefPtr<DOMPoint> Internals::touchPositionAdjustedToBestClickableNode(long x,
long y, long width, long height, Document* document, ExceptionState& exceptionS
tate) | 1130 PassRefPtrWillBeRawPtr<DOMPoint> Internals::touchPositionAdjustedToBestClickable
Node(long x, long y, long width, long height, Document* document, ExceptionState
& exceptionState) |
1131 { | 1131 { |
1132 if (!document || !document->frame()) { | 1132 if (!document || !document->frame()) { |
1133 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc
ument's frame cannot be retrieved." : "The document provided is invalid."); | 1133 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc
ument's frame cannot be retrieved." : "The document provided is invalid."); |
1134 return nullptr; | 1134 return nullptr; |
1135 } | 1135 } |
1136 | 1136 |
1137 document->updateLayout(); | 1137 document->updateLayout(); |
1138 | 1138 |
1139 IntSize radius(width / 2, height / 2); | 1139 IntSize radius(width / 2, height / 2); |
1140 IntPoint point(x + radius.width(), y + radius.height()); | 1140 IntPoint point(x + radius.width(), y + radius.height()); |
(...skipping 19 matching lines...) Expand all Loading... |
1160 | 1160 |
1161 IntSize radius(width / 2, height / 2); | 1161 IntSize radius(width / 2, height / 2); |
1162 IntPoint point(x + radius.width(), y + radius.height()); | 1162 IntPoint point(x + radius.width(), y + radius.height()); |
1163 | 1163 |
1164 Node* targetNode; | 1164 Node* targetNode; |
1165 IntPoint adjustedPoint; | 1165 IntPoint adjustedPoint; |
1166 document->frame()->eventHandler().bestClickableNodeForTouchPoint(point, radi
us, adjustedPoint, targetNode); | 1166 document->frame()->eventHandler().bestClickableNodeForTouchPoint(point, radi
us, adjustedPoint, targetNode); |
1167 return targetNode; | 1167 return targetNode; |
1168 } | 1168 } |
1169 | 1169 |
1170 PassRefPtr<DOMPoint> Internals::touchPositionAdjustedToBestContextMenuNode(long
x, long y, long width, long height, Document* document, ExceptionState& exceptio
nState) | 1170 PassRefPtrWillBeRawPtr<DOMPoint> Internals::touchPositionAdjustedToBestContextMe
nuNode(long x, long y, long width, long height, Document* document, ExceptionSta
te& exceptionState) |
1171 { | 1171 { |
1172 if (!document || !document->frame()) { | 1172 if (!document || !document->frame()) { |
1173 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc
ument's frame cannot be retrieved." : "The document provided is invalid."); | 1173 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc
ument's frame cannot be retrieved." : "The document provided is invalid."); |
1174 return nullptr; | 1174 return nullptr; |
1175 } | 1175 } |
1176 | 1176 |
1177 document->updateLayout(); | 1177 document->updateLayout(); |
1178 | 1178 |
1179 IntSize radius(width / 2, height / 2); | 1179 IntSize radius(width / 2, height / 2); |
1180 IntPoint point(x + radius.width(), y + radius.height()); | 1180 IntPoint point(x + radius.width(), y + radius.height()); |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2452 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) | 2452 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) |
2453 { | 2453 { |
2454 if (!node) | 2454 if (!node) |
2455 return String(); | 2455 return String(); |
2456 blink::WebPoint point(x, y); | 2456 blink::WebPoint point(x, y); |
2457 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); | 2457 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); |
2458 return surroundingText.content(); | 2458 return surroundingText.content(); |
2459 } | 2459 } |
2460 | 2460 |
2461 } | 2461 } |
OLD | NEW |