Open Bug 1657296 Opened 5 years ago Updated 5 years ago

[wpt-sync] Sync PR 24883 - Fieldset NG: Supports 'overflow' property properly

Categories

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

task

Tracking

()

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Kent Tamura <tkent@chromium.org> wrote:

Fieldset NG: Supports 'overflow' property properly

The 'overflow' property value should be propagated from a FIELDSET to
its anonymous fieldset content box, and its LEGEND should not be
scrolled if the anonymous fieldset content box is scrolled.

This CL consists of two parts:
A) Move out the rendered legend box from the anonymous fieldset content
box. The rendered legend should be the first child of the FIELDSET.
B) Propagate 'overflow' property value of a FIELDSET to its anonymous
fieldset content box, and disable the 'overflow' property for the
FIELDSET.

A)
The main change is LayoutNGFieldset::AddChild().
Because the rendered legend depends on the order in the children, we
need to reattach FIELDSET's LayoutObject whenever

  • a LEGEND is added to a FIELDSET
    HTMLLegendElement::InsertedInto()
  • a LEGEND is removed from a FIELDSET
    HTMLLegendElement::RemovedFrom()
  • LEGEND's 'position' 'float' properties are changed
    ComputedStyle::NeedsReattachLayoutTree() and
    Element::RecalcOwnStyle()

This CL removes some code to handle the situation that the rendered
legend is a child of the anonymous fieldset content box.

  • LayoutFieldset::FindInFlowLegend()
  • LayoutObject::IsRenderedLegendInternal()
  • GetLayoutObjectForFirstChildNode()
  • GetLayoutObjectForParentNode()
  • GetLayoutObjectForNextSiblingNode()
  • NGBlockNode::PlaceChildrenInLayoutBox()

B)
In HTMLFieldSetElement::CustomStyleForLayoutObject(), we reset
'overflow' property values and store the original values.
LayoutNGFieldset::AddChild() copies the original values to the anonymous
fieldset content box.

Test changes
Update fieldset-content-before-legend.html and
fieldset-generated-content.html so that they are not affected by
rounding errors by fractional paddings and fractional letter widths.

Many testcases in NGFieldsetLayoutAlgorithmTest now has no anonymous
fieldset content boxes.

Bug: 875235, 1101976
Change-Id: Idc54069a75b2fba46897267fccd35c44c89b0c1f

Reviewed-on: https://chromium-review.googlesource.com/2336563
WPT-Export-Revision: 53715a94403c8b4d478a503d5a4cb2e69d27aa9d

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

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

Total 1 tests and 1 subtests

Status Summary

Firefox

OK : 1
PASS: 1

Chrome

OK : 1
FAIL: 1

Safari

OK : 1
PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

You need to log in before you can comment on or make changes to this bug.