Firefox Changing Source Code on H Tags within DT Tags

While other browsers let you get away with it Firefox won't.

Following HTML markup for a plain old definition list:

<dl>
  <dt>
  <h3>Some Title</h3>
  </dt>
  <dd>
  </dd>
</dl>

Turns out all common browser let you get away with it and keep your source untouched.

BUT Firefox turns your above code into:

<dl>
  <dt>
  </dt>
  <h3>Some Title</h3>
  <dd>
  </dd>
</dl>

Which can potentially screw up your design for this definition list depending on css used.

W3 Validator gives an error:

document type does not allow element "h3" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

Turning the dt into dd tags would be perfectly valid and left untouched by Firefox:

<dl>
  <dd>
  <h3>Some Title</h3>
  </dd>
  <dd>
  </dd>
</dl>

I don't know how crawlers/SEO react on missing dt tags within dl tags. I guess the safest way would be to find an alternate way to the above approach.

Rearranging the source code is not really something I would expect Firefox to do.