Add options to fillTextCluster to override some cluster values [chromium/src : main]

1 view
Skip to first unread message

Andres Ricardo Perez (Gerrit)

unread,
Nov 12, 2024, 9:33:56 AMNov 12
to Fernando Serboncini, Jean-Philippe Gravel, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
Attention needed from Fernando Serboncini and Jean-Philippe Gravel

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Fernando Serboncini
  • Jean-Philippe Gravel
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
Gerrit-Change-Number: 6006496
Gerrit-PatchSet: 4
Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
Gerrit-Attention: Fernando Serboncini <fs...@chromium.org>
Gerrit-Comment-Date: Tue, 12 Nov 2024 14:33:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Fernando Serboncini (Gerrit)

unread,
Nov 12, 2024, 2:11:57 PMNov 12
to Andres Ricardo Perez, Fernando Serboncini, Jean-Philippe Gravel, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
Attention needed from Andres Ricardo Perez and Jean-Philippe Gravel

Fernando Serboncini added 2 comments

File third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
Line 3422, Patchset 4 (Latest): DrawTextInternal(
Fernando Serboncini . unresolved

fillTextCluster(text_cluster, x, y, nullptr);

Line 3432, Patchset 4 (Latest): if (cluster_options == nullptr) {
Fernando Serboncini . unresolved

TextCluster* whatever = text_cluster;
if (!nullptr) { whatever = MakeGC<TextCluster>(*text_cluster); whatever.updateWithOptions(options); }

drawtextinternal....

Open in Gerrit

Related details

Attention is currently required from:
  • Andres Ricardo Perez
  • Jean-Philippe Gravel
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
    Gerrit-Change-Number: 6006496
    Gerrit-PatchSet: 4
    Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
    Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
    Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
    Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-Attention: Andres Ricardo Perez <andres...@chromium.org>
    Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-Comment-Date: Tue, 12 Nov 2024 19:11:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andres Ricardo Perez (Gerrit)

    unread,
    Nov 12, 2024, 4:08:51 PMNov 12
    to Fernando Serboncini, Jean-Philippe Gravel, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Fernando Serboncini and Jean-Philippe Gravel

    Andres Ricardo Perez added 2 comments

    File third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
    Line 3422, Patchset 4: DrawTextInternal(
    Fernando Serboncini . resolved

    fillTextCluster(text_cluster, x, y, nullptr);

    Andres Ricardo Perez

    Done

    Line 3432, Patchset 4: if (cluster_options == nullptr) {
    Fernando Serboncini . resolved

    TextCluster* whatever = text_cluster;
    if (!nullptr) { whatever = MakeGC<TextCluster>(*text_cluster); whatever.updateWithOptions(options); }

    drawtextinternal....

    Andres Ricardo Perez

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fernando Serboncini
    • Jean-Philippe Gravel
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
    Gerrit-Change-Number: 6006496
    Gerrit-PatchSet: 5
    Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
    Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
    Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
    Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-Attention: Fernando Serboncini <fs...@chromium.org>
    Gerrit-Comment-Date: Tue, 12 Nov 2024 21:08:40 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Fernando Serboncini <fs...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Fernando Serboncini (Gerrit)

    unread,
    Nov 13, 2024, 1:17:00 PMNov 13
    to Andres Ricardo Perez, Hiroki Nakagawa, Fernando Serboncini, Jean-Philippe Gravel, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, horo+...@chromium.org, kenjibah...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, kinuko+ser...@chromium.org, jsbell+ser...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Andres Ricardo Perez and Jean-Philippe Gravel

    Fernando Serboncini added 3 comments

    File third_party/blink/renderer/core/html/canvas/text_cluster.cc
    Line 29, Patchset 6 (Latest):TextCluster::TextCluster(const TextCluster& other)
    Fernando Serboncini . unresolved

    can't you just use the default copy constructor here?

    TextCluster::TextCluster(const TextCluster&) = default;

    Line 56, Patchset 6 (Latest):void TextCluster::ApplyFillTextClusterOptions(const FillTextClusterOptions* options) {
    Fernando Serboncini . unresolved

    if you are going to pass a pointer, you need a "if (!options) return" in the beginning. Otherwise, pass a reference.

    File third_party/blink/renderer/core/html/canvas/text_metrics.idl
    Line 28, Patchset 6 (Latest):dictionary GetTextClusterOptions {
    Fernando Serboncini . unresolved

    could we merge those two as TextClusterOptions?

    The align/baseline are the same (btw, Are the "?=null" necessary?)
    It would be reasonable to either ignore the x,y or add some meaning to it on the getTextCluster)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andres Ricardo Perez
    • Jean-Philippe Gravel
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
      Gerrit-Change-Number: 6006496
      Gerrit-PatchSet: 6
      Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-Attention: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-Comment-Date: Wed, 13 Nov 2024 18:16:53 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andres Ricardo Perez (Gerrit)

      unread,
      Nov 15, 2024, 11:33:00 AMNov 15
      to Hiroki Nakagawa, Fernando Serboncini, Jean-Philippe Gravel, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, horo+...@chromium.org, kenjibah...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, kinuko+ser...@chromium.org, jsbell+ser...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Fernando Serboncini and Jean-Philippe Gravel

      Andres Ricardo Perez added 3 comments

      File third_party/blink/renderer/core/html/canvas/text_cluster.cc
      Line 29, Patchset 6:TextCluster::TextCluster(const TextCluster& other)
      Fernando Serboncini . unresolved

      can't you just use the default copy constructor here?

      TextCluster::TextCluster(const TextCluster&) = default;

      Andres Ricardo Perez

      The compiler doesn't allow it as `TextCluster` inherits from `ScriptWrappable`, which deletes the default copy constructor here: https://crsrc.org/c/third_party/blink/renderer/platform/bindings/script_wrappable.h;l=102

      Do you know of a workaround or should I leave the constructor as is?

      Line 56, Patchset 6:void TextCluster::ApplyFillTextClusterOptions(const FillTextClusterOptions* options) {
      Fernando Serboncini . resolved

      if you are going to pass a pointer, you need a "if (!options) return" in the beginning. Otherwise, pass a reference.

      Andres Ricardo Perez

      Made it a reference. Thanks!

      File third_party/blink/renderer/core/html/canvas/text_metrics.idl
      Line 28, Patchset 6:dictionary GetTextClusterOptions {
      Fernando Serboncini . unresolved

      could we merge those two as TextClusterOptions?

      The align/baseline are the same (btw, Are the "?=null" necessary?)
      It would be reasonable to either ignore the x,y or add some meaning to it on the getTextCluster)

      Andres Ricardo Perez

      If it's okay to just ignore the `x` and `y` params then yes, at least implementation-wise.

      In that case, should they still be separate dictionaries in the IDL for the explainer?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fernando Serboncini
      • Jean-Philippe Gravel
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
      Gerrit-Change-Number: 6006496
      Gerrit-PatchSet: 7
      Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-Attention: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Comment-Date: Fri, 15 Nov 2024 16:32:51 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Fernando Serboncini <fs...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Jean-Philippe Gravel (Gerrit)

      unread,
      Nov 18, 2024, 10:57:56 AMNov 18
      to Andres Ricardo Perez, Hiroki Nakagawa, Fernando Serboncini, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, horo+...@chromium.org, kenjibah...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, kinuko+ser...@chromium.org, jsbell+ser...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Andres Ricardo Perez and Fernando Serboncini

      Jean-Philippe Gravel added 1 comment

      File third_party/blink/renderer/core/html/canvas/text_cluster.cc
      Line 29, Patchset 6:TextCluster::TextCluster(const TextCluster& other)
      Fernando Serboncini . unresolved

      can't you just use the default copy constructor here?

      TextCluster::TextCluster(const TextCluster&) = default;

      Andres Ricardo Perez

      The compiler doesn't allow it as `TextCluster` inherits from `ScriptWrappable`, which deletes the default copy constructor here: https://crsrc.org/c/third_party/blink/renderer/platform/bindings/script_wrappable.h;l=102

      Do you know of a workaround or should I leave the constructor as is?

      Jean-Philippe Gravel

      I'm not sure, but it sounds to me that there must be a reason for ScriptWrappable to be non-copyable. Is it safe to make child classes copyable?

      From the [script_wrappable.h](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/bindings/script_wrappable.h;l=48;drc=7c38333ec090336a9a3a8be8deeb23ae76030942):
      "ScriptWrappable provides a way to map from/to C++ DOM implementation to/from JavaScript object (platform object)."

      What happens if you make a copy of the C++ object without also copying the corresponding JavaScript object? Is it legal to have a ScriptWrappable object without a corresponding JavaScript object?

      Instead of copying the `TextCluster`, could you not update `DrawTextInternal` to accept the params to use, either the ones passed by via `TextClusterOptions`, the ones already in the `TextCluster`, or the parameters in the context state?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andres Ricardo Perez
      • Fernando Serboncini
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
      Gerrit-Change-Number: 6006496
      Gerrit-PatchSet: 7
      Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-Attention: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Attention: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Comment-Date: Mon, 18 Nov 2024 15:57:48 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andres Ricardo Perez <andres...@chromium.org>
      Comment-In-Reply-To: Fernando Serboncini <fs...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andres Ricardo Perez (Gerrit)

      unread,
      Nov 19, 2024, 7:56:03 PMNov 19
      to Hiroki Nakagawa, Fernando Serboncini, Jean-Philippe Gravel, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, horo+...@chromium.org, kenjibah...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, kinuko+ser...@chromium.org, jsbell+ser...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Fernando Serboncini and Jean-Philippe Gravel

      Andres Ricardo Perez added 1 comment

      File third_party/blink/renderer/core/html/canvas/text_cluster.cc
      Line 29, Patchset 6:TextCluster::TextCluster(const TextCluster& other)
      Fernando Serboncini . resolved

      can't you just use the default copy constructor here?

      TextCluster::TextCluster(const TextCluster&) = default;

      Andres Ricardo Perez

      The compiler doesn't allow it as `TextCluster` inherits from `ScriptWrappable`, which deletes the default copy constructor here: https://crsrc.org/c/third_party/blink/renderer/platform/bindings/script_wrappable.h;l=102

      Do you know of a workaround or should I leave the constructor as is?

      Jean-Philippe Gravel

      I'm not sure, but it sounds to me that there must be a reason for ScriptWrappable to be non-copyable. Is it safe to make child classes copyable?

      From the [script_wrappable.h](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/bindings/script_wrappable.h;l=48;drc=7c38333ec090336a9a3a8be8deeb23ae76030942):
      "ScriptWrappable provides a way to map from/to C++ DOM implementation to/from JavaScript object (platform object)."

      What happens if you make a copy of the C++ object without also copying the corresponding JavaScript object? Is it legal to have a ScriptWrappable object without a corresponding JavaScript object?

      Instead of copying the `TextCluster`, could you not update `DrawTextInternal` to accept the params to use, either the ones passed by via `TextClusterOptions`, the ones already in the `TextCluster`, or the parameters in the context state?

      Andres Ricardo Perez

      My reasoning for passing the whole `TextCluster` was to avoid adding to many optional parameters to `DrawTextInternal()`, but I do feel this will make the logic for which value to use.

      I added the modifications to `DrawTextInternal()` in a previous CL in the stack. Let me know what you think!

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fernando Serboncini
      • Jean-Philippe Gravel
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
      Gerrit-Change-Number: 6006496
      Gerrit-PatchSet: 10
      Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-Attention: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Comment-Date: Wed, 20 Nov 2024 00:55:54 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andres Ricardo Perez <andres...@chromium.org>
      Comment-In-Reply-To: Jean-Philippe Gravel <jpgr...@chromium.org>
      Comment-In-Reply-To: Fernando Serboncini <fs...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Fernando Serboncini (Gerrit)

      unread,
      Nov 21, 2024, 12:19:25 PM (13 days ago) Nov 21
      to Andres Ricardo Perez, Hiroki Nakagawa, Fernando Serboncini, Jean-Philippe Gravel, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, horo+...@chromium.org, kenjibah...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, kinuko+ser...@chromium.org, jsbell+ser...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Andres Ricardo Perez and Jean-Philippe Gravel

      Fernando Serboncini added 2 comments

      File third_party/blink/renderer/core/html/canvas/text_metrics.idl
      Line 28, Patchset 6:dictionary GetTextClusterOptions {
      Fernando Serboncini . unresolved

      could we merge those two as TextClusterOptions?

      The align/baseline are the same (btw, Are the "?=null" necessary?)
      It would be reasonable to either ignore the x,y or add some meaning to it on the getTextCluster)

      Andres Ricardo Perez

      If it's okay to just ignore the `x` and `y` params then yes, at least implementation-wise.

      In that case, should they still be separate dictionaries in the IDL for the explainer?

      Fernando Serboncini

      I think no, just make them the same?

      File third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
      Line 3444, Patchset 10 (Latest): if (ParseTextAlign(cluster_options->align(), options_align)) {
      Fernando Serboncini . unresolved

      can't we just "ParseTextAlign(cluster_options->align(), align); and below?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andres Ricardo Perez
      • Jean-Philippe Gravel
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
      Gerrit-Change-Number: 6006496
      Gerrit-PatchSet: 10
      Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-Attention: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-Comment-Date: Thu, 21 Nov 2024 17:19:16 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andres Ricardo Perez <andres...@chromium.org>
      Comment-In-Reply-To: Fernando Serboncini <fs...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andres Ricardo Perez (Gerrit)

      unread,
      Nov 21, 2024, 2:53:41 PM (13 days ago) Nov 21
      to Hiroki Nakagawa, Fernando Serboncini, Jean-Philippe Gravel, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, horo+...@chromium.org, kenjibah...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, kinuko+ser...@chromium.org, jsbell+ser...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Fernando Serboncini and Jean-Philippe Gravel

      Andres Ricardo Perez added 2 comments

      File third_party/blink/renderer/core/html/canvas/text_metrics.idl
      Line 28, Patchset 6:dictionary GetTextClusterOptions {
      Fernando Serboncini . resolved

      could we merge those two as TextClusterOptions?

      The align/baseline are the same (btw, Are the "?=null" necessary?)
      It would be reasonable to either ignore the x,y or add some meaning to it on the getTextCluster)

      Andres Ricardo Perez

      If it's okay to just ignore the `x` and `y` params then yes, at least implementation-wise.

      In that case, should they still be separate dictionaries in the IDL for the explainer?

      Fernando Serboncini

      I think no, just make them the same?

      Andres Ricardo Perez

      Okay, I will use the same options dictionary for both in the explainer too. Thanks!

      File third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
      Line 3444, Patchset 10: if (ParseTextAlign(cluster_options->align(), options_align)) {
      Fernando Serboncini . resolved

      can't we just "ParseTextAlign(cluster_options->align(), align); and below?

      Andres Ricardo Perez

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fernando Serboncini
      • Jean-Philippe Gravel
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
      Gerrit-Change-Number: 6006496
      Gerrit-PatchSet: 11
      Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-Attention: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Comment-Date: Thu, 21 Nov 2024 19:53:29 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Jean-Philippe Gravel (Gerrit)

      unread,
      Nov 26, 2024, 12:44:04 PM (8 days ago) Nov 26
      to Andres Ricardo Perez, Code Review Nudger, Hiroki Nakagawa, Fernando Serboncini, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, horo+...@chromium.org, kenjibah...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, kinuko+ser...@chromium.org, jsbell+ser...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Andres Ricardo Perez and Fernando Serboncini

      Jean-Philippe Gravel voted and added 5 comments

      Votes added by Jean-Philippe Gravel

      Code-Review+1

      5 comments

      Patchset-level comments
      File-level comment, Patchset 11 (Latest):
      Jean-Philippe Gravel . resolved

      Looks good, appart from a few nits and suggestions.

      File third_party/blink/renderer/core/html/canvas/text_cluster.cc
      Line 7, Patchset 11 (Parent):#include "third_party/blink/renderer/platform/graphics/graphics_types.h"
      Jean-Philippe Gravel . unresolved

      This is still needed, isn't it? `TextAlign` and others are defined in this header.

      File third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
      Line 3423, Patchset 11 (Latest): fillTextCluster(text_cluster, x, y, nullptr);
      Jean-Philippe Gravel . unresolved

      Please name this parameter with a comment.

      Line 3431, Patchset 11 (Latest): TextAlign align = text_cluster->GetTextAlign();
      TextBaseline baseline = text_cluster->GetTextBaseline();
      double cluster_x = text_cluster->x();
      double cluster_y = text_cluster->y();
      Jean-Philippe Gravel . unresolved

      You are assigning all of these defaults even if they end up being never used if you have a `text_cluster`. Plus, the non-cluster-options API now needs to run though this more complex function. Why not just move each case of the `if` to the callers and have both `fillTextCluster` overloads call `DrawTextInternal` directly?

      File third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml-new/text.yaml
      Line 2290, Patchset 11 (Latest): let tm = ctx.measureText(text);
      Jean-Philippe Gravel . unresolved

      These two variables are never reassigned. Make them `const`, for consistency with the `text` variable?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andres Ricardo Perez
      • Fernando Serboncini
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
      Gerrit-Change-Number: 6006496
      Gerrit-PatchSet: 11
      Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-Attention: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Attention: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Comment-Date: Tue, 26 Nov 2024 17:43:52 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andres Ricardo Perez (Gerrit)

      unread,
      Nov 27, 2024, 3:33:20 PM (7 days ago) Nov 27
      to Jean-Philippe Gravel, Code Review Nudger, Hiroki Nakagawa, Fernando Serboncini, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, horo+...@chromium.org, kenjibah...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, kinuko+ser...@chromium.org, jsbell+ser...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Fernando Serboncini and Jean-Philippe Gravel

      Andres Ricardo Perez added 4 comments

      File third_party/blink/renderer/core/html/canvas/text_cluster.cc
      Line 7, Patchset 11 (Parent):#include "third_party/blink/renderer/platform/graphics/graphics_types.h"
      Jean-Philippe Gravel . resolved

      This is still needed, isn't it? `TextAlign` and others are defined in this header.

      Andres Ricardo Perez

      Done

      File third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
      Line 3423, Patchset 11: fillTextCluster(text_cluster, x, y, nullptr);
      Jean-Philippe Gravel . resolved

      Please name this parameter with a comment.

      Andres Ricardo Perez

      Done

      Line 3431, Patchset 11: TextAlign align = text_cluster->GetTextAlign();

      TextBaseline baseline = text_cluster->GetTextBaseline();
      double cluster_x = text_cluster->x();
      double cluster_y = text_cluster->y();
      Jean-Philippe Gravel . resolved

      You are assigning all of these defaults even if they end up being never used if you have a `text_cluster`. Plus, the non-cluster-options API now needs to run though this more complex function. Why not just move each case of the `if` to the callers and have both `fillTextCluster` overloads call `DrawTextInternal` directly?

      Andres Ricardo Perez

      @fserb suggested passing the non-options version of `fillTextCluster()` through here [in a previous comment](https://crrev.com/c/6006496/4..11/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc#b3422), although at that point we were copying the `TextCluster` object instead of passing the parameters directly.

      I'm also working on a CL that migrates the align and baselines enums to IDL enums, which would come pre-parsed and would allow much cleaner ternary operators. Following our in-person discussion, I will leave this CL as is and do that in a follow-up CL to the IDL migration one.

      File third_party/blink/web_tests/external/wpt/html/canvas/tools/yaml-new/text.yaml
      Line 2290, Patchset 11: let tm = ctx.measureText(text);
      Jean-Philippe Gravel . resolved

      These two variables are never reassigned. Make them `const`, for consistency with the `text` variable?

      Andres Ricardo Perez

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fernando Serboncini
      • Jean-Philippe Gravel
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Review
      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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
      Gerrit-Change-Number: 6006496
      Gerrit-PatchSet: 12
      Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
      Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-Attention: Fernando Serboncini <fs...@chromium.org>
      Gerrit-Comment-Date: Wed, 27 Nov 2024 20:33:11 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Jean-Philippe Gravel <jpgr...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Fernando Serboncini (Gerrit)

      unread,
      Dec 2, 2024, 2:56:43 PM (2 days ago) Dec 2
      to Andres Ricardo Perez, Jean-Philippe Gravel, Code Review Nudger, Hiroki Nakagawa, Fernando Serboncini, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Kentaro Hara, horo+...@chromium.org, kenjibah...@chromium.org, servicewor...@chromium.org, shimazu+se...@chromium.org, kinuko+ser...@chromium.org, jsbell+ser...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Andres Ricardo Perez and Jean-Philippe Gravel

      Fernando Serboncini added 2 comments

      Patchset-level comments
      File-level comment, Patchset 12 (Latest):
      Fernando Serboncini . resolved

      it's looking much much better. :P
      small nit.

      File third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
      Line 3428, Patchset 12 (Latest): TextAlign align = text_cluster->GetTextAlign();
      Fernando Serboncini . unresolved

      DCHECK(text_cluster) ?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andres Ricardo Perez
      • Jean-Philippe Gravel
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        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: Ie9d64dc7534c4deb8ae72472eeaea8df7e41c19a
        Gerrit-Change-Number: 6006496
        Gerrit-PatchSet: 12
        Gerrit-Owner: Andres Ricardo Perez <andres...@chromium.org>
        Gerrit-Reviewer: Andres Ricardo Perez <andres...@chromium.org>
        Gerrit-Reviewer: Fernando Serboncini <fs...@chromium.org>
        Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
        Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
        Gerrit-CC: Hiroki Nakagawa <nhi...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-Attention: Andres Ricardo Perez <andres...@chromium.org>
        Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
        Gerrit-Comment-Date: Mon, 02 Dec 2024 19:56:37 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages