Closed
Bug 1360154
Opened 8 years ago
Closed 8 years ago
nsIPlaintextEditor might have to have hasText property for UpdateOverlayTextVisibility
Categories
(Core :: DOM: Editor, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: m_kato, Assigned: m_kato)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files)
Now, nsTextEditState::GetValue uses TextEditor::OutputToString to get current value when editor has focus.
nsTextEditState::UpdateOverlayTextVisibility uses this to check whether current value is empty.
I think that OutputToString is expensive whether value is empty or not. So nsIPlainEditor might have to have hasText property for this.
Assignee | ||
Updated•8 years ago
|
Summary: nsIPlainEditor might have to have hasText property for UpdateOverlayTextVisibility → nsIPlaintextEditor might have to have hasText property for UpdateOverlayTextVisibility
Assignee | ||
Comment 1•8 years ago
|
||
HTMLInputElement::IsValueEmpty might require it since element::UpdateState uses nsTextEditState::GetValue to check empty string.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 4•8 years ago
|
||
mozreview-review |
Comment on attachment 8866635 [details]
Bug 1360154 - Part 1. DocumentIsBody should return bool, not nsresult.
https://reviewboard.mozilla.org/r/138238/#review141436
Attachment #8866635 -
Flags: review?(masayuki) → review+
Comment 5•8 years ago
|
||
mozreview-review |
Comment on attachment 8866636 [details]
Bug 1360154 - Part 2. Add fast path to check whether valus is emtpy.
https://reviewboard.mozilla.org/r/138240/#review141438
::: dom/html/nsTextEditorState.h:184
(Diff revision 1)
> // not changed the cursor won't move.
> eSetValue_MoveCursorToEndIfValueChanged = 1 << 3,
> };
> MOZ_MUST_USE bool SetValue(const nsAString& aValue, uint32_t aFlags);
> void GetValue(nsAString& aValue, bool aIgnoreWrap) const;
> + bool HasValue();
HasValue() is unclear to me. I think that HasNonEmptyValue(), IsEmpty() or something is better.
Attachment #8866636 -
Flags: review?(masayuki) → review+
Comment hidden (mozreview-request) |
Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/b508ea403285
Part 1. DocumentIsBody should return bool, not nsresult. r=masayuki
https://hg.mozilla.org/integration/autoland/rev/fab114e7628c
Part 2. Add fast path to check whether valus is emtpy. r=masayuki
Comment 8•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b508ea403285
https://hg.mozilla.org/mozilla-central/rev/fab114e7628c
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Updated•6 years ago
|
Assignee: nobody → m_kato
Updated•5 years ago
|
Blocks: redesign-editor-scriptable-API
You need to log in
before you can comment on or make changes to this bug.
Description
•