Record computed styles in geometry probes
This commit is contained in:
@@ -79,6 +79,26 @@ def geometry_probe_javascript(selectors_expression):
|
||||
"const clientRectCount=element.getClientRects().length;"
|
||||
"return {index:index,x:rect.left,y:rect.top,"
|
||||
"width:rect.width,height:rect.height,"
|
||||
"dom:{tag:String(element.tagName||'').toLowerCase(),"
|
||||
"id:element.id||'',class_name:typeof element.className==='string'"
|
||||
"?element.className:'',child_node_count:element.childNodes.length,"
|
||||
"child_element_count:element.children.length,"
|
||||
"children:Array.from(element.children).slice(0,20).map(child=>({"
|
||||
"tag:String(child.tagName||'').toLowerCase(),id:child.id||'',"
|
||||
"class_name:typeof child.className==='string'?child.className:''}))},"
|
||||
"computed:{display:style.display,float:style.cssFloat,"
|
||||
"clear:style.clear,position:style.position,"
|
||||
"box_sizing:style.boxSizing,width:style.width,height:style.height,"
|
||||
"min_width:style.minWidth,min_height:style.minHeight,"
|
||||
"max_width:style.maxWidth,max_height:style.maxHeight,"
|
||||
"margin_top:style.marginTop,margin_right:style.marginRight,"
|
||||
"margin_bottom:style.marginBottom,margin_left:style.marginLeft,"
|
||||
"padding_top:style.paddingTop,padding_right:style.paddingRight,"
|
||||
"padding_bottom:style.paddingBottom,padding_left:style.paddingLeft,"
|
||||
"flex_direction:style.flexDirection,"
|
||||
"align_items:style.alignItems,justify_content:style.justifyContent,"
|
||||
"text_align:style.textAlign,contain:style.contain,"
|
||||
"overflow_x:style.overflowX,overflow_y:style.overflowY},"
|
||||
"visible:clientRectCount>0&&rect.width>0&&rect.height>0"
|
||||
"&&style.display!=='none'&&style.visibility!=='hidden'"
|
||||
"&&style.visibility!=='collapse'"
|
||||
|
||||
Reference in New Issue
Block a user