Closed (fixed)
Project:
Drupal core
Version:
9.3.x-dev
Component:
ckeditor5.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
3 May 2022 at 13:12 UTC
Updated:
30 May 2022 at 13:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
wim leersFor test coverage: I could add a test to
HTMLRestrictionsTestlike:… but that would be silly because we already have the massive
\Drupal\Tests\ckeditor5\Unit\HTMLRestrictionsTest::testOperations()with an enormous data provider.Turns out there's a wrong expectation in the expectations, and that's how we missed this bug! Fixed test expectation in ed4a73cd3fea1b2b0598803d0be4ae895239b22a.
Comment #4
wim leersNow ready for review!
Comment #5
wim leersUh oh — I fixed
\Drupal\Tests\ckeditor5\Unit\HTMLRestrictionsTest::testOperations()but broke two other tests 😅Comment #6
wim leersNow the only remaining failure is this:
Mysterious, right? 🤓🙈
Let's unravel it. 🕵️
diff()now correctly handles an extra case. In the failing test, the desire is to support<foo bar>(meaning ANY value on thebarattribute on thefootag), buttest_attr_valuesonly supports<foo bar="a b">. In other words: there is no surplus at all here. With the fix in this issue, that changes the score to0instead of1002. The score used to be 1002 (meaning "two surplus attribute values" and "one surplus attribute") because<foo bar="a b"> DIFF <foo bar> === <foo bar="a b">in HEAD, but we're fixing that to be<foo bar="a b"> DIFF <foo bar> = ∅, which completely explains that difference in score.In other words: this is another example of something that was wrong in the test expectations!
Fixed in 3af97b37934a63f4f29bf0fd8acd4bb2c115995e.
Comment #7
wim leers6aa08d5fc as patch, to test against all
34 branches.Comment #8
bnjmnmThis is basically RTBC but a committer would need to make a small change on commit. If the committer reading this would prefer to not take on that responsibility, feel free to switch back to NW.
The small change that is needed:
Suffix would be `*-bar` 🤓
Comment #9
wim leers#8 OMG 🤣 🙈
Fixed! 😁 (This is a pre-existing bug, but totally reasonable to fix here IMHO. Which is why the patch size grew a bit: there were three places within the same file which contained this comment bug.)
Comment #11
wim leersRandom unrelated Layout Builder test fail. Re-testing.
Comment #14
lauriiiCommitted ce0ec61 and pushed to 10.0.x. Cherry-picked to 9.5.x and 9.4.x. Thanks!
Leaving open for backport to 9.3.x once freeze is over.
Comment #16
larowlanUpdating status
Comment #17
wim leersNot yet backported 😅
Comment #18
alexpottBackported to 9.3.x as this is experimental there and there is no harm