<?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>141789</bug_id>
          
          <creation_ts>2015-02-18 19:13:26 -0800</creation_ts>
          <short_desc>Updating :checked pseudo-class with next-sibling combinator can intermittently fail to re-render background SVG images with transition</short_desc>
          <delta_ts>2026-01-12 09:02:13 -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>Safari Technology Preview</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <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>krinklemail</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dino</cc>
    
    <cc>graouts</cc>
    
    <cc>hartman.wiki</cc>
    
    <cc>koivisto</cc>
    
    <cc>rniwa</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>volker</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1070323</commentid>
    <comment_count>0</comment_count>
    <who name="">krinklemail</who>
    <bug_when>2015-02-18 19:13:26 -0800</bug_when>
    <thetext>Reduced test case: http://s.codepen.io/Krinkle/debug/JoLyzx (Source code: http://codepen.io/Krinkle/pen/JoLyzx?editors=110)

The check mark often does not appear when clicking the checkbox.

Reproduced with:
* Safari 7.1.3 (9537.85.12.18), AppleWebKit/600.3.18, OSX 10.9.5
* Safari 8.0 (10600.1.25.1), AppleWebKit/600.1.25, OSX 10.10.1
* WebKit Nightly r180270, AppleWebKit/601.1.19+, OSX 10.9.5

The node&apos;s `checked` property is toggling, and the native checkbox&apos;s appearance is updated. But surrounding elements that should match via the `:checked` selector are ignored. While trivial in this example (given the native checkbox), this technique is used by UI libraries to replace the appearance of the native checkbox (CSS-only; using opacity and z-index). There, the user would perceive the checkbox as being broken (never reaching the checked state).

We narrowed it down to:
* Selector `input[type=&quot;checkbox&quot;]:checked + span`.
* The checkbox in question has no custom styling (user agent default).
* The targeted element is a `&lt;span&gt;` with:
 * transition on background-size
 * background-color
 * one background-image using SVG

The bug is evaded by either: removing the transition, or removing the background-color, or using a PNG instead of SVG, or creating a second background alongside the SVG (e.g. a dummy transparent gradient).

-------

Downstream report:
 https://phabricator.wikimedia.org/T89309#1048894

See also:
 https://bugs.webkit.org/show_bug.cgi?id=17680</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1428056</commentid>
    <comment_count>1</comment_count>
    <who name="">krinklemail</who>
    <bug_when>2018-05-29 05:15:16 -0700</bug_when>
    <thetext>This is still reproducible in the latest Safari Technology Preview (56) and Safari 11.1.

Updated test case: https://codepen.io/Krinkle/full/XYWjRZ

Expected: Ticking a checkbox makes the tick appear. Unticking a checkbox makes the tick disappear.

Actual: The initial state seems to work, but any input from the user is either ignored or applied without the tick appearing.

This works as expected in Chrome, Firefox and Edge.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1428057</commentid>
    <comment_count>2</comment_count>
    <who name="">krinklemail</who>
    <bug_when>2018-05-29 05:18:15 -0700</bug_when>
    <thetext>Triaging as affecting all Hardware/OS (this issue is reproducible on Mobile Safari/iPhone as well).

Tentatively raising important as the impact of this is user confusion and potentially corrupted or unintentional destructive actions, due to the user unable to see whether a checkbox is ticked or unticked.

This may affect any number of UI libraries that customise the style of checkboxes on the web.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450559</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-08-15 19:18:14 -0700</bug_when>
    <thetext>Hm... the URL posted are 404 now. Could you attach a reduced test case if you still have access to it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450637</commentid>
    <comment_count>4</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2018-08-16 01:47:03 -0700</bug_when>
    <thetext>@Ryosuke Try the link in the 2018 comment, that still works for me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450838</commentid>
    <comment_count>5</comment_count>
      <attachid>347296</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-08-16 13:30:30 -0700</bug_when>
    <thetext>Created attachment 347296
Reduction</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450840</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-08-16 13:31:24 -0700</bug_when>
    <thetext>(In reply to Derk-Jan Hartman from comment #4)
&gt; @Ryosuke Try the link in the 2018 comment, that still works for me.

Thanks. I was able to make a reduction based on this.

This is a very convoluted bug. It seems to only reproduce with background SVG images and only when transition is specified. It might be some sort of an animation bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450843</commentid>
    <comment_count>7</comment_count>
      <attachid>347298</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-08-16 13:35:21 -0700</bug_when>
    <thetext>Created attachment 347298
Better reduction</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450845</commentid>
    <comment_count>8</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-08-16 13:36:25 -0700</bug_when>
    <thetext>&lt;rdar://problem/43394425&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450846</commentid>
    <comment_count>9</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-08-16 13:37:22 -0700</bug_when>
    <thetext>On STP63, you may need to reload &quot;better reduction&quot; 4-5 times before you can reproduce it once.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1450847</commentid>
    <comment_count>10</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-08-16 13:39:03 -0700</bug_when>
    <thetext>It looks like this is a painting or a layout issue because even when the green box fails to render, the computed style of the span has &quot;200% 200%&quot; as the background size.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1451105</commentid>
    <comment_count>11</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2018-08-17 07:09:13 -0700</bug_when>
    <thetext>We hit this ASSERT when the test fails:

// FIXME: This doesn&apos;t take into account the animation timeline so animations will not
// restart on page load, nor will two animations in different pages have different timelines.
Image* SVGImageCache::imageForRenderer(const RenderObject* renderer) const
{
    auto* image = findImageForRenderer(renderer);
    if (!image)
        return &amp;Image::nullImage();
    ASSERT(!image-&gt;size().isEmpty());
    return image;
}

So this does seem related to animations. I think Said should take a look and advise as I&apos;m not sure how the SVGImageCache should relate to animations.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>347296</attachid>
            <date>2018-08-16 13:30:30 -0700</date>
            <delta_ts>2018-08-16 13:35:21 -0700</delta_ts>
            <desc>Reduction</desc>
            <filename>bug141789.html</filename>
            <type>text/html</type>
            <size>781</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8Ym9keT4KPHN0eWxlPgpzcGFuIHsKICAgIGNvbG9yOiBy
ZWQ7CiAgICBib3JkZXI6IHNvbGlkIDFweCBibGFjazsKICAgIHBhZGRpbmc6IDFyZW07CiAgICBi
YWNrZ3JvdW5kLXNpemU6IDAgMDsKICAgIGJhY2tncm91bmQtaW1hZ2U6IHVybCgnaHR0cHM6Ly9z
dm4ud2Via2l0Lm9yZy9yZXBvc2l0b3J5L3dlYmtpdC90cnVuay9MYXlvdXRUZXN0cy9zdmcvYXMt
aW1hZ2UvcmVzb3VyY2VzLzEwMHB4LWdyZWVuLXJlY3Quc3ZnJyk7CiAgICBiYWNrZ3JvdW5kLXBv
c2l0aW9uOiBsZWZ0IHRvcDsKICAgIGJhY2tncm91bmQtcmVwZWF0OiBuby1yZXBlYXQ7CiAgICB0
cmFuc2l0aW9uOiBiYWNrZ3JvdW5kLXNpemUgMC4xcyBjdWJpYy1iZXppZXIoMC4xNzUsIDAuODg1
LCAwLjMyLCAxLjI3NSk7Cn0KCmlucHV0W3R5cGU9ImNoZWNrYm94Il06Y2hlY2tlZCArIHNwYW4g
ewogICAgY29sb3I6IGdyZWVuOwogICAgYmFja2dyb3VuZC1zaXplOiAyMDAlIDIwMCU7Cn0KCjwv
c3R5bGU+CjxkaXY+PGlucHV0IHR5cGU9ImNoZWNrYm94Ij48c3Bhbj5YPC9zcGFuPjwvZGl2Pgo8
c2NyaXB0Pgpjb25zdCBjaGVja2JveCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2lucHV0Jyk7
CmNoZWNrYm94LmNoZWNrZWQgPSB0cnVlOwpmb3IgKGxldCBpID0gMDsgaSA8IDEwOyBpKyspIHsK
ICAgIHNldFRpbWVvdXQoKCkgPT4gY2hlY2tib3guY2hlY2tlZCA9ICFjaGVja2JveC5jaGVja2Vk
LCBpICogMTAwKTsKfQo8L3NjcmlwdD4KPC9ib2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>347298</attachid>
            <date>2018-08-16 13:35:21 -0700</date>
            <delta_ts>2018-08-16 13:35:21 -0700</delta_ts>
            <desc>Better reduction</desc>
            <filename>bug141789.html</filename>
            <type>text/html</type>
            <size>832</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0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