-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
UA style for <br> and <wbr> #2291
Comments
This should be a relatively simple spec fix, right? I guess nobody is going to pass the tests since nobody implements these in CSS from what I understand... not sure what we should do there. Do UAs plan to do so? Maybe we should just give up and stop trying to define these through CSS? |
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4831
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4832 I did not test Edge. Anyway, yeah the spec fix itself should be simple. Slightly more work is probably testing + browser bugs and getting implementors interested in passing the tests... |
In particular the test cases that get the computed (used?) style of br/wbr are the ones I'm worried no engine will ever be interested in passing. |
Hmmm. It's unclear to me if the discussion in https://www.w3.org/Bugs/Public/show_bug.cgi?id=25503 applies equally to the proposed change now. @dbaron? Also I'll note that |
@domenic they pass similar tests for other rules in the user agent stylesheet. Is there a performance concern here? If so, then we should bring that feedback back to the CSS WG, though it would be a little weird for them to recommend something like that then since they have implementers involved too. |
It's more that everyone already has a br implementation that I assume they're happy with. There is a performance concern, which the CSSWG addressed by suggesting the !important reset. That allows implementers to work around the performance issue by having some sort of fast path that uses their existing br logic but reports "fake" used styles. My skepticism is that any implementer would want to implement such a fast path solely for the purpose of passing such tests; it doesn't really have any author or user facing benefit. Stated another way: it's great that we've shown CSS has a way to express br. But actually mandating that the observable world act as if br was rendered via CSS isn't so useful, I imagine. Of course this is all speculation. Maybe there were implementers in the room who were already adding this fast path/used style reporting issue to their Q2 goals. |
I don't think w3c/csswg-drafts#610 (comment) is an accurate reflection of the WG's discussion (in which I did raise performance concerns), which concluded with:
I was arguing for something similar to what Domenic just wrote as I was typing this, and I think the CSS WG agreed. |
Maybe that's not quite accurate, now that I'm remembering the discussion. The idea is that implementations still would have native implementations, but the spec would be defining the expected behavior of those native implementations as equivalent to the given CSS, which (given the |
One further note: given that I think the intent is that implementations have non-CSS <br> implementations, I think the spec should (non-normatively) say that that's the intent, so that readers of the spec understand what was intended. |
Yeah, it's not really helpful to make these elements be defined in terms of UA stylesheet if that's not what we're trying to achieve. It's rather misleading especially if we haven't figured out the compatibility implications. |
I've posted #2298 as an attempt to concretize this discussion. Given the disappointing lack of interop for the test case at http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4837 , we might not be able to come up with something perfect, but at least what's in that PR seems like a start toward something a bit more aligned with implementations than the fictional display types the spec currently uses. |
Yes, that's what the discussion concluded on (implementations should continue to have magic implementations of the elements). @fantasai's post in the issue thread was an inaccurate summary. |
It seems and So |
We might want to re-evaluate how |
Since we're still not officially defining rendering in terms of CSS, I don't think it's necessary to get the "approximated by this CSS" part precisely right; at least, it's not worth adding complications to other CSS features to make this not-used-in-practice CSS exactly match legacy implementation. So we can just document the properties that do have an effect in prose. |
Any chance the CSSWG could take an action item for its members to look up what properties apply in their implementations, so we don't have to write a bunch of test cases? :) |
I can pass that on. :) Note there are use cases for allowing more customization of these elements -- see w3c/csswg-drafts#610 . So I don't think the HTML spec should disallow additional properties applying, just set a minimum for the ones we know need to apply. That way, we can, over time, try to accommodate more of the use cases. |
Thanks. I'm about to post a new draft of #2298 and maybe you can help with the phrasing there. |
The Gecko code for BR is here: https://dxr.mozilla.org/mozilla-central/rev/6d38ad302429c98115c354d643e81987ecec5d3c/layout/generic/BRFrame.cpp#87 |
... and the Gecko code for WBR appears to construct a base-class nsFrame, which I didn't even know happened ever. Its reflow method returns a zero-sized box. I'm not sure how the line-breaking opportunity is introduced, but I'm guessing no CSS properties apply. |
Thanks, that helps. I'm sure This bit also seems interesting:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4947 WebKit/Chromium break the line; Gecko doesn't; IE and Edge 13 don't break but insert some vertical space instead? |
See
w3c/csswg-drafts#610 (comment)
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26264#c6
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28080#c3
The text was updated successfully, but these errors were encountered: