Closed Bug 1865480 Opened 1 year ago Closed 1 year ago

Rename nsIContentViewer to nsIDocumentViewer

Categories

(Core :: DOM: Navigation, task)

task

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

Attachments

(1 file)

No description provided.

Not objecting, but I'm just curious: could you briefly explain the reasoning behind the rename here?

I don't interact with the nsIContentViewer interface super-often so I don't have a lot of intuition on why either name is better. But the rename does make some intuitive sense, since this does seem to live closer to the granularity of a "document" than a "content" (which is a bit of an overloaded term), and it's definitely closer to the granularity of a nsIDocument than a nsIContent. So the rename makes sense from that perspective. But I'm curious if this is just following that particular intuition, or if there's more behind this than that.

(I'm also curious to what extent there was careful reasoning behind the current nsIContentViewer name, but I haven't researched that yet, and perhaps the original reasoning is lost to time/CVS and/or not relevant these days.)

Also, this probably wants sign-off from a DOM peer or someone closer to this interface than myself (at least, agreeing in spirit with the rename; they don't necessarily need to review the details; I'm happy to do that part with a skim through the patch).

Flags: needinfo?(jwatt)

(In reply to Daniel Holbert [:dholbert] from comment #2)

Not objecting, but I'm just curious: could you briefly explain the reasoning behind the rename here?

I don't interact with the nsIContentViewer interface super-often so I don't have a lot of intuition on why either name is better. But the rename does make some intuitive sense, since this does seem to live closer to the granularity of a "document" than a "content" (which is a bit of an overloaded term), and it's definitely closer to the granularity of a nsIDocument than a nsIContent. So the rename makes sense from that perspective. But I'm curious if this is just following that particular intuition, or if there's more behind this than that.

Exactly this. "Content" is far too broad a term given that it is very specifically related to a document only. It has long bugged me that it makes the many places in the code where we use the term "content viewer" more difficult to intuit for new people than it needs to be. Just scratching that itch over the weekend.

(I'm also curious to what extent there was careful reasoning behind the current nsIContentViewer name, but I haven't researched that yet, and perhaps the original reasoning is lost to time/CVS and/or not relevant these days.)

I believe from memory the thinking was that at some point we may wish to extend viewing to fragments of documents. A couple of decades later and we've never done that, and since it's pretty document specific now it seems like we should acknowledge that.

Also, this probably wants sign-off from a DOM peer or someone closer to this interface than myself (at least, agreeing in spirit with the rename; they don't necessarily need to review the details; I'm happy to do that part with a skim through the patch).

Sure thing.

Flags: needinfo?(jwatt)
Pushed by jwatt@jwatt.org: https://hg.mozilla.org/integration/autoland/rev/14c89d004e06 Rename nsIContentViewer to nsIDocumentViewer. r=layout-reviewers,emilio
Blocks: 1865891

(In reply to Daniel Holbert [:dholbert] from comment #2)

(I'm also curious to what extent there was careful reasoning behind the current nsIContentViewer name, but I haven't researched that yet, and perhaps the original reasoning is lost to time/CVS and/or not relevant these days.)

Bug 540433 comment 1 has better background on the nsIContentViewer/nsIDocumentViewer split:

(In reply to Boris Zbarsky [:bzbarsky] from Bug 540433 comment #1)

I think the theory was that we could have non-document viewers (e.g.
for plug-ins or images PDFs or whatnot), but I think that's a silly theory.
We should just keep using synthetic documents.

Blocks: 1865918

(In reply to Jonathan Watt [:jwatt] from comment #5)

Bug 540433 comment 1 has better background on the nsIContentViewer/nsIDocumentViewer split:

Thanks for digging that up!

See Also: → 540433

(this also probably doesn't really belong in Printing; searchfox suggests "File a bug in Core:: DOM: Navigation for the nsIContentViewer interface , so let's use that component.)

Component: Printing: Setup → DOM: Navigation
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
See Also: → 1865974
Blocks: 1865995
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: