Open Bug 1552358 Opened 5 years ago Updated 2 years ago

<script> console warnings/errors should possibly use the _start_ position of the <script>?

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: loganfsmyth, Unassigned)

References

(Blocks 2 open bugs)

Details

When Gecko emits a warning about a <script>, for example ‘src’ attribute of <script> element is empty., right now the position it uses is pulled from the nsIScriptElement interface, and currently that position (in HTML files, but not XML) is the position of the end of the <script>. Right now that position is also only a line number, with column always being 1 and since <script>s are rarely wrapped across multiple lines, we basically always show opentagendline:1 and it is the same as opentagstartline:1.

When I fix https://bugzilla.mozilla.org/show_bug.cgi?id=1538056, I actually don't know if it would be better to just leave the column number hard-coded 1 in the warnings, or if I should set it to the end column of the <script>. Setting it to the end might be confusing for users, especially since scripts that emit warnings may not have any inline text content. On the other hand, if a line had multiple scripts, setting the column number would allow users to know which script emitted the warning, but I imagine that would be pretty infrequent.

Per discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1538056#c7, getting the <script> start line/column might be pretty hard, so if you want to close this, that's alright, but I'm filing it so we at least have it for historical reasons.

Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.