html5

How to tell what's causing slow HTML5 Canvas performance?

How can I tell if the canvas's slow performance is caused by the drawing itself, or the underlying logic that calculates what should be drawn and where? The second part of my question is: how to calculate canvas fps? Here's how I did it, seems logical to me, but I can be absolutely wrong too. Is this the right way to do it? var fps = ...

Make a <br> instead of <div></div> by pressing Enter on a contenteditable

I've written a bit of code in my keyboard event handler to insert a <br> in response to the press of the Enter key: event.preventDefault(); document.execCommand('InsertHTML', true, '<br>'); This only works if the cursor is between two Letters, if its on the end i need two <br>-Elements. Can i detect if i'm on the end of a Line? Or som...

How is scribd html5?

I don't get it... how is Scribd html5 ? In searching for an answer.. the closest I got against is found here: http://loud.anotherquietday.com/post/598121586/scribds-html5-is-a-mess Is there any reason for? ...

CSS @font-face not working in ie

I have the following css that works within Firefox but not i.e.? Obviously the fonts are within the directory... Any suggestions? @font-face { font-family: "Futura"; src: url("../fonts/Futura_Medium_BT.eot"); /* IE */ src: local("Futura"), url( "../fonts/Futura_Medium_BT.ttf" ) format("truetype"); /* non-I...

[JavaScript, Canvas] Create a buffer and work on it

Is it possible to create a buffer of arbitrary size and work on that just like on a canvas element? I would like to create a graphic (> 10'000 x 10'000 pixel) and use methods like drawImage() on that. After everything is done a part should be copied over to the canvas element. createImageData() can make a buffer but there's no way to us...

Why background on section element does not show (height 0)?

i noticed that in the following example, note the classes, i am using 960gs in case the classes css interfered html <section id="main" class="container_12"> <div class="grid_12"> <article> ... css header, footer, section, article, nav, aside { display: block; } #main { background: #fff; } i noticed that #main has a heig...

how to add a youtube video to / with jMediaelement

Does anybody uses jMediaelement (http://protofunc.com/jme/index.html) for HTML5 videos? I am wondering how to display a youtube video. I see there's a demo on the homepage of jMediaelement, but the source code is not provided (clever!). Any idea how to? Thanks ...

What changes are coming to Mobile Safari in iPhone OS 4?

What changes can I expect from Mobile Safari in iPhone OS 4? We're doing lots of client side storage and cache manifesting, so debating on updating to the latest OS when the current (3.1.3) is well tested and working. Any killer features that I should know about? ...

clear pixels under a shape in HTML canvas

I am using an HTML canvas and javascript and I need to clear all of the pixels underneath a shape created by closing a path (for example, I am using flot, and I want to make rounded corners, and to do this, I first need to remove the square corners by drawing a curve on top of the corner to remove the desired pixels). Right now, I am do...

Is there a full implementation of the HTML5 Canvas object for GWT?

I'm looking to perform some dynamic charting based on a model via GWT on HTML5 compliant browsers. I know that the following library exists : GWT Canvas The problem is that this library does not support drawing text within the canvas so I can draw lines but no write text on my charts. I haven't been able to find any other plugin tha...

Can't serve HTML5 video through PHP on Safari/Mac (5.0)

I'm encountering a strange bug in Safari where, when I serve MP4 video through PHP (to obfuscate the file beneath the document root with a token-based authentication system), Safari for some reason fires the <video>'s onerror event, and the video never loads (I can't get any useful information out of the event object sent to onerror — ev...

HTML5 localStorage

Ok, I have to use the localStorage to store an object, and an array. However, whenever i set something, it stores a string value instead. For example: var x = [1,2,3]; localStorage["x"] = x; console.debug(x); //[1, 2, 3] console.debug(localStorage["x"]); //"1,2,3" and objects: var o = {foo:1}; localStorage["o"] = o; console.debug(loc...

Disable validation of HTML5 form elements

In my forms, I'd like to use the new HTML5 form types, for example <input type="url" /> (more info about the types here). The problem is that Chrome wants to be super helpful and validate these elements for me, except that it sucks at it. If it fails the built-in validation, there's no message or indication other than the element gettin...

Getting the value of a HTML5 number input

I'm using one of the new HTML5 input types, number: <input type="number" /> In Opera, which is the only desktop browser I know of which currently recognises it, it renders it as such: The problem I'm facing is one of validation. If a user types something invalid into the field, eg: "abc", the value returned by myInput.value is an e...

HTML5 panoramic

I am using this Flash panoramic viewer (http://flashpanoramas.com/player/). But for devices without Flash support are there any good HTML alternatives? It needs to support proper 3d panoramics such as Google Street View. ...

Web Sockets questions

Hi, I have a couple of questions concerning Web Sockets. The latest Firefox 4.0 nightlies support Web Sockets. So does Webkit (Chrome 4 + Safari 4/5). Internet Explorer 9 is supposed to feature Web Sockets at some point according to Microsoft (before the stable release). Anyway, my questions are: I am building a JavaScript admin int...

HTML5 under IE questions

I'm getting a really bad end of a day as I started to change my main website to the brand new HTML5, but ... I see HTML5 websites and everything looks fine on them, so, when I finished mine I was very pleased... well, not when I moved to a windows machine :( http://balexandre.com/ under Internet Explorer, this shows absolutely not...

Detect the specific iPhone/iPod touch model in Javascript

I am developing a website for Apple i* devices which uses HTML5 webkit features like transitions but I want to disable some of the fancy stuff for older/slower iPhone models like iPhone < 3GS and iPod touch < 3rd Gen because on those devices the transitions are too slow. Is there a way to detect the exact model (not just the OS/User Age...

How can I use a variable within an SVG path creation?

Hi, I'm creating an SVG path using the Raphael library and the following code: this.resultsBoxLine1 = paper.path("M42 10L42 36"); I would like to use variables to dictate the position of the path, however I cannot write like this: this.resultsBoxLine1 = paper.path("MmyVar11 myVar2LmyVar3 myVar4"); Does anybody know how I can do th...

Capture Signature using HTML5 and iPad

Anyone know how this can be done? Would you use a canvas object, svg, jQuery, etc? ...