Closed Bug 1309326 Opened 3 years ago Closed 3 years ago
HTML serializer handling of <br> (and other empty tags) inside <pre> is all buggy
+++ This bug was initially created as a clone of Bug #1308675 +++ Consider something like this: <pre>Some text<br>More text</pre> When we run that through our HTML serializer, we increment mPreLevel at the <pre>, increment it again at the <br> start, do NOT decrement it at the <br> end because it's an empty tag, and then end up with a nonzero mPreLevel forever after. And our serializer tests don't catch this, because they run with a display:none iframe, where we never end up touching mPreLevel at all, because it's style-dependent. Yes, just like bug 1308675 but for the HTML serializer. Sorry I didn't notice it immediately. :(
The test change makes sure the test actually tests this codepath. The resulting test expectation changes are all due to the test now recognizing <pre> as preformatted.
Attachment #8799905 - Flags: review?(ehsan)
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/1ae11d588928 Fix the HTML serializer's handling of self-closing tags inside <pre> to correctly keep track of our mPreLevel. r=ehsan
You need to log in before you can comment on or make changes to this bug.