Closed Bug 978070 Opened 11 years ago Closed 11 years ago

Do not use document.write() to insert HTML code

Categories

(Bugzilla :: Bugzilla-General, enhancement)

4.5.2
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: LpSolit, Assigned: LpSolit)

References

()

Details

Attachments

(1 file)

From what I know, document.write() blocks the rendering of HTML pages. It's (ab)used a lot in attachment/edit.html.tmpl, and in some other templates. We can reasonably assume that JS is enabled for all users, and if we really want to hide fields which need JS, then we should use the bz_default_hidden CSS class instead, and let JS remove this class if it's enabled.
Attached patch patch, v1Splinter Review
Attachment #8383699 - Flags: review?(justdave)
For the record, the HTML5 spec explains why document.write() should not be used: http://www.w3.org/TR/html5/webappapis.html#document.write%28%29
Comment on attachment 8383699 [details] [diff] [review] patch, v1 Looks good to me. So much cleaner. Also making more work for the YUI2->3 upgrade project ;) (Actually, these particular utilities likely haven't changed any).
Attachment #8383699 - Flags: review?(justdave) → review+
Flags: approval+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git fd518e1..cf74a17 master -> master
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Blocks: 314193
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: