Bug 1538056 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

> Column information from <script> elements should be passed to SpiderMonkey when processing inline scripts

Looking into this more, there's actually more issues here though I'll leave it lumped into this bug for now.

In XHTML files, the line/column given to <script> elements is the _start_ of the <script>, so if you do
```
<script
  type="application/javascript">
  console.log("foo");
</script>
```
The `type="application/javascript">` line is marked breakable because it is "line 2" after the `<script` part.

In HTML files, the line (there is no column) given to <script> is the _end_ of the <script> tag, so the above works fine, but then you have the confusing behavior that
```
<script 
  src=""
>
</script>
```
will log a warning to the console `‘src’ attribute of <script> element is empty.`, but the line number associated with the warning is the closing `>` in the opening `<script>`.

It seems like nsIScriptElement objects should have both a line/column for the _start_ of the `<script` _and_ a line/column for just _after_ the `<script>` opening tag. That way errors and things can use the first position, and inline scripts would use the second pair.
> Column information from <script> elements should be passed to SpiderMonkey when processing inline scripts

Looking into this more, there's actually more issues here though I'll leave it lumped into this bug for now.

In XHTML files, the line/column given to <script> elements is the _start_ of the <script>, so if you do
```
<script
  type="application/javascript">
  console.log("foo");
</script>
```
The `type="application/javascript">` line is marked breakable because it is "line 2" after the `<script` part, where it should be `console.log("foo");` that is breakable.

In HTML files, the line (there is no column) given to <script> is the _end_ of the <script> tag, so the above works fine, but then you have the confusing behavior that
```
<script 
  src=""
>
</script>
```
will log a warning to the console `‘src’ attribute of <script> element is empty.`, but the line number associated with the warning is the closing `>` in the opening `<script>`.

It seems like nsIScriptElement objects should have both a line/column for the _start_ of the `<script` _and_ a line/column for just _after_ the `<script>` opening tag. That way errors and things can use the first position, and inline scripts would use the second pair.
> Column information from <script> elements should be passed to SpiderMonkey when processing inline scripts

Looking into this more, there's actually more issues here though I'll leave it lumped into this bug for now.

In XHTML files, the line/column given to <script> elements is the _start_ of the <script>, so if you do
```
<script
  type="application/javascript">
  console.log("foo");
</script>
```
The `type="application/javascript">` line is marked breakable because it is "line 2" after the `<script` part, where it should be `console.log("foo");` that is breakable.

In HTML files, the line (there is no column pending https://bugzilla.mozilla.org/show_bug.cgi?id=1552008)) given to <script> is the _end_ of the <script> tag, so the above works fine, but then you have the confusing behavior that
```
<script 
  src=""
>
</script>
```
will log a warning to the console `‘src’ attribute of <script> element is empty.`, but the line number associated with the warning is the closing `>` in the opening `<script>`.

It seems like nsIScriptElement objects should have both a line/column for the _start_ of the `<script` _and_ a line/column for just _after_ the `<script>` opening tag. That way errors and things can use the first position, and inline scripts would use the second pair.
> Column information from <script> elements should be passed to SpiderMonkey when processing inline scripts

Looking into this more, there's actually more issues here though I'll leave it lumped into this bug for now.

In XHTML files, the line/column given to <script> elements is the _start_ of the <script>, so if you do
```
<script
  type="application/javascript">
  console.log("foo");
</script>
```
The `type="application/javascript">` line is marked breakable because it is "line 2" after the `<script` part, where it should be `console.log("foo");` that is breakable.

In HTML files, the line (there is no column pending https://bugzilla.mozilla.org/show_bug.cgi?id=1552008) given to <script> is the _end_ of the <script> tag, so the above works fine, but then you have the confusing behavior that
```
<script 
  src=""
>
</script>
```
will log a warning to the console `‘src’ attribute of <script> element is empty.`, but the line number associated with the warning is the closing `>` in the opening `<script>`.

It seems like nsIScriptElement objects should have both a line/column for the _start_ of the `<script` _and_ a line/column for just _after_ the `<script>` opening tag. That way errors and things can use the first position, and inline scripts would use the second pair.

Back to Bug 1538056 Comment 5