

On extracting an element from a web page with CSS styles - nathancahill
http://nathancahill.wordpress.com/2012/02/21/on-extracting-an-element-from-a-web-page-with-css-styles/

======
vitovito
Would love to see inline examples of the output, or a bookmarklet that gives
you the generated output of e.g. an element you choose on an arbitrary site.

Also, you don't need to copy every child element's style. You only need to
copy the styles that are _different from the parent element_ and/or _different
from your current stylesheet._

For each element, I believe you can create an empty one in the place you'll be
putting the final output to see what its computed styles are, and then use
that to compare to the one you're reading from.

~~~
nathancahill
You're right, I wouldn't need to copy styles that are the same as the elements
parent. It adds an extra check though.. I'm trying to reduce the amount of
things the lowest level handler has to do. Another check would expand the
overhead exponentially.

