Add privacy enforcement tests for mathml anchor element [chromium/src : main]

0 views
Skip to first unread message

Frédéric Wang Nélar (Gerrit)

unread,
Jul 1, 2026, 7:03:57 AM (5 days ago) Jul 1
to tannal, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
Attention needed from tannal

Frédéric Wang Nélar voted and added 6 comments

Votes added by Frédéric Wang Nélar

Code-Review-1

6 comments

File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/anchor-visited-privacy.html
Line 6, Patchset 1 (Latest): <link rel="help" href="https://w3c.github.io/mathml-core/#security-considerations">
Frédéric Wang Nélar . unresolved

I guess this should be https://w3c.github.io/mathml-core/#privacy-considerations

but still I don't find where the behavior tested here is specified. Do you know where it is specified for HTML?

Line 22, Patchset 1 (Latest): <a id="mathLink" href="">
Frédéric Wang Nélar . unresolved

maybe add a comment that this points to the current file so it's visited.

File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/canvas-visited-privacy.html
Line 8, Patchset 1 (Latest): <script src="/mathml/support/ahem-base64.js"></script>
Frédéric Wang Nélar . unresolved

Inserting base64 does not look great.


How about you use

```
a:link > mspace { background: rgb(0, 0, 255); }
a:visited > mspace { background: rgb(255, 0, 0); }
```

and

```
<math xmlns="http://www.w3.org/1998/Math/MathML">
<a href=""><mspace width="200px" height="50px"></a>
</math>
```

maybe with extra tweak to make sure it fits the svg/canvas size.

Line 41, Patchset 1 (Latest): <a href=""><mtext>X</mtext></a>
Frédéric Wang Nélar . unresolved

maybe add a comment that this points to the current file so it's visited.

Line 63, Patchset 1 (Latest): const imgData = ctx.getImageData(0, 0, 1, 1);
Frédéric Wang Nélar . unresolved

testing this single pixel at coordinate (0,0) seems a bit fragile, for example if the math does not not perfectly fit into the SVG.

I would test the middle pixel at (100, 25) which is more likely to contain the mspace.

Line 71, Patchset 1 (Latest): assert_equals(b, 255, "Blue channel must be 255 as specified in :link selector.");
Frédéric Wang Nélar . unresolved

I think this does not work (see 3 of https://frederic-wang.fr/2025/02/21/five-testharness-dot-js-mistakes/).

What about this:

``` 
function tryGetImgData(sx, sy, sw, sh) {
try {
return ctx.getImageData(sx, sy, sw, sh).data;
} catch(e) {
return null;
}
}
let imgData = tryGetImgData(...);
if (imgData) {
// For browsers returning the data, check pixel color does not reveal :visited.
} else {
/ For browsers throwing, verify this is a security error.
assert_throws_dom("SecurityError", _ => tryGetImgData(...));
}
```
Open in Gerrit

Related details

Attention is currently required from:
  • tannal
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is blockingCode-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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
Gerrit-Change-Number: 8010987
Gerrit-PatchSet: 1
Gerrit-Owner: tannal <mt...@igalia.com>
Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
Gerrit-Attention: tannal <mt...@igalia.com>
Gerrit-Comment-Date: Wed, 01 Jul 2026 11:03:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
blocking_requirement
unsatisfied_requirement
open
diffy

tannal (Gerrit)

unread,
Jul 1, 2026, 7:31:48 AM (5 days ago) Jul 1
to Frédéric Wang Nélar, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
Attention needed from Frédéric Wang Nélar

tannal added 1 comment

File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/anchor-visited-privacy.html
Frédéric Wang Nélar . unresolved

I guess this should be https://w3c.github.io/mathml-core/#privacy-considerations

but still I don't find where the behavior tested here is specified. Do you know where it is specified for HTML?

tannal

This behavior is specified in the css selectors spec[1] and MDN page [2]

[1] https://www.w3.org/TR/selectors-4/#link
[2] https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Selectors/Privacy_and_:visited

I didn't find related information in the html spec either.

Open in Gerrit

Related details

Attention is currently required from:
  • Frédéric Wang Nélar
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is blockingCode-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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
Gerrit-Change-Number: 8010987
Gerrit-PatchSet: 1
Gerrit-Owner: tannal <mt...@igalia.com>
Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
Gerrit-Attention: Frédéric Wang Nélar <fw...@igalia.com>
Gerrit-Comment-Date: Wed, 01 Jul 2026 11:31:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Frédéric Wang Nélar <fw...@igalia.com>
satisfied_requirement
blocking_requirement
unsatisfied_requirement
open
diffy

tannal (Gerrit)

unread,
Jul 1, 2026, 9:21:02 PM (5 days ago) Jul 1
to Frédéric Wang Nélar, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
Attention needed from Frédéric Wang Nélar

tannal added 6 comments

File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/anchor-visited-privacy.html
Line 6, Patchset 1: <link rel="help" href="https://w3c.github.io/mathml-core/#security-considerations">
Frédéric Wang Nélar . resolved

I guess this should be https://w3c.github.io/mathml-core/#privacy-considerations

but still I don't find where the behavior tested here is specified. Do you know where it is specified for HTML?

tannal

This behavior is specified in the css selectors spec[1] and MDN page [2]

[1] https://www.w3.org/TR/selectors-4/#link
[2] https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Selectors/Privacy_and_:visited

I didn't find related information in the html spec either.

tannal

I updated the help link to css selector spec.

Line 22, Patchset 1: <a id="mathLink" href="">
Frédéric Wang Nélar . resolved

maybe add a comment that this points to the current file so it's visited.

tannal

Done

File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/canvas-visited-privacy.html
Line 8, Patchset 1: <script src="/mathml/support/ahem-base64.js"></script>
Frédéric Wang Nélar . resolved

Inserting base64 does not look great.


How about you use

```
a:link > mspace { background: rgb(0, 0, 255); }
a:visited > mspace { background: rgb(255, 0, 0); }
```

and

```
<math xmlns="http://www.w3.org/1998/Math/MathML">
<a href=""><mspace width="200px" height="50px"></a>
</math>
```

maybe with extra tweak to make sure it fits the svg/canvas size.

tannal

Done

Line 41, Patchset 1: <a href=""><mtext>X</mtext></a>
Frédéric Wang Nélar . resolved

maybe add a comment that this points to the current file so it's visited.

tannal

Done

Line 63, Patchset 1: const imgData = ctx.getImageData(0, 0, 1, 1);
Frédéric Wang Nélar . resolved

testing this single pixel at coordinate (0,0) seems a bit fragile, for example if the math does not not perfectly fit into the SVG.

I would test the middle pixel at (100, 25) which is more likely to contain the mspace.

tannal

Done

Line 71, Patchset 1: assert_equals(b, 255, "Blue channel must be 255 as specified in :link selector.");
Frédéric Wang Nélar . resolved

I think this does not work (see 3 of https://frederic-wang.fr/2025/02/21/five-testharness-dot-js-mistakes/).

What about this:

``` 
function tryGetImgData(sx, sy, sw, sh) {
try {
return ctx.getImageData(sx, sy, sw, sh).data;
} catch(e) {
return null;
}
}
let imgData = tryGetImgData(...);
if (imgData) {
// For browsers returning the data, check pixel color does not reveal :visited.
} else {
/ For browsers throwing, verify this is a security error.
assert_throws_dom("SecurityError", _ => tryGetImgData(...));
}
```
tannal

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Frédéric Wang Nélar
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is blockingCode-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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
    Gerrit-Change-Number: 8010987
    Gerrit-PatchSet: 3
    Gerrit-Owner: tannal <mt...@igalia.com>
    Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
    Gerrit-Attention: Frédéric Wang Nélar <fw...@igalia.com>
    Gerrit-Comment-Date: Thu, 02 Jul 2026 01:20:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Frédéric Wang Nélar <fw...@igalia.com>
    Comment-In-Reply-To: tannal <mt...@igalia.com>
    satisfied_requirement
    blocking_requirement
    unsatisfied_requirement
    open
    diffy

    Frédéric Wang Nélar (Gerrit)

    unread,
    Jul 1, 2026, 10:26:31 PM (5 days ago) Jul 1
    to tannal, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
    Attention needed from tannal

    Frédéric Wang Nélar voted and added 5 comments

    Votes added by Frédéric Wang Nélar

    Code-Review+0

    5 comments

    File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/anchor-visited-privacy.html
    Frédéric Wang Nélar . unresolved

    OK, as I read this is just a suggested approach, but I guess if all browsers are doing that it is fine.

    Line 15, Patchset 3 (Latest): color: rgb(255, 0, 0) !important;
    Frédéric Wang Nélar . unresolved

    Why !important?

    Line 34, Patchset 3 (Latest): "The computed style of :visited MathML 'a' element must be masked to protect user history privacy.");
    Frédéric Wang Nélar . unresolved

    I think this description does not bring more information, so I would remove it.

    File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/canvas-visited-privacy.html
    Line 25, Patchset 3 (Latest): a:link > mspace { background: rgb(0, 0, 255); }
    Frédéric Wang Nélar . unresolved

    In a previous patch, you mentioned that the color of link is a special blue (let's say purple?), but I would use something that is not blue to make clear this selector is applied.

    Line 64, Patchset 3 (Latest): assert_equals(b, 255, "Blue channel must be 255 as specified in :link selector.");
    Frédéric Wang Nélar . unresolved

    It's a bit weird to test each channel individually, as at the end we'll have a single background color applied, so I would just do

    `assert_array_equals(imgData, [...], "Background color should apply style from :link but not from :visited.");`

    If you want, you can also use two independent properties like :link { background-color: ... } and :visited { opacity: .5; } so it's clear whether none, one or two of them is applied.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • tannal
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
      Gerrit-Change-Number: 8010987
      Gerrit-PatchSet: 3
      Gerrit-Owner: tannal <mt...@igalia.com>
      Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
      Gerrit-Attention: tannal <mt...@igalia.com>
      Gerrit-Comment-Date: Thu, 02 Jul 2026 02:26:07 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      tannal (Gerrit)

      unread,
      Jul 2, 2026, 12:15:31 AM (5 days ago) Jul 2
      to Frédéric Wang Nélar, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
      Attention needed from Frédéric Wang Nélar

      tannal added 6 comments

      Patchset-level comments
      File-level comment, Patchset 3:
      tannal . resolved

      Using :any-link instead of :link is because :any-link is applied independent of whether it has been visited or not.
      While :link is applied when the href is not visited.

      Despite sometimes :link and :visited applied at the same time in chrome and firefox, not sure why.
      If you change the :any-link to :link in the anchor-visited-privacy.html, it will show red text with a green background in the page.
      I'm not sure if it's a bug.

      File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/anchor-visited-privacy.html
      Line 6, Patchset 3: <link rel="help" href="https://drafts.csswg.org/selectors-4/#link">
      Frédéric Wang Nélar . resolved

      OK, as I read this is just a suggested approach, but I guess if all browsers are doing that it is fine.

      tannal

      Acknowledged

      Line 15, Patchset 3: color: rgb(255, 0, 0) !important;
      Frédéric Wang Nélar . resolved

      Why !important?

      tannal

      Hmm, it's a mistake.
      Should be removed.
      Good catch

      Line 34, Patchset 3: "The computed style of :visited MathML 'a' element must be masked to protect user history privacy.");
      Frédéric Wang Nélar . resolved

      I think this description does not bring more information, so I would remove it.

      tannal

      Done.

      File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/canvas-visited-privacy.html
      Line 25, Patchset 3: a:link > mspace { background: rgb(0, 0, 255); }
      Frédéric Wang Nélar . resolved

      In a previous patch, you mentioned that the color of link is a special blue (let's say purple?), but I would use something that is not blue to make clear this selector is applied.

      tannal

      I changed the default style (:any-link) to green.

      Line 64, Patchset 3: assert_equals(b, 255, "Blue channel must be 255 as specified in :link selector.");
      Frédéric Wang Nélar . unresolved

      It's a bit weird to test each channel individually, as at the end we'll have a single background color applied, so I would just do

      `assert_array_equals(imgData, [...], "Background color should apply style from :link but not from :visited.");`

      If you want, you can also use two independent properties like :link { background-color: ... } and :visited { opacity: .5; } so it's clear whether none, one or two of them is applied.

      tannal

      Seems like the :visited selector has some restrictions on what properties can used in the css rule. [1]

      Opacity is not allowed in :visited selector.

      I'll stick to the background color for both :visited and :any-link.

      Again changed :any-link's background-color to green.

      [1] https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:visited#privacy_restrictions

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Frédéric Wang Nélar
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
      Gerrit-Change-Number: 8010987
      Gerrit-PatchSet: 4
      Gerrit-Owner: tannal <mt...@igalia.com>
      Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
      Gerrit-Attention: Frédéric Wang Nélar <fw...@igalia.com>
      Gerrit-Comment-Date: Thu, 02 Jul 2026 04:15:07 +0000
      Gerrit-HasComments: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Frédéric Wang Nélar (Gerrit)

      unread,
      Jul 2, 2026, 5:51:50 AM (4 days ago) Jul 2
      to tannal, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
      Attention needed from tannal

      Frédéric Wang Nélar voted

      Code-Review+1
      Commit-Queue+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • tannal
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
      Gerrit-Change-Number: 8010987
      Gerrit-PatchSet: 4
      Gerrit-Owner: tannal <mt...@igalia.com>
      Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
      Gerrit-Attention: tannal <mt...@igalia.com>
      Gerrit-Comment-Date: Thu, 02 Jul 2026 09:51:31 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      tannal (Gerrit)

      unread,
      Jul 2, 2026, 5:55:57 AM (4 days ago) Jul 2
      to Chromium LUCI CQ, Frédéric Wang Nélar, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org

      tannal added 1 comment

      File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/canvas-visited-privacy.html
      Line 64, Patchset 3: assert_equals(b, 255, "Blue channel must be 255 as specified in :link selector.");
      Frédéric Wang Nélar . resolved

      It's a bit weird to test each channel individually, as at the end we'll have a single background color applied, so I would just do

      `assert_array_equals(imgData, [...], "Background color should apply style from :link but not from :visited.");`

      If you want, you can also use two independent properties like :link { background-color: ... } and :visited { opacity: .5; } so it's clear whether none, one or two of them is applied.

      tannal

      Seems like the :visited selector has some restrictions on what properties can used in the css rule. [1]

      Opacity is not allowed in :visited selector.

      I'll stick to the background color for both :visited and :any-link.

      Again changed :any-link's background-color to green.

      [1] https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:visited#privacy_restrictions

      tannal

      Acknowledged

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
        Gerrit-Change-Number: 8010987
        Gerrit-PatchSet: 4
        Gerrit-Owner: tannal <mt...@igalia.com>
        Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
        Gerrit-Comment-Date: Thu, 02 Jul 2026 09:55:38 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Frédéric Wang Nélar <fw...@igalia.com>
        Comment-In-Reply-To: tannal <mt...@igalia.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Frédéric Wang Nélar (Gerrit)

        unread,
        Jul 2, 2026, 7:13:51 AM (4 days ago) Jul 2
        to tannal, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
        Attention needed from tannal

        Frédéric Wang Nélar voted Commit-Queue+2

        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention is currently required from:
        • tannal
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
        Gerrit-Change-Number: 8010987
        Gerrit-PatchSet: 4
        Gerrit-Owner: tannal <mt...@igalia.com>
        Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
        Gerrit-Attention: tannal <mt...@igalia.com>
        Gerrit-Comment-Date: Thu, 02 Jul 2026 11:13:30 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Fredrik Söderquist (Gerrit)

        unread,
        Jul 2, 2026, 12:20:15 PM (4 days ago) Jul 2
        to tannal, Stephen Chenney, Chromium LUCI CQ, Frédéric Wang Nélar, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
        Attention needed from Frédéric Wang Nélar, Stephen Chenney and tannal

        Fredrik Söderquist added 4 comments

        Commit Message
        Line 9, Patchset 4 (Latest):For the canvas test, render a SVG image containing a mathml a element into canvas,
        then verify that the :visited selector is not applied in the canvas result.

        For the dom test, we check the :visited rule can't be queried by getComputedStyle.
        Fredrik Söderquist . unresolved

        Use the "Format" button.

        File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/anchor-visited-privacy.html
        Line 2, Patchset 4 (Latest):
        <head>
        Fredrik Söderquist . unresolved

        `<head>` and `<body>` can be removed.

        File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/canvas-visited-privacy.html
        Line 3, Patchset 4 (Latest):<head>
        Fredrik Söderquist . unresolved

        Ditto

        Line 51, Patchset 4 (Latest): function tryGetImgData(sx, sy, sw, sh) {

        try {
        return ctx.getImageData(sx, sy, sw, sh).data;
        } catch (e) {
        return null;
        }
        }
        Fredrik Söderquist . unresolved

        I'd just combine this with the if-else below. I think that will make the test more obvious.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Frédéric Wang Nélar
        • Stephen Chenney
        • tannal
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
          Gerrit-Change-Number: 8010987
          Gerrit-PatchSet: 4
          Gerrit-Owner: tannal <mt...@igalia.com>
          Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
          Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
          Gerrit-Reviewer: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: Frédéric Wang Nélar <fw...@igalia.com>
          Gerrit-Attention: tannal <mt...@igalia.com>
          Gerrit-Comment-Date: Thu, 02 Jul 2026 16:19:52 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Frédéric Wang Nélar (Gerrit)

          unread,
          Jul 2, 2026, 2:20:45 PM (4 days ago) Jul 2
          to tannal, Stephen Chenney, Fredrik Söderquist, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
          Attention needed from Stephen Chenney and tannal

          Frédéric Wang Nélar added 1 comment

          File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/canvas-visited-privacy.html
          Line 51, Patchset 4 (Latest): function tryGetImgData(sx, sy, sw, sh) {
          try {
          return ctx.getImageData(sx, sy, sw, sh).data;
          } catch (e) {
          return null;
          }
          }
          Fredrik Söderquist . unresolved

          I'd just combine this with the if-else below. I think that will make the test more obvious.

          Frédéric Wang Nélar

          As I previously mentioned, assert_* functions are throwing exceptions when the assertion fails, so we should avoid placing them in a try { } catch { } block.

          Probably a comment should be added to explain that.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Stephen Chenney
          • tannal
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
          Gerrit-Change-Number: 8010987
          Gerrit-PatchSet: 4
          Gerrit-Owner: tannal <mt...@igalia.com>
          Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
          Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
          Gerrit-Reviewer: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: tannal <mt...@igalia.com>
          Gerrit-Comment-Date: Thu, 02 Jul 2026 18:20:26 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Fredrik Söderquist <f...@opera.com>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Fredrik Söderquist (Gerrit)

          unread,
          Jul 3, 2026, 6:56:24 AM (3 days ago) Jul 3
          to tannal, Stephen Chenney, Chromium LUCI CQ, Frédéric Wang Nélar, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
          Attention needed from Stephen Chenney and tannal

          Fredrik Söderquist added 1 comment

          File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/canvas-visited-privacy.html
          Line 51, Patchset 4 (Latest): function tryGetImgData(sx, sy, sw, sh) {
          try {
          return ctx.getImageData(sx, sy, sw, sh).data;
          } catch (e) {
          return null;
          }
          }
          Fredrik Söderquist . resolved

          I'd just combine this with the if-else below. I think that will make the test more obvious.

          Frédéric Wang Nélar

          As I previously mentioned, assert_* functions are throwing exceptions when the assertion fails, so we should avoid placing them in a try { } catch { } block.

          Probably a comment should be added to explain that.

          Fredrik Söderquist

          Acknowledged

          Gerrit-Comment-Date: Fri, 03 Jul 2026 10:56:07 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Frédéric Wang Nélar <fw...@igalia.com>
          Comment-In-Reply-To: Fredrik Söderquist <f...@opera.com>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          tannal (Gerrit)

          unread,
          Jul 4, 2026, 10:59:11 PM (2 days ago) Jul 4
          to Stephen Chenney, Fredrik Söderquist, Chromium LUCI CQ, Frédéric Wang Nélar, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
          Attention needed from Fredrik Söderquist, Frédéric Wang Nélar and Stephen Chenney

          tannal added 4 comments

          Patchset-level comments
          File-level comment, Patchset 6 (Latest):
          tannal . resolved

          Thanks for all the feedbacks!

          Commit Message
          Line 9, Patchset 4:For the canvas test, render a SVG image containing a mathml a element into canvas,

          then verify that the :visited selector is not applied in the canvas result.

          For the dom test, we check the :visited rule can't be queried by getComputedStyle.
          Fredrik Söderquist . resolved

          Use the "Format" button.

          tannal

          Done

          File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/anchor-visited-privacy.html
          Line 2, Patchset 4:
          <head>
          Fredrik Söderquist . resolved

          `<head>` and `<body>` can be removed.

          tannal

          Done

          File third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/canvas-visited-privacy.html
          Line 3, Patchset 4:<head>
          Fredrik Söderquist . resolved

          Ditto

          tannal

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Fredrik Söderquist
          • Frédéric Wang Nélar
          • Stephen Chenney
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
              Gerrit-Change-Number: 8010987
              Gerrit-PatchSet: 6
              Gerrit-Owner: tannal <mt...@igalia.com>
              Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
              Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
              Gerrit-Reviewer: Stephen Chenney <sche...@chromium.org>
              Gerrit-Attention: Stephen Chenney <sche...@chromium.org>
              Gerrit-Attention: Frédéric Wang Nélar <fw...@igalia.com>
              Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
              Gerrit-Comment-Date: Sun, 05 Jul 2026 02:58:49 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Fredrik Söderquist <f...@opera.com>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Frédéric Wang Nélar (Gerrit)

              unread,
              Jul 5, 2026, 8:36:42 AM (yesterday) Jul 5
              to tannal, Stephen Chenney, Fredrik Söderquist, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
              Attention needed from Fredrik Söderquist, Stephen Chenney and tannal

              Frédéric Wang Nélar voted Code-Review+1

              Code-Review+1
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Fredrik Söderquist
              • Stephen Chenney
              • tannal
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
              Gerrit-Change-Number: 8010987
              Gerrit-PatchSet: 6
              Gerrit-Owner: tannal <mt...@igalia.com>
              Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
              Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
              Gerrit-Reviewer: Stephen Chenney <sche...@chromium.org>
              Gerrit-Attention: Stephen Chenney <sche...@chromium.org>
              Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
              Gerrit-Attention: tannal <mt...@igalia.com>
              Gerrit-Comment-Date: Sun, 05 Jul 2026 12:36:19 +0000
              Gerrit-HasComments: No
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Fredrik Söderquist (Gerrit)

              unread,
              7:31 AM (8 hours ago) 7:31 AM
              to tannal, Frédéric Wang Nélar, Stephen Chenney, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
              Attention needed from Stephen Chenney and tannal

              Fredrik Söderquist voted Code-Review+1

              Code-Review+1
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Stephen Chenney
              • tannal
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement satisfiedCode-Owners
                • requirement satisfiedCode-Review
                • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
                Gerrit-Change-Number: 8010987
                Gerrit-PatchSet: 6
                Gerrit-Owner: tannal <mt...@igalia.com>
                Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
                Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
                Gerrit-Reviewer: Stephen Chenney <sche...@chromium.org>
                Gerrit-Attention: Stephen Chenney <sche...@chromium.org>
                Gerrit-Attention: tannal <mt...@igalia.com>
                Gerrit-Comment-Date: Mon, 06 Jul 2026 11:31:28 +0000
                Gerrit-HasComments: No
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                open
                diffy

                Blink W3C Test Autoroller (Gerrit)

                unread,
                7:42 AM (8 hours ago) 7:42 AM
                to tannal, Fredrik Söderquist, Frédéric Wang Nélar, Stephen Chenney, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
                Attention needed from Stephen Chenney and tannal

                Message from Blink W3C Test Autoroller

                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/61082.

                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

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Stephen Chenney
                • tannal
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement satisfiedCode-Owners
                • requirement satisfiedCode-Review
                • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
                Gerrit-Change-Number: 8010987
                Gerrit-PatchSet: 6
                Gerrit-Owner: tannal <mt...@igalia.com>
                Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
                Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
                Gerrit-Reviewer: Stephen Chenney <sche...@chromium.org>
                Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
                Gerrit-Comment-Date: Mon, 06 Jul 2026 11:42:15 +0000
                Gerrit-HasComments: No
                Gerrit-Has-Labels: No
                satisfied_requirement
                open
                diffy

                Frédéric Wang Nélar (Gerrit)

                unread,
                10:26 AM (5 hours ago) 10:26 AM
                to tannal, Blink W3C Test Autoroller, Fredrik Söderquist, Stephen Chenney, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org
                Attention needed from Stephen Chenney and tannal

                Frédéric Wang Nélar voted Commit-Queue+2

                Commit-Queue+2
                Gerrit-Comment-Date: Mon, 06 Jul 2026 14:25:52 +0000
                Gerrit-HasComments: No
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                open
                diffy

                Chromium LUCI CQ (Gerrit)

                unread,
                10:37 AM (5 hours ago) 10:37 AM
                to tannal, Frédéric Wang Nélar, Blink W3C Test Autoroller, Fredrik Söderquist, Stephen Chenney, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org

                Chromium LUCI CQ submitted the change

                Change information

                Commit message:
                Add privacy enforcement tests for mathml anchor element


                For the canvas test, render a SVG image containing a mathml a element
                into canvas, then verify that the :visited selector is not applied in
                the canvas result.

                For the dom test, we check the :visited rule can't be queried by
                getComputedStyle.
                Bug: 510487697
                Change-Id: I9d5b83c13ef66317e0f80e68f276a563a79078e1
                Commit-Queue: Frédéric Wang Nélar <fw...@igalia.com>
                Reviewed-by: Frédéric Wang Nélar <fw...@igalia.com>
                Reviewed-by: Fredrik Söderquist <f...@opera.com>
                Cr-Commit-Position: refs/heads/main@{#1657182}
                Files:
                • A third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/anchor-visited-privacy.html
                • A third_party/blink/web_tests/external/wpt/mathml/relations/html5-tree/canvas-visited-privacy.html
                Change size: M
                Delta: 2 files changed, 101 insertions(+), 0 deletions(-)
                Branch: refs/heads/main
                Submit Requirements:
                • requirement satisfiedCode-Review: +1 by Fredrik Söderquist, +1 by Frédéric Wang Nélar
                Open in Gerrit
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: merged
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I9d5b83c13ef66317e0f80e68f276a563a79078e1
                Gerrit-Change-Number: 8010987
                Gerrit-PatchSet: 7
                Gerrit-Owner: tannal <mt...@igalia.com>
                Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
                Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
                Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
                Gerrit-Reviewer: Stephen Chenney <sche...@chromium.org>
                Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
                open
                diffy
                satisfied_requirement

                Blink W3C Test Autoroller (Gerrit)

                unread,
                12:06 PM (4 hours ago) 12:06 PM
                to Chromium LUCI CQ, tannal, Frédéric Wang Nélar, Fredrik Söderquist, Stephen Chenney, android-bu...@system.gserviceaccount.com, blink-...@chromium.org, blink-revie...@chromium.org

                Message from Blink W3C Test Autoroller

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

                Open in Gerrit

                Related details

                Attention set is empty
                Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement satisfiedCode-Owners
                • requirement satisfiedCode-Review
                • requirement 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: I9d5b83c13ef66317e0f80e68f276a563a79078e1
                Gerrit-Change-Number: 8010987
                Gerrit-PatchSet: 7
                Gerrit-Owner: tannal <mt...@igalia.com>
                Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
                Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
                Gerrit-Reviewer: Frédéric Wang Nélar <fw...@igalia.com>
                Gerrit-Reviewer: Stephen Chenney <sche...@chromium.org>
                Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
                Gerrit-Comment-Date: Mon, 06 Jul 2026 16:05:52 +0000
                Gerrit-HasComments: No
                Gerrit-Has-Labels: No
                satisfied_requirement
                open
                diffy
                Reply all
                Reply to author
                Forward
                0 new messages