Page MenuHomePhabricator

Bug 1565214 - Don't apply property restrictions to pseudo-elements in UA stylesheets. r=boris,#style
ClosedPublic

Authored by emilio on Jul 11 2019, 1:25 PM.

Details

Summary

And remove some of the ::placeholder and ::cue hacks where we need to use
!important to make the property not apply for content but apply on UA sheets.

The comment about the white-space property was wrong, we don't enforce it with
!important in the UA stylesheets for <input> (we do for <textarea> though), so
I've kept the flag since it really applies.

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

emilio created this revision.Jul 11 2019, 1:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2019, 1:25 PM
phab-bot requested review of this revision.Jul 11 2019, 1:25 PM
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: Restricted Project.
alwu added a subscriber: alwu.Jul 11 2019, 7:29 PM
alwu added inline comments.
layout/style/res/html.css
788

Sorry, @emilio, I wonder if we remove !important, how do we distinguish those properties which are able to be overridden from those one are only allowed to be set in UA sheet?

For example, font should still be able to be overridden by user, but writing-mode shouldn't.

Thank you.

emilio added inline comments.Jul 11 2019, 7:36 PM
layout/style/res/html.css
788

writing-mode and overflow-wrap no longer can be set by content after this patch. I don't understand your question, mind elaborating?

After this patch, all properties are allowed to be set in the UA stylesheet, and only the ones with the flag are allowed to be set by content / overriden by the user. Thus there's no need to set !important from the UA sheet, since nobody can override it anyway.

So there should be no behavior change with this patch. A later patch leaves the list of properties in a single place so it's easy to audit.

Not sure if that answers your question though?

alwu added inline comments.Jul 11 2019, 7:42 PM
layout/style/res/html.css
788

Got it. Thank you for clear clarification!

emilio marked an inline comment as done.Jul 11 2019, 7:43 PM
boris accepted this revision.Jul 11 2019, 9:45 PM
This revision is now accepted and ready to land.Jul 11 2019, 9:45 PM
boris removed a reviewer: Restricted Project.Jul 11 2019, 9:45 PM
emilio updated this revision to Diff 131005.Jul 11 2019, 11:06 PM

fixes + rebase

emilio edited the summary of this revision. (Show Details)Jul 11 2019, 11:06 PM