-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
TINY-10892: Fix deleting from P with IMG into LI would create unwanted font-styles on Chrome #9638
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8bceb0e
TINY-10892: Fix deleting from P with IMG into LI would create unwante…
hamza0867 694dbde
TINY-10892: Add changelog entry
hamza0867 0662989
TINY-10892: Remove forgotten debugger statement
hamza0867 3204c4f
Update .changes/unreleased/tinymce-TINY-10892-2024-05-12.yaml
hamza0867 6f39635
TINY-10892: Remove skipping tests on browsers other than Chrome
hamza0867 541948a
TINY-10892: Revert unnecessary formats
hamza0867 52c0271
TINY-10892: Revert unnecessary formats
hamza0867 3ee744a
Update .changes/unreleased/tinymce-TINY-10892-2024-05-12.yaml
hamza0867 28ebfec
TINY-10892: Make changes as per review
hamza0867 1e8c02b
Merge branch 'feature/TINY-10892' of github.com:tinymce/tinymce into …
hamza0867 cd17dc0
TINY-10892: Revert long fix, use simpler fix
hamza0867 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
project: tinymce | ||
kind: Fixed | ||
body: Deleting into a list from a paragraph that has an `img` tag could cause extra inline styles to be added. | ||
time: 2024-05-12T23:00:56.388965+01:00 | ||
custom: | ||
Issue: TINY-10892 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
141 changes: 141 additions & 0 deletions
141
modules/tinymce/src/core/test/ts/webdriver/delete/QuirksChromeTest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
import { RealKeys } from '@ephox/agar'; | ||
import { describe, it } from '@ephox/bedrock-client'; | ||
import { TinyAssertions, TinyHooks } from '@ephox/wrap-mcagar'; | ||
|
||
import Editor from 'tinymce/core/api/Editor'; | ||
|
||
describe('webdriver.tinymce.core.delete.QuirksChromeTest', () => { | ||
|
||
const hook = TinyHooks.bddSetupLight<Editor>({ | ||
base_url: '/project/tinymce/js/tinymce' | ||
}, [], true); | ||
|
||
it('TINY-10892: Backspace from beginning of P that contains IMG into OL when the LI does NOT end with an inline element', async () => { | ||
const editor = hook.editor(); | ||
editor.setContent( | ||
`<ol> | ||
<li>sdadsa</li> | ||
</ol> | ||
<p><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada </p>`); | ||
editor.selection.setCursorLocation(editor.getDoc().querySelector('em') as HTMLElement, 0); | ||
await RealKeys.pSendKeysOn('iframe => body => em', [ RealKeys.backspace() ]); | ||
TinyAssertions.assertContent(editor, | ||
`<ol> | ||
<li>sdadsa<em>sdada</em><img src="#" alt="" width="24" height="24"> dsada</li> | ||
</ol>` | ||
); | ||
}); | ||
|
||
it('TINY-10892: Backspace from beginning of P that contains IMG into OL when the LI DOES end with an inline element', async () => { | ||
const editor = hook.editor(); | ||
editor.setContent( | ||
`<ol> | ||
<li>sdadsa <strong>a</strong></li> | ||
</ol> | ||
<p><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada </p>`); | ||
editor.selection.setCursorLocation(editor.getDoc().querySelector('em') as HTMLElement, 0); | ||
await RealKeys.pSendKeysOn('iframe => body => em', [ RealKeys.backspace() ]); | ||
TinyAssertions.assertContent(editor, | ||
`<ol> | ||
<li>sdadsa <strong>a</strong><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada</li> | ||
</ol>` | ||
); | ||
}); | ||
|
||
it('TINY-10892: Delete from end of OL when the LI does NOT end with an inline element and has nextSibling P that contains IMG', async () => { | ||
const editor = hook.editor(); | ||
editor.setContent( | ||
`<ol> | ||
<li>a</li> | ||
</ol> | ||
<p><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada </p>`); | ||
editor.selection.setCursorLocation(editor.getDoc().querySelector('li') as HTMLElement, 1); | ||
await RealKeys.pSendKeysOn('iframe => body => li', [ RealKeys.text('\uE017') /* unicode for Delete key */]); | ||
TinyAssertions.assertContent(editor, | ||
`<ol> | ||
<li>a<em>sdada</em><img src="#" alt="" width="24" height="24"> dsada</li> | ||
</ol>` | ||
); | ||
}); | ||
|
||
it('TINY-10892: Delete from end of OL when the LI DOES end with an inline element and has nextSibling P that contains IMG', async () => { | ||
const editor = hook.editor(); | ||
editor.setContent( | ||
`<ol> | ||
<li>a <strong>a</strong></li> | ||
</ol> | ||
<p><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada </p>`); | ||
editor.selection.setCursorLocation(editor.getDoc().querySelector('strong') as HTMLElement, 1); | ||
await RealKeys.pSendKeysOn('iframe => body => strong', [ RealKeys.text('\uE017') /* unicode for Delete key */]); | ||
TinyAssertions.assertContent(editor, | ||
`<ol> | ||
<li>a <strong>a</strong><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada</li> | ||
</ol>` | ||
); | ||
}); | ||
|
||
it('TINY-10892: Backspace from beginning of P that contains IMG into UL when the LI does NOT end with an inline element', async () => { | ||
const editor = hook.editor(); | ||
editor.setContent( | ||
`<ul> | ||
<li>sdadsa</li> | ||
</ul> | ||
<p><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada </p>`); | ||
editor.selection.setCursorLocation(editor.getDoc().querySelector('em') as HTMLElement, 0); | ||
await RealKeys.pSendKeysOn('iframe => body => em', [ RealKeys.backspace() ]); | ||
TinyAssertions.assertContent(editor, | ||
`<ul> | ||
<li>sdadsa<em>sdada</em><img src="#" alt="" width="24" height="24"> dsada</li> | ||
</ul>` | ||
); | ||
}); | ||
|
||
it('TINY-10892: Backspace from beginning of P that contains IMG into UL when the LI DOES end with an inline element', async () => { | ||
const editor = hook.editor(); | ||
editor.setContent( | ||
`<ul> | ||
<li>sdadsa <strong>a</strong></li> | ||
</ul> | ||
<p><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada </p>`); | ||
editor.selection.setCursorLocation(editor.getDoc().querySelector('em') as HTMLElement, 0); | ||
await RealKeys.pSendKeysOn('iframe => body => em', [ RealKeys.backspace() ]); | ||
TinyAssertions.assertContent(editor, | ||
`<ul> | ||
<li>sdadsa <strong>a</strong><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada</li> | ||
</ul>` | ||
); | ||
}); | ||
|
||
it('TINY-10892: Delete from end of UL when the LI does NOT end with an inline element and has nextSibling P that contains IMG', async () => { | ||
const editor = hook.editor(); | ||
editor.setContent( | ||
`<ul> | ||
<li>a</li> | ||
</ul> | ||
<p><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada </p>`); | ||
editor.selection.setCursorLocation(editor.getDoc().querySelector('li') as HTMLElement, 1); | ||
await RealKeys.pSendKeysOn('iframe => body => li', [ RealKeys.text('\uE017') /* unicode for Delete key */]); | ||
TinyAssertions.assertContent(editor, | ||
`<ul> | ||
<li>a<em>sdada</em><img src="#" alt="" width="24" height="24"> dsada</li> | ||
</ul>` | ||
); | ||
}); | ||
|
||
it('TINY-10892: Delete from end of UL when the LI DOES end with an inline element and has nextSibling P that contains IMG', async () => { | ||
const editor = hook.editor(); | ||
editor.setContent( | ||
`<ul> | ||
<li>a <strong>a</strong></li> | ||
</ul> | ||
<p><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada </p>`); | ||
editor.selection.setCursorLocation(editor.getDoc().querySelector('strong') as HTMLElement, 1); | ||
await RealKeys.pSendKeysOn('iframe => body => strong', [ RealKeys.text('\uE017') /* unicode for Delete key */]); | ||
TinyAssertions.assertContent(editor, | ||
`<ul> | ||
<li>a <strong>a</strong><em>sdada</em><img src="#" alt="" width="24" height="24"> dsada</li> | ||
</ul>` | ||
); | ||
}); | ||
|
||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's no longer really a chrome test, nor it is a quirks test 🤔
I'm happy to keep the test, just rename it (and remember the describe call includes the name).