Cross Browser Canvas Bugs and Compatibility

Cross Browser Canvas Bugs and Compatibility

If you've been working on websites in the last.. hmmm... well if you've ever worked on websites, you'll be familiar with the problem of different browsers behaving differently. If it's CSS, JavaScript or even just ordinary HTML you'll find that each browser has it's own way of understanding what you want it to do.
HTML5 is well underway now, and things are looking up. It's all good, right?

Well, not. Not exactly.

Yes, things are in a much better state. Not just that, but we've also figured out ways to bend the browsers to our will - if() statements to check what JavaScript to use, browser specific <!--[if IE]> tags to fix up the CSS.
We've managed to get by okay. And now with HTML5, we've even got a bunch of new toys to play with. We can embed video without third party plugins, we can render vector graphics natively, and all kinds of awesome things.

There is one small problem though. At this early stage of HTML5 implementations, we're seeing the familiar problem of cross-browser compatibility.
I've recently posted about my use of the canvas element. One thing I had planned to post about there was some of the canvas bugs I've encountered over the last couple of weeks.
That post was getting rather lengthy, so I rewrote it, and have begun writing this one. Read more »


Extending Canvas to Draw Rounded Rectangles

Extending Canvas to Draw Rounded RectanglesRecently, I have been working on some canvas rendered buttons and other UI elements for a little project. So, rather than downloading an image for the buttons, it can be rendered. One problem I encountered was the lack of rounded rectangle drawing methods in the canvas 2D context.
I decided I'd like to make my job a little easier and add a couple of methods to the 2D context:
  • fillRectR()
  • strokeRectR()
So, how do we extend the 2D context of a canvas? I'm glad you asked! Read more »

Basic Password Generator

Not having much time to update the site regularly has been a bit of a problem. But sometimes I do manage to find a few spare minutes here and there to play around with tiny projects. Late last week, I was taking a look at my friend Alastair's blog http://www.lazyefficient.com/ where he had published a small post about a password generation service.

"I used to use http://www.goodpassword.com for generating random passwords for random accounts I created. However when I went there this morning I noticed that the site has gone to a Pay-For-Service model (rather than advertising). You only find this out after clicking the "Generate Password" button."
- lazyefficient.com

So, after taking a look at Alastair's password generator, I decided it'd be a fun little diversion to build my own. Not that I personally use anything like that, but it's more about the joy of coding for me. Read more »


Closure

Google Closure

Google have released their core JavaScript developments tools to the wider community. Apparently they hope that faster, more reliable internet applications will be developed using the same technology used to build popular web apps such as Gmail and Google Docs.

From the Closure site:

Web applications have evolved from simple HTML pages into rich, interactive applications that provide a great user experience. Today's web apps pose a challenge for developers, however: how do you create and maintain efficient JavaScript code that downloads quickly and works across different browsers?
The Closure tools help developers to build rich web applications with JavaScript that is both powerful and efficient.

Read more »


V8? More like V1...

Google V8So a v8 internal combustion engine is a powerful machine. So powerful, that Google chose to name their high-powered, super-fast JavaScript engine after it. It's a clever name... but it seems to be missrepresenting the truth.

Look at it this way: a v8 engine has 8 cylinders; all of them performing the same mechanics which make the engine go.
What about Google's V8? Well, it compiles JavaScript to machine code... let's say that's "firing" a cylinder. Here's the problem: only one instance of V8 can be run per process.
This means if I were to embed V8 in my application, and provide a function for launching a new worker thread to execute JavaScript simultaniously - it just won't work! Read more »


Syndicate content