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 1616
1717- Corrected return type of ` getPropertyValue ` for CSS style attributes (it's nullable and now returns an option).
1818
19+ #### :bug : Bug Fix
20+
21+ - Widened input type of ` Window.getComputedStyle ` , allowing subclasses of Element (such as HtmlElement).
22+
1923# 0.9.1
2024
2125#### :bug : Bug Fix
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ window.focus();
3434
3535window . getComputedStyle ( el ) ;
3636
37+ window . getComputedStyle ( el ) ;
38+
39+ window . getComputedStyle ( el , "hover" ) ;
40+
3741window . getComputedStyle ( el , "hover" ) ;
3842
3943window . getSelection ( ) ;
@@ -85,7 +89,10 @@ window.onload = (function (param) {
8589
8690 } ) ;
8791
92+ var htmlEl = el ;
93+
8894exports . el = el ;
95+ exports . htmlEl = htmlEl ;
8996exports . $$event = $$event ;
9097exports . handleClick = handleClick ;
9198exports . idleId = idleId ;
Original file line number Diff line number Diff line change @@ -78,11 +78,13 @@ module Impl = (
7878 @send external close : t_window => unit = "close"
7979 @send external confirm : (t_window , string ) => bool = "confirm"
8080 @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"
8284 @send
8385 external getComputedStyleWithPseudoElement : (
8486 t_window ,
85- Dom .element ,
87+ Dom .element_like < 'a > ,
8688 string ,
8789 ) => Dom .cssStyleDeclaration = "getComputedStyle"
8890 @send @return (nullable ) external getSelection : t_window => option <Dom .selection > = "getSelection"
Original file line number Diff line number Diff line change 11open Webapi .Dom
22
33let el = document -> Document .createElement ("strong" )
4+ let htmlEl = el -> Element .unsafeAsHtmlElement
45let event = document -> Document .createEvent ("my-event" )
56let handleClick = _ => print_endline ("asd" )
67
@@ -53,7 +54,9 @@ Window.close(window)
5354let _ = window -> Window .confirm ("is ok?" )
5455Window .focus (window )
5556let _ = window -> Window .getComputedStyle (el )
57+ let _ = window -> Window .getComputedStyle (htmlEl )
5658let _ = window -> Window .getComputedStyleWithPseudoElement (el , "hover" )
59+ let _ = window -> Window .getComputedStyleWithPseudoElement (htmlEl , "hover" )
5760let _ = Window .getSelection (window )
5861let _ = window -> Window .matchMedia ("max-height: 400" )
5962let _ = window -> Window .moveBy (10 , - 10 )
You can’t perform that action at this time.
0 commit comments