Closed Bug 1308675 Opened 8 years ago Closed 8 years ago

XHTML serializer handling of <br> (and other self-closing tags) inside <pre> is all buggy

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

Consider something like this:

  <pre>Some text<br />More text</pre>

When we run that through our XHTML 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 self-closing, 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.
Blocks: 548397
The test change makes sure the test actually tests this codepath.  The resulting
test changes are all due to the test now recognizing <pre> as preformatted.
Attachment #8799095 - Flags: review?(ehsan)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #8799095 - Flags: review?(ehsan) → review+
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1fdcea1595a4
Fix the XHTML serializer's handling of self-closing tags inside <pre> to correctly keep track of our mPreLevel.  r=ehsan
https://hg.mozilla.org/mozilla-central/rev/1fdcea1595a4
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: