<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>194335</bug_id>
          
          <creation_ts>2019-02-06 01:58:49 -0800</creation_ts>
          <short_desc>Extension style sheet mutation in middle of style resolution because animation code triggers a resource load</short_desc>
          <delta_ts>2026-01-12 09:04:12 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=194333</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Antti Koivisto">koivisto</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>graouts</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1502731</commentid>
    <comment_count>0</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2019-02-06 01:58:49 -0800</bug_when>
    <thetext>This stack shows we are triggering a resource load from ImplicitAnimation::reset and then mutating an extension stylesheet via ExtensionStyleSheets::addDisplayNoneSelector.

0   WebCore                       	0x00000001a0245d08 WTFCrashWithInfo(int, char const*, char const*, int) + 20
1   WebCore                       	0x00000001a0ef3178 WebCore::StyleResolver::~StyleResolver() + 796 (Assertions.h:578)
2   WebCore                       	0x00000001a1904074 WebCore::Style::Scope::scheduleUpdate(WebCore::Style::Scope::UpdateType) + 168 (memory:2321)
3   WebCore                       	0x00000001a10107a4 WebCore::ExtensionStyleSheets::addDisplayNoneSelector(WTF::String const&amp;, WTF::String const&amp;, unsigned int) + 348 (ExtensionStyleSheets.cpp:172)
4   WebCore                       	0x00000001a0e11f20 WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad(WTF::URL const&amp;, WebCore::ResourceType, WebCore::DocumentLoader&amp;) + 872 (ContentExtensionsBackend.cpp:190)
5   WebCore                       	0x00000001a14176e4 WebCore::CachedResourceLoader::requestResource(WebCore::CachedResource::Type, WebCore::CachedResourceRequest&amp;&amp;, WebCore::CachedResourceLoader::ForPreload, WebCore::CachedResourceLoader::DeferOption) + 880 (CachedResourceLoader.cpp:814)
6   WebCore                       	0x00000001a1416f68 WebCore::CachedResourceLoader::requestImage(WebCore::CachedResourceRequest&amp;&amp;) + 268 (CachedResourceLoader.cpp:213)
7   WebCore                       	0x00000001a0e98d10 WebCore::CSSImageValue::loadImage(WebCore::CachedResourceLoader&amp;, WebCore::ResourceLoaderOptions const&amp;) + 492 (CSSImageValue.cpp:78)
8   WebCore                       	0x00000001a18a8884 WebCore::StyleCachedImage::load(WebCore::CachedResourceLoader&amp;, WebCore::ResourceLoaderOptions const&amp;) + 80 (StyleCachedImage.cpp:91)
9   WebCore                       	0x00000001a18ffc74 WebCore::Style::loadPendingImage(WebCore::Document&amp;, WebCore::StyleImage const*, WebCore::Element const*, WebCore::Style::LoadPolicy) + 460 (StylePendingResources.cpp:62)
10  WebCore                       	0x00000001a18ff930 WebCore::Style::loadPendingResources(WebCore::RenderStyle&amp;, WebCore::Document&amp;, WebCore::Element const*) + 64 (StylePendingResources.cpp:68)
11  WebCore                       	0x00000001a14e9484 WebCore::ImplicitAnimation::reset(WebCore::RenderStyle const&amp;, WebCore::CompositeAnimation&amp;) + 112 (ImplicitAnimation.cpp:206)
12  WebCore                       	0x00000001a14e9350 WebCore::ImplicitAnimation::animate(WebCore::CompositeAnimation&amp;, WebCore::RenderStyle const&amp;, std::__1::unique_ptr&lt;WebCore::RenderStyle, std::__1::default_delete&lt;WebCore::RenderStyle&gt; &gt;&amp;, bool&amp;) + 88 (ImplicitAnimation.cpp:75)
13  WebCore                       	0x00000001a14d3724 WebCore::CompositeAnimation::animate(WebCore::Element&amp;, WebCore::RenderStyle const*, WebCore::RenderStyle const&amp;) + 252 (CompositeAnimation.cpp:300)
14  WebCore                       	0x00000001a14d359c WebCore::CSSAnimationController::updateAnimations(WebCore::Element&amp;, WebCore::RenderStyle const&amp;, WebCore::RenderStyle const*) + 220 (CSSAnimationController.cpp:633)
15  WebCore                       	0x00000001a1906aac WebCore::Style::TreeResolver::createAnimatedElementUpdate(std::__1::unique_ptr&lt;WebCore::RenderStyle, std::__1::default_delete&lt;WebCore::RenderStyle&gt; &gt;, WebCore::Element&amp;, WebCore::Style::Change) + 416 (StyleTreeResolver.cpp:312)
16  WebCore                       	0x00000001a19065dc WebCore::Style::TreeResolver::resolveElement(WebCore::Element&amp;) + 344 (StyleTreeResolver.cpp:208)
17  WebCore                       	0x00000001a19073dc WebCore::Style::TreeResolver::resolveComposedTree() + 1204 (StyleTreeResolver.cpp:493)
18  WebCore                       	0x00000001a19080cc WebCore::Style::TreeResolver::resolve() + 720 (StyleTreeResolver.cpp:551)
19  WebCore                       	0x00000001a0fbcee8 WebCore::Document::resolveStyle(WebCore::Document::ResolveStyleType) + 920 (Document.cpp:1935)
20  WebCore                       	0x00000001a0fbd924 WebCore::Document::updateStyleIfNeeded() + 436 (Document.cpp:2064)
21  WebCore                       	0x00000001a0279e2c WebCore::Timer::fired() + 32 (Function.h:56)
22  WebCore                       	0x00000001a15388c8 WebCore::ThreadTimers::sharedTimerFiredInternal() + 196 (ThreadTimers.cpp:129)
23  WebCore                       	0x00000001a1522308 WebCore::MainThreadSharedTimer::fired() + 32 (Function.h:56)
24  WebCore                       	0x00000001a1557ba8 WebCore::timerFired(__CFRunLoopTimer*, void*) + 32 (MainThreadSharedTimerCF.cpp:74)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1502732</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-02-06 01:59:47 -0800</bug_when>
    <thetext>&lt;rdar://problem/47844927&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1502737</commentid>
    <comment_count>2</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2019-02-06 02:34:32 -0800</bug_when>
    <thetext>Besides ImplicitAnimation::reset(), there is another similar stack via KeyframeAnimation::KeyframeAnimation()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1502739</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-02-06 02:40:31 -0800</bug_when>
    <thetext>&lt;rdar://problem/47845431&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1502753</commentid>
    <comment_count>4</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2019-02-06 05:19:54 -0800</bug_when>
    <thetext>Note that this bug only exists in the legacy animation code. The new web animation engine does not have this problem so this is fixed when it is enabled.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>