Skip to content

Commit

Permalink
Bug 1881157 - Restore the old behavior that allows TableBCDataPropert…
Browse files Browse the repository at this point in the history
…y to be set on table continuations. r=dholbert

Bug 1861562 Part 6 [1] made a bold assumption that TableBCDataProperty should
only be set on first-in-flow, but apparently a table continuation can call
`GetOrCreateTableBCData()` to set the property in the testcase [2].

This patch restores the old behavior that allows TableBCDataProperty to be set
on table continuations.

[1] https://hg.mozilla.org/mozilla-central/rev/c9c310c769d2
[2] Note: we don't support fragmenting tables in multicol. Table continuations
are created in this testcase because the abspos `<dialog>` in the table
is fragmented.

Differential Revision: https://phabricator.services.mozilla.com/D203707
  • Loading branch information
aethanyc committed Mar 7, 2024
1 parent 8389398 commit c2163d4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
26 changes: 26 additions & 0 deletions layout/tables/crashtests/1881157.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<style>
#a {
min-height: 1vw;
line-height: 0vw;
}
#b {
scale: 0.67976 1 1;
}
:root {
column-width: 1em;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", () => {
b.appendChild(a)
document.execCommand("fontSize", false, 5)
b.style.setProperty("border-top-style", "dotted")
})
function func_0() {
b.rules = "cols"
}
</script>
<dialog id="a" open="true">,&#x27;/,_J</dialog>
<table id="b">
<details open="true" ontoggle="func_0()">
1 change: 1 addition & 0 deletions layout/tables/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,4 @@ load 1767364-4.html
load 1795030.html
load 1795051.html
load 1821177.html
asserts(0-2) load 1881157.html # bug 1884058
7 changes: 3 additions & 4 deletions layout/tables/nsTableFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2393,16 +2393,15 @@ nsMargin nsTableFrame::GetUsedMargin() const {
return nsMargin(0, 0, 0, 0);
}
// This property is only set on the first-in-flow of nsTableFrame.
// TODO(TYLin): Should this property only be set on the first-in-flow of
// nsTableFrame?
NS_DECLARE_FRAME_PROPERTY_DELETABLE(TableBCDataProperty, TableBCData)
TableBCData* nsTableFrame::GetTableBCData() const {
return FirstInFlow()->GetProperty(TableBCDataProperty());
return GetProperty(TableBCDataProperty());
}
TableBCData* nsTableFrame::GetOrCreateTableBCData() {
MOZ_ASSERT(!GetPrevInFlow(),
"TableBCProperty should only be set on the first-in-flow!");
TableBCData* value = GetProperty(TableBCDataProperty());
if (!value) {
value = new TableBCData();
Expand Down

0 comments on commit c2163d4

Please sign in to comment.