Closed Bug 737785 Opened 12 years ago Closed 3 years ago

Implement 'tab-size' (dropping the -moz- prefix)

Categories

(Core :: CSS Parsing and Computation, defect, P4)

defect

Tracking

()

RESOLVED FIXED
91 Branch
Webcompat Priority revisit
Tracking Status
firefox91 --- fixed

People

(Reporter: mathias, Assigned: jfkthame)

References

(Blocks 2 open bugs)

Details

(Keywords: dev-doc-complete, site-compat)

Attachments

(3 files)

Gecko currently supports `-moz-tab-size`. The `-moz-` prefix should be dropped when CSS3 Text reaches CR. This bug can be used to track that.

http://www.w3.org/TR/css3-text/#tab-size0
OS: Mac OS X → All
Priority: -- → P4
Hardware: x86 → All
Summary: Implement `tab-size` (dropping the `-moz-` prefix) → Implement 'tab-size' (dropping the -moz- prefix)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Looks like WebKit has implemented tab-size without -webkit-.

http://trac.webkit.org/changeset/116723
Blocks: unprefix
css3test.com fails in current Nightly for `tab-size: 1em` but succeeds for `tab-size: 4` (I'm assuming the site auto-prefixes the properties). 

Thus before unprefixing, the actual behavior needs to be fixed first.
Blocks: css3test
Depends on: 943918
Assignee: nobody → matspal
Comment on attachment 8340695 [details] [diff] [review]
Drop the vendor prefix on -moz-tab-size.

As I mention in bug 943918 comment 5, I think we should get calc() working with the integer values before unprefixing.
Attachment #8340695 - Flags: review?(cam)
No longer blocks: css3test
Blocks: css-text-3
Depends on: 594933
Status: NEW → ASSIGNED
@Cameron McCormack I think we should check the calc() in all the integer values.
Depends on: 1308108
Depends on: 1308110
Depends on: 1308113
Depends on: 1308174
I think all the important dependent bugs are fixed now. One remains, but it's for a recent spec-change which hasn't fully baked yet, and hasn't been shipped by anyone else regardless (and Chrome and Safari are still shipping the unprefixed version without that update).

As such, I'm guessing that we may as well ship the unprefixed version too. Here's a fresh patch in case you all agree. It just unprefixes tab-size without also removing the prefixed version (though I don't mind changing it to remove the prefixed version as well, if we'd still rather go ahead and do that).

Try seems fine with the patch as-is: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1f613fa42ee5bd0a529bca18f19f39da968d6ca8
Attachment #8819700 - Flags: review?(cam)
Comment on attachment 8819700 [details] [diff] [review]
737785-unprefix-tab-size.diff

Review of attachment 8819700 [details] [diff] [review]:
-----------------------------------------------------------------

Yeah, I think we're good to go now.
Attachment #8819700 - Flags: review?(cam) → review+
I'm fine for the removal of the prefixed version happens in another bug.  It's probably not a risky property to drop the prefix for, but it needn't hold up exposing the unprefixed version.
Thomas, is there anything blocking you from landing the r+ed patch?
Flags: needinfo?(wisniewskit)
Yes, I'm stuck on the dependent bug waiting on go-ahead from dbaron. I'll ping him to resume discussion on whether we go ahead there, since it looks like we got a reply to our concerns.
Flags: needinfo?(wisniewskit)
Keywords: site-compat
What's the status on this? Just suggested to a site owner that his code output should use the "tab-size" property to suit the standard tab size and discovered it still doesn't work in Firefox. Did this get lost in the shuffle?
This bug is blocked on bug 1308113.
Yeah, but the blocking bug is prioritized as an enhancement, not a bug, causing this actual bug in standards support to stall. Should the depended bug be upgraded in priority due to this?
Blocks: 1524428
Webcompat Priority: --- → ?
Type: defect → task

How is fixing a bug in standards support an "enhancement"?

This bug is 7 YEARS OLD.

How hard can it be to make "tab-size" an alias for "-moz-tab-size"?

It's blocked on bug 1308113, since we're not supposed to ship unprefixed if we don't match the spec. And the next step there is bug 1308113 comment 10.

I know that. But nobody's even assigned to that bug. It's been around for 8 years, and it's been idle for at least 2 years, with the last real activity being ME suggesting that it should be taken off of the back burner it's obviously on!

This bug will never get fixed at this rate.

Also, I was trying to make the point that this is NOT an "enhancement". This is a failure to support the spec. It should be marked as a "defect", not an "enhancement".

See my blog post on the age of bugs for why arguing on the basis that the bug has been open a long time isn't going to help. (Arguing on the basis of user or developer need, or the basis of what other browsers support, is much more relevant.)

(Arguing on the basis of user or developer need, or the basis of what other browsers support, is much more relevant.)

I did that two years ago, if you actually read the history on this bug. I mentioned that this is a problem for a site I use that displays source code that includes tabs. Explaining why, in real-world terms, this needs fixing, is clearly ineffectual in motivating anyone.

As for your blog post, I've read it before. I consider it a very facile argument that relies on a strawman to make its point. Specifically in this case, I'm not asking you to support MS Word documents. I'm looking for support for part of the current CSS spec, on the display of a fundamental Unicode/ASCII character, not some proprietary software, the publisher of which you know the average reader looks at with a sneer. You wrote up that argument 12 years ago and apparently you've been relying on it ever since to deflect reasonable criticisms. Well, I don't accept your argument as valid.

We're talking about handling simple tab characters, which have existed practically since the dawn of computers. This isn't new tech, it's not a new, complex layer on the web, it's just a single style setting that dictates the width of a single Unicode/ASCII character.

Fixing this bug would be as simple as putting in an alias for "tab-size" → "-moz-tab-size". However, apparently "policy" (whose? yours?) says that you can't do that, because "-moz-tab-size" doesn't work right in certain cases and it can't be "tab-size" until it does. But nobody's working on making "-moz-tab-size" work in all cases, because this bug is effectively shielding that bug from ever being in the spotlight by disguising it as a vendor-specific style.

A world in which we have a mostly-spec-supporting "tab-size" would be a lot better than a world in which we have no "tab-size" for another 8+ years while you continue to say, "it's not about how long the bug has been around!"

Just because it's in a spec doesn't mean it's important. There are lots of things that are in specs that we don't implement -- and there's more in specs than we can implement.

That said, the policy you're arguing against is in a spec.

Hi felice, setting aside arguments about standards and priorities for a moment, can you not use -moz-tab-size alongside tab-size in your stylesheet, if a simple alias will do the job in your case? If that's impractical as a work-around in the meantime, it would be good to know.

@David

Just because it's in a spec doesn't mean it's important. There are lots of things that are in specs that we don't implement.

"A" spec. Just some random spec. It's not like it's an important spec. Not, like, one of the spec that govern the entire web. Nah. Not necessarily important. How silly of me to assume it would be.

/s

The whole point of a web browser is that it conforms to a spec so that authors can create web content that users can view consistently. How can you have any pride in your work and still argue that a failure to support the spec doesn't warrant attention even after it's been failing for eight years?

It's not like I don't know who you are. Unless I'm mistaken or out-of-date (admittedly not unusual), you're the guy when it comes to making sure Firefox follows the CSS spec. Why devote this much energy to quashing someone's request that you, or someone you direct, do exactly that?

You're very clearly resisting the idea of getting this and the other associated bug fixed. I won't try to read your mind about why you would do that, but it's pretty clear that you don't want to fix it. So, given your attitude and your role in the project, it presently seems to me that this bug will never be fixed. You might as well mark it "Will not fix, David doesn't think supporting tab-size is important".

@Thomas
We're not clueless about vendor prefix versions. I've said as much. Of course we can work around it.

And hey, we all worked around IE for, what, 20 years? Wasn't that fun?

I'm not here in search of a workaround. I'm trying to find/trigger/elicit an actual solution. If you offered that idea in earnest, then I appreciate the thought, but that's not what I'm here for.

Sigh. I didn't realize the markup here would join my text to the quote immediately above it. My own text above starts inside the quote at "A".

(In reply to David Baron :dbaron: 🏴󠁵󠁳󠁣󠁡󠁿 ⌚UTC-8 from comment #19)

That said, the policy you're arguing against is in a spec.

I just noticed something. Immediately below the policy you're saying disallows removing the prefix in this case is an exception to the policy that seems to apply to cases similar to the one we're discussing:

(from: https://www.w3.org/TR/CSS/#CR-exceptions)

§ 4. Safe to Release pre-CR Exceptions

The following features have been explicitly and proactively cleared by the CSS Working Group for broad release prior to the spec reaching Candidate Recommendation:

The explanation—which you wrote—lists inline-size as one of the excepted properties, and that's actually a rather similar case in my opinion. In fact, I would say that tab-size is conceptually a subset of inline-size, just applied to one specific character element.

At any rate, the spirit of the exception certainly indicates to me that W3C is not excessively concerned with minor flaws in whitespace/padding, on the assumption that browser developers will endeavor to fix those flaws in due time and users will benefit from having otherwise-workable properties in the meantime.

In my limited survey of the web as a whole (yes, I say that with some humor), I find that tab characters are pretty much used only to indent either source code or paragraphs. Other uses, such as tab-separated tables, are usually not intended for formatting, only delimiting fields.

That being said, neither of those primary use cases is currently flawed under -moz-tab-size, as the lack of preceding characters in an indentation means the width calculation is straightforward regardless of font. Furthermore, in cases where source code contains intra-line tab characters, pretty much all will employ fixed-width fonts, because otherwise tabs would not provide reliable spacing and formatting would be unpredictable.

Thus, removing the prefix would allow virtually all practical uses of tabs on the web to work properly with the existing implementation, while the more esoteric fail cases with proportional and unusual international characters/fonts (as I recall from the other bug) are also addressed and fixed over however many months or years.

So, again, I call for an alias to be created for tab-size-moz-tab-size. I think this is entirely reasonable and not at odds with the policy you've linked.

I was also surprised this is not implemented. FF is the only browser which does not support this CSS rule AFAIK.

If that's impractical as a work-around in the meantime, it would be good to know.

Well, it is possible to work around it. However, I use responsive tab width, based on browser width, so it basically makes the CSS cumbersome. I worked around it using var but it's still kind of messy.

@media (min-width: 40em) {
	html {
		--tab-size: 4;
	}
}

@media (min-width: 80em) {
	html {
		--tab-size: 4;
	}
}

pre {
	/* -moz-tab-size is still required by Firefox */
	--tab-size: 2;
	tab-size: var(--tab-size);
	-moz-tab-size: var(--tab-size);
}

Now I have to replicate this to all the sites where I do this kind of responsive design. Sure, it's possible to do it. Am I happy that I have to make a FF specific fix? Not so much, it's unexpected and a time sink.

or the basis of what other browsers support, is much more relevant.

Every other (modern) browser supports tab-size.

Webcompat Priority: ? → revisit

Actually, it looks like Firefox's implementation of tab-size is still failing a couple of reftests (though note the reftests themselves have to be modified to account for the prefix issue):

https://github.com/web-platform-tests/wpt/blob/master/css/css-text/tab-size/tab-size-integer-004.html
https://github.com/web-platform-tests/wpt/blob/master/css/css-text/tab-size/tab-size-spacing-001.html

It looks like it has something to do with making sure it's calculated based on the block container or something? That first test (that was added about two months ago) is weird because if you replace the four spaces with four zeroes sans letter-spacing, you see they're in a smaller font than the one the tab is in, and if you put four reference zeroes in the same font as the tab without letter spacing, the two do align.

I'm not sure what the goal of the spec is here. It seems like they're implying tab-size should ignore font, but that makes no sense because both spaces and zeroes will be different sizes in different fonts. Is this what bug 1308113 is trying to address, or is this a new issue caused by a recent spec decision? Sorry if I'm pointing out something very obvious here, I'm just curious because the whole situation seems to be dancing around a very bizarre technicality in the spec.

felice, I flag your comment to the bugzilla admin as your comments aren't following our code of conduit: https://bugzilla.mozilla.org/page.cgi?id=etiquette.html

I am also restricting access to this bug to people who have editbugs permissions.

Restrict Comments: true
Type: enhancement → defect

I'm proposing to "steal" this bug from Mats, as I have a patch for the behavior issue in bug 1308113 that has been blocking progress here; with that addressed, I think we can resolve this as well.

Assignee: mats → jfkthame

This results in lots of new WPT test passes.

There were also a couple of WPT tests that turned out to be broken;
tab-size-inline-001 and -002 had errors in their reference files such
that they'd never pass anywhere. So those are fixed here.

Depends on D117331

Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c32a18de589c
Un-prefix -moz-tab-size (keeping the prefixed version as an alias for now). r=layout-reviewers,dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/29326 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
Upstream PR merged by moz-wptsync-bot

PRs pending to add to release notes and update BCD.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: