Skip to content
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

[clipboard-apis] .write() for text/html doesn't define a canonical form #233

Open
karlcow opened this issue Feb 21, 2025 · 1 comment
Open

Comments

@karlcow
Copy link
Member

karlcow commented Feb 21, 2025

With an input

<!doctype html> <html> <head> <title>Title of the
                    document</title> </head> <body> <p>Hello World</p>
                    </body> </html>

All browsers return something different for navigator.clipboard.write([clipboardItem]);.

  • FAIL Safari returns <head> </head> <body> <p style=\"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;\">Hello World</p> </body>
  • PASS Firefox returns <head> <title>Title of the document</title> </head> <body> <p>Hello World</p> </body>
  • FAIL Chrome returns <head> <title>Title of the\n document</title> </head> <body> <p>Hello World</p> </body>

The spec currently is not mandating what should the be the serialization, which in returns makes it difficult to test:
web-platform-tests/wpt#50744
web-platform-tests/wpt@1023ea6

Even if a strict canonical form was not required.
It would be good to define what .write() means in the context of read/write operations. It is the exact copy of the data in read. is it the information visible to users (with another ambiguity about styling such as display: none element etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant