Skip to content

Define read-back-allowed rendering - #12554

Open
foolip wants to merge 12 commits into
mainfrom
foolip/privacy-preserving-rendering
Open

foolip wants to merge 12 commits into
mainfrom
foolip/privacy-preserving-rendering

Conversation

@foolip

@foolip foolip commented Jun 9, 2026

Copy link
Copy Markdown
Member
  • At least two implementers are interested (and none opposed):
  • Tests are written and can be reviewed and commented upon at:
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: …
    • WebKit: …
    • Deno (only for timers, structured clone, base64 utils, channel messaging, module resolution, web workers, and web storage): …
    • Node.js (only for timers, structured clone, base64 utils, channel messaging, and module resolution): …
  • Corresponding HTML AAM & ARIA in HTML issues & PRs:
  • MDN issue is filed: …
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


/index.html ( diff )
/infrastructure.html ( diff )
/rendering.html ( diff )

Comment thread source Outdated
Comment thread source Outdated
Comment thread source Outdated
@nigelmegitt

nigelmegitt commented Jun 9, 2026

Copy link
Copy Markdown

What's the motivation behind privacy-preserving rendering of subtitles and captions not taking into account user preferences? As I understand it, WebVTT rendering done by the UA or OS is already supposed to be privacy-preserving, and the current design choice is that there are no Web APIs for querying user preferences or for extracting styling choices from the rendered captions.

It seems odd that privacy-preservation should have a negative impact on accessibility settings that aren't exposed to pages.

(aside: I actually don't think the argument for prohibiting Web APIs for accessing user settings holds up any more, but that's a whole different discussion)

@annevk

annevk commented Jun 9, 2026

Copy link
Copy Markdown
Member

This is a rendering mode that allows for arbitrary read back. Maybe instead of calling it privacy-preserving we should call it "read-back rendering mode".

@nigelmegitt

Copy link
Copy Markdown

That would be a lot clearer, yes, seems like I got a whole different impression from the name alone.

Not sure if this PR is the right place for the discussion (please point me to the right place: there's no linked issue), but since I'm here: Is this related to test drivers/engines? I'd expect test engines, when inspecting rendering results, to be able to choose whether to use this "read-back rendering mode" or to be able to read back the result rendered with a provided context of specific user settings.

@foolip foolip mentioned this pull request Jun 11, 2026
6 tasks
@foolip foolip changed the title Define privacy-preserving rendering Define read-back-allowed rendering Jun 16, 2026
@foolip

foolip commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

After discussion with @annevk on chat I'll rename it "read-back-allowed rendering" since read back might not actually happen.

@annevk annevk added topic: canvas security/privacy There are security or privacy implications labels Jun 16, 2026
@schenney-chromium

Copy link
Copy Markdown
Contributor

That would be a lot clearer, yes, seems like I got a whole different impression from the name alone.

Not sure if this PR is the right place for the discussion (please point me to the right place: there's no linked issue), but since I'm here: Is this related to test drivers/engines? I'd expect test engines, when inspecting rendering results, to be able to choose whether to use this "read-back rendering mode" or to be able to read back the result rendered with a provided context of specific user settings.

The test drivers/engines is an interesting point we had not considered. We have thought to refer to read-back-allowed in the SVG spec, where there are issues with SVG-as-Image used as an image source in a canvas and the related tainting behavior.

Comment thread source
<span>rules for updating the display of WebVTT text tracks</span>. <ref>WEBVTT</ref></p>

<p>During <span>read-back-allowed rendering</span>, <code>video</code> elements whose <span>media
data</span> is <span>CORS-cross-origin</span> must not be rendered.</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSS specs already use the term "not rendered" to specifically mean "acts like display:none". (See Images, where it's a condition, and Grid, where it's an effect like you're doing here.)

Is this what we want? If so, we can just copy Grid's wording and say ", as if it were display: none".

This has layout effects, so if we instead want it to just not paint, we should use a different term to avoid the clash, and specify "as if it were opacity: 0".

Alternately, I think previous proposals in this space made them paint as solid opaque black, so the hole was observable and obvious in debugging.

Comment thread source
data</span> is <span>CORS-cross-origin</span> must not be rendered.</p>

<p>During <span>read-back-allowed rendering</span>, controls, subtitles and captions must not be
rendered.</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And same here obvs. Note that, while CORS-violating images still leak sizing info, so observing the geometry via other layout effects doesn't leak any further info, this isn't necessarily true for these elements. Dunno if you can use anchorpos to observe their geometry indirectly, but if we assume that someday you can, this would be an info leak. We probably do mean "as if display:none" here, at least for subs/captions, then? They float on the video so there's no layout side-effects from making them not render boxes.

Probably also useful to clarify that this applies to these elements even on non-CORS-cross-origin videos, just to contrast it with the preceding bullet point.

Comment thread source

<p>During <span>read-back-allowed rendering</span>, <code>img</code> and <code>input</code>
elements whose <span>current request</span>'s <span data-x="img-req-data">image data</span> is
<span>CORS-cross-origin</span> must not be rendered.</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same clarification that you apply to replaced elements here.

Comment thread source

<p>During <span>read-back-allowed rendering</span>, user agents are <span>expected</span> to act
as if the <code data-x="selector-visited">:visited</code> <span>pseudo-class</span> does not
match.</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead, point to https://drafts.csswg.org/selectors/#link and say that UAs must preserve privacy for :link/:visited in the same way that they do in other contexts.

Comment thread source

<h4>Summary</h4>

<!-- NON-NORMATIVE SECTION -->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then obvs update this informative section to match whatever changes are made above.

@tabatkins

Copy link
Copy Markdown
Contributor

Ah here we go, the term we want to lean on for "not rendered" is instead "invisible", from Display 4. Not painted, not hit-tested, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security/privacy There are security or privacy implications topic: canvas

Development

Successfully merging this pull request may close these issues.

5 participants