jquery.suggestions: Handle CSS ellipsis better for IE
authorBartosz Dziewoński <matma.rex@gmail.com>
Sun, 25 May 2014 12:09:10 +0000 (14:09 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 28 May 2014 21:36:30 +0000 (23:36 +0200)
commit1a04fb81cfca8bde9b05ceb17aa7775d94fcf24c
treee9e161a511abc443a735ca44873461a95be39ad9
parent14a5ce33daf3c46646e6e18ff59c9b82311dac6a
jquery.suggestions: Handle CSS ellipsis better for IE

IE is not impressed by our puny hacks and still reports the width
"in context of" the position in the document, limited by the width
of ancestor elements.

Let's temporarily apply position: absolute; to the involved elements.
This pulls them out of normal document flow and lets us figure out the
real width at last.

Also wrote a proper comment on why we need this stuff.

Verified that this fixes:
* IE 8
* IE 11

Verified that it doesn't break:
* Firefox 3.6
* Firefox 29
* Opera 12
* Opera 22

It *does not* fix IE 6. I don't think that investigating why is a good
use of my time, so I didn't. I84fbae5a made the functionality usable
on IE 6, which feels good enough for me.

Bug: 65224
Change-Id: I4a7357543ca244585ade2061b92f5a6d1e439278
resources/src/jquery/jquery.suggestions.js