I noticed I'm still missing some elements.
Children of button HTML elements aren't returned by elementsFromPoint.
You can see it in this fiddle: https://jsfiddle.net/ztg9gppt/2/

Google Chrome does return the children within button elements, even divs.
Twitter is nesting divs within buttons on their feed.

Has it been a deliberate choice to leave out the children of button elements? 
Can I make another workaround or should this be reported as a bug?

On Friday, 6 May 2016 23:15:35 UTC+2, [email protected]  wrote:
> Thanks again for replying!
> 
> I was able to get everything working with your instructions :)
> I also applied the same method to ignore backface-visibility:hidden;
> This check is done here:
> https://dxr.mozilla.org/mozilla-central/rev/e5a10bc7dac4ee2453d8319165c1f6578203eac7/layout/base/nsDisplayList.cpp#6018
> 
> Hopefully I'm now only excluding elements with display:none and elements 
> which aren't visible because their outside the visible part of a scrollable 
> HTML element.
> 
> Another thing I realized I should do was calling GetPrimaryFrame() on the 
> dom::Element* I got from GetFramesForArea(). This way I could filter only the 
> primary frames, which correspond to the HTML elements. Now I no longer have 
> duplicate HTML tags in my output. This also filters out the list decoration 
> of ul and ol elements and the scrollbars.
> 
> And sorry about the video! I forgot to turn that on. But the video wasn't 
> very good anyway.
> 
> Thanks for the help and I'll post my final result when I've got something to 
> show.
> 
> On Thursday, 5 May 2016 01:59:34 UTC+2, [email protected]  wrote:
> > On Monday, May 2, 2016 at 4:55:13 PM UTC-4, [email protected] wrote:
> > > Does it means I also have to modify nsDisplayList.h in order to add the 
> > > flag to nsDisplayListBuilder? I'm still a bit unsure how to add a flag to 
> > > nsDisplayListBuilder. 
> > 
> > Just add a new member variable, like mIgnoreVisibility (and a getter/setter 
> > for it, if it's not public).
> > 
> > > In my brief testing I noticed that overriding the pointer-events check in 
> > > nsDisplayList::HitTest() allows me to also retrieve elements with 
> > > pointer-events:none. Though strangely no iframes with 
> > > pointer-events:none. Those are still left out.
> > 
> > Ah, there is a separate check for iframes here [1]!
> > 
> > > I made this screen recording to give an idea of my end goal: 
> > > https://youtu.be/EtH1MMDorKA
> > 
> > The video is private, I can't access it.
> > 
> > Cheers,
> > Botond
> > 
> > [1] 
> > https://dxr.mozilla.org/mozilla-central/rev/369a5ee3a2880a4a98df3a00bf3db8d8f36b181b/layout/generic/nsSubDocumentFrame.cpp#379
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to