Open Bug 1585482 Opened 2 months ago Updated Yesterday

Stop using xul:dialog as a root element and migrate consumers to xul:window[role=dialog] with the dialog as the only child

Categories

(Toolkit :: XUL Widgets, task, P5)

task

Tracking

()

People

(Reporter: bgrins, Assigned: bytesized)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

Attachments

(3 files)

+++ This bug was initially created as a clone of Bug #1584283 +++

Similar to xul:wizard and xul:page, I'd like to stop using non-window xul root elements in order to make migration to html roots easier.

There are a number of consumers of this element in m-c: https://searchfox.org/mozilla-central/search?q=%3Cdialog&path=.

Depends on: 1585545
Assignee: nobody → ksteuber
Summary: Remove xul:dialog and migrate consumers to xul:window[role=dialog] with the dialog as the only child → Stop using xul:dialog as a root element and migrate consumers to xul:window[role=dialog] with the dialog as the only child
Blocks: 1590840
See Also: → 1593787
Attachment #9107605 - Attachment description: Bug 1585482 - WIP! Remove xul:dialog and migrate consumers to xul:window[role=dialog] with the dialog as the only child → Bug 1585482 - Restructure all <xul:dialog> usages such that they are not the top level element

Most of these fixes involve fixing test XUL to not use <dialog> as a top level element or replacing calls to document.documentElement that expect it to return the dialog, now that the dialog is not the top level element anymore.

Depends on D53721

(In reply to Kirk Steuber (he/him) [:bytesized] from comment #4)

So, clearly these patches aren't quite ready: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1be99788a3cbdbc9e825ac3896327b6984dbde3c

Scanning some of those chunks it looks mostly like tests are expecting the documentElement to be a dialog that need updating. Hopefully when you fix helpers like in https://treeherder.mozilla.org/#/jobs?repo=try&revision=1be99788a3cbdbc9e825ac3896327b6984dbde3c&selectedJob=276861526 it will knock a bunch out at a time.

In general you should be able to find replace: doc.documentElement.cancelDialog with doc.querySelector("dialog").cancelDialog (and so on for other dialog functions).

(In reply to Brian Grinstead [:bgrins] from comment #5)

(In reply to Kirk Steuber (he/him) [:bytesized] from comment #4)

So, clearly these patches aren't quite ready: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1be99788a3cbdbc9e825ac3896327b6984dbde3c

Scanning some of those chunks it looks mostly like tests are expecting the documentElement to be a dialog that need updating. Hopefully when you fix helpers like in https://treeherder.mozilla.org/#/jobs?repo=try&revision=1be99788a3cbdbc9e825ac3896327b6984dbde3c&selectedJob=276861526 it will knock a bunch out at a time.

In general you should be able to find replace: doc.documentElement.cancelDialog with doc.querySelector("dialog").cancelDialog (and so on for other dialog functions).

Or as I mentioned previously, you could make the dialog customElement set window.dialogElement = this in the constructor / connectedCallback and then update callers from document.documentElement to window.dialogElement.

I think the work is pretty much done. The last Try run shows two failures that I'm a bit unsure about, but I've discussed them with Brian and we think that they are existing problems, unrelated to this patch. I'm not quite sure who should review this, but we want to wait until after the code freeze (and the Thanksgiving holiday) to land this anyways so that this gets lots of testing time and we don't cause any surprises.

I'd like to get some input from a11y to make sure everything still looks alright. Marco, would you be able to take a look for me? We mostly just want to make sure that the accessibility structure of the dialogs hasn't been changed by these three commits. There are sort of two "types" of dialogs involved in this patch, it would probably be good to take a look at one of each. I'll give an example of each type.

A good example of the first type is the "Clear History" dialog. To open this one, go to "about:preferences" and search for "Clear History". Then click the button with the "Clear History" label.

A good example of the second type is "Bookmark Properties" dialog. To open this one, go to first open the Bookmarks Library either with Control+Shift+B or via Hamburger Menu->Library->Bookmarks->Show All Bookmarks. Once in the Bookmarks Library, click Organize->New Bookmark.

Thanks for your help!

Flags: needinfo?(mzehe)

Thanks for reaching out! These dialogs still work fine with that try build. One thing I noticed: I assume this try build didn't yet include bug 1572677? Because I saw that bug in the try build, but assume it is that bug and not something related to this change to dialogs. Is that correct?

Flags: needinfo?(mzehe) → needinfo?(ksteuber)

Correct. The try build does not include Bug 1572677, so I believe that is why you were seeing that bug.

Thanks for your help!

Flags: needinfo?(ksteuber)
You need to log in before you can comment on or make changes to this bug.