# RE: The outline property on inline elements

From: L. David Baron <dbaron@fas.harvard.edu>
Date: Fri, 16 Jul 1999 19:38:46 -0400 (EDT)
Message-Id: <199907162338.TAA02776@ice3.fas.harvard.edu>

```On Fri, 16 Jul 1999 23:26:46 +0100 (BST), Ian Hickson
(py8ieh@bath.ac.uk) wrote:
> The "minimum outline" version can "easily" be made by simply not drawing
> an outline where the outlines would overlap (a relatively simple way of
> doing it, compared to the "lets actually work out the minimum outline"
> manner). The outline is drawn around each piece of _text_ in an inline
> box, much like a border is drawn around the text in an inline box, but
> ignoring padding. Around replaced elements or block elements, the outline
> is simply drawn around the box.

If you're drawing around the inline boxes and padding and border are
zero, and line-height is more than font-size (which I think is true 99%
of the time), the outlines will *never* overlap.  Even if you include
half-leading, there will often be gaps.  This is the problem.

I think I may have a possible solution to finding this minimum box, but
it would be hard to implement, but I haven't quite finished thinking it
through.  The following is a somewhat mathematical definition of what I
think it should include.  It couldn't be implemented easily this way.
In the following discussion, :before and :after pseudo-elements are
considered elements.  The minimum box or boxes for an outline on an
inline element E should include:

* all points within E's inline box or half-leading of E's inline box

* all points within the inline box or half-leading of all non-replaced
inline descendants of E. (using the position before positioning of
relatively positioned elements)

* all points within the border edge of all replaced inline descendants
of E (using the position before positioning of relatively positioned
elements)

* all points that are on a line parallel to the text direction
connecting any of the above points P to the edge of the region in which
the inline element containing P (i.e., the inline element for which P
was already in the minimum box) flows, that is, the region in which
line boxes in that flow can be, only if the inline box of E is broken
at the end of the line-box adjacent to that edge

* all points that can be connected by both a horizontal and a vertical
line to a point within the same line box that is already in the minimum
box

* all points inside the border edge of any non-positioned,
non-floating, block-level descendants of E

* all points that are on a line perpendicular to the text direction
connecting, without crossing any other inline elements or border edges
of block-level elements in the same flow or margin edges of any other
block-level elements (including floats) in the same flow, any two of
the above points as long as those two points were placed in the minimum
box for being in the normal flow of the same parent.

* all points inside the border edge of any positioned or floating
block-level descendants of E or relatively positioned inline
descendants of E

* no other points

These rules do not correctly account for
* (pseudo-)elements with display marker or compact.
* What else???

I have not thoroughly checked these rules for being exactly what I
want, but I think they are something similar to what I would see as the
optimum answer.  They also require a formal definition of 'in the same
flow'.

David
```
Received on Friday, 16 July 1999 19:38:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:59 GMT