<Glazblog/>

Webslices, the bloody painful clickable icon

So the main problem with IE8's implementation of webslices was, from my mozillian point of view, the clickable icon appearing in the web page when the pointer hovers over a webslice:

  • positioning an image like that requires the image to be a child of the body, not of the slice. It would break the layout if for instance the slice were a table and the image a direct child of that table...
  • when you apply from chrome JS an XBL to an HTML element in a browser, there are severe limitations to what you can do from chrome JS; for instance, it's almost impossible to reach the properties of your bound elements
  • of course, you want the icon to appear when you hover over the slice, and disappear when you leave the slice. But the icon cannot be a child of the slice, so it disappears when the pointer moves to the slice... sigh.
  • XBL are unbound from HTML elements only if you apply another binding, that's a bug; -moz-binding: none has no effect

I was tired so I went to bed rather early with the feeling this was going the bad way. Simple problem, too complex to solve. Around 4am, a cat woke me up, probably chasing a bird or fighting another cat in the gardens in front of my bedroom's window. Could not sleep again so I went to my desk and after long (really long) fights with XBL and the DOM, I finally succeeded. It's a bit hacky, because I had to find a suitable workaround for each issue expressed above, but it works beautifully. The icon is clickable and that registers a new webslice in the toolbar. Finally. I can now go back to bed and sleep peacefully :-)