diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Draw the diffstat bars as SVG
The bars were cells spanning up to 1000 columns of a nested table, which
kept them free of inline styles under a strict CSP but broke the HTML
table model, 18 errors on a commit page, and left Firefox's longest bar
short of the full width. An SVG canvas sized by its attributes is just
as safe under a CSP, validates, and draws every bar exactly to scale.
Diffstat (limited to '')
| -rw-r--r-- | assets/cgit.css | 18 |
1 file changed, 6 insertions, 12 deletions
diff --git a/assets/cgit.css b/assets/cgit.css index af7ea3d..de772e4 100644 --- a/assets/cgit.css +++ b/assets/cgit.css @@ -966,24 +966,18 @@ div#cgit table.diffstat td.graph { vertical-align: middle; } -div#cgit table.diffstat td.graph table { - border: none; - table-layout: fixed; +div#cgit table.diffstat td.graph svg { + display: block; width: 100%; -} - -div#cgit table.diffstat td.graph td { - padding: 0; - border: 0; height: 7pt; } -div#cgit table.diffstat td.graph td.add { - background-color: var(--graph-add); +div#cgit table.diffstat td.graph rect.add { + fill: var(--graph-add); } -div#cgit table.diffstat td.graph td.rem { - background-color: var(--graph-rem); +div#cgit table.diffstat td.graph rect.rem { + fill: var(--graph-rem); } div#cgit div.diffstat-summary { |
