Bug 196761 - Unprefixed clip-path present in computed stye (for SVG), but doesn't work on CSS boxes
Summary: Unprefixed clip-path present in computed stye (for SVG), but doesn't work on ...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 12
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 126207
  Show dependency treegraph
 
Reported: 2019-04-09 21:29 PDT by Jack Doyle
Modified: 2020-12-02 18:53 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Doyle 2019-04-09 21:29:37 PDT
The JavaScript element.style.clipPath is present (returns "" instead of undefined), indicating a prefix is NOT needed. However, if you apply a clipPath (without the -webkit- prefix), it doesn't work! Here's a reduced test case:

https://codepen.io/GreenSock/pen/4ec363d7fca960b501b390634fdf2e39?editors=0010

For a non-valid property (like element.style.bogus), undefined is returned (correct). So this clipPath behavior is very confusing (and I'd say clearly a bug). The element.style.clipPath test is passing, but functionality fails. It should either be fully functional in unprefixed form, or element.style.clipPath should return undefined.

Possibly a related thread: https://bugs.webkit.org/show_bug.cgi?id=187888
Comment 1 Radar WebKit Bug Importer 2019-04-09 23:24:46 PDT
<rdar://problem/49764514>
Comment 2 Simon Fraser (smfr) 2019-04-10 09:27:24 PDT
clip-path is present in computed style because it's present for SVG in the non-prefixed form.
Comment 3 Jack Doyle 2019-04-10 10:19:39 PDT
This seems like non-standard behavior. My demo isn't using an SVG element. Shouldn't it be returning undefined (indicating it's not supported on that element)? Of course ideally it would actually just work unprefixed.
Comment 4 Dirk Schulze 2019-10-04 10:47:21 PDT
We did not unprefix clip-path yet (though there is a patch for doing so). Sadly that means that both properties behave like 2 different properties as long as we did not unprefix (and alias the prefixed version) of Clip-path.
Comment 5 Dirk Schulze 2019-10-04 10:50:05 PDT
(In reply to Dirk Schulze from comment #4)
> We did not unprefix clip-path yet (though there is a patch for doing so).
> Sadly that means that both properties behave like 2 different properties as
> long as we did not unprefix (and alias the prefixed version) of Clip-path.

Forgot the background: clip-path was introduced by and for SVG. -WebKit-Clip-path for HTML first. So those properties currently ARE 2 different properties. When unprefixing we plan to make them one. Foundation is there already. You should be able to find the bug that is duplicated by this bug by searching for clip-path.