On a Mac, with build 652 of Opa, the following code results in a box with 'Something' next to it on Safari and Google Chrome, but just the box with Firefox. They both seem to be getting identical HTML. Is this user error?
server = Server.of_bundle()
server = Server.simple_dispatch(start)
HTML received by browser:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="/_internal_/jvhapartigfviysmzqufxojlnxfnzxpt/css/dyn_css.css" xmlns="http://www.w3.org/1999/xhtml"/>
We serve different content-types to Firefox (application/xhtml+xml) and Chrome (text/html) as a work-around to a Chrome bug (http://code.google.com/p/chromium/issues/detail?id=45440).
Your example shows that this work-around is definitely bad, as browsers behaviors are very different depending on the content-type. You can do the test without Opa, with simple files: if you name them .html, browsers will assume it's text/html, if you name them .xhtml, they will assume it's application/xhtml+xml. On these test files, Chrome and Firefox behave in the same way.
So our plan is:
Then your code would be consistent (and not show "Something" on any browser). You may instead use the value and/or placeholder attributes, or a label tag outside of the input.
Of course it'd be great that the Chrome teams fixes the bug... (Every one is invited to "star" it, by the way.)
Cool, thanks for looking into this.
No more workaround