File tree Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 16
16
17
17
- Corrected return type of ` getPropertyValue ` for CSS style attributes (it's nullable and now returns an option).
18
18
19
+ #### :bug : Bug Fix
20
+
21
+ - Widened input type of ` Window.getComputedStyle ` , allowing subclasses of Element (such as HtmlElement).
22
+
19
23
# 0.9.1
20
24
21
25
#### :bug : Bug Fix
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ window.focus();
34
34
35
35
window . getComputedStyle ( el ) ;
36
36
37
+ window . getComputedStyle ( el ) ;
38
+
39
+ window . getComputedStyle ( el , "hover" ) ;
40
+
37
41
window . getComputedStyle ( el , "hover" ) ;
38
42
39
43
window . getSelection ( ) ;
@@ -85,7 +89,10 @@ window.onload = (function (param) {
85
89
86
90
} ) ;
87
91
92
+ var htmlEl = el ;
93
+
88
94
exports . el = el ;
95
+ exports . htmlEl = htmlEl ;
89
96
exports . $$event = $$event ;
90
97
exports . handleClick = handleClick ;
91
98
exports . idleId = idleId ;
Original file line number Diff line number Diff line change @@ -78,11 +78,13 @@ module Impl = (
78
78
@send external close : t_window => unit = "close"
79
79
@send external confirm : (t_window , string ) => bool = "confirm"
80
80
@send external focus : t_window => unit = "focus"
81
- @send external getComputedStyle : (t_window , Dom .element ) => Dom .cssStyleDeclaration = "getComputedStyle"
81
+ @send
82
+ external getComputedStyle : (t_window , Dom .element_like <'a >) => Dom .cssStyleDeclaration =
83
+ "getComputedStyle"
82
84
@send
83
85
external getComputedStyleWithPseudoElement : (
84
86
t_window ,
85
- Dom .element ,
87
+ Dom .element_like < 'a > ,
86
88
string ,
87
89
) => Dom .cssStyleDeclaration = "getComputedStyle"
88
90
@send @return (nullable ) external getSelection : t_window => option <Dom .selection > = "getSelection"
Original file line number Diff line number Diff line change 1
1
open Webapi .Dom
2
2
3
3
let el = document -> Document .createElement ("strong" )
4
+ let htmlEl = el -> Element .unsafeAsHtmlElement
4
5
let event = document -> Document .createEvent ("my-event" )
5
6
let handleClick = _ => print_endline ("asd" )
6
7
@@ -53,7 +54,9 @@ Window.close(window)
53
54
let _ = window -> Window .confirm ("is ok?" )
54
55
Window .focus (window )
55
56
let _ = window -> Window .getComputedStyle (el )
57
+ let _ = window -> Window .getComputedStyle (htmlEl )
56
58
let _ = window -> Window .getComputedStyleWithPseudoElement (el , "hover" )
59
+ let _ = window -> Window .getComputedStyleWithPseudoElement (htmlEl , "hover" )
57
60
let _ = Window .getSelection (window )
58
61
let _ = window -> Window .matchMedia ("max-height: 400" )
59
62
let _ = window -> Window .moveBy (10 , - 10 )
You can’t perform that action at this time.
0 commit comments