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

This commit is contained in:
roytam1 2023-02-28 10:46:33 +08:00
commit 713dd244b9
2 changed files with 19 additions and 62 deletions

View file

@ -7255,21 +7255,6 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
}
#endif // MOZ_XUL
if (aContainer && aContainer->HasFlag(NODE_IS_IN_SHADOW_TREE) &&
!aContainer->IsInNativeAnonymousSubtree() &&
!aFirstNewContent->IsInNativeAnonymousSubtree()) {
// Recreate frames if content is appended into a ShadowRoot
// because children of ShadowRoot are rendered in place of children
// of the host.
//XXXsmaug This is super unefficient!
nsIContent* bindingParent = aContainer->GetBindingParent();
LAYOUT_PHASE_TEMP_EXIT();
RecreateFramesForContent(bindingParent, InsertionKind::Sync,
REMOVE_FOR_RECONSTRUCTION);
LAYOUT_PHASE_TEMP_REENTER();
return;
}
// See comment in ContentRangeInserted for why this is necessary.
if (!GetContentInsertionFrameFor(aContainer) &&
!aContainer->IsActiveChildrenElement()) {
@ -7410,7 +7395,9 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
GetAbsoluteContainingBlock(parentFrame, FIXED_POS),
GetAbsoluteContainingBlock(parentFrame, ABS_POS),
containingBlock);
state.mTreeMatchContext.InitAncestors(aContainer->AsElement());
// We use GetParentElementCrossingShadowRoot to handle the case where
// aContainer is a ShadowRoot.
state.mTreeMatchContext.InitAncestors(aFirstNewContent->GetParentElementCrossingShadowRoot());
nsIAtom* frameType = parentFrame->GetType();
@ -7735,22 +7722,6 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
return;
}
if (aContainer->HasFlag(NODE_IS_IN_SHADOW_TREE) &&
!aContainer->IsInNativeAnonymousSubtree() &&
(!aStartChild || !aStartChild->IsInNativeAnonymousSubtree()) &&
(!aEndChild || !aEndChild->IsInNativeAnonymousSubtree())) {
// Recreate frames if content is inserted into a ShadowRoot
// because children of ShadowRoot are rendered in place of
// the children of the host.
//XXXsmaug This is super unefficient!
nsIContent* bindingParent = aContainer->GetBindingParent();
LAYOUT_PHASE_TEMP_EXIT();
RecreateFramesForContent(bindingParent, InsertionKind::Sync,
REMOVE_FOR_RECONSTRUCTION);
LAYOUT_PHASE_TEMP_REENTER();
return;
}
// Put 'parentFrame' inside a scope so we don't confuse it with
// 'insertion.mParentFrame' later.
{
@ -7758,10 +7729,13 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
// The xbl:children element won't have a frame, but default content can have the children as
// a parent. While its uncommon to change the structure of the default content itself, a label,
// for example, can be reframed by having its value attribute set or removed.
if (!parentFrame && !aContainer->IsActiveChildrenElement()) {
if (!parentFrame &&
!(aContainer->IsActiveChildrenElement() || ShadowRoot::FromNode(aContainer))) {
return;
}
MOZ_ASSERT_IF(ShadowRoot::FromNode(aContainer), !parentFrame);
// Otherwise, we've got parent content. Find its frame.
NS_ASSERTION(!parentFrame || parentFrame->GetContent() == aContainer ||
GetDisplayContentsStyleFor(aContainer), "New XBL code is possibly wrong!");
@ -7870,9 +7844,9 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
GetAbsoluteContainingBlock(insertion.mParentFrame, ABS_POS),
GetFloatContainingBlock(insertion.mParentFrame),
do_AddRef(aFrameState));
state.mTreeMatchContext.InitAncestors(aContainer ?
aContainer->AsElement() :
nullptr);
// We use GetParentElementCrossingShadowRoot to handle the case where
// aContainer is a ShadowRoot.
state.mTreeMatchContext.InitAncestors(aStartChild->GetParentElementCrossingShadowRoot());
// Recover state for the containing block - we need to know if
// it has :first-letter or :first-line style applied to it. The
@ -8238,21 +8212,6 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
}
}
if (aContainer && aContainer->HasFlag(NODE_IS_IN_SHADOW_TREE) &&
!aContainer->IsInNativeAnonymousSubtree() &&
!aChild->IsInNativeAnonymousSubtree()) {
// Recreate frames if content is removed from a ShadowRoot
// because it may contain an insertion point which can change
// how the host is rendered.
//XXXsmaug This is super unefficient!
nsIContent* bindingParent = aContainer->GetBindingParent();
*aDidReconstruct = true;
LAYOUT_PHASE_TEMP_EXIT();
RecreateFramesForContent(bindingParent, insertionKind, aFlags);
LAYOUT_PHASE_TEMP_REENTER();
return;
}
if (aFlags == REMOVE_DESTROY_FRAMES) {
CaptureStateForFramesOf(aChild, mTempFrameTreeState);
}
@ -9071,8 +9030,11 @@ nsCSSFrameConstructor::GetInsertionPoint(nsIContent* aContainer,
return InsertionPoint(GetContentInsertionFrameFor(aContainer), aContainer);
}
if (nsContentUtils::HasDistributedChildren(aContainer)) {
// The container distributes nodes, use the frame of the flattened tree parent.
if (nsContentUtils::HasDistributedChildren(aContainer) ||
ShadowRoot::FromNode(aContainer)) {
// The container distributes nodes or is a shadow root, use the frame of
// the flattened tree parent.
//
// It may be the case that the node is distributed but not matched to any
// insertion points, so there is no flattened parent.
nsIContent* flattenedParent = aChild->GetFlattenedTreeParent();

View file

@ -582,14 +582,8 @@ pref("media.track.enabled", false);
// Whether to enable MediaSource support.
pref("media.mediasource.enabled", true);
pref("media.mediasource.mp4.enabled", true);
#if defined(XP_WIN) || defined(XP_MACOSX)
pref("media.mediasource.webm.enabled", false);
#else
pref("media.mediasource.webm.enabled", true);
#endif
pref("media.mediasource.webm.audio.enabled", true);
#ifdef MOZ_AV1
@ -605,8 +599,8 @@ pref("media.benchmark.frames", 300);
pref("media.benchmark.timeout", 1000);
#ifdef MOZ_WEBSPEECH
pref("media.webspeech.recognition.enable", false);
pref("media.webspeech.synth.enabled", false);
// Web text-to-speech API enabled?
pref("media.webspeech.synth.enabled", true);
#endif
#ifdef MOZ_WEBM_ENCODER
pref("media.encoder.webm.enabled", true);
@ -1245,7 +1239,8 @@ pref("privacy.trackingprotection.pbmode.enabled", false);
pref("dom.event.contextmenu.enabled", true);
pref("dom.event.clipboardevents.enabled", true);
pref("dom.webcomponents.enabled", false);
// Enable Google WebComponents?
pref("dom.webcomponents.enabled", true);
pref("javascript.enabled", true);
// Enable Array.prototype.values