Sciter HTML parsing flavour

HTML parser in Sciter v.3 supports attribute shortcuts allowing to write HTML in more compact form. Compare these two declarations that are identical (to the Sciter):

Compact:

 
  <input|currency(itemPrice) value=1000> 

and standard:

 
  <input type="currency" name="itemPrice" value=1000> 

As you see the first one is slightly shorter and better readable (subjective of course).

Here is full list of supported attribute shortcuts:

  • #nameid, attribute name that starts from ‘#’ is parsed as id=”name”
  • .nameclass, this is an equivalent of class="name". Element may have multiple “dot attributes”. All of them are combined into single class attribute. So this <div.container.collapsed> is treated as this: <div class=”container collapsed”>
  • |nametype, attribute name that starts from ‘|’ is parsed as type="name"
  • (someName)name, attribute name enclosed into ‘(‘ and ‘)’ is parsed as name="someName"

Just in case 🙂

Sciter 3

Sciter 3 is officially out.

See its log file.

  • On Windows Vista/7 it uses Direct2D backend
  • On Windows XP it uses GDI+ backend

Known issue on Windows XP: rendering of linear and radial gradients is different from Direct2D backend as GDI+ has no notion of “open gradients”. I’ll fix it a bit later.

You shall expect that GDI+ rendering is not that effective as rendering by Direct2D so avoid animations affecting large areas. These two media rules allow to target different backends used:

 
  @media graphics-layer == 1 {
    /* GDI+ rules here.
       Less animation, etc. */
  }
  @media graphics-layer == 2 {
    /* Direct2D in WARP mode (software rendering but fast enough)        
     */
  }
  @media graphics-layer >= 3 {
    /* Direct2D in hardware mode, max performance. */
  }

But most of the time it is enough to have just two sections:

 
  @media graphics-layer == 1 {
    /* GDI+ rules here.
       Less animation, etc. */
  }
  @media graphics-layer > 1 {
    /* Direct2D, high performance. */
  }

In script you can check gfx backend used by reading view.backend (:integer) property.