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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 if (isHTMLInputElement(*element)) | 1037 if (isHTMLInputElement(*element)) |
1038 toHTMLInputElement(*element).setSuggestedValue(value); | 1038 toHTMLInputElement(*element).setSuggestedValue(value); |
1039 | 1039 |
1040 if (isHTMLTextAreaElement(*element)) | 1040 if (isHTMLTextAreaElement(*element)) |
1041 toHTMLTextAreaElement(*element).setSuggestedValue(value); | 1041 toHTMLTextAreaElement(*element).setSuggestedValue(value); |
1042 | 1042 |
1043 if (isHTMLSelectElement(*element)) | 1043 if (isHTMLSelectElement(*element)) |
1044 toHTMLSelectElement(*element).setSuggestedValue(value); | 1044 toHTMLSelectElement(*element).setSuggestedValue(value); |
1045 } | 1045 } |
1046 | 1046 |
| 1047 void Internals::setValueAfterUserGesture(Element* element, const String& value,
ExceptionState& exceptionState) |
| 1048 { |
| 1049 if (!element) { |
| 1050 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Element")); |
| 1051 return; |
| 1052 } |
| 1053 |
| 1054 if (!isHTMLInputElement(*element)) { |
| 1055 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov
ided is not a input element."); |
| 1056 return; |
| 1057 } |
| 1058 |
| 1059 toHTMLInputElement(*element).setValueAfterUserGesture(value); |
| 1060 } |
| 1061 |
1047 void Internals::setEditingValue(Element* element, const String& value, Exception
State& exceptionState) | 1062 void Internals::setEditingValue(Element* element, const String& value, Exception
State& exceptionState) |
1048 { | 1063 { |
1049 if (!element) { | 1064 if (!element) { |
1050 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Element")); | 1065 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Element")); |
1051 return; | 1066 return; |
1052 } | 1067 } |
1053 | 1068 |
1054 if (!isHTMLInputElement(*element)) { | 1069 if (!isHTMLInputElement(*element)) { |
1055 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov
ided is not an INPUT."); | 1070 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov
ided is not an INPUT."); |
1056 return; | 1071 return; |
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2470 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) | 2485 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) |
2471 { | 2486 { |
2472 if (!node) | 2487 if (!node) |
2473 return String(); | 2488 return String(); |
2474 blink::WebPoint point(x, y); | 2489 blink::WebPoint point(x, y); |
2475 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); | 2490 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); |
2476 return surroundingText.content(); | 2491 return surroundingText.content(); |
2477 } | 2492 } |
2478 | 2493 |
2479 } | 2494 } |
OLD | NEW |