mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Bug 1360154 - nsIPlaintextEditor might have to have hasText property for UpdateOverlayTextVisibility
* DocumentIsBody should return bool, not nsresult * Add fast path to check whether valus is emtpy Tag #1375
This commit is contained in:
parent
b8260c664a
commit
a6f048fc42
7 changed files with 33 additions and 18 deletions
|
|
@ -3530,15 +3530,11 @@ HTMLEditor::SelectEntireDocument(Selection* aSelection)
|
|||
// Protect the edit rules object from dying
|
||||
nsCOMPtr<nsIEditRules> rules(mRules);
|
||||
|
||||
// get editor root node
|
||||
nsCOMPtr<nsIDOMElement> rootElement = do_QueryInterface(GetRoot());
|
||||
|
||||
// is doc empty?
|
||||
bool bDocIsEmpty;
|
||||
nsresult rv = rules->DocumentIsEmpty(&bDocIsEmpty);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (rules->DocumentIsEmpty()) {
|
||||
// get editor root node
|
||||
Element* rootElement = GetRoot();
|
||||
|
||||
if (bDocIsEmpty) {
|
||||
// if its empty dont select entire doc - that would select the bogus node
|
||||
return aSelection->Collapse(rootElement, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue