Closed Bug 1287054 Opened 8 years ago Closed 6 months ago

Support all level 3 CSS length units in SVG

Categories

(Core :: SVG, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: sebo, Assigned: longsonr)

References

(Blocks 1 open bug, )

Details

(Keywords: dev-doc-complete)

Attachments

(2 files, 1 obsolete file)

SVG 2 defines that all units in SVG follow the description and definition of common values and units from the CSS Values and Units Module[1].

Therefore the viewport-percentage length units 'vw', 'vh', 'vi', 'vb', 'vmin' and 'vmax' should also have an effect within SVG.

There is also an issue[2] discussing to which viewport those units refer.

Sebastian

[1] https://drafts.csswg.org/css-values-3/#viewport-relative-lengths
[2] https://github.com/w3c/svgwg/issues/207
Blocks: svg2
Priority: -- → P3
This is a followup on https://webcompat.com/issues/12853

<svg height="100vh" width="100vw" 
     viewbox="0 0 100 100">
  <circle cx="50" cy="50" r="40" 
     fill="red" />
</svg>


It was in Chromium (Blink) a while ago
https://bugs.chromium.org/p/chromium/issues/detail?id=368598#c11

found out also that WebKit is reporting that this is an invalid attribute BUT still applies the transformation.
In WebKit, for the implementation of viewport lengths, but not specific to SVG.
https://bugs.webkit.org/show_bug.cgi?id=27160

or maybe WebKit doesn't support it but fallback on 100% when there is a parsing error and it's why it is working. Ah no. 
<svg  id="f" style="height:10vh; width:10vw;" viewbox="0 0 100 100"> is working as expected.
Summary: Add support for CSS viewport-percentage length units to SVG → Support all CSS length units in SVG

We should implement:

  1. vw, vh, vmin, vmax
  2. q
  3. rem, ch

Note vi and vb are in CSS level 4, they are not supported in any browser yet. It won't be implemented here either.

Assignee: nobody → violet.bugreport
Status: NEW → ASSIGNED

The bug assignee didn't login in Bugzilla in the last 7 months.
:jwatt, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: violet.bugreport → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(jwatt)
See Also: → 1791045
Severity: normal → S3
Flags: needinfo?(jwatt)
Duplicate of this bug: 1778774
Assignee: nobody → longsonr
Status: NEW → ASSIGNED
Pushed by longsonr@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/35034282dc7c
part 1 - support rem, ch, ic and cap units for non-CSS lengths r=emilio,jgilbert
https://hg.mozilla.org/integration/autoland/rev/5158484e9eab
part 2 - support vw, vh, vmin and vmax units for non-CSS lengths r=emilio,jgilbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41914 for changes under testing/web-platform/tests
Attachment #9069561 - Attachment is obsolete: true
Keywords: dev-doc-needed
Attachment #9069561 - Attachment is obsolete: false
Attachment #9069561 - Attachment is obsolete: true

Backed out for causing build bustages in SVGAnimatedLength.cpp.

Flags: needinfo?(longsonr)
Upstream PR was closed without merging
Pushed by longsonr@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/8a94c155e35c
part 1 - support rem, ch, ic and cap units for non-CSS lengths r=emilio,jgilbert
https://hg.mozilla.org/integration/autoland/rev/fc8eaef017f9
part 2 - support vw, vh, vmin and vmax units for non-CSS lengths r=emilio,jgilbert
Regressions: 1852652

Backed out for causing Android wpt failures in SVGLength-ch.html

There are failures on Windows too -> link.

Flags: needinfo?(longsonr)
Upstream PR was closed without merging

https://treeherder.mozilla.org/jobs?repo=try&revision=f0c5ea8210e849ad23d091527522f889fc9517ff - despite the sea of orange there's nothing that could be caused by these patches.

Flags: needinfo?(longsonr)
Pushed by longsonr@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/2f48a6566514
part 1 - support rem, ch, ic and cap units for non-CSS lengths r=emilio,jgilbert
https://hg.mozilla.org/integration/autoland/rev/4cca882e069d
part 2 - support vw, vh, vmin and vmax units for non-CSS lengths r=emilio,jgilbert

https://treeherder.mozilla.org/jobs?repo=try&revision=a966d3d24e09f9609de17556c1f9b09d1809652f hard to tell but I can't find anything in that sea of orange that's mine.

Flags: needinfo?(longsonr)
Pushed by longsonr@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/a16d763f2866
part 1 - support rem, ch, ic and cap units for non-CSS lengths r=emilio,jgilbert
https://hg.mozilla.org/integration/autoland/rev/9525c5d9a710
part 2 - support vw, vh, vmin and vmax units for non-CSS lengths r=emilio,jgilbert
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
Summary: Support all CSS length units in SVG → Support all level 3 CSS length units in SVG
Duplicate of this bug: 1853081
Upstream PR merged by moz-wptsync-bot
Regressions: 1857986
Duplicate of this bug: 1867128
You need to log in before you can comment on or make changes to this bug.