The image below has class="clipped"
, where clipped
in the stylesheet in the HEAD
of this file
defines a clipping rectangle. The image is clipped as desired, but
I can't find any way in Internet Explorer 7 or Safari
to get the runtime clip rectangle.
The following in IE return a blank or undefined result:
javascript:alert(document.images[0].style.clip)
javascript:alert(document.images[0].currentStyle.clip)
javascript:alert(document.images[0].runtimeStyle.clip)
The following works in Firefox and Opera, but not Safari, and
getComputedStyle()
is unsupported in IE:
javascript:alert(document.defaultView.getComputedStyle(document.images[0], null).clip)
Properties like position
seem to work.
Searching the stylesheets for rules with relevant selector text
seems doable, but a general solution would mean implementing all the
logic that goes into calculating run time styles.