Closed Bug 2071074 Opened 2 months ago Closed 2 months ago

[wpt-sync] Sync PR 62596 - Refactor Element::StyleForPseudoElement

Categories

(Core :: Layout: Text and Fonts, task, P4)

task

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Rune Lillesveen <futhark@chromium.org> wrote:

Refactor Element::StyleForPseudoElement

The function had slightly different paths for inherited ::first-line
styles, pseudo-elements which were categorized as "before-or-after-
like", and other pseudo-elements.

The display:contents handling should not be limited to a subset of
pseudo-elements. The pseudo-elements generating sibling boxes already
handled display:contents since they always call LayoutParentElement()
for updating layout_parent_override.

The remaining special part of before-or-after-like was locale style
adjustments only relevant to ::before/::after for UA rendered HTML \<q>
elements.

The resulting change was:

  1. Move StyleForFirstLineInherited() into a separate function
  2. Use a common ResolveStyle() path for the rest of the pseudo-elements
    where we are:
    • Adjusting layout_parent_style for pseudo-elements which are pulled
      out as siblings of their inheritance parent (originating element)
    • Adjusting layout_parent_style for all other pseudo elements where a
      display:contents style was passed in
    • Adjust the resulting style for ::before/::after of \<q> elements

Also, added a wpt test that fails if the display:contents adjustment is
removed since we didn't have coverage for that.

Change-Id: I1f7384d5236c724ab0e8aff71a361aae49714018

Reviewed-on: https://chromium-review.googlesource.com/8378405
WPT-Export-Revision: f26646f986faadbda41ee56a2ffd7be6836840af

Component: web-platform-tests → Layout: Text and Fonts
Product: Testing → Core

CI Results

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

Total 365 tests and 10 subtests

Status Summary

Firefox

OK : 48
PASS: 1[GitHub] 9[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 1290[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 1575[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 1577[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 1578[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
FAIL: 11[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 31[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt] 32[Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 33[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview]

Chrome

PASS: 1

Safari

PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.