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:
Matt A. Tobin 2020-04-17 07:43:03 -04:00 committed by Roy Tam
commit a6f048fc42
7 changed files with 33 additions and 18 deletions

View file

@ -157,6 +157,11 @@ public:
};
MOZ_MUST_USE bool SetValue(const nsAString& aValue, uint32_t aFlags);
void GetValue(nsAString& aValue, bool aIgnoreWrap) const;
bool HasNonEmptyValue();
// The following methods are for textarea element to use whether default
// value or not.
// XXX We might have to add assertion when it is into editable,
// or reconsider fixing bug 597525 to remove these.
void EmptyValue() { if (mValue) mValue->Truncate(); }
bool IsEmpty() const { return mValue ? mValue->IsEmpty() : true; }