New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify invisible text #29

Open
npm1 opened this Issue May 24, 2018 · 8 comments

Comments

Projects
None yet
6 participants
@npm1
Copy link
Collaborator

npm1 commented May 24, 2018

The Paint Timing API says that a paint occurs when the browser has rendered pixels to the screen. Invisible text and whitespaces technically do not cause pixels to be rendered in the screen, but the text can still be highlighted or searched and this would probably cause pixels to be rendered in the screen. It's also not super clear to me how easy it is for browsers to keep track of all invisible text and differentiate it with visible text. The spec should probably clarify whether this kind of text triggers a First Paint and/or a First Contentful Paint. Also, explicit tests should be added to test the behavior when only this kind of text is rendered in a frame.

@tdresser @spanicker let's first agree on what should happen and then I'll send PRs and tests?

@tdresser

This comment has been minimized.

Copy link
Contributor

tdresser commented May 24, 2018

We might just have to leave it vague. We should probably spec that FP & FCP should behave the same with respect to invisible text though?

@igrigorik

This comment has been minimized.

Copy link
Member

igrigorik commented May 25, 2018

@npm1 what is our behavior today in Chrome?

@npm1

This comment has been minimized.

Copy link
Collaborator

npm1 commented May 25, 2018

The following is exposed in Chrome:

  • &nbsp: first-paint

  • visibility: hidden 'a': first-paint, first-contentful-paint

  • visibility: hidden &nbsp: nothing

@igrigorik

This comment has been minimized.

Copy link
Member

igrigorik commented May 25, 2018

Sorry, I meant.. How does Chrome react in response to invisible text? E.g. if I create page with nothing but text on it and a webfont that takes forever to load, what would FP / FCP tell me today?

@npm1

This comment has been minimized.

Copy link
Collaborator

npm1 commented May 25, 2018

I think the spec says that even First Contentful Paint "includes text with pending webfonts" (but I haven't confirmed Chrome's behavior).

@igrigorik igrigorik added this to the Level 1 milestone May 25, 2018

@irori

This comment has been minimized.

Copy link

irori commented Jun 19, 2018

It seems Chrome triggers FP and FCP on invisible text:
http://output.jsbin.com/lipuzewube/2/quiet

@tdresser

This comment has been minimized.

Copy link
Contributor

tdresser commented Oct 25, 2018

Next step: find a list of cases where we run into whitespaces causing these metrics to fire early.

@toddreifsteck

This comment has been minimized.

Copy link
Member

toddreifsteck commented Oct 25, 2018

Discussed at TPAC 2018:

  • We agreed that the critical issues are important to specify.
  • @tdresser @npm1 @rniwa will review data to determine important white space add to the spec then bring proposal back.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment