stylo: getComputedStyle returns empty for custom property

NEW
Unassigned

Status

()

Core
CSS Parsing and Computation
P2
normal
4 months ago
2 months ago

People

(Reporter: xidorn, Unassigned)

Tracking

(Blocks: 2 bugs)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 months ago
Given the following code:
<!DOCTYPE html>
<p style="--foo:bar">hello</p>
<script>
  var p = document.querySelector('p');
  alert(getComputedStyle(p).getPropertyValue('--foo'));
</script>

It should show "bar", but stylo always shows empty string.

Probably the stylo glue code doesn't pass the computed value of custom properties to gecko.

Test test_variable_serialization_computed.html is for this.
Xidorn, are you going to take these kinds of bugs?
Flags: needinfo?(xidorn+moz)
(Reporter)

Comment 2

3 months ago
Maybe later.
Flags: needinfo?(xidorn+moz)
Component: DOM: CSS Object Model → CSS Parsing and Computation
Priority: -- → P2
[16:24:27]  <xidorn>	there is only one remaining issue as far as I know that, getComputedStyle doesn't return value for custom properties
[16:24:49]  <xidorn>	which is probably because we don't generate nsStyleVariables from ServoComputedValues
Blocks: 1243581
You need to log in before you can comment on or make changes to this bug.