Mozilla Home
Privacy
Cookies
Legal
Bugzilla
Browse
Advanced Search
New Bug
Reports
Documentation
Log In
Log In with GitHub
or
Remember me
Browse
Advanced Search
New Bug
Reports
Documentation
Attachment 806955 Details for
Bug 918109
[patch]
fix v1
918109-fix.patch (text/plain), 4.15 KB, created by
Daniel Holbert [:dholbert]
(
hide
)
Description:
fix v1
Filename:
MIME Type:
Creator:
Daniel Holbert [:dholbert]
Size:
4.15 KB
patch
obsolete
># HG changeset patch ># Parent 4a5e5dfa5e2fb9bc7a084281b8868fe7aea6c5bb ># User Daniel Holbert <dholbert@cs.stanford.edu> >Bug 918109: Move some null-initialized static variables in nsLayoutUtils.cpp to function-scope. r=mats > >diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp >--- a/layout/base/nsLayoutUtils.cpp >+++ b/layout/base/nsLayoutUtils.cpp >@@ -109,28 +109,16 @@ typedef FrameMetrics::ViewID ViewID; > /* static */ int32_t nsLayoutUtils::sFontSizeInflationMappingIntercept; > /* static */ uint32_t nsLayoutUtils::sFontSizeInflationMaxRatio; > /* static */ bool nsLayoutUtils::sFontSizeInflationForceEnabled; > /* static */ bool nsLayoutUtils::sFontSizeInflationDisabledInMasterProcess; > /* static */ bool nsLayoutUtils::sInvalidationDebuggingIsEnabled; > > static ViewID sScrollIdCounter = FrameMetrics::START_SCROLL_ID; > >-// These are indices into kDisplayKTable. They'll be initialized >-// the first time that FlexboxEnabledPrefChangeCallback() is invoked. >-static int32_t sIndexOfFlexInDisplayTable; >-static int32_t sIndexOfInlineFlexInDisplayTable; >-// This tracks whether those ^^ indices have been initialized >-static bool sAreFlexKeywordIndicesInitialized = false; >- >-// This is an index into kPositionKTable. It will be initialized >-// the first time that StickyEnabledPrefChangeCallback() is invoked. >-static int32_t sIndexOfStickyInPositionTable; >-static bool sIsStickyKeywordIndexInitialized = false; >- > typedef nsDataHashtable<nsUint64HashKey, nsIContent*> ContentMap; > static ContentMap* sContentMap = nullptr; > static ContentMap& GetContentMap() { > if (!sContentMap) { > sContentMap = new ContentMap(); > } > return *sContentMap; > } >@@ -141,28 +129,37 @@ static ContentMap& GetContentMap() { > static int > FlexboxEnabledPrefChangeCallback(const char* aPrefName, void* aClosure) > { > MOZ_ASSERT(strncmp(aPrefName, FLEXBOX_ENABLED_PREF_NAME, > NS_ARRAY_LENGTH(FLEXBOX_ENABLED_PREF_NAME)) == 0, > "We only registered this callback for a single pref, so it " > "should only be called for that pref"); > >+ static int32_t sIndexOfFlexInDisplayTable; >+ static int32_t sIndexOfInlineFlexInDisplayTable; >+ static bool sAreFlexKeywordIndicesInitialized; // initialized to false >+ > bool isFlexboxEnabled = > Preferences::GetBool(FLEXBOX_ENABLED_PREF_NAME, false); > > if (!sAreFlexKeywordIndicesInitialized) { > // First run: find the position of "flex" and "inline-flex" in > // kDisplayKTable. > sIndexOfFlexInDisplayTable = > nsCSSProps::FindIndexOfKeyword(eCSSKeyword_flex, > nsCSSProps::kDisplayKTable); >+ MOZ_ASSERT(sIndexOfFlexInDisplayTable >= 0, >+ "Couldn't find flex in kDisplayKTable"); >+ > sIndexOfInlineFlexInDisplayTable = > nsCSSProps::FindIndexOfKeyword(eCSSKeyword_inline_flex, > nsCSSProps::kDisplayKTable); >+ MOZ_ASSERT(sIndexOfInlineFlexInDisplayTable >= 0, >+ "Couldn't find inline-flex in kDisplayKTable"); > > sAreFlexKeywordIndicesInitialized = true; > } > > // OK -- now, stomp on or restore the "flex" entries in kDisplayKTable, > // depending on whether the flexbox pref is enabled vs. disabled. > if (sIndexOfFlexInDisplayTable >= 0) { > nsCSSProps::kDisplayKTable[sIndexOfFlexInDisplayTable] = >@@ -182,16 +179,19 @@ FlexboxEnabledPrefChangeCallback(const c > static int > StickyEnabledPrefChangeCallback(const char* aPrefName, void* aClosure) > { > MOZ_ASSERT(strncmp(aPrefName, STICKY_ENABLED_PREF_NAME, > NS_ARRAY_LENGTH(STICKY_ENABLED_PREF_NAME)) == 0, > "We only registered this callback for a single pref, so it " > "should only be called for that pref"); > >+ static int32_t sIndexOfStickyInPositionTable; >+ static bool sIsStickyKeywordIndexInitialized; // initialized to false >+ > bool isStickyEnabled = > Preferences::GetBool(STICKY_ENABLED_PREF_NAME, false); > > if (!sIsStickyKeywordIndexInitialized) { > // First run: find the position of "sticky" in kPositionKTable. > sIndexOfStickyInPositionTable = > nsCSSProps::FindIndexOfKeyword(eCSSKeyword_sticky, > nsCSSProps::kPositionKTable);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Flags:
MatsPalmgren_bugz
: review+
Actions:
View
|
Diff
|
Review
Attachments on
bug 918109
: 806955