mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-02 22:08:40 +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
|
|
@ -2214,6 +2214,23 @@ nsTextEditorState::SetValue(const nsAString& aValue, uint32_t aFlags)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
nsTextEditorState::HasNonEmptyValue()
|
||||
{
|
||||
if (mEditor && mBoundFrame && mEditorInitialized &&
|
||||
!mIsCommittingComposition) {
|
||||
bool empty;
|
||||
nsresult rv = mEditor->GetDocumentIsEmpty(&empty);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
return !empty;
|
||||
}
|
||||
}
|
||||
|
||||
nsAutoString value;
|
||||
GetValue(value, true);
|
||||
return !value.IsEmpty();
|
||||
}
|
||||
|
||||
void
|
||||
nsTextEditorState::InitializeKeyboardEventListeners()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue