mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 575336 part 2. Make sure editor flushes layout before caret moves and scrolls that depend on layout information. r=roc,ehsan
This commit is contained in:
parent
e8a9de31ab
commit
ddf024831a
@ -47,6 +47,7 @@
|
||||
#include "nsIClipboard.h"
|
||||
|
||||
#include "nsEditorCommands.h"
|
||||
#include "nsIDocument.h"
|
||||
|
||||
|
||||
#define STATE_ENABLED "state_enabled"
|
||||
@ -669,7 +670,6 @@ nsSelectionMoveCommands::IsCommandEnabled(const char * aCommandName,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSelectionMoveCommands::DoCommand(const char *aCommandName,
|
||||
nsISupports *aCommandRefCon)
|
||||
@ -677,6 +677,15 @@ nsSelectionMoveCommands::DoCommand(const char *aCommandName,
|
||||
nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
|
||||
NS_ENSURE_TRUE(editor, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> domDoc;
|
||||
editor->GetDocument(getter_AddRefs(domDoc));
|
||||
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
|
||||
if (doc) {
|
||||
// Most of the commands below (possibly all of them) need layout to
|
||||
// be up to date.
|
||||
doc->FlushPendingNotifications(Flush_Layout);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISelectionController> selCont;
|
||||
nsresult rv = editor->GetSelectionController(getter_AddRefs(selCont));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
Loading…
Reference in New Issue
Block a user