mirror of
https://github.com/daijro/camoufox.git
synced 2026-10-30 00:06:21 +00:00
fix: rewrite gfxTextRun constructor for Firefox 146 FontVisibilityProvider
- Update constructor signature from nsPresContext to FontVisibilityProvider - Remove mLastPrefFirstFont and mSkipDrawing from initializer (not in FF146) - Update line numbers: 1861→1873, 1876→1875 - Replace mPresContext with mFontVisibilityProvider for user context extraction
This commit is contained in:
@@ -869,25 +869,25 @@ index a8fac45e67..d59815f2d5 100644
|
||||
|
||||
EmphasisMarkDrawParams params(aContext, aPaletteCache);
|
||||
params.mark = aMark;
|
||||
@@ -1861,7 +1865,8 @@ gfxFontGroup::gfxFontGroup(nsPresContext* aPresContext,
|
||||
mPageLang(gfxPlatformFontList::GetFontPrefLangFor(aLanguage)),
|
||||
mLastPrefFirstFont(false),
|
||||
mSkipDrawing(false),
|
||||
- mExplicitLanguage(aExplicitLanguage) {
|
||||
+ mExplicitLanguage(aExplicitLanguage),
|
||||
@@ -1873,2 +1877,3 @@ gfxFontGroup::gfxFontGroup(FontVisibilityProvider* aFontVisibilityProvider,
|
||||
mPageLang(gfxPlatformFontList::GetFontPrefLangFor(aLanguage)),
|
||||
mExplicitLanguage(aExplicitLanguage),
|
||||
- mFontVariantEmoji(aVariantEmoji) {
|
||||
+ mFontVariantEmoji(aVariantEmoji),
|
||||
+ mUserContextId(0) {
|
||||
+ mUserContextId(0) {
|
||||
switch (aVariantEmoji) {
|
||||
case StyleFontVariantEmoji::Normal:
|
||||
case StyleFontVariantEmoji::Unicode:
|
||||
@@ -1876,6 +1881,19 @@ gfxFontGroup::gfxFontGroup(nsPresContext* aPresContext,
|
||||
@@ -1875,4 +1880,17 @@ gfxFontGroup::gfxFontGroup(FontVisibilityProvider* aFontVisibilityProvider,
|
||||
// We don't use SetUserFontSet() here, as we want to unconditionally call
|
||||
// EnsureFontList() rather than only do UpdateUserFonts() if it changed.
|
||||
mCurrGeneration = 0;
|
||||
+
|
||||
+ // Initialize cached user context ID from the document principal.
|
||||
+ mUserContextId = 0;
|
||||
+ if (mPresContext) {
|
||||
+ if (auto* doc = mPresContext->Document()) {
|
||||
+ if (mFontVisibilityProvider) {
|
||||
if (auto* doc = mFontVisibilityProvider ? mFontVisibilityProvider->GetDocument() : nullptr) {
|
||||
+ if (auto* principal = doc->NodePrincipal()) {
|
||||
+ auto* bp = mozilla::BasePrincipal::Cast(principal);
|
||||
+ if (bp) {
|
||||
|
||||
Reference in New Issue
Block a user