Closed
Bug 1191024
Opened 9 years ago
Closed 9 years ago
getRuleLocation sometimes computes incorrect start line
Categories
(DevTools :: Inspector, defect)
DevTools
Inspector
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1013814
People
(Reporter: tromey, Assigned: tromey)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
pbro
:
review+
|
Details | Diff | Splinter Review |
stylesheets.js:getRuleLocation can sometimes incorrectly compute
the start line for a rule. In particular I saw it happen
with an inline style sheet where the first rule was @supports.
In this case the check here:
https://dxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/stylesheets.js#963
... fails, leading it to use the second rule to compute the
absolute start line.
I think the fix is to change the check to use Ci.nsIDOMCSSRule
rather than nsIDOMCSSStyleRule.
I have a fix for this; just need to write a test case.
Assignee | ||
Comment 1•9 years ago
|
||
Here's the patch without tests.
Assignee | ||
Updated•9 years ago
|
Attachment #8645735 -
Flags: review?(pbrosset)
Comment 3•9 years ago
|
||
Comment on attachment 8645735 [details] [diff] [review]
widen instanceof test in getRuleLocation
Review of attachment 8645735 [details] [diff] [review]:
-----------------------------------------------------------------
Seems fine to me.
Attachment #8645735 -
Flags: review?(pbrosset) → review+
Assignee | ||
Comment 4•9 years ago
|
||
Assignee | ||
Comment 5•9 years ago
|
||
The try run showed that this is flawed; some rules don't use a "{" for their
location but rather the token following the @-keyword. Then it occurred to me
that even expanding the heuristic to check this would be wrong, because an
invalid @-keyword would be recognized by a naive scanner but be ignored by the
real parser.
Then I found bug 1013814. I've decided to try to fix this the real way.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•