Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-cascade] User stylesheets, UA stylesheets - still something we expect to be real? #2237

Open
svgeesus opened this issue Jan 29, 2018 · 9 comments

Comments

@svgeesus
Copy link
Contributor

svgeesus commented Jan 29, 2018

CSS 2.2 section 3.2 UA conformance:

UAs must allow users to specify a file that contains the user style sheet. UAs that run on devices without any means of writing or specifying files are exempted from this requirement. Additionally, UAs may offer other means to specify user preferences, for example, through a GUI.
https://drafts.csswg.org/css2/conform.html#conformance

Microsoft Edge does not support User Stylesheets.
https://msdn.microsoft.com/en-us/library/hh674753(v=vs.85).aspx

Chrome removed User stylesheets ages ago (chrome 33)
https://bugs.chromium.org/p/chromium/issues/detail?id=347016
https://news.ycombinator.com/item?id=7329855

The conformance section does not mention UA default stylesheets at all, but they are listed in section 6.4 the cascade:

User agent: Conforming user agents must apply a default style sheet (or behave as if they did). A user agent's default style sheet should present the elements of the document language in ways that satisfy general presentation expectations for the document language (e.g., for visual browsers, the EM element in HTML is presented using an italic font). See A sample style sheet for HTML for a recommended default style sheet for HTML documents.

I came across this again recently in the context of test for Fonts 3. A couple of tests require a particular font to be set in the UA stylesheet. For example font-052 and font-family-rule-004a. Everyone fails those tests, and they have less results than other tests (I guess skipping is easier than finding how to change the UA stylesheet, restarting the browser, then changing it back again for one test).

Do we want to still
a) say that UA stylesheets are a thing
b) insist that they be modifiable by users (as a stylesheet, not as prefs in a dialog box)

If not, then CSS2 should be modified.

if we do, then we need browser vendors on board to expose UA styles to user editing. Otherwise, how can we pass tests like these?

@svgeesus
Copy link
Contributor Author

User stylesheets (not UA stylesheets, I think) are also a WAI UA Accessibility Guidelines requirement
https://www.w3.org/TR/UAAG20/#gl-style-sheets-config

@emilio
Copy link
Collaborator

emilio commented Jan 29, 2018

Also, Blink was adding them back last time I checked, see https://bugs.chromium.org/p/chromium/issues/detail?id=632009.

@svgeesus
Copy link
Contributor Author

Great link! Interesting to see that extensions rely on injecting user stylesheets.

@fantasai
Copy link
Collaborator

fantasai commented Jan 29, 2018

There's no requirement that UA stylesheets be modifiable by users; in fact they are most definitely not intended to be modifiable by users--the users should be modifying the user stylesheet. There's also no requirement that the UA represent the user stylesheet as CSS syntax--if it wants to inject rules directly into the cascade internally, that's fine and allowable. So I'm not sure what the problem is that you're asking us to fix.

Update: Nm, noticed that 3.2 and 6.4 conflict--3.2 requires a file for the user style sheet, and 6.4 says “may”. We should fix that.

@fantasai fantasai changed the title User stylesheets, UA stylesheets - still something we expect to be real? [css-cascade] User stylesheets, UA stylesheets - still something we expect to be real? Jan 29, 2018
@fantasai
Copy link
Collaborator

I also don't see why those two tests need the UA's default font to be set to anything? The test should just specify div { font-family: whatever-the-default-was-supposed-to-be } if it needs a specific font to be specified earlier in the cascade.

@fantasai fantasai added Agenda+ and removed Agenda+ labels Jan 29, 2018
@Nadya678
Copy link

Nadya678 commented Jan 30, 2018

@fantasai: But due to possibility of tracking users, I propose Helvetica, Arial, Liberation Sans 16px (=12pt) as default font. Or other with character width compatible with Arial/Helvetica.

@svgeesus
Copy link
Contributor Author

No, it needs to be the specific font required by the test. Helvetica etc as you suggest would not suit the test purpose.

@svgeesus
Copy link
Contributor Author

The test should just specify div { font-family: whatever-the-default-was-supposed-to-be } if it needs a specific font to be specified earlier in the cascade

That fix works fine to solve my specific question, I will patch those two tests. The more general question remains open.

@css-meeting-bot
Copy link
Member

The Working Group just discussed [css-cascade] User stylesheets, UA stylesheets - still something we expect to be real?, and agreed to the following resolutions:

  • RESOLVED: From CSS 2, 2.1 and, 2.2 section 3.2 remove the paragraph beginning "UA must allow the user to specify a file..."
  • RESOLVED: No change to section 6.4
The full IRC log of that discussion <dael> Topic: [css-cascade] User stylesheets, UA stylesheets - still something we expect to be real?
<dael> github: https://github.com//issues/2237
<dael> Chris_: I guess there are 2 parts to this. First is I was trying to remove fonts 3 test failures. 2 tests said you have to set UA stylesheet o specific syntax which implies you have to be able to edit and put syntax in UA stylesheet.
<dael> Chris_: Since fantasai said you can wrap a div instead of putting it in the stylesheet so that's solved.
<dael> Chris_: But this is testing functionality I can't find anywhere. There's nothing that says the UA stylesshet has to be something phsyical nor something editable by the user.
<dael> Chris_: They're relying on non-required features.
<dael> Chris_: User stylesheets there's a requirements to support. Edge doesn't do it. Chrome took it out. We've had this model since CSS 1. Do we still believe in it or do we want to allow the browsers to inject and we shouldn't test for it. Esp. UA stylesheet.
<dael> fantasai: I don't know anywhere in the spec the UA stylesheet editable. User stylesheet is a file you can choose.
<dael> Chris_: Right.
<dael> fantasai: There's also that we have spec sections conflicting.
<dael> florian: How?
<fantasai> https://www.w3.org/TR/CSS2/cascade.html#cascade
<dael> fantasai: one impl one thing, the other different. Casecade talks user and user agenda.
<dael> fantasai: User may be able to spec style info for a particular doc. It's all mays.
<fantasai> https://www.w3.org/TR/CSS2/conform.html#conformance
<dael> fantasai: Chris_ pointed out there's a section on the conformance with musts saying UA must allow the user to select a stylesheet.
<fantasai> “UAs must allow users to specify a file that contains the user style sheet.”
<Rossen_> q+
<dael> florian: That doesn't seem very elegent. Spec saying how a UA must behavior is reasonable. But saying it must provide some UI level feature, file access is a UI level requirement.
<dael> fantasai: That's in 3.2.
<dael> Chris_: An additional complication were UA a11y guidelines require it to be modifiable. That's various legal standards. modifying or changing this has substanital reprecussions. Assuming it works also has repercussions.
<dauwhe> q?
<Rossen_> q?
<florian> q+
<dauwhe> q+
<dael> Rossen_: As an impl who is shipping this. UA stylesheet since the first time I impl this in IE8 there was no conformance requirement that the user stylesheet has to be on disk nor using it as such and paying the performance costs.
<fantasai> *please* can we not confound UA and user in this discussion?
<dael> Rossen_: This as a UA impl leads to the conclusion this better be a static compiled ready to go stylesheet. This is the reason we don't have an actual file on the system. But we do have one that's loaded and compiled.
<smfr> webkit also compiles the UA style sheet at build time
<fantasai> The UA stylesheet and user stylesheet are really different concepts
<dael> Rossen_: So there is the concept of user agent def. stylesheet. But we don't plan on shipping it as actual CSS.
<dael> Rossen_: Other reason is if you have differener user agents referring to same engine you should have, at least our design principle, is they all have basically same stylesheet.
<dael> Rossen_: User stylesheets we deprecated before edge. We had support in ie9 and 10. I think we deprecated in 11. There was no use.
<dael> Rossen_: Since then things changed. In particular extensions allow the addition of stylesheets only that can be used to modify and tailor UX in more ways then a single stylesheet. In terms of extensibility one of our principles was to encourage this to be exposed through extensions rather then dropping a style sheet.
<Rossen_> q?
<Rossen_> ack Rossen
<fantasai> +1 to Florian
<Rossen_> +1 to florian
<dael> florian: Pretty much agreeing with you. I think the right division is the css specs should define how user stylesheets work, but stay out of the must impl. If other specs wand to require this of browsers, but css should define how it works.
<dael> Rossen_: Agree.
<Rossen_> ack florian
<Chris_> https://www.w3.org/WAI/UA/TS/html401/cp0414/0414-USER-STYLE.html
<Chris_> Checkpoint 4.14 Choose style sheets (Priority 1 )
<Chris_> Provision 2 : Allow the user to choose from and apply at least one user style sheet.
<dael> dauwhe: I want to reiterate the importance of the end use affecting presentation of content. This becomes a huge issue on digital books. There's an aria personalization task force so might be good to coordination. I don't want to see this die.
<dael> fantasai: Yeah.
<Rossen_> ack dauwhe
<Chris_> also https://www.w3.org/TR/UAAG20/#gl-style-sheets-config
<Rossen_> dholbert: I will, thx for pointing out
<dholbert> Rossen_: thanks
<dael> fantasai: I think propose edits would be leave the cascade 6.4 section in place. It describes that a use could do a css syntax or through an interface. I think we should remove from conformance the paragragh that wasy the user must have ability to spec a file rep. user stylesheet.
<fantasai> https://www.w3.org/TR/CSS2/conform.html#conformance
<dael> fantasai: I would remove tha second paragraph after bullet list ^
<dael> florian: I don't think removing the must decreases the chance of impl. It's important to define how to do it and let market pressure push to impl.
<fantasai> no changes proposed to https://www.w3.org/TR/CSS2/cascade.html#cascade
<dael> Rossen_: Chris_ back to you.
<dael> Chris_: I wanted clarity. I didn't have an aim in mind. I like what florian said we shouldn't spec UI behavior.
<dael> fantasai: Proposal for edits. Sound good?
<dael> Chris_: I like what you suggested.
<dael> fantasai: proposed resolution: From section 3.2 remove the paragraph begining UA must allow users to spec a file. No changes to section 6.4
<fantasai> https://www.w3.org/TR/CSS2/conform.html#conformance 3.2
<fantasai> https://www.w3.org/TR/CSS2/cascade.html#cascade 6.4 (no change)
<dael> Rossen_: One at a time. From CSS 2 section 3.2 remove the paragraph beginning "UA must allow the user to specify a file..."
<dael> Rossen_: Objections?
<Chris_> https://www.w3.org/TR/CSS22/conform.html#conformance
<dael> Chris_: Question. That link goes to css2 which points to 2.1 and 2.2 I want to make sure we're updating those.
<dael> fantasai: Yes, we can update both of those. Might as well edit all.
<Chris_> +1
<dael> RESOLVED: From CSS 2, 2.1 and, 2.2 section 3.2 remove the paragraph beginning "UA must allow the user to specify a file..."
<tantek> Agenda+ https://github.com//issues/2230#issuecomment-362010888 compute auto to auto or auto to zero? Heard one thing (auto to auto), but it got scribed as auto to zero?!?
<dael> Rossen_: Second was additional resolution of no change for css cascade section 6.4
<dael> fantasai: CSS 2.
<dael> Rossen_: Sorry. I'm looking at links and got confused.
<dael> florian: Question.
<dael> florian: If this would induce process churn I'm happy no change. If it would it would be nice to mention it may be done with an extension as well as a file.
<dael> fantasai: It's already there.
<dael> florian: Given the example of extensions is nice, but only if it doesn't make process change.
<dael> Chris_: It's easy to put that in 2.2
<dael> fantasai: I feel like the text is close enough.
<dael> florian: Sure.
<Chris_> q?
<dael> Rossen_: Back to proposed no change rsolution. Objections?
<dael> RESOLVED: No change to section 6.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants