File tree 2 files changed +99
-8
lines changed
2 files changed +99
-8
lines changed Original file line number Diff line number Diff line change 565
565
}
566
566
},
567
567
"svg" : {
568
+ "global_attributes" : {
569
+ "attributes" : [
570
+ {"class" : " className" , "tabindex" : " tabIndex" },
571
+ " clip" ,
572
+ " color" ,
573
+ " cursor" ,
574
+ " data" ,
575
+ " direction" ,
576
+ " display" ,
577
+ " fill" ,
578
+ " filter" ,
579
+ " href" ,
580
+ " id" ,
581
+ " kerning" ,
582
+ " lang" ,
583
+ " mask" ,
584
+ " onabort" ,
585
+ " onactivate" ,
586
+ " onbegin" ,
587
+ " oncancel" ,
588
+ " oncanplay" ,
589
+ " oncanplaythrough" ,
590
+ " onchange" ,
591
+ " onclick" ,
592
+ " onclose" ,
593
+ " oncuechange" ,
594
+ " ondblclick" ,
595
+ " ondrag" ,
596
+ " ondragend" ,
597
+ " ondragenter" ,
598
+ " ondragexit" ,
599
+ " ondragleave" ,
600
+ " ondragover" ,
601
+ " ondragstart" ,
602
+ " ondrop" ,
603
+ " ondurationchange" ,
604
+ " onemptied" ,
605
+ " onend" ,
606
+ " onended" ,
607
+ " onerror" ,
608
+ " onfocus" ,
609
+ " onfocusin" ,
610
+ " onfocusout" ,
611
+ " oninput" ,
612
+ " oninvalid" ,
613
+ " onkeydown" ,
614
+ " onkeypress" ,
615
+ " onkeyup" ,
616
+ " onload" ,
617
+ " onloadeddata" ,
618
+ " onloadedmetadata" ,
619
+ " onloadstart" ,
620
+ " onmousedown" ,
621
+ " onmouseenter" ,
622
+ " onmouseleave" ,
623
+ " onmousemove" ,
624
+ " onmouseout" ,
625
+ " onmouseover" ,
626
+ " onmouseup" ,
627
+ " onmousewheel" ,
628
+ " onpause" ,
629
+ " onplay" ,
630
+ " onplaying" ,
631
+ " onprogress" ,
632
+ " onratechange" ,
633
+ " onrepeat" ,
634
+ " onreset" ,
635
+ " onresize" ,
636
+ " onscroll" ,
637
+ " onseeked" ,
638
+ " onseeking" ,
639
+ " onselect" ,
640
+ " onshow" ,
641
+ " onstalled" ,
642
+ " onsubmit" ,
643
+ " onsuspend" ,
644
+ " ontimeupdate" ,
645
+ " ontoggle" ,
646
+ " onunload" ,
647
+ " onvolumechange" ,
648
+ " onwaiting" ,
649
+ " opacity" ,
650
+ " overflow" ,
651
+ " requiredExtensions" ,
652
+ " requiredFeatures" ,
653
+ " stroke" ,
654
+ " style" ,
655
+ " systemLanguage" ,
656
+ " textLength" ,
657
+ " transform" ,
658
+ " visibility"
659
+ ]
660
+ },
568
661
"cursor" : {
569
662
"interfaceName" : " SVGCursorElement" ,
570
663
"attributes" : [" href" , " x" , " xlink_href" , " y" ]
Original file line number Diff line number Diff line change @@ -131,28 +131,26 @@ const build = async (specElements, customElements) => {
131
131
? `${ category } .global_attributes`
132
132
: `${ category } .elements` ;
133
133
134
- const interfaceName = data . interfaceName || categoryData . default ;
135
- if ( ! interfaceName ) {
136
- throw new Error ( `${ bcdPath } is missing an interface name` ) ;
137
- }
138
-
139
134
const customTest = await getCustomTest ( bcdPath , subcat , true ) ;
140
135
141
136
const defaultConstructCode = namespace
142
137
? `document.createElementNS('${ namespace } ', '${ el } ')`
143
138
: `document.createElement('${ el } ')` ;
144
139
145
140
if ( el !== "global_attributes" ) {
141
+ const interfaceName = data . interfaceName || categoryData . default ;
142
+ if ( ! interfaceName ) {
143
+ throw new Error ( `${ bcdPath } is missing an interface name` ) ;
144
+ }
145
+
146
146
const defaultCode =
147
147
category === "mathml"
148
148
? `(function () {
149
149
throw new Error('MathML elements require custom tests');
150
150
})()`
151
151
: `(function() {
152
152
var instance = ${ defaultConstructCode } ;
153
- return bcd.testObjectName(instance, '${
154
- data . interfaceName || categoryData . default
155
- } ');
153
+ return bcd.testObjectName(instance, '${ interfaceName } ');
156
154
})()` ;
157
155
tests [ bcdPath ] = compileTest ( {
158
156
raw : { code : customTest . test || defaultCode } ,
You can’t perform that action at this time.
0 commit comments