RE: IE11 and xml:space="preserve"

"Smailus, Thomas O" <[email protected]>
Newsgroups gmane.comp.web.svg
Message-ID <175A0EE510663A46ACD5FF1A03AD46F51F141ED2@XCH-BLV-204.nw.nos.boeing.com>
> -----Original Message-----
> From: Erik Dahlström [mailto:erik@dahlström.net]
> Sent: Thursday, October 01, 2015 13:59
> To: [email protected]; Smailus, Thomas O
> Subject: Re: IE11 and xml:space="preserve"
> 
> On Thu, 01 Oct 2015 22:24:26 +0200, Smailus, Thomas O
> <[email protected]> wrote:
> 
> > I'm finding that IE11 doesn't honor the request to preserve whitespace
> > OR the getBBox() function applied to text/tspan containing extra
> > whitespace is not computing the bounding box as expected (by giving
> > the whitespace content contributing extent)
> >
> > <tspan  font-family="arial" fill="rgb(0,0,0)"  font-size="2.02847"
> > >AIRSPEED - 111 TO 999 KCAS RECOMMENDED (NOT LESS THAN V
> </tspan>
> >
> > Contained within the <text> element is reporting/rendering as if the
> > extra spaces after the "V" were not there or don't contribute to the
> > bounding box computation.
> >
> > The document has xml:space="preserve" declared in the <svg > tag
> >
> > As a work-around, I'm replacing all space characters with non-breaking
> > spaces, but that, as one can imagine, makes a mess of doing text
> > search/matching across the DOM.
> 
> That sounds painful.
> 
> Have you tried using "white-space: pre" instead of xml:space?
> 
> Testcase: http://jsfiddle.net/jhprc28v/
> 
> Cheers
> /Erik



Hm, that doesn't seem to solve the problem, so maybe the BBox() result isn't the issue , it may go back to the problem of IE and the its way of handling tspans.

Note the spaces getting collapsed between the end of one tspan and start of the next

http://jsfiddle.net/thomassmailus/tmehr4z5/2/


Thomas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.