I can't tell if the behavior is correct or not but I am posting the bug non-the-less.
Created attachment 8755 [details] test case in Strict mode
Created attachment 8756 [details] test case in Quirks mode
I'm not sure if this is a bug either, but WebKit r15138 differs in behaviour from WebKit 418.8, Firefox 1.5.0.4 and Camino 1.0. The latter three render the box on the right side in both examples, while WebKit from ToT renders the strict mode box to the left side.
In my opinion it's a bug. Checked also in Gecko and Opera. Both browsers display the blue box on the right in strict mode.
I am unable to reproduce this bug in Safari 15.6 on macOS 12.5 based on attached test cases (both) and get expected result of "blue" square / box being shown on right-side. It matches with other browsers (Chrome Canary 105 and Firefox Nightly 104) as well. I think it was fixed along the way and this can be marked as "RESOLVED CONFIGURATION CHANGED". Thanks!