Bug 197769 - "Disable cache" causes difference in resource loading behavior for CSS style vs CSS custom property
Summary: "Disable cache" causes difference in resource loading behavior for CSS style ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 12
Hardware: Mac macOS 10.12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-05-10 01:48 PDT by Terry
Modified: 2019-05-12 14:59 PDT (History)
6 users (show)

See Also:


Attachments
Bug showing that when ignoring cache, CSS custom property causes resource to be re-requested (475.12 KB, video/mp4)
2019-05-10 01:48 PDT, Terry
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Terry 2019-05-10 01:48:30 PDT
Created attachment 369549 [details]
Bug showing that when ignoring cache, CSS custom property causes resource to be re-requested

Steps to reproduce the bug:

1. Open devtools and disable cache (aka ignore cache) in Network tab
2. Set up the element so that it uses a CSS custom property to be its "background-image" property
3. Update the CSS custom property with the same value. Note that the image will be re-requested

The browser should not re-request a loaded resource when a CSS custom property is updated but whose value did not change. This behavior is not observed if the value is set using CSS property directly.

This bug cannot be reproduced if the background image is set using the "backgroundImage" property in the style object. It appears to be a bug in the implementation of CSS custom properties.

Interestingly, this bug cannot be reproduced on iOS Safari (at least from my testing on BrowserStack). This bug can also be reproduced in Google Chrome, but not on Mozilla Firefox.
Comment 1 Radar WebKit Bug Importer 2019-05-12 14:59:06 PDT
<rdar://problem/50708338>