Closed
Bug 1097355
Opened 11 years ago
Closed 11 years ago
Allow UA stylesheets to set preffed-off properties, so we can implement old hardcoded behavior in terms of those properties before we expose the properties to the web
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
DUPLICATE
of bug 966992
People
(Reporter: dholbert, Unassigned)
References
Details
When we add a new CSS property (preffed off by default at first), it's sometimes useful to be able to set that CSS property in UA stylesheets, even when the property is preffed off.
CASE IN POINT: "object-fit".
* Bug 624647 is adding layout support for the "object-fit" property.
* The initial value value of "object-fit" is "fill" (to match how images allow themselves to stretch in <img>) -- but for <video>, the default is instead "contain". This is implemented via a UA.css rule, as suggested in the WHATWG spec. (This rule was added in bug 1065766, though it won't have any rendering effect until bug 624647's patches land.)
* nsVideoFrame has traditionally had some transform code to hardcode the "contain" behavior, but in Bug 624647, I'm removing that code & teaching it to instead respect its specified "object-fit" value (including the default "contain" value in html.css).
* BUT, that means that if the "object-fit" property is preffed off at startup time, we'll mis-render <video> elements, because we won't have successfully parsed the "object-fit:contain" rule in html.css.
* SO: tl;dr, by changing to rely on a UA stylesheet to implement this pre-existing rendering behavior, we actually *break* that rendering behavior, when the property is preffed off.
So, we really need a way to force rules in html.css (and other UA stylesheets) to be parsable, regardless of whether the property is preffed off.
(This problem is similar to -- but distinct from -- the problem that heycam is solving over in bug 1068477. The main difference is that this bug here causes rendering breakage even if the user doesn't dynamically tweak the pref.)
| Reporter | ||
Comment 1•11 years ago
|
||
(In the meantime, until this bug is fixed, we have to resort to hacks like attachment 8521010 [details] [diff] [review] on the "object-fit" bug [which hackily forces "object-fit:contain" behavior on nsVideoFrame and on poster-images if the property is preffed off, and which handles another maybe-not-parsed html.css rule by "faking" inheritance to get poster-images to render correctly.)
Comment 2•11 years ago
|
||
For the specific case of object-fit, I think we can ship it without hidding it after the pref, since many of other UAs have already implemented it, and the spec has reached CR level.
| Reporter | ||
Comment 3•11 years ago
|
||
You're right, we *could* just drop the "object-fit" pref entirely, which would make this a non-issue (in that case). But:
(1) that would make it more complicated to disable that feature on branches, if for some reason we needed to. (say, if we discover a compat issue late in the game). In an ideal world, we should be able to disable new features on release branches with a pref flip.
(2) "object-fit" is just an example -- it won't actually benefit from this bug. (per comment 1, I already have a workaround.) But we'll likely run into this same problems with new CSS properties in the future. (particularly properties where existing legacy behavior can be expressed in terms of the new property)
Comment 4•11 years ago
|
||
Maybe we can do something like my patch for bug 1090744.
Comment 5•11 years ago
|
||
I think CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS already allows this.
| Reporter | ||
Comment 6•11 years ago
|
||
Oh, nice! That does look like exactly what I want -- thanks!
| Reporter | ||
Comment 7•11 years ago
|
||
Duping to bug 966992 (which added that flag), since that provided what we need here.
(If it turns out not to be sufficient for some reason, we can reopen this bug or file a more targeted bug.)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•