@@ -1053,7 +1053,7 @@ pub const CssProperties = struct {
10531053
10541054pub const CssCache = std .AutoHashMapUnmanaged (* Element , CssProperties );
10551055
1056- fn getCssProperties (el : * Element , page : * Page , doc_sheets : ? * StyleSheetList , cache : ? * CssCache ) CssProperties {
1056+ fn getCssProperties (el : * Element , doc_sheets : ? * StyleSheetList , cache : ? * CssCache , page : * Page ) CssProperties {
10571057 if (cache ) | c | {
10581058 if (c .get (el )) | props | return props ;
10591059 }
@@ -1144,27 +1144,23 @@ fn getCssProperties(el: *Element, page: *Page, doc_sheets: ?*StyleSheetList, cac
11441144 return props ;
11451145}
11461146
1147- pub fn hasPointerEventsNoneCached (self : * Element , page : * Page , cache : ? * CssCache ) bool {
1147+ pub fn hasPointerEventsNone (self : * Element , cache : ? * CssCache , page : * Page ) bool {
11481148 const doc_sheets = page .document .getStyleSheets (page ) catch null ;
11491149 var current : ? * Element = self ;
11501150 while (current ) | el | {
1151- const props = el .getCssProperties (page , doc_sheets , cache );
1151+ const props = el .getCssProperties (doc_sheets , cache , page );
11521152 if (props .pointer_events_none ) return true ;
11531153 current = el .parentElement ();
11541154 }
11551155 return false ;
11561156}
11571157
1158- pub fn hasPointerEventsNone (self : * Element , page : * Page ) bool {
1159- return self .hasPointerEventsNoneCached (page , null );
1160- }
1161-
1162- pub fn checkVisibilityCached (self : * Element , page : * Page , cache : ? * CssCache ) bool {
1158+ pub fn checkVisibilityCached (self : * Element , cache : ? * CssCache , page : * Page ) bool {
11631159 const doc_sheets = page .document .getStyleSheets (page ) catch null ;
11641160 var current : ? * Element = self ;
11651161
11661162 while (current ) | el | {
1167- const props = getCssProperties (el , page , doc_sheets , cache );
1163+ const props = getCssProperties (el , doc_sheets , cache , page );
11681164 if (props .display_none or props .visibility_hidden or props .opacity_zero ) return false ;
11691165 current = el .parentElement ();
11701166 }
@@ -1173,7 +1169,7 @@ pub fn checkVisibilityCached(self: *Element, page: *Page, cache: ?*CssCache) boo
11731169}
11741170
11751171pub fn checkVisibility (self : * Element , page : * Page ) bool {
1176- return self .checkVisibilityCached (page , null );
1172+ return self .checkVisibilityCached (null , page );
11771173}
11781174
11791175fn getElementDimensions (self : * Element , page : * Page ) struct { width : f64 , height : f64 } {
0 commit comments