w3c / clipboard-apis

Clipboard API and events
https://w3c.github.io/clipboard-apis/
Other
143 stars 41 forks source link

read(formats) ambiguous #209

Open evanstade opened 5 months ago

evanstade commented 5 months ago

WRT https://w3c.github.io/clipboard-apis/#dom-clipboard-read

  1. items is referenced after it is no longer in scope ("if items has size > 0" comes after the scope of "Let items [...]"
  2. "Set representation’s data to systemClipboardRepresentation’s data." has a type mismatch, because the former data is a Promise and the latter data is a sequence of bytes
  3. The steps in "Else" go 1, 2, 3, 1
  4. In the text "If customItem’s list of representations size is greater than 0, append item to items.", item is undefined AFAICT

I also can't figure out why there are two different places where the algorithm says "Run the read web custom format algorithm", perhaps because the above issues (and others?) are making it difficult to understand the flow.