Created attachment 337156
proposed patch (no longer calling FlushTags)
Summary of changes:
- CNavDTD::HandleSavedTokens is now responsible for instructing
the content sink to close forms created (e.g., by
CNavDTD::CreateContextStackFor) during the execution of
HandleSavedTokens. Intuitively, CNavDTD::CloseContainersTo
should do this, but the parser forgets about forms after
opening them (a deliberate design choice that I didn't make).
Closing these forms before calling HTMLContentSink::EndContext
ensures that the sink is completely flushed before it throws
away the current context (with its mInsertionPoint
information), which solves the double rendering bug without
requiring any calls to FlushTags.
- Introduced CNavDTD::CloseResidualStyleTags to fix another bug
that was involved in the original test case but orthogonal to
the double rendering issue. To explain: residual tags get
pushed inside block elements when the document has any
malformed tags, and the sink refuses to close a form if any
tags inside the form are still open. So form closure fails
when there are any malformed tags, unless we close all the
residual tags still open within the form. This failure causes
subsequent nodes to nest inside the unclosed form (sometimes
forms within forms!), as reftest bug448564-1_*.html
demonstrates. My bug448564_4*.html reftest verifies that
CNavDTD::OpenTransientStyles reopens the residual tags.
- Decomposition of SinkContext::Node::Add. Not a functional
change, just a little cleanup.
Created attachment 337156
proposed patch (no longer calling FlushTags)
Summary of changes:
- CNavDTD: :HandleSavedTok ens is now responsible for instructing :CreateContextS tackFor) during the execution of kens. Intuitively, CNavDTD: :CloseContainer sTo ::EndContext
the content sink to close forms created (e.g., by
CNavDTD:
HandleSavedTo
should do this, but the parser forgets about forms after
opening them (a deliberate design choice that I didn't make).
Closing these forms before calling HTMLContentSink
ensures that the sink is completely flushed before it throws
away the current context (with its mInsertionPoint
information), which solves the double rendering bug without
requiring any calls to FlushTags.
- Introduced CNavDTD: :CloseResidualS tyleTags to fix another bug :OpenTransientS tyles reopens the residual tags.
that was involved in the original test case but orthogonal to
the double rendering issue. To explain: residual tags get
pushed inside block elements when the document has any
malformed tags, and the sink refuses to close a form if any
tags inside the form are still open. So form closure fails
when there are any malformed tags, unless we close all the
residual tags still open within the form. This failure causes
subsequent nodes to nest inside the unclosed form (sometimes
forms within forms!), as reftest bug448564-1_*.html
demonstrates. My bug448564_4*.html reftest verifies that
CNavDTD:
- Decomposition of SinkContext: :Node:: Add. Not a functional
change, just a little cleanup.
- Miscellaneous assertions.
- Six reftests and one crashtest.