Closed
Bug 979574
Opened 10 years ago
Closed 9 years ago
[rule-view] important CSS property inherited from parent causes property with the same name on the element to incorrectly be marked as overridden
Categories
(DevTools :: Inspector, defect)
DevTools
Inspector
Tracking
(firefox44 fixed)
RESOLVED
FIXED
Firefox 44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: efpies, Assigned: tromey)
References
()
Details
(Whiteboard: [polish-backlog][difficulty=easy][rule-view-correctness])
Attachments
(2 files, 3 obsolete files)
32.21 KB,
image/png
|
Details | |
4.52 KB,
patch
|
tromey
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release) Build ID: 20140212131424 Steps to reproduce: Container have the line-height property set with the !important modifier. The child have the line-height property set without modifiers. http://jsfiddle.net/cWLF7/ Actual results: Firebug strikes child's line-height property as overriden. Parent's property is not striked. However, child's line-height is actually used, and changing parent's property in the Firebug don't affect on text positioning. Expected results: Parent's !important property is used as having the highest priority.
Comment 1•10 years ago
|
||
Unfortunately, your expected result doesn't match what the CSS spec says to do, or the behavior of any browser. !important only affects what the specified value is, and hence the computed value. That's what gets inherited if the child inherits at all, but if the child has a different specified value it doesn't matter what was specified on the parent.
> Firebug strikes child's line-height property as overriden.
Sounds like a bug in Firebug...
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Comment 2•10 years ago
|
||
Though I just checked, and Firebug does not in fact strike out the "line-height: 3px;" bit, or in fact anything in its style view that I can see...
Comment 3•10 years ago
|
||
This is an issue in which the built in developer tools (not Firebug) are showing the wrong property as being active in the rule view.
Component: CSS Parsing and Computation → Developer Tools: Inspector
Product: Core → Firefox
Version: 27 Branch → Trunk
Comment 4•10 years ago
|
||
I believe this is happening due to the markOverridden function being too aggressive: https://mxr.mozilla.org/mozilla-central/source/browser/devtools/styleinspector/rule-view.js#328. It should be checking to make sure the property is not inherited before marking the earlier as overridden. Even nicer would be if the getApplied() call from the style actor knew which properties would be overridden.
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Summary: line-height with !important modifier can be overriden in children → [rule-view] important CSS property inherited from parent causes property with the same name on the element to incorrectly be marked as overridden
Updated•10 years ago
|
Status: REOPENED → NEW
OS: Mac OS X → All
Hardware: x86 → All
Updated•10 years ago
|
Priority: -- → P2
Comment 6•9 years ago
|
||
Easy test case - inspect the span on this page: data:text/html,<style type="text/css">div{line-height: 1.25!important; } span {line-height: 1}</style><div><span>hi</span></div>
Whiteboard: [rule-view-correctness]
Updated•9 years ago
|
Priority: P2 → --
Whiteboard: [rule-view-correctness] → [polish-backlog][difficulty=easy][rule-view-correctness]
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Assignee | ||
Comment 7•9 years ago
|
||
Assignee | ||
Comment 8•9 years ago
|
||
The test likely depends on the as-authored series.
Depends on: 984880
Assignee | ||
Updated•9 years ago
|
Attachment #8667533 -
Flags: review?(bgrinstead)
Comment 9•9 years ago
|
||
Comment on attachment 8667533 [details] [diff] [review] don't let inherited properties override with !important Review of attachment 8667533 [details] [diff] [review]: ----------------------------------------------------------------- Took me a while to step through all the conditions in markOverridden.. Feel like that's some information that we should be able to fetch from the platform more reliably than computing it all ourselves. r+ though assuming all other tests are green, and I'd say let's ship it ASAP ::: devtools/client/styleinspector/test/browser_ruleview_mark_overridden_07.js @@ +9,5 @@ > + > +const TEST_URI = ` > + <style type='text/css'> > + #testid { > + background-color: #f0c; If you use margin instead of background-color this patch could be landed now, independently from the as-authored series
Attachment #8667533 -
Flags: review?(bgrinstead) → review+
Assignee | ||
Comment 10•9 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #9) > If you use margin instead of background-color this patch could be landed > now, independently from the as-authored series Excellent idea.
No longer depends on: 984880
Assignee | ||
Comment 11•9 years ago
|
||
Updated to use margin properties instead.
Attachment #8667533 -
Attachment is obsolete: true
Assignee | ||
Comment 12•9 years ago
|
||
This time, a clean patch against fx-team.
Attachment #8668445 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8668446 -
Flags: review+
Assignee | ||
Comment 13•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=39d373393550
Assignee | ||
Comment 14•9 years ago
|
||
The expected results are different before as-authored.
Attachment #8668446 -
Attachment is obsolete: true
Assignee | ||
Updated•9 years ago
|
Attachment #8668508 -
Flags: review+
Assignee | ||
Comment 15•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=9eceba31808a
Assignee | ||
Comment 16•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d80a181488a6
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 17•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/178f1ddd2f6a
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/178f1ddd2f6a
Status: ASSIGNED → RESOLVED
Closed: 10 years ago → 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•