зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to inbound. a=merge CLOSED TREE
This commit is contained in:
Коммит
1d3a8e90da
|
@ -223,10 +223,14 @@ XPCOMUtils.defineLazyGetter(this, "Win7Features", function() {
|
|||
return {
|
||||
onOpenWindow() {
|
||||
AeroPeek.onOpenWindow(window);
|
||||
this.handledOpening = true;
|
||||
},
|
||||
onCloseWindow() {
|
||||
AeroPeek.onCloseWindow(window);
|
||||
}
|
||||
if (this.handledOpening) {
|
||||
AeroPeek.onCloseWindow(window);
|
||||
}
|
||||
},
|
||||
handledOpening: false,
|
||||
};
|
||||
}
|
||||
return null;
|
||||
|
@ -1507,9 +1511,6 @@ var gBrowserInit = {
|
|||
|
||||
LightWeightThemeWebInstaller.init();
|
||||
|
||||
if (Win7Features)
|
||||
Win7Features.onOpenWindow();
|
||||
|
||||
FullScreen.init();
|
||||
PointerLock.init();
|
||||
|
||||
|
@ -1770,6 +1771,10 @@ var gBrowserInit = {
|
|||
}
|
||||
}, {timeout: 10000});
|
||||
|
||||
if (Win7Features) {
|
||||
scheduleIdleTask(() => Win7Features.onOpenWindow());
|
||||
}
|
||||
|
||||
// This should always go last, since the idle tasks (except for the ones with
|
||||
// timeouts) should execute in order. Note that this observer notification is
|
||||
// not guaranteed to fire, since the window could close before we get here.
|
||||
|
@ -1895,9 +1900,6 @@ var gBrowserInit = {
|
|||
if (this._boundDelayedStartup) {
|
||||
this._cancelDelayedStartup();
|
||||
} else {
|
||||
if (Win7Features)
|
||||
Win7Features.onCloseWindow();
|
||||
|
||||
Services.prefs.removeObserver(ctrlTab.prefName, ctrlTab);
|
||||
ctrlTab.uninit();
|
||||
gBrowserThumbnails.uninit();
|
||||
|
|
|
@ -432,9 +432,9 @@ TabWindow.prototype = {
|
|||
let docShell = this.win.docShell;
|
||||
let preview = AeroPeek.taskbar.createTaskbarTabPreview(docShell, controller);
|
||||
preview.visible = AeroPeek.enabled;
|
||||
preview.active = this.tabbrowser.selectedTab == controller.tab;
|
||||
this.onLinkIconAvailable(controller.tab.linkedBrowser,
|
||||
controller.tab.getAttribute("image"));
|
||||
let {tab} = controller;
|
||||
preview.active = this.tabbrowser.selectedTab == tab;
|
||||
this.updateFavicon(tab, tab.getAttribute("image"));
|
||||
return preview;
|
||||
},
|
||||
|
||||
|
@ -585,6 +585,10 @@ TabWindow.prototype = {
|
|||
"file", "chrome", "resource", "about"
|
||||
]),
|
||||
onLinkIconAvailable(aBrowser, aIconURL) {
|
||||
let tab = this.win.gBrowser.getTabForBrowser(aBrowser);
|
||||
this.updateFavicon(tab, aIconURL);
|
||||
},
|
||||
updateFavicon(aTab, aIconURL) {
|
||||
let requestURL = null;
|
||||
if (aIconURL) {
|
||||
let shouldRequestFaviconURL = true;
|
||||
|
@ -603,17 +607,22 @@ TabWindow.prototype = {
|
|||
requestURL,
|
||||
PrivateBrowsingUtils.isWindowPrivate(this.win),
|
||||
img => {
|
||||
let index = this.tabbrowser.browsers.indexOf(aBrowser);
|
||||
// Only add it if we've found the index and the URI is still the same.
|
||||
// The tab could have closed, and there's no guarantee the icons
|
||||
// will have finished fetching 'in order'.
|
||||
if (index != -1) {
|
||||
let tab = this.tabbrowser.tabs[index];
|
||||
let preview = this.previews.get(tab);
|
||||
if (tab.getAttribute("image") == aIconURL ||
|
||||
(!preview.icon && isDefaultFavicon)) {
|
||||
preview.icon = img;
|
||||
}
|
||||
if (this.win.closed || aTab.closing || !aTab.linkedBrowser) {
|
||||
return;
|
||||
}
|
||||
// Note that bizarrely, we can get to updateFavicon via a sync codepath
|
||||
// where the new preview controller hasn't yet been added to the
|
||||
// window's map of previews. So `preview` would be null here - except
|
||||
// getFaviconAsImage is async so that should never happen, as we add
|
||||
// the controller to the preview collection straight after creating it.
|
||||
// However, if any of this code ever tries to access this
|
||||
// synchronously, that won't work.
|
||||
let preview = this.previews.get(aTab);
|
||||
if (aTab.getAttribute("image") == aIconURL ||
|
||||
(!preview.icon && isDefaultFavicon)) {
|
||||
preview.icon = img;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -824,7 +833,7 @@ var AeroPeek = {
|
|||
for (let win of this.windows) {
|
||||
for (let [tab, ] of win.previews) {
|
||||
if (tab.getAttribute("image") == newValue) {
|
||||
win.onLinkIconAvailable(tab.linkedBrowser, newValue);
|
||||
win.updateFavicon(tab, newValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,17 +229,20 @@
|
|||
transform: translateX(0);
|
||||
fill-opacity: 0.3;
|
||||
}
|
||||
38% {
|
||||
30% {
|
||||
fill: inherit;
|
||||
fill-opacity: 0.3;
|
||||
}
|
||||
39% {
|
||||
31% {
|
||||
fill: var(--tracking-protection-shield-color);
|
||||
fill-opacity: 1;
|
||||
}
|
||||
75% {
|
||||
50% {
|
||||
transform: translateX(-1232px);
|
||||
fill: var(--tracking-protection-shield-color);
|
||||
}
|
||||
65% {
|
||||
fill: var(--tracking-protection-shield-color);
|
||||
fill-opacity: 1;
|
||||
}
|
||||
to {
|
||||
|
@ -253,17 +256,20 @@
|
|||
transform: scaleX(-1) translateX(0);
|
||||
fill-opacity: 0.3;
|
||||
}
|
||||
38% {
|
||||
30% {
|
||||
fill: inherit;
|
||||
fill-opacity: 0.3;
|
||||
}
|
||||
39% {
|
||||
31% {
|
||||
fill: var(--tracking-protection-shield-color);
|
||||
fill-opacity: 1;
|
||||
}
|
||||
75% {
|
||||
50% {
|
||||
transform: scaleX(-1) translateX(-1232px);
|
||||
fill: var(--tracking-protection-shield-color);
|
||||
}
|
||||
65% {
|
||||
fill: var(--tracking-protection-shield-color);
|
||||
fill-opacity: 1;
|
||||
}
|
||||
to {
|
||||
|
|
|
@ -126,8 +126,8 @@ class MenuButton extends PureComponent {
|
|||
// Mark the menu as closed since the onHidden callback may not be called in
|
||||
// this case.
|
||||
this.setState({ expanded: false });
|
||||
this.tooltip.destroy();
|
||||
this.tooltip.off("hidden", this.onHidden);
|
||||
this.tooltip.destroy();
|
||||
this.tooltip = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ add_task(async function testMessagesAppear() {
|
|||
|
||||
const message = await waitFor(() => findMessage(hud,
|
||||
"The resource at \u201chttp://tracking.example.com/\u201d was " +
|
||||
"blocked because tracking protection is enabled"));
|
||||
"blocked because content blocking is enabled"));
|
||||
|
||||
await testClickOpenNewTab(hud, message);
|
||||
});
|
||||
|
|
|
@ -452,6 +452,8 @@ CharacterData::BindToTree(nsIDocument* aDocument,
|
|||
"aDocument must be current doc of aParent");
|
||||
MOZ_ASSERT(!GetUncomposedDoc() && !IsInUncomposedDoc(),
|
||||
"Already have a document. Unbind first!");
|
||||
MOZ_ASSERT(!IsInComposedDoc(),
|
||||
"Already have a document. Unbind first!");
|
||||
// Note that as we recurse into the kids, they'll have a non-null parent. So
|
||||
// only assert if our parent is _changing_ while we have a parent.
|
||||
MOZ_ASSERT(!GetParent() || aParent == GetParent(),
|
||||
|
@ -489,14 +491,14 @@ CharacterData::BindToTree(nsIDocument* aDocument,
|
|||
if (HasFlag(NODE_IS_ANONYMOUS_ROOT)) {
|
||||
aParent->SetMayHaveAnonymousChildren();
|
||||
}
|
||||
if (aParent->IsInShadowTree()) {
|
||||
ClearSubtreeRootPointer();
|
||||
SetFlags(NODE_IS_IN_SHADOW_TREE);
|
||||
}
|
||||
ShadowRoot* parentContainingShadow = aParent->GetContainingShadow();
|
||||
if (parentContainingShadow) {
|
||||
ExtendedContentSlots()->mContainingShadow = parentContainingShadow;
|
||||
}
|
||||
}
|
||||
|
||||
if (aParent && aParent->IsInShadowTree()) {
|
||||
ClearSubtreeRootPointer();
|
||||
SetFlags(NODE_IS_IN_SHADOW_TREE);
|
||||
SetIsConnected(aParent->IsInComposedDoc());
|
||||
MOZ_ASSERT(aParent->GetContainingShadow());
|
||||
ExtendedContentSlots()->mContainingShadow = aParent->GetContainingShadow();
|
||||
}
|
||||
|
||||
bool hadParent = !!GetParentNode();
|
||||
|
@ -507,8 +509,7 @@ CharacterData::BindToTree(nsIDocument* aDocument,
|
|||
NS_ADDREF(aParent);
|
||||
}
|
||||
mParent = aParent;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
mParent = aDocument;
|
||||
}
|
||||
SetParentIsContent(aParent);
|
||||
|
@ -523,6 +524,7 @@ CharacterData::BindToTree(nsIDocument* aDocument,
|
|||
|
||||
// XXX See the comment in Element::BindToTree
|
||||
SetIsInDocument();
|
||||
SetIsConnected(true);
|
||||
if (mText.IsBidi()) {
|
||||
aDocument->SetBidiEnabled();
|
||||
}
|
||||
|
@ -553,8 +555,7 @@ void
|
|||
CharacterData::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
{
|
||||
// Unset frame flags; if we need them again later, they'll get set again.
|
||||
UnsetFlags(NS_CREATE_FRAME_IF_NON_WHITESPACE |
|
||||
NS_REFRAME_IF_WHITESPACE);
|
||||
UnsetFlags(NS_CREATE_FRAME_IF_NON_WHITESPACE | NS_REFRAME_IF_WHITESPACE);
|
||||
|
||||
nsIDocument* document = GetComposedDoc();
|
||||
|
||||
|
@ -570,6 +571,7 @@ CharacterData::UnbindFromTree(bool aDeep, bool aNullParent)
|
|||
SetParentIsContent(false);
|
||||
}
|
||||
ClearInDocument();
|
||||
SetIsConnected(false);
|
||||
|
||||
if (aNullParent || !mParent->IsInShadowTree()) {
|
||||
UnsetFlags(NODE_IS_IN_SHADOW_TREE);
|
||||
|
|
|
@ -1258,8 +1258,6 @@ Element::AttachShadowWithoutNameChecks(ShadowRootMode aMode)
|
|||
RefPtr<ShadowRoot> shadowRoot =
|
||||
new ShadowRoot(this, aMode, nodeInfo.forget());
|
||||
|
||||
shadowRoot->SetIsComposedDocParticipant(IsInComposedDoc());
|
||||
|
||||
if (NodeOrAncestorHasDirAuto()) {
|
||||
shadowRoot->SetAncestorHasDirAuto();
|
||||
}
|
||||
|
@ -1296,7 +1294,8 @@ Element::UnattachShadow()
|
|||
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
|
||||
if (nsIDocument* doc = GetComposedDoc()) {
|
||||
nsIDocument* doc = GetComposedDoc();
|
||||
if (doc) {
|
||||
if (nsIPresShell* shell = doc->GetShell()) {
|
||||
shell->DestroyFramesForAndRestyle(this);
|
||||
}
|
||||
|
@ -1304,13 +1303,8 @@ Element::UnattachShadow()
|
|||
MOZ_ASSERT(!GetPrimaryFrame());
|
||||
|
||||
// Simply unhook the shadow root from the element.
|
||||
MOZ_ASSERT(!GetShadowRoot()->HasSlots(), "Won't work when shadow root has slots!");
|
||||
for (nsIContent* child = shadowRoot->GetFirstChild(); child;
|
||||
child = child->GetNextSibling()) {
|
||||
child->UnbindFromTree(true, false);
|
||||
}
|
||||
|
||||
shadowRoot->SetIsComposedDocParticipant(false);
|
||||
MOZ_ASSERT(!shadowRoot->HasSlots(), "Won't work when shadow root has slots!");
|
||||
shadowRoot->Unbind();
|
||||
SetShadowRoot(nullptr);
|
||||
}
|
||||
|
||||
|
@ -1625,7 +1619,8 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|||
"Must have the same owner document");
|
||||
MOZ_ASSERT(!aParent || aDocument == aParent->GetUncomposedDoc(),
|
||||
"aDocument must be current doc of aParent");
|
||||
MOZ_ASSERT(!GetUncomposedDoc(), "Already have a document. Unbind first!");
|
||||
MOZ_ASSERT(!IsInComposedDoc(), "Already have a document. Unbind first!");
|
||||
MOZ_ASSERT(!IsInUncomposedDoc(), "Already have a document. Unbind first!");
|
||||
// Note that as we recurse into the kids, they'll have a non-null parent. So
|
||||
// only assert if our parent is _changing_ while we have a parent.
|
||||
MOZ_ASSERT(!GetParent() || aParent == GetParent(),
|
||||
|
@ -1678,10 +1673,8 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|||
if (aParent->IsInShadowTree()) {
|
||||
ClearSubtreeRootPointer();
|
||||
SetFlags(NODE_IS_IN_SHADOW_TREE);
|
||||
}
|
||||
ShadowRoot* parentContainingShadow = aParent->GetContainingShadow();
|
||||
if (parentContainingShadow) {
|
||||
ExtendedDOMSlots()->mContainingShadow = parentContainingShadow;
|
||||
MOZ_ASSERT(aParent->GetContainingShadow());
|
||||
ExtendedDOMSlots()->mContainingShadow = aParent->GetContainingShadow();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1693,8 +1686,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|||
NS_ADDREF(aParent);
|
||||
}
|
||||
mParent = aParent;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
mParent = aDocument;
|
||||
}
|
||||
SetParentIsContent(aParent);
|
||||
|
@ -1720,10 +1712,12 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|||
|
||||
// Being added to a document.
|
||||
SetIsInDocument();
|
||||
SetIsConnected(true);
|
||||
|
||||
// Clear the lazy frame construction bits.
|
||||
UnsetFlags(NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
|
||||
} else if (IsInShadowTree()) {
|
||||
SetIsConnected(aParent->IsInComposedDoc());
|
||||
// We're not in a document, but we did get inserted into a shadow tree.
|
||||
// Since we won't have any restyle data in the document's restyle trackers,
|
||||
// don't let us get inserted with restyle bits set incorrectly.
|
||||
|
@ -1828,13 +1822,8 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|||
|
||||
// Call BindToTree on shadow root children.
|
||||
if (ShadowRoot* shadowRoot = GetShadowRoot()) {
|
||||
shadowRoot->SetIsComposedDocParticipant(IsInComposedDoc());
|
||||
MOZ_ASSERT(shadowRoot->GetBindingParent() == this);
|
||||
for (nsIContent* child = shadowRoot->GetFirstChild(); child;
|
||||
child = child->GetNextSibling()) {
|
||||
rv = child->BindToTree(nullptr, shadowRoot, this);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
rv = shadowRoot->Bind();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// FIXME(emilio): Why is this needed? The element shouldn't even be styled in
|
||||
|
@ -1994,6 +1983,7 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
|
|||
#endif
|
||||
|
||||
ClearInDocument();
|
||||
SetIsConnected(false);
|
||||
|
||||
// Ensure that CSS transitions don't continue on an element at a
|
||||
// different place in the tree (even if reinserted before next
|
||||
|
@ -2104,12 +2094,7 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
|
|||
|
||||
// Unbind children of shadow root.
|
||||
if (ShadowRoot* shadowRoot = GetShadowRoot()) {
|
||||
for (nsIContent* child = shadowRoot->GetFirstChild(); child;
|
||||
child = child->GetNextSibling()) {
|
||||
child->UnbindFromTree(true, false);
|
||||
}
|
||||
|
||||
shadowRoot->SetIsComposedDocParticipant(false);
|
||||
shadowRoot->Unbind();
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!HasAnyOfFlags(kAllServoDescendantBits));
|
||||
|
|
|
@ -1465,13 +1465,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FragmentOrElement)
|
|||
} */
|
||||
|
||||
if (ShadowRoot* shadowRoot = tmp->GetShadowRoot()) {
|
||||
for (nsIContent* child = shadowRoot->GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
child->UnbindFromTree(true, false);
|
||||
}
|
||||
|
||||
shadowRoot->SetIsComposedDocParticipant(false);
|
||||
shadowRoot->Unbind();
|
||||
tmp->ExtendedDOMSlots()->mShadowRoot = nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,6 @@ ShadowRoot::ShadowRoot(Element* aElement, ShadowRootMode aMode,
|
|||
, DocumentOrShadowRoot(*this)
|
||||
, mMode(aMode)
|
||||
, mServoStyles(Servo_AuthorStyles_Create())
|
||||
, mIsComposedDocParticipant(false)
|
||||
, mIsUAWidget(false)
|
||||
{
|
||||
SetHost(aElement);
|
||||
|
@ -74,6 +73,7 @@ ShadowRoot::ShadowRoot(Element* aElement, ShadowRootMode aMode,
|
|||
ClearSubtreeRootPointer();
|
||||
|
||||
SetFlags(NODE_IS_IN_SHADOW_TREE);
|
||||
Bind();
|
||||
|
||||
ExtendedDOMSlots()->mBindingParent = aElement;
|
||||
ExtendedDOMSlots()->mContainingShadow = this;
|
||||
|
@ -91,7 +91,7 @@ ShadowRoot::~ShadowRoot()
|
|||
host->RemoveMutationObserver(this);
|
||||
}
|
||||
|
||||
if (IsComposedDocParticipant()) {
|
||||
if (IsInComposedDoc()) {
|
||||
OwnerDoc()->RemoveComposedDocShadowRoot(*this);
|
||||
}
|
||||
|
||||
|
@ -103,29 +103,6 @@ ShadowRoot::~ShadowRoot()
|
|||
SetSubtreeRootPointer(this);
|
||||
}
|
||||
|
||||
void
|
||||
ShadowRoot::SetIsComposedDocParticipant(bool aIsComposedDocParticipant)
|
||||
{
|
||||
bool changed = mIsComposedDocParticipant != aIsComposedDocParticipant;
|
||||
mIsComposedDocParticipant = aIsComposedDocParticipant;
|
||||
if (!changed) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (IsComposedDocParticipant()) {
|
||||
doc->AddComposedDocShadowRoot(*this);
|
||||
} else {
|
||||
doc->RemoveComposedDocShadowRoot(*this);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ShadowRoot::SetIsUAWidget(bool aIsUAWidget)
|
||||
{
|
||||
mIsUAWidget = aIsUAWidget;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
ShadowRoot::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
|
@ -148,18 +125,50 @@ ShadowRoot::CloneInternalDataFrom(ShadowRoot* aOther)
|
|||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
ShadowRoot::Bind()
|
||||
{
|
||||
MOZ_ASSERT(!IsInComposedDoc(), "Forgot to unbind?");
|
||||
if (Host()->IsInComposedDoc()) {
|
||||
SetIsConnected(true);
|
||||
OwnerDoc()->AddComposedDocShadowRoot(*this);
|
||||
}
|
||||
|
||||
for (nsIContent* child = GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
nsresult rv = child->BindToTree(nullptr, this, Host());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
ShadowRoot::Unbind()
|
||||
{
|
||||
if (IsInComposedDoc()) {
|
||||
SetIsConnected(false);
|
||||
OwnerDoc()->RemoveComposedDocShadowRoot(*this);
|
||||
}
|
||||
|
||||
for (nsIContent* child = GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
child->UnbindFromTree(true, false);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ShadowRoot::InvalidateStyleAndLayoutOnSubtree(Element* aElement)
|
||||
{
|
||||
MOZ_ASSERT(aElement);
|
||||
|
||||
if (!IsComposedDocParticipant()) {
|
||||
nsIDocument* doc = GetComposedDoc();
|
||||
if (!doc) {
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(GetComposedDoc() == OwnerDoc());
|
||||
|
||||
nsIPresShell* shell = OwnerDoc()->GetShell();
|
||||
nsIPresShell* shell = doc->GetShell();
|
||||
if (!shell) {
|
||||
return;
|
||||
}
|
||||
|
@ -316,11 +325,11 @@ ShadowRoot::RuleChanged(StyleSheet&, css::Rule*) {
|
|||
void
|
||||
ShadowRoot::ApplicableRulesChanged()
|
||||
{
|
||||
if (!IsComposedDocParticipant()) {
|
||||
nsIDocument* doc = GetComposedDoc();
|
||||
if (!doc) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (nsIPresShell* shell = doc->GetShell()) {
|
||||
shell->RecordShadowStyleChange(*this);
|
||||
}
|
||||
|
@ -514,8 +523,8 @@ ShadowRoot::MaybeReassignElement(Element* aElement)
|
|||
return;
|
||||
}
|
||||
|
||||
if (IsComposedDocParticipant()) {
|
||||
if (nsIPresShell* shell = OwnerDoc()->GetShell()) {
|
||||
if (nsIDocument* doc = GetComposedDoc()) {
|
||||
if (nsIPresShell* shell = doc->GetShell()) {
|
||||
shell->SlotAssignmentWillChange(*aElement, oldSlot, assignment.mSlot);
|
||||
}
|
||||
}
|
||||
|
@ -563,7 +572,6 @@ ShadowRoot::ImportNodeAndAppendChildAt(nsINode& aParentNode,
|
|||
mozilla::ErrorResult& rv)
|
||||
{
|
||||
MOZ_ASSERT(mIsUAWidget);
|
||||
MOZ_ASSERT(OwnerDoc());
|
||||
|
||||
if (!aParentNode.IsInUAWidget()) {
|
||||
rv.Throw(NS_ERROR_INVALID_ARG);
|
||||
|
|
|
@ -89,6 +89,14 @@ public:
|
|||
void CloneInternalDataFrom(ShadowRoot* aOther);
|
||||
void InsertSheetAt(size_t aIndex, StyleSheet&);
|
||||
|
||||
// Calls UnbindFromTree for each of our kids, and also flags us as no longer
|
||||
// being connected.
|
||||
void Unbind();
|
||||
|
||||
// Calls BindToTree on each of our kids, and also maybe flags us as being
|
||||
// connected.
|
||||
nsresult Bind();
|
||||
|
||||
private:
|
||||
void InsertSheetIntoAuthorData(size_t aIndex, StyleSheet&);
|
||||
|
||||
|
@ -185,19 +193,15 @@ public:
|
|||
const nsAString& aTagName,
|
||||
mozilla::ErrorResult& rv);
|
||||
|
||||
bool IsComposedDocParticipant() const
|
||||
{
|
||||
return mIsComposedDocParticipant;
|
||||
}
|
||||
|
||||
void SetIsComposedDocParticipant(bool aIsComposedDocParticipant);
|
||||
|
||||
bool IsUAWidget() const
|
||||
{
|
||||
return mIsUAWidget;
|
||||
}
|
||||
|
||||
void SetIsUAWidget(bool aIsUAWidget);
|
||||
void SetIsUAWidget()
|
||||
{
|
||||
mIsUAWidget = true;
|
||||
}
|
||||
|
||||
void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
|
||||
|
||||
|
@ -219,12 +223,6 @@ protected:
|
|||
// are in the shadow tree and should be kept alive by its parent.
|
||||
nsClassHashtable<nsStringHashKey, SlotArray> mSlotMap;
|
||||
|
||||
// Flag to indicate whether the descendants of this shadow root are part of the
|
||||
// composed document. Ideally, we would use a node flag on nodes to
|
||||
// mark whether it is in the composed document, but we have run out of flags
|
||||
// so instead we track it here.
|
||||
bool mIsComposedDocParticipant;
|
||||
|
||||
bool mIsUAWidget;
|
||||
|
||||
nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
|
||||
|
|
|
@ -1519,6 +1519,7 @@ nsIDocument::nsIDocument()
|
|||
mNumTrackersBlocked(0)
|
||||
{
|
||||
SetIsInDocument();
|
||||
SetIsConnected(true);
|
||||
}
|
||||
|
||||
nsDocument::nsDocument(const char* aContentType)
|
||||
|
|
|
@ -3817,7 +3817,7 @@ protected:
|
|||
|
||||
// A hashtable of ShadowRoots belonging to the composed doc.
|
||||
//
|
||||
// See ShadowRoot::SetIsComposedDocParticipant.
|
||||
// See ShadowRoot::Bind and ShadowRoot::Unbind.
|
||||
ShadowRootSet mComposedShadowRoots;
|
||||
|
||||
using SVGUseElementSet =
|
||||
|
|
|
@ -251,8 +251,8 @@ nsINode::GetTextEditorRootContent(TextEditor** aTextEditor)
|
|||
nsINode* nsINode::GetRootNode(const GetRootNodeOptions& aOptions)
|
||||
{
|
||||
if (aOptions.mComposed) {
|
||||
if (IsInComposedDoc() && GetComposedDoc()) {
|
||||
return OwnerDoc();
|
||||
if (nsIDocument* doc = GetComposedDoc()) {
|
||||
return doc;
|
||||
}
|
||||
|
||||
nsINode* node = this;
|
||||
|
@ -457,17 +457,6 @@ nsINode::GetTextContentInternal(nsAString& aTextContent, OOMReporter& aError)
|
|||
SetDOMStringToNull(aTextContent);
|
||||
}
|
||||
|
||||
nsIDocument*
|
||||
nsINode::GetComposedDocInternal() const
|
||||
{
|
||||
MOZ_ASSERT(HasFlag(NODE_IS_IN_SHADOW_TREE) && IsContent(),
|
||||
"Should only be caled on nodes in the shadow tree.");
|
||||
|
||||
ShadowRoot* containingShadow = AsContent()->GetContainingShadow();
|
||||
return containingShadow && containingShadow->IsComposedDocParticipant() ?
|
||||
OwnerDoc() : nullptr;
|
||||
}
|
||||
|
||||
DocumentOrShadowRoot*
|
||||
nsINode::GetUncomposedDocOrConnectedShadowRoot() const
|
||||
{
|
||||
|
@ -475,7 +464,7 @@ nsINode::GetUncomposedDocOrConnectedShadowRoot() const
|
|||
return OwnerDoc();
|
||||
}
|
||||
|
||||
if (IsInComposedDoc() && HasFlag(NODE_IS_IN_SHADOW_TREE)) {
|
||||
if (IsInComposedDoc() && IsInShadowTree()) {
|
||||
return AsContent()->GetContainingShadow();
|
||||
}
|
||||
|
||||
|
|
|
@ -642,6 +642,15 @@ public:
|
|||
return IsInUncomposedDoc() ? OwnerDoc() : nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if we're connected, and thus GetComposedDoc() would return a
|
||||
* non-null value.
|
||||
*/
|
||||
bool IsInComposedDoc() const
|
||||
{
|
||||
return GetBoolFlag(IsConnected);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the owner document if the node is connected to it
|
||||
* (as defined in the DOM spec), otherwise it returns null.
|
||||
|
@ -651,16 +660,7 @@ public:
|
|||
*/
|
||||
nsIDocument* GetComposedDoc() const
|
||||
{
|
||||
return IsInShadowTree() ?
|
||||
GetComposedDocInternal() : GetUncomposedDoc();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if GetComposedDoc() would return a non-null value.
|
||||
*/
|
||||
bool IsInComposedDoc() const
|
||||
{
|
||||
return IsInUncomposedDoc() || (IsInShadowTree() && GetComposedDocInternal());
|
||||
return IsInComposedDoc() ? OwnerDoc() : nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1418,8 +1418,6 @@ private:
|
|||
|
||||
mozilla::dom::SVGUseElement* DoGetContainingSVGUseShadowHost() const;
|
||||
|
||||
nsIDocument* GetComposedDocInternal() const;
|
||||
|
||||
nsIContent* GetNextNodeImpl(const nsINode* aRoot,
|
||||
const bool aSkipChildren) const
|
||||
{
|
||||
|
@ -1501,6 +1499,9 @@ private:
|
|||
// Set if our parent chain (including this node itself) terminates
|
||||
// in a document
|
||||
IsInDocument,
|
||||
// Set if we're part of the composed doc.
|
||||
// https://dom.spec.whatwg.org/#connected
|
||||
IsConnected,
|
||||
// Set if mParent is an nsIContent
|
||||
ParentIsContent,
|
||||
// Set if this node is an Element
|
||||
|
@ -1555,8 +1556,6 @@ private:
|
|||
NodeAncestorHasDirAuto,
|
||||
// Set if the node is handling a click.
|
||||
NodeHandlingClick,
|
||||
// Set if the node has had :hover selectors matched against it
|
||||
NodeHasRelevantHoverRules,
|
||||
// Set if the element has a parser insertion mode other than "in body",
|
||||
// per the HTML5 "Parse state" section.
|
||||
ElementHasWeirdParserInsertionMode,
|
||||
|
@ -1680,8 +1679,6 @@ public:
|
|||
// Implemented in nsIContentInlines.h.
|
||||
inline bool NodeOrAncestorHasDirAuto() const;
|
||||
|
||||
bool HasRelevantHoverRules() const { return GetBoolFlag(NodeHasRelevantHoverRules); }
|
||||
void SetHasRelevantHoverRules() { SetBoolFlag(NodeHasRelevantHoverRules); }
|
||||
void SetParserHasNotified() { SetBoolFlag(ParserHasNotified); };
|
||||
bool HasParserNotified() { return GetBoolFlag(ParserHasNotified); }
|
||||
|
||||
|
@ -1700,8 +1697,9 @@ public:
|
|||
protected:
|
||||
void SetParentIsContent(bool aValue) { SetBoolFlag(ParentIsContent, aValue); }
|
||||
void SetIsInDocument() { SetBoolFlag(IsInDocument); }
|
||||
void SetNodeIsContent() { SetBoolFlag(NodeIsContent); }
|
||||
void ClearInDocument() { ClearBoolFlag(IsInDocument); }
|
||||
void SetIsConnected(bool aConnected) { SetBoolFlag(IsConnected, aConnected); }
|
||||
void SetNodeIsContent() { SetBoolFlag(NodeIsContent); }
|
||||
void SetIsElement() { SetBoolFlag(NodeIsElement); }
|
||||
void SetHasID() { SetBoolFlag(ElementHasID); }
|
||||
void ClearHasID() { ClearBoolFlag(ElementHasID); }
|
||||
|
|
|
@ -4950,7 +4950,7 @@ HTMLMediaElement::AttachAndSetUAShadowRoot()
|
|||
// Add a closed shadow root to host video controls
|
||||
RefPtr<ShadowRoot> shadowRoot =
|
||||
AttachShadowWithoutNameChecks(ShadowRootMode::Closed);
|
||||
shadowRoot->SetIsUAWidget(true);
|
||||
shadowRoot->SetIsUAWidget();
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -34,7 +34,7 @@ interface Node : EventTarget {
|
|||
[Pure, Throws, NeedsCallerType, BinaryName="baseURIFromJS"]
|
||||
readonly attribute DOMString? baseURI;
|
||||
|
||||
[Pure, BinaryName=getComposedDoc]
|
||||
[Pure, BinaryName=isInComposedDoc]
|
||||
readonly attribute boolean isConnected;
|
||||
[Pure]
|
||||
readonly attribute Document? ownerDocument;
|
||||
|
|
|
@ -47,7 +47,7 @@ interface ShadowRoot : DocumentFragment
|
|||
|
||||
// For triggering UA Widget scope in tests.
|
||||
[ChromeOnly]
|
||||
void setIsUAWidget(boolean isUAWidget);
|
||||
void setIsUAWidget();
|
||||
};
|
||||
|
||||
ShadowRoot implements DocumentOrShadowRoot;
|
||||
|
|
|
@ -176,7 +176,7 @@ EnumerateShadowRoots(const nsIDocument& aDoc, const Functor& aCb)
|
|||
for (auto iter = shadowRoots.ConstIter(); !iter.Done(); iter.Next()) {
|
||||
ShadowRoot* root = iter.Get()->GetKey();
|
||||
MOZ_ASSERT(root);
|
||||
MOZ_DIAGNOSTIC_ASSERT(root->IsComposedDocParticipant());
|
||||
MOZ_DIAGNOSTIC_ASSERT(root->IsInComposedDoc());
|
||||
aCb(*root);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -889,7 +889,7 @@ nsChannelClassifier::SetBlockedContent(nsIChannel *channel,
|
|||
NS_ConvertUTF8toUTF16 spec(uri->GetSpecOrDefault());
|
||||
const char16_t* params[] = { spec.get() };
|
||||
const char* message = (aErrorCode == NS_ERROR_TRACKING_URI) ?
|
||||
"TrackingUriBlocked" : "UnsafeUriBlocked";
|
||||
"TrackerUriBlocked" : "UnsafeUriBlocked";
|
||||
nsCString category = (aErrorCode == NS_ERROR_TRACKING_URI) ?
|
||||
NS_LITERAL_CSTRING("Tracking Protection") :
|
||||
NS_LITERAL_CSTRING("Safe Browsing");
|
||||
|
|
|
@ -40,7 +40,7 @@ PhishingAuthAccept=I understand and will be very careful
|
|||
SuperfluousAuth=You are about to log in to the site “%1$S” with the username “%2$S”, but the website does not require authentication. This may be an attempt to trick you.\n\nIs “%1$S” the site you want to visit?
|
||||
AutomaticAuth=You are about to log in to the site “%1$S” with the username “%2$S”.
|
||||
|
||||
TrackingUriBlocked=The resource at “%1$S” was blocked because tracking protection is enabled.
|
||||
TrackerUriBlocked=The resource at “%1$S” was blocked because content blocking is enabled.
|
||||
UnsafeUriBlocked=The resource at “%1$S” was blocked by Safe Browsing.
|
||||
|
||||
# LOCALIZATION NOTE (nsICookieManagerAPIDeprecated): don't localize originAttributes.
|
||||
|
|
|
@ -300,4 +300,10 @@ def read_wpt_manifest(context, paths):
|
|||
finally:
|
||||
sys.path = old_path
|
||||
f = context._finder.get(full_path)
|
||||
return wptmanifest.manifest.load(tests_root, f)
|
||||
try:
|
||||
rv = wptmanifest.manifest.load(tests_root, f)
|
||||
except wptmanifest.manifest.ManifestVersionMismatch:
|
||||
# If we accidentially end up with a committed manifest that's the wrong
|
||||
# version, then return an empty manifest here just to not break the build
|
||||
rv = wptmanifest.manifest.Manifest()
|
||||
return rv
|
||||
|
|
|
@ -137,27 +137,27 @@
|
|||
},
|
||||
"cryptography": {
|
||||
"hashes": [
|
||||
"sha256:21af753934f2f6d1a10fe8f4c0a64315af209ef6adeaee63ca349797d747d687",
|
||||
"sha256:27bb401a20a838d6d0ea380f08c6ead3ccd8c9d8a0232dc9adcc0e4994576a66",
|
||||
"sha256:29720c4253263cff9aea64585adbbe85013ba647f6e98367efff9db2d7193ded",
|
||||
"sha256:2a35b7570d8f247889784010aac8b384fd2e4a47b33e15c4a60b45a7c1944120",
|
||||
"sha256:42c531a6a354407f42ee07fda5c2c0dc822cf6d52744949c182f2b295fbd4183",
|
||||
"sha256:5eb86f03f9c4f0ac2336ac5431271072ddf7ecc76b338e26366732cfac58aa19",
|
||||
"sha256:67f7f57eae8dede577f3f7775957f5bec93edd6bdb6ce597bb5b28e1bdf3d4fb",
|
||||
"sha256:6ec84edcbc966ae460560a51a90046503ff0b5b66157a9efc61515c68059f6c8",
|
||||
"sha256:7ba834564daef87557e7fcd35c3c3183a4147b0b3a57314e53317360b9b201b3",
|
||||
"sha256:7d7f084cbe1fdb82be5a0545062b59b1ad3637bc5a48612ac2eb428ff31b31ea",
|
||||
"sha256:82409f5150e529d699e5c33fa8fd85e965104db03bc564f5f4b6a9199e591f7c",
|
||||
"sha256:87d092a7c2a44e5f7414ab02fb4145723ebba411425e1a99773531dd4c0e9b8d",
|
||||
"sha256:8c56ef989342e42b9fcaba7c74b446f0cc9bed546dd00034fa7ad66fc00307ef",
|
||||
"sha256:9449f5d4d7c516a6118fa9210c4a00f34384cb1d2028672100ee0c6cce49d7f6",
|
||||
"sha256:bc2301170986ad82d9349a91eb8884e0e191209c45f5541b16aa7c0cfb135978",
|
||||
"sha256:c132bab45d4bd0fff1d3fe294d92b0a6eb8404e93337b3127bdec9f21de117e6",
|
||||
"sha256:c3d945b7b577f07a477700f618f46cbc287af3a9222cd73035c6ef527ef2c363",
|
||||
"sha256:cee18beb4c807b5c0b178f4fa2fae03cef9d51821a358c6890f8b23465b7e5d2",
|
||||
"sha256:d01dfc5c2b3495184f683574e03c70022674ca9a7be88589c5aba130d835ea90"
|
||||
"sha256:02602e1672b62e803e08617ec286041cc453e8d43f093a5f4162095506bc0beb",
|
||||
"sha256:10b48e848e1edb93c1d3b797c83c72b4c387ab0eb4330aaa26da8049a6cbede0",
|
||||
"sha256:17db09db9d7c5de130023657be42689d1a5f60502a14f6f745f6f65a6b8195c0",
|
||||
"sha256:227da3a896df1106b1a69b1e319dce218fa04395e8cc78be7e31ca94c21254bc",
|
||||
"sha256:2cbaa03ac677db6c821dac3f4cdfd1461a32d0615847eedbb0df54bb7802e1f7",
|
||||
"sha256:31db8febfc768e4b4bd826750a70c79c99ea423f4697d1dab764eb9f9f849519",
|
||||
"sha256:4a510d268e55e2e067715d728e4ca6cd26a8e9f1f3d174faf88e6f2cb6b6c395",
|
||||
"sha256:6a88d9004310a198c474d8a822ee96a6dd6c01efe66facdf17cb692512ae5bc0",
|
||||
"sha256:76936ec70a9b72eb8c58314c38c55a0336a2b36de0c7ee8fb874a4547cadbd39",
|
||||
"sha256:7e3b4aecc4040928efa8a7cdaf074e868af32c58ffc9bb77e7bf2c1a16783286",
|
||||
"sha256:8168bcb08403ef144ff1fb880d416f49e2728101d02aaadfe9645883222c0aa5",
|
||||
"sha256:8229ceb79a1792823d87779959184a1bf95768e9248c93ae9f97c7a2f60376a1",
|
||||
"sha256:8a19e9f2fe69f6a44a5c156968d9fc8df56d09798d0c6a34ccc373bb186cee86",
|
||||
"sha256:8d10113ca826a4c29d5b85b2c4e045ffa8bad74fb525ee0eceb1d38d4c70dfd6",
|
||||
"sha256:be495b8ec5a939a7605274b6e59fbc35e76f5ad814ae010eb679529671c9e119",
|
||||
"sha256:dc2d3f3b1548f4d11786616cf0f4415e25b0fbecb8a1d2cd8c07568f13fdde38",
|
||||
"sha256:e4aecdd9d5a3d06c337894c9a6e2961898d3f64fe54ca920a72234a3de0f9cb3",
|
||||
"sha256:e79ab4485b99eacb2166f3212218dd858258f374855e1568f728462b0e6ee0d9",
|
||||
"sha256:f995d3667301e1754c57b04e0bae6f0fa9d710697a9f8d6712e8cca02550910f"
|
||||
],
|
||||
"version": "==2.3"
|
||||
"version": "==2.3.1"
|
||||
},
|
||||
"datadog": {
|
||||
"hashes": [
|
||||
|
@ -377,7 +377,7 @@
|
|||
"sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf",
|
||||
"sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5"
|
||||
],
|
||||
"markers": "python_version != '3.3.*' and python_version != '3.1.*' and python_version != '3.2.*' and python_version != '3.0.*' and python_version < '4' and python_version >= '2.6'",
|
||||
"markers": "python_version != '3.0.*' and python_version != '3.2.*' and python_version != '3.3.*' and python_version >= '2.6' and python_version < '4' and python_version != '3.1.*'",
|
||||
"version": "==1.23"
|
||||
},
|
||||
"virtualenv": {
|
||||
|
@ -385,7 +385,7 @@
|
|||
"sha256:2ce32cd126117ce2c539f0134eb89de91a8413a29baac49cbab3eb50e2026669",
|
||||
"sha256:ca07b4c0b54e14a91af9f34d0919790b016923d157afda5efdde55c96718f752"
|
||||
],
|
||||
"markers": "python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.2.*' and python_version != '3.0.*'",
|
||||
"markers": "python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.0.*' and python_version != '3.2.*'",
|
||||
"version": "==16.0.0"
|
||||
},
|
||||
"yarl": {
|
||||
|
|
|
@ -9,11 +9,13 @@ from wptrunner.wptcommandline import get_test_paths, set_from_config
|
|||
|
||||
manifest = None
|
||||
|
||||
|
||||
def do_delayed_imports(wpt_dir):
|
||||
global manifest
|
||||
sys.path.insert(0, os.path.join(wpt_dir, "tools", "manifest"))
|
||||
import manifest
|
||||
|
||||
|
||||
def create_parser():
|
||||
p = argparse.ArgumentParser()
|
||||
p.add_argument("--check-clean", action="store_true",
|
||||
|
@ -47,10 +49,14 @@ def update(logger, wpt_dir, check_clean=True, rebuild=False):
|
|||
def _update(logger, test_paths, rebuild):
|
||||
for url_base, paths in test_paths.iteritems():
|
||||
manifest_path = os.path.join(paths["metadata_path"], "MANIFEST.json")
|
||||
if rebuild:
|
||||
m = None
|
||||
if not rebuild:
|
||||
try:
|
||||
m = manifest.manifest.load(paths["tests_path"], manifest_path)
|
||||
except manifest.manifest.ManifestVersionMismatch:
|
||||
logger.info("Manifest format changed, rebuilding")
|
||||
if m is None:
|
||||
m = manifest.manifest.Manifest(url_base)
|
||||
else:
|
||||
m = manifest.manifest.load(paths["tests_path"], manifest_path)
|
||||
manifest.update.update(paths["tests_path"], m, working_copy=True)
|
||||
manifest.manifest.write(m, manifest_path)
|
||||
return 0
|
||||
|
|
|
@ -59,10 +59,6 @@ interface nsITaggingService : nsISupports
|
|||
[optional] out unsigned long length,
|
||||
[retval, array, size_is(length)] out wstring aTags);
|
||||
|
||||
/**
|
||||
* Retrieves all tags used to tag URIs in the data-base (sorted by name).
|
||||
*/
|
||||
readonly attribute nsIVariant allTags;
|
||||
};
|
||||
|
||||
%{C++
|
||||
|
|
|
@ -21,7 +21,7 @@ const content = document.getElementById("content");
|
|||
|
||||
const div = content.appendChild(document.createElement("div"));
|
||||
div.attachShadow({ mode: "open"});
|
||||
SpecialPowers.wrap(div.shadowRoot).setIsUAWidget(true);
|
||||
SpecialPowers.wrap(div.shadowRoot).setIsUAWidget();
|
||||
|
||||
const sandbox = SpecialPowers.Cu.getUAWidgetScope(SpecialPowers.wrap(div).nodePrincipal);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче