This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 209775 - svg script type = "application/ecmascript" is not parsed and highlighted in editor
Summary: svg script type = "application/ecmascript" is not parsed and highlighted in e...
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-20 09:13 UTC by mps77
Modified: 2016-03-12 14:47 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mps77 2012-03-20 09:13:59 UTC
references: 
http://www.w3.org/TR/SVG/script.html#ScriptElement
http://www.ietf.org/rfc/rfc4329.txt
<quot>
   This document defines equivalent processing requirements for the
   types text/javascript, text/ecmascript, and application/javascript.
   Use of and support for the media type application/ecmascript is
   considerably less widespread than for other media types defined in
   this document.  Using that to its advantage, this document defines
   stricter processing rules for this type to foster more interoperable
   processing.
</quot>

work:
<svg id="fooSvg" width="640" height="480" xmlns="http://www.w3.org/2000/svg">
  <script type="text/javascript">
    function bar() {
      //svg related stuff here
    }
  </script>
  <g>
     <title>Foo</title>
     <circle fill="#ff0000" stroke="#000000" stroke-width="5" r="10" cy="10" cx="10" id="fooCircle" />
  </g>
</svg>

does not work:
<svg id="fooSvg" width="640" height="480" xmlns="http://www.w3.org/2000/svg">
  <script type="application/ecmascript">
    function bar() {
      //svg related stuff here
    }
  </script>
  <g>
     <title>Foo</title>
     <circle fill="#ff0000" stroke="#000000" stroke-width="5" r="10" cy="10" cx="10" id="fooCircle" />
  </g>
</svg>
Comment 1 BlameFate 2016-03-12 14:46:16 UTC
https://www.iana.org/assignments/media-types/media-types.xml

text/javascript: "javascript - OBSOLETED in favor of application/javascript"

application/javascript: "javascript" (the correct option, though not supported by MSIE < v.8: however over the next few years, this option might become a little more common.

Netbeans/PHP: supports 1st option (officially obsolete), but does not support 2nd option in HTML/Javascript source, for code autocompletion purposes (the syntax checker seems not to understand it!)
Comment 2 BlameFate 2016-03-12 14:47:49 UTC
If I don't see any movement on this issue within the next 12 months, I might change the Issue Type to "DEFECT" rather than "ENHANCEMENT".