Re: [css-houdini-drafts] Print behaviour & test requirements (#978)

The CSS Working Group just discussed `????`, and agreed to the following:

* `RESOLVED: Any Houdini JS that needs to run for style / layout calc needs to run for print`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: ????<br>
&lt;fantasai> s/????/Print Behavior and Test Requirements/<br>
&lt;Rossen___>  github: https://github.com/w3c/css-houdini-drafts/issues/978<br>
&lt;fantasai> github: https://github.com/w3c/css-houdini-drafts/issues/978<br>
&lt;fantasai> TabAtkins: gsnedders brought up really good point that historically we don't run JS for print<br>
&lt;fantasai> TabAtkins: but how should that interact with layout API and paint API?<br>
&lt;AmeliaBR> q+<br>
&lt;fantasai> TabAtkins: print style can change sizes of things<br>
&lt;fantasai> TabAtkins: have to run custom paint and custom layout<br>
&lt;astearns> ack florian<br>
&lt;fantasai> TabAtkins: are we doing something with that?<br>
&lt;florian> q-<br>
&lt;fantasai> TabAtkins: if we're not, do we plan to?<br>
&lt;fantasai> TabAtkins: we should document this either way, to make sure it's clear how printing and houdini APIs work together<br>
&lt;fantasai> Rossen___: When are we evaluating print?<br>
&lt;fantasai> TabAtkins: when you print a web page<br>
&lt;fantasai> TabAtkins: switch over to print styles and fragment for printing<br>
&lt;sushanth> +q<br>
&lt;fantasai> TabAtkins: but aren't running JS<br>
&lt;fantasai> iank_: These particular things, we should be running any layout API JS<br>
&lt;Rossen___> ack AmeliaBR<br>
&lt;fantasai> AmeliaBR: Definitely as part of a style recalc<br>
&lt;fantasai> AmeliaBR: Dunno if works correctly, but that should be the expectation<br>
&lt;fantasai> sushanth: for printing, I work on canvas so I know how it works for Chavas<br>
&lt;fantasai> sushanth: There's a "about to print" event, and you do stuff, and that gets replayed<br>
&lt;Rossen___> ack sushanth<br>
&lt;fantasai> sushanth: when you print, those recordings are played back<br>
&lt;AmeliaBR> s/"about to print"/onBeforePrint/<br>
&lt;emilio> q+<br>
&lt;fantasai> Rossen___: So takeaway is yes, should be running all of the JS hooks and execute scripts that will do custom paint / layout etc. in all of these cases<br>
&lt;fantasai> emilio: One question, for print approach, what happens when user changes stuff?<br>
&lt;fantasai> emilio: does print run multiple times?<br>
&lt;fantasai> emilio: in Gecko that's not the case<br>
&lt;fantasai> emilio: You issue print command, right?<br>
&lt;fantasai> emilio: there's a print preview that let's you adjust page size / margins / etc.<br>
&lt;fantasai> emilio: we don't dispatch JS events every time that happens<br>
&lt;fantasai> emilio: in Gecko, we do a complete separate document just for printing<br>
&lt;fantasai> emilio: we fire  beforeprint event before doing this<br>
&lt;fantasai> emilio: when you change layout, we don't do it over again<br>
&lt;fantasai> AmeliaBR: It would be after regular JS event<br>
&lt;Rossen___> q?<br>
&lt;Rossen___> ack emilio<br>
&lt;fantasai> AmeliaBR: Houdini isn't part of event loop, it's triggered by style recalc directly<br>
&lt;gsnedders> q+<br>
&lt;fantasai> gsnedders: Want to point of last bit of my issue, which was about how we plan on testing the layout API<br>
&lt;fantasai> gsnedders: whether we expect there to be different testing for paged media vs scrolling media<br>
&lt;fantasai> iank_: There's currently work that is at least planned but maybe not in progress to support better printing in WPT?<br>
&lt;fantasai> gsnedders: We have paged reftests, but only currently implemented in Gecko<br>
&lt;fantasai> iank_: so on Chromium project to add support reftests of that form<br>
&lt;Rossen___> ack gsnedders<br>
&lt;fantasai> iank_: Testing strategy should be no different from other printing tests<br>
&lt;fantasai> gsnedders: ...<br>
&lt;fantasai> gsnedders: JS tests for worklets specifically, do we want them to differ from paged media?<br>
&lt;fantasai> iank_: Changing behavior between paged vs non-paged?<br>
&lt;fantasai> iank_: Definitely will be a difference<br>
&lt;fantasai> iank_: sizes change<br>
&lt;fantasai> iank_: definitley change in layout maybe paint<br>
&lt;fantasai> iank_: One that's missing is fragmentation support<br>
&lt;fantasai> iank_: that's one thing that will definitely be triggered by paged media context<br>
&lt;fantasai> emilio: We ported a lot of the Gecko paged reftests to be in WPT<br>
&lt;fantasai> iank_: We're undergoing adding more and more capabilities to our new fragmentation engine<br>
&lt;fantasai> iank_: adding a lot of those tests as ? tests<br>
&lt;fantasai> iank_: first half of next year will be focusing solely on printing, effectively<br>
&lt;fantasai> iank_: will add a lot more reftests<br>
&lt;AmeliaBR> s/?/ref/<br>
&lt;fantasai> iank_: will work on supporting print reftests in chromium at the same time<br>
&lt;fantasai> gsnedders: I think that answers my questions<br>
&lt;fantasai> Rossen___: smfr pointed out that we should probably specify when Houdini JS is specified in all of these cases for printing<br>
&lt;fantasai> AmeliaBR: Are worklets allowed to do anything asyc?<br>
&lt;fantasai> TabAtkins: nope. Very intentionally<br>
&lt;TabAtkins> ScribeNick: TabAtkins<br>
&lt;TabAtkins> fantasai: Layout API hasnt' been published since 2018, and I'm guessing edits ahve happened since then<br>
&lt;fantasai> fantasai: Just want to point out that Layout API haven't been published since 2018<br>
&lt;TabAtkins> Rossen___: Yes Ian and I botha ttempted to publish this and both failed<br>
&lt;TabAtkins> fantasai: If you have mechanics issues, can youg et a staff contact to help?<br>
&lt;TabAtkins> Rossen___: Yes.<br>
&lt;fantasai> fantasai: If you're getting stuck, ask the staff contacts for help<br>
&lt;fantasai> scribeNick: TabAtkins<br>
&lt;fantasai> TabAtkins: let's record a resolution<br>
&lt;fantasai> TabAtkins: Any houdini JS that needs to rerun for style / layout recalc needs to run<br>
&lt;fantasai> RESOLVED: Any Houdini JS that needs to run for style / layout calc needs to run for print<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/978#issuecomment-667197344 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 31 July 2020 15:58:50 UTC