Closed Bug 1533395 Opened 6 years ago Closed 6 years ago

Refactor gfxTextRange to better match how it's actually used

Categories

(Core :: Layout: Text and Fonts, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla68
Fission Milestone M2
Tracking Status
firefox68 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

Details

Attachments

(1 file)

The gfxTextRange struct is not well-named or -placed in the tree. It's not a general-purpose text range; it's used only by gfxFontGroup to keep track of ranges and associated fonts during the font-matching process for text run construction.

The MatchType enum within gfxTextRange exists only so we can expose how font matching happened via the dom::InspectorFontFace interface.

So I intend to define the MatchType enum within InspectorFontFace (and alias it as FontMatchType within gfxTextRun/gfxFontGroup), and move the gfxTextRange struct inside gfxFontGroup as a local TextRange type, which better reflects its purpose.

(The real motivation for this, aside from that it feels better-organized, is to eliminate the need for #include "gfxFont.h" in InspectorFontFace.h, because that led to conflicts later on in the shared-font-list work.)

Assignee: nobody → jfkthame
Fission Milestone: --- → ?

This more closely reflects what the match-type flags and the range struct are actually used for,
and allows us to reduce #include usage of the massive gfxFont.h header.

:jwatt, just FYI - this is basically what you previously reviewed as "patch 3" in bug 1514869, but I've shuffled things around into what I think is a much better arrangement, and split it out into a dependent bug as it's a standalone change.

Attachment #9049885 - Attachment description: Bug 1533395 - Refactor gfxTextRange struct, moving the MatchType enum to InspectorFontFace, and the struct inside gfxFontGroup as a local type. r?jwatt → Bug 1533395 - Refactor gfxTextRange struct, moving the MatchType enum to gfxTypes.h as FontMatchType, and the struct inside gfxFontGroup as a local type. r=jwatt
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5e7654dc258d Refactor gfxTextRange struct, moving the MatchType enum to gfxTypes.h as FontMatchType, and the struct inside gfxFontGroup as a local type. r=jwatt
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Type: enhancement → task
Fission Milestone: ? → M2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: