The default bug view has changed. See this FAQ.

Source Editor with the textarea fallback displays undefined without a placeholderText

RESOLVED FIXED in Firefox 9

Status

()

Firefox
Developer Tools
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: past, Assigned: past)

Tracking

Trunk
Firefox 9
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed-in-fx-team])

Attachments

(1 attachment, 1 obsolete attachment)

When creating a SourceEditor without a placeholderText in the configuration, we get the string "undefined" when using a textarea. Also a warning is displayed in case strict mode is enabled:

JavaScript strict warning: resource:///modules/source-editor-textarea.jsm, line 132: reference to undefined property aConfig.placeholderText
Assignee: nobody → past
Status: NEW → ASSIGNED
Created attachment 560182 [details] [diff] [review]
Working patch

Simple fix.
Attachment #560182 - Flags: review?(mihai.sucan)
Comment on attachment 560182 [details] [diff] [review]
Working patch

Review of attachment 560182 [details] [diff] [review]:
-----------------------------------------------------------------

Hah, I missed this when I did my patches. Thanks for the fix!

::: browser/devtools/sourceeditor/source-editor-textarea.jsm
@@ +129,5 @@
>  
>      this._textbox.style.MozTabSize = this._tabSize;
>  
> +    this._textbox.setAttribute("value", aConfig.placeholderText ?
> +                               aConfig.placeholderText : "");

Perhaps it would be more concise to do:

this._textbox.setAttribute("value", aConfig.placeholderText || "");
Attachment #560182 - Flags: review?(mihai.sucan) → review+
Created attachment 560363 [details] [diff] [review]
[in-fx-team] Patch v2

(In reply to Mihai Sucan [:msucan] from comment #2)
> Comment on attachment 560182 [details] [diff] [review]
> Working patch
> 
> Review of attachment 560182 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Hah, I missed this when I did my patches. Thanks for the fix!
> 
> ::: browser/devtools/sourceeditor/source-editor-textarea.jsm
> @@ +129,5 @@
> >  
> >      this._textbox.style.MozTabSize = this._tabSize;
> >  
> > +    this._textbox.setAttribute("value", aConfig.placeholderText ?
> > +                               aConfig.placeholderText : "");
> 
> Perhaps it would be more concise to do:
> 
> this._textbox.setAttribute("value", aConfig.placeholderText || "");

Absolutely.
Attachment #560182 - Attachment is obsolete: true

Updated

6 years ago
Whiteboard: [land-in-fx-team]
Comment on attachment 560363 [details] [diff] [review]
[in-fx-team] Patch v2

Pushed:
https://hg.mozilla.org/integration/fx-team/rev/01ef83aa3f02
Attachment #560363 - Attachment description: Patch v2 → [in-fx-team] Patch v2

Updated

6 years ago
Whiteboard: [land-in-fx-team] → [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/01ef83aa3f02
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 9
You need to log in before you can comment on or make changes to this bug.