[whatwg] Styling of area elements (as displayed within referencing image)

L. David Baron dbaron at dbaron.org
Thu May 10 11:21:21 PDT 2007

The interaction of area elements with CSS styling is not defined in
HTML 5.  Since area elements are particularly unusual (in that they
appear an arbitrary number of times, whenever their containing map
is linked to by an img), I think it should be.

What Mozilla implements (as of Mozilla 1.8.1 / Firefox 2.0) is
described by the following proposed spec text:

# The CSS 'cursor' property must be applied to areas as displayed
# within the referencing image.  Selectors that match the area (such
# as 'area', ':link', ':visited') must apply normally when
# determining what CSS rules match (that is, selectors match the
# area's actual position in the content tree, not the referencing
# image).  However, inherited properties must inherit from the
# referencing image rather than from the area's parent element.

Note that this rule causes areas with usable href attributes to be
matched by a rule like ":link, :visited { cursor: pointer }" in the
UA style sheet, but lets areas without href attributes use the
cursor property from the referencing image.

Also note that I invented the term "referencing image" for use in
the text above, and it might need to be defined if it's not deemed
sufficiently obvious.

I'm not sure whether the spec should say that other properties don't
apply.  Some other properties from [2] may also be useful.  But
Mozilla doesn't apply any properties other than 'cursor' to the
display of the area within the referencing image.

(Mozilla also implements this for a elements as used in image maps,
but I think that's been removed from HTML 5.)

Some comments about the behavior of other browsers (with testcase)
are available at [1].


[1] https://bugzilla.mozilla.org/show_bug.cgi?id=302536#c58
[2] http://www.w3.org/TR/css3-ui/

L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20070510/e2d0e321/attachment-0001.pgp>

More information about the whatwg mailing list