Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: third_party/WebKit/Source/core/dom/Range.idl

Issue 2701413003: Range: node offsets should be unsigned. (Closed)
Patch Set: Resolve std::numeric_limits<int>::max() leftover Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 18 * Boston, MA 02110-1301, USA.
19 */ 19 */
20 20
21 // https://dom.spec.whatwg.org/#interface-range 21 // https://dom.spec.whatwg.org/#interface-range
22
23 // FIXME: All long types in this interface should be unsigned long.
24 [ 22 [
25 Constructor, 23 Constructor,
26 ConstructorCallWith=Document, 24 ConstructorCallWith=Document,
27 ] interface Range { 25 ] interface Range {
28 readonly attribute Node startContainer; 26 readonly attribute Node startContainer;
29 readonly attribute long startOffset; 27 readonly attribute unsigned long startOffset;
30 readonly attribute Node endContainer; 28 readonly attribute Node endContainer;
31 readonly attribute long endOffset; 29 readonly attribute unsigned long endOffset;
32 readonly attribute boolean collapsed; 30 readonly attribute boolean collapsed;
33 readonly attribute Node commonAncestorContainer; 31 readonly attribute Node commonAncestorContainer;
34 32
35 [RaisesException] void setStart(Node node, long offset); 33 [RaisesException] void setStart(Node node, unsigned long offset);
36 [RaisesException] void setEnd(Node node, long offset); 34 [RaisesException] void setEnd(Node node, unsigned long offset);
37 [RaisesException] void setStartBefore(Node node); 35 [RaisesException] void setStartBefore(Node node);
38 [RaisesException] void setStartAfter(Node node); 36 [RaisesException] void setStartAfter(Node node);
39 [RaisesException] void setEndBefore(Node node); 37 [RaisesException] void setEndBefore(Node node);
40 [RaisesException] void setEndAfter(Node node); 38 [RaisesException] void setEndAfter(Node node);
41 void collapse(optional boolean toStart = false); 39 void collapse(optional boolean toStart = false);
42 [RaisesException] void selectNode(Node node); 40 [RaisesException] void selectNode(Node node);
43 [RaisesException] void selectNodeContents(Node node); 41 [RaisesException] void selectNodeContents(Node node);
44 42
45 const unsigned short START_TO_START = 0; 43 const unsigned short START_TO_START = 0;
46 const unsigned short START_TO_END = 1; 44 const unsigned short START_TO_END = 1;
47 const unsigned short END_TO_END = 2; 45 const unsigned short END_TO_END = 2;
48 const unsigned short END_TO_START = 3; 46 const unsigned short END_TO_START = 3;
49 [RaisesException] short compareBoundaryPoints(unsigned short how, Range sour ceRange); 47 [RaisesException] short compareBoundaryPoints(unsigned short how, Range sour ceRange);
50 48
51 [RaisesException, CEReactions, CustomElementCallbacks] void deleteContents() ; 49 [RaisesException, CEReactions, CustomElementCallbacks] void deleteContents() ;
52 [NewObject, RaisesException, CEReactions, CustomElementCallbacks] DocumentFr agment extractContents(); 50 [NewObject, RaisesException, CEReactions, CustomElementCallbacks] DocumentFr agment extractContents();
53 [NewObject, RaisesException, CEReactions, CustomElementCallbacks] DocumentFr agment cloneContents(); 51 [NewObject, RaisesException, CEReactions, CustomElementCallbacks] DocumentFr agment cloneContents();
54 [RaisesException, CEReactions, CustomElementCallbacks] void insertNode(Node node); 52 [RaisesException, CEReactions, CustomElementCallbacks] void insertNode(Node node);
55 [RaisesException, CEReactions, CustomElementCallbacks] void surroundContents (Node newParent); 53 [RaisesException, CEReactions, CustomElementCallbacks] void surroundContents (Node newParent);
56 54
57 [NewObject] Range cloneRange(); 55 [NewObject] Range cloneRange();
58 [MeasureAs=RangeDetach] void detach(); 56 [MeasureAs=RangeDetach] void detach();
59 57
60 [RaisesException] boolean isPointInRange(Node node, long offset); 58 [RaisesException] boolean isPointInRange(Node node, unsigned long offset);
61 [RaisesException] short comparePoint(Node node, long offset); 59 [RaisesException] short comparePoint(Node node, unsigned long offset);
62 60
63 [RaisesException] boolean intersectsNode(Node node); 61 [RaisesException] boolean intersectsNode(Node node);
64 62
65 stringifier; 63 stringifier;
66 64
67 // CSSOM View Module 65 // CSSOM View Module
68 // https://dev.w3.org/csswg/cssom-view/#extensions-to-the-range-interface 66 // https://dev.w3.org/csswg/cssom-view/#extensions-to-the-range-interface
69 // FIXME: getClientRect() and getBoundingClientRect() should 67 // FIXME: getClientRect() and getBoundingClientRect() should
70 // return DOMRectList and DOMRect respectively. 68 // return DOMRectList and DOMRect respectively.
71 ClientRectList getClientRects(); 69 ClientRectList getClientRects();
72 ClientRect getBoundingClientRect(); 70 ClientRect getBoundingClientRect();
73 71
74 // DOM Parsing and Serialization 72 // DOM Parsing and Serialization
75 // https://w3c.github.io/DOM-Parsing/#extensions-to-the-range-interface 73 // https://w3c.github.io/DOM-Parsing/#extensions-to-the-range-interface
76 [NewObject, RaisesException, CEReactions, CustomElementCallbacks] DocumentFr agment createContextualFragment(DOMString fragment); 74 [NewObject, RaisesException, CEReactions, CustomElementCallbacks] DocumentFr agment createContextualFragment(DOMString fragment);
77 75
78 // Non-standard API 76 // Non-standard API
79 [RaisesException, DeprecateAs=RangeExpand] void expand([Default=Undefined] o ptional DOMString unit); 77 [RaisesException, DeprecateAs=RangeExpand] void expand([Default=Undefined] o ptional DOMString unit);
80 }; 78 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698