The default bug view has changed. See this FAQ.

Would like a way to ask if a property is inherited by default

RESOLVED FIXED in mozilla10

Status

()

Core
CSS Parsing and Computation
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dcamp, Assigned: dcamp)

Tracking

unspecified
mozilla10
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed-in-fx-team])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 571788 [details] [diff] [review]
maybe this will work

We're working on a developer tool (similar to firebug's) that shows the css rules that apply to an element. It shows properties from cssText for rules returned from nsIDOMUtils::getCSSStyleRules(). For parent elements, we want to show only properties whose value might be inherited.
Attachment #571788 - Flags: review?(bzbarsky)
Comment on attachment 571788 [details] [diff] [review]
maybe this will work

>+++ b/layout/inspector/src/inDOMUtils.cpp
>+  *_retval = (sid < nsStyleStructID_Reset_Start);

How about:

  *_retval = !nsCachedStyleData::IsReset(sid);

?  You'll need to include nsRuleNode.h.

r=me with that.
Attachment #571788 - Flags: review?(bzbarsky) → review+
Comment on attachment 571788 [details] [diff] [review]
maybe this will work

Actually, wait.  This will break for shorthands because kSIDTable only goes up to eCSSProperty_COUNT_no_shorthands.

You need to handle shorthands specially (e.g by setting |prop| to one of the longhands the shorthand expands to).

And please add some tests (including for the above) and a commit message?
Attachment #571788 - Flags: review+ → review-
(Assignee)

Comment 3

6 years ago
Created attachment 572093 [details] [diff] [review]
v2
Assignee: nobody → dcamp
Attachment #571788 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #572093 - Flags: review?
Comment on attachment 572093 [details] [diff] [review]
v2

r=me
Attachment #572093 - Flags: review? → review+
(Assignee)

Comment 5

6 years ago
https://hg.mozilla.org/integration/fx-team/rev/56e7358abdb3
Whiteboard: [fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/56e7358abdb3
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in before you can comment on or make changes to this bug.