Skip to content

Add tests for contenteditable=plaintext-only - #36664

Open
howard-e wants to merge 9 commits into
masterfrom
bocoup/contenteditablePlainTextOnly
Open

howard-e wants to merge 9 commits into
masterfrom
bocoup/contenteditablePlainTextOnly

Conversation

@howard-e

@howard-e howard-e commented Oct 26, 2022 •

Copy link
Copy Markdown
Contributor

Comment thread html/editing/editing-0/contenteditable/contentEditable-shortcuts-manual.html Outdated
Comment thread html/editing/editing-0/contenteditable/contentEditable-shortcuts-manual.html Outdated
Comment thread html/editing/editing-0/contenteditable/contentEditable-queryCommandEnabled.html Outdated
<!DOCTYPE html>
<html>
<head>
<title>Editing: manual test for keyboard shortcuts with contenteditable=plaintext-only</title>

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.

This comment says "manual test" but the file name doesn't have "-manual" suffix, and this looks like an automated test. Can you verify which this is?

.keyUp(kControl)
.send();

assert_equals(document.queryCommandState('bold'), false);

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.

Comments appreciated. Is the intention the queryCommandState('bold') should be false because the text is already bold by the shortcut?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's because for plaintext-only, bold shouldn't work. I'll clarify this in the test name.

.keyUp(kMeta)
.send();

assert_equals(document.queryCommandState('bold'), false);

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.

Comments appreciated. I'm not sure what this is trying to test, Alt+B doesn't do anything, right? Or should it behave as Ctrl+B on some platforms?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should be Cmd on macOS. Added a code comment.

@zcorpan

zcorpan commented Mar 8, 2023

Copy link
Copy Markdown
Member

I guess the issue is that the keyboard shortcut for "bold" is different on different OSes (Command+B on macOS, Ctrl+B on Windows). How should this be tested? Separate subtests or try both in the same subtest?

@zcorpan

zcorpan commented Mar 10, 2023

Copy link
Copy Markdown
Member

Separate subtests or try both in the same subtest?

I've done the latter.

@zcorpan
zcorpan requested a review from kojiishi March 10, 2023 09:26
@zcorpan

zcorpan commented Jun 7, 2023

Copy link
Copy Markdown
Member

@kojiishi ping

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants