-
Notifications
You must be signed in to change notification settings - Fork 719
[css-pseudo] Which properties to reset in ::marker #4568
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
Comments
There is also #4206 about
Actually, Chromium LayoutNG supports it, but you don't see it because of the marker alignment, so you need
Note Chromium LayoutNG does support it, but maybe not like you expected? If you use In general I would lean towards not resetting properties unless strictly necessary. |
Whoops, I should have qualified that I'm testing with the versions I have here, which are the latest public ones available - your view from inside is much more accurate, thank you. I presume you have edit rights, if you want to edit that table to correct it please be my guest. I'm making the presumption that markers will not contain newlines. As I said in #4448 I think multi-line markers are a can-of-worms - if they're allowed, the list above will certainly need updating. |
So... I think this is an argument for clearly defining which properties apply to raw text vs to boxes vs to line boxes or their interaction with text, and clarifying that you can set declarations on ::marker and they will inherit to the text it contains. (Applying a property to a box vs letting it inherit through and affect its contents are slightly different concepts.) I have no problem with allowing properties that affect text and not boxes to be applied to ::marker and to inherit through, since that wouldn't change behavior as we further develop a layout model for marker boxes. I am concerned about things like For the rest, I would let So I guess my proposal would be:
I'm not entirely sure about the last two. @dauwhe ? |
The inability to distinguish between inside and outside markers is consistently making the process of styling them (both in terms which properties apply, and what their defaults are) quite a bit more complicated. Would something like |
We should also consider text breaking properties. For example, it's not clear if
|
I suspect you're right, and that we need something like this. Whether we actually expose it is an interesting question, but given that inside markers and outside markers seem call for different behaviors, effectively that's the model we're using. Given that this doesn't introduce any selector-styling loop shenanigans, I suspect we should make it explicit and expose it. And from there, it looks like quite a few of the resets (with or without |
Note that adding If |
Not really, since If we don't allow having markers on markers, then it is only natural than applying list-style-position on the marker itself would do nothing. |
Sure, I mean that for example Chromium legacy reads the |
Exposing :has(::marker:outside) { list-style-position: inside } |
As in, that selector would result in the CSS oscillating between two states? True, but I can also think of: :not(:has(::marker)) { display: list-item }
:has(::marker) { display: block } I can't get |
@faceless2 There is no circularity with ::marker alone, since it exists even with
|
Ah, very true. I'll try to come up with another one :-) Edit: not sure I can actually. So yes, I agree that setting |
While we're considering which properties apply or don't, and reset or don't, it seems that the text-decoration properties in general, and the text-decoration-skip family of properties in particular should apply. (initially raised in #843). |
#4574 also has some discussions about text decoration in markers. |
Filed follow-up to #4568 (comment) in #5303 |
Agenda+ F2F because resetting
And I guess No strong opinion about the others, but I don't see much benefit in resetting them. |
@Loirooriol My position is in #4568 (comment) Basically:
|
The CSS Working Group just discussed
The full IRC log of that discussion |
The CSSWG resolved in w3c/csswg-drafts#4568 that properties like 'text-indent' that don't apply to ::marker, should not be able to affect the ::marker via inheritance when set to an ancestor. Therefore, this patch sets 'text-indent: 0 !important' in UA origin. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-content-023.html TEST=external/wpt/css/css-pseudo/marker-default-styles.html TEST=http/tests/devtools/elements/styles-2/pseudo-elements.js Change-Id: I4dd9e8afd448bd5fe237c084d3c0215e91560dd1
The CSSWG resolved in w3c/csswg-drafts#4568 that properties like 'text-indent' that don't apply to ::marker, should not be able to affect the ::marker via inheritance when set to an ancestor. Therefore, this patch sets 'text-indent: 0 !important' in UA origin. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-content-023.html TEST=external/wpt/css/css-pseudo/marker-default-styles.html TEST=http/tests/devtools/elements/styles-2/pseudo-elements.js Change-Id: I4dd9e8afd448bd5fe237c084d3c0215e91560dd1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2382750 Reviewed-by: Rune LillesveenReviewed-by: Koji Ishii Commit-Queue: Oriol Brufau Cr-Commit-Position: refs/heads/master@{#803126}
The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. Therefore, this patch allows text-decoration-skip-ink, text-emphasis, -webkit-text-emphasis-color, -webkit-text-emphasis-position, -webkit-text-emphasis-style, and text-shadow in ::marker. text-underline-position is not allowed despite being inherited because it doesn't affect underlines specified by ancestor elements. And since text-decoration-line is not allowed, it would be pointless. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-text-decoration-skip-ink.html TEST=external/wpt/css/css-pseudo/marker-text-emphasis.html TEST=external/wpt/css/css-pseudo/marker-text-shadow.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html Some parsing tests fail because unprefixed text-emphasis hasn't been implemented. And some reftests fail in legacy because ::markers with 'content: normal' are not implemented using actual text. Change-Id: I3bd7287f0e8164a7fac0ed84dd4ec0af57a34f2e
The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. Therefore, this patch allows text-decoration-skip-ink, text-emphasis, -webkit-text-emphasis-color, -webkit-text-emphasis-position, -webkit-text-emphasis-style, and text-shadow in ::marker. text-underline-position is not allowed despite being inherited because it doesn't affect underlines specified by ancestor elements. And since text-decoration-line is not allowed, it would be pointless. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-text-decoration-skip-ink.html TEST=external/wpt/css/css-pseudo/marker-text-emphasis.html TEST=external/wpt/css/css-pseudo/marker-text-shadow.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html Some parsing tests fail because unprefixed text-emphasis hasn't been implemented. And some reftests fail in legacy because ::markers with 'content: normal' are not implemented using actual text. Change-Id: I3bd7287f0e8164a7fac0ed84dd4ec0af57a34f2e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2396125 Commit-Queue: Oriol BrufauReviewed-by: Rune Lillesveen Cr-Commit-Position: refs/heads/master@{#805343}
The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. Therefore, this patch allows text-decoration-skip-ink, text-emphasis, -webkit-text-emphasis-color, -webkit-text-emphasis-position, -webkit-text-emphasis-style, and text-shadow in ::marker. text-underline-position is not allowed despite being inherited because it doesn't affect underlines specified by ancestor elements. And since text-decoration-line is not allowed, it would be pointless. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-text-decoration-skip-ink.html TEST=external/wpt/css/css-pseudo/marker-text-emphasis.html TEST=external/wpt/css/css-pseudo/marker-text-shadow.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html Some parsing tests fail because unprefixed text-emphasis hasn't been implemented. And some reftests fail in legacy because ::markers with 'content: normal' are not implemented using actual text. Change-Id: I3bd7287f0e8164a7fac0ed84dd4ec0af57a34f2e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2396125 Commit-Queue: Oriol BrufauReviewed-by: Rune Lillesveen Cr-Commit-Position: refs/heads/master@{#805343}
@Loirooriol Edits checked in, mind reviewing (and closing out the issue if it looks OK)? |
csswg-drafts/css-lists-3/Overview.bs Lines 227 to 228 in 16f9106
What about the user origin? I would say no effect either, so that the behavior can be achieved with |
I'd like to note for the record that I strongly disagree with this resolution. |
@MatsPalmgren But this is just until the outside marker layout model becomes clear. Then it will be fine to allow authors to change the properties. IMO the resolution is a step forwards since it allows several properties that were not allowed beforehand. |
This is the wrong way to go about it IMHO. Doing a long series of backward-incompatible changes to how properties work for |
Very strongly agree with this. ::marker is implemented by Gecko, our engine, PrinceXML, PDFReactor's RealObjects, Antenna House Formatter and Weazyprint - those are the ones I'm aware of. Every one of these has had to guess at the layout rules because they're not properly defined. I also agree with Mats that it's easy: we do largely what he describes in #3771 (specifically: remove newlines; lay out as if it were an inline-block in infinite available space so content is necessarily on a single line; align inline border box with list-item and block align as if it were on first formatted line of list-item; markers do not interact with floats and may overlap). However as we all know, the devil is in those details (Gecko trims all trailing whitespace; we don't, Prince doesn't. Prince allows newlines; we don't, Gecko doesn't. Prince adds |
@faceless2 BTW, Blink is shipping ::marker in 86 (currently beta). And WebKit shipped it long time ago, but it's a more limited version. |
About this resolution:
I'm thinking about the Or the So I wouldn't prevent their inheritance and it could also make sense to accept them to be set directly on ::marker. |
The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. Therefore, this patch allows 'line-height'. Note it was already possibly to set it to the list item and the ::marker would inherit it. This patch just lets authors set it directly to the ::marker. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-line-height.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html marker-line-height.html fails in legacy because ::markers with 'content: normal' are not implemented with actual text. Change-Id: If63095d046150a2b5f76c40fce93fce1c0e7741c
The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. And in w3c/csswg-drafts#5303 it resolved that 'line-height' applies to text (as it already does in Chromium). Therefore, this patch allows 'line-height' in ::marker. Note it was already possibly to set it to the list item and the ::marker would inherit it. Just letting authors set it directly to the ::marker. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-line-height.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html marker-line-height.html fails in legacy because ::markers with 'content: normal' are not implemented with actual text. Change-Id: If63095d046150a2b5f76c40fce93fce1c0e7741c
The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. And in w3c/csswg-drafts#5303 it resolved that 'line-height' applies to text (as it already does in Chromium). Therefore, this patch allows 'line-height' in ::marker. Note it was already possibly to set it to the list item and the ::marker would inherit it. Just letting authors set it directly to the ::marker. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-line-height.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html marker-line-height.html fails in legacy because ::markers with 'content: normal' are not implemented with actual text. Change-Id: If63095d046150a2b5f76c40fce93fce1c0e7741c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438413 Commit-Queue: Oriol BrufauReviewed-by: Rune Lillesveen Reviewed-by: Koji Ishii Cr-Commit-Position: refs/heads/master@{#821293}
The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. And in w3c/csswg-drafts#5303 it resolved that 'line-height' applies to text (as it already does in Chromium). Therefore, this patch allows 'line-height' in ::marker. Note it was already possibly to set it to the list item and the ::marker would inherit it. Just letting authors set it directly to the ::marker. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-line-height.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html marker-line-height.html fails in legacy because ::markers with 'content: normal' are not implemented with actual text. Change-Id: If63095d046150a2b5f76c40fce93fce1c0e7741c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438413 Commit-Queue: Oriol BrufauReviewed-by: Rune Lillesveen Reviewed-by: Koji Ishii Cr-Commit-Position: refs/heads/master@{#821293}
The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. And in w3c/csswg-drafts#5303 it resolved that 'line-height' applies to text (as it already does in Chromium). Therefore, this patch allows 'line-height' in ::marker. Note it was already possibly to set it to the list item and the ::marker would inherit it. Just letting authors set it directly to the ::marker. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-line-height.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html marker-line-height.html fails in legacy because ::markers with 'content: normal' are not implemented with actual text. Change-Id: If63095d046150a2b5f76c40fce93fce1c0e7741c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438413 Commit-Queue: Oriol BrufauReviewed-by: Rune Lillesveen Reviewed-by: Koji Ishii Cr-Commit-Position: refs/heads/master@{#821293}
…rty in ::marker, a=testonly Automatic update from web-platform-tests [css-pseudo] Support 'line-height' property in ::marker The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. And in w3c/csswg-drafts#5303 it resolved that 'line-height' applies to text (as it already does in Chromium). Therefore, this patch allows 'line-height' in ::marker. Note it was already possibly to set it to the list item and the ::marker would inherit it. Just letting authors set it directly to the ::marker. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-line-height.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html marker-line-height.html fails in legacy because ::markers with 'content: normal' are not implemented with actual text. Change-Id: If63095d046150a2b5f76c40fce93fce1c0e7741c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438413 Commit-Queue: Oriol BrufauReviewed-by: Rune Lillesveen Reviewed-by: Koji Ishii Cr-Commit-Position: refs/heads/master@{#821293} -- wpt-commits: 91da84149d57c560e3435866fd198d1910c22e3f wpt-pr: 25886
…rty in ::marker, a=testonly Automatic update from web-platform-tests [css-pseudo] Support 'line-height' property in ::marker The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. And in w3c/csswg-drafts#5303 it resolved that 'line-height' applies to text (as it already does in Chromium). Therefore, this patch allows 'line-height' in ::marker. Note it was already possibly to set it to the list item and the ::marker would inherit it. Just letting authors set it directly to the ::marker. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-line-height.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html marker-line-height.html fails in legacy because ::markers with 'content: normal' are not implemented with actual text. Change-Id: If63095d046150a2b5f76c40fce93fce1c0e7741c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438413 Commit-Queue: Oriol BrufauReviewed-by: Rune Lillesveen Reviewed-by: Koji Ishii Cr-Commit-Position: refs/heads/master@{#821293} -- wpt-commits: 91da84149d57c560e3435866fd198d1910c22e3f wpt-pr: 25886
Ok, pushed some wording changes:
Let me know if this is workable, or if the wording needs additional tweaking. CC @tabatkins for review. As for whether this is the right approach or if we should go ahead and define marker layout... If anyone wants to start work on the outside marker layout project right now, I invite you to start a css-lists-4 delta ED in the repository and start drafting it up. I can't prioritize it right now personally, but this isn't to say that we shouldn't be working on it. But I think it will take 1-3 years, not 1-3 months, before we shake out all the issues and that's with someone actively working on it. Which is why I don't want to hold up everything else in css-lists-3 (most of which is already shipping) to wait for it. In the meantime, I think it's best to disable most styling of ::marker until we can work out what exactly it means, so that authors don't build a dependency on particular behaviors that we end up wanting to change as we work through all the outside marker layout issues. If you disagree on this point and would like to argue for letting whatever interop and Web-compat constraints fall out of authors exploiting various layout properties on your implementations dictate what we're able to define for outside marker layout going forward, please make a cogent argument to that effect. But I think it's safest if such properties don't have any effect until we are agreed on what exactly that effect will be. |
…rty in ::marker, a=testonly Automatic update from web-platform-tests [css-pseudo] Support 'line-height' property in ::marker The CSSWG resolved in w3c/csswg-drafts#4568 that inherited properties that apply to text can be set on ::marker and should affect the marker text. And in w3c/csswg-drafts#5303 it resolved that 'line-height' applies to text (as it already does in Chromium). Therefore, this patch allows 'line-height' in ::marker. Note it was already possibly to set it to the list item and the ::marker would inherit it. Just letting authors set it directly to the ::marker. Bug: 1031667 TEST=external/wpt/css/css-pseudo/marker-line-height.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties-in-animation.html TEST=external/wpt/css/css-pseudo/parsing/marker-supported-properties.html marker-line-height.html fails in legacy because ::markers with 'content: normal' are not implemented with actual text. Change-Id: If63095d046150a2b5f76c40fce93fce1c0e7741c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438413 Commit-Queue: Oriol BrufauReviewed-by: Rune Lillesveen Reviewed-by: Koji Ishii Cr-Commit-Position: refs/heads/master@{#821293} -- wpt-commits: 91da84149d57c560e3435866fd198d1910c22e3f wpt-pr: 25886
Uh oh!
There was an error while loading. Please reload this page.
Migrated from #4474
The specification currently states that only the following properties apply to ::marker:
...and that this list is likely to be revised. But markers don't exist in a vacuum; they're part of the tree, so even properties that don't apply will need to be reset if they're inheritable, to
initial
or some other sensible value.As of today the specification has
with
white-space
to be reset to something closely resemblingpre
(#4448).So, starting with inheritable properties in css-text and
text-shadow
from css-text-decor, and working on the presumption that markers will always be limited to a single line, we have these properties to consider:I'm going to leave
tab-size
, it's technically applicable but the only place this would ever happen is a WPT test-case. I suppose a decision has to be made, but I doubt it matters what that is.I think
hanging-punctuation
doesn't apply - all values other thanforce-end
will apply only if the text wraps, andforce-end
only applies to the end of the line. As white-space won't collapse in markers, and a space will almost always follow the punctuation I don't think that's the case, but will test for completeness (although as this depends on browser support for bothhanging-punctuation
and custom markers, it might not be a very useful test).Test is here: https://output.jsbin.com/rusilefogo
Findings:
Everyone's different, isn't that fun! To start the ball off on the discussion below, I'd suggest:
(edit: pinging @MatsPalmgren @dauwhe and @fantasai for input as suggested by @fantasai in the original issue)
The text was updated successfully, but these errors were encountered: