mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Backed out 6 changesets (bug 1712140) for causing sanitizer failures on nsHtml5TreeBuilder.cpp. CLOSED TREE
Backed out changeset b374469160e9 (bug 1712140) Backed out changeset dfc44cccff32 (bug 1712140) Backed out changeset 3a35e1401130 (bug 1712140) Backed out changeset a93481858c38 (bug 1712140) Backed out changeset a861fd445f56 (bug 1712140) Backed out changeset dc1dc389f2dc (bug 1712140)
This commit is contained in:
parent
ff13238087
commit
ec88b58413
@ -1394,7 +1394,6 @@ Document::Document(const char* aContentType)
|
||||
mHasUserInteractionTimerScheduled(false),
|
||||
mShouldResistFingerprinting(false),
|
||||
mCloningForSVGUse(false),
|
||||
mAllowDeclarativeShadowRoots(false),
|
||||
mXMLDeclarationBits(0),
|
||||
mOnloadBlockCount(0),
|
||||
mWriteLevel(0),
|
||||
@ -18989,41 +18988,4 @@ void Document::UpdateHiddenByContentVisibilityForAnimations() {
|
||||
timeline->UpdateHiddenByContentVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
void Document::SetAllowDeclarativeShadowRoots(
|
||||
bool aAllowDeclarativeShadowRoots) {
|
||||
mAllowDeclarativeShadowRoots = aAllowDeclarativeShadowRoots;
|
||||
}
|
||||
|
||||
bool Document::AllowsDeclarativeShadowRoots() const {
|
||||
return mAllowDeclarativeShadowRoots;
|
||||
}
|
||||
|
||||
/* static */
|
||||
already_AddRefed<Document> Document::ParseHTMLUnsafe(GlobalObject& aGlobal,
|
||||
const nsAString& aHTML) {
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
NS_NewURI(getter_AddRefs(uri), "about:blank");
|
||||
if (!uri) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<Document> doc;
|
||||
nsresult rv =
|
||||
NS_NewHTMLDocument(getter_AddRefs(doc), aGlobal.GetSubjectPrincipal(),
|
||||
aGlobal.GetSubjectPrincipal());
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
doc->SetAllowDeclarativeShadowRoots(true);
|
||||
doc->SetDocumentURI(uri);
|
||||
rv = nsContentUtils::ParseDocumentHTML(aHTML, doc, false);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return doc.forget();
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
@ -3866,9 +3866,6 @@ class Document : public nsINode,
|
||||
*/
|
||||
bool AllowsL10n() const;
|
||||
|
||||
void SetAllowDeclarativeShadowRoots(bool aAllowDeclarativeShadowRoots);
|
||||
bool AllowsDeclarativeShadowRoots() const;
|
||||
|
||||
protected:
|
||||
RefPtr<DocumentL10n> mDocumentL10n;
|
||||
|
||||
@ -4831,8 +4828,6 @@ class Document : public nsINode,
|
||||
// Whether we're cloning the contents of an SVG use element.
|
||||
bool mCloningForSVGUse : 1;
|
||||
|
||||
bool mAllowDeclarativeShadowRoots : 1;
|
||||
|
||||
// The fingerprinting protections overrides for this document. The value will
|
||||
// override the default enabled fingerprinting protections for this document.
|
||||
// This will only get populated if these is one that comes from the local
|
||||
@ -5347,9 +5342,6 @@ class Document : public nsINode,
|
||||
void LoadEventFired();
|
||||
|
||||
RadioGroupContainer& OwnedRadioGroupContainer();
|
||||
|
||||
static already_AddRefed<Document> ParseHTMLUnsafe(GlobalObject& aGlobal,
|
||||
const nsAString& aHTML);
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(Document, NS_IDOCUMENT_IID)
|
||||
|
@ -1252,9 +1252,8 @@ bool Element::CanAttachShadowDOM() const {
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/commit-snapshots/1eadf0a4a271acc92013d1c0de8c730ac96204f9/#dom-element-attachshadow
|
||||
already_AddRefed<ShadowRoot> Element::AttachShadow(
|
||||
const ShadowRootInit& aInit, ErrorResult& aError,
|
||||
ShadowRootDeclarative aNewShadowIsDeclarative) {
|
||||
already_AddRefed<ShadowRoot> Element::AttachShadow(const ShadowRootInit& aInit,
|
||||
ErrorResult& aError) {
|
||||
/**
|
||||
* Step 1, 2, and 3.
|
||||
*/
|
||||
@ -1264,41 +1263,25 @@ already_AddRefed<ShadowRoot> Element::AttachShadow(
|
||||
}
|
||||
|
||||
/**
|
||||
* 4. If element is a shadow host, then:
|
||||
* 4. If this is a shadow host, then throw a "NotSupportedError" DOMException.
|
||||
*/
|
||||
if (RefPtr<ShadowRoot> root = GetShadowRoot()) {
|
||||
/*
|
||||
* 1. If element’s shadow root’s declarative is false, then throw an
|
||||
* "NotSupportedError" DOMException.
|
||||
*/
|
||||
if (!root->IsDeclarative()) {
|
||||
aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
// https://github.com/whatwg/dom/issues/1235
|
||||
root->SetIsDeclarative(aNewShadowIsDeclarative);
|
||||
/*
|
||||
* 2. Otherwise, remove all of element’s shadow root’s children, in tree
|
||||
* order, and return.
|
||||
*/
|
||||
root->ReplaceChildren(nullptr, aError);
|
||||
return root.forget();
|
||||
if (GetShadowRoot()) {
|
||||
aError.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (StaticPrefs::dom_webcomponents_shadowdom_report_usage()) {
|
||||
OwnerDoc()->ReportShadowDOMUsage();
|
||||
}
|
||||
|
||||
return AttachShadowWithoutNameChecks(
|
||||
aInit.mMode, DelegatesFocus(aInit.mDelegatesFocus), aInit.mSlotAssignment,
|
||||
ShadowRootClonable(aInit.mClonable),
|
||||
ShadowRootDeclarative(aNewShadowIsDeclarative));
|
||||
return AttachShadowWithoutNameChecks(aInit.mMode,
|
||||
DelegatesFocus(aInit.mDelegatesFocus),
|
||||
aInit.mSlotAssignment);
|
||||
}
|
||||
|
||||
already_AddRefed<ShadowRoot> Element::AttachShadowWithoutNameChecks(
|
||||
ShadowRootMode aMode, DelegatesFocus aDelegatesFocus,
|
||||
SlotAssignmentMode aSlotAssignment, ShadowRootClonable aClonable,
|
||||
ShadowRootDeclarative aDeclarative) {
|
||||
SlotAssignmentMode aSlotAssignment) {
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
|
||||
auto* nim = mNodeInfo->NodeInfoManager();
|
||||
@ -1322,9 +1305,8 @@ already_AddRefed<ShadowRoot> Element::AttachShadowWithoutNameChecks(
|
||||
* context object's node document, host is context object,
|
||||
* and mode is init's mode.
|
||||
*/
|
||||
RefPtr<ShadowRoot> shadowRoot =
|
||||
new (nim) ShadowRoot(this, aMode, aDelegatesFocus, aSlotAssignment,
|
||||
aClonable, aDeclarative, nodeInfo.forget());
|
||||
RefPtr<ShadowRoot> shadowRoot = new (nim) ShadowRoot(
|
||||
this, aMode, aDelegatesFocus, aSlotAssignment, nodeInfo.forget());
|
||||
|
||||
if (NodeOrAncestorHasDirAuto()) {
|
||||
shadowRoot->SetAncestorHasDirAuto();
|
||||
@ -5045,8 +5027,4 @@ EditorBase* Element::GetEditorWithoutCreation() const {
|
||||
return docShell ? docShell->GetHTMLEditorInternal() : nullptr;
|
||||
}
|
||||
|
||||
void Element::SetHTMLUnsafe(const nsAString& aHTML) {
|
||||
nsContentUtils::SetHTMLUnsafe(this, this, aHTML);
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
@ -1320,23 +1320,15 @@ class Element : public FragmentOrElement {
|
||||
bool ParseLoadingAttribute(const nsAString& aValue, nsAttrValue& aResult);
|
||||
|
||||
// Shadow DOM v1
|
||||
enum class ShadowRootDeclarative : bool { No, Yes };
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
||||
already_AddRefed<ShadowRoot> AttachShadow(
|
||||
const ShadowRootInit& aInit, ErrorResult& aError,
|
||||
ShadowRootDeclarative aNewShadowIsDeclarative =
|
||||
ShadowRootDeclarative::No);
|
||||
already_AddRefed<ShadowRoot> AttachShadow(const ShadowRootInit& aInit,
|
||||
ErrorResult& aError);
|
||||
bool CanAttachShadowDOM() const;
|
||||
|
||||
enum class DelegatesFocus : bool { No, Yes };
|
||||
enum class ShadowRootClonable : bool { No, Yes };
|
||||
|
||||
already_AddRefed<ShadowRoot> AttachShadowWithoutNameChecks(
|
||||
ShadowRootMode aMode, DelegatesFocus = DelegatesFocus::No,
|
||||
SlotAssignmentMode aSlotAssignmentMode = SlotAssignmentMode::Named,
|
||||
ShadowRootClonable aClonable = ShadowRootClonable::No,
|
||||
ShadowRootDeclarative aDeclarative = ShadowRootDeclarative::No);
|
||||
SlotAssignmentMode aSlotAssignmentMode = SlotAssignmentMode::Named);
|
||||
|
||||
// Attach UA Shadow Root if it is not attached.
|
||||
enum class NotifyUAWidgetSetup : bool { No, Yes };
|
||||
@ -2087,9 +2079,6 @@ class Element : public FragmentOrElement {
|
||||
|
||||
virtual bool Translate() const;
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
virtual void SetHTMLUnsafe(const nsAString& aHTML);
|
||||
|
||||
protected:
|
||||
enum class ReparseAttributes { No, Yes };
|
||||
/**
|
||||
|
@ -51,8 +51,7 @@ NS_IMPL_RELEASE_INHERITED(ShadowRoot, DocumentFragment)
|
||||
|
||||
ShadowRoot::ShadowRoot(Element* aElement, ShadowRootMode aMode,
|
||||
Element::DelegatesFocus aDelegatesFocus,
|
||||
SlotAssignmentMode aSlotAssignment, Clonable aIsClonable,
|
||||
Declarative aDeclarative,
|
||||
SlotAssignmentMode aSlotAssignment,
|
||||
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
|
||||
: DocumentFragment(std::move(aNodeInfo)),
|
||||
DocumentOrShadowRoot(this),
|
||||
@ -60,9 +59,7 @@ ShadowRoot::ShadowRoot(Element* aElement, ShadowRootMode aMode,
|
||||
mDelegatesFocus(aDelegatesFocus),
|
||||
mSlotAssignment(aSlotAssignment),
|
||||
mIsDetailsShadowTree(aElement->IsHTMLElement(nsGkAtoms::details)),
|
||||
mIsAvailableToElementInternals(false),
|
||||
mIsDeclarative(aDeclarative),
|
||||
mIsClonable(aIsClonable) {
|
||||
mIsAvailableToElementInternals(false) {
|
||||
// nsINode.h relies on this.
|
||||
MOZ_ASSERT(static_cast<nsINode*>(this) == reinterpret_cast<nsINode*>(this));
|
||||
MOZ_ASSERT(static_cast<nsIContent*>(this) ==
|
||||
@ -877,8 +874,3 @@ nsresult ShadowRoot::Clone(dom::NodeInfo* aNodeInfo, nsINode** aResult) const {
|
||||
*aResult = nullptr;
|
||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
}
|
||||
|
||||
void ShadowRoot::SetHTMLUnsafe(const nsAString& aHTML) {
|
||||
RefPtr<Element> host = GetHost();
|
||||
nsContentUtils::SetHTMLUnsafe(this, host, aHTML);
|
||||
}
|
||||
|
@ -42,9 +42,6 @@ class HTMLInputElement;
|
||||
class ShadowRoot final : public DocumentFragment, public DocumentOrShadowRoot {
|
||||
friend class DocumentOrShadowRoot;
|
||||
|
||||
using Declarative = Element::ShadowRootDeclarative;
|
||||
using Clonable = Element::ShadowRootClonable;
|
||||
|
||||
public:
|
||||
NS_IMPL_FROMNODE_HELPER(ShadowRoot, IsShadowRoot());
|
||||
|
||||
@ -53,8 +50,7 @@ class ShadowRoot final : public DocumentFragment, public DocumentOrShadowRoot {
|
||||
|
||||
ShadowRoot(Element* aElement, ShadowRootMode aMode,
|
||||
Element::DelegatesFocus aDelegatesFocus,
|
||||
SlotAssignmentMode aSlotAssignment, Clonable aClonable,
|
||||
Declarative aDeclarative,
|
||||
SlotAssignmentMode aSlotAssignment,
|
||||
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
||||
|
||||
void AddSizeOfExcludingThis(nsWindowSizes&, size_t* aNodeSize) const final;
|
||||
@ -235,19 +231,6 @@ class ShadowRoot final : public DocumentFragment, public DocumentOrShadowRoot {
|
||||
|
||||
void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
|
||||
|
||||
bool IsDeclarative() const { return mIsDeclarative == Declarative::Yes; }
|
||||
void SetIsDeclarative(Declarative aIsDeclarative) {
|
||||
mIsDeclarative = aIsDeclarative;
|
||||
}
|
||||
void SetIsDeclarative(bool aIsDeclarative) {
|
||||
mIsDeclarative = aIsDeclarative ? Declarative::Yes : Declarative::No;
|
||||
}
|
||||
|
||||
bool IsClonable() const { return mIsClonable == Clonable::Yes; }
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
void SetHTMLUnsafe(const nsAString& aHTML);
|
||||
|
||||
protected:
|
||||
// FIXME(emilio): This will need to become more fine-grained.
|
||||
void ApplicableRulesChanged();
|
||||
@ -285,12 +268,6 @@ class ShadowRoot final : public DocumentFragment, public DocumentOrShadowRoot {
|
||||
// https://dom.spec.whatwg.org/#shadowroot-available-to-element-internals
|
||||
bool mIsAvailableToElementInternals : 1;
|
||||
|
||||
// https://dom.spec.whatwg.org/#shadowroot-declarative
|
||||
Declarative mIsDeclarative;
|
||||
|
||||
// https://dom.spec.whatwg.org/#shadowroot-clonable
|
||||
Clonable mIsClonable;
|
||||
|
||||
nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
|
||||
};
|
||||
|
||||
|
@ -5446,34 +5446,6 @@ bool AllowsUnsanitizedContentForAboutNewTab(nsIPrincipal* aPrincipal) {
|
||||
return aboutModuleFlags & nsIAboutModule::ALLOW_UNSANITIZED_CONTENT;
|
||||
}
|
||||
|
||||
/* static */
|
||||
void nsContentUtils::SetHTMLUnsafe(FragmentOrElement* aTarget,
|
||||
Element* aContext,
|
||||
const nsAString& aSource) {
|
||||
MOZ_ASSERT(!sFragmentParsingActive, "Re-entrant fragment parsing attempted.");
|
||||
mozilla::AutoRestore<bool> guard(sFragmentParsingActive);
|
||||
sFragmentParsingActive = true;
|
||||
if (!sHTMLFragmentParser) {
|
||||
NS_ADDREF(sHTMLFragmentParser = new nsHtml5StringParser());
|
||||
// Now sHTMLFragmentParser owns the object
|
||||
}
|
||||
|
||||
nsAtom* contextLocalName = aContext->NodeInfo()->NameAtom();
|
||||
int32_t contextNameSpaceID = aContext->GetNameSpaceID();
|
||||
|
||||
RefPtr<Document> doc = aTarget->OwnerDoc();
|
||||
RefPtr<DocumentFragment> fragment = doc->CreateDocumentFragment();
|
||||
nsresult rv = sHTMLFragmentParser->ParseFragment(
|
||||
aSource, fragment, contextLocalName, contextNameSpaceID,
|
||||
fragment->OwnerDoc()->GetCompatibilityMode() == eCompatibility_NavQuirks,
|
||||
true, true);
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_WARNING("Failed to parse fragment for SetHTMLUnsafe");
|
||||
}
|
||||
|
||||
aTarget->ReplaceChildren(fragment, IgnoreErrors());
|
||||
}
|
||||
|
||||
/* static */
|
||||
nsresult nsContentUtils::ParseFragmentHTML(
|
||||
const nsAString& aSourceBuffer, nsIContent* aTargetNode,
|
||||
@ -5529,7 +5501,7 @@ nsresult nsContentUtils::ParseFragmentHTML(
|
||||
|
||||
nsresult rv = sHTMLFragmentParser->ParseFragment(
|
||||
aSourceBuffer, target, aContextLocalName, aContextNamespace, aQuirks,
|
||||
aPreventScriptExecution, false);
|
||||
aPreventScriptExecution);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (fragment) {
|
||||
@ -11367,25 +11339,6 @@ template bool nsContentUtils::AddElementToListByTreeOrder(
|
||||
nsTArray<RefPtr<HTMLInputElement>>& aList, HTMLInputElement* aChild,
|
||||
nsIContent* aAncestor);
|
||||
|
||||
nsIContent* nsContentUtils::AttachDeclarativeShadowRoot(nsIContent* aHost,
|
||||
ShadowRootMode aMode,
|
||||
bool aDelegatesFocus) {
|
||||
RefPtr<Element> host = mozilla::dom::Element::FromNodeOrNull(aHost);
|
||||
if (!host) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ShadowRootInit init;
|
||||
init.mMode = aMode;
|
||||
init.mDelegatesFocus = aDelegatesFocus;
|
||||
init.mSlotAssignment = SlotAssignmentMode::Named;
|
||||
init.mClonable = true;
|
||||
|
||||
RefPtr shadowRoot = host->AttachShadow(init, IgnoreErrors(),
|
||||
Element::ShadowRootDeclarative::Yes);
|
||||
return shadowRoot;
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
std::ostream& operator<<(std::ostream& aOut,
|
||||
const PreventDefaultResult aPreventDefaultResult) {
|
||||
|
@ -176,7 +176,6 @@ class DOMArena;
|
||||
class Element;
|
||||
class Event;
|
||||
class EventTarget;
|
||||
class FragmentOrElement;
|
||||
class HTMLElement;
|
||||
class HTMLInputElement;
|
||||
class IPCTransferable;
|
||||
@ -188,7 +187,6 @@ class MessageBroadcaster;
|
||||
class NodeInfo;
|
||||
class OwningFileOrUSVStringOrFormData;
|
||||
class Selection;
|
||||
enum class ShadowRootMode : uint8_t;
|
||||
struct StructuredSerializeOptions;
|
||||
class WorkerPrivate;
|
||||
enum class ElementCallbackType;
|
||||
@ -1804,9 +1802,6 @@ class nsContentUtils {
|
||||
bool aPreventScriptExecution,
|
||||
mozilla::ErrorResult& aRv);
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
static void SetHTMLUnsafe(mozilla::dom::FragmentOrElement* aTarget,
|
||||
Element* aContext, const nsAString& aSource);
|
||||
/**
|
||||
* Invoke the fragment parsing algorithm (innerHTML) using the HTML parser.
|
||||
*
|
||||
@ -3462,11 +3457,6 @@ class nsContentUtils {
|
||||
nsIContent* aContent2,
|
||||
const nsIContent* aCommonAncestor);
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
||||
static nsIContent* AttachDeclarativeShadowRoot(
|
||||
nsIContent* aHost, mozilla::dom::ShadowRootMode aMode,
|
||||
bool aDelegatesFocus);
|
||||
|
||||
private:
|
||||
static bool InitializeEventTable();
|
||||
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "mozilla/dom/DebuggerNotificationBinding.h"
|
||||
#include "mozilla/dom/DocumentType.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/ElementBinding.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/dom/Exceptions.h"
|
||||
#include "mozilla/dom/Link.h"
|
||||
@ -3615,38 +3614,6 @@ already_AddRefed<nsINode> nsINode::CloneAndAdopt(
|
||||
}
|
||||
}
|
||||
|
||||
if (aClone && aNode->IsElement() &&
|
||||
!nodeInfo->GetDocument()->IsStaticDocument()) {
|
||||
// Clone the Shadow DOM
|
||||
ShadowRoot* originalShadowRoot = aNode->AsElement()->GetShadowRoot();
|
||||
if (originalShadowRoot && originalShadowRoot->IsClonable()) {
|
||||
ShadowRootInit init;
|
||||
init.mMode = originalShadowRoot->Mode();
|
||||
init.mDelegatesFocus = originalShadowRoot->DelegatesFocus();
|
||||
init.mSlotAssignment = originalShadowRoot->SlotAssignment();
|
||||
init.mClonable = true;
|
||||
|
||||
RefPtr<ShadowRoot> newShadowRoot =
|
||||
clone->AsElement()->AttachShadow(init, aError);
|
||||
if (NS_WARN_IF(aError.Failed())) {
|
||||
return nullptr;
|
||||
}
|
||||
newShadowRoot->SetIsDeclarative(originalShadowRoot->IsDeclarative());
|
||||
|
||||
if (aDeep) {
|
||||
for (nsIContent* origChild = originalShadowRoot->GetFirstChild();
|
||||
origChild; origChild = origChild->GetNextSibling()) {
|
||||
nsCOMPtr<nsINode> child =
|
||||
CloneAndAdopt(origChild, aClone, aDeep, nodeInfoManager,
|
||||
aReparentScope, newShadowRoot, aError);
|
||||
if (NS_WARN_IF(aError.Failed())) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Cloning template element.
|
||||
if (aDeep && aClone && aNode->IsTemplateElement()) {
|
||||
DocumentFragment* origContent =
|
||||
|
@ -8,9 +8,6 @@
|
||||
#include "mozilla/dom/HTMLTemplateElementBinding.h"
|
||||
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/NameSpaceConstants.h"
|
||||
#include "mozilla/dom/ShadowRootBinding.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsAtom.h"
|
||||
@ -19,13 +16,6 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Template)
|
||||
|
||||
namespace mozilla::dom {
|
||||
|
||||
static constexpr nsAttrValue::EnumTable kShadowRootModeTable[] = {
|
||||
{"open", ShadowRootMode::Open},
|
||||
{"closed", ShadowRootMode::Closed},
|
||||
{nullptr, {}}};
|
||||
|
||||
const nsAttrValue::EnumTable* kShadowRootModeDefault = &kShadowRootModeTable[2];
|
||||
|
||||
HTMLTemplateElement::HTMLTemplateElement(
|
||||
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
|
||||
: nsGenericHTMLElement(std::move(aNodeInfo)) {
|
||||
@ -41,7 +31,7 @@ HTMLTemplateElement::HTMLTemplateElement(
|
||||
}
|
||||
|
||||
HTMLTemplateElement::~HTMLTemplateElement() {
|
||||
if (mContent && mContent->GetHost() == this) {
|
||||
if (mContent) {
|
||||
mContent->SetHost(nullptr);
|
||||
}
|
||||
}
|
||||
@ -54,9 +44,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLTemplateElement)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLTemplateElement,
|
||||
nsGenericHTMLElement)
|
||||
if (tmp->mContent) {
|
||||
if (tmp->mContent->GetHost() == tmp) {
|
||||
tmp->mContent->SetHost(nullptr);
|
||||
}
|
||||
tmp->mContent->SetHost(nullptr);
|
||||
tmp->mContent = nullptr;
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
@ -73,38 +61,4 @@ JSObject* HTMLTemplateElement::WrapNode(JSContext* aCx,
|
||||
return HTMLTemplateElement_Binding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
void HTMLTemplateElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
|
||||
const nsAttrValue* aValue,
|
||||
const nsAttrValue* aOldValue,
|
||||
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||
bool aNotify) {
|
||||
if (aNamespaceID == kNameSpaceID_None && aName == nsGkAtoms::shadowrootmode &&
|
||||
aValue && aValue->Type() == nsAttrValue::ValueType::eEnum &&
|
||||
!mShadowRootMode.isSome()) {
|
||||
mShadowRootMode.emplace(
|
||||
static_cast<ShadowRootMode>(aValue->GetEnumValue()));
|
||||
}
|
||||
|
||||
nsGenericHTMLElement::AfterSetAttr(aNamespaceID, aName, aValue, aOldValue,
|
||||
aMaybeScriptedPrincipal, aNotify);
|
||||
}
|
||||
|
||||
bool HTMLTemplateElement::ParseAttribute(int32_t aNamespaceID,
|
||||
nsAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||
nsAttrValue& aResult) {
|
||||
if (aNamespaceID == kNameSpaceID_None &&
|
||||
aAttribute == nsGkAtoms::shadowrootmode) {
|
||||
return aResult.ParseEnumValue(aValue, kShadowRootModeTable, false, nullptr);
|
||||
}
|
||||
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||
aMaybeScriptedPrincipal, aResult);
|
||||
}
|
||||
|
||||
void HTMLTemplateElement::SetHTMLUnsafe(const nsAString& aHTML) {
|
||||
RefPtr<DocumentFragment> content = mContent;
|
||||
nsContentUtils::SetHTMLUnsafe(content, this, aHTML);
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
@ -8,11 +8,8 @@
|
||||
#define mozilla_dom_HTMLTemplateElement_h
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "mozilla/dom/DocumentFragment.h"
|
||||
#include "mozilla/dom/ShadowRootBinding.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
||||
namespace mozilla::dom {
|
||||
|
||||
@ -29,38 +26,9 @@ class HTMLTemplateElement final : public nsGenericHTMLElement {
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLTemplateElement,
|
||||
nsGenericHTMLElement)
|
||||
|
||||
void AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
|
||||
const nsAttrValue* aValue, const nsAttrValue* aOldValue,
|
||||
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||
bool aNotify) override;
|
||||
|
||||
bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||
nsAttrValue& aResult) override;
|
||||
|
||||
virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
|
||||
|
||||
DocumentFragment* Content() { return mContent; }
|
||||
void SetContent(DocumentFragment* aContent) { mContent = aContent; }
|
||||
|
||||
void GetShadowRootMode(nsAString& aResult) const {
|
||||
GetEnumAttr(nsGkAtoms::shadowrootmode, nullptr, aResult);
|
||||
}
|
||||
void SetShadowRootMode(const nsAString& aValue) {
|
||||
SetHTMLAttr(nsGkAtoms::shadowrootmode, aValue);
|
||||
}
|
||||
|
||||
bool ShadowRootDelegatesFocus() {
|
||||
return GetBoolAttr(nsGkAtoms::shadowrootdelegatesfocus);
|
||||
}
|
||||
void SetShadowRootDelegatesFocus(bool aValue) {
|
||||
SetHTMLBoolAttr(nsGkAtoms::shadowrootdelegatesfocus, aValue,
|
||||
IgnoredErrorResult());
|
||||
}
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
void SetHTMLUnsafe(const nsAString& aHTML) final;
|
||||
|
||||
protected:
|
||||
virtual ~HTMLTemplateElement();
|
||||
@ -69,7 +37,6 @@ class HTMLTemplateElement final : public nsGenericHTMLElement {
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
RefPtr<DocumentFragment> mContent;
|
||||
Maybe<ShadowRootMode> mShadowRootMode;
|
||||
};
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
@ -151,9 +151,6 @@ interface Document : Node {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/dom.html#the-document-object
|
||||
partial interface Document {
|
||||
[Pref="dom.webcomponents.shadowdom.declarative.enabled"]
|
||||
static Document parseHTMLUnsafe(DOMString html);
|
||||
|
||||
[PutForwards=href, LegacyUnforgeable] readonly attribute Location? location;
|
||||
[SetterThrows] attribute DOMString domain;
|
||||
readonly attribute DOMString referrer;
|
||||
|
@ -276,8 +276,6 @@ dictionary ShadowRootInit {
|
||||
required ShadowRootMode mode;
|
||||
boolean delegatesFocus = false;
|
||||
SlotAssignmentMode slotAssignment = "named";
|
||||
[Pref="dom.webcomponents.shadowdom.declarative.enabled"]
|
||||
boolean clonable = false;
|
||||
};
|
||||
|
||||
// https://dom.spec.whatwg.org/#element
|
||||
@ -405,9 +403,3 @@ partial interface Element {
|
||||
[SecureContext, UseCounter, Throws, Pref="dom.security.setHTML.enabled"]
|
||||
undefined setHTML(DOMString aInnerHTML, optional SetHTMLOptions options = {});
|
||||
};
|
||||
|
||||
partial interface Element {
|
||||
// https://html.spec.whatwg.org/#dom-element-sethtmlunsafe
|
||||
[Pref="dom.webcomponents.shadowdom.declarative.enabled"]
|
||||
undefined setHTMLUnsafe(DOMString html);
|
||||
};
|
||||
|
@ -3,7 +3,7 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://html.spec.whatwg.org/multipage/scripting.html#the-template-element
|
||||
* https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
@ -13,9 +13,5 @@
|
||||
interface HTMLTemplateElement : HTMLElement {
|
||||
[HTMLConstructor] constructor();
|
||||
|
||||
readonly attribute DocumentFragment content;
|
||||
[CEReactions, Pref="dom.webcomponents.shadowdom.declarative.enabled"]
|
||||
attribute DOMString shadowRootMode;
|
||||
[CEReactions, Pref="dom.webcomponents.shadowdom.declarative.enabled"]
|
||||
attribute boolean shadowRootDelegatesFocus;
|
||||
readonly attribute DocumentFragment content;
|
||||
};
|
||||
|
@ -56,10 +56,4 @@ interface ShadowRoot : DocumentFragment
|
||||
boolean isUAWidget();
|
||||
};
|
||||
|
||||
partial interface ShadowRoot {
|
||||
// https://html.spec.whatwg.org/#dom-shadowroot-sethtmlunsafe
|
||||
[Pref="dom.webcomponents.shadowdom.declarative.enabled"]
|
||||
undefined setHTMLUnsafe(DOMString html);
|
||||
};
|
||||
|
||||
ShadowRoot includes DocumentOrShadowRoot;
|
||||
|
@ -314,8 +314,6 @@ nsresult nsContentDLF::CreateDocument(
|
||||
nsCOMPtr<nsIDocumentViewer> viewer = NS_NewDocumentViewer();
|
||||
|
||||
doc->SetContainer(static_cast<nsDocShell*>(aContainer));
|
||||
doc->SetAllowDeclarativeShadowRoots(
|
||||
mozilla::StaticPrefs::dom_webcomponents_shadowdom_declarative_enabled());
|
||||
|
||||
// Initialize the document to begin loading the data. An
|
||||
// nsIStreamListener connected to the parser is returned in
|
||||
|
@ -4528,12 +4528,6 @@
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
# Is support for Declarative ShadowDOM enabled?
|
||||
- name: dom.webcomponents.shadowdom.declarative.enabled
|
||||
type: bool
|
||||
value: @IS_NIGHTLY_BUILD@
|
||||
mirror: always
|
||||
|
||||
# Is support for the Web GPU API enabled?
|
||||
- name: dom.webgpu.enabled
|
||||
type: RelaxedAtomicBool
|
||||
|
@ -798,12 +798,10 @@ public final class AttributeName
|
||||
public static final AttributeName LOADING = new AttributeName(ALL_NO_NS, "loading", "loading", "loading", "loading", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
public static final AttributeName READONLY = new AttributeName(ALL_NO_NS, "readonly", "readonly", "readonly", "readonly", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG | CASE_FOLDED | BOOLEAN);
|
||||
public static final AttributeName RENDERING_INTENT = new AttributeName(ALL_NO_NS, "rendering-intent", "rendering-intent", "rendering-intent", "rendering-intent", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
public static final AttributeName SHADOWROOTMODE = new AttributeName(ALL_NO_NS, "shadowrootmode", "shadowrootmode", "shadowrootmode", "shadowrootmode", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
public static final AttributeName SEED = new AttributeName(ALL_NO_NS, "seed", "seed", "seed", "seed", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
public static final AttributeName SRCDOC = new AttributeName(ALL_NO_NS, "srcdoc", "srcdoc", "srcdoc", "srcdoc", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
public static final AttributeName STDDEVIATION = new AttributeName(ALL_NO_NS, "stddeviation", "stddeviation", "stdDeviation", "stddeviation", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
public static final AttributeName SANDBOX = new AttributeName(ALL_NO_NS, "sandbox", "sandbox", "sandbox", "sandbox", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
public static final AttributeName SHADOWROOTDELEGATESFOCUS = new AttributeName(ALL_NO_NS, "shadowrootdelegatesfocus", "shadowrootdelegatesfocus", "shadowrootdelegatesfocus", "shadowrootdelegatesfocus", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
public static final AttributeName WORD_SPACING = new AttributeName(ALL_NO_NS, "word-spacing", "word-spacing", "word-spacing", "word-spacing", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
public static final AttributeName ACCENTUNDER = new AttributeName(ALL_NO_NS, "accentunder", "accentunder", "accentunder", "accentunder", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
public static final AttributeName ACCEPT_CHARSET = new AttributeName(ALL_NO_NS, "accept-charset", "accept-charset", "accept-charset", "accept-charset", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
@ -1194,36 +1192,36 @@ public final class AttributeName
|
||||
public static final AttributeName RY = new AttributeName(ALL_NO_NS, "ry", "ry", "ry", "ry", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
public static final AttributeName REFY = new AttributeName(ALL_NO_NS, "refy", "refy", "refY", "refy", ALL_NO_PREFIX, NCNAME_HTML | NCNAME_FOREIGN | NCNAME_LANG);
|
||||
private final static @NoLength AttributeName[] ATTRIBUTE_NAMES = {
|
||||
CELLSPACING,
|
||||
CODETYPE,
|
||||
ATTRIBUTENAME,
|
||||
DECLARE,
|
||||
CITE,
|
||||
CHAR,
|
||||
CLEAR,
|
||||
ALIGNMENTSCOPE,
|
||||
BGCOLOR,
|
||||
FILTERUNITS,
|
||||
HEIGHT,
|
||||
COLOR_RENDERING,
|
||||
FONT_SIZE,
|
||||
ARIA_DISABLED,
|
||||
OPACITY,
|
||||
ONBEFORECOPY,
|
||||
ACTION,
|
||||
KERNELMATRIX,
|
||||
STROKE_DASHOFFSET,
|
||||
IS,
|
||||
INPUTMODE,
|
||||
ONBEFOREPASTE,
|
||||
ADDITIVE,
|
||||
KERNELUNITLENGTH,
|
||||
STROKE_MITERLIMIT,
|
||||
KEYSPLINES,
|
||||
ONCUT,
|
||||
Y,
|
||||
ARIA_MULTISELECTABLE,
|
||||
ROTATE,
|
||||
STDDEVIATION,
|
||||
MODE,
|
||||
SUPERSCRIPTSHIFT,
|
||||
TARGETX,
|
||||
SCRIPTMINSIZE,
|
||||
FORMAT,
|
||||
TRANSFORM,
|
||||
ONMOUSEOVER,
|
||||
GLYPHREF,
|
||||
OVERFLOW,
|
||||
CONTENTEDITABLE,
|
||||
STITCHTILES,
|
||||
SANDBOX,
|
||||
NORESIZE,
|
||||
SCHEME,
|
||||
ARCHIVE,
|
||||
VALIGN,
|
||||
FRAME,
|
||||
WHEN,
|
||||
ONCONTEXTMENU,
|
||||
KEYPOINTS,
|
||||
ONDRAGLEAVE,
|
||||
CONTENT,
|
||||
TEXT_RENDERING,
|
||||
RX,
|
||||
MIN,
|
||||
K3,
|
||||
@ -1232,30 +1230,30 @@ public final class AttributeName
|
||||
LOCAL,
|
||||
ONABORT,
|
||||
HIDDEN,
|
||||
ACCEPT,
|
||||
ENTERKEYHINT,
|
||||
OTHER,
|
||||
REPEAT,
|
||||
HREF,
|
||||
LARGEOP,
|
||||
MATHCOLOR,
|
||||
MEDIA,
|
||||
MARKER_END,
|
||||
ONBLUR,
|
||||
SYMMETRIC,
|
||||
POINTER_EVENTS,
|
||||
XMLNS,
|
||||
FLOOD_COLOR,
|
||||
ONFOCUS,
|
||||
CLIP,
|
||||
SCOPE,
|
||||
ONDRAG,
|
||||
COLSPAN,
|
||||
PRESERVEASPECTRATIO,
|
||||
FONTWEIGHT,
|
||||
ONSTOP,
|
||||
WIDTH,
|
||||
VALUETYPE,
|
||||
BASEFREQUENCY,
|
||||
INDEX,
|
||||
ONREADYSTATECHANGE,
|
||||
RULES,
|
||||
ONAFTERPRINT,
|
||||
LENGTHADJUST,
|
||||
NOSHADE,
|
||||
ONFINISH,
|
||||
MARKER_START,
|
||||
ROWLINES,
|
||||
USEMAP,
|
||||
POINTSATX,
|
||||
XLINK_SHOW,
|
||||
LQUOTE,
|
||||
ONFOCUSOUT,
|
||||
CLIP_PATH,
|
||||
SLOPE,
|
||||
ONDRAGOVER,
|
||||
CROSSORIGIN,
|
||||
ROWSPACING,
|
||||
FONTSTYLE,
|
||||
POSTER,
|
||||
COLUMNSPAN,
|
||||
ELEVATION,
|
||||
DY,
|
||||
END,
|
||||
SRC,
|
||||
@ -1271,54 +1269,54 @@ public final class AttributeName
|
||||
FETCHPRIORITY,
|
||||
BORDER,
|
||||
RENDERING_INTENT,
|
||||
ACCENTUNDER,
|
||||
BASEPROFILE,
|
||||
DATETIME,
|
||||
INTEGRITY,
|
||||
ONREPEAT,
|
||||
ONBEGIN,
|
||||
ONKEYUP,
|
||||
REPEATCOUNT,
|
||||
SELECTION,
|
||||
SURFACESCALE,
|
||||
IMAGESRCSET,
|
||||
MARGINWIDTH,
|
||||
LIGHTING_COLOR,
|
||||
PATHLENGTH,
|
||||
DOMINANT_BASELINE,
|
||||
RADIOGROUP,
|
||||
BACKGROUND,
|
||||
MASKUNITS,
|
||||
FILL,
|
||||
STYLE,
|
||||
FROM,
|
||||
ASYNC,
|
||||
OPEN,
|
||||
POINTSATZ,
|
||||
XLINK_TITLE,
|
||||
AUTOPLAY,
|
||||
COLOR,
|
||||
NOMODULE,
|
||||
ONCOPY,
|
||||
TO,
|
||||
SCROLLING,
|
||||
DISPLAY,
|
||||
PROPERTY,
|
||||
STOP_OPACITY,
|
||||
CHAROFF,
|
||||
ONDROP,
|
||||
START,
|
||||
CURSOR,
|
||||
MAXSIZE,
|
||||
SRCSET,
|
||||
DEPTH,
|
||||
FONTFAMILY,
|
||||
LETTER_SPACING,
|
||||
PATTERN,
|
||||
TEXT_ANCHOR,
|
||||
COLUMNALIGN,
|
||||
REQUIREDFEATURES,
|
||||
VIEWBOX,
|
||||
ACCESSKEY,
|
||||
BASE,
|
||||
EDGEMODE,
|
||||
LABEL,
|
||||
ONSELECT,
|
||||
ORIENT,
|
||||
ONKEYDOWN,
|
||||
SELECTED,
|
||||
TYPE,
|
||||
ALIGN,
|
||||
LANGUAGE,
|
||||
PING,
|
||||
METHOD,
|
||||
ALTIMG,
|
||||
DEFINITIONURL,
|
||||
SCRIPTLEVEL,
|
||||
MARKER_MID,
|
||||
MASKCONTENTUNITS,
|
||||
MAXLENGTH,
|
||||
TITLE,
|
||||
PROMPT,
|
||||
IN,
|
||||
ONEND,
|
||||
STANDBY,
|
||||
XLINK_ARCROLE,
|
||||
AUTOFOCUS,
|
||||
ENCODING,
|
||||
ONMOUSEWHEEL,
|
||||
ONMOUSEMOVE,
|
||||
STROKE_LINECAP,
|
||||
STROKE_OPACITY,
|
||||
GLYPH_ORIENTATION_VERTICAL,
|
||||
STEP,
|
||||
WRAP,
|
||||
NOWRAP,
|
||||
ONERROR,
|
||||
AXIS,
|
||||
CLOSE,
|
||||
OFFSET,
|
||||
VERSION,
|
||||
FONT_STRETCH,
|
||||
FONT_VARIANT,
|
||||
MULTIPLE,
|
||||
PATTERNCONTENTUNITS,
|
||||
TEXT,
|
||||
COLUMNWIDTH,
|
||||
REQUIREDEXTENSIONS,
|
||||
DX,
|
||||
BY,
|
||||
RY,
|
||||
DIR,
|
||||
@ -1348,103 +1346,103 @@ public final class AttributeName
|
||||
SPECULAREXPONENT,
|
||||
GRADIENTTRANSFORM,
|
||||
LOADING,
|
||||
SEED,
|
||||
SHADOWROOTDELEGATESFOCUS,
|
||||
ACCESSKEY,
|
||||
BASEFREQUENCY,
|
||||
BASE,
|
||||
CITE,
|
||||
EDGEMODE,
|
||||
INDEX,
|
||||
LABEL,
|
||||
NORESIZE,
|
||||
ONSELECT,
|
||||
ONREADYSTATECHANGE,
|
||||
ORIENT,
|
||||
ONBEFOREPASTE,
|
||||
ONKEYDOWN,
|
||||
RULES,
|
||||
SELECTED,
|
||||
SCHEME,
|
||||
TYPE,
|
||||
ONAFTERPRINT,
|
||||
ALIGN,
|
||||
HEIGHT,
|
||||
LANGUAGE,
|
||||
LENGTHADJUST,
|
||||
PING,
|
||||
ARCHIVE,
|
||||
METHOD,
|
||||
NOSHADE,
|
||||
ALTIMG,
|
||||
ADDITIVE,
|
||||
DEFINITIONURL,
|
||||
ONFINISH,
|
||||
SCRIPTLEVEL,
|
||||
VALIGN,
|
||||
MARKER_MID,
|
||||
MARKER_START,
|
||||
MASKCONTENTUNITS,
|
||||
DECLARE,
|
||||
MAXLENGTH,
|
||||
ROWLINES,
|
||||
TITLE,
|
||||
FRAME,
|
||||
PROMPT,
|
||||
USEMAP,
|
||||
IN,
|
||||
KERNELUNITLENGTH,
|
||||
ONEND,
|
||||
POINTSATX,
|
||||
STANDBY,
|
||||
WHEN,
|
||||
XLINK_ARCROLE,
|
||||
XLINK_SHOW,
|
||||
AUTOFOCUS,
|
||||
COLOR_RENDERING,
|
||||
ENCODING,
|
||||
LQUOTE,
|
||||
ONMOUSEWHEEL,
|
||||
ONCONTEXTMENU,
|
||||
ONMOUSEMOVE,
|
||||
ONFOCUSOUT,
|
||||
STROKE_LINECAP,
|
||||
STROKE_MITERLIMIT,
|
||||
STROKE_OPACITY,
|
||||
CLIP_PATH,
|
||||
GLYPH_ORIENTATION_VERTICAL,
|
||||
KEYPOINTS,
|
||||
STEP,
|
||||
SLOPE,
|
||||
WRAP,
|
||||
CHAR,
|
||||
NOWRAP,
|
||||
ONDRAGOVER,
|
||||
ONERROR,
|
||||
ONDRAGLEAVE,
|
||||
AXIS,
|
||||
CROSSORIGIN,
|
||||
CLOSE,
|
||||
KEYSPLINES,
|
||||
OFFSET,
|
||||
ROWSPACING,
|
||||
VERSION,
|
||||
CONTENT,
|
||||
FONT_STRETCH,
|
||||
FONTSTYLE,
|
||||
FONT_VARIANT,
|
||||
FONT_SIZE,
|
||||
MULTIPLE,
|
||||
POSTER,
|
||||
PATTERNCONTENTUNITS,
|
||||
TEXT_RENDERING,
|
||||
TEXT,
|
||||
COLUMNSPAN,
|
||||
COLUMNWIDTH,
|
||||
ONCUT,
|
||||
REQUIREDEXTENSIONS,
|
||||
ELEVATION,
|
||||
DX,
|
||||
SRCDOC,
|
||||
ACCENTUNDER,
|
||||
ACCEPT,
|
||||
BASEPROFILE,
|
||||
CODETYPE,
|
||||
DATETIME,
|
||||
ENTERKEYHINT,
|
||||
INTEGRITY,
|
||||
MODE,
|
||||
ONREPEAT,
|
||||
OTHER,
|
||||
ONBEGIN,
|
||||
ONBEFORECOPY,
|
||||
ONKEYUP,
|
||||
REPEAT,
|
||||
REPEATCOUNT,
|
||||
SUPERSCRIPTSHIFT,
|
||||
SELECTION,
|
||||
HREF,
|
||||
SURFACESCALE,
|
||||
ALIGNMENTSCOPE,
|
||||
IMAGESRCSET,
|
||||
LARGEOP,
|
||||
MARGINWIDTH,
|
||||
TARGETX,
|
||||
LIGHTING_COLOR,
|
||||
MATHCOLOR,
|
||||
PATHLENGTH,
|
||||
ACTION,
|
||||
DOMINANT_BASELINE,
|
||||
MEDIA,
|
||||
RADIOGROUP,
|
||||
SCRIPTMINSIZE,
|
||||
BACKGROUND,
|
||||
MARKER_END,
|
||||
MASKUNITS,
|
||||
CELLSPACING,
|
||||
FILL,
|
||||
ONBLUR,
|
||||
STYLE,
|
||||
FORMAT,
|
||||
FROM,
|
||||
SYMMETRIC,
|
||||
ASYNC,
|
||||
KERNELMATRIX,
|
||||
OPEN,
|
||||
POINTER_EVENTS,
|
||||
POINTSATZ,
|
||||
TRANSFORM,
|
||||
XLINK_TITLE,
|
||||
XMLNS,
|
||||
AUTOPLAY,
|
||||
BGCOLOR,
|
||||
COLOR,
|
||||
FLOOD_COLOR,
|
||||
NOMODULE,
|
||||
ONMOUSEOVER,
|
||||
ONCOPY,
|
||||
ONFOCUS,
|
||||
TO,
|
||||
STROKE_DASHOFFSET,
|
||||
SCROLLING,
|
||||
CLIP,
|
||||
DISPLAY,
|
||||
GLYPHREF,
|
||||
PROPERTY,
|
||||
SCOPE,
|
||||
STOP_OPACITY,
|
||||
ATTRIBUTENAME,
|
||||
CHAROFF,
|
||||
ONDRAG,
|
||||
ONDROP,
|
||||
OVERFLOW,
|
||||
START,
|
||||
COLSPAN,
|
||||
CURSOR,
|
||||
IS,
|
||||
MAXSIZE,
|
||||
PRESERVEASPECTRATIO,
|
||||
SRCSET,
|
||||
CONTENTEDITABLE,
|
||||
DEPTH,
|
||||
FONTWEIGHT,
|
||||
FONTFAMILY,
|
||||
FILTERUNITS,
|
||||
LETTER_SPACING,
|
||||
ONSTOP,
|
||||
PATTERN,
|
||||
STITCHTILES,
|
||||
TEXT_ANCHOR,
|
||||
WIDTH,
|
||||
COLUMNALIGN,
|
||||
INPUTMODE,
|
||||
REQUIREDFEATURES,
|
||||
VALUETYPE,
|
||||
VIEWBOX,
|
||||
FX,
|
||||
REFX,
|
||||
CY,
|
||||
FY,
|
||||
@ -1503,9 +1501,8 @@ public final class AttributeName
|
||||
GRADIENTUNITS,
|
||||
HEADERS,
|
||||
READONLY,
|
||||
SHADOWROOTMODE,
|
||||
SRCDOC,
|
||||
SANDBOX,
|
||||
SEED,
|
||||
STDDEVIATION,
|
||||
WORD_SPACING,
|
||||
ACCEPT_CHARSET,
|
||||
ACCENT,
|
||||
@ -1696,39 +1693,38 @@ public final class AttributeName
|
||||
VALUE,
|
||||
VIEWTARGET,
|
||||
CX,
|
||||
FX,
|
||||
};
|
||||
private final static int[] ATTRIBUTE_HASHES = {
|
||||
1865910331,
|
||||
1748503880,
|
||||
1965512429,
|
||||
1866496199,
|
||||
1748566068,
|
||||
1966384692,
|
||||
1681174213,
|
||||
1781007934,
|
||||
1915757815,
|
||||
2001826027,
|
||||
1784574102,
|
||||
1916247343,
|
||||
2001898809,
|
||||
1680165421,
|
||||
1721347639,
|
||||
1754835516,
|
||||
1814560070,
|
||||
1903612236,
|
||||
1924517489,
|
||||
1984430082,
|
||||
2019887833,
|
||||
1754860061,
|
||||
1814656840,
|
||||
1903759600,
|
||||
1924583073,
|
||||
1987422362,
|
||||
2023342821,
|
||||
71827457,
|
||||
1680282148,
|
||||
1689324870,
|
||||
1740119884,
|
||||
1753550036,
|
||||
1756762256,
|
||||
1791068279,
|
||||
1824159037,
|
||||
1884079398,
|
||||
1908462185,
|
||||
1922413307,
|
||||
1934970504,
|
||||
1972922984,
|
||||
2000096287,
|
||||
2008401563,
|
||||
1740130375,
|
||||
1754434872,
|
||||
1756836998,
|
||||
1797886599,
|
||||
1825437894,
|
||||
1884246821,
|
||||
1909819252,
|
||||
1922566877,
|
||||
1937336473,
|
||||
1972996699,
|
||||
2000160071,
|
||||
2009041198,
|
||||
2073034754,
|
||||
57205395,
|
||||
911736834,
|
||||
@ -1737,30 +1733,30 @@ public final class AttributeName
|
||||
1685882101,
|
||||
1704526375,
|
||||
1734182982,
|
||||
1747479606,
|
||||
1749549708,
|
||||
1754644293,
|
||||
1756147974,
|
||||
1767725700,
|
||||
1786775671,
|
||||
1804081401,
|
||||
1820727381,
|
||||
1854366938,
|
||||
1872343590,
|
||||
1890996553,
|
||||
1906408542,
|
||||
1910503637,
|
||||
1917857531,
|
||||
1922677495,
|
||||
1932959284,
|
||||
1941435445,
|
||||
1972656710,
|
||||
1983157559,
|
||||
1990107683,
|
||||
2001634458,
|
||||
2006459190,
|
||||
2010716309,
|
||||
2026893641,
|
||||
1747800157,
|
||||
1751507685,
|
||||
1754647074,
|
||||
1756219733,
|
||||
1771569964,
|
||||
1786851500,
|
||||
1804405895,
|
||||
1821958888,
|
||||
1854466380,
|
||||
1873656984,
|
||||
1891937366,
|
||||
1906419001,
|
||||
1910527802,
|
||||
1921061206,
|
||||
1922679610,
|
||||
1933123337,
|
||||
1941440197,
|
||||
1972744954,
|
||||
1983290011,
|
||||
1991220282,
|
||||
2001669449,
|
||||
2006824246,
|
||||
2016711994,
|
||||
2034765641,
|
||||
2082471938,
|
||||
53006051,
|
||||
60345635,
|
||||
@ -1776,54 +1772,54 @@ public final class AttributeName
|
||||
1716623661,
|
||||
1731048742,
|
||||
1739583824,
|
||||
1747295467,
|
||||
1747906667,
|
||||
1748971848,
|
||||
1751755561,
|
||||
1754579720,
|
||||
1754698327,
|
||||
1754899031,
|
||||
1756360955,
|
||||
1756889417,
|
||||
1773606972,
|
||||
1785053243,
|
||||
1787365531,
|
||||
1803561214,
|
||||
1805715690,
|
||||
1816104145,
|
||||
1823574314,
|
||||
1848600826,
|
||||
1854497001,
|
||||
1867462756,
|
||||
1874270021,
|
||||
1884295780,
|
||||
1898415413,
|
||||
1905628916,
|
||||
1906423097,
|
||||
1910441627,
|
||||
1915025672,
|
||||
1916286197,
|
||||
1921977416,
|
||||
1922607670,
|
||||
1923088386,
|
||||
1924629705,
|
||||
1933369607,
|
||||
1939976792,
|
||||
1941550652,
|
||||
1966442279,
|
||||
1972904518,
|
||||
1975062341,
|
||||
1983398182,
|
||||
1988784439,
|
||||
1991625270,
|
||||
2000752725,
|
||||
2001710298,
|
||||
2004846654,
|
||||
2007021895,
|
||||
2009079867,
|
||||
2016810187,
|
||||
2024647008,
|
||||
2060474743,
|
||||
1747309881,
|
||||
1748021284,
|
||||
1749350104,
|
||||
1753049109,
|
||||
1754612424,
|
||||
1754794646,
|
||||
1754927689,
|
||||
1756704824,
|
||||
1757421892,
|
||||
1780879045,
|
||||
1786622296,
|
||||
1788842244,
|
||||
1804054854,
|
||||
1814517574,
|
||||
1816178925,
|
||||
1823829083,
|
||||
1854285018,
|
||||
1854497008,
|
||||
1871251689,
|
||||
1874788501,
|
||||
1889569526,
|
||||
1900544002,
|
||||
1905754853,
|
||||
1907701479,
|
||||
1910441773,
|
||||
1915341049,
|
||||
1917295176,
|
||||
1922400908,
|
||||
1922665179,
|
||||
1924443742,
|
||||
1924773438,
|
||||
1934917290,
|
||||
1941286708,
|
||||
1943317364,
|
||||
1972151670,
|
||||
1972908839,
|
||||
1982254612,
|
||||
1983432389,
|
||||
1989522022,
|
||||
1993343287,
|
||||
2001527900,
|
||||
2001732764,
|
||||
2005342360,
|
||||
2007064819,
|
||||
2009231684,
|
||||
2017010843,
|
||||
2024794274,
|
||||
2065694722,
|
||||
2081423362,
|
||||
2089811970,
|
||||
52488851,
|
||||
@ -1853,103 +1849,103 @@ public final class AttributeName
|
||||
1723336432,
|
||||
1733874289,
|
||||
1736416327,
|
||||
1739927860,
|
||||
1740222216,
|
||||
1747309881,
|
||||
1747800157,
|
||||
1748021284,
|
||||
1748566068,
|
||||
1749350104,
|
||||
1751507685,
|
||||
1753049109,
|
||||
1754434872,
|
||||
1754612424,
|
||||
1754647074,
|
||||
1754794646,
|
||||
1754860061,
|
||||
1754927689,
|
||||
1756219733,
|
||||
1756704824,
|
||||
1756836998,
|
||||
1757421892,
|
||||
1771569964,
|
||||
1780879045,
|
||||
1784574102,
|
||||
1786622296,
|
||||
1786851500,
|
||||
1788842244,
|
||||
1797886599,
|
||||
1804054854,
|
||||
1804405895,
|
||||
1814517574,
|
||||
1814656840,
|
||||
1816178925,
|
||||
1821958888,
|
||||
1823829083,
|
||||
1825437894,
|
||||
1854285018,
|
||||
1854466380,
|
||||
1854497008,
|
||||
1866496199,
|
||||
1871251689,
|
||||
1873656984,
|
||||
1874788501,
|
||||
1884246821,
|
||||
1889569526,
|
||||
1891937366,
|
||||
1900544002,
|
||||
1903759600,
|
||||
1905754853,
|
||||
1906419001,
|
||||
1907701479,
|
||||
1909819252,
|
||||
1910441773,
|
||||
1910527802,
|
||||
1915341049,
|
||||
1916247343,
|
||||
1917295176,
|
||||
1921061206,
|
||||
1922400908,
|
||||
1922566877,
|
||||
1922665179,
|
||||
1922679610,
|
||||
1924443742,
|
||||
1924583073,
|
||||
1924773438,
|
||||
1933123337,
|
||||
1934917290,
|
||||
1937336473,
|
||||
1941286708,
|
||||
1941440197,
|
||||
1943317364,
|
||||
1966384692,
|
||||
1972151670,
|
||||
1972744954,
|
||||
1972908839,
|
||||
1972996699,
|
||||
1982254612,
|
||||
1983290011,
|
||||
1983432389,
|
||||
1987422362,
|
||||
1989522022,
|
||||
1991220282,
|
||||
1993343287,
|
||||
2000160071,
|
||||
2001527900,
|
||||
2001669449,
|
||||
2001732764,
|
||||
2001898809,
|
||||
2005342360,
|
||||
2006824246,
|
||||
2007064819,
|
||||
2009041198,
|
||||
2009231684,
|
||||
2016711994,
|
||||
2017010843,
|
||||
2023342821,
|
||||
2024794274,
|
||||
2034765641,
|
||||
2065694722,
|
||||
1740096054,
|
||||
1747295467,
|
||||
1747479606,
|
||||
1747906667,
|
||||
1748503880,
|
||||
1748971848,
|
||||
1749549708,
|
||||
1751755561,
|
||||
1753550036,
|
||||
1754579720,
|
||||
1754644293,
|
||||
1754698327,
|
||||
1754835516,
|
||||
1754899031,
|
||||
1756147974,
|
||||
1756360955,
|
||||
1756762256,
|
||||
1756889417,
|
||||
1767725700,
|
||||
1773606972,
|
||||
1781007934,
|
||||
1785053243,
|
||||
1786775671,
|
||||
1787365531,
|
||||
1791068279,
|
||||
1803561214,
|
||||
1804081401,
|
||||
1805715690,
|
||||
1814560070,
|
||||
1816104145,
|
||||
1820727381,
|
||||
1823574314,
|
||||
1824159037,
|
||||
1848600826,
|
||||
1854366938,
|
||||
1854497001,
|
||||
1865910331,
|
||||
1867462756,
|
||||
1872343590,
|
||||
1874270021,
|
||||
1884079398,
|
||||
1884295780,
|
||||
1890996553,
|
||||
1898415413,
|
||||
1903612236,
|
||||
1905628916,
|
||||
1906408542,
|
||||
1906423097,
|
||||
1908462185,
|
||||
1910441627,
|
||||
1910503637,
|
||||
1915025672,
|
||||
1915757815,
|
||||
1916286197,
|
||||
1917857531,
|
||||
1921977416,
|
||||
1922413307,
|
||||
1922607670,
|
||||
1922677495,
|
||||
1923088386,
|
||||
1924517489,
|
||||
1924629705,
|
||||
1932959284,
|
||||
1933369607,
|
||||
1934970504,
|
||||
1939976792,
|
||||
1941435445,
|
||||
1941550652,
|
||||
1965512429,
|
||||
1966442279,
|
||||
1972656710,
|
||||
1972904518,
|
||||
1972922984,
|
||||
1975062341,
|
||||
1983157559,
|
||||
1983398182,
|
||||
1984430082,
|
||||
1988784439,
|
||||
1990107683,
|
||||
1991625270,
|
||||
2000096287,
|
||||
2000752725,
|
||||
2001634458,
|
||||
2001710298,
|
||||
2001826027,
|
||||
2004846654,
|
||||
2006459190,
|
||||
2007021895,
|
||||
2008401563,
|
||||
2009079867,
|
||||
2010716309,
|
||||
2016810187,
|
||||
2019887833,
|
||||
2024647008,
|
||||
2026893641,
|
||||
2060474743,
|
||||
2066743298,
|
||||
2075005220,
|
||||
2081947650,
|
||||
2083520514,
|
||||
@ -2008,9 +2004,8 @@ public final class AttributeName
|
||||
1733919469,
|
||||
1734404167,
|
||||
1739561208,
|
||||
1739914974,
|
||||
1740096054,
|
||||
1740130375,
|
||||
1739927860,
|
||||
1740119884,
|
||||
1742183484,
|
||||
1747299630,
|
||||
1747446838,
|
||||
@ -2201,6 +2196,5 @@ public final class AttributeName
|
||||
2026975253,
|
||||
2060302634,
|
||||
2065170434,
|
||||
2066743298,
|
||||
};
|
||||
}
|
||||
|
@ -434,8 +434,6 @@ public abstract class TreeBuilder<T> implements TokenHandler,
|
||||
|
||||
private boolean forceNoQuirks = false;
|
||||
|
||||
private boolean allowDeclarativeShadowRoots = false;
|
||||
|
||||
// [NOCPP[
|
||||
|
||||
private boolean reportingDoctype = true;
|
||||
@ -2960,20 +2958,6 @@ public abstract class TreeBuilder<T> implements TokenHandler,
|
||||
|| (("http://www.w3.org/1998/Math/MathML" == ns) && (stackNode.getGroup() == MI_MO_MN_MS_MTEXT));
|
||||
}
|
||||
|
||||
private T getDeclarativeShadowRoot(T currentNode, T templateNode, HtmlAttributes attributes) {
|
||||
if (!isAllowDeclarativeShadowRoots()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String shadowRootMode = attributes.getValue(AttributeName.SHADOWROOTMODE);
|
||||
if (shadowRootMode == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean shadowRootDelegatesFocus = attributes.contains(AttributeName.SHADOWROOTDELEGATESFOCUS);
|
||||
return getShadowRootFromHost(currentNode, templateNode, shadowRootMode, shadowRootDelegatesFocus);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* <p>
|
||||
@ -5318,17 +5302,9 @@ public abstract class TreeBuilder<T> implements TokenHandler,
|
||||
T elt = createElement("http://www.w3.org/1999/xhtml", elementName.getName(), attributes, currentNode
|
||||
// CPPONLY: , htmlCreator(elementName.getHtmlCreator())
|
||||
);
|
||||
appendElement(elt, currentNode);
|
||||
if (ElementName.TEMPLATE == elementName) {
|
||||
T root = getDeclarativeShadowRoot(currentNode, elt, attributes);
|
||||
if (root != null) {
|
||||
setDocumentFragmentForTemplate(elt, root);
|
||||
elt = root;
|
||||
} else {
|
||||
appendElement(elt, currentNode);
|
||||
elt = getDocumentFragmentForTemplate(elt);
|
||||
}
|
||||
} else {
|
||||
appendElement(elt, currentNode);
|
||||
elt = getDocumentFragmentForTemplate(elt);
|
||||
}
|
||||
StackNode<T> node = createStackNode(elementName, elt
|
||||
// [NOCPP[
|
||||
@ -5415,13 +5391,6 @@ public abstract class TreeBuilder<T> implements TokenHandler,
|
||||
return template;
|
||||
}
|
||||
|
||||
void setDocumentFragmentForTemplate(T template, T fragment) {
|
||||
}
|
||||
|
||||
T getShadowRootFromHost(T host, T template, String shadowRootMode, boolean shadowRootDelegatesFocus) {
|
||||
return null;
|
||||
}
|
||||
|
||||
T getFormPointerForContext(T context) {
|
||||
return null;
|
||||
}
|
||||
@ -5540,7 +5509,6 @@ public abstract class TreeBuilder<T> implements TokenHandler,
|
||||
} else {
|
||||
T currentNode = nodeFromStackWithBlinkCompat(currentPtr);
|
||||
elt = createElement("http://www.w3.org/1999/xhtml", name,
|
||||
|
||||
attributes, formOwner, currentNode
|
||||
// CPPONLY: , htmlCreator(elementName.getHtmlCreator())
|
||||
);
|
||||
@ -5925,14 +5893,6 @@ public abstract class TreeBuilder<T> implements TokenHandler,
|
||||
this.setForceNoQuirks(isSrcdocDocument);
|
||||
}
|
||||
|
||||
public boolean isAllowDeclarativeShadowRoots() {
|
||||
return allowDeclarativeShadowRoots;
|
||||
}
|
||||
|
||||
public void setAllowDeclarativeShadowRoots(boolean allow) {
|
||||
allowDeclarativeShadowRoots = allow;
|
||||
}
|
||||
|
||||
// [NOCPP[
|
||||
|
||||
public void setNamePolicy(XmlViolationPolicy namePolicy) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -281,12 +281,10 @@ class nsHtml5AttributeName {
|
||||
static nsHtml5AttributeName* ATTR_LOADING;
|
||||
static nsHtml5AttributeName* ATTR_READONLY;
|
||||
static nsHtml5AttributeName* ATTR_RENDERING_INTENT;
|
||||
static nsHtml5AttributeName* ATTR_SHADOWROOTMODE;
|
||||
static nsHtml5AttributeName* ATTR_SEED;
|
||||
static nsHtml5AttributeName* ATTR_SRCDOC;
|
||||
static nsHtml5AttributeName* ATTR_STDDEVIATION;
|
||||
static nsHtml5AttributeName* ATTR_SANDBOX;
|
||||
static nsHtml5AttributeName* ATTR_SHADOWROOTDELEGATESFOCUS;
|
||||
static nsHtml5AttributeName* ATTR_WORD_SPACING;
|
||||
static nsHtml5AttributeName* ATTR_ACCENTUNDER;
|
||||
static nsHtml5AttributeName* ATTR_ACCEPT_CHARSET;
|
||||
|
@ -678,8 +678,6 @@ void nsHtml5Parser::StartTokenizer(bool aScriptingEnabled) {
|
||||
|
||||
mTreeBuilder->SetPreventScriptExecution(!aScriptingEnabled);
|
||||
mTreeBuilder->setScriptingEnabled(aScriptingEnabled);
|
||||
mTreeBuilder->setAllowDeclarativeShadowRoots(
|
||||
mExecutor->GetDocument()->AllowsDeclarativeShadowRoots());
|
||||
mTokenizer->start();
|
||||
}
|
||||
|
||||
|
@ -1125,8 +1125,6 @@ nsresult nsHtml5StreamParser::OnStartRequest(nsIRequest* aRequest) {
|
||||
mTreeBuilder->setScriptingEnabled(scriptingEnabled);
|
||||
mTreeBuilder->SetPreventScriptExecution(
|
||||
!((mMode == NORMAL) && scriptingEnabled));
|
||||
mTreeBuilder->setAllowDeclarativeShadowRoots(
|
||||
mExecutor->GetDocument()->AllowsDeclarativeShadowRoots());
|
||||
mTokenizer->start();
|
||||
mExecutor->Start();
|
||||
mExecutor->StartReadingFromStage();
|
||||
|
@ -24,10 +24,12 @@ nsHtml5StringParser::nsHtml5StringParser()
|
||||
|
||||
nsHtml5StringParser::~nsHtml5StringParser() {}
|
||||
|
||||
nsresult nsHtml5StringParser::ParseFragment(
|
||||
const nsAString& aSourceBuffer, nsIContent* aTargetNode,
|
||||
nsAtom* aContextLocalName, int32_t aContextNamespace, bool aQuirks,
|
||||
bool aPreventScriptExecution, bool aAllowDeclarativeShadowRoots) {
|
||||
nsresult nsHtml5StringParser::ParseFragment(const nsAString& aSourceBuffer,
|
||||
nsIContent* aTargetNode,
|
||||
nsAtom* aContextLocalName,
|
||||
int32_t aContextNamespace,
|
||||
bool aQuirks,
|
||||
bool aPreventScriptExecution) {
|
||||
NS_ENSURE_TRUE(aSourceBuffer.Length() <= INT32_MAX, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
Document* doc = aTargetNode->OwnerDoc();
|
||||
@ -50,7 +52,7 @@ nsresult nsHtml5StringParser::ParseFragment(
|
||||
|
||||
mTreeBuilder->SetPreventScriptExecution(aPreventScriptExecution);
|
||||
|
||||
return Tokenize(aSourceBuffer, doc, true, aAllowDeclarativeShadowRoots);
|
||||
return Tokenize(aSourceBuffer, doc, true);
|
||||
}
|
||||
|
||||
nsresult nsHtml5StringParser::ParseDocument(
|
||||
@ -65,14 +67,12 @@ nsresult nsHtml5StringParser::ParseDocument(
|
||||
mTreeBuilder->SetPreventScriptExecution(true);
|
||||
|
||||
return Tokenize(aSourceBuffer, aTargetDoc,
|
||||
aScriptingEnabledForNoscriptParsing,
|
||||
aTargetDoc->AllowsDeclarativeShadowRoots());
|
||||
aScriptingEnabledForNoscriptParsing);
|
||||
}
|
||||
|
||||
nsresult nsHtml5StringParser::Tokenize(const nsAString& aSourceBuffer,
|
||||
Document* aDocument,
|
||||
bool aScriptingEnabledForNoscriptParsing,
|
||||
bool aDeclarativeShadowRootsAllowed) {
|
||||
nsresult nsHtml5StringParser::Tokenize(
|
||||
const nsAString& aSourceBuffer, Document* aDocument,
|
||||
bool aScriptingEnabledForNoscriptParsing) {
|
||||
nsIURI* uri = aDocument->GetDocumentURI();
|
||||
|
||||
mBuilder->Init(aDocument, uri, nullptr, nullptr);
|
||||
@ -85,7 +85,6 @@ nsresult nsHtml5StringParser::Tokenize(const nsAString& aSourceBuffer,
|
||||
|
||||
mTreeBuilder->setScriptingEnabled(aScriptingEnabledForNoscriptParsing);
|
||||
mTreeBuilder->setIsSrcdocDocument(aDocument->IsSrcdocDocument());
|
||||
mTreeBuilder->setAllowDeclarativeShadowRoots(aDeclarativeShadowRootsAllowed);
|
||||
mBuilder->Start();
|
||||
mTokenizer->start();
|
||||
if (!aSourceBuffer.IsEmpty()) {
|
||||
|
@ -41,14 +41,11 @@ class nsHtml5StringParser : public nsParserBase {
|
||||
* @param aPreventScriptExecution true to prevent scripts from executing;
|
||||
* don't set to false when parsing into a target node that has been bound
|
||||
* to tree.
|
||||
* @param aAllowDeclarativeShadowRoots allow the creation of declarative
|
||||
* shadow roots.
|
||||
*/
|
||||
nsresult ParseFragment(const nsAString& aSourceBuffer,
|
||||
nsIContent* aTargetNode, nsAtom* aContextLocalName,
|
||||
int32_t aContextNamespace, bool aQuirks,
|
||||
bool aPreventScriptExecution,
|
||||
bool aAllowDeclarativeShadowRoots);
|
||||
bool aPreventScriptExecution);
|
||||
|
||||
/**
|
||||
* Parse an entire HTML document from a source string.
|
||||
@ -64,8 +61,7 @@ class nsHtml5StringParser : public nsParserBase {
|
||||
|
||||
nsresult Tokenize(const nsAString& aSourceBuffer,
|
||||
mozilla::dom::Document* aDocument,
|
||||
bool aScriptingEnabledForNoscriptParsing,
|
||||
bool aDeclarativeShadowRootsAllowed);
|
||||
bool aScriptingEnabledForNoscriptParsing);
|
||||
|
||||
/**
|
||||
* The tree operation executor
|
||||
|
@ -2093,23 +2093,6 @@ bool nsHtml5TreeBuilder::isSpecialParentInForeign(nsHtml5StackNode* stackNode) {
|
||||
(stackNode->getGroup() == MI_MO_MN_MS_MTEXT));
|
||||
}
|
||||
|
||||
nsIContentHandle* nsHtml5TreeBuilder::getDeclarativeShadowRoot(
|
||||
nsIContentHandle* currentNode, nsIContentHandle* templateNode,
|
||||
nsHtml5HtmlAttributes* attributes) {
|
||||
if (!isAllowDeclarativeShadowRoots()) {
|
||||
return nullptr;
|
||||
}
|
||||
nsHtml5String shadowRootMode =
|
||||
attributes->getValue(nsHtml5AttributeName::ATTR_SHADOWROOTMODE);
|
||||
if (!shadowRootMode) {
|
||||
return nullptr;
|
||||
}
|
||||
bool shadowRootDelegatesFocus =
|
||||
attributes->contains(nsHtml5AttributeName::ATTR_SHADOWROOTDELEGATESFOCUS);
|
||||
return getShadowRootFromHost(currentNode, templateNode, shadowRootMode,
|
||||
shadowRootDelegatesFocus);
|
||||
}
|
||||
|
||||
nsHtml5String nsHtml5TreeBuilder::extractCharsetFromContent(
|
||||
nsHtml5String attributeValue, nsHtml5TreeBuilder* tb) {
|
||||
int32_t charsetState = CHARSET_INITIAL;
|
||||
@ -4235,18 +4218,9 @@ void nsHtml5TreeBuilder::appendToCurrentNodeAndPushElement(
|
||||
nsIContentHandle* elt =
|
||||
createElement(kNameSpaceID_XHTML, elementName->getName(), attributes,
|
||||
currentNode, htmlCreator(elementName->getHtmlCreator()));
|
||||
appendElement(elt, currentNode);
|
||||
if (nsHtml5ElementName::ELT_TEMPLATE == elementName) {
|
||||
nsIContentHandle* root =
|
||||
getDeclarativeShadowRoot(currentNode, elt, attributes);
|
||||
if (root) {
|
||||
setDocumentFragmentForTemplate(elt, root);
|
||||
elt = root;
|
||||
} else {
|
||||
appendElement(elt, currentNode);
|
||||
elt = getDocumentFragmentForTemplate(elt);
|
||||
}
|
||||
} else {
|
||||
appendElement(elt, currentNode);
|
||||
elt = getDocumentFragmentForTemplate(elt);
|
||||
}
|
||||
nsHtml5StackNode* node = createStackNode(elementName, elt);
|
||||
push(node);
|
||||
@ -4508,14 +4482,6 @@ void nsHtml5TreeBuilder::setIsSrcdocDocument(bool isSrcdocDocument) {
|
||||
this->setForceNoQuirks(isSrcdocDocument);
|
||||
}
|
||||
|
||||
bool nsHtml5TreeBuilder::isAllowDeclarativeShadowRoots() {
|
||||
return allowDeclarativeShadowRoots;
|
||||
}
|
||||
|
||||
void nsHtml5TreeBuilder::setAllowDeclarativeShadowRoots(bool allow) {
|
||||
allowDeclarativeShadowRoots = allow;
|
||||
}
|
||||
|
||||
void nsHtml5TreeBuilder::flushCharacters() {
|
||||
if (charBufferLen > 0) {
|
||||
if ((mode == IN_TABLE || mode == IN_TABLE_BODY || mode == IN_ROW) &&
|
||||
|
@ -314,7 +314,6 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState {
|
||||
private:
|
||||
bool quirks;
|
||||
bool forceNoQuirks;
|
||||
bool allowDeclarativeShadowRoots;
|
||||
inline nsHtml5ContentCreatorFunction htmlCreator(
|
||||
mozilla::dom::HTMLContentCreatorFunction htmlCreator) {
|
||||
nsHtml5ContentCreatorFunction creator;
|
||||
@ -354,9 +353,6 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState {
|
||||
bool isTemplateContents();
|
||||
bool isTemplateModeStackEmpty();
|
||||
bool isSpecialParentInForeign(nsHtml5StackNode* stackNode);
|
||||
nsIContentHandle* getDeclarativeShadowRoot(nsIContentHandle* currentNode,
|
||||
nsIContentHandle* templateNode,
|
||||
nsHtml5HtmlAttributes* attributes);
|
||||
|
||||
public:
|
||||
static nsHtml5String extractCharsetFromContent(nsHtml5String attributeValue,
|
||||
@ -560,8 +556,6 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState {
|
||||
void setScriptingEnabled(bool scriptingEnabled);
|
||||
void setForceNoQuirks(bool forceNoQuirks);
|
||||
void setIsSrcdocDocument(bool isSrcdocDocument);
|
||||
bool isAllowDeclarativeShadowRoots();
|
||||
void setAllowDeclarativeShadowRoots(bool allow);
|
||||
void flushCharacters();
|
||||
|
||||
private:
|
||||
|
@ -7,12 +7,9 @@
|
||||
#include "ErrorList.h"
|
||||
#include "nsError.h"
|
||||
#include "nsHtml5AttributeName.h"
|
||||
#include "nsHtml5HtmlAttributes.h"
|
||||
#include "nsHtml5String.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "mozilla/dom/FetchPriority.h"
|
||||
#include "mozilla/dom/ShadowRoot.h"
|
||||
#include "mozilla/dom/ShadowRootBinding.h"
|
||||
#include "mozilla/CheckedInt.h"
|
||||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/StaticPrefs_dom.h"
|
||||
@ -41,7 +38,6 @@ nsHtml5TreeBuilder::nsHtml5TreeBuilder(nsHtml5OplessBuilder* aBuilder)
|
||||
charBufferLen(0),
|
||||
quirks(false),
|
||||
forceNoQuirks(false),
|
||||
allowDeclarativeShadowRoots(false),
|
||||
mBuilder(aBuilder),
|
||||
mViewSource(nullptr),
|
||||
mOpSink(nullptr),
|
||||
@ -1640,53 +1636,6 @@ nsIContentHandle* nsHtml5TreeBuilder::getDocumentFragmentForTemplate(
|
||||
return fragHandle;
|
||||
}
|
||||
|
||||
void nsHtml5TreeBuilder::setDocumentFragmentForTemplate(
|
||||
nsIContentHandle* aTemplate, nsIContentHandle* aFragment) {
|
||||
if (mBuilder) {
|
||||
nsHtml5TreeOperation::SetDocumentFragmentForTemplate(
|
||||
static_cast<nsIContent*>(aTemplate),
|
||||
static_cast<nsIContent*>(aFragment));
|
||||
return;
|
||||
}
|
||||
|
||||
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement(mozilla::fallible);
|
||||
if (MOZ_UNLIKELY(!treeOp)) {
|
||||
MarkAsBrokenAndRequestSuspensionWithoutBuilder(NS_ERROR_OUT_OF_MEMORY);
|
||||
return;
|
||||
}
|
||||
opSetDocumentFragmentForTemplate operation(aTemplate, aFragment);
|
||||
treeOp->Init(mozilla::AsVariant(operation));
|
||||
}
|
||||
|
||||
nsIContentHandle* nsHtml5TreeBuilder::getShadowRootFromHost(
|
||||
nsIContentHandle* aHost, nsIContentHandle* aTemplateNode,
|
||||
nsHtml5String aShadowRootMode, bool aShadowRootDelegatesFocus) {
|
||||
mozilla::dom::ShadowRootMode mode;
|
||||
if (aShadowRootMode.LowerCaseEqualsASCII("open")) {
|
||||
mode = mozilla::dom::ShadowRootMode::Open;
|
||||
} else if (aShadowRootMode.LowerCaseEqualsASCII("closed")) {
|
||||
mode = mozilla::dom::ShadowRootMode::Closed;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (mBuilder) {
|
||||
return nsContentUtils::AttachDeclarativeShadowRoot(
|
||||
static_cast<nsIContent*>(aHost), mode, aShadowRootDelegatesFocus);
|
||||
}
|
||||
|
||||
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement(mozilla::fallible);
|
||||
if (MOZ_UNLIKELY(!treeOp)) {
|
||||
MarkAsBrokenAndRequestSuspensionWithoutBuilder(NS_ERROR_OUT_OF_MEMORY);
|
||||
return nullptr;
|
||||
}
|
||||
nsIContentHandle* fragHandle = AllocateContentHandle();
|
||||
opGetShadowRootFromHost operation(aHost, fragHandle, aTemplateNode, mode,
|
||||
aShadowRootDelegatesFocus);
|
||||
treeOp->Init(mozilla::AsVariant(operation));
|
||||
return fragHandle;
|
||||
}
|
||||
|
||||
nsIContentHandle* nsHtml5TreeBuilder::getFormPointerForContext(
|
||||
nsIContentHandle* aContext) {
|
||||
MOZ_ASSERT(mBuilder, "Must have builder.");
|
||||
|
@ -58,13 +58,6 @@ bool mActive;
|
||||
void documentMode(nsHtml5DocumentMode m);
|
||||
|
||||
nsIContentHandle* getDocumentFragmentForTemplate(nsIContentHandle* aTemplate);
|
||||
void setDocumentFragmentForTemplate(nsIContentHandle* aTemplate,
|
||||
nsIContentHandle* aFragment);
|
||||
|
||||
nsIContentHandle* getShadowRootFromHost(nsIContentHandle* aHost,
|
||||
nsIContentHandle* aTemplateNode,
|
||||
nsHtml5String aShadowRootMode,
|
||||
bool aShadowRootDelegatesFocus);
|
||||
|
||||
nsIContentHandle* getFormPointerForContext(nsIContentHandle* aContext);
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "mozilla/dom/Comment.h"
|
||||
#include "mozilla/dom/CustomElementRegistry.h"
|
||||
#include "mozilla/dom/DocGroup.h"
|
||||
#include "mozilla/dom/DocumentFragment.h"
|
||||
#include "mozilla/dom/DocumentType.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/LinkStyle.h"
|
||||
@ -19,14 +18,12 @@
|
||||
#include "mozilla/dom/HTMLImageElement.h"
|
||||
#include "mozilla/dom/HTMLTemplateElement.h"
|
||||
#include "mozilla/dom/MutationObservers.h"
|
||||
#include "mozilla/dom/ShadowRoot.h"
|
||||
#include "mozilla/dom/Text.h"
|
||||
#include "nsAttrName.h"
|
||||
#include "nsContentCreatorFunctions.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsDocElementCreatedNotificationRunner.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHtml5AutoPauseUpdate.h"
|
||||
#include "nsHtml5DocumentMode.h"
|
||||
#include "nsHtml5HtmlAttributes.h"
|
||||
@ -138,10 +135,6 @@ nsHtml5TreeOperation::~nsHtml5TreeOperation() {
|
||||
|
||||
void operator()(const opGetDocumentFragmentForTemplate& aOperation) {}
|
||||
|
||||
void operator()(const opSetDocumentFragmentForTemplate& aOperation) {}
|
||||
|
||||
void operator()(const opGetShadowRootFromHost& aOperation) {}
|
||||
|
||||
void operator()(const opGetFosterParent& aOperation) {}
|
||||
|
||||
void operator()(const opMarkAsBroken& aOperation) {}
|
||||
@ -701,12 +694,6 @@ nsIContent* nsHtml5TreeOperation::GetDocumentFragmentForTemplate(
|
||||
return tempElem->Content();
|
||||
}
|
||||
|
||||
void nsHtml5TreeOperation::SetDocumentFragmentForTemplate(
|
||||
nsIContent* aNode, nsIContent* aDocumentFragment) {
|
||||
auto* tempElem = static_cast<HTMLTemplateElement*>(aNode);
|
||||
tempElem->SetContent(static_cast<DocumentFragment*>(aDocumentFragment));
|
||||
}
|
||||
|
||||
nsIContent* nsHtml5TreeOperation::GetFosterParent(nsIContent* aTable,
|
||||
nsIContent* aStackParent) {
|
||||
nsIContent* tableParent = aTable->GetParent();
|
||||
@ -907,31 +894,6 @@ nsresult nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult operator()(const opSetDocumentFragmentForTemplate& aOperation) {
|
||||
SetDocumentFragmentForTemplate(*aOperation.mTemplate,
|
||||
*aOperation.mFragment);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult operator()(const opGetShadowRootFromHost& aOperation) {
|
||||
nsIContent* root = nsContentUtils::AttachDeclarativeShadowRoot(
|
||||
*aOperation.mHost, aOperation.mShadowRootMode,
|
||||
aOperation.mShadowRootDelegatesFocus);
|
||||
if (root) {
|
||||
*aOperation.mFragHandle = root;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// We failed to attach a new shadow root, so instead attach a template
|
||||
// element and return its content.
|
||||
nsHtml5TreeOperation::Append(*aOperation.mTemplateNode, *aOperation.mHost,
|
||||
mBuilder);
|
||||
*aOperation.mFragHandle =
|
||||
static_cast<HTMLTemplateElement*>(*aOperation.mTemplateNode)
|
||||
->Content();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult operator()(const opGetFosterParent& aOperation) {
|
||||
nsIContent* table = *(aOperation.mTable);
|
||||
nsIContent* stackParent = *(aOperation.mStackParent);
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "nsHtml5DocumentMode.h"
|
||||
#include "nsHtml5HtmlAttributes.h"
|
||||
#include "mozilla/dom/FromParser.h"
|
||||
#include "mozilla/dom/ShadowRootBinding.h"
|
||||
#include "mozilla/NotNull.h"
|
||||
#include "mozilla/Variant.h"
|
||||
#include "nsCharsetSource.h"
|
||||
@ -265,37 +264,6 @@ struct opGetDocumentFragmentForTemplate {
|
||||
}
|
||||
};
|
||||
|
||||
struct opSetDocumentFragmentForTemplate {
|
||||
nsIContent** mTemplate;
|
||||
nsIContent** mFragment;
|
||||
|
||||
explicit opSetDocumentFragmentForTemplate(nsIContentHandle* aTemplate,
|
||||
nsIContentHandle* aFragment) {
|
||||
mTemplate = static_cast<nsIContent**>(aTemplate);
|
||||
mFragment = static_cast<nsIContent**>(aFragment);
|
||||
}
|
||||
};
|
||||
|
||||
struct opGetShadowRootFromHost {
|
||||
nsIContent** mHost;
|
||||
nsIContent** mFragHandle;
|
||||
nsIContent** mTemplateNode;
|
||||
mozilla::dom::ShadowRootMode mShadowRootMode;
|
||||
bool mShadowRootDelegatesFocus;
|
||||
|
||||
explicit opGetShadowRootFromHost(nsIContentHandle* aHost,
|
||||
nsIContentHandle* aFragHandle,
|
||||
nsIContentHandle* aTemplateNode,
|
||||
mozilla::dom::ShadowRootMode aShadowRootMode,
|
||||
bool aShadowRootDelegatesFocus) {
|
||||
mHost = static_cast<nsIContent**>(aHost);
|
||||
mFragHandle = static_cast<nsIContent**>(aFragHandle);
|
||||
mTemplateNode = static_cast<nsIContent**>(aTemplateNode);
|
||||
mShadowRootMode = aShadowRootMode;
|
||||
mShadowRootDelegatesFocus = aShadowRootDelegatesFocus;
|
||||
}
|
||||
};
|
||||
|
||||
struct opGetFosterParent {
|
||||
nsIContent** mTable;
|
||||
nsIContent** mStackParent;
|
||||
@ -524,8 +492,7 @@ typedef mozilla::Variant<
|
||||
opCreateHTMLElement, opCreateSVGElement, opCreateMathMLElement,
|
||||
opSetFormElement, opAppendText, opFosterParentText, opAppendComment,
|
||||
opAppendCommentToDocument, opAppendDoctypeToDocument,
|
||||
opGetDocumentFragmentForTemplate, opSetDocumentFragmentForTemplate,
|
||||
opGetShadowRootFromHost, opGetFosterParent,
|
||||
opGetDocumentFragmentForTemplate, opGetFosterParent,
|
||||
// Gecko-specific on-pop ops
|
||||
opMarkAsBroken, opRunScriptThatMayDocumentWriteOrBlock,
|
||||
opRunScriptThatCannotDocumentWriteOrBlock, opPreventScriptExecution,
|
||||
@ -620,8 +587,6 @@ class nsHtml5TreeOperation final {
|
||||
nsHtml5DocumentBuilder* aBuilder);
|
||||
|
||||
static nsIContent* GetDocumentFragmentForTemplate(nsIContent* aNode);
|
||||
static void SetDocumentFragmentForTemplate(nsIContent* aNode,
|
||||
nsIContent* aDocumentFragment);
|
||||
|
||||
static nsIContent* GetFosterParent(nsIContent* aTable,
|
||||
nsIContent* aStackParent);
|
||||
|
@ -0,0 +1,2 @@
|
||||
[part-pseudo.html]
|
||||
expected: FAIL
|
@ -579,6 +579,12 @@ prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featu
|
||||
[PopStateEvent interface: new PopStateEvent("popstate", { data: {} }) must inherit property "hasUAVisualTransition" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[Element interface: document.createElement("noscript") must inherit property "setHTMLUnsafe(DOMString)" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[Element interface: calling setHTMLUnsafe(DOMString) on document.createElement("noscript") with too few arguments must throw TypeError]
|
||||
expected: FAIL
|
||||
|
||||
[CloseWatcher interface: existence and properties of interface object]
|
||||
expected: FAIL
|
||||
|
||||
@ -612,6 +618,12 @@ prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featu
|
||||
[CloseWatcher interface: attribute onclose]
|
||||
expected: FAIL
|
||||
|
||||
[ShadowRoot interface: operation setHTMLUnsafe(DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[Element interface: operation setHTMLUnsafe(DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[idlharness.https.html?include=(Document|Window)]
|
||||
[Window interface: window must inherit property "originAgentCluster" with the proper type]
|
||||
@ -683,9 +695,18 @@ prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featu
|
||||
[Window interface: attribute clientInformation]
|
||||
expected: FAIL
|
||||
|
||||
[Document interface: operation parseHTMLUnsafe(DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[Document interface: calling parseHTMLUnsafe(DOMString) on iframe.contentDocument with too few arguments must throw TypeError]
|
||||
expected: FAIL
|
||||
|
||||
[Document interface: calling parseHTMLUnsafe(DOMString) on new Document() with too few arguments must throw TypeError]
|
||||
expected: FAIL
|
||||
|
||||
[Document interface: calling parseHTMLUnsafe(DOMString) on documentWithHandlers with too few arguments must throw TypeError]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[idlharness.https.html?include=HTML.*]
|
||||
[HTMLVideoElement interface: attribute playsInline]
|
||||
@ -792,3 +813,15 @@ prefs: [dom.security.featurePolicy.experimental.enabled:true, dom.security.featu
|
||||
|
||||
[HTMLDetailsElement interface: document.createElement("details") must inherit property "name" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLTemplateElement interface: attribute shadowRootMode]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLTemplateElement interface: attribute shadowRootDelegatesFocus]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLTemplateElement interface: document.createElement("template") must inherit property "shadowRootMode" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLTemplateElement interface: document.createElement("template") must inherit property "shadowRootDelegatesFocus" with the proper type]
|
||||
expected: FAIL
|
||||
|
@ -1,2 +1,3 @@
|
||||
[Element-setHTMLUnsafe-04.tentative.html]
|
||||
prefs: [dom.webcomponents.shadowdom.declarative.enabled:true]
|
||||
[Element-setHTMLUnsafe-04.html]
|
||||
[setHTMLUnsafe should leave the removed children alone.]
|
||||
expected: FAIL
|
||||
|
@ -1,3 +1,6 @@
|
||||
[setHTMLUnsafe-xml.html]
|
||||
[setHTMLUnsafe should still parse HTML even in XML documents.]
|
||||
expected: FAIL
|
||||
|
||||
[setHTMLUnsafe should still parse HTML even in SVG documents.]
|
||||
expected: FAIL
|
||||
|
@ -1,2 +1,15 @@
|
||||
[setHTMLUnsafe.tentative.html]
|
||||
prefs: [dom.webcomponents.shadowdom.declarative.enabled:true]
|
||||
[setHTMLUnsafe.html]
|
||||
[Element: setHTMLUnsafe with no shadowdom.]
|
||||
expected: FAIL
|
||||
|
||||
[Element: setHTMLUnsafe with shadowdom.]
|
||||
expected: FAIL
|
||||
|
||||
[ShadowRoot: setHTMLUnsafe with no shadowdom.]
|
||||
expected: FAIL
|
||||
|
||||
[ShadowRoot: setHTMLUnsafe with shadowdom.]
|
||||
expected: FAIL
|
||||
|
||||
[template.setHTMLUnsafe() should modify template content fragment rather than actual children.]
|
||||
expected: FAIL
|
||||
|
@ -1 +0,0 @@
|
||||
prefs: [dom.webcomponents.shadowdom.declarative.enabled:true]
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,42 @@
|
||||
[declarative-shadow-dom-basic.html]
|
||||
[Declarative Shadow DOM: Basic test]
|
||||
expected: FAIL
|
||||
|
||||
[Declarative Shadow DOM: Feature detection]
|
||||
expected: FAIL
|
||||
|
||||
[Shadowrootmode reflection]
|
||||
expected: FAIL
|
||||
|
||||
[Declarative Shadow DOM: Fragment parser basic test]
|
||||
expected: FAIL
|
||||
|
||||
[Declarative Shadow DOM: Invalid shadow root attribute]
|
||||
expected: FAIL
|
||||
|
||||
[Declarative Shadow DOM: Closed shadow root attribute]
|
||||
expected: FAIL
|
||||
|
||||
[Declarative Shadow DOM: Missing closing tag]
|
||||
expected: FAIL
|
||||
|
||||
[Declarative Shadow DOM: delegates focus attribute]
|
||||
expected: FAIL
|
||||
|
||||
[Declarative Shadow DOM: Multiple roots]
|
||||
expected: FAIL
|
||||
|
||||
[Declarative Shadow DOM: template containing declarative shadow root]
|
||||
expected: FAIL
|
||||
|
||||
[Declarative Shadow DOM: template containing (deeply nested) declarative shadow root]
|
||||
expected: FAIL
|
||||
|
||||
[Declarative Shadow DOM: template containing a template containing declarative shadow root]
|
||||
expected: FAIL
|
||||
|
||||
[Declarative Shadow DOM: template containing declarative shadow root and UA shadow root]
|
||||
expected: FAIL
|
||||
|
||||
[Shadowrootmode reflection, setter]
|
||||
expected: FAIL
|
@ -1,5 +1,18 @@
|
||||
[declarative-shadow-dom-opt-in.html]
|
||||
prefs: [dom.webcomponents.shadowdom.declarative.enabled:true]
|
||||
[document.write disallowed on fresh document]
|
||||
expected:
|
||||
[PASS, FAIL]
|
||||
[Non-fragment parsing needs no opt-in]
|
||||
expected: FAIL
|
||||
|
||||
[document.write allowed from synchronous script loaded from main document]
|
||||
expected: FAIL
|
||||
|
||||
[iframe]
|
||||
expected: FAIL
|
||||
|
||||
[iframe, no sandbox]
|
||||
expected: FAIL
|
||||
|
||||
[sandboxed iframe allows declarative Shadow DOM]
|
||||
expected: FAIL
|
||||
|
||||
[iframe with no sandbox allows declarative Shadow DOM]
|
||||
expected: FAIL
|
||||
|
@ -0,0 +1,2 @@
|
||||
[innerhtml-before-closing-tag.html]
|
||||
expected: ERROR
|
@ -0,0 +1,6 @@
|
||||
[move-template-before-closing-tag.html]
|
||||
[Moving the template node during parsing should attach to initial parent (content before observer)]
|
||||
expected: FAIL
|
||||
|
||||
[Moving the template node during parsing should attach to initial parent (content after observer)]
|
||||
expected: FAIL
|
@ -0,0 +1,2 @@
|
||||
[script-access.html]
|
||||
expected: ERROR
|
@ -39,12 +39,8 @@ HTML_PARSER_ATOMS = [
|
||||
# ATOM GENERATED BY HTML PARSER TRANSLATOR (WILL BE AUTOMATICALLY OVERWRITTEN):
|
||||
Atom("rendering_intent", "rendering-intent"),
|
||||
# ATOM GENERATED BY HTML PARSER TRANSLATOR (WILL BE AUTOMATICALLY OVERWRITTEN):
|
||||
Atom("shadowrootmode", "shadowrootmode"),
|
||||
# ATOM GENERATED BY HTML PARSER TRANSLATOR (WILL BE AUTOMATICALLY OVERWRITTEN):
|
||||
Atom("stddeviation", "stddeviation"),
|
||||
# ATOM GENERATED BY HTML PARSER TRANSLATOR (WILL BE AUTOMATICALLY OVERWRITTEN):
|
||||
Atom("shadowrootdelegatesfocus", "shadowrootdelegatesfocus"),
|
||||
# ATOM GENERATED BY HTML PARSER TRANSLATOR (WILL BE AUTOMATICALLY OVERWRITTEN):
|
||||
Atom("basefrequency", "basefrequency"),
|
||||
# ATOM GENERATED BY HTML PARSER TRANSLATOR (WILL BE AUTOMATICALLY OVERWRITTEN):
|
||||
Atom("baseprofile", "baseprofile"),
|
||||
|
Loading…
Reference in New Issue
Block a user