-
Notifications
You must be signed in to change notification settings - Fork 4
/
323.txt
83 lines (66 loc) · 2.97 KB
/
323.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
* DocumentIndex
[2] A DocumentIndex is a scalar value used to identify a source data stream. It must be a true value. A positive integer should be used.
[3] The value [CODE[-1]] represents that the source is an unknown data stream.
* CharacterIndex
[4] A CharacterIndex is a non-negative integer representing the location of a character in the given source character stream. It is the offset from the beginning of the character string.
;; [5] It is unclear whether "an unknown character index" is necessary or not at the time of writing. If necessary, the value [CODE[-1]] will be used.
* IndexedStringSegment
[6] An IndexedStringSegment is an array reference containing a character string,
a DocumentIndex, and a CharacterIndex.
[7] The pair of the DocumentIndex and the CharacterIndex identifies the source
location of the first character of the character string.
[8] An IndexedStringSegment represents the character string.
* IndexedString
[1] An IndexedString is an array reference containing zero or more IndexedStringSegment,
representing a string consist of concatenation of strings represented by
the IndexedStringSegments, in order.
* Web IDL Perl binding extensions
[9] If the type of an argument is IndexedStringSegment, run these steps:
[FIG(steps)[
= Let [VAR[value]] be the specified value.
= If [VAR[value]] is not an array reference, throw an [[TypeError]] and abort these steps.
= Let [VAR[new value]] be a new array reference.
= Push ToString([VAR[value]]->[0]) to [VAR[new value]].
= Push ToNumber([VAR[value]]->[1]) to [VAR[new value]].
= Push ToNumber([VAR[value]]->[2]) to [VAR[new value]].
= Return [VAR[new value]].
]FIG]
[10] If the type of an argument is IndexedString, run these steps:
[FIG(steps)[
= Let [VAR[value]] be the specified value.
= If [VAR[value]] is not an array reference, throw an [[TypeError]] and abort these steps.
= If there is an item in [VAR[value]] which is not an array reference, throw an [[TypeError]] and abort these steps.
= Let [VAR[new value]] be a new array reference.
= For each item in [VAR[value]], in order,
== Apply >>9 to the item and push the result into [VAR[new value]].
= Return [VAR[new value]].
]FIG]
* DOM [CODE(DOMi)@en[Node]] extensions
[FIG[
[PRE(IDL code)[
partial interface Node {
IndexedStringSegment manakaiGetSourceLocation;
void manakaiSetSourceLocation (IndexedStringSegment? new);
};
partial interface Attr {
IndexedStringSegment manakaiGetSourceLocation;
void manakaiSetSourceLocation (IndexedStringSegment? new);
};
]PRE]
]FIG]
[FIG[
[PRE(IDL code)[
partial interface ParentNode {
IndexedString manakaiGetIndexedString ();
void manakaiAppendIndexedString (IndexedString s);
};
partial interface CharacterData {
IndexedString manakaiGetIndexedString ();
void manakaiAppendIndexedString (IndexedString s);
};
partial interface Attr {
IndexedString manakaiGetIndexedString ();
void manakaiAppendIndexedString (IndexedString s);
};
]PRE]
]FIG]