mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
layout: Implement <table width>
and <center>
.
Improves Hacker News.
This commit is contained in:
parent
263b69cf7f
commit
4b9cd4e65d
13 changed files with 160 additions and 36 deletions
|
@ -11,7 +11,6 @@ pre[wrap] { white-space: pre-wrap; }
|
|||
FIXME: also "align descendants"
|
||||
https://html.spec.whatwg.org/multipage/#align-descendants
|
||||
*/
|
||||
center, div[align=center i], div[align=middle i] { text-align: center; }
|
||||
div[align=left i] { text-align: left; }
|
||||
div[align=right i] { text-align: right; }
|
||||
div[align=justify i] { text-align: justify; }
|
||||
|
|
|
@ -19,6 +19,17 @@ table {
|
|||
font-size: initial;
|
||||
line-height: initial;
|
||||
white-space: initial;
|
||||
/* text-align: initial; -- see FIXME below */
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME(pcwalton): Actually saying `text-align: initial` above breaks `<table>` inside `<center>`
|
||||
* in quirks mode. This is because we (following Gecko, WebKit, and Blink) implement the HTML5
|
||||
* align-descendants rules with a special `text-align: -servo-center`. `text-align: initial`, if
|
||||
* placed on the `<table>` element per the spec, would break this behavior. So we place it on
|
||||
* `<tbody>` instead.
|
||||
*/
|
||||
tbody {
|
||||
text-align: initial;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,3 +19,5 @@ td[align="left"] { text-align: left; }
|
|||
td[align="center"] { text-align: center; }
|
||||
td[align="right"] { text-align: right; }
|
||||
|
||||
center, div[align=center i], div[align=middle i] { text-align: -servo-center; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue