mirror of
https://github.com/roytam1/basilisk55.git
synced 2026-05-26 15:02:46 +00:00
import from UXP: Issue #2135 - Bug 1066965: Make contentEditable and spellchecking to work in Shadow DOM (010db07b)
This commit is contained in:
@@ -382,13 +382,14 @@ HTMLEditor::FindSelectionRoot(nsINode* aNode)
|
||||
aNode->IsNodeOfType(nsINode::eCONTENT),
|
||||
"aNode must be content or document node");
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = aNode->GetUncomposedDoc();
|
||||
nsCOMPtr<nsIDocument> doc = aNode->GetComposedDoc();
|
||||
if (!doc) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> content;
|
||||
if (doc->HasFlag(NODE_IS_EDITABLE) || !aNode->IsContent()) {
|
||||
if (aNode->IsInUncomposedDoc() &&
|
||||
doc->HasFlag(NODE_IS_EDITABLE) || !aNode->IsContent()) {
|
||||
content = doc->GetRootElement();
|
||||
return content.forget();
|
||||
}
|
||||
@@ -5088,7 +5089,11 @@ HTMLEditor::IsAcceptableInputEvent(WidgetGUIEvent* aGUIEvent)
|
||||
return true;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> target = aGUIEvent->GetDOMEventTarget();
|
||||
nsCOMPtr<nsIDOMEventTarget> target = aGUIEvent->GetOriginalDOMEventTarget();
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(target);
|
||||
if (content) {
|
||||
target = content->FindFirstNonChromeOnlyAccessContent();
|
||||
}
|
||||
NS_ENSURE_TRUE(target, false);
|
||||
|
||||
nsCOMPtr<nsIDocument> document = GetDocument();
|
||||
|
||||
Reference in New Issue
Block a user