File tree 1 file changed +38
-0
lines changed
html/semantics/permission-element
1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < meta charset =utf-8 >
3
+ < script src ="/resources/testharness.js "> </ script >
4
+ < script src ="/resources/testharnessreport.js "> </ script >
5
+ < body >
6
+ <!--The permission element should have some limits for specific properties:
7
+ * font-weight is adjusted to be at least 200.
8
+ * font-style should only have "normal" or "italic" values.
9
+ -->
10
+ < style >
11
+ # id1 {
12
+ font-weight : 100 ;
13
+ font-style : oblique 30deg ;
14
+ }
15
+ # id2 {
16
+ font-weight : 300 ;
17
+ font-style : italic;
18
+ }
19
+ </ style >
20
+
21
+
22
+ < permission id ="id1 " type ="geolocation ">
23
+ < permission id ="id2 " type ="camera ">
24
+
25
+ < script >
26
+ test ( function ( ) {
27
+ var el_outside_bounds = document . getElementById ( "id1" ) ;
28
+ assert_equals ( getComputedStyle ( el_outside_bounds ) . fontWeight , "200" , "font-weight" ) ;
29
+ assert_equals ( getComputedStyle ( el_outside_bounds ) . fontStyle , "normal" , "font-style" ) ;
30
+ } , "Properties with out-of-bounds values should be corrected" ) ;
31
+
32
+ test ( function ( ) {
33
+ var el_inside_bounds = document . getElementById ( "id2" ) ;
34
+ assert_equals ( getComputedStyle ( el_inside_bounds ) . fontWeight , "300" , "font-weight" ) ;
35
+ assert_equals ( getComputedStyle ( el_inside_bounds ) . fontStyle , "italic" , "font-style" ) ;
36
+ } , "Properties with values in bounds should not be modified" ) ;
37
+ </ script >
38
+ </ body >
You can’t perform that action at this time.
0 commit comments