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

Make ::first-letter and ::first-line pseudo-elements not applied to elements with display: math #211

Open
fred-wang opened this issue Nov 20, 2023 · 7 comments

Comments

@fred-wang
Copy link
Contributor

These are used to provide special stylistic effects on a paragraph of text:

https://drafts.csswg.org/css-pseudo-4/#first-line-styling
https://drafts.csswg.org/css-pseudo-4/#selectordef-first-letter

They don't apply to flexbox or grid and we should probably specify the same for MathML:

https://drafts.csswg.org/css-flexbox/#flex-containers
https://www.w3.org/TR/css-grid-1/#grid-containers

@bkardell
Copy link
Collaborator

Seems logical.

@dginev
Copy link

dginev commented Nov 21, 2023

Looks like a reasonable simplification.

With ~5 minutes of consideration, I can mostly see <mtext> benefiting from the ::first-line mechanism in theory, although it would be exceedingly rare. But in practice one can always use <mtext><p>...</p></mtext> or similar HTML switch to achieve the effect, so the Core elements can avoid the complication.

I can also imagine ::first-letter could bring a nice visual flourish for some multi-character <mi> themes, but I wouldn't call that a "need".

fred-wang added a commit that referenced this issue Nov 22, 2023
@fred-wang
Copy link
Contributor Author

I pushed some change for that. I plan to add tests later when doing some changes in Chromium.

@NSoiffer
Copy link
Contributor

I concur -- it is hard to come up with a case where that makes sense for math and Deyan mentioned a workaround if needed.

@bkardell
Copy link
Collaborator

I've tagged this with agenda+ just so we can get a resolution to confirm it - should be easy.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Nov 23, 2023
Ensure that display: math elements handle ::first-letter the same as
flexbox/grid in order to fix a CHECK failure. display: math elements do
not support linebreaking, so an equivalent testcase for ::first-line
is not possible. The WG is agreeing about whether these pseudo-elements
should indeed be ignored for math layout [1].

[1] w3c/mathml-core#211

Bug: 1495811
Change-Id: Id4eda5573f64e79ece3a94b6f09f991f3251434b
fred-wang added a commit to web-platform-tests/wpt that referenced this issue Nov 24, 2023
This is related to w3c/mathml-core#211

Note that this does not necessarily aligned with current browser implementations.
@fred-wang
Copy link
Contributor Author

I've tagged this with agenda+ just so we can get a resolution to confirm it - should be easy.

Sorry I misunderstood this was already agreed in a previous meeting.

I've opened the related web-platform-tests/wpt#43334 for that.

aarongable pushed a commit to chromium/chromium that referenced this issue Nov 26, 2023
Ensure that display: math elements handle ::first-letter the same as
flexbox/grid in order to fix a CHECK failure. display: math elements do
not support linebreaking, so an equivalent testcase for ::first-line
is not possible. The WG is agreeing about whether these pseudo-elements
should indeed be ignored for math layout [1].

[1] w3c/mathml-core#211

Bug: 1495811
Change-Id: Id4eda5573f64e79ece3a94b6f09f991f3251434b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054276
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1229096}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Nov 26, 2023
Ensure that display: math elements handle ::first-letter the same as
flexbox/grid in order to fix a CHECK failure. display: math elements do
not support linebreaking, so an equivalent testcase for ::first-line
is not possible. The WG is agreeing about whether these pseudo-elements
should indeed be ignored for math layout [1].

[1] w3c/mathml-core#211

Bug: 1495811
Change-Id: Id4eda5573f64e79ece3a94b6f09f991f3251434b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054276
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1229096}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Nov 26, 2023
Ensure that display: math elements handle ::first-letter the same as
flexbox/grid in order to fix a CHECK failure. display: math elements do
not support linebreaking, so an equivalent testcase for ::first-line
is not possible. The WG is agreeing about whether these pseudo-elements
should indeed be ignored for math layout [1].

[1] w3c/mathml-core#211

Bug: 1495811
Change-Id: Id4eda5573f64e79ece3a94b6f09f991f3251434b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054276
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1229096}
@bkardell
Copy link
Collaborator

Let's talk about #2 in https://github.com/web-platform-tests/wpt/pull/43334/files specifically in todays call...

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Nov 30, 2023
…er, a=testonly

Automatic update from web-platform-tests
CHECK failure with MathML + ::first-letter

Ensure that display: math elements handle ::first-letter the same as
flexbox/grid in order to fix a CHECK failure. display: math elements do
not support linebreaking, so an equivalent testcase for ::first-line
is not possible. The WG is agreeing about whether these pseudo-elements
should indeed be ignored for math layout [1].

[1] w3c/mathml-core#211

Bug: 1495811
Change-Id: Id4eda5573f64e79ece3a94b6f09f991f3251434b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054276
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1229096}

--

wpt-commits: 245a37d4371b4e2a47e322482de8e443de04aca3
wpt-pr: 43323
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Nov 30, 2023
…er, a=testonly

Automatic update from web-platform-tests
CHECK failure with MathML + ::first-letter

Ensure that display: math elements handle ::first-letter the same as
flexbox/grid in order to fix a CHECK failure. display: math elements do
not support linebreaking, so an equivalent testcase for ::first-line
is not possible. The WG is agreeing about whether these pseudo-elements
should indeed be ignored for math layout [1].

[1] w3c/mathml-core#211

Bug: 1495811
Change-Id: Id4eda5573f64e79ece3a94b6f09f991f3251434b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054276
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1229096}

--

wpt-commits: 245a37d4371b4e2a47e322482de8e443de04aca3
wpt-pr: 43323
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Nov 30, 2023
…er, a=testonly

Automatic update from web-platform-tests
CHECK failure with MathML + ::first-letter

Ensure that display: math elements handle ::first-letter the same as
flexbox/grid in order to fix a CHECK failure. display: math elements do
not support linebreaking, so an equivalent testcase for ::first-line
is not possible. The WG is agreeing about whether these pseudo-elements
should indeed be ignored for math layout [1].

[1] w3c/mathml-core#211

Bug: 1495811
Change-Id: Id4eda5573f64e79ece3a94b6f09f991f3251434b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054276
Reviewed-by: Ian Kilpatrick <ikilpatrickchromium.org>
Commit-Queue: Frédéric Wang <fwangigalia.com>
Cr-Commit-Position: refs/heads/main{#1229096}

--

wpt-commits: 245a37d4371b4e2a47e322482de8e443de04aca3
wpt-pr: 43323

UltraBlame original commit: 4476e33e8e6d0872e74ac5e8e16e8b1243812715
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Nov 30, 2023
…er, a=testonly

Automatic update from web-platform-tests
CHECK failure with MathML + ::first-letter

Ensure that display: math elements handle ::first-letter the same as
flexbox/grid in order to fix a CHECK failure. display: math elements do
not support linebreaking, so an equivalent testcase for ::first-line
is not possible. The WG is agreeing about whether these pseudo-elements
should indeed be ignored for math layout [1].

[1] w3c/mathml-core#211

Bug: 1495811
Change-Id: Id4eda5573f64e79ece3a94b6f09f991f3251434b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054276
Reviewed-by: Ian Kilpatrick <ikilpatrickchromium.org>
Commit-Queue: Frédéric Wang <fwangigalia.com>
Cr-Commit-Position: refs/heads/main{#1229096}

--

wpt-commits: 245a37d4371b4e2a47e322482de8e443de04aca3
wpt-pr: 43323

UltraBlame original commit: 4476e33e8e6d0872e74ac5e8e16e8b1243812715
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Nov 30, 2023
…er, a=testonly

Automatic update from web-platform-tests
CHECK failure with MathML + ::first-letter

Ensure that display: math elements handle ::first-letter the same as
flexbox/grid in order to fix a CHECK failure. display: math elements do
not support linebreaking, so an equivalent testcase for ::first-line
is not possible. The WG is agreeing about whether these pseudo-elements
should indeed be ignored for math layout [1].

[1] w3c/mathml-core#211

Bug: 1495811
Change-Id: Id4eda5573f64e79ece3a94b6f09f991f3251434b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054276
Reviewed-by: Ian Kilpatrick <ikilpatrickchromium.org>
Commit-Queue: Frédéric Wang <fwangigalia.com>
Cr-Commit-Position: refs/heads/main{#1229096}

--

wpt-commits: 245a37d4371b4e2a47e322482de8e443de04aca3
wpt-pr: 43323

UltraBlame original commit: 4476e33e8e6d0872e74ac5e8e16e8b1243812715
bkardell added a commit to web-platform-tests/wpt that referenced this issue Apr 11, 2024
* Add tests for ::first-letter and ::first-line with MathML

This is related to w3c/mathml-core#211

Note that this does not necessarily aligned with current browser implementations.

* fix indent

* Correct tests as display math elements _should_ apply first-letter/line for non-mathml elements.  Make the 'do not contribute to parents' test use MathML elements

* resolve fred's comments about style consistency and using math elements

* remove space before period nit

---------

Co-authored-by: Brian Kardell <bkardell@gmail.com>
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Apr 19, 2024
…-line with MathML, a=testonly

Automatic update from web-platform-tests
Add tests for ::first-letter and ::first-line with MathML (#43334)

* Add tests for ::first-letter and ::first-line with MathML

This is related to w3c/mathml-core#211

Note that this does not necessarily aligned with current browser implementations.

* fix indent

* Correct tests as display math elements _should_ apply first-letter/line for non-mathml elements.  Make the 'do not contribute to parents' test use MathML elements

* resolve fred's comments about style consistency and using math elements

* remove space before period nit

---------

Co-authored-by: Brian Kardell <bkardell@gmail.com>
--

wpt-commits: 58bd6e4080be7067719c5a516cd91d9e4356d280
wpt-pr: 43334
ErichDonGubler pushed a commit to ErichDonGubler/firefox that referenced this issue Apr 22, 2024
…-line with MathML, a=testonly

Automatic update from web-platform-tests
Add tests for ::first-letter and ::first-line with MathML (#43334)

* Add tests for ::first-letter and ::first-line with MathML

This is related to w3c/mathml-core#211

Note that this does not necessarily aligned with current browser implementations.

* fix indent

* Correct tests as display math elements _should_ apply first-letter/line for non-mathml elements.  Make the 'do not contribute to parents' test use MathML elements

* resolve fred's comments about style consistency and using math elements

* remove space before period nit

---------

Co-authored-by: Brian Kardell <bkardell@gmail.com>
--

wpt-commits: 58bd6e4080be7067719c5a516cd91d9e4356d280
wpt-pr: 43334
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

4 participants