| 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 22 matching lines...) Expand all Loading... |
| 33 ] interface Selection { | 33 ] interface Selection { |
| 34 [MeasureAs=SelectionAnchorNode] readonly attribute Node? anchorNode; | 34 [MeasureAs=SelectionAnchorNode] readonly attribute Node? anchorNode; |
| 35 [MeasureAs=SelectionAnchorOffset] readonly attribute unsigned long anchorOff
set; | 35 [MeasureAs=SelectionAnchorOffset] readonly attribute unsigned long anchorOff
set; |
| 36 [MeasureAs=SelectionFocusNode] readonly attribute Node? focusNode; | 36 [MeasureAs=SelectionFocusNode] readonly attribute Node? focusNode; |
| 37 [MeasureAs=SelectionFocusOffset] readonly attribute unsigned long focusOffse
t; | 37 [MeasureAs=SelectionFocusOffset] readonly attribute unsigned long focusOffse
t; |
| 38 [MeasureAs=SelectionIsCollapsed] readonly attribute boolean isCollapsed; | 38 [MeasureAs=SelectionIsCollapsed] readonly attribute boolean isCollapsed; |
| 39 [MeasureAs=SelectionRangeCount] readonly attribute unsigned long rangeCount; | 39 [MeasureAs=SelectionRangeCount] readonly attribute unsigned long rangeCount; |
| 40 [MeasureAs=SelectionType] readonly attribute DOMString type; | 40 [MeasureAs=SelectionType] readonly attribute DOMString type; |
| 41 [MeasureAs=SelectionGetRangeAt, RaisesException] Range getRangeAt(unsigned l
ong index); | 41 [MeasureAs=SelectionGetRangeAt, RaisesException] Range getRangeAt(unsigned l
ong index); |
| 42 [MeasureAs=SelectionAddRange] void addRange(Range range); | 42 [MeasureAs=SelectionAddRange] void addRange(Range range); |
| 43 // TODO(yoichio): Implement removeRange. crbug.com/391673 | 43 void removeRange(Range range); |
| 44 //void removeRange(Range range); | |
| 45 [MeasureAs=SelectionRemoveAllRanges] void removeAllRanges(); | 44 [MeasureAs=SelectionRemoveAllRanges] void removeAllRanges(); |
| 46 [MeasureAs=SelectionEmpty] void empty(); | 45 [MeasureAs=SelectionEmpty] void empty(); |
| 47 [MeasureAs=SelectionCollapse, RaisesException] void collapse(Node? node, opt
ional unsigned long offset = 0); | 46 [MeasureAs=SelectionCollapse, RaisesException] void collapse(Node? node, opt
ional unsigned long offset = 0); |
| 48 [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException] vo
id setPosition(Node? node, optional unsigned long offset = 0); | 47 [ImplementedAs=collapse, MeasureAs=SelectionSetPosition, RaisesException] vo
id setPosition(Node? node, optional unsigned long offset = 0); |
| 49 [MeasureAs=SelectionCollapseToStart, RaisesException] void collapseToStart()
; | 48 [MeasureAs=SelectionCollapseToStart, RaisesException] void collapseToStart()
; |
| 50 [MeasureAs=SelectionCollapseToEnd, RaisesException] void collapseToEnd(); | 49 [MeasureAs=SelectionCollapseToEnd, RaisesException] void collapseToEnd(); |
| 51 [MeasureAs=SelectionExtend, RaisesException] void extend(Node node, optional
unsigned long offset = 0); | 50 [MeasureAs=SelectionExtend, RaisesException] void extend(Node node, optional
unsigned long offset = 0); |
| 52 // TODO(foolip): The arguments should be anchorNode, anchorOffset, | 51 // TODO(foolip): The arguments should be anchorNode, anchorOffset, |
| 53 // focusNode and focusOffset, and none of them are nullable in the spec. | 52 // focusNode and focusOffset, and none of them are nullable in the spec. |
| 54 [MeasureAs=SelectionSetBaseAndExtent, RaisesException] void setBaseAndExtent
(Node? baseNode, unsigned long baseOffset, | 53 [MeasureAs=SelectionSetBaseAndExtent, RaisesException] void setBaseAndExtent
(Node? baseNode, unsigned long baseOffset, |
| 55
Node? extentNode, unsigned long extentOffset); | 54
Node? extentNode, unsigned long extentOffset); |
| 56 [MeasureAs=SelectionSelectAllChildren, RaisesException] void selectAllChildr
en(Node node); | 55 [MeasureAs=SelectionSelectAllChildren, RaisesException] void selectAllChildr
en(Node node); |
| 57 [MeasureAs=SelectionDeleteDromDocument, CEReactions, CustomElementCallbacks]
void deleteFromDocument(); | 56 [MeasureAs=SelectionDeleteDromDocument, CEReactions, CustomElementCallbacks]
void deleteFromDocument(); |
| 58 [MeasureAs=SelectionContainsNode] boolean containsNode(Node node, optional b
oolean allowPartialContainment = false); | 57 [MeasureAs=SelectionContainsNode] boolean containsNode(Node node, optional b
oolean allowPartialContainment = false); |
| 59 [MeasureAs=SelectionDOMString] stringifier; | 58 [MeasureAs=SelectionDOMString] stringifier; |
| 60 | 59 |
| 61 // Non-standard APIs | 60 // Non-standard APIs |
| 62 | 61 |
| 63 // https://github.com/w3c/selection-api/issues/34 | 62 // https://github.com/w3c/selection-api/issues/34 |
| 64 [MeasureAs=SelectionBaseNode] readonly attribute Node? baseNode; | 63 [MeasureAs=SelectionBaseNode] readonly attribute Node? baseNode; |
| 65 [MeasureAs=SelectionBaseOffset] readonly attribute unsigned long baseOffset; | 64 [MeasureAs=SelectionBaseOffset] readonly attribute unsigned long baseOffset; |
| 66 [MeasureAs=SelectionExtentNode] readonly attribute Node? extentNode; | 65 [MeasureAs=SelectionExtentNode] readonly attribute Node? extentNode; |
| 67 [MeasureAs=SelectionExtentOffset] readonly attribute unsigned long extentOff
set; | 66 [MeasureAs=SelectionExtentOffset] readonly attribute unsigned long extentOff
set; |
| 68 | 67 |
| 69 // https://github.com/w3c/selection-api/issues/37 | 68 // https://github.com/w3c/selection-api/issues/37 |
| 70 [MeasureAs=SelectionModify] void modify([Default=Undefined] optional DOMStri
ng alter, | 69 [MeasureAs=SelectionModify] void modify([Default=Undefined] optional DOMStri
ng alter, |
| 71 [Default=Undefined] optional DOMStri
ng direction, | 70 [Default=Undefined] optional DOMStri
ng direction, |
| 72 [Default=Undefined] optional DOMStri
ng granularity); | 71 [Default=Undefined] optional DOMStri
ng granularity); |
| 73 }; | 72 }; |
| OLD | NEW |