[Webkit-unassigned] [Bug 254844] Intermittent removal of adoptedStyleSheet CSSStyleSheet instances when assigning adoptedStyleSheet array

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jul 29 04:11:16 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=254844

Nayden Naydenov <nnaydenow.work at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nnaydenow.work at gmail.com

--- Comment #17 from Nayden Naydenov <nnaydenow.work at gmail.com> ---
(In reply to Chris Dumez from comment #16)
> I also tried modifying setAdoptedStyleSheetsOnTreeScope() to modify the
> existing JSObservableArray (deleting all properties in it then setting the
> new ones one by one) but it didn't help either:
> ```
> void setAdoptedStyleSheetsOnTreeScope(TreeScope& treeScope,
> JSC::JSObservableArray* existingArray, JSC::JSGlobalObject&
> lexicalGlobalObject, JSC::JSValue value)
> {
>     auto& vm = JSC::getVM(&lexicalGlobalObject);
>     auto throwScope = DECLARE_THROW_SCOPE(vm);
>     if (existingArray) {
>         auto* jsObject = jsDynamicCast<JSObject*>(value);
>         if (!jsObject)
>             return;
> 
>         while (existingArray->length()) {
>            
> jsCast<JSObject*>(existingArray)-
> >deleteProperty((JSGlobalObject*)&lexicalGlobalObject, (uint64_t)0);
>             RETURN_IF_EXCEPTION(throwScope, void());
>         }
> 
>         unsigned index = 0;
>         forEachInIterable(&lexicalGlobalObject, jsObject, [existingArray,
> &index](JSC::VM&, JSC::JSGlobalObject* lexicalGlobalObject, JSC::JSValue
> nextValue) {
>             if (existingArray->putByIndexInline(lexicalGlobalObject, index,
> nextValue, false))
>                 ++index;
>         });
>     } else {
>         auto nativeValue =
> convert<IDLFrozenArray<IDLInterface<CSSStyleSheet>>>(lexicalGlobalObject,
> value);
>         RETURN_IF_EXCEPTION(throwScope, void());
>         invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject,
> throwScope, [&] {
>             return treeScope.setAdoptedStyleSheets(WTFMove(nativeValue));
>         });
>     }
> }
> ```
> 
> At this point, I think I'll need help with someone with more JSC knowledge.

Do you have any updates? Our customers started to update their macOS devices and they are facing the issue more and more often? We are making an UI library similar to @microsoft/fast and many applications are with broken styles.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230729/cbd5e20e/attachment-0001.htm>


More information about the webkit-unassigned mailing list