Closed Bug 389631 Opened 17 years ago Closed 8 years ago

CSS error messages in script-added <style> elements incorrectly give the line number within the stylesheet

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: johnjbarton, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: testcase, Whiteboard: [firebug-p3])

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a6) Gecko/20070629 GranParadiso/3.0a6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a6) Gecko/20070629 GranParadiso/3.0a6

In the referenced URL is a test case that adds a style tag whose contents contain a CSS error. That added tag comes after an existing style tag. The error is reported on line 20 of the page URI; the error is on the 20th line of the second style tag.
The Firefox CSS error-message line-number is relative to the style element but there is no information in the error as to *which* style element. The test case has its error in the second style, but I can't find that out. 

Reproducible: Always

Steps to Reproduce:
Load the page, look at the error console.
Actual Results:  
Warning: Unknown property 'guinea-pig'.  Declaration dropped.
Source File: http://fireclipse.svn.sourceforge.net/viewvc/*checkout*/fireclipse/trunk/FireclipseTests/WebContent/ConsoleCSSErrorNotInCSSPanel.htm
Line: 20

Expected Results:  
Warning: Unknown property 'guinea-pig'.  Declaration dropped.
Source File: http://fireclipse.svn.sourceforge.net/viewvc/*checkout*/fireclipse/trunk/FireclipseTests/WebContent/ConsoleCSSErrorNotInCSSPanel.htm
XPath: /html/head/style[2]
Line: 20


If the XPath to the erroneous style tag was added, then the error message would actually make sense and tools like Firebug could correctly show users where the error occurred.
Attached file html file test case
I'm not convinced that adding an XPath to the error message is a good solution.  The error definitely isn't on line 20 of the HTML file, though :)
Component: General → Style System (CSS)
Product: Firefox → Core
QA Contact: general → style-system
Summary: CSS error messages do not uniquely identify the erroneous line number → CSS error messages in script-added <style> elements incorrectly give the line number within the stylesheet
Version: unspecified → Trunk
Well you could report the error against line numbers, but I don't know how debuggers or IDE would use that info. They have the (static old) source and they have the (dynamic) DOM. XPath will tell where the error is in the DOM. If you want to give line numbers, you'll also have to give the (dynamic new) source to go with it. 
I think this is the same as bug 261147
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Whiteboard: [firebug-want]
Whiteboard: [firebug-want] → [firebug-p3]
Blocks: 435025
Keywords: testcase
this looks like it's fixed in Firebug. The attached test case now brings up the offending line in the HTML panel when clicked on. Should we close this or is the underlying bug still a problem?
As there was no further feedback for many years and the test case shows the correct line within the HTML panel using Firefox 46.0 + Firebug 2.0.16, I finally close this bug.

Sebastian
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: