Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

css rules cause hang on linux gtk #126

Closed
adabru opened this issue Aug 1, 2019 · 2 comments
Closed

css rules cause hang on linux gtk #126

adabru opened this issue Aug 1, 2019 · 2 comments

Comments

@adabru
Copy link

adabru commented Aug 1, 2019

Hi, I get a 100% CPU hang when I use some specific html-file.

System: linux gtk x64 (ArcoLinuxD rolling release).

Create file ui/main.htm with following content:

<html>
  <head>
    <style>
      .h30 { height: 30px; }
      .floatleft { float: left; }
      *::after { box-sizing: border-box; }
    </style>
  </head>
  <body>
    <div class="h30">
      <div class="floatleft"></div>
      div element
    </div>
    <a class="h30">
      <div class="floatleft"></div>
      a element
    </a>
  </body>
</html>

Create file main.cpp with content copied from https://sciter.com/hello-cpp-tutorial/

Issue visible in usciter:

# bash
wget https://github.com/c-smile/sciter-sdk/archive/master.zip
unzip master.zip
sciter-sdk-master/bin.gtk/x64/usciter ui/main.htm

Open ui/main.htm in usciter, hover mouse over the text a little bit, program gets stuck on 100% CPU usage and no responsiveness.

Alternatively, issue visible in compiled program:

# bash
export SCITERSDK="$PWD/sciter-sdk-master"
export PATH="$PATH:$SCITERSDK/bin.gtk/x64"
cp $SCITERSDK/include/sciter-gtk-main.cpp .
cp $SCITERSDK/bin.gtk/x64/libsciter-gtk.so .
packfolder ui resources.cpp -v "resources"

g++ -I"$SCITERSDK/include" $(pkg-config --cflags gtk+-3.0) sciter-gtk-main.cpp main.cpp -o a.out -L. -lsciter-gtk -ldl $(pkg-config --libs gtk+-3.0)
LD_LIBRARY_PATH=. ./a.out

Hover mouse over the text a little bit, program gets stuck on 100% CPU usage.

The html file is a MWE extracted from a css-design-template I downloaded.

@c-smile
Copy link
Owner

c-smile commented Aug 1, 2019

Problem indeed.

Thanks for the sample, Adam.

Just in case use of floats for layout purposes in modern CSS is "considered harmful".

In Sciter use

body { flow:horizontal; } 

if you want blocks inside body to be replaced in horizontal row.

Yet *::after { box-sizing: border-box; } (all elements are getting additional not-so-pseudo-element) is murky at best. Anyway box-sizing is not supported by Sciter - no need for that.

@adabru
Copy link
Author

adabru commented Nov 21, 2019

The mentioned downloaded css-template wasn't fun to work with in other areas either (unrelated to sciter) and I rewrote the template. As you mention working with floats is considered bad practice, I wouldn't mind you closing this issue as won't fix.

@c-smile c-smile closed this as completed Nov 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants