On Tue, Sep 17, 2013 at 12:30 PM, Gijs Kruitbosch <gijskruitbo...@gmail.com> wrote: > On 17/09/13 11:18 , Neil wrote: >> >> Gavin Sharp wrote: >> >> Probably the conceptually simplest solution is to get the bounding >> client rect of the found range. > > Won't that be non-zero for visibility:hidden content?
Should be, as well as for content that's obscured by other content, content that's inaccessible due to overflow: hidden, content with low opacity, etc. For this use-case, though, it sounds like the best solution that's really simple: test that the bounding box has nonzero height and width and is at least partially on the screen. That will handle most common cases of hidden text that can be sensibly handled at all. The most important is display: none. I don't think visibility: hidden is used too often to hide text. overflow: hidden is more common, and you could theoretically check for it by iterating through all ancestors and making sure the bounding box is at least partly contained in the box of every ancestor that has overflow: hidden. transform, opacity, and font-size: 0 are not really important to handle for normal web content. Being covered by another element is not inconceivable in real-world content, but probably not worth the effort to handle, unless there's an easy way to do it that I'm not thinking of. _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform