layout: Implement outline per CSS 2.1 § 18.4.

`invert` is not yet supported.

Objects that get layers will not yet display outlines properly. This is
because our overflow calculation doesn't take styles into account and
because layers are always anchored to the top left of the border box.
Since fixing this is work that is not related to outline *per se* I'm
leaving that to a followup and making a note in the code.
This commit is contained in:
Patrick Walton 2014-12-08 23:29:41 -08:00
parent 512d55ecef
commit 52b9951cad
10 changed files with 242 additions and 6 deletions

View file

@ -1177,6 +1177,11 @@ impl<'a> MutableFlowUtils for &'a mut Flow + 'a {
/// Assumption: Absolute descendants have had their overflow calculated.
fn store_overflow(self, _: &LayoutContext) {
let my_position = mut_base(self).position;
// FIXME(pcwalton): We should calculate overflow on a per-fragment basis, because their
// styles can affect overflow regions. Consider `box-shadow`, `outline`, etc.--anything
// that can draw outside the border box. For now we assume overflow is the border box, but
// that is wrong.
let mut overflow = my_position;
if self.is_block_container() {