Bug 103719

Summary: Implement anchored positioning used by <dialog>
Product: WebKit Reporter: Matt Falkenhagen <falken>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: cigitia, jchaffraix, ntim, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 84635    
Attachments:
Description Flags
work in progress patch none

Description Matt Falkenhagen 2012-11-30 00:40:30 PST
<dialog> elements can be anchored to other elements, specified in the call show/showModal():

  dialog.show(anchor);

The spec calls this magical alignment:
http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#magically-aligned
Comment 1 Matt Falkenhagen 2012-11-30 00:51:13 PST
Created attachment 176914 [details]
work in progress patch
Comment 2 Matt Falkenhagen 2012-11-30 00:58:51 PST
This patch is very much a WIP but I hope it can spark some discussion.

I think the anchored positioning step must occur after normal layout, or else we don't know where the anchor itself is be positioned. The tricky part is that an anchor can itself be anchored to something else (or it may be in the subtree of an anchored object). So the order in which the anchored objects are processed is important.

This WIP patch simply traverses the render tree but this is incorrect. The order of anchoring has nothing to do with the render tree structure.

I think we need to somehow build a anchored object tree, and then traverse that instead.
Comment 3 Simon Fraser (smfr) 2012-11-30 09:21:59 PST
If the anchor target is being animated, should the dialog also move around?
Comment 4 Matt Falkenhagen 2012-12-02 21:32:22 PST
(In reply to comment #3)
> If the anchor target is being animated, should the dialog also move around?

Yes, I think so. If I'm interpreting the spec correctly, the dialog follows the anchor if its position is changed dynamically. It looks like animations can be considered the same thing.

Is it more difficult to handle following an animated anchor?
Comment 5 Simon Fraser (smfr) 2012-12-02 22:08:35 PST
(In reply to comment #4)
> (In reply to comment #3)
> > If the anchor target is being animated, should the dialog also move around?
> 
> Yes, I think so. If I'm interpreting the spec correctly, the dialog follows the anchor if its position is changed dynamically. It looks like animations can be considered the same thing.
> 
> Is it more difficult to handle following an animated anchor?

Yes, in some cases. You also need to consider the effects of CSS transforms on your target.
Comment 6 Tim Nguyen (:ntim) 2021-04-23 14:53:58 PDT
This has been removed from the spec.