ComputeContainerNode -> AnchorNode for ScopedForcedUpdate [chromium/src : main]

0 views
Skip to first unread message

Joey Arhar (Gerrit)

unread,
Nov 3, 2021, 12:41:29 PM11/3/21
to vmpstr, blink-...@chromium.org

Attention is currently required from: vmpstr.

Joey Arhar would like vmpstr to review this change.

View Change

ComputeContainerNode -> AnchorNode for ScopedForcedUpdate

In crrev.com/921268 I replaced the usage of AnchorNode with a Range
based unlock. In crrev.com/937171 I re-added the removed single node
unlock, but instead of using AnchorNode like I should have, I used
ComputeContainerNode.

ComputeContainerNode is used for the Range based unlock because that's
what Range uses in its constructor and it must be non-null for Ranges.

The test case is unminimized so I didn't include a test in this patch,
but I verified with the clusterfuzz repro tool that this fixes the bug.

Fixed: 1266366
Change-Id: I8416d1c28ebad3ff6fc5341ca8e8ea740133eb83
---
M third_party/blink/renderer/core/editing/frame_selection.cc
1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/third_party/blink/renderer/core/editing/frame_selection.cc b/third_party/blink/renderer/core/editing/frame_selection.cc
index 41f9c2c..05898bd 100644
--- a/third_party/blink/renderer/core/editing/frame_selection.cc
+++ b/third_party/blink/renderer/core/editing/frame_selection.cc
@@ -168,8 +168,7 @@
DisplayLockContext::ForcedPhase::kLayout);
} else {
force_locks = DisplayLockUtilities::ScopedForcedUpdate(
- base.ComputeContainerNode(),
- DisplayLockContext::ForcedPhase::kLayout);
+ base.AnchorNode(), DisplayLockContext::ForcedPhase::kLayout);
}
GetDocument().UpdateStyleAndLayout(DocumentUpdateReason::kSelection);
return ComputeVisibleSelectionInDOMTree();

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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8416d1c28ebad3ff6fc5341ca8e8ea740133eb83
Gerrit-Change-Number: 3260206
Gerrit-PatchSet: 2
Gerrit-Owner: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
Gerrit-Attention: vmpstr <vmp...@chromium.org>
Gerrit-MessageType: newchange

Joey Arhar (Gerrit)

unread,
Nov 3, 2021, 12:41:36 PM11/3/21
to blink-...@chromium.org, vmpstr, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: vmpstr.

Patch set 1:Auto-Submit +1Commit-Queue +1

View Change

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I8416d1c28ebad3ff6fc5341ca8e8ea740133eb83
    Gerrit-Change-Number: 3260206
    Gerrit-PatchSet: 1
    Gerrit-Owner: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
    Gerrit-Attention: vmpstr <vmp...@chromium.org>
    Gerrit-Comment-Date: Wed, 03 Nov 2021 16:41:26 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    vmpstr (Gerrit)

    unread,
    Nov 3, 2021, 12:50:49 PM11/3/21
    to Joey Arhar, blink-...@chromium.org, Chromium LUCI CQ, chromium...@chromium.org

    Attention is currently required from: Joey Arhar.

    Patch set 2:Code-Review +1Commit-Queue +2

    View Change

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I8416d1c28ebad3ff6fc5341ca8e8ea740133eb83
      Gerrit-Change-Number: 3260206
      Gerrit-PatchSet: 2
      Gerrit-Owner: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: vmpstr <vmp...@chromium.org>
      Gerrit-Attention: Joey Arhar <jar...@chromium.org>
      Gerrit-Comment-Date: Wed, 03 Nov 2021 16:50:37 +0000

      Chromium LUCI CQ (Gerrit)

      unread,
      Nov 3, 2021, 5:15:54 PM11/3/21
      to Joey Arhar, blink-...@chromium.org, vmpstr, chromium...@chromium.org

      Chromium LUCI CQ submitted this change.

      View Change


      Approvals: vmpstr: Looks good to me; Commit Joey Arhar: Dry run; Send CL to CQ automatically after approval
      ComputeContainerNode -> AnchorNode for ScopedForcedUpdate

      In crrev.com/921268 I replaced the usage of AnchorNode with a Range
      based unlock. In crrev.com/937171 I re-added the removed single node
      unlock, but instead of using AnchorNode like I should have, I used
      ComputeContainerNode.

      ComputeContainerNode is used for the Range based unlock because that's
      what Range uses in its constructor and it must be non-null for Ranges.

      The test case is unminimized so I didn't include a test in this patch,
      but I verified with the clusterfuzz repro tool that this fixes the bug.

      Fixed: 1266366
      Change-Id: I8416d1c28ebad3ff6fc5341ca8e8ea740133eb83
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3260206
      Commit-Queue: Joey Arhar <jar...@chromium.org>
      Commit-Queue: vmpstr <vmp...@chromium.org>
      Reviewed-by: vmpstr <vmp...@chromium.org>
      Auto-Submit: Joey Arhar <jar...@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#938025}
      ---
      M third_party/blink/renderer/core/editing/frame_selection.cc
      1 file changed, 28 insertions(+), 2 deletions(-)

      diff --git a/third_party/blink/renderer/core/editing/frame_selection.cc b/third_party/blink/renderer/core/editing/frame_selection.cc
      index 3da2a3a..c5372cb 100644
      --- a/third_party/blink/renderer/core/editing/frame_selection.cc
      +++ b/third_party/blink/renderer/core/editing/frame_selection.cc
      @@ -169,8 +169,7 @@

      DisplayLockContext::ForcedPhase::kLayout);
      } else {
      force_locks = DisplayLockUtilities::ScopedForcedUpdate(
      - base.ComputeContainerNode(),
      - DisplayLockContext::ForcedPhase::kLayout);
      + base.AnchorNode(), DisplayLockContext::ForcedPhase::kLayout);
      }
      GetDocument().UpdateStyleAndLayout(DocumentUpdateReason::kSelection);
      return ComputeVisibleSelectionInDOMTree();

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I8416d1c28ebad3ff6fc5341ca8e8ea740133eb83
      Gerrit-Change-Number: 3260206
      Gerrit-PatchSet: 3
      Gerrit-Owner: Joey Arhar <jar...@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-MessageType: merged
      Reply all
      Reply to author
      Forward
      0 new messages