Closed Bug 1716732 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 29397 - Move out the rendered legend box from the anonymous fieldset content box.

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 29397 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/29397
Details from upstream follow.

b'Kent Tamura <tkent@chromium.org>' wrote:

Move out the rendered legend box from the anonymous fieldset content box.

This is based on https://chromium-review.googlesource.com/c/chromium/src/+/2336563/8

We had a rendered legend box as a child of an anonymous fieldset content
box, and had adjustment code at many places. This CL updates this
structure so that the rendered legend box is a child of the fieldset box
as the specification asks.

The main change is LayoutNGFieldset::AddChild(). If the rendered legend
is passed to this function, it is added as a child of the fieldset, not
a child of the anonymous fieldset content box.

Because the rendered legend depends on some CSS properties and the order
of children, we need to reattach a fieldset to keep the correct
LayoutObject structure:

  • a LEGEND is added to a FIELDSET:
    HTMLLegendElement::DidRecalcStyle().

  • a LEGEND is removed from a FIELDSET:
    HTMLLegendElement::RemovedFrom().

  • LEGEND's 'position' 'float' properties are changed:
    HTMLLegendElement::StyleNeedsReattachLayoutTree() and DidRecalcStyle().

  • display:contents of a fieldset child is changed:
    Element::RecalcOwnStyle()

Test changes:

  • display-contents-dynamic-fieldset-legend-001.html
    Add testcases of adding a rendered legend to a display:content element,
    and removing a rendered legend from a display:content element.

  • fieldset-content-before-legend.html and fieldset-generated-content.html
    They are updated so that they are not affected by fractional paddings
    and fractional letter widths.

  • fieldset-content-before-legend.html
    Added a testcase for the LayoutTreeBuilder change.

  • NGFieldsetLayoutAlgorithmTest
    Many test cases now have no anonymous fieldset content boxes.

Bug: 880062, 1214561
Change-Id: I45a6b4eb1dcb1f3c3ab052324c3839c0d9a85b3a

Reviewed-on: https://chromium-review.googlesource.com/2960239
WPT-Export-Revision: c6d2044fef80966c4bd810e7c88d6f510e477fda

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

Ran 15 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 4 tests and 1 subtests

Status Summary

Firefox

OK : 2
PASS: 2[Gecko-linux1804-64-qr-opt, Gecko-windows10-64-qr-opt] 5[Gecko-android-em-7.0-x86_64-debug-geckoview, Gecko-android-em-7.0-x86_64-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-debug, Gecko-linux1804-64-opt, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-tsan-opt, Gecko-windows10-32-debug, Gecko-windows10-32-opt, Gecko-windows10-64-debug, Gecko-windows10-64-opt, Gecko-windows10-64-qr-debug, GitHub]

Chrome

OK : 2
PASS: 3
FAIL: 2

Safari

OK : 2
PASS: 2
FAIL: 3

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/682f70e60286
[wpt PR 29397] - Move out the rendered legend box from the anonymous fieldset content box., a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.