Bug 1954413 - Get rid of nsINode::GetChromeOnlyAccessSubtreeRootParent() r=smaug
It's an alias of `nsINode::GetClosestNativeAnonymousSubtreeRootParentOrHost()` and oddly it returns `const nsIContent*` rather than `nsIContent*`. Therefore, some callers need to use `const_cast`. Differential Revision: https://phabricator.services.mozilla.com/D241776
This commit is contained in:
@@ -7522,10 +7522,12 @@ Element* HTMLEditor::ComputeEditingHostInternal(
|
||||
}
|
||||
if (Element* focusedElementInWindow = innerWindow->GetFocusedElement()) {
|
||||
if (focusedElementInWindow->ChromeOnlyAccess()) {
|
||||
focusedElementInWindow =
|
||||
Element::FromNodeOrNull(const_cast<nsIContent*>(
|
||||
focusedElementInWindow
|
||||
->GetChromeOnlyAccessSubtreeRootParent()));
|
||||
focusedElementInWindow = Element::FromNodeOrNull(
|
||||
// XXX Should we use
|
||||
// nsIContent::FindFirstNonChromeOnlyAccessContent() instead of
|
||||
// nsINode::GetClosestNativeAnonymousSubtreeRootParentOrHost()?
|
||||
focusedElementInWindow
|
||||
->GetClosestNativeAnonymousSubtreeRootParentOrHost());
|
||||
}
|
||||
if (focusedElementInWindow) {
|
||||
return focusedElementInWindow->IsEditable() ? focusedElementInWindow
|
||||
|
||||
Reference in New Issue
Block a user