Bug 1431255 - Part V, Set the reflectors of the UA Widget DOM to UA Widget Scope r=bholley
The DOM elements within the UA Widget Shadow DOM should have its reflectors in the UA Widget Scope. This is done by calling nsINode::IsInUAWidget() which would check its containing shadow and its UA Widget bit. To prevent JS access of the DOM element before it is in the UA Widget Shadom DOM tree, various DOM methods are set to inaccessible to UA Widget script. It would need to use the two special methods in ShadowRoot instead to insert the DOM directly into the shadow tree. MozReview-Commit-ID: Jz9iCaVIoij
This commit is contained in:
@@ -4942,11 +4942,14 @@ void
|
||||
HTMLMediaElement::AttachAndSetUAShadowRoot()
|
||||
{
|
||||
if (GetShadowRoot()) {
|
||||
MOZ_ASSERT(GetShadowRoot()->IsUAWidget());
|
||||
return;
|
||||
}
|
||||
|
||||
// Add a closed shadow root to host video controls
|
||||
AttachShadowWithoutNameChecks(ShadowRootMode::Closed);
|
||||
RefPtr<ShadowRoot> shadowRoot =
|
||||
AttachShadowWithoutNameChecks(ShadowRootMode::Closed);
|
||||
shadowRoot->SetIsUAWidget(true);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
||||
Reference in New Issue
Block a user