mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 872870 - Use GetParentNode() instead of GetParent() in UndoManager. r=ehsan
This commit is contained in:
parent
f5b104f7b9
commit
42b2a4bd05
@ -361,7 +361,7 @@ nsresult
|
||||
UndoContentAppend::RedoTransaction()
|
||||
{
|
||||
for (int32_t i = 0; i < mChildren.Count(); i++) {
|
||||
if (!mChildren[i]->GetParent()) {
|
||||
if (!mChildren[i]->GetParentNode()) {
|
||||
mContent->AppendChildTo(mChildren[i], true);
|
||||
}
|
||||
}
|
||||
@ -373,7 +373,7 @@ nsresult
|
||||
UndoContentAppend::UndoTransaction()
|
||||
{
|
||||
for (int32_t i = mChildren.Count() - 1; i >= 0; i--) {
|
||||
if (mChildren[i]->GetParent() == mContent) {
|
||||
if (mChildren[i]->GetParentNode() == mContent) {
|
||||
ErrorResult error;
|
||||
mContent->RemoveChild(*mChildren[i], error);
|
||||
}
|
||||
@ -428,12 +428,12 @@ UndoContentInsert::RedoTransaction()
|
||||
}
|
||||
|
||||
// Check if node already has parent.
|
||||
if (mChild->GetParent()) {
|
||||
if (mChild->GetParentNode()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Check to see if next sibling has same parent.
|
||||
if (mNextNode && mNextNode->GetParent() != mContent) {
|
||||
if (mNextNode && mNextNode->GetParentNode() != mContent) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -450,12 +450,12 @@ UndoContentInsert::UndoTransaction()
|
||||
}
|
||||
|
||||
// Check if the parent is the same.
|
||||
if (mChild->GetParent() != mContent) {
|
||||
if (mChild->GetParentNode() != mContent) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Check of the parent of the next node is the same.
|
||||
if (mNextNode && mNextNode->GetParent() != mContent) {
|
||||
if (mNextNode && mNextNode->GetParentNode() != mContent) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -521,12 +521,12 @@ UndoContentRemove::UndoTransaction()
|
||||
}
|
||||
|
||||
// Check if child has a parent.
|
||||
if (mChild->GetParent()) {
|
||||
if (mChild->GetParentNode()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Make sure next sibling is still under same parent.
|
||||
if (mNextNode && mNextNode->GetParent() != mContent) {
|
||||
if (mNextNode && mNextNode->GetParentNode() != mContent) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -543,12 +543,12 @@ UndoContentRemove::RedoTransaction()
|
||||
}
|
||||
|
||||
// Check that the parent has not changed.
|
||||
if (mChild->GetParent() != mContent) {
|
||||
if (mChild->GetParentNode() != mContent) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Check that the next node still has the same parent.
|
||||
if (mNextNode && mNextNode->GetParent() != mContent) {
|
||||
if (mNextNode && mNextNode->GetParentNode() != mContent) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -598,17 +598,17 @@ NS_IMPL_ISUPPORTS1(UndoMutationObserver, nsIMutationObserver)
|
||||
bool
|
||||
UndoMutationObserver::IsManagerForMutation(nsIContent* aContent)
|
||||
{
|
||||
nsCOMPtr<nsIContent> content = aContent;
|
||||
nsCOMPtr<nsINode> currentNode = aContent;
|
||||
nsRefPtr<UndoManager> undoManager;
|
||||
|
||||
// Get the UndoManager of nearest ancestor with an UndoManager.
|
||||
while (content && !undoManager) {
|
||||
nsCOMPtr<Element> htmlElem = do_QueryInterface(content);
|
||||
while (currentNode && !undoManager) {
|
||||
nsCOMPtr<Element> htmlElem = do_QueryInterface(currentNode);
|
||||
if (htmlElem) {
|
||||
undoManager = htmlElem->GetUndoManager();
|
||||
}
|
||||
|
||||
content = content->GetParent();
|
||||
currentNode = currentNode->GetParentNode();
|
||||
}
|
||||
|
||||
if (!undoManager) {
|
||||
|
Loading…
Reference in New Issue
Block a user