(outerFrame)
+ ->IntrinsicScrollbarGutterSize();
+ subgrid->mMarginBorderPadding += LogicalMargin(cbWM, ssz);
+ } else {
+ subgrid->mMarginBorderPadding +=
+ szOuterFrame.ComputedLogicalPadding(cbWM);
}
}
+
+ if (nsFieldSetFrame* f = do_QueryFrame(aGridItem.mFrame)) {
+ const auto* inner = f->GetInner();
+ auto wm = inner->GetWritingMode();
+ LogicalPoint pos = inner->GetLogicalPosition(aGridItem.mFrame->GetSize());
+ // The legend is always on the BStart side and it inflates the fieldset's
+ // "border area" size. The inner frame's b-start pos equals that size.
+ LogicalMargin offsets(wm, pos.B(wm), 0, 0, 0);
+ subgrid->mMarginBorderPadding += offsets.ConvertTo(cbWM, wm);
+ }
+
return subgrid;
}
diff --git a/testing/web-platform/tests/css/css-grid/subgrid/subgrid-button-ref.html b/testing/web-platform/tests/css/css-grid/subgrid/subgrid-button-ref.html
new file mode 100644
index 000000000000..b6b5e6115c51
--- /dev/null
+++ b/testing/web-platform/tests/css/css-grid/subgrid/subgrid-button-ref.html
@@ -0,0 +1,33 @@
+
+
+CSS test reference
+
+
+
+ hello
+ ,
+ world
+
+
diff --git a/testing/web-platform/tests/css/css-grid/subgrid/subgrid-button.html b/testing/web-platform/tests/css/css-grid/subgrid/subgrid-button.html
new file mode 100644
index 000000000000..774702238f2d
--- /dev/null
+++ b/testing/web-platform/tests/css/css-grid/subgrid/subgrid-button.html
@@ -0,0 +1,36 @@
+
+
+
+
+
+Button subgrid
+
+
+
+