Bug 243915 - `background-repeat` is incorrectly exposed through inline style
Summary: `background-repeat` is incorrectly exposed through inline style
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
: 252403 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-08-12 20:17 PDT by Simon Fraser (smfr)
Modified: 2023-12-17 04:09 PST (History)
4 users (show)

See Also:


Attachments
Testcase (485 bytes, text/html)
2022-08-12 20:21 PDT, Simon Fraser (smfr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2022-08-12 20:17:04 PDT
This testcase fails in WebKit:

    <div id="target" style="background-repeat: no-repeat;"></div>
    <script>
        let target = document.getElementById('target');
        target.textContent = target.style.length + ' rules';
    </script>

reporting `0 rules`. Other browsers correctly find one rule.

This causes failures on https://css3test.com which uses this technique to detect support for style properties.

The bug relates to how webkit expands `background-repeat` to `background-repeat-x` and `background-repeat-y`.
Comment 1 Simon Fraser (smfr) 2022-08-12 20:21:13 PDT
Created attachment 461569 [details]
Testcase
Comment 2 Simon Fraser (smfr) 2022-08-12 20:26:18 PDT
`PropertySetCSSStyleDeclaration::length()` is really API, so to fix this we'd either have to recompute the length by collapsing longhands, or not expand `background-repeat` to `background-repeat-x` and `background-repeat-y`.
Comment 3 Simon Fraser (smfr) 2022-08-12 20:42:25 PDT
Maybe we could stop pretending that `background-repeat` is a shorthand.
Comment 4 Simon Fraser (smfr) 2022-08-13 17:21:48 PDT
Pull request: https://github.com/WebKit/WebKit/pull/3292
Comment 5 EWS 2022-08-15 15:04:09 PDT
Committed 253440@main (165b098dbd0b): <https://commits.webkit.org/253440@main>

Reviewed commits have been landed. Closing PR #3292 and removing active labels.
Comment 6 Radar WebKit Bug Importer 2022-08-15 15:05:24 PDT
<rdar://problem/98690270>
Comment 7 Anne van Kesteren 2023-12-17 04:09:41 PST
*** Bug 252403 has been marked as a duplicate of this bug. ***