Hi,

I've faced a problem for what I still haven't found a good solution.

Watir's visible? method iterates up the DOM element tree and checks if any 
of the parent elements has visibility attribute set to hidden. If any of 
the parents is hidden then visible? returns false and that's it.

In case of the following html:

div id="parent" style="display: block; visibility:hidden;">
  <div id="child" style="display: block; visibility:visible;">
    Visibility Check.
  </div>
</div>

visible? will return false because "parent" div is hidden.

However the div is actually visible in the browser.

The standard says: definition of hidden: The generated box is invisible 
(fully transparent, nothing is drawn), but still affects layout. 
Furthermore, descendants of the element will be visible if they have 
'visibility: visible'. 
(w3.org/TR/CSS21/visufx.html<http://www.w3.org/TR/CSS21/visufx.html>
)

Is it a feature in Watir and I shall live with it or is there a nice 
workaround here?

Thanks, Andras
ps. the question was originally posted on stackoverflow:
http://stackoverflow.com/questions/14585649/watir-visible-returns-false-for-visible-element-if-parent-is-hidden

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to