Skip to content

CI HTML validation issue "One operand must be a number" #8596

@ahukkanen

Description

@ahukkanen

Describe the bug
I just wanted to document it here before someone else spends time on it but there are several PRs that receive the "One operand must be a number" CSS validation error during the page HTML validation checks (e.g. proposals system specs).

This seems to be caused some recent changes in the Nu CSS validator, not any problems in Decidim itself.

I have opened an issue in the CSS validator project for this with a simple minimal example on how to replicate the issue in the validator:
w3c/css-validator#355

To Reproduce

$ cd /path/to/decidim
$ cd decidim-proposals
$ bundle exec rspec spec/system/proposals_spec.rb -e "Proposals when viewing a single proposal behaves like accessible page passes HTML validation"

Expected behavior
Valid HTML with no CI errors.

Screenshots
If applicable, add screenshots to help explain your problem.

Stacktrace

Failures:

  1) Proposals when viewing a single proposal behaves like accessible page passes HTML validation
     Failure/Error: DEFAULT_FAILURE_NOTIFIER = lambda { |failure, _opts| raise failure }
     
       ######
       line 561: CSS: “--content-height”: One operand must be a number.
     
         --row-count: 6;
     
       >>  --content-height: calc((var(--emoji-size) * var(--emoji-size-multiplier)) * var(--row-count) + var(--category-name-size) + var(--category-button-height) + 0.5em);
     
         --category-name-size: 0.85em;
     
     [Image screenshot]: file:///.../decidim/spec/decidim_dummy_app/tmp/screenshots/failures_r_spec_example_groups_proposals_when_viewing_a_single_proposal_behaves_like_accessible_page_passes_html_validation_961.png

            [Page HTML]: file:///.../decidim/spec/decidim_dummy_app/tmp/screenshots/failures_r_spec_example_groups_proposals_when_viewing_a_single_proposal_behaves_like_accessible_page_passes_html_validation_961.html

     
     Shared Example Group: "accessible page" called from ./spec/system/proposals_spec.rb:49
     # /.../decidim/decidim-dev/lib/decidim/dev/test/rspec_support/accessibility_examples.rb:14:in `block (2 levels) in <main>'

Extra data (please complete the following information):

  • Device: bash
  • Device OS: Linux
  • Browser: N/A
  • Decidim Version: develop
  • Decidim installation: N/A

Additional context
The related issue at the CSS validator project:
w3c/css-validator#355

The related issue at the HTML validator project:
validator/validator#1284

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions