Comments (8)
https://wpt.live/css/css-contain/contain-layout-baseline-005.html
https://wpt.live/css/css-contain/contain-layout-button-001.html
from wpt.
https://chromium-review.googlesource.com/c/chromium/src/+/5479489 - if anyone is curious about the baseline patch.
from wpt.
I'm not yet entirely sure what makes the most sense here, but one other situation that's worth comparing is what happens when these elements have an orthogonal writing-mode. In Firefox, that makes us synthesize a baseline using their border-edge, it seems.
Same WM as parent: https://www.software.hixie.ch/utilities/js/live-dom-viewer/saved/12648
Same WM as parent, plus contain:layout
: https://www.software.hixie.ch/utilities/js/live-dom-viewer/saved/12649
(Firefox uses the bottom content-edge of in the first case, vs. bottom margin-edge in the second case, as IanK noted)
Orthogonal WM to parent: https://www.software.hixie.ch/utilities/js/live-dom-viewer/saved/12647
Orthogonal WM to parent, plus contain:layout
: https://www.software.hixie.ch/utilities/js/live-dom-viewer/saved/12650
(Firefox renders these two^ identically, using the bottom border-edge to synthesize the baseline)
from wpt.
Chrome (v126 dev) seems to synthesize a baseline from the bottom margin-edge, for all of the cases in my previous comment, except for the first one where it uses the content-box bottom for the button
and input type="color"
vs. the margin-box for the others (I think that inconsistency is the thing @bfgeek mentioned as being not correct)
from wpt.
See also whatwg/html#5065
I'm not yet entirely sure what makes the most sense here, but one other situation that's worth comparing is what happens when these elements have an orthogonal writing-mode. In Firefox, that makes us synthesize a baseline using their border-edge, it seems.
(Ignoring <input type=color>
for reasons) My current patch will synthesize based off the content edges in all of the above cases. (Which seems reasonable?)
from wpt.
cc/ @zcorpan
from wpt.
At a high level, I think the following makes sense based on current specs:
contain:layout
makes a box be treated as having no baseline per https://drafts.csswg.org/css-contain-1/#containment-layout- The lack-of-a-baseline forces one to be synthesized per https://drafts.csswg.org/css-align/#generate-baselines ("If a box that participates in baseline alignment has no baseline set, then its alignment baseline is synthesized according to the rules of the formatting context in which it participates" -- technically this is for
align-self:baseline
but it seems reasonable that it's applicable tovertical-align:baseline
as well.)
I'm not entirely sure if how-that-baseline-is-synthesized is well-defined for buttons in an inline context, but it seems worth ensuring it's well-defined & consistent.
from wpt.
Yeah - that's the same logic I followed as well - as such I believe that:
<button></button> <button style="contain:layout"></button>
https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=12662
Should be aligned (ignoring the issue of how to synthesize baselines for button elements). No browser does this today (likely because of the tests).
I'm going to remove the <button>
from one of the tests, and mark the other test as .tentative
from wpt.
Related Issues (20)
- Add support for testing native find-in-page search results
- [css-color] css/css-color/parsing/color-computed-relative-color.html assumes conversion to hwb is lossless HOT 5
- The wpt Writing Tests documentation should be updated HOT 4
- infrastructure/testdriver/click_iframe_crossorigin.sub.html can fail in Firefox HOT 1
- REGRESSION(c3a572d): TypeError: can't compare offset-naive and offset-aware datetimes
- lint for tests with link rel=match and testharness.js
- Do not run tests for PRs still in draft mode HOT 1
- Fa
- Firefox Android runs missing since May 12
- tools/unittests (Python 3.12) are failing
- Lovely
- Azure Pipeline run queued and not restarted HOT 17
- iss
- tytg HOT 1
- WebVTT rendering tests fail widely because of UA-specific cue backgrounds HOT 2
- Incorrect test added for text-transform HOT 8
- UAX 14 not strictly required by css-text HOT 2
- wpt.live lists files instead of tests HOT 1
- [python style] gentestutilsunion.py gives the WebKit style checker hiccup
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wpt.