Add nsHTMLTextAreaElement::IsValueEmpty const

RESOLVED FIXED in mozilla6

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: mounir, Assigned: mounir)

Tracking

Trunk
mozilla6
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Comment hidden (empty)
(Assignee)

Updated

7 years ago
Summary: Ad → Add nsHTMLTextAreaElement::IsValueEmpty const
(Assignee)

Comment 1

7 years ago
Created attachment 519041 [details] [diff] [review]
Add IsValueEmpty

Like for nsHTMLInputElement, it makes thing easier to read.
But unlike nsHTMLInputElement, it comes with perf improvement given that we don't check if the string is the empty string but if mValue is NULL (by calling nsTextEditorState::IsEmpty).
Attachment #519041 - Flags: review?(bzbarsky)
(Assignee)

Updated

7 years ago
Whiteboard: [needs review]
Comment on attachment 519041 [details] [diff] [review]
Add IsValueEmpty

r=me
Attachment #519041 - Flags: review?(bzbarsky) → review+
(Assignee)

Updated

7 years ago
Whiteboard: [needs review] → [can land][post-2.0]
(Assignee)

Comment 3

7 years ago
Ehsan, nsTextEditorState::IsEmpty doesn't sound to do what I expected it to do (returning if nsTextEditorState value is empty). Did I misinterpreted this method? is it mis-named? or is it not working as expected?
(Assignee)

Updated

7 years ago
Whiteboard: [can land][post-2.0] → [can land][post-2.0][not ready]
(Assignee)

Updated

7 years ago
Whiteboard: [can land][post-2.0][not ready] → [post-2.0][not ready]
(In reply to comment #3)
> Ehsan, nsTextEditorState::IsEmpty doesn't sound to do what I expected it to do
> (returning if nsTextEditorState value is empty). Did I misinterpreted this
> method? is it mis-named? or is it not working as expected?

It is not the best named method in our tree for sure.  ;-)  But the only call site I can find for it expects it to work this way.
(Assignee)

Comment 5

6 years ago
Created attachment 525438 [details] [diff] [review]
Add IsValueEmpty

The only chunk that has been changed is:

+bool
+nsHTMLTextAreaElement::IsValueEmpty() const
+{
+  nsAutoString value;
+  GetValueInternal(value, PR_TRUE);
+
+  return value.IsEmpty();
+}

In the previous patch, it was returning mState.IsEmpty().
Attachment #519041 - Attachment is obsolete: true
Attachment #525438 - Flags: review?(bzbarsky)
(Assignee)

Updated

6 years ago
Whiteboard: [post-2.0][not ready] → [needs review]
Comment on attachment 525438 [details] [diff] [review]
Add IsValueEmpty

r=me
Attachment #525438 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 7

6 years ago
Pushed:
http://hg.mozilla.org/mozilla-central/rev/ebe25dc723b5
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [needs review]
Target Milestone: --- → mozilla6
You need to log in before you can comment on or make changes to this bug.