Bug 230119 - FontFaceSet's iterators skip items when previous items are removed
Summary: FontFaceSet's iterators skip items when previous items are removed
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-09 12:49 PDT by Myles C. Maxfield
Modified: 2022-09-12 15:09 PDT (History)
5 users (show)

See Also:


Attachments
Test (529 bytes, text/html)
2021-09-09 12:51 PDT, Myles C. Maxfield
no flags Details
Highlight API test (708 bytes, text/html)
2021-09-09 12:52 PDT, Myles C. Maxfield
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2021-09-09 12:49:45 PDT
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15

Steps to reproduce:

Iterate across a FontFaceSet. When the iterator is halfway through, delete an element from the first half. Then continue iterating.

FontFaceSet is Setlike, and JS's set delete functionality is specified as:

> Replace the element of entries whose value is e with an element whose value is empty.

The purpose of this is to make iterators not skip over items when items are deleted during iteration.
Comment 1 Myles C. Maxfield 2021-09-09 12:50:13 PDT
I opened the same bug on Gecko here: https://bugzilla.mozilla.org/show_bug.cgi?id=1729997
Comment 2 Myles C. Maxfield 2021-09-09 12:50:43 PDT
WebKit doesn't actually use setlike<FontFace> inside the IDL for FontFaceSet. Migrating to that might fix this.
Comment 3 Myles C. Maxfield 2021-09-09 12:51:37 PDT
Created attachment 437769 [details]
Test
Comment 4 Myles C. Maxfield 2021-09-09 12:52:28 PDT
Created attachment 437770 [details]
Highlight API test

I also tested the Highlight API (which also uses setlike) and it behaves correctly here.
Comment 5 Radar WebKit Bug Importer 2021-09-09 12:53:15 PDT
<rdar://problem/82939287>
Comment 6 Ahmad Saleem 2022-09-12 15:09:10 PDT
*** Safari 16 / STP 153 on macOS 12.6 ***

A , A , C - Using "Test"

*** Firefox Nightly 106 ***

A , A , C - Using "Test"


*** Chrome Canary 107 ***

A , A , B - Using "Test"

_____________

*** Safari 16 / STP 153 on macOS 12.6 ***

Just 'Hello' in body but no dialog box - Using "API" test

*** Firefox Nightly 106 ***

Just 'Hello' in body but no dialog box - Using "API" test


*** Chrome Canary 107 ***

Just 'Hello' in body but 1 , 1 , 2 dialog alerts - Using "API" test

____

Just wanted to share updated testing results. Thanks!