You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Python @DataClass, post_init return values are ignored. If inverted coordinates (x1 > x2 or y1 > y2) are passed, the dataclass initializes silently with invalid negative bounds, corrupting occlusion calculations. It should raise ValueError.
Unhandled zero or negative dimensions in calculate_paint_order: Elements with bounds.width <= 0 or bounds.height <= 0 are passed into Rect(...) without filtering, causing non-visible or collapsed elements to enter occlusion calculations.
HTML around where it's failing
### 4. HTML around where it's failing *
<divstyle="width: 0px; height: 0px; overflow: hidden;"><spanclass="hidden-tracker"></span></div>
frombrowser_use.dom.serializer.paint_orderimportRect# Returns an instance silently instead of failing:invalid_rect=Rect(x1=100.0, y1=50.0, x2=20.0, y2=10.0)
print(invalid_rect.area()) # Computes nonsensical area without error
Full DEBUG Log Output
DEBUG [browser_use.dom.serializer] Building paint order occlusion tree
DEBUG [browser_use.dom.serializer] Processed node bounds: Rect(x1=100.0, y1=50.0, x2=20.0, y2=10.0)
DEBUG [browser_use.dom.serializer] Invalid negative dimensions detected during occlusion pass
Activity
fix(dom): raise on inverted Rect bounds instead of ignoring them