Bug 462758 - elements with contenteditable=true and position:absolute can be moved around the page; r=ehsan

This commit is contained in:
Fabien Cazenave
2011-09-07 13:34:58 -04:00
parent 1d231e1829
commit 1a0e8b9b13
5 changed files with 75 additions and 7 deletions

View File

@@ -368,9 +368,11 @@ nsHTMLEditor::CheckSelectionStateForAnonymousButtons(nsISelection * aSelection)
}
// now, let's display all contextual UI for good
nsIContent* hostContent = GetActiveEditingHost();
nsCOMPtr<nsIDOMNode> hostNode = do_QueryInterface(hostContent);
if (mIsObjectResizingEnabled && focusElement &&
IsModifiableNode(focusElement)) {
IsModifiableNode(focusElement) && focusElement != hostNode) {
if (nsEditProperty::img == focusTagAtom)
mResizedObjectIsAnImage = PR_TRUE;
if (mResizedObject)
@@ -381,7 +383,7 @@ nsHTMLEditor::CheckSelectionStateForAnonymousButtons(nsISelection * aSelection)
}
if (mIsAbsolutelyPositioningEnabled && absPosElement &&
IsModifiableNode(absPosElement)) {
IsModifiableNode(absPosElement) && absPosElement != hostNode) {
if (mAbsolutelyPositionedObject)
res = RefreshGrabber();
else
@@ -390,7 +392,7 @@ nsHTMLEditor::CheckSelectionStateForAnonymousButtons(nsISelection * aSelection)
}
if (mIsInlineTableEditingEnabled && cellElement &&
IsModifiableNode(cellElement)) {
IsModifiableNode(cellElement) && cellElement != hostNode) {
if (mInlineEditedCell)
res = RefreshInlineTableEditingUI();
else