Bug 1766685 - Do not perform page-breaks in the destructor of the page name tracker...
commit2ab827df0d5159924b6f05f052ec66fc82c024cb
authorEmily McDonough <emcdonough@mozilla.com>
Mon, 1 Aug 2022 20:17:34 +0000 (1 20:17 +0000)
committerEmily McDonough <emcdonough@mozilla.com>
Mon, 1 Aug 2022 20:17:34 +0000 (1 20:17 +0000)
treea85d114e8feb0fd6e0c4637389def430ddd63e8b
parent07bcbd6c5e5049ca24a597659afa1f48f9607477
Bug 1766685 - Do not perform page-breaks in the destructor of the page name tracker RAII struct r=dholbert

Instead, do this just before we addd the frame construction items, where CSS
break-after/break-before is handled.

This also fixes the expectations of three tests where our expectations have
changed. The test page-name-img-001 now succeeds with correct results because
of this change, though the other img and the canvas tests fail due issues with
fragmentation named pages and replaced frames.

The issues with replaced frames are currently caused because our page-break
logic occurs in nsCSSFrameConstructor::AddFrameConstructionItemsInternal, but
this is performed for the parent frame. As the replaced frames have no
children, we never process their children in
nsCSSFrameConstructor::AddFrameConstructionItemsInternal.

The issue with replaced frames will be fixed by
https://bugzilla.mozilla.org/1779645

Differential Revision: https://phabricator.services.mozilla.com/D151331
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
layout/reftests/css-page/page-name-canvas-001-ref.html
layout/reftests/css-page/page-name-canvas-002-ref.html
layout/reftests/css-page/page-name-img-001-ref.html
layout/reftests/css-page/page-name-img-002-ref.html
layout/reftests/css-page/reftest.list