Thanks for replying again. I think I've done exactly as you suggested, save in JavaScript: https://github.com/Jip-Hop/visuallyOnTop.With the visuallyOnTop JavaScript library I can walk the DOM tree and determine which DOM node is in front of others.But downsides of this approach is that it's very slow and needs to be constantly maintained and tested to make sure it actually corresponds to the way the browser renders it.That's why I was hoping to get this information at a lower level, directly from the browser. Like you say, the painting code does create this data. I'm just looking how to get my hands on it.Any further suggestions? :)
On Thursday, 14 April 2016 18:26:51 UTC+2, Christian Biesinger wrote:z-order is not directly part of the layout tree, no. I'm not sure what a good way to get that information is. I mean, the painting code obviously creates such data, I just don't know if it outputs that in a reusable form. You could always treewalk the layout tree and follow https://www.w3.org/TR/CSS2/zindex.html to find out what is occluded by what. (This is not a simple question)-ChristianOn Thu, Apr 14, 2016 at 12:06 PM, <jip.d...@gmail.com> wrote:Hi,Is the z-order (final result of applying z-index etc.) taken into account in the Layout Tree?That's basically the reason I'm looking into this.As I understood it, the Layout Tree is the DOM tree with CSS applied.But on Firefox I noticed the Frame Tree isn't sorted by z-order and doesn't contain any information about z-order either.I was wondering if the same applies to Chrome.Basically I'm interested in real time dumping of the following info for all visible nodes (nodes that take up space in the document):- z-order (so I can determine which elements are in front of other elements)- position- dimensions
On Sunday, 10 April 2016 16:26:58 UTC+2, jip.d...@gmail.com wrote:That sounds like a very nice approach! I really want to try that as well.I actually prefer to have access to it via JavaScript and I was already planning on making an extension.Today I tried building Chromium on my Mac but it fails at: ImportError: No module named CoreFoundationIt seems my Python environment is messed up and I'm unable to fix it (after several hours of trying...)So I'll probably start with a fresh install of OS X sometime soon and try building again.Thanks for all the info everybody. When I've successfully built Chromium I'll try your suggestions and post back here.
On Friday, 8 April 2016 22:56:45 UTC+2, Levi Weintraub wrote:One more way of snagging this info would be to add a JavaScript API to do it. You can just add a definition to one of the JS idl files like Document.idl:DOMString dumpLayoutTree;then wire it up in Document.Then you could make a super-simple extension that runs and records the dumps for all your tabs :)On Fri, Apr 8, 2016 at 1:37 PM, Stefan Zager <sza...@chromium.org> wrote:On Fri, Apr 8, 2016 at 12:39 PM <jip.d...@gmail.com> wrote:In the command:$ kill -s SIGUSR1 <renderer pid>Instead of the Activity Monitor, try using Chrome's TaskMangager:The PID you want is "Tab".Also, someone reminded me that you can get a layout tree dump using chrome tracing with blink.debug.layout enabled, but it has a lot less information in it, and if you want to get a lot of tree dumps, you'll blow out the tracing buffer capacity pretty quickly.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/paint-dev/8bcf73fb-3c2e-4429-bc44-abb79439de22%40chromium.org.--
You received this message because you are subscribed to the Google Groups "paint-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to paint-dev+unsubscribe@chromium.org.
To post to this group, send email to pain...@chromium.org.