The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

"I think I'll use AJAX and PHP and generated images as a background to fake support for a CSS3 element"

Last post 01-16-2007 4:18 AM by kae. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 12-30-2006 5:12 AM

    • cshobe
    • Not Ranked
    • Joined on 12-30-2006
    • Posts 1

    "I think I'll use AJAX and PHP and generated images as a background to fake support for a CSS3 element"

    This has to be the worst example of code and technology misuse I've ever seen, proudly displayed for your pleasure:

    http://verens.com/archives/2005/03/28/rounded-borders-for-ie-konqueror-opera-and-firefox/

    "if all existing browsers have trouble rendering rounded borders (yes, even firefox), then why not just remove them completely from the CSS and render them as a background image in PHP?"

    Uhh....

    "In other words, scan the CSS, grab any CSS relating to rounded borders, and render the borders as a background image."

    Uhhhhhhhhhmmmmmmm........

    "This thought was electric! Why hadn’t I thought of it before? Why hadn’t anyone else thought of it?"

    *runs screaming* Because you're a moron and it's a horrible idea?!?
  • 12-30-2006 4:51 PM In reply to

    • HeroreV
    • Top 500 Contributor
    • Joined on 01-02-2006
    • East Texas
    • Posts 94

    Re: "I think I'll use AJAX and PHP and generated images as a background to fake support for a CSS3 element"

    The borders aren't even smooth. They're very blocky and jagged. All that work and the end result is terrible.
  • 12-30-2006 6:39 PM In reply to

    Re: "I think I'll use AJAX and PHP and generated images as a background to fake support for a CSS3 element"

    I'd hate to be a maintainer of this code. 681 lines for something very simple like this.

  • 12-31-2006 5:50 AM In reply to

    • Rasit
    • Not Ranked
    • Joined on 12-30-2006
    • Posts 23

    Re: "I think I'll use AJAX and PHP and generated images as a background to fake support for a CSS3 element"

    Oh my god... Try to resize or scroll the page, FF 2.0 suddenly took 99 % of my CPU.

    If I ever encounter a page using that code I will definitly .host block it, such a travesty should not be allowed to exist.

  • 12-31-2006 2:59 PM In reply to

    • kae
    • Not Ranked
    • Joined on 12-31-2006
    • Monaghan, Ireland
    • Posts 2

    Re: "I think I'll use AJAX and PHP and generated images as a background to fake support for a CSS3 element"

    well, I can't say I wasn't warned!

    to be fair, I wrote the thing just to see if I could. I don't think it has ever actually been used as anything other than a demo.

    For an example of fake borders /without/ PHP, try this misuse of JavaScript (anoher of mine :-) )

     

    work: http://webworks.ie/
    play: http://kfm.verens.com/
    kae: http://verens.com/
  • 01-04-2007 8:46 AM In reply to

    Re: "I think I'll use AJAX and PHP and generated images as a background to fake support for a CSS3 element"

    This method is vastly better/easier: http://www.webreference.com/programming/css_borders/index.html

     

    Just use some <b> tags and leave it at that. 

    Disclaimer: I am not now, nor have I to the best of my knowledge been in the past, an actual collision detection algorithm.
  • 01-12-2007 3:56 PM In reply to

    Re: "I think I'll use AJAX and PHP and generated images as a background to fake support for a CSS3 element"

    To be even more fair... I have immense respect for someone who not only admits writing a WTF, but also happily admits that it's a WTF *and* directs us to more code he's written.

    You'll probably go far in this industry. Arguably, the most important part of being a successful developer is being unafraid of mistakes. :)

  • 01-16-2007 4:18 AM In reply to

    • kae
    • Not Ranked
    • Joined on 12-31-2006
    • Monaghan, Ireland
    • Posts 2

    Re: "I think I'll use AJAX and PHP and generated images as a background to fake support for a CSS3 element"

    To be honest, I don't really think it's a real WTF - I wouldn't use the code in production work (which most WTFs seem to...), and it is actually solving a problem which has not been solved elsewhere (most WTFs appear to be grossly over-coded attempts to solve problems which have already been solved).

    The code in question here actually provides a border-radius according to the W3C specs. This is something which no browser does on its own.

    HitScan's example of an existing solution to the perceived problem actually doesn't solve the problem. That example merely provides curved corners. What if  the CSS specifically specifies corners which are 37px radius in Y and 54px radius in X ? The given example will not provide that, but my "WTF" will.

    Anyhow... call it what you will, I had fun writing it, and that's all that matters ;-)
     

    work: http://webworks.ie/
    play: http://kfm.verens.com/
    kae: http://verens.com/
Page 1 of 1 (8 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems