Meeting minutes
astearns: we have 4 items that are new-ish, will hold those to 20 minutes each
… at 11:00 there is a session with WHATWG on responsive images that some folks might want to duck out to
… a few things that aren't slotted on the agenda yet because we may not have time for them
… if we get through those we can pull in some regular agenda items
fantasai: do we want to bring up spatial layout?
astearns: yes, could slot in as fifth new item
github-bot, take up w3c/
Proposal: Declarative Web Haptics
<github-bot> OK, I'll post this discussion to w3c/
kyerebo: Hi, I'm Alex from Microsoft, been working on web haptics API for declarative and imperative haptics on the web
… on the declarative side we've narrowed down to 2 potential models
… hoping to converge on one of them today
… first is nested @haptic rule
… fires when containing selector changes from not-matching to matching
… simple syntax, easy for author to parse, signals to dev pretty clearly that @haptic is not a regular CSS property
… some of the main pushback we saw at Berlin F2F is that haptic isn't directly associated with event that caused it to start matching
… and that @haptic must wait for style recalc which can cause latency
… which led us to other model we got
… second model is event trigger model
… similar to animation triggers
… specifically event triggers for animations, plays a haptic when event actually happens
… [shows code example from explainer]
… assign haptic to specific event trigger
… can also have anonymous syntax which simplifies trigger
… advantage is that there's specific cause and effect and lower latency
… because UA already knows relationship before event occurs
… a little harder to understand than @haptic and has dependency on event trigger sources
… [shows comparison table]
<kyerebo> https://
kyerebo: authoring experience and causality make event trigger a little more attactive
… would love to hear what you all think and hopefully we can resolve on one model or the other
emilio: in general the event trigger approach seems a bit nicer
… allows you to have all the state beforehand
… presumably some of this where interesting in compositor stuff (?)
… triggering on pseudo starting or stopping matching is a bit of an antipattern
… a bit confused about how option 1 would work
… what happens if I don't put the @trigger in a pseudo class that would switch, would it trigger the haptic every time it happens?
… that seems a lot more confusing of a model than event trigger approach
davidjmarland: I think the nested one may be a new pattern, using @haptic - I don't think we have any existing @-whatever that only work if they're nested inside something else
… they tend to be something that sit outside, not sure if this would be confusing to developers since it must be inside
ydaniv: like the option built on top of animation triggers, exactly what we were aiming for
… everything is reusable and works together
… if you think of haptics as an effect, it makes sense
astearns: like the event trigger thing in part because if we find that there are bits of event triggers that aren't adequate for haptics, perhaps we can fix them
<ydaniv> +1 to astearns
astearns: and make triggers better not just for haptics but in general
sgill: might have missed this in the beginning, can you go over the difference between @haptic and other syntax again?
… in the example here, you assign a haptic to button being active, wasn't obvious to me what was going on in the other case
kyerebo: referring to one-off in event trigger model?
sgill: yes
kyerebo: for event trigger we have to define event trigger as a variable within class itself
… later created event trigger and assign a haptic to it
… one-off is an anonymous version of that which does creation of haptic and assignment in one line
… syntactically similar to other model
… just not naming event trigger that's being created
fantasai: selector model seems a bit more awkward for controlling lots of types of effects
… can't do it as easily with scroll snap effects, not easy to distinguish between entering and exiting a hover effect
… can't make that distinction very well
… also hooking things up to selector matching is expensive, we try to avoid doing that
… allows a lot of arbitrary things
… do we want to allow triggering a haptic effect when adding/removing a class
… do you want to trigger a haptic when something is no longer a first child
… those are things you can do with selectors
… event model has this concept of entry and exit into a state which selectors don't have, benefit there too
… plus it extends a model we have already
… can reuse a model and that's helpful
kbabbitt: One thing about the event trigger model, it does mean if two rules try to set two different haptics on the same element, one will override the other in the cascade. I think this is something authors are used to dealing with though, it just gets added to the list of use cases for additive CSS if we ever take that up. Happy with either
model.
emilio: did ask about this on previous comment, related to what fantasai was saying
… wasn't clear to me what option 1 really was
… my mental model is different from fantasai's, you have well defined points where you read this property
… independent of selector matching
… seems fantasai's model is, if I do :root @haptic something, my page is vibrating all the time somehow
fantasai: no, it's when you start or stop matching
emilio: so you effectively have all these defined points in time
… your stylesheet loads and now your page vibrates because it loaded async
… specifics don't matter if we're leaning towards other model
kyerebo: rule fires when selector transitions from not-matching to matching, not on load
… but sounds like we're leaning towards event triggers
fantasai: could happen when creating element
emilio: or when MQ changes
… I think that would be a fairly confusing model
kyerebo: CSS version of this API is just an explainer
astearns: could we create an ED with animation triggers model?
PROPOSED: Create an ED using the animation trigger model
<ChrisL> +1
<JohnJansen> +1
PROPOSED: Create an ED using the animation trigger model and start having more focused issues based on that draft
<kbabbitt> +1
RESOLUTION: Create an ED using the animation trigger model and start having more focused issues based on that draft
<ydaniv> +1
<seokho> +1
astearns: I appoint kyerebo as editor, we'll see how that draft goes and start discussing in more detail in future meetings
github-bot, take up w3c/
Web Preferences API: implementation interest and next steps
<github-bot> OK, I'll post this discussion to w3c/
davidjmarland: David Marland, Bloomberg
… along with Jason we've been discussing Web Preferences API
… CSS can use MQs to target various user preferences, generally set in OS or browser
… website can respect these settings
… e.g. color-scheme, contrast, etc.
… common for websites to want to change these settings e.g. dark mode / light mode switch
… achieved by setting class on root element and flipping color scheme on the page
… most common case people do but other settings as well
… comes with problems. Website has to figure out how to store this value and block rendering while retrieving value from storage
… sub-applications on same domain must all reimplement same logic and might not share storage
… we encounter this at Bloomberg, teams build their own dark mode switches
… not respected by MQs
… other uses continue to use OS or browser preference and mismatch CSS when you've done the flip in own code
… this is where user preferences API comes in
… allows sites to override prefs at origin level
… MQs pick this up as if it were the normal value
… gets stored by the browser by origin
… so it doesn't require website to store on their own storage
… was resolved to be added July 2024, is part of MQ 5 spec
… implemented in Chrome Canary but progress in other browsers seems to have stalled
… have to keep implementing old way and new way until we have it across browsers
… have been ongoing discussions about this
… raised some concerns/questions
… if a website is able to alter user prefs without concent
… but could already do that by ignoring preferences
… maybe it can only be changed with a trigger e.g. permission dialog
… also need browser UI to let user clear preferences
… since most common use case is color scheme, is using the meta tag enough?
… was resolved that meta tag will affect MQs
… but requires page to implement that and check own storage
… won't cover high contrast, reduced transparency, bold text which we're talking about
… may not cover enough of problem space
… few other questions to resolve, what happens in iframes, whether you need to know original value
… next steps. can we resolve questions? does this api have traction?
… can we get intent to ship or is this not viable?
emilio: seems like a lot of API surface
… at least color scheme part seems solvable with existing mechanisms
… propagates through iframes
… page would be responsible for managing storage
… is implementable, feels like overly generic
… when 99% use case is color-scheme
… color-scheme toggle seems solvable with existing things we've resolved on
… I recently implemented MQ being affected by meta tag in Firefox, was a 5-line change
… seems easy to get into browsers in general
… then MQs can hook into it and so on
… with 10 lines of JS to manage local storage
… then you bypass all these questions about what UI should be, what restrictions should be
… both Blink and Gecko have some sort of emulation for media features
… but it's not generic, you emulate what makes sense to emulate
… print media which doesn't matter, emulate color-scheme and prefers-reduced motion
… could have per-application setting for prefers-reduced-motion but seems less common than prefers-color-scheme
… API surface and complexity vs benefit of this API makes me lean towards providing right tools for color scheme and let websites handle storage
… cannot customize color scheme of page if you embed it
… only can work right now on top-level page because meta tag was not implemented
fantasai: if we want to add prefs for things other than color-scheme, we need to invent meta tags for them
… having this be a consistent API for all prefs is probably a good thing
… storage seems fine
… need to make it clear that we want to restrict to set of prefers MQs where we expect authors to respond to it, not going to change UA behavior to flip preference
… while in principle we don't have problems with it, may want to simplify
lwarlow: while color-scheme is most widely used case, lots of sites offer settings for reduced motion, contrast
… github for example, can choose color scheme and reduced motion
… unfortunate if we don't have the other preference MQs covered
… which is what this API is trying to do
… if the alternative is we define a contrast meta tag where you define supported contrast
… and that reflects MQ, maybe that works
… would be unusual because reason for meta tag for color-scheme was because color-scheme property just has MQ
… in terms of simplifying API shape, not wedded to this API shape in particular, came up with it 3 years ago
… if we can simplify I'm all ears but think there's still value
… if there's a subset or simplification we can agree on, I'm open to that
… if this is just MQ preferences, I'm open to that, just want a solution to this
TabAtkins: still strongly in favor of this
… if we want to simplify API that's fine
… no connection to any particular complexity level as long as base functionality exists
… re: emilio - yes, could do this by setting something in local storage and setting meta tag
… but the fact you have to do that with inline script high up on every page on your domain is kind of ridiculous for what should be an easy feature
… easy to do but a lot of silly busywork for something that if they mess it up is just bad for the user
<florian> +1 to TabAtkins
TabAtkins: we can easily make this work consistently across an entire origin
<fantasai> +1 TabAtkins, was on the queue to say basically that except less thoroughly :p
TabAtkins: if the API is too complex, let's simplify
… if they don't want to do rest of prefs, unfortunate but that would be okay
<miriam> +1 that blocking script is a strange requirement for authors to get this right
TabAtkins: would like to try for at least prefers-* for now
astearns: slight skepticism that this is going to be useful across all prefs
<JaseW> +1 TabAtkins
astearns: as someone who uses prefers-reduced-motion, I never want to allow whole site to start moving
… not sure how this API is going to help for that particular preference
emilio: similar thing, feels like as soon as website would want to get off this common path
… maybe they don't care about prefers-contrast but do care about themes, now they have to reimplement
… color-scheme seems like obvious one, 3 choices, we built into platform
… common thing a lot of websites do
… over-generalizing it to contrast, motion, ... feels like over-generalizing for something that may not warrant it
… as soon as your settings become more complicated and you reimplement them yourself, seems not great
… 2 extremes: website has color picker, and github has lots of themes and contrast levels
… in between you want a color picker and that's the preference browser exposes, less common
smfr: lea's blog post says best dark mode toggle is probably none
… probably want to discourage toggls
kizu: like all these preferences, often adjust settings by site using an extension
… sometimes get too light a display
… same with reduced motion, some sites I want to reduce
<fantasai> smfr is referencing https://
kizu: one thing about contrast, there are use cases where you want it to be similar to light-dark
… property sets its own subtree and then you can override same as with color-scheme
<lea> I'm not in the meeting so I lack context, but note that there's more nuance to it than the title
kizu: all cases where you want to have this adjusted, maybe not everyone's thing but for some users they want this
lwarlow: saying we don't want sites to implement color-scheme toggles, we can say that but sites are building them
… if we ignore reality maybe that's what we want to do but they're building them and often quite bad
… because they aren't following system preferences
… toggle makes it so you can use MQs
… following system preference is great when system offers preference in the way it can be found
… browsers often fail in their job as UAs with overrides or ability to set these outside system
… on Windows you can't set a contrast preference without going into full forced colors mode which is heavy handed
<TabAtkins> "The best dark mode toggle is none" is a misreading of Lea's blog post; she just used a fun title. When she actually gets down to that point, it's "most websites don't need a toggle *on every page*, they can just put it in a settings page"
lwarlow: there are use cases that aren't covered by just following system settings
astearns: perhaps we could remove current version in spec without prejudice but I'm hearing more interest in having this
… perhaps we just need to iterate with what's in spec
<lea> Yes. A separate settings panel is fine. Go beyond the title people! 😅
astearns: saying to implementers don't worry about this yet, we're still working on this, but it may not be necessary
JaseW: hearing no rejection of base functionality of this
… currently in the spec
<fantasai> lea, what happened to "if the user is confused, it's the designer's fault"? :P
JaseW: do sympathize with emilio's points, maybe we can rework the API
… can keep working on that
github-bot, take up w3c/
[css-fonts][mediaqueries-5] Add prefers-bold-text user preference media feature
<github-bot> OK, I'll post this discussion to w3c/
dgrogan: we have a proposal for sites to be able to respect the OS level prefers-bold-text preference
… we talked about this with this group a few months ago
… a few things came out of that
… do we need an opt out?
… can we get away with an opt-out or do we need an opt-in?
… what exact API shape do we need? different opt-in for power user sites vs long-tail sites that don't need as fine control
… in response to setting
… did a bunch more investigation after that, specifically around can we do this automatically to sites with opt-out or does it need to be opt-in?
… ran a custom build of Chrome that opted in, browsed around, found some breakage
… but not definitive either way
… then we looked at bug reports that Android got when it started bolding in apps
… that was astronomical
… that convinced us we need to not do this by default
… on sites when user has asked for it in OS level preferences, which is sad
… if we started web over that's what we'd do
iank_: with the bug reports on Android, only affects a relatively small portion of Android apps
… many apps using webview or react
… just a subset of apps that were affected
… and that was still egregiously bad
dgrogan: our research combined with our experience last year of doing something similar with OS level font-size setting
… makes us want to follow that same formula
… we want to have 2 ways a page can opt in
… one would be a media query
… explainer has exact proposal
… this would let power sites that want to control rendering change how much to bold, weight vs grade, taht kind of thing
… then follow up with a way to let sites turn most of this over to browser
… could be a meta tag like with text scale or a new CSS property
… proposal in the explainer
… possibly font-bold-adjust
… one thing we learned with meta text-scale is, we can learn from sites that use initial fine control way to find out what we should do when they turn details over to the browser
… in this case we'd see how much they change their weight, are they just saying bold, are they also changing grade
… we're not sure exactly what authors will precisely want
… instead of author research that might turn out to be true or false, want to see what they do and pick that cowpath
… talk last time of, what should we do if a page has both MQ and also opts entire page in
… have a lot of options there
… we don't think that needs to block shipping MQ on its own
… we have customers who want MQ right now and specify exactly how their site response
iank_: can go into how various things break
… not as simple as text being cut off
… cases where designers are using bold to indicate selected or unread state, subtle UI brokenness, a lot worse than we expected
emilio: given all the breakage on Android ... is the thought behind it that user benefit outweighs potentially broken layout?
dgrogan: they turned this on way earlier in Android ecosystem existence, didn't have same back compat problem we do and still got hammered
… not sure why they kept it on
emilio: if reason why OS auto-bolds even with breakage, then either auto-bolding is worth it even if layouts break, or ...
… same thing with font size, breaks layouts but we still allow user to set it
… because they need to be able to read the website. layout break is not as bad as not able to read
iank_: because it only affects a relatively limited subset of apps ... doesn't affect rendering for games or webviews
… which is a high proportion of apps
… they may have turned it off if there were more apps
emilio: my main concern with just exposing the pref is that doing it right is not as simple as setting font-weight: bold
… want more subtle things, maybe increase stroke width without increasing spacing
… getting that right seems hard for authors
… easy to say prefers-bold-text, set font-weight bold
iank_: UA can't do it automatically, sites break
emilio: things where site can't rely on specific font metrics
… bunch of fonts which are not defined to particular face
dgrogan: omitted an important detail on that point
… when we modified local chrome build, we did it just for local fonts, still saw breakage
emilio: means websites are broken in other configs as well
… android ships with other fonts
dgrogan: one thing we hypothesized is, educated guess, we've talked to large sites who really do test on a huge matrix of popular devices for default fonts
… this would be a new one, would face a lot of breakage
… you're right, these sites are broken in some devices
… re minimum font size, percent of users who have enabled prefers-bold-font is many orders of magnitude higher than browser level min font size
… some sites are broken for users who set min font size but breakage would be way more for auto bolding
astearns: sounds like you're still interested in finding a solution, just that this initial attempt has problems and you want to find some other way?
iank_: we don't think it's possible to auto bold fonts
astearns: meta tag?
iank_: yes we want this to be opt in
astearns: emilio are you arguing for an opt out?
emilio: seems like user benefit is a lot less if you don't blindly expose preference
<romain> force bold mode?
emilio: either this is important for users and trying to respect pref is more important than text overflowing or it's not
iank_: it's a tradeoff, some things more accessible, some less, we're not going to ship it
dgrogan: where we go, proposed resolution to add MQ to the spec
iank_: and the meta tag?
dgrogan: whether a meta tag or a new property, that can be bikeshedded
… but we want to learn from advanced sites, see what they do in response to MQ, get that in first
astearns: is the auto mechanism in the spec now?
dgrogan: just in explainer
emilio: won't object to that but ... curious if apple folks have opinion?
romain: do think difference between MQ and meta is important, not bikesheddy
… meta tag [missed]
… MQ has to go through design review and we will never ship that
dgrogan: definitely want MQ first, bikeshedding is second step, do we want meta tag or new CSS property?
… where author can say bold everything
romain: so shape of opt-in, got it
sgill: question about the fingerprinting aspecet
… if you just have a scenario where you do the meta tag that opts in and has UA automatically bold internally
… is there a way to detect that still?
dgrogan: yes, unfortunately
astearns: in the interest of time, since this is all noodling in an explainer, perhaps take this as a progress report
… people currently working on explainer are against meta tag, looking into opt-in solutions
dgrogan: want to propose a resolution to go forward with first step which is MQ
astearns: can we resolve on that? would privacy considerations keep us from resolving?
emilio: if you want to say ... don't think it would harm anyone to add this to spec, if you don't want to expose this bit, can never match MQ
iank_: no getting around if you want to expose
astearns: in the interest of time, would prefer having a specific issue on MQ that we can discuss in github comments for a bit before coming to a resolution
… just noodling on explainer for now, can come back to resolution soon for MQ
iank_: MQ part is pretty solved, only open questions for opt-in, can we try resolving on MQ?
… don't think I heard any pushback on MQ
astearns: I'm hearing a bit but we can try
PROPOSED: Add media query for prefers-bold-text
lwarlow: on web preferences point, do youthink this should be overridable by sites?
<davidjmarland> +1
fantasai: this is an MQ where the site has to respond it it, so it goes into the overrideable preferences API set
… on our side we have concerns about fingerprinting but not objecting at this point
RESOLUTION: Add media query for prefers-bold-text
astearns: we'll add MQ and continue discussing in issues
github-bot, take up w3c/
[css-images-5] Define object-view-box for inline svg elements (viewBox-only svgs, user units)
<github-bot> OK, I'll post this discussion to w3c/
TabAtkins: we already have properties object-fit and object-position
… useful on img element, canvas, video, position them once you've made them different size
… regardless of size of image, if you set width height on img, these properties let you respect actual aspect ratio and position
… these 2 properties are a direct map to SVG preserveAspectRatio on root
… other bit of how SVG is controlled is viewBox attribute
… sarah did some impl work in chrome to play with this
… think it's useful to bring over to img
… wrote a spec for this 5 years ago and forgot about it, don't look at that, we're going to talk about feature in general
… viewBox defines coordinate space image draws into
… for SVG can set up scalable image to draw into 100x100 square
… doesn't matter how big it actually is, scales to that size
… same thing here, object-view-box would take a rect
… and that's the coordinate space the image draws into
… raster images draw pixels into that
… if you want to pan or zoom image around you can use object-view-box to do that
… same use case as for SVG
… question about how this and related object properties should work
… as I defined it previously, changed natural width and height of image
florian: from point of view of document that embeds it?
TabAtkins: yes
… does anyone have a great reason to make that happen, if not would like to make it like viewbox in SVG
<ChrisL> Yes, that was a mistake
TabAtkins: only thing it does is provide aspect ratio if one is not specified or implied
<ChrisL> +1
<ydaniv> +1
TabAtkins: because it matches SVG
… makes it more natural to use this for panning and zooming use cases
… because it doesn't change size of element if you provide width and height
iank_: if we respect viewbox on image, does this put images in same place as SVG where you can have aspect ratio only images?
TabAtkins: wouldn't remove natrual dimentions from anything
… if you start from raster image it maintains natural width and height
iank_: but image with no raster
TabAtkins: svg with no dimensions?
iank_: raw img tag
… img will fall back to 300x150
… raw svg with viewbox has no natural dimensions, only aspect ratio
… would img have same effect?
TabAtkins: no opinion, img with no image is an error case
iank_: don't know what right solution is there
… but there are a lot of quirks with SVGs and how they behave in that mode
… might be good to limit that
… can get stretchy behavior and weird intrinsic sizing
TabAtkins: will go through these, not intending to get them all resolved right now, can discuss offline
astearns: maybe some of these details are future discussions and we can resolve to start work?
TabAtkins: want to introduce issues for folks to think about\
TabAtkins: 2, right now, object-position and -fit are defined to apply to replaced elements
… however inline SVG is replaced and does not honor them in browsers I tested
… should it?
… should be consistent in that regard, do we want img element pointing to SVG and inline SVG to act the same
… would prefer it to be so but opinions on that later
… sub aspect, SVG pAR is strict subset of what object-position and -fit can do
… should these become presentation attributes on SVG? weakly lean toward yes
… talking about replaced elements in normal CSS formatted documents. should these props similarly work on external SVG or other elements that use these, nested SVG, marker, svg image etc. all of these take viewbox
… probably relies on answering presentation attribute question
emilio: was going to mention some of these things, do we want viewbox attribute to map to this propertu
… main issue with inline SVG is that it would change positioning
… would get annoying but not unworkable
… would be nice to be consistent
ChrisL: do think they should become presentation attributes, when they were invented there was nothing for them to map to, but now it makes sense
<ydaniv> +1 to ChrisL
ChrisL: want to encourage people to write SVG with viewBox and not explicit width and height
<fantasai> +1 to ChrisL
sdrasner: want to put together specification proposal
… good point that fragment part is underspecified
… if you specify fragment different from aspect ratio, want to pan and zoom to different AR at different times
… panning to a different area, even in those cases it shoudl respect aspect ratio fragment, otherwise could get crops
TabAtkins: want to spend some time thinking about it, arguments on both sides
<iank_> how do percentages resolve for determining the aspect-ratio?
sdrasner: nervous about cases where people try to hack around, specify on both
vmpstr: clarify, confused at opening
… I think we shipped object-view-box 4 years ago in blink
… don't thinkwe do anything with SVG mapping so that's open but proposal to change behavior on images is subject to compat
TabAtkins: curious about what subset of text we implemented
ydaniv: +1 to presentation attributes
… nested SVG and other elements, only concern is probably accept because of box model and different model in SVG, accept more values in SVG than this property
<ChrisL> Hoping we can at least fix "Percentages: N/A" as Obvious Bugfix
ydaniv: needs some checking whether we need separate property
… would be great because you can consolidate SVG and CSS rendering and accept everything
TabAtkins: other things we have are things we can't do with pAR
fantasai: wanted to raise same point as vmpstr, shipping already
… impact on intrinsic sizing could cause pages to break, have to be careful about that
… +1 to mapping to SVG attributes and doing it for both
… have to think through a bit more about intrinsic sizing stuff
… if it's an in page SVG and you restrict view box, get a square view box but your CSS box is rectangular
… and you set object-fit to contain
… do you draw rest of image outside viewbox rectangle?
… astearns we could probably resolve to do the mapping
TabAtkins: do we need to talk to SVGWG for that?
astearns: could resolve and then ping them
fantasai: proposed that viewBox and preserveAspectRatio become presentation attributes and map to object-position and object-fit properties
TabAtkins: and object-view-box
PROPOSED: viewBox and preserveAspectRatio become presentation attributes and map to object-position, object-fit, and object-view-box properties
<fantasai> PROPOSED: SVG viewBox and preserveAspectRatio become presentation attributes that map to CSS object-view-box, object-position, and object-fit, subject to approval by the SVGWG
ydaniv: pAR has totally different values and works completely different
TabAtkins: they're spelled differently but map perfectly
RESOLUTION: SVG viewBox and preserveAspectRatio become presentation attributes that map to CSS object-view-box, object-position, and object-fit, subject to approval by the SVGWG