saucelabs / the-internet

An example application that captures prominent and ugly functionality found on the web. Perfect for writing automated acceptance tests against.
http://the-internet.herokuapp.com
Apache License 2.0
787 stars 648 forks source link

checkbutton page has slightly invalid markup #11

Closed boakley closed 10 years ago

boakley commented 10 years ago

The checkbutton page seems to have some invalid markup. On the checkbutton page you have this markup:

<p>
    <form>
        <input type="checkbox"> unchecked</br>
        <input type="checkbox" checked> checked
    </form>
</p>

When I use chrome and firefox developer tools, it renders the form outside of the paragraph tag, and asking for an xpath returns an xpath that does not include the paragraph tag.

Doing a little digging (I'm not an HTML expert by any means), it appears that a paragraph isn't allowed to have block-level elements inside it, and a form is a block level element. Firefox and chrome seems to auto-close the paragraph before starting the form (and eventually ignoring the following close paragraph tag), but IE does not. This results in slightly different xpaths for the elements in IE versus firefox and chrome.

Since it's technically invalid to have a form inside a paragraph, it would be nice if this page didn't put forms inside of paragraphs.

More information: http://stackoverflow.com/questions/1022041/why-doesnt-form-nested-in-p-validate-as-xhtml

tourdedave commented 10 years ago

I sniped the p tags per your recommendation. I appreciate you logging the issue and doing the research for it.