#106469TYPO3 RelativeCssPathFixer should ignore pure id-urls
Description
Currently, the RelativeCssPathFixer tries to fix all url(...) in CSS to a relative path.
This however does cause the issue, when using clip-path with a url pointing to an ID that is on the same page (e.g. svg clipPath element).
Example CSS:
.cropped-element {
width: 100px;
height: 100px;
background: red;
clip-path: url(#example-clip-path);
}
Example HTML:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1">
<clipPath id="example-clip-path" clipPathUnits="objectBoundingBox">
<path d="M 0.5,0 L 0.6545,0.3455 L 1,0.3819 L 0.7265,0.6180 L 0.8090,0.9511 L 0.5,0.8 L 0.1910,0.9511 L 0.2735,0.6180 L 0,0.3819 L 0.3455,0.3455 Z"></path>
</clipPath>
</svg>
<div class="cropped-element"></div>
Expected output: The RelativeCsPathFixer leaves the purely id-based url in CSS untouched, as it’s not actually pointing to any file.
Actual Result: the url gets converted to a relative path, breaking the styling:
@clip-path: url(‘../../../_assets/c1dda3cd8b878b3d2d1341386e1ea699/Css/#example-clip-path’)@
I would argue that it should be safe to ignore all URLs starting with a hash (containing no path or other parts of a valid URL), as it doesn’t actually represent any file on the webserver (unless I’m overlooking something?).
It probably also affects older TYPO3 Versions, but I’ve only discovered it in TYPO3 13 now, due to rarely needing the clip-path feature.
I can of course easily avoid the issue by just not concatenating/compressing CSS files, but I’d like if this could be fixed.
Greetings
LPS
Reviews 3
History 37
-
Lars Peter Søndergaard commented <span data-processor="relativetime" data-value="2025-04-01T08:45:27+00:00" > 04/01/25, 08:45 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 88875 status
NewUnder Review <span data-processor="relativetime" data-value="2025-04-01T09:49:42+00:00" > 04/01/25, 09:49 </span> -
Gerrit Code Review pushed patch set 2 for main to change 88875 <span data-processor="relativetime" data-value="2025-04-01T10:05:06+00:00" > 04/01/25, 10:05 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 88896 <span data-processor="relativetime" data-value="2025-04-02T07:09:42+00:00" > 04/02/25, 07:09 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 88897 <span data-processor="relativetime" data-value="2025-04-02T07:09:48+00:00" > 04/02/25, 07:09 </span>
-
Anonymous commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-04-02T07:25:09+00:00" > 04/02/25, 07:25 </span>Applied in changeset commit:10287ded2dc0d92b09e50d78ca315ca9a9c7d5d7.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:21:59+00:00" > 12/02/25, 14:21 </span>
Forgot to mention: This happens mostly with
page.includeCSSand the like and setting the config:config { compressCss = 1 concatenateCss = 1 }f:asset.cssmay be unaffected by this issue.