OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // TODO(philipj): The offset argument should not have a default value. | 51 // TODO(philipj): The offset argument should not have a default value. |
52 [MeasureAs=SelectionCollapse, RaisesException, LegacyInterfaceTypeChecking]
void collapse(Node? node, optional long offset = 0); | 52 [MeasureAs=SelectionCollapse, RaisesException, LegacyInterfaceTypeChecking]
void collapse(Node? node, optional long offset = 0); |
53 // TODO(yoichio): The node argument should not be nullable. crbug.com/391673 | 53 // TODO(yoichio): The node argument should not be nullable. crbug.com/391673 |
54 // TODO(philipj): The offset argument should not have a default value. | 54 // TODO(philipj): The offset argument should not have a default value. |
55 [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException, Le
gacyInterfaceTypeChecking] void setPosition(Node? node, optional long offset = 0
); | 55 [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException, Le
gacyInterfaceTypeChecking] void setPosition(Node? node, optional long offset = 0
); |
56 [MeasureAs=SelectionCollapseToStart, RaisesException] void collapseToStart()
; | 56 [MeasureAs=SelectionCollapseToStart, RaisesException] void collapseToStart()
; |
57 [MeasureAs=SelectionCollapseToEnd, RaisesException] void collapseToEnd(); | 57 [MeasureAs=SelectionCollapseToEnd, RaisesException] void collapseToEnd(); |
58 // TODO(philipj): The offset argument should not have a default value. | 58 // TODO(philipj): The offset argument should not have a default value. |
59 [MeasureAs=SelectionExtend, RaisesException] void extend(Node node, optional
long offset = 0); | 59 [MeasureAs=SelectionExtend, RaisesException] void extend(Node node, optional
long offset = 0); |
60 // TODO(philipj): The arguments should be anchorNode, anchorOffset, | 60 // TODO(philipj): The arguments should be anchorNode, anchorOffset, |
61 // focusNode and focusOffset, and none of them should be optional. | 61 // focusNode and focusOffset, and none of them should be optional or |
62 [MeasureAs=SelectionSetBaseAndExtent, RaisesException, LegacyInterfaceTypeCh
ecking] void setBaseAndExtent([Default=Undefined] optional Node baseNode, | 62 // nullable. |
| 63 [MeasureAs=SelectionSetBaseAndExtent, RaisesException, LegacyInterfaceTypeCh
ecking] void setBaseAndExtent([Default=Undefined] optional Node? baseNode, |
63
[Default=Undefined] optional long baseOffset, | 64
[Default=Undefined] optional long baseOffset, |
64
[Default=Undefined] optional Node extentNode, | 65
[Default=Undefined] optional Node? extentNode, |
65
[Default=Undefined] optional long extentOffset); | 66
[Default=Undefined] optional long extentOffset); |
66 [MeasureAs=SelectionSelectAllChildren, RaisesException] void selectAllChildr
en(Node node); | 67 [MeasureAs=SelectionSelectAllChildren, RaisesException] void selectAllChildr
en(Node node); |
67 [MeasureAs=SelectionDeleteDromDocument, CustomElementCallbacks] void deleteF
romDocument(); | 68 [MeasureAs=SelectionDeleteDromDocument, CustomElementCallbacks] void deleteF
romDocument(); |
68 [MeasureAs=SelectionContainsNode] boolean containsNode(Node node, optional b
oolean allowPartialContainment = false); | 69 [MeasureAs=SelectionContainsNode] boolean containsNode(Node node, optional b
oolean allowPartialContainment = false); |
69 // TODO(philipj): The spec does not use [NotEnumerable]. See also: | 70 // TODO(philipj): The spec does not use [NotEnumerable]. See also: |
70 // https://codereview.chromium.org/345983004/ | 71 // https://codereview.chromium.org/345983004/ |
71 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=26179 | 72 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=26179 |
72 [MeasureAs=SelectionDOMString, NotEnumerable] stringifier DOMString(); | 73 [MeasureAs=SelectionDOMString, NotEnumerable] stringifier DOMString(); |
73 | 74 |
74 // Non-standard APIs | 75 // Non-standard APIs |
75 | 76 |
76 // https://github.com/w3c/selection-api/issues/34 | 77 // https://github.com/w3c/selection-api/issues/34 |
77 [MeasureAs=SelectionBaseNode] readonly attribute Node? baseNode; | 78 [MeasureAs=SelectionBaseNode] readonly attribute Node? baseNode; |
78 [MeasureAs=SelectionBaseOffset] readonly attribute long baseOffset; | 79 [MeasureAs=SelectionBaseOffset] readonly attribute long baseOffset; |
79 [MeasureAs=SelectionExtentNode] readonly attribute Node? extentNode; | 80 [MeasureAs=SelectionExtentNode] readonly attribute Node? extentNode; |
80 [MeasureAs=SelectionExtentOffset] readonly attribute long extentOffset; | 81 [MeasureAs=SelectionExtentOffset] readonly attribute long extentOffset; |
81 | 82 |
82 // https://github.com/w3c/selection-api/issues/37 | 83 // https://github.com/w3c/selection-api/issues/37 |
83 [MeasureAs=SelectionModify] void modify([Default=Undefined] optional DOMStri
ng alter, | 84 [MeasureAs=SelectionModify] void modify([Default=Undefined] optional DOMStri
ng alter, |
84 [Default=Undefined] optional DOMStri
ng direction, | 85 [Default=Undefined] optional DOMStri
ng direction, |
85 [Default=Undefined] optional DOMStri
ng granularity); | 86 [Default=Undefined] optional DOMStri
ng granularity); |
86 }; | 87 }; |
OLD | NEW |