Skip to content

Commit 46f6159

Browse files
committed
update web.jsx
1 parent ac67334 commit 46f6159

22 files changed

+24492
-15125
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ server: web
8686
web.jsx:
8787
idl2jsx/build.pl
8888
idl2jsx/maketest.pl > t/lib/010.web.jsx
89-
bin/jsx --test t/lib/010.web.jsx
89+
bin/jsx --warn none --test t/lib/010.web.jsx
9090

9191

9292
show-todo:

idl2jsx/build.pl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
['web.jsx' =>
2626
# DOM spec
2727
#'http://www.w3.org/TR/DOM-Level-3-Core/idl/dom.idl',
28-
'dom; http://www.w3.org/TR/dom/',
28+
'dom; http://www.w3.org/TR/2013/WD-dom-20131107/',
2929
'DOM-Level-2-Views; http://www.w3.org/TR/DOM-Level-2-Views/idl/views.idl',
3030
'DOM-Level-3-Events; http://www.w3.org/TR/DOM-Level-3-Events/',
3131
'progress-events; http://www.w3.org/TR/progress-events/',
@@ -37,6 +37,7 @@
3737
#'http://html5labs.interoperabilitybridges.com/dom4events/', # no correct IDL
3838

3939
# CSS
40+
'css-conditional; http://dev.w3.org/csswg/css-conditional/',
4041
'cssom; http://dev.w3.org/csswg/cssom/',
4142
'cssom-view; http://dev.w3.org/csswg/cssom-view/',
4243
"$root/extra/chrome.idl",
@@ -62,6 +63,8 @@
6263
"url; http://www.w3.org/TR/2012/WD-url-20120524/",
6364
"IndexedDB; http://www.w3.org/TR/2013/WD-IndexedDB-20130516/",
6465
"notifications; http://www.w3.org/TR/2012/WD-notifications-20120614/",
66+
"matrix; http://dev.w3.org/fxtf/matrix/",
67+
"metry; http://dev.w3.org/fxtf/geometry/",
6568

6669
"webrtc; http://dev.w3.org/2011/webrtc/editor/webrtc.html",
6770
#"http://dev.w3.org/2011/webrtc/editor/getusermedia.html",

idl2jsx/extra/draft.idl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,27 @@ interface WindowAnimationTiming {
1717
void mozCancelAnimationFrame(long handle);
1818
};
1919

20+
// https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
21+
partial interface Element {
22+
void requestFullscreen();
23+
void webkitRequestFullscreen();
24+
void mozRequestFullscreen();
25+
};
26+
27+
partial interface Document {
28+
readonly attribute boolean? fullscreenEnabled;
29+
readonly attribute Element? fullscreenElement;
30+
31+
readonly attribute boolean? webkitFullscreenEnabled;
32+
readonly attribute Element? webkitFullscreenElement;
33+
34+
readonly attribute boolean? mozFullscreenEnabled;
35+
readonly attribute Element? mozFullscreenElement;
36+
37+
void exitFullscreen();
38+
void webkitExitFullscreen();
39+
void mozExitFullscreen();
40+
};
2041
Window implements WindowAnimationTiming;
2142

2243
callback FrameRequestCallback = void (DOMTimeStamp time);
@@ -144,3 +165,8 @@ Navigator implements NavigatorUserMedia;
144165
HTMLElement implements ElementCSSInlineStyle;
145166
SVGELement implements ElementCSSInlineStyle;
146167

168+
// http://www.w3.org/TR/2013/ED-css3-conditional-20131109/
169+
interface CSS {
170+
static boolean supports(DOMString property, DOMString value);
171+
static boolean supports(DOMString conditionText);
172+
};

idl2jsx/extra/legacy.idl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@ interface CanvasPixelArray {
77
getter octet (in unsigned long index);
88
setter void (in unsigned long index, in octet value);
99
};
10+
11+
// Introduced in DOM Level 3 (http://www.w3.org/TR/DOM-Level-3-Core/core.html):
12+
interface DOMStringList {
13+
DOMString item(in unsigned long index);
14+
readonly attribute unsigned long length;
15+
boolean contains(in DOMString str);
16+
};

idl2jsx/idl2jsx.pl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@
141141
'MediaStreamConstraints' => 'Map.<variant>', # e.g. { video: true }
142142
'MediaConstraints' => 'Map.<variant>',
143143

144+
'Elements' => 'Array.<Element>',
145+
144146
# https://wiki.mozilla.org/GamepadAPI
145147
'nsIVariant' => 'variant',
146148
'nsIDOMEvent' => 'Event',
@@ -353,6 +355,20 @@ sub info {
353355
fake => $fake{$class},
354356
};
355357

358+
if($class eq 'HTMLAllCollection' or $class eq 'HTMLFormControlsCollection') {
359+
# HTMLAllCollection and HTMLFormControlsCollection are
360+
# declared as a subclass of HTMLCollection,
361+
# but it is not compatible with HTMLCollection in terms of JSX.
362+
$base = "";
363+
push @{$def->{members}}, {
364+
id => 'length',
365+
decl => 'var length : number;',
366+
type => 'number',
367+
static => 0,
368+
spec => $spec_name,
369+
};
370+
}
371+
356372
if($class_type !~ /\b partial \b/xms) {
357373
$has_definition{$class} = 1;
358374
$def->{spec} = $spec_name;
@@ -462,7 +478,9 @@ sub info {
462478
(?: \bstringifier\b \s+ )?
463479
(?<static> \bstatic\b \s+ )?
464480
(?<readonly> \breadonly\b \s+)?
481+
(?: \binherit\b \s+)?
465482
(?: \battribute\b \s+)?
483+
(?: \bunrestricted\b \s+)?
466484
(?: \[ [^\]]+ \])? # annotations
467485
(?<type> $rx_type) \s+ (?<ident> \w+) # required
468486
(?: \s+ setraises\( [^\)]+ \) )?

0 commit comments

Comments
 (0)