Open Bug 1215367 Opened 9 years ago Updated 2 years ago

Internal-only CSS properties should be hidden in inspector rules

Categories

(DevTools :: Inspector, defect, P2)

defect

Tracking

(firefox44 affected)

Tracking Status
firefox44 --- affected

People

(Reporter: xidorn, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [devtools-platform])

Attachments

(1 file)

Steps to reproduce:
1. in the inspector options, enable "Show Browser Styles"
2. load page https://developer.mozilla.org/samples/domref/fullscreen.html
3. enter fullscreen via pressing enter
4. inspect the video element
5. see the rules panel in the inspector

Expected result:
there should not be any rule with `-moz-top-layer: top !important`

Actual result:
there is a rule shows this property with a delete line


We are able to make some CSS properties internal-only since bug 1069192. The internal-only CSS properties cannot be used in the web content, and they are not accessible via the DOM interface.

The internal-only property `-moz-top-layer` was added in bug 1126230 for the Fullscreen API, which is active in the case I described above.

We should either hide this property, or show it as normal (without the delete line).
What's the best way to detect if a property is internal-only?
Flags: needinfo?(quanxunzhen)
In layout/style/nsCSSPropList.h, all internal-only properties have a flag called "CSS_PROPERTY_INTERNAL", and all of those properties are wrapped in "#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL". You can either generate a blacklist, or a whitelist from that file.
Flags: needinfo?(quanxunzhen)
Tom, can you please take a look at this when you have a chance and see what the best approach is?  I'm not sure that it's directly related to the authored styles work but there may be some overlap.
Flags: needinfo?(ttromey)
I think the best route would be to either add a new method to inIDOMUtils, or to
modify one of the existing methods.

Originally I was thinking a new isInternalOnlyProperty method plus a tweak to this code:

https://dxr.mozilla.org/mozilla-central/source/devtools/client/styleinspector/rule-view.js#864

However, if a user style sheet mentions "-moz-top-layer", this approach would hide
the property -- but we want to see it as invalid in that case.

So, maybe we could do the above and add an additional check for a browser style
sheet; plus extend cssPropertyIsShorthand and perhaps cssPropertyIsValid to
reject internal-only properties.


I couldn't actually reproduce this bug, though.  I followed the instructions using
today's fx-team and could not find the -moz-top-layer property anywhere.
Is there some other step I need?
Flags: needinfo?(ttromey)
(In reply to Tom Tromey :tromey from comment #4)
> I couldn't actually reproduce this bug, though.  I followed the instructions
> using
> today's fx-team and could not find the -moz-top-layer property anywhere.
> Is there some other step I need?
Flags: needinfo?(quanxunzhen)
Attached image screenshot
I probably chose a wrong word in the STR. I mean, -moz-top-layer should not be shown in the rule-view. See the attachment.
Flags: needinfo?(quanxunzhen)
Whiteboard: [devtools-platform]
Bug triage (filter on CLIMBING SHOES).
Priority: -- → P2
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: