Module to synchronize popup/panel UI positions with elements in content (for autocomplete, validation, <select>, etc.)
Categories
(Firefox :: General, enhancement, P2)
Tracking
()
People
(Reporter: MattN, Unassigned)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [tech-debt])
User Story
Some of the DOM events currently used or available: * resize * MozScrolledAreaChanged * mozvisualscroll * scroll * FullZoomChange * TextZoomChange * ZoomChangeUsingMouseWheel * MozAfterPaint * pagehide Some things to handle: * zoom changes * page is unloaded/hidden * ownerDocument scrolling * viewport resizes * should handle a parent frame scrolling while the chrome UI is attached to an inner frame. * handle a position change due to a stylesheet load (e.g. bug 1329333). * stay constrained to the <browser> viewport area * Ideally handle overflow: auto, not just the whole document scrolling * entering DOM fullscreen mode
Comment 1•7 years ago
|
||
Reporter | ||
Comment 2•5 years ago
|
||
Hi Razvan,
All the various popups that appear over content have to address a similar problem as bug 1598307 and I wondered if there would be a way to share the approach (either code or just hooks into layout) used to address this longstanding bug (since e10s). Anything info you could share would be great, thanks.
You might also be interested in the list in the User Story to make sure you handle all those cases.
Comment 3•5 years ago
|
||
Hi Matthew,
Historically, highlighters in DevTools have relied on a requestAnimationFrame
loop where getBoxQuads()
is called on the inspected node. When the box quads, scroll or zoom change, the UI of the highlighter is updated accordingly. Checks are done to get "adjusted quads" in relation to the top-level document. This has worked well over time and the intent is to keep the behavior (mostly keep the necessary rewrite for highlighters for Fission as small as possible).
With Fission, we intend to keep this approach in DevTools. But we need to get additional platform support in order to get box quads relevant to the top-level document which may be in a different process if inspecting a node in a nested frame from a different process. See bug 1593756.
If there is a desire to implement a mechanism to track node position changes directly on the platform, perhaps like an observer, we'd be interested to learn about it and share some use cases.
Highlighters in DevTools have a few more needs than just tracking node position. For example getting updated node attributes, like id, class names, measuring color contrast between text content and background, or getting some information from the node's ancestors (ex: from grid/flex container). These still require direct access to the node and monitoring it directly.
Work for this will happen in bug 1598307. We're still learning about the complexities and pitfalls of rendering in the parent process while observing nodes in content process. Impact on synchronizing with smooth scroll stands out. We already have a discontinued prototype in bug 1572651 which we be removed soon because it was the wrong approach to communicate cross-process.
(please ni? me on my mozilla email address)
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Updated•4 years ago
|
Updated•2 years ago
|
Description
•