Fix anchor-positioned scroll buttons after dialog resize [chromium/src : main]

0 views
Skip to first unread message

Helmut Januschka (Gerrit)

unread,
May 15, 2026, 4:03:41 PM (3 days ago) May 15
to Helmut Januschka, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, feature-me...@chromium.org
Attention needed from Joey Arhar

Helmut Januschka voted and added 1 comment

Votes added by Helmut Januschka

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Helmut Januschka . resolved

@jar...@chromium.org thanks in advance for your time, feel free to re-route in case you dont find time, no time pressure from me.

i hope i found the root-area to fix it, please let me know if you want me to address anything.


a sampler page is here: https://static.januschka.com/i-419755710/index.html

Open in Gerrit

Related details

Attention is currently required from:
  • Joey Arhar
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie14bd6455ee0906e3917a14a62e6f160b91dbdc5
Gerrit-Change-Number: 7852263
Gerrit-PatchSet: 3
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Comment-Date: Fri, 15 May 2026 20:03:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Joey Arhar (Gerrit)

unread,
May 15, 2026, 4:48:47 PM (3 days ago) May 15
to Helmut Januschka, Rune Lillesveen, Daniil Sakhapov, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, feature-me...@chromium.org
Attention needed from Daniil Sakhapov, Helmut Januschka and Rune Lillesveen

Joey Arhar added 1 comment

Patchset-level comments
Joey Arhar . resolved

i'm not very familiar with this code, i think rune or daniil would know more

Open in Gerrit

Related details

Attention is currently required from:
  • Daniil Sakhapov
  • Helmut Januschka
  • Rune Lillesveen
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ie14bd6455ee0906e3917a14a62e6f160b91dbdc5
Gerrit-Change-Number: 7852263
Gerrit-PatchSet: 3
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
Gerrit-Comment-Date: Fri, 15 May 2026 20:48:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Rune Lillesveen (Gerrit)

unread,
May 15, 2026, 6:32:46 PM (3 days ago) May 15
to Helmut Januschka, Rune Lillesveen, Daniil Sakhapov, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, feature-me...@chromium.org
Attention needed from Daniil Sakhapov and Helmut Januschka

Rune Lillesveen added 3 comments

File third_party/blink/renderer/core/dom/element.cc
Line 5858, Patchset 3 (Latest): // ::scroll-button() layout tree position is determined by
// LayoutTreeBuilderTraversal relative to the originating element and
// sibling pseudos. Reattach so the traversal logic chooses the correct
// parent and sibling rather than reinserting next to the old parent.
Rune Lillesveen . unresolved

I don't understand. Why doesn't ParentLayoutObject() and NextSiblingLayoutObject() below find the correct boxes for re-insertion?

File third_party/blink/renderer/core/dom/layout_tree_builder_traversal.cc
Line 545, Patchset 3 (Latest): // between that marker group and their originating element:
Rune Lillesveen . unresolved

This does not seem to match reality - that scroll buttons change whether they appear before or after the originating element in the box tree depending on the `scroll-marker-group` property?

Could you elaborate on the motivation for the traversal change?

File third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-position-dialog-resize-media-query.html
Line 1, Patchset 3 (Latest):<!DOCTYPE html>
Rune Lillesveen . unresolved

Can't this test be simplified to a case where you only change the property that causes NeedsReinsertLayoutTree() to return true?

Do you need media queries at all?

Is anchor positioning necessary to show the issue?

Open in Gerrit

Related details

Attention is currently required from:
  • Daniil Sakhapov
  • Helmut Januschka
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ie14bd6455ee0906e3917a14a62e6f160b91dbdc5
    Gerrit-Change-Number: 7852263
    Gerrit-PatchSet: 3
    Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
    Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
    Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
    Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
    Gerrit-Comment-Date: Fri, 15 May 2026 22:32:27 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Helmut Januschka (Gerrit)

    unread,
    May 16, 2026, 9:45:14 AM (2 days ago) May 16
    to Helmut Januschka, Rune Lillesveen, Daniil Sakhapov, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, feature-me...@chromium.org
    Attention needed from Daniil Sakhapov and Rune Lillesveen

    Helmut Januschka added 4 comments

    Patchset-level comments
    File-level comment, Patchset 5 (Latest):
    Helmut Januschka . resolved

    thanks for review, please let me know, not sure if we should remove the unittests, is the WPT enough?

    File third_party/blink/renderer/core/dom/element.cc
    Line 5858, Patchset 3: // ::scroll-button() layout tree position is determined by

    // LayoutTreeBuilderTraversal relative to the originating element and
    // sibling pseudos. Reattach so the traversal logic chooses the correct
    // parent and sibling rather than reinserting next to the old parent.
    Rune Lillesveen . resolved

    I don't understand. Why doesn't ParentLayoutObject() and NextSiblingLayoutObject() below find the correct boxes for re-insertion?

    Helmut Januschka

    tried it and removed the special-case and now rely on the normal `ParentLayoutObject()` / `NextSiblingLayoutObject()` reinsertion path.

    File third_party/blink/renderer/core/dom/layout_tree_builder_traversal.cc
    Line 545, Patchset 3: // between that marker group and their originating element:
    Rune Lillesveen . resolved

    This does not seem to match reality - that scroll buttons change whether they appear before or after the originating element in the box tree depending on the `scroll-marker-group` property?

    Could you elaborate on the motivation for the traversal change?

    Helmut Januschka

    PS5 changed the code.

    File third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-position-dialog-resize-media-query.html
    Line 1, Patchset 3:<!DOCTYPE html>
    Rune Lillesveen . resolved

    Can't this test be simplified to a case where you only change the property that causes NeedsReinsertLayoutTree() to return true?

    Do you need media queries at all?

    Is anchor positioning necessary to show the issue?

    Helmut Januschka

    i thought i'd need the media queries, as it was in the original reproducer, removed it, and simplified it, still verifies the fix :)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniil Sakhapov
    • Rune Lillesveen
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ie14bd6455ee0906e3917a14a62e6f160b91dbdc5
      Gerrit-Change-Number: 7852263
      Gerrit-PatchSet: 5
      Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
      Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
      Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
      Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
      Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
      Gerrit-Comment-Date: Sat, 16 May 2026 13:44:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Rune Lillesveen <fut...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Rune Lillesveen (Gerrit)

      unread,
      4:09 AM (6 hours ago) 4:09 AM
      to Helmut Januschka, Rune Lillesveen, Daniil Sakhapov, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, feature-me...@chromium.org
      Attention needed from Daniil Sakhapov and Helmut Januschka

      Rune Lillesveen added 2 comments

      File third_party/blink/renderer/core/dom/layout_tree_builder_traversal.cc
      Line 544, Patchset 5 (Latest): return LayoutTreeBuilderTraversal::NextSibling(*originating_element);
      Rune Lillesveen . unresolved

      This obviously makes this function inconsistent in box ordering. Could you please explain what you're trying to do here instead of sending arbitrary code that seemingly fixes the bug?

      File third_party/blink/web_tests/external/wpt/css/css-anchor-position/anchor-position-dialog-resize-media-query.html
      Line 1, Patchset 3:<!DOCTYPE html>
      Rune Lillesveen . unresolved

      Can't this test be simplified to a case where you only change the property that causes NeedsReinsertLayoutTree() to return true?

      Do you need media queries at all?

      Is anchor positioning necessary to show the issue?

      Helmut Januschka

      i thought i'd need the media queries, as it was in the original reproducer, removed it, and simplified it, still verifies the fix :)

      Rune Lillesveen

      It's still way too complicated for testing what you're trying to fix. First, understand what the issue is, then write a test that's checking that specifically.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Daniil Sakhapov
      • Helmut Januschka
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ie14bd6455ee0906e3917a14a62e6f160b91dbdc5
        Gerrit-Change-Number: 7852263
        Gerrit-PatchSet: 5
        Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
        Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
        Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
        Gerrit-Comment-Date: Mon, 18 May 2026 08:09:38 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Helmut Januschka <hel...@januschka.com>
        Comment-In-Reply-To: Rune Lillesveen <fut...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages