liflab / cornipickle

Versatile web application testing tool
4 stars 3 forks source link

Improve element highlighting #14

Open Faterou opened 9 years ago

Faterou commented 9 years ago

Originally reported by: Sylvain Hallé (Bitbucket: sylvainhalle, GitHub: sylvainhalle)


The current way of highlighting elements in the page is a bit quirky. CP gets a reference to the element, computes its bounding box, and overlays an empty div with a red border of the same dimension on top of it. This has a couple of issues:

Yet, highlighting the elements themselves (changing their border attribute, for example) is no better: if a CP property refers to the border, highlighting the element might change the truth value of the property (even worse if it is the application itself that refers to that attribute). Plus, one has to record the element's state before modifying it, and restore it when it becomes "un-highlighted", etc.

Can we do better?