Open Bug 240421 Opened 21 years ago Updated 2 years ago

Attribute setting needs a way of getting line numbers

Categories

(Core :: DOM: Core & HTML, defect, P5)

x86
Linux
defect

Tracking

()

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 2 open bugs)

Details

(Keywords: helpwanted, Whiteboard: [firebug-p2])

When setting some attributes (style attr and event handler attrs come to mind), it would be really nice to have a line number along (at least for times when we're setting the attr from the parser, which is I think the only time we can get a line number that generally makes sense). I don't particularly want to change SetAttr to include this information. What are our other options?
We discussed two other options on irc yesterday: 1. Parse the selector manually in the contentsink and call SetInlineStyleRule rather then SetAttr. 2. Let nsGenericHTMLElement::ParseStyleAttribute do something like mDocument->GetParser()->GetCurrentLineNumber()
Ah, ok. Right. The former wouldn't work for event handlers, but the latter might, assuming we could be sure that this particular call came from the parser (and not, say, from a setAttribute() call from a script that we just finished parsing or from somewhere random inside Gecko).
Blocks: 261337
Blocks: 261339
Any new developments or posssible alpha fix on this bug blocking the 5+ years old bug 11240 (JS errors in event handlers lack file and line number info)?
Keywords: helpwanted
Assignee: general → nobody
QA Contact: ian → general
(In reply to comment #3) > Any new developments or posssible alpha fix on this bug blocking the 5+ years > old bug 11240 (JS errors in event handlers lack file and line number info)? From the Firebug perspective, this bug is different from bug 11240. 11240 calls jsd.onError() so Firebug can get control, but it has no stack so it cannot get line numbers. It tries to trigger jsd.onDebug() to get the line numbers, but that fails. So from Firebug I can fix 11240 if I can onError() fixed. This bug does not call jsd.onError(). In the case where the style value is set by JS, the error message is "Javascript Warning" but jsd does not get the message. We are going to try to intercept the style setting calls in JS and see if we can correlate the error message arrival in the console with the JS call.
Whiteboard: [firebug-p2]
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.