Closed Bug 1530048 Opened 7 months ago Closed 7 months ago

HTML spec says tables should have `border-color:gray`, but we only do that in quirks mode

Categories

(Core :: Layout: Tables, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

()

Details

Attachments

(5 files, 1 obsolete file)

The html spec says that tables should have border-color:gray:

table, td, th { border-color: gray; }

We specify that in our quirks-mode stylesheet, so we only give tables gray borders in quirks mode, but we give them black (i.e. default-color) borders in standards mode.
https://searchfox.org/mozilla-central/rev/dc0adc07db3df9431a0876156f50c65d580010cb/layout/style/res/quirk.css#55-60

Here are how different browsers render the attached testcases (listing the border colors as "outer/inner", i.e. "table/td"):

                         Firefox 67     Chrome 74 and Safari 12    Edge 18 & IE11
Standards-mode colors:   black/black         gray/black              Black/Black
Quirks-mode colors:      gray/gray           gray/black              Black/Black

So:

  • We're the only browser to have a difference based on quirks-mode.
  • We're the only browser to ever render gray borders for the td (and th) elements (though it's what the spec says we're supposed to do).
  • We have a comment saying our gray color is "for compatibility" (presumably with IE, in the old days), but Edge/IE don't have any special non-default border-coloring behavior for tables anymore (!!)

Maybe we should just get the spec updated? Given the lack of compatibility here and the agreement between Edge and Firefox (and Chrome for td/th), I'm not sure it's useful for HTML to specify a special default "border-color" for table elements that disagrees with the browser ~consensus.

It looks like our quirks-mode rule dates back to https://bugzilla.mozilla.org/show_bug.cgi?id=84307#c20

See also bug 370833 -- the testcases on that bug are interesting (using <table border>) and seem to behave a bit differently...

And I filed https://bugs.chromium.org/p/chromium/issues/detail?id=935708 and https://bugs.webkit.org/show_bug.cgi?id=195015 on the Chrome/Safari (Blink/WebKit) magic behavior for inset/outset cells' border colors (which is shown in the middle section of testcase 3).

Flags: needinfo?(dholbert)

This quirk was originally for compatibility with IE, but IE doesn't have this
special behavior anymore (in quirks-mode or in standards-mode).
And Blink/WebKit have yet another set of behaviors, which are also not
quirks-mode-dependent, and vary depending on the part of the table:
https://bugs.chromium.org/p/chromium/issues/detail?id=935708
https://bugs.chromium.org/p/chromium/issues/detail?id=935729

Try run is green, which means we don't have any test coverage for this quirk (I should probably add some before landing).

Flags: needinfo?(dholbert)
Flags: needinfo?(dholbert)
Attachment #9046610 - Attachment description: Bug 1530048: Remove quirks-mode-only UA stylesheet rule that made table borders gray. r?dbaron → Bug 1530048 part 1: Remove quirks-mode-only UA stylesheet rule that made table borders gray. r?dbaron
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Flags: needinfo?(dholbert)
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8ff9537201ef
part 1: Remove quirks-mode-only UA stylesheet rule that made table borders gray. r=dbaron
https://hg.mozilla.org/integration/autoland/rev/72127702116c
part 2: Add test to verify that table, td, and th draw borders using 'currentColor'. r=dbaron
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/15748 for changes under testing/web-platform/tests
Can't merge web-platform-tests PR due to failing upstream checks:
Github PR https://github.com/web-platform-tests/wpt/pull/15748
* Taskcluster (pull_request) (https://tools.taskcluster.net/task-group-inspector/#/f5byuvYzSq-fxen70Fqm8Q)

The "can't merge" reason is bogus; I left a comment in the pull request.

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