Closed Bug 1786185 Opened 2 years ago Closed 2 years ago

Migrate XMLPrettyPrinter from DTD to Fluent

Categories

(Core :: XML, task)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: eemeli, Assigned: eemeli)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

dom/xml/resources/XMLPrettyPrint.xsl is one of the few remaining users of DTD strings for localization, and should be migrated to Fluent.

Erik/Greg, would you be able to confirm my suspicion that this would probably be best done by adding a data-l10n-id to this <p> element in the XSL, and then somewhere around here constructing a new DOMLocalization instance and connecting the parent id="header" as a localization root?

I think this would end up as the one single place where it makes sense to directly create a new DOMLocalization from C++ code, so I'm a bit leery about progressing here in case I've missed some other way of solving this.

Blocks: 1675814
Flags: needinfo?(gtatum)
Flags: needinfo?(enordin)
Blocks: 1786543

Seems reasonable to create your own if you can't access one.

It looks like here is where the Document normally creates one: https://searchfox.org/mozilla-central/rev/380fc5571b039fd453b45bbb64ed13146fe9b066/dom/base/Document.cpp#4323

You can grab it via: https://searchfox.org/mozilla-central/rev/380fc5571b039fd453b45bbb64ed13146fe9b066/dom/base/Document.cpp#4297

I'm low context on this specific codepath, but I would at least verify you can't get access to that first.

Flags: needinfo?(gtatum)

It also seems reasonable to me to create your own in this case.

Flags: needinfo?(enordin)

The DocumentL10n instance that's created here is not exposed on the root document, as that is the user-defined XML document. The localization root that's connected to it is in a closed shadow root.

I'm not certain if this localization updates on locale changes, or how exactly to test for that.

Assignee: nobody → earo
Status: NEW → ASSIGNED
Pushed by earo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5c9f3a2ee4ad Migrate XMLPrettyPrint from DTD to FTL. r=gregtatum,smaug,fluent-reviewers,flod
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: