Closed Bug 820230 Opened 13 years ago Closed 13 years ago

Move PaintSVGGlyph and GetSVGGlyphExtents from nsContentUtils to nsSVGUtils

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

Details

Attachments

(1 file)

tdlr: moving them to avoid nsContentUtils.h requiring gfx/ headers PaintSVGGlyph and GetSVGGlyphExtents requires includes of #include "gfxContext.h" #include "gfxFont.h" which makes any file including nsContentUtils.h depending on GFX. For example js/xpconnect/loader/mozJSComponentLoader.cpp It seems to me js/xpconnect depending on gfx/ is a layer violation. Also, it makes fixing bug 786533 very hard, since std::max requires <algorithm> which we wrap and thus fails to compile when building in some configurations. See bug 786533 comment 28 for details.
Attached patch fixSplinter Review
... well, also just because they really belong in nsSVGUtils.h :-)
Attachment #690666 - Flags: review?(roc)
I should point out that I cleaned up the code somewhat also, so you don't miss to review that.
(In reply to Mats Palmgren [:mats] from comment #0) > It seems to me js/xpconnect depending on gfx/ is a layer violation. Really it's js/xpconnect depending on nsContentUtils that's a layering violation.
OK, the only use of nsContentUtils is this: MOZ_ASSERT(nsContentUtils::IsCallerChrome()); (mozJSComponentLoader.cpp compiles without the #include if I remove that line)
Sorry about that, I had neglected to add some "b2g platforms" to my default Try patch (fixed now). The build problem was that gfxFont.h brings in numerous other headers so when I removed it from nsContentUtils.h it exposed a couple of dom/ files that didn't include the correct headers for their used APIs (depending on gfxFont.h for mozilla::services etc). I'll reland in a moment (with a green Try). (It's just a an added #include in the affected files so no need to re-review.) https://hg.mozilla.org/try/rev/ea713cb603fd
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: