workbenchdev / workbenchdev/Workbench

Invalid CSS drop-shadow call crashes app

Open
#1,030 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
844
Forks
91
Avg merge
7h 12m
Merged PRs (30d)
1

Description

I'm finding crashes when messing with CSS drop-shadow in Workbench. When the syntax is slightly wrong, it crashes the whole app.

Here's a minimal reproduction:

  1. Open the "Welcome" demo from the library (I think any other demo will do, but this is one I've checked)
  2. Open the Style pane to edit CSS
  3. Paste in the following CSS code:
    button {
      filter: drop-shadow(1px 0);
    }
    
  4. Workbench crashes, repeatedly until I manually find and edit the CSS file it's using to remove the invalid drop-shadow() call

For context of the provided CSS snippet, it's one example I encountered while trying to type drop-shadow(1px 0px). It appears that Workbench pulled and tried to run the code as I was typing, before I made it to typing the "px" keys.

Once Workbench is in the crashing state (trying to load the invalid code), launching it from terminal prints the following:

$ flatpak run re.sonny.Workbench
(re.sonny.Workbench:5): Gjs-WARNING **: 14:16:41.982: Type GITypeInfo of property Gtk.IconTheme::search-path does not match return type GITypeInfo of getter get_search_path. Falling back to slow path
(re.sonny.Workbench:5): Gjs-WARNING **: 14:16:41.982: Type GITypeInfo of property Gtk.IconTheme::search-path does not match type GITypeInfo of first argument of setter set_search_path. Falling back to slow path
**
Gtk:ERROR:../gtk/gtkcsscolorvalue.c:2194:gtk_css_color_value_get_rgba: assertion failed: (color->type == COLOR_TYPE_COLOR)
Bail out! Gtk:ERROR:../gtk/gtkcsscolorvalue.c:2194:gtk_css_color_value_get_rgba: assertion failed: (color->type == COLOR_TYPE_COLOR)

Reproduced using Workbench 50.0, Flatpak 1.12.7, on Elementary OS 7.1.

This may include other CSS functions, I'm not sure, this is just the one I am aware of.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the crash from the Welcome demo through the Style pane with the invalid drop-shadow() CSS shown in the issue. Trace how the Style pane applies CSS while text is being edited, then verify that invalid CSS no longer crashes Workbench and that valid CSS can still be entered.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.