Closed Bug 641352 Opened 13 years ago Closed 13 years ago

Add nsHTMLTextAreaElement::IsValueEmpty const

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla6

People

(Reporter: mounir, Assigned: mounir)

Details

Attachments

(1 file, 1 obsolete file)

      No description provided.
Summary: Ad → Add nsHTMLTextAreaElement::IsValueEmpty const
Attached patch Add IsValueEmpty (obsolete) — Splinter Review
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)
Whiteboard: [needs review]
Comment on attachment 519041 [details] [diff] [review]
Add IsValueEmpty

r=me
Attachment #519041 - Flags: review?(bzbarsky) → review+
Whiteboard: [needs review] → [can land][post-2.0]
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?
Whiteboard: [can land][post-2.0] → [can land][post-2.0][not ready]
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.
Attached patch Add IsValueEmptySplinter Review
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)
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+
Pushed:
http://hg.mozilla.org/mozilla-central/rev/ebe25dc723b5
Status: ASSIGNED → RESOLVED
Closed: 13 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.

Attachment

General

Created:
Updated:
Size: