Add prefs to enable/disable E4X (javascript.options.xml.content and .chrome)

RESOLVED FIXED in mozilla16



JavaScript Engine
5 years ago
5 years ago


(Reporter: jorendorff, Assigned: jorendorff)


Other Branch
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [js:p2])


(1 attachment, 4 obsolete attachments)

Comment hidden (empty)


5 years ago
Depends on: 753885

Comment 1

5 years ago
Created attachment 624405 [details] [diff] [review]
WIP 1, part 1 - Rename JSOPTION_XML -> JSOPTION_MOAR_XML and other renaming

The problem is that JSOPTION_XML doesn't do what you might guess, so I'm splitting it into two separate options:

    JSOPTION_ALLOW_XML - if this is off, we won't allow E4X syntax
      no matter what your version number is
    JSOPTION_MOAR_XML - if ALLOW_XML is off, this has no effect;
      if ALLOW_XML is on, this has the effect of the existing JSOPTION_XML flag,
      which means we allow E4X even in JS version numbers that don't
      normally have it, and <!-- is treated as an E4X comment rather than
      as a // to-end-of-line comment.

This patch simply renames the existing JSOPTION_XML to JSOPTION_MOAR_XML,
and a few other trivial renamings/cleanups. There should be no change in behavior.
Assignee: general → jorendorff

Comment 2

5 years ago
Created attachment 624406 [details] [diff] [review]

Adds JSOPTION_ALLOW_XML and unconditionally turns it on throughout the browser (and JS test suites except jsapi-tests).

Comment 3

5 years ago
Created attachment 624419 [details] [diff] [review]
WIP 1, part 3 - add prefs for E4X support

This adds two prefs:

Both these prefs control JSOPTION_ALLOW_XML. The first is for chrome JS; the second is for web content.

In this patch, both default to true so as not to change the default behavior, but in a follow-up bug I intend to make them both off-by-default!

Note: In this WIP, the prefs only control XML syntax; neither pref affects the constructors XML, XMLList, Namespace, etc. that exist in every global. Those shouldn't exist either, if JSOPTION_ALLOW_XML is off. I just haven't implemented that part yet.

Comment 4

5 years ago
Oh - I should add that due to bugs in part 2, this isn't passing tests yet. At the moment, it's disabling XML support more than it should. Just putting the patches up early so anyone interested could look into the effect on addons.
Whiteboard: [js:p2]

Comment 5

5 years ago

Comment 6

5 years ago
Created attachment 626502 [details] [diff] [review]
Attachment #624405 - Attachment is obsolete: true
Attachment #624406 - Attachment is obsolete: true
Attachment #624419 - Attachment is obsolete: true

Comment 7

5 years ago
Created attachment 628773 [details] [diff] [review]
v3 - also check the pref in dom/workers

Sorry for the last-minute request. I'd like addon developers to be able to test their stuff using FF15 this release, and default the pref to false in FF16.
Attachment #626502 - Attachment is obsolete: true
Attachment #628773 - Flags: superreview?(jst)
Attachment #628773 - Flags: review?(benjamin)

Comment 8

5 years ago
New Try run, since I added code:


5 years ago
Attachment #628773 - Flags: superreview?(jst) → superreview+
Attachment #628773 - Flags: review?(benjamin) → review+

Comment 9

5 years ago
Thank you for the rapid reviews!
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
Blocks: 753203
You need to log in before you can comment on or make changes to this bug.