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 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov
ided is not a form control element."); | 1006 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov
ided is not a form control element."); |
1007 return String(); | 1007 return String(); |
1008 } | 1008 } |
1009 | 1009 |
1010 String suggestedValue; | 1010 String suggestedValue; |
1011 if (isHTMLInputElement(*element)) | 1011 if (isHTMLInputElement(*element)) |
1012 suggestedValue = toHTMLInputElement(*element).suggestedValue(); | 1012 suggestedValue = toHTMLInputElement(*element).suggestedValue(); |
1013 | 1013 |
1014 if (isHTMLTextAreaElement(*element)) | 1014 if (isHTMLTextAreaElement(*element)) |
1015 suggestedValue = toHTMLTextAreaElement(*element).suggestedValue(); | 1015 suggestedValue = toHTMLTextAreaElement(*element).suggestedValue(); |
| 1016 |
| 1017 if (isHTMLSelectElement(*element)) |
| 1018 suggestedValue = toHTMLSelectElement(*element).suggestedValue(); |
| 1019 |
1016 return suggestedValue; | 1020 return suggestedValue; |
1017 } | 1021 } |
1018 | 1022 |
1019 void Internals::setSuggestedValue(Element* element, const String& value, Excepti
onState& exceptionState) | 1023 void Internals::setSuggestedValue(Element* element, const String& value, Excepti
onState& exceptionState) |
1020 { | 1024 { |
1021 if (!element) { | 1025 if (!element) { |
1022 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Element")); | 1026 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Element")); |
1023 return; | 1027 return; |
1024 } | 1028 } |
1025 | 1029 |
1026 if (!element->isFormControlElement()) { | 1030 if (!element->isFormControlElement()) { |
1027 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov
ided is not a form control element."); | 1031 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov
ided is not a form control element."); |
1028 return; | 1032 return; |
1029 } | 1033 } |
1030 | 1034 |
1031 if (isHTMLInputElement(*element)) | 1035 if (isHTMLInputElement(*element)) |
1032 toHTMLInputElement(*element).setSuggestedValue(value); | 1036 toHTMLInputElement(*element).setSuggestedValue(value); |
1033 | 1037 |
1034 if (isHTMLTextAreaElement(*element)) | 1038 if (isHTMLTextAreaElement(*element)) |
1035 toHTMLTextAreaElement(*element).setSuggestedValue(value); | 1039 toHTMLTextAreaElement(*element).setSuggestedValue(value); |
| 1040 |
| 1041 if (isHTMLSelectElement(*element)) |
| 1042 toHTMLSelectElement(*element).setSuggestedValue(value); |
1036 } | 1043 } |
1037 | 1044 |
1038 void Internals::setEditingValue(Element* element, const String& value, Exception
State& exceptionState) | 1045 void Internals::setEditingValue(Element* element, const String& value, Exception
State& exceptionState) |
1039 { | 1046 { |
1040 if (!element) { | 1047 if (!element) { |
1041 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Element")); | 1048 exceptionState.throwDOMException(InvalidAccessError, ExceptionMessages::
argumentNullOrIncorrectType(1, "Element")); |
1042 return; | 1049 return; |
1043 } | 1050 } |
1044 | 1051 |
1045 if (!isHTMLInputElement(*element)) { | 1052 if (!isHTMLInputElement(*element)) { |
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2410 } | 2417 } |
2411 | 2418 |
2412 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) | 2419 String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long ma
xLength) |
2413 { | 2420 { |
2414 blink::WebPoint point(x, y); | 2421 blink::WebPoint point(x, y); |
2415 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); | 2422 SurroundingText surroundingText(VisiblePosition(node->renderer()->positionFo
rPoint(static_cast<IntPoint>(point))), maxLength); |
2416 return surroundingText.content(); | 2423 return surroundingText.content(); |
2417 } | 2424 } |
2418 | 2425 |
2419 } | 2426 } |
OLD | NEW |