layout: Add BoxFragment rare data (#38325)

Introduce `BoxFragmentRareData`, rare data for `BoxFragment`, which
would store the specific data that is relevant to several fragments.
This would reduce the `BoxFragment` size to 256 from 264 and add 8 bytes
for fragment that have rare data (due to the additional pointer to the
rare data).

Testing: Existing WPT coverage

Signed-off-by: Jo Steven Novaryo <jo.steven.novaryo@huawei.com>
This commit is contained in:
Jo Steven Novaryo 2025-08-01 13:17:39 +08:00 committed by GitHub
parent 09f0e20e29
commit a8886c1222
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 32 additions and 8 deletions

View file

@ -1362,7 +1362,7 @@ impl<'a> BuilderForBoxFragment<'a> {
fn build_collapsed_table_borders(&mut self, builder: &mut DisplayListBuilder) {
let Some(SpecificLayoutInfo::TableGridWithCollapsedBorders(table_info)) =
&self.fragment.specific_layout_info
self.fragment.specific_layout_info()
else {
return;
};