зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1484474 - Make the ua widget flag in ShadowRoot write-only. r=smaug
Letting people set it back to false would be bad. Differential Revision: https://phabricator.services.mozilla.com/D3714 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
0e51fb2cce
Коммит
69f98d5c58
|
@ -120,12 +120,6 @@ ShadowRoot::SetIsComposedDocParticipant(bool aIsComposedDocParticipant)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
ShadowRoot::SetIsUAWidget(bool aIsUAWidget)
|
||||
{
|
||||
mIsUAWidget = aIsUAWidget;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
ShadowRoot::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
|
@ -563,7 +557,6 @@ ShadowRoot::ImportNodeAndAppendChildAt(nsINode& aParentNode,
|
|||
mozilla::ErrorResult& rv)
|
||||
{
|
||||
MOZ_ASSERT(mIsUAWidget);
|
||||
MOZ_ASSERT(OwnerDoc());
|
||||
|
||||
if (!aParentNode.IsInUAWidget()) {
|
||||
rv.Throw(NS_ERROR_INVALID_ARG);
|
||||
|
|
|
@ -197,7 +197,10 @@ public:
|
|||
return mIsUAWidget;
|
||||
}
|
||||
|
||||
void SetIsUAWidget(bool aIsUAWidget);
|
||||
void SetIsUAWidget()
|
||||
{
|
||||
mIsUAWidget = true;
|
||||
}
|
||||
|
||||
void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -47,7 +47,7 @@ interface ShadowRoot : DocumentFragment
|
|||
|
||||
// For triggering UA Widget scope in tests.
|
||||
[ChromeOnly]
|
||||
void setIsUAWidget(boolean isUAWidget);
|
||||
void setIsUAWidget();
|
||||
};
|
||||
|
||||
ShadowRoot implements DocumentOrShadowRoot;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче