c-v: Distinguish the type of forced updates. [chromium/src : main]

0 views
Skip to first unread message

vmpstr (Gerrit)

unread,
Sep 20, 2021, 2:58:24 PM9/20/21
to blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Chromium LUCI CQ, Chris Harrelson, Joey Arhar, David Bokan, chromium...@chromium.org

Attention is currently required from: Joey Arhar, Chris Harrelson.

View Change

1 comment:

To view, visit change 3168328. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9856acbcabedfb0b232518b438ca43a16a0cfd09
Gerrit-Change-Number: 3168328
Gerrit-PatchSet: 1
Gerrit-Owner: vmpstr <vmp...@chromium.org>
Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
Gerrit-Comment-Date: Mon, 20 Sep 2021 18:58:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

vmpstr (Gerrit)

unread,
Sep 20, 2021, 2:58:40 PM9/20/21
to blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Chromium LUCI CQ, Chris Harrelson, Joey Arhar, David Bokan, chromium...@chromium.org

Attention is currently required from: Joey Arhar, Chris Harrelson.

View Change

1 comment:

  • Patchset:

    • look*

To view, visit change 3168328. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9856acbcabedfb0b232518b438ca43a16a0cfd09
Gerrit-Change-Number: 3168328
Gerrit-PatchSet: 1
Gerrit-Owner: vmpstr <vmp...@chromium.org>
Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
Gerrit-Comment-Date: Mon, 20 Sep 2021 18:58:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: vmpstr <vmp...@chromium.org>
Gerrit-MessageType: comment

Blink WPT Bot (Gerrit)

unread,
Sep 20, 2021, 3:04:59 PM9/20/21
to vmpstr, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Chromium LUCI CQ, Chris Harrelson, Joey Arhar, David Bokan, chromium...@chromium.org

Attention is currently required from: Joey Arhar, Chris Harrelson.

Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/30887.

When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.

WPT Export docs:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process

View Change

    To view, visit change 3168328. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9856acbcabedfb0b232518b438ca43a16a0cfd09
    Gerrit-Change-Number: 3168328
    Gerrit-PatchSet: 1
    Gerrit-Owner: vmpstr <vmp...@chromium.org>
    Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
    Gerrit-Comment-Date: Mon, 20 Sep 2021 19:04:51 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Joey Arhar (Gerrit)

    unread,
    Sep 20, 2021, 3:42:00 PM9/20/21
    to vmpstr, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Tricium, Blink WPT Bot, Chromium LUCI CQ, Chris Harrelson, David Bokan, chromium...@chromium.org

    Attention is currently required from: vmpstr, Chris Harrelson.

    View Change

    6 comments:

    • Commit Message:

      • Patch Set #1, Line 9:

        we can force an update for style without
        forcing layout

        so this is a performance optimization which shouldn't change any behavior?

    • File third_party/blink/renderer/core/display_lock/display_lock_context.h:

      • Patch Set #1, Line 79: kStyleAndLayoutTree, kLayout, kPrePaint

        Do these correspond with UpdateStyleAndLayoutTree, UpdateStyleAndLayout, and a third thing I don't know?

        Is calling UpdateStyleAndLayoutTree considered only updating style?

      • Patch Set #1, Line 345: // If non-zero, then the update has been forced.

        should this comment still be here?

    • File third_party/blink/renderer/core/dom/range.cc:

      • Patch Set #1, Line 1595: DisplayLockContext::ForcedPhase::kLayout

        Let's say I'm debugging a content-visibility related DCHECK, and I suspect that one of these ForcedPhase flags is wrong *somewhere* in the codebase.
        Is there an easy spot in DisplayLockContext for me to effectively change every usage of ForcedPhase to ForcedPhase::kPrePaint?

    • File third_party/blink/renderer/core/frame/local_frame_view.cc:

      • Patch Set #1, Line 1132: LockedAncestorPreventingLayout

        So there are already many existing calls to LockedAncestorPreventingLayout/Style/Paint, right?

        Before this patch, are all of the Prevening Layout vs Style vs Paint calls effectively the same because all DisplayLocks prevent... everything?

    • File third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-embed-element/embed-document-under-content-visibility-gbcr.html:

    To view, visit change 3168328. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9856acbcabedfb0b232518b438ca43a16a0cfd09
    Gerrit-Change-Number: 3168328
    Gerrit-PatchSet: 1
    Gerrit-Owner: vmpstr <vmp...@chromium.org>
    Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-Attention: vmpstr <vmp...@chromium.org>
    Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
    Gerrit-Comment-Date: Mon, 20 Sep 2021 19:41:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    vmpstr (Gerrit)

    unread,
    Sep 20, 2021, 3:57:53 PM9/20/21
    to blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Tricium, Blink WPT Bot, Chromium LUCI CQ, Chris Harrelson, Joey Arhar, David Bokan, chromium...@chromium.org

    Attention is currently required from: Joey Arhar, Chris Harrelson.

    View Change

    7 comments:

    • Commit Message:

      • Patch Set #1, Line 9:

        we can force an update for style without
        forcing layout

        so this is a performance optimization which shouldn't change any behavior?

      • It does have behavior implications (as the code I've changed below shows)

    • Patchset:

    • File third_party/blink/renderer/core/display_lock/display_lock_context.h:

      • Do these correspond with UpdateStyleAndLayoutTree, UpdateStyleAndLayout, and a third thing I don't k […]

        Basically yeah. I don't think we have a force prepaint call, but for completeness it's here?

      • Oops.

    • File third_party/blink/renderer/core/dom/range.cc:

      • Let's say I'm debugging a content-visibility related DCHECK, and I suspect that one of these ForcedP […]

        Yeah, you can just add prepaint is forced count anytime you increase any other count. (in .h)

    • File third_party/blink/renderer/core/frame/local_frame_view.cc:

      • So there are already many existing calls to LockedAncestorPreventingLayout/Style/Paint, right? […]

        Essentially yes. The one distinction is what happened when things were forced. Before this, *PreventingPaint is equivalent to "do we have a locked ancestor" and forcing locks didn't change anything. The rest *PreventingStyle/PrePaint/Layout would all be equivalent: true if locked, false if forced.

        With this patch now, there is a distinction of what is forced. So if style is forced, then *PreventingLayout would still return a lock. This is important for this particular bug fix, since we have a style check for *PreventingLayout because it expects if that's "false" then layout will run on this object. However, because only style was forced, the layout would never run (style would run, then the forced scope would be destroyed, so nothing will run layout). The two tests confirm this.

    • File third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-embed-element/embed-document-under-content-visibility-gbcr.html:

      • Patch Set #1, Line 21:

            // Ensure we process style and layout in the hidden object.
        target.getBoundingClientRect();

      • In similar tests I wrote, I checked to make sure that the resulting coordinates and sizes are greate […]

        This is more about just forcing layout, so it's really any property would do. I don't think it's worth checking what the actual value is

    To view, visit change 3168328. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9856acbcabedfb0b232518b438ca43a16a0cfd09
    Gerrit-Change-Number: 3168328
    Gerrit-PatchSet: 1
    Gerrit-Owner: vmpstr <vmp...@chromium.org>
    Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
    Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
    Gerrit-Comment-Date: Mon, 20 Sep 2021 19:57:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
    Gerrit-MessageType: comment

    Joey Arhar (Gerrit)

    unread,
    Sep 20, 2021, 4:18:58 PM9/20/21
    to vmpstr, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Tricium, Blink WPT Bot, Chromium LUCI CQ, Chris Harrelson, David Bokan, chromium...@chromium.org

    Attention is currently required from: vmpstr, Chris Harrelson.

    Patch set 1:Code-Review +1

    View Change

      To view, visit change 3168328. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I9856acbcabedfb0b232518b438ca43a16a0cfd09
      Gerrit-Change-Number: 3168328
      Gerrit-PatchSet: 1
      Gerrit-Owner: vmpstr <vmp...@chromium.org>
      Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
      Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
      Gerrit-CC: David Bokan <bo...@chromium.org>
      Gerrit-Attention: vmpstr <vmp...@chromium.org>
      Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
      Gerrit-Comment-Date: Mon, 20 Sep 2021 20:18:48 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      Gerrit-MessageType: comment

      vmpstr (Gerrit)

      unread,
      Sep 20, 2021, 9:44:18 PM9/20/21
      to blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Tricium, Blink WPT Bot, Chromium LUCI CQ, Chris Harrelson, David Bokan, chromium...@chromium.org

      Attention is currently required from: Chris Harrelson.

      View Change

      6 comments:

      • Commit Message:

        • It does have behavior implications (as the code I've changed below shows)

          .

      • File third_party/blink/renderer/core/display_lock/display_lock_context.h:

        • Basically yeah. […]

          .

        • Oops.

          Done

      • File third_party/blink/renderer/core/dom/range.cc:

        • Yeah, you can just add prepaint is forced count anytime you increase any other count. (in . […]

          .

      • File third_party/blink/renderer/core/frame/local_frame_view.cc:

        • Essentially yes. The one distinction is what happened when things were forced. […]

          .

      • File third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-embed-element/embed-document-under-content-visibility-gbcr.html:

        • Patch Set #1, Line 21:

              // Ensure we process style and layout in the hidden object.
          target.getBoundingClientRect();

        • This is more about just forcing layout, so it's really any property would do. […]

          .

      To view, visit change 3168328. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I9856acbcabedfb0b232518b438ca43a16a0cfd09
      Gerrit-Change-Number: 3168328
      Gerrit-PatchSet: 2
      Gerrit-Owner: vmpstr <vmp...@chromium.org>
      Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
      Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
      Gerrit-CC: David Bokan <bo...@chromium.org>
      Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
      Gerrit-Comment-Date: Tue, 21 Sep 2021 01:44:09 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: vmpstr <vmp...@chromium.org>

      vmpstr (Gerrit)

      unread,
      Sep 21, 2021, 3:30:29 PM9/21/21
      to blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Tricium, Blink WPT Bot, Chromium LUCI CQ, Chris Harrelson, David Bokan, chromium...@chromium.org

      Attention is currently required from: Chris Harrelson.

      Patch set 3:Commit-Queue +2

      View Change

        To view, visit change 3168328. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I9856acbcabedfb0b232518b438ca43a16a0cfd09
        Gerrit-Change-Number: 3168328
        Gerrit-PatchSet: 3
        Gerrit-Owner: vmpstr <vmp...@chromium.org>
        Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
        Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
        Gerrit-CC: David Bokan <bo...@chromium.org>
        Gerrit-Attention: Chris Harrelson <chri...@chromium.org>
        Gerrit-Comment-Date: Tue, 21 Sep 2021 19:30:15 +0000

        Chromium LUCI CQ (Gerrit)

        unread,
        Sep 21, 2021, 3:35:00 PM9/21/21
        to vmpstr, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Joey Arhar, Tricium, Blink WPT Bot, Chris Harrelson, David Bokan, chromium...@chromium.org

        Chromium LUCI CQ submitted this change.

        View Change



        1 is the latest approved patch-set.
        The change was submitted with unreviewed changes in the following files:

        ```
        The name of the file: third_party/blink/renderer/core/display_lock/display_lock_context.cc
        Insertions: 2, Deletions: 1.

        @@ -647,7 +647,8 @@
        STACK_ALLOCATED();

        public:
        - ScopedForceLayout(DisplayLockContext* context) : context_(context) {
        + explicit ScopedForceLayout(DisplayLockContext* context)
        + : context_(context) {
        context_->forced_info_.start(ForcedPhase::kLayout);
        }
        ~ScopedForceLayout() { context_->forced_info_.end(ForcedPhase::kLayout); }
        ```
        ```
        The name of the file: third_party/blink/renderer/core/display_lock/display_lock_context.h
        Insertions: 1, Deletions: 1.

        @@ -342,7 +342,7 @@
        WeakMember<Document> document_;
        EContentVisibility state_ = EContentVisibility::kVisible;

        - // If non-zero, then the update has been forced.
        + // A struct to keep track of forced unlocks, and reasons for it.
        struct UpdateForcedInfo {
        bool is_forced(ForcedPhase phase) const {
        switch (phase) {
        ```

        Approvals: Joey Arhar: Looks good to me vmpstr: Commit
        c-v: Distinguish the type of forced updates.

        This patch ensures that we can force an update for style without
        forcing layout, etc. This is useful since we need to determine whether
        we have a lock that blocks, for e.g. layout, and if we force a lock
        it's unclear whether layout would be updated without this patch.

        With the patch, functions like UpdateStyleAndLayoutTree only force
        style updates.

        R=chri...@chromium.org, jar...@chromium.org

        Fixed: 1250742
        Change-Id: I9856acbcabedfb0b232518b438ca43a16a0cfd09
        Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3168328
        Commit-Queue: vmpstr <vmp...@chromium.org>
        Reviewed-by: Joey Arhar <jar...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#923524}
        ---
        M third_party/blink/renderer/core/display_lock/display_lock_context.cc
        M third_party/blink/renderer/core/display_lock/display_lock_context.h
        M third_party/blink/renderer/core/display_lock/display_lock_context_test.cc
        M third_party/blink/renderer/core/display_lock/display_lock_utilities.cc
        M third_party/blink/renderer/core/display_lock/display_lock_utilities.h
        M third_party/blink/renderer/core/dom/document.cc
        M third_party/blink/renderer/core/dom/range.cc
        M third_party/blink/renderer/core/editing/frame_selection.cc
        M third_party/blink/renderer/core/frame/local_frame_view.cc
        M third_party/blink/renderer/core/html/html_plugin_element.cc
        R third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-embed-element/embed-document-under-content-visibility-focus.html
        A third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-embed-element/embed-document-under-content-visibility-gbcr.html
        12 files changed, 169 insertions(+), 70 deletions(-)


        To view, visit change 3168328. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I9856acbcabedfb0b232518b438ca43a16a0cfd09
        Gerrit-Change-Number: 3168328
        Gerrit-PatchSet: 4
        Gerrit-Owner: vmpstr <vmp...@chromium.org>
        Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
        Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
        Gerrit-CC: David Bokan <bo...@chromium.org>
        Gerrit-MessageType: merged

        Blink WPT Bot (Gerrit)

        unread,
        Sep 21, 2021, 4:04:33 PM9/21/21
        to vmpstr, Chromium LUCI CQ, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, Tricium, Chris Harrelson, David Bokan, chromium...@chromium.org

        The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/30887

        View Change

          To view, visit change 3168328. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I9856acbcabedfb0b232518b438ca43a16a0cfd09
          Gerrit-Change-Number: 3168328
          Gerrit-PatchSet: 4
          Gerrit-Owner: vmpstr <vmp...@chromium.org>
          Gerrit-Reviewer: Chris Harrelson <chri...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
          Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
          Gerrit-CC: Blink WPT Bot <blink-w3c-te...@chromium.org>
          Gerrit-CC: David Bokan <bo...@chromium.org>
          Gerrit-Comment-Date: Tue, 21 Sep 2021 20:04:24 +0000
          Reply all
          Reply to author
          Forward
          0 new messages