Thoughts on upcoming releases of DD_roundies and DD_belatedPNG

May 20, 2009

I have an opportunity to do some hacking this weekend and the next, which should (frickin’ finally) yield some new public versions of each lib.  Each should have more than one fix present, particularly in light of the really solid public bug patches I’ve received over email (thank you!).

Today, I found out the hard way that DD_roundies (and by inference, I suspect DD_belatedPNG as well) really hates HTTPS traffic and will cause ‘operation aborted’ errors in some cases (even though I’m NOT doing an appendChild to an unfinished element).  I conjured a solution, nonsensical as it may be… I suppose that is fitting, given that the PNG lib in particular is nonsense to begin with.

Anyway, I’m looking for some feedback, on one idea in particular: both libs require the silent addition of invisible image elements to a given page to determine the sizes of all images that get applied to VML elements.  I, and pretty much anyone who has used DD_belatedPNG to a great degree, have noticed significant initial page load lagging when using that lib.  I suspect it is in part because of the addition of the above mentioned “size-finding” images.

How would you feel about the lib requiring you to add an object literal that would inform the lib of how big the image sizes are… sort of like a configuration object?

This would enable me to skip the whole size-finding bit.  However, it sounds like a pain in the butt.  A compromise: if no config object is detected, the lib runs the size-finding bit once, and spits out a config object in form of some javascript code that can be copied out of a textarea.

Even if it doesn’t save much CPU time, it would at least prevent the need to download a given image twice just to display it once.


8 Responses to “Thoughts on upcoming releases of DD_roundies and DD_belatedPNG”

  1. klucznik Says:

    I’d like to have a way of telling DD_belatedPNG to update image when i change something via javascript the element holding that image ( for example add css class )

    PS jquery version would be great 🙂

    • dillerdesign Says:

      klucznik, that’s a really valid criticism. The lib current reads as many style changes as it can in an unassuming fashion by listening to the onpropertychange events of the “fixed” elements directly.

      I could fix it in an aggressive manner, but at what cost? Listen to onpropertychange events for _every_ element on the page? That would do it (on each event, collect all descendant “fixed” elements and re-render them), but it sounds really CPU intensive. I could be wrong though.

      • klucznik Says:

        I agree that listening for every property change is probably a bit overkill.

        I was thinking about a way of firing update via javascript function on my image when I know something is changed.

        for example:

        var d = DD_belatedPNG.fix(‘#loginbox’);

        or DD_belatedPNG.update(‘#loginbox’);

  2. David Says:

    Sounds like a reasonable idea. However when using dynamic content and thus heights might this not pose a problem? If so perhaps this static object can be optional. So when implementing we can decide to accept the lag or go for the static object.

    In any case i’d be happy when I no longer have to use compatibility mode in ie8 🙂

  3. Adam Says:

    I use it extensively on this candy site I made, along with many other. Many of them have lots of animated divs with rounded corners. I’m not sure how that change would affect that exactly, but it’s nice to be able to do and I hope it doesn’t change.

    One thing I haven’t been able to figure out is the padded areas on anchor tags that are set with display:block. The border and content works and is click-able like a link, but the padded ignores any hover and can’t be clicked.

  4. ice Says:

    Hello, is there a way to apply DD_belatedPNG.fix to body image background?

  5. foldaway Says:

    Hi, Ive recently been experimenting with the last public release of DD_belatedPNG lib & I think I may have found a bug.
    Just incase it is a bug that hasnt made its way onto the bug radar yet Ive uploaded an example which demonstrates the problem.

    Thanks & congratulations on a brilliant bit of code!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: