Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2023-08-17 09:19:05 +08:00
commit 4e8d205102
13 changed files with 155 additions and 23 deletions

View file

@ -13,7 +13,7 @@ MOZ_ARG_ENABLE_BOOL(address-sanitizer,
MOZ_ASAN= ) MOZ_ASAN= )
if test -n "$MOZ_ASAN"; then if test -n "$MOZ_ASAN"; then
MOZ_LLVM_HACKS=1 MOZ_LLVM_HACKS=1
if test -n "$CLANG_CL"; then if test "$OS_ARCH" = "WINNT"; then
# Look for the ASan runtime binary # Look for the ASan runtime binary
if test "$CPU_ARCH" = "x86_64"; then if test "$CPU_ARCH" = "x86_64"; then
MOZ_CLANG_RT_ASAN_LIB=clang_rt.asan_dynamic-x86_64.dll MOZ_CLANG_RT_ASAN_LIB=clang_rt.asan_dynamic-x86_64.dll
@ -27,14 +27,14 @@ if test -n "$MOZ_ASAN"; then
fi fi
AC_SUBST(MOZ_CLANG_RT_ASAN_LIB_PATH) AC_SUBST(MOZ_CLANG_RT_ASAN_LIB_PATH)
# Suppressing errors in recompiled code. # Suppressing errors in recompiled code.
if test "$OS_ARCH" = "WINNT"; then if test -n "$CLANG_CL"; then
CFLAGS="-fsanitize-blacklist=$_topsrcdir/build/sanitizers/asan_blacklist_win.txt $CFLAGS" CFLAGS="-fsanitize-blacklist=$_topsrcdir/build/sanitizers/asan_blacklist_win.txt $CFLAGS"
CXXFLAGS="-fsanitize-blacklist=$_topsrcdir/build/sanitizers/asan_blacklist_win.txt $CXXFLAGS" CXXFLAGS="-fsanitize-blacklist=$_topsrcdir/build/sanitizers/asan_blacklist_win.txt $CXXFLAGS"
fi fi
fi fi
CFLAGS="-fsanitize=address $CFLAGS" CFLAGS="-fsanitize=address $CFLAGS"
CXXFLAGS="-fsanitize=address $CXXFLAGS" CXXFLAGS="-fsanitize=address $CXXFLAGS"
if test -z "$CLANG_CL"; then if test "$OS_ARCH" != "WINNT"; then
LDFLAGS="-fsanitize=address $LDFLAGS" LDFLAGS="-fsanitize=address $LDFLAGS"
fi fi
AC_DEFINE(MOZ_ASAN) AC_DEFINE(MOZ_ASAN)
@ -80,6 +80,40 @@ if test -n "$MOZ_TSAN"; then
fi fi
AC_SUBST(MOZ_TSAN) AC_SUBST(MOZ_TSAN)
dnl ========================================================
dnl = Use Leak Sanitizer
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(leak-sanitizer,
[ --enable-leak-sanitizer Enable Leak Sanitizer (default=no)],
MOZ_LSAN=1,
MOZ_LSAN= )
if test -n "$MOZ_LSAN"; then
MOZ_LLVM_HACKS=1
LDFLAGS="-fsanitize=leak $LDFLAGS"
AC_DEFINE(MOZ_LSAN)
MOZ_PATH_PROG(LLVM_SYMBOLIZER, llvm-symbolizer)
fi
AC_SUBST(MOZ_LSAN)
dnl ========================================================
dnl = Use Undefined Behavior Sanitizer
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(undefined-sanitizer,
[ --enable-undefined-sanitizer Enable Undefined Behavior Sanitizer (default=no)],
MOZ_UBSAN=1,
MOZ_UBSAN= )
if test -n "$MOZ_UBSAN"; then
MOZ_LLVM_HACKS=1
CFLAGS="-fsanitize=undefined $CFLAGS"
CXXFLAGS="-fsanitize=undefined $CXXFLAGS"
if test -z "$CLANG_CL"; then
LDFLAGS="-fsanitize=undefined $LDFLAGS"
fi
AC_DEFINE(MOZ_UBSAN)
MOZ_PATH_PROG(LLVM_SYMBOLIZER, llvm-symbolizer)
fi
AC_SUBST(MOZ_UBSAN)
# The LLVM symbolizer is used by all sanitizers # The LLVM symbolizer is used by all sanitizers
AC_SUBST(LLVM_SYMBOLIZER) AC_SUBST(LLVM_SYMBOLIZER)

View file

@ -64,9 +64,11 @@ FINAL_TARGET_FILES += ['/.gdbinit']
FINAL_TARGET_PP_FILES += ['.gdbinit_python.in'] FINAL_TARGET_PP_FILES += ['.gdbinit_python.in']
OBJDIR_FILES += ['!/dist/bin/.gdbinit_python'] OBJDIR_FILES += ['!/dist/bin/.gdbinit_python']
# Install the clang-cl runtime library for ASAN next to the binaries we produce. # Install the clang runtime library for ASAN next to the binaries we produce.
if CONFIG['MOZ_ASAN'] and CONFIG['CLANG_CL']: if CONFIG['MOZ_ASAN'] and CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH']:
FINAL_TARGET_FILES += ['%' + CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH']] FINAL_TARGET_FILES += [CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH']]
if CONFIG['LLVM_SYMBOLIZER']:
FINAL_TARGET_FILES += ['/' + CONFIG['LLVM_SYMBOLIZER']]
if CONFIG['MOZ_APP_BASENAME']: if CONFIG['MOZ_APP_BASENAME']:
FINAL_TARGET_PP_FILES += ['application.ini'] FINAL_TARGET_PP_FILES += ['application.ini']

View file

@ -196,6 +196,7 @@ def old_configure_options(*options):
'--enable-ios-target', '--enable-ios-target',
'--enable-jitspew', '--enable-jitspew',
'--enable-js-lto', '--enable-js-lto',
'--enable-leak-sanitizer',
'--enable-libjpeg-turbo', '--enable-libjpeg-turbo',
'--enable-libproxy', '--enable-libproxy',
'--enable-llvm-hacks', '--enable-llvm-hacks',
@ -246,6 +247,7 @@ def old_configure_options(*options):
'--enable-thread-sanitizer', '--enable-thread-sanitizer',
'--enable-trace-logging', '--enable-trace-logging',
'--enable-ui-locale', '--enable-ui-locale',
'--enable-undefined-sanitizer',
'--enable-universalchardet', '--enable-universalchardet',
'--enable-updater', '--enable-updater',
'--enable-url-classifier', '--enable-url-classifier',

View file

@ -9,9 +9,6 @@ if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION'] or CONFIG['MOZ_LIBSTDCXX_HOST_VERSION'
if CONFIG['USE_ELF_HACK']: if CONFIG['USE_ELF_HACK']:
DIRS += ['elfhack'] DIRS += ['elfhack']
if CONFIG['LLVM_SYMBOLIZER']:
FINAL_TARGET_FILES += ['/' + CONFIG['LLVM_SYMBOLIZER']]
SDK_FILES.bin += [ SDK_FILES.bin += [
'run-mozilla.sh', 'run-mozilla.sh',
] ]

View file

@ -409,7 +409,8 @@ AutoStopwatch::getCycles(JSRuntime* runtime) const
cpuid_t inline cpuid_t inline
AutoStopwatch::getCPU() const AutoStopwatch::getCPU() const
{ {
#if defined(XP_WIN) && WINVER >= _WIN32_WINNT_VISTA // Temporary disable untested code path. Issue #2255
#if 0 //defined(XP_WIN) && WINVER >= _WIN32_WINNT_VISTA
PROCESSOR_NUMBER proc; PROCESSOR_NUMBER proc;
GetCurrentProcessorNumberEx(&proc); GetCurrentProcessorNumberEx(&proc);
@ -423,7 +424,8 @@ AutoStopwatch::getCPU() const
bool inline bool inline
AutoStopwatch::isSameCPU(const cpuid_t& a, const cpuid_t& b) const AutoStopwatch::isSameCPU(const cpuid_t& a, const cpuid_t& b) const
{ {
#if defined(XP_WIN) && WINVER >= _WIN32_WINNT_VISTA // Temporary disable untested code path. Issue #2255
#if 0 //defined(XP_WIN) && WINVER >= _WIN32_WINNT_VISTA
return a.group_ == b.group_ && a.number_ == b.number_; return a.group_ == b.group_ && a.number_ == b.number_;
#else #else
return true; return true;

View file

@ -271,7 +271,8 @@ struct PerformanceMonitoring {
uint64_t highestTimestampCounter_; uint64_t highestTimestampCounter_;
}; };
#if WINVER >= 0x0600 // Temporary disable untested code path. Issue #2255
#if 0 // WINVER >= 0x0600
struct cpuid_t { struct cpuid_t {
WORD group_; WORD group_;
BYTE number_; BYTE number_;

View file

@ -226,6 +226,7 @@ ReflowInput::ReflowInput(
mFlags.mAssumingHScrollbar = mFlags.mAssumingVScrollbar = false; mFlags.mAssumingHScrollbar = mFlags.mAssumingVScrollbar = false;
mFlags.mIsColumnBalancing = false; mFlags.mIsColumnBalancing = false;
mFlags.mIsFlexContainerMeasuringHeight = false; mFlags.mIsFlexContainerMeasuringHeight = false;
mFlags.mTreatBSizeAsIndefinite = false;
mFlags.mDummyParentReflowInput = false; mFlags.mDummyParentReflowInput = false;
mFlags.mShrinkWrap = !!(aFlags & COMPUTE_SIZE_SHRINK_WRAP); mFlags.mShrinkWrap = !!(aFlags & COMPUTE_SIZE_SHRINK_WRAP);
mFlags.mUseAutoBSize = !!(aFlags & COMPUTE_SIZE_USE_AUTO_BSIZE); mFlags.mUseAutoBSize = !!(aFlags & COMPUTE_SIZE_USE_AUTO_BSIZE);
@ -2045,6 +2046,10 @@ ReflowInput::ComputeContainingBlockRectangle(
WritingMode wm = aContainingBlockRI->GetWritingMode(); WritingMode wm = aContainingBlockRI->GetWritingMode();
if (aContainingBlockRI->mFlags.mTreatBSizeAsIndefinite) {
cbSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
}
// mFrameType for abs-pos tables is NS_CSS_FRAME_TYPE_BLOCK, so we need to // mFrameType for abs-pos tables is NS_CSS_FRAME_TYPE_BLOCK, so we need to
// special case them here. // special case them here.
if (NS_FRAME_GET_TYPE(mFrameType) == NS_CSS_FRAME_TYPE_ABSOLUTE || if (NS_FRAME_GET_TYPE(mFrameType) == NS_CSS_FRAME_TYPE_ABSOLUTE ||
@ -2081,12 +2086,13 @@ ReflowInput::ComputeContainingBlockRectangle(
} }
} else { } else {
// an element in quirks mode gets a containing block based on looking for a // an element in quirks mode gets a containing block based on looking for a
// parent with a non-auto height if the element has a percent height // parent with a non-auto height if the element has a percent height.
// Note: We don't emulate this quirk for percents in calc() or in // Note: We don't emulate this quirk for percents in calc(), or in vertical
// vertical writing modes. // writing modes, or if the containing block is a flex or grid item.
if (!wm.IsVertical() && if (!wm.IsVertical() &&
NS_AUTOHEIGHT == cbSize.BSize(wm)) { NS_AUTOHEIGHT == cbSize.BSize(wm)) {
if (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() && if (eCompatibility_NavQuirks == aPresContext->CompatibilityMode() &&
!aContainingBlockRI->mFrame->IsFlexOrGridItem() &&
mStylePosition->mHeight.GetUnit() == eStyleUnit_Percent) { mStylePosition->mHeight.GetUnit() == eStyleUnit_Percent) {
cbSize.BSize(wm) = CalcQuirkContainingBlockHeight(aContainingBlockRI); cbSize.BSize(wm) = CalcQuirkContainingBlockHeight(aContainingBlockRI);
} }
@ -2222,7 +2228,8 @@ ReflowInput::InitConstraints(nsPresContext* aPresContext,
// in quirks mode, get the cb height using the special quirk method // in quirks mode, get the cb height using the special quirk method
if (!wm.IsVertical() && if (!wm.IsVertical() &&
eCompatibility_NavQuirks == aPresContext->CompatibilityMode()) { eCompatibility_NavQuirks == aPresContext->CompatibilityMode()) {
if (!IS_TABLE_CELL(fType)) { if (!IS_TABLE_CELL(fType) &&
!cbrs->mFrame->IsFlexOrGridItem()) {
cbSize.BSize(wm) = CalcQuirkContainingBlockHeight(cbrs); cbSize.BSize(wm) = CalcQuirkContainingBlockHeight(cbrs);
if (cbSize.BSize(wm) == NS_AUTOHEIGHT) { if (cbSize.BSize(wm) == NS_AUTOHEIGHT) {
blockSizeUnit = eStyleUnit_Auto; blockSizeUnit = eStyleUnit_Auto;

View file

@ -206,6 +206,13 @@ public:
uint32_t mIsFlexContainerMeasuringHeight:1; // nsFlexContainerFrame is uint32_t mIsFlexContainerMeasuringHeight:1; // nsFlexContainerFrame is
// reflowing this child to // reflowing this child to
// measure its intrinsic height. // measure its intrinsic height.
uint32_t mTreatBSizeAsIndefinite:1; // If this flag is set, the BSize of this frame should be considered
// indefinite for the purposes of percent resolution on child frames (we
// should behave as if ComputedBSize() were NS_INTRINSIC_ISIZE when doing
// percent resolution against this.ComputedBSize()). For example: flex
// items may have their ComputedBSize() resolved ahead-of-time by their
// flex container, and yet their BSize might have to be considered
// indefinite per https://drafts.csswg.org/css-flexbox/#definite-sizes
uint32_t mDummyParentReflowInput:1; // a "fake" reflow state made uint32_t mDummyParentReflowInput:1; // a "fake" reflow state made
// in order to be the parent // in order to be the parent
// of a real one // of a real one

View file

@ -557,6 +557,8 @@ public:
return mFlexShrink * mFlexBaseSize; return mFlexShrink * mFlexBaseSize;
} }
bool TreatBSizeAsIndefinite() const { return mTreatBSizeAsIndefinite; }
const AspectRatio IntrinsicRatio() const { return mIntrinsicRatio; } const AspectRatio IntrinsicRatio() const { return mIntrinsicRatio; }
bool HasIntrinsicRatio() const { return !!mIntrinsicRatio; } bool HasIntrinsicRatio() const { return !!mIntrinsicRatio; }
@ -799,6 +801,9 @@ protected:
// Does this item need to resolve a min-[width|height]:auto (in main-axis). // Does this item need to resolve a min-[width|height]:auto (in main-axis).
bool mNeedsMinSizeAutoResolution; bool mNeedsMinSizeAutoResolution;
// Should we take care to treat this item's resolved BSize as indefinite?
bool mTreatBSizeAsIndefinite;
const WritingMode mWM; // The flex item's writing mode. const WritingMode mWM; // The flex item's writing mode.
uint8_t mAlignSelf; // My "align-self" computed value (with "auto" uint8_t mAlignSelf; // My "align-self" computed value (with "auto"
// swapped out for parent"s "align-items" value, // swapped out for parent"s "align-items" value,
@ -1990,6 +1995,40 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
mAlignSelf &= ~NS_STYLE_ALIGN_FLAG_BITS; mAlignSelf &= ~NS_STYLE_ALIGN_FLAG_BITS;
} }
// Our main-size is considered definite if any of these are true:
// (a) flex container has definite main size.
// (b) flex item has a definite flex basis and is fully inflexible
// (NOTE: We don't actually check "fully inflexible" because webcompat
// may not agree with that restriction...)
//
// Hence, we need to take care to treat the final main-size as *indefinite*
// if none of these conditions are satisfied.
// The flex item's main size is its BSize, and is considered definite under
// certain conditions laid out for definite flex-item main-sizes in the spec.
if (aAxisTracker.IsMainAxisHorizontal() ||
(containerRS->ComputedBSize() != NS_UNCONSTRAINEDSIZE &&
!containerRS->mFlags.mTreatBSizeAsIndefinite)) {
// The flex *container* has a definite main-size (either by being
// row-oriented [and using its own inline size which is by definition
// definite, or by being column-oriented and having a definite
// block-size). The spec says this means all of the flex items'
// post-flexing main sizes should *also* be treated as definite.
mTreatBSizeAsIndefinite = false;
} else if (aFlexBaseSize != NS_UNCONSTRAINEDSIZE) {
// The flex item has a definite flex basis, which we'll treat as making
// its main-size definite.
// XXXdholbert Technically the spec requires the flex item to *also* be
// fully inflexible in order to have its size treated as definite in this
// scenario, but no browser implements that additional restriction, so
// it's not clear that this additional requirement would be
// web-compatible...
mTreatBSizeAsIndefinite = false;
} else {
// Otherwise, we have to treat the item's BSize as indefinite.
mTreatBSizeAsIndefinite = true;
}
SetFlexBaseSizeAndMainSize(aFlexBaseSize); SetFlexBaseSizeAndMainSize(aFlexBaseSize);
CheckForMinSizeAuto(aFlexItemReflowInput, aAxisTracker); CheckForMinSizeAuto(aFlexItemReflowInput, aAxisTracker);
@ -2054,6 +2093,7 @@ FlexItem::FlexItem(nsIFrame* aChildFrame, nscoord aCrossSize,
mIsStretched(false), mIsStretched(false),
mIsStrut(true), // (this is the constructor for making struts, after all) mIsStrut(true), // (this is the constructor for making struts, after all)
mNeedsMinSizeAutoResolution(false), mNeedsMinSizeAutoResolution(false),
mTreatBSizeAsIndefinite(false),
mWM(aContainerWM), mWM(aContainerWM),
mAlignSelf(NS_STYLE_ALIGN_FLEX_START) mAlignSelf(NS_STYLE_ALIGN_FLEX_START)
{ {
@ -4463,6 +4503,9 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
childReflowInput.SetComputedWidth(item->GetMainSize()); childReflowInput.SetComputedWidth(item->GetMainSize());
} else { } else {
childReflowInput.SetComputedHeight(item->GetMainSize()); childReflowInput.SetComputedHeight(item->GetMainSize());
if (item->TreatBSizeAsIndefinite()) {
childReflowInput.mFlags.mTreatBSizeAsIndefinite = true;
}
} }
} }
@ -4802,6 +4845,9 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
} else { } else {
childReflowInput.SetComputedHeight(aItem.GetMainSize()); childReflowInput.SetComputedHeight(aItem.GetMainSize());
didOverrideComputedHeight = true; didOverrideComputedHeight = true;
if (aItem.TreatBSizeAsIndefinite()) {
childReflowInput.mFlags.mTreatBSizeAsIndefinite = true;
}
} }
// Override reflow state's computed cross-size if either: // Override reflow state's computed cross-size if either:
@ -4819,6 +4865,10 @@ nsFlexContainerFrame::ReflowFlexItem(nsPresContext* aPresContext,
childReflowInput.SetComputedWidth(aItem.GetCrossSize()); childReflowInput.SetComputedWidth(aItem.GetCrossSize());
didOverrideComputedWidth = true; didOverrideComputedWidth = true;
} else { } else {
// Note that in the above cases we don't need to worry about the BSize
// needing to be treated as indefinite, because this is for cases where
// the block size would always be considered definite (or where its
// definiteness would be irrelevant).
childReflowInput.SetComputedHeight(aItem.GetCrossSize()); childReflowInput.SetComputedHeight(aItem.GetCrossSize());
didOverrideComputedHeight = true; didOverrideComputedHeight = true;
} }

View file

@ -13,9 +13,20 @@
} }
.flexInnerHoriz { .flexInnerHoriz {
display: flex; height: -moz-fit-content;
margin: 0 0 auto 0;
background: pink; background: pink;
} }
.height50pct {
height: -moz-fit-content;
margin: 0 0 auto 0;
background: brown;
}
.height0pct {
height: -moz-fit-content;
margin: 0 0 auto 0;
background: yellow;
}
.spacer { .spacer {
background: lightblue; background: lightblue;
@ -28,6 +39,8 @@
<div class="flexVert"> <div class="flexVert">
<div class="flexIntermediateHoriz"> <div class="flexIntermediateHoriz">
<div class="flexInnerHoriz">text</div> <div class="flexInnerHoriz">text</div>
<div class="height50pct">fifty</div>
<div class="height0pct">zero</div>
<div class="spacer"></div> <div class="spacer"></div>
</div> </div>
</div> </div>

View file

@ -14,11 +14,26 @@
.flexInnerHoriz { .flexInnerHoriz {
display: flex; display: flex;
height: 100%; /* If you delete this line, then pink area is stretched /* This percent should not be resolvable, because our parent's
to have its height match blue area. */ * height is indefinite (because our parent is a flex item with an
* indefinite flex basis, in an indefinite-main-sized flex container).
* So we just end up with our content height.
*/
height: 100%;
background: pink; background: pink;
} }
.height50pct {
/* This percent should not be resolvable, for the same reason as above.
*/
height: 50%;
background: brown;
}
.height0pct {
/* This percent should not be resolvable, for the same reason as above.
*/
height: 0%;
background: yellow;
}
.spacer { .spacer {
background: lightblue; background: lightblue;
height: 200px; height: 200px;
@ -30,6 +45,8 @@
<div class="flexVert"> <div class="flexVert">
<div class="flexIntermediateHoriz"> <div class="flexIntermediateHoriz">
<div class="flexInnerHoriz">text</div> <div class="flexInnerHoriz">text</div>
<div class="height50pct">fifty</div>
<div class="height0pct">zero</div>
<div class="spacer"></div> <div class="spacer"></div>
</div> </div>
</div> </div>

View file

@ -230,7 +230,7 @@ WebrtcVideoConduit::~WebrtcVideoConduit()
mVideoStatsTimer->Cancel(); mVideoStatsTimer->Cancel();
} }
MOZ_ASSERT(!mSendStream && !mRecvStream, "Call DeleteStreams prior to ~WebrtcVideoConduit."); MOZ_ASSERT(!mPtrViEBase, "Call DeleteStreams prior to ~WebrtcVideoConduit.");
} }
void void

View file

@ -96,7 +96,7 @@ ul {
/* Trees */ /* Trees */
.tree-container { .tree-container {
margin-top: 1.2em; margin-top: 1.2em;
flex-grow: 1; flex: 1 0px;
min-height: 12em; min-height: 12em;
} }