mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
Issue #2135 - Bug 1066965: Make contentEditable and spellchecking to work in Shadow DOM
This commit is contained in:
parent
b2c77e5eda
commit
010db07bf3
10 changed files with 60 additions and 30 deletions
|
|
@ -1725,10 +1725,11 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|||
if (!hadParent) {
|
||||
uint32_t editableDescendantChange = EditableInclusiveDescendantCount(this);
|
||||
if (editableDescendantChange != 0) {
|
||||
// If we are binding a subtree root to the document, we need to update
|
||||
// the editable descendant count of all the ancestors.
|
||||
// If we are binding a subtree root to the document, we need to update
|
||||
// the editable descendant count of all the ancestors. However, we don't
|
||||
// cross the Shadow DOM boundary (expected behavior is unclear).
|
||||
nsIContent* parent = GetParent();
|
||||
while (parent) {
|
||||
while (parent && parent->IsElement()) {
|
||||
parent->ChangeEditableDescendantCount(editableDescendantChange);
|
||||
parent = parent->GetParent();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,6 +273,18 @@ nsINode* nsINode::GetRootNode(const GetRootNodeOptions& aOptions)
|
|||
return SubtreeRoot();
|
||||
}
|
||||
|
||||
// TODO: was marked as constant.
|
||||
nsINode*
|
||||
nsINode::GetParentOrHostNode()
|
||||
{
|
||||
if (mParent) {
|
||||
return mParent;
|
||||
}
|
||||
|
||||
ShadowRoot* shadowRoot = ShadowRoot::FromNode(this);
|
||||
return shadowRoot ? shadowRoot->GetHost() : nullptr;
|
||||
}
|
||||
|
||||
nsINode*
|
||||
nsINode::SubtreeRoot() const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -942,6 +942,12 @@ public:
|
|||
return mParent;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is similar to above, but in case 'this' is ShadowRoot, we return its
|
||||
* host element.
|
||||
*/
|
||||
nsINode* GetParentOrHostNode();
|
||||
|
||||
/**
|
||||
* Returns the node that is the parent of this node in the flattened
|
||||
* tree. This differs from the normal parent if the node is filtered
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue