/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include"mozilla/dom/HTMLStyleElement.h" #include"mozilla/dom/HTMLStyleElementBinding.h" #include"nsGkAtoms.h" #include"nsStyleConsts.h" #include"mozilla/dom/Document.h" #include"mozilla/dom/FetchPriority.h" #include"mozilla/dom/ReferrerInfo.h" #include"nsUnicharUtils.h" #include"nsThreadUtils.h" #include"nsContentUtils.h" #include"nsStubMutationObserver.h" #include"nsDOMTokenList.h"
void HTMLStyleElement::ContentWillBeRemoved(nsIContent* aChild, const BatchRemovalState* aState) {
mTriggeringPrincipal = nullptr; if (!nsContentUtils::IsInSameAnonymousTree(this, aChild)) { return;
} if (aState && !aState->mIsFirst) { return;
} // Make sure to run this once the removal has taken place.
nsContentUtils::AddScriptRunner(NS_NewRunnableFunction( "HTMLStyleElement::ContentWillBeRemoved",
[self = RefPtr{this}] { self->UpdateStyleSheetInternal(); }));
}
void HTMLStyleElement::SetTextContentInternal(const nsAString& aTextContent,
nsIPrincipal* aScriptedPrincipal,
ErrorResult& aError) { // Per spec, if we're setting text content to an empty string and don't // already have any children, we should not trigger any mutation observers, or // re-parse the stylesheet. if (aTextContent.IsEmpty() && !GetFirstChild()) {
nsIPrincipal* principal =
mTriggeringPrincipal ? mTriggeringPrincipal.get() : NodePrincipal(); if (principal == aScriptedPrincipal) { return;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.