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-fonts-4][css-font-loading] Applying default font-display to FontFace.load() #3188

Open
lilles opened this issue Oct 2, 2018 · 2 comments

Comments

@lilles
Copy link
Member

lilles commented Oct 2, 2018

The spec for default value for font-display[1] talks about @font-face, but it should apply to fonts loaded through FontFace.load() as well? Should that be clarified in the spec?

[1] https://drafts.csswg.org/css-fonts-4/#font-display-font-feature-values

@tabatkins
Copy link
Member

Yeah, it should definitely apply, just for simplicity. (You can just change the value on a FontFace object, unlike a third-party @font-face rule, but still, consistency seems useful and simple for authors.)

@lilles
Copy link
Member Author

lilles commented Oct 5, 2018

Turns out it doesn't have an effect because the descriptors in the dictionary passed to FontFace constructor have default values.

aarongable pushed a commit to chromium/chromium that referenced this issue Nov 27, 2018
This CL implements support for specifying a default value for
font-display for @font-face rules which do not provide a font-display
descriptor. See spec [1]. The implementation is currently behind a flag
which is off by default (not tested, not in experimental).

For intent-to-implement, see [4].

There is a question if we should mix descriptors with @-rules in
@font-feature-values because an unrecognized descriptor would be seen as
part of the following rule as the start of a qualified ruled which means
forward-compatibility could break. Also, there is a question if this is a
font feature value and should be added to that @-rule at all. Both these
issue are discussed/mentioned in [2].

Since using a descriptor directly in @font-feature values is not
compatible with Gecko, we're wrapping the font-display descriptor in a
block with no prelude for now.

Note that the default font-display cannot currently apply to fonts loaded
by FontFace.load() because the dictionary passed to FontFace have default
values which effectively overrides any @font-feature-values
descriptors[3].


[1] https://drafts.csswg.org/css-fonts-4/#font-display-font-feature-values
[2] w3c/csswg-drafts#2973
[3] w3c/csswg-drafts#3188
[4] https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/C6taiCkYayU

Bug: 777846

Change-Id: I290f23e7489afeef64812d7604417268c2464455
Reviewed-on: https://chromium-review.googlesource.com/c/1222966
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611056}
SergioOpenPeer pushed a commit to webrtc-uwp/chromium-tools that referenced this issue May 10, 2019
This CL implements support for specifying a default value for
font-display for @font-face rules which do not provide a font-display
descriptor. See spec [1]. The implementation is currently behind a flag
which is off by default (not tested, not in experimental).

For intent-to-implement, see [4].

There is a question if we should mix descriptors with @-rules in
@font-feature-values because an unrecognized descriptor would be seen as
part of the following rule as the start of a qualified ruled which means
forward-compatibility could break. Also, there is a question if this is a
font feature value and should be added to that @-rule at all. Both these
issue are discussed/mentioned in [2].

Since using a descriptor directly in @font-feature values is not
compatible with Gecko, we're wrapping the font-display descriptor in a
block with no prelude for now.

Note that the default font-display cannot currently apply to fonts loaded
by FontFace.load() because the dictionary passed to FontFace have default
values which effectively overrides any @font-feature-values
descriptors[3].


[1] https://drafts.csswg.org/css-fonts-4/#font-display-font-feature-values
[2] w3c/csswg-drafts#2973
[3] w3c/csswg-drafts#3188
[4] https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/C6taiCkYayU

Bug: 777846

Change-Id: I290f23e7489afeef64812d7604417268c2464455
Reviewed-on: https://chromium-review.googlesource.com/c/1222966
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#611056}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5d39943cf7bd8db8aa1f874f3444affca39e408f
ns-rsilva pushed a commit to ns-rsilva/chromium that referenced this issue Apr 25, 2024
This CL implements support for specifying a default value for
font-display for @font-face rules which do not provide a font-display
descriptor. See spec [1]. The implementation is currently behind a flag
which is off by default (not tested, not in experimental).

For intent-to-implement, see [4].

There is a question if we should mix descriptors with @-rules in
@font-feature-values because an unrecognized descriptor would be seen as
part of the following rule as the start of a qualified ruled which means
forward-compatibility could break. Also, there is a question if this is a
font feature value and should be added to that @-rule at all. Both these
issue are discussed/mentioned in [2].

Since using a descriptor directly in @font-feature values is not
compatible with Gecko, we're wrapping the font-display descriptor in a
block with no prelude for now.

Note that the default font-display cannot currently apply to fonts loaded
by FontFace.load() because the dictionary passed to FontFace have default
values which effectively overrides any @font-feature-values
descriptors[3].


[1] https://drafts.csswg.org/css-fonts-4/#font-display-font-feature-values
[2] w3c/csswg-drafts#2973
[3] w3c/csswg-drafts#3188
[4] https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/C6taiCkYayU

Bug: 777846

Change-Id: I290f23e7489afeef64812d7604417268c2464455
Reviewed-on: https://chromium-review.googlesource.com/c/1222966
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611056}
Former-commit-id: 5d39943cf7bd8db8aa1f874f3444affca39e408f
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

3 participants