You can clone with
b = Watir::Browser.start 'minesweeper.github.com'
puts b.div(:id => 'g1minesRemaining100s').style 'background-image'
puts b.div(:id => 'g1minesRemaining100s').style #shouldn't be ''
Right. If you give an argument, we'll return the computed style of the element, otherwise, the style attribute (which may very well be empty).
I'm not entirely sure if it's correct to change this.
I guess what I was looking for is all computed styles of the element. But, it makes sense to not change this method from what it actually currently does.
I imagine it may be rather inefficient to compute all styles of an element?
Honestly don't know if it's inefficient, but I think it will be pretty difficult to make the returned string consistent cross-browser.
What's the use case? What would you do with the full list?
Someone wanted it on stackoverflow.
They couldn't work out how to use the style method, as it returned an empty string.
I'm more than happy to close it and see if it comes up as a request again :)
OK, then that's what we'll do :)