W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2015

Re: [whatwg] Responsive image maps

From: Andrea Rendine <master.skywalker.88@gmail.com>
Date: Fri, 20 Mar 2015 21:30:36 +0100
Message-ID: <CAGxST9=Vx03bTw=mXphvrZ75ALFOKThfRiaVvm30d-VzgPTCRA@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: WHATWG List <whatwg@whatwg.org>, Martin Janecke <whatwg.org@prlbr.com>
SVG can be resized. Everything inside it cannot, as far as it is not
defined by relative units. And percentage is not limited to ingegers, of
course, but it requires a value conversion. And I'm not sure it works with
polygons.


2015-03-20 21:15 GMT+01:00 Tab Atkins Jr. <jackalmage@gmail.com>:

> On Fri, Mar 20, 2015 at 1:00 PM, Andrea Rendine
> <master.skywalker.88@gmail.com> wrote:
> > About SVG, I made a couple of tests and they are far from being
> > comprehensive, but this is the fact. SVG image "maps" need to define 2
> > elements for each "area", i.e. the element itself and its associated
> > hyperlink.
>
> That's really not much:
>
> <svg width=... height=...>
>   <image src=foo ... />
>   <a href=target1><polygon points="..." /></a>
>   <a href=target2><rect ... /></a>
>   ...
> </svg>
>
> The markup complexity seems to be about the same as using
> <img>/<map>/<area>, especially if you accompany it with prose like the
> example in <
> https://html.spec.whatwg.org/multipage/embedded-content.html#the-map-element
> >
> shows.
>
> > And while SVG graphics offers a wider range of instruments, such
> > a complexity is not always of much use. As such it could be useless to
> > vectorially define parts of the image when the purpose is just to apply a
> > series of shaped links on a preexisting "layer-0" image, as it could
> happen
> > with geographical maps, non-vectorial logos/charts, pre-elaborated
> graphics.
> > What is important, instead, is that inline SVG images cannot be resized
> with
> > CSS. And as such they aren't responsive, exactly as image maps.
>
> <svg> elements can be resized by the CSS 'width' and 'height'
> properties just fine.
>
> > The only
> > case where CSS resize applies to SVG graphics is when they're used as
> source
> > for <img> tag (apart from IE). And in that case hyperlinks are disabled.
> > What we are left with is relative measurement, expressed in percentage
> for
> > example, but IMHO this is not optimal. On one hand, measuring on base 100
> > decreases precision,
>
> Percentages are not "base 100".  They're full decimal numbers.  You're
> not limited to integer percentages.
>
> ~TJ
>
Received on Friday, 20 March 2015 20:31:01 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:29 UTC