Hi,

Thanks a lot for replying again. I'll look into it more but it already makes 
sense!

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. I think I need to implement my own function to get and 
set a custom parameter, right? I can then check for this parameter from the two 
parts you referenced. And I can set the parameter from GetFramesForArea() which 
constructs the nsDisplayListBuilder.

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.

I made this screen recording to give an idea of my end goal: 
https://youtu.be/EtH1MMDorKA

I basically want to visualize the position of all visible elements on a 
webpage, with all CSS rules applied and in the right visual order (z-order). In 
real time. The only elements I want to leave out are elements with display:none.

As you can see in the video I still have some issues with elements within 
scrolling elements...

On Monday, 2 May 2016 18:50:28 UTC+2, [email protected]  wrote:
> Sorry for the delayed response! I'm not actually subscribed to this list, and 
> I thought replies would be automatically cc'd to me.
> 
> On Sunday, April 24, 2016 at 6:12:31 AM UTC-4, [email protected] wrote:
> > I'm still stuck with a few things. Just like elementsFromPoint() my 
> > function currently ignores nodes with pointer-events:none; or 
> > visibility:hidden; (and maybe more). I only want to ignore nodes with 
> > display:none; Where can I override this?
> 
> It looks like visibility:none is checked here [1] and pointer-events:none is 
> checked here [2].
> 
> Both of those functions have an nsDisplayListBuilder* argument, so you could 
> do something like this:
> 
>   - add a flag to nsDisplayListBuilder, whether it should ignore
>     visibility:none and pointer-events:none
>   - condition the above checks on the flag not being set
>   - add a corresponding option to GetFramesForArea()
>   - when GetFramesForArea() constructs the nsDisplayListBuilder,
>     set the flag is the option is set
>   - for your call to GetFramesForArea(), set the option
> 
> Hope that made sense.
> 
> If you give some more details about your end goal, we may be able to suggest 
> solutions that are easier / involve writing less custom code.
> 
> Cheers,
> Botond
> 
> [1] 
> https://dxr.mozilla.org/mozilla-central/rev/1461a4071341c282afcf7b72e33036412d2251d4/layout/generic/nsFrame.cpp#6295
> [2] 
> https://dxr.mozilla.org/mozilla-central/rev/1461a4071341c282afcf7b72e33036412d2251d4/layout/base/nsDisplayList.cpp#2061
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to