LibCSS
What is LibCSS?
LibCSS is a CSS (Cascading Style Sheet) parser and selection engine, written in C. It was developed as part of the NetSurf project and is available for use by other software under the MIT licence. For further details, see the readme.
Features
- Parses CSS, good and bad
- Simple C API
- Low memory usage
- Fast selection engine
- Portable
- Shared library
Future:
- Available and packaged in major Linux distributions
Source code
You can browse the source code via the online interface. Alternatively, you can check it out with Git:
$ git clone git://git.netsurf-browser.org/libcss.git
LibCSS is licensed under the MIT Licence.
Releases
Most recent first:
- LibCSS 0.9.2
- Tarball – Changes
- LibCSS 0.9.1
- Tarball – Changes
- LibCSS 0.9.0
- Tarball – Changes
- LibCSS 0.8.0
- Tarball – Changes
- LibCSS 0.7.0
- Tarball – Changes
- LibCSS 0.6.1
- Tarball – Changes
- LibCSS 0.6.0
- Tarball – Changes
- LibCSS 0.5.1
- Tarball – Changes
- LibCSS 0.5.0
- Tarball – Changes
- LibCSS 0.4.0
- Tarball – Changes
- LibCSS 0.3.0
- Tarball – Changes
- LibCSS 0.2.0
- Tarball – Changes
- LibCSS 0.1.2
- Tarball – Changes
- LibCSS 0.1.1
- Tarball – Changes
- LibCSS 0.1.0
- Tarball – Changes
- LibCSS 0.0.2
- Tarball – Changes
- LibCSS 0.0.1
- Tarball – First release
Changes
- LibCSS 0.9.2
- Added support for SVG `fill-opacity` property.
- Added support for SVG `stroke-opacity` property.
- Added support for CSS property wide `revert` value.
- Added support for CSS property wide `unset` value.
- Added support for CSS property wide `initial` value.
- Added support for CSS `position` property `sticky` value.
- Added support for CSS `display` property "grid" values.
- Added support for `prefers-color-scheme` media query.
- Added new public API for CSS unit conversion.
- Added support for predefined counter styles.
- Optimised media query handling.
- Made selection code generator deterministic.
- Various selection code generator improvements.
- Squashed leak of system font names.
- Improved internal handling of property units.
- Improved internal string map.
- Minor buildsystem improvements.
- Improved example code.
- Added new tests.
- LibCSS 0.9.1
- Fixed a problem in the parsing of invalid media blocks.
- Minor code quality improvements.
- LibCSS 0.9.0
- Added support for parsing CSS Media Queries Level 4.
- API for adding sheets to a selection context now takes a Media string.
- The selection API now allows the client to describe the media that is being selected for.
- Selection now honours width/height feature queries.
- Removed the uncommon property extension blocks in computed style data. This simplfies the code and fixes a subtle bug in the cascade/composition handling.
- Fixed leak where rules had over 256 selectors.
- LibCSS 0.8.0
- Added support for CSS flexbox properties.
- Added support for new CSS units.
- Auto-generated source code for computed style handling.
- Squashed some undefined behaviour issues.
- Unified some duplicated media handling code.
- LibCSS 0.7.0
- Computed styles can now be shared between elements.
- Computed styles interned, so only unique computed styles reside in memory. This means multiple pages/tabs/windows can share computed style data.
- Where possible, we now bypass CSS selection, and simply take a reference to another element in the DOM's style, if we're sure it will be the same.
- Added support for the CSS3 box-sizing property.
- Fixed invalid read when removing sheet from selection context.
- Fixed example / demo app build.
- LibCSS 0.6.1
- LibCSS 0.6.0
- Changed how presentational hints are handled to be more optimal.
- LibCSS 0.5.1
- Fixed paths for Haiku.
- Minor buildsystem changes.
- Added doxygen code documentation generation support.
- Minor improvements to tests.
- Added "96" to useful fixed point values in fpmath header.
- Slight simplification of initial computed style setup.
- LibCSS 0.5.0
- Added selection support for CSS3 column-count property.
- Added selection support for CSS3 column-fill property.
- Added selection support for CSS3 column-gap property.
- Added selection support for CSS3 column-rule-color property.
- Added selection support for CSS3 column-rule-style property.
- Added selection support for CSS3 column-rule-width property.
- Added selection support for CSS3 column-span property.
- Added selection support for CSS3 column-width property.
- Added selection support for CSS3 break-after property.
- Added selection support for CSS3 break-before property.
- Added selection support for CSS3 break-inside property.
- Improved and fixed absolute value conversion of computed styles.
- Minor optimisations.
- Updated buildsystem.
- Improved selection tests.
- Code tidying.
- Many minor improvements and fixes.
- LibCSS 0.4.0
- Added support for CSS3 overflow-x and overflow-y properties.
- Fix to !important handling with play-during property.
- Improved test coverage.
- API changes made.
- LibCSS 0.3.0
- Added support for the writing-mode property.
- Significantly optimised selection performance.
- Made many fixes and internal clean-ups.
- Added support for multilib.
- API and ABI changes made.
- LibCSS 0.2.0
- Updated example code.
- Added support for CSS widows and orphans properties.
- Minor selection optimisations.
- Several minor fixes.
- Updated to use new core buildsystem.
- LibCSS 0.1.2
- Avoided interning standard strings for every stylesheet, style tag and style attribute.
- Made significant optimisations to style selection.
- Fixed case where font-family is unspecified in input CSS.
- Added some support for @font-face.
- Fixed !important on opacity property.
- Added support for parsing CSS3 Multi-column layout properties.
- LibCSS 0.1.1
- Improved build tree cleaning.
- Fixed build with GCC 4.6.
- Added support for selection of page-break properties.
- Optimised style selection.
- LibCSS 0.1.0
- Fixed destruction of bytecode for clip property.
- Added scoping for use from C++ programs.
- Removed need for library initialisation and finalisation.
- Added support for CSS2 system colours.
- Added support for CSS2 system fonts.
- Altered external representation of colours to aarrggbb.
- Added support for CSS3 rgba() colour specifier.
- Added support for CSS3 'transparent' colour keyword.
- Added support for CSS3 hsl() and hsla() colour specifiers.
- Added support for CSS3 'currentColor' colour keyword.
- Added support for CSS3 'opacity' property.
- Added support for CSS3 selectors.
- Added support for CSS3 namespaces.
- Enabled clients to fetch imported stylesheets in parallel.
- Made internal bytecode 64-bit safe.
- Fixed leaking of strings.
- Rewritten property parsers.
- Certain property parsers auto-generated at build time.
- Added clang build support.
- Various portability enhancements.
- Fixed selection for pseudo elements.
- Added simultaneous selection for base and pseudo elements.
- Namespaced all global symbols.
- Updated test suite.
- Future-proofed ABI.
- Ensured fixed point maths saturates instead of overflowing.
- Fixed clip property handling.
- Fixed selection and cascade of "uncommon" CSS properties.
- Added structure versioning for client input.
- LibCSS 0.0.2
- Allow stylesheets to be used in multiple contexts simultaneously.
- Fix possible stylesheet reuse crash.
- LibCSS 0.0.1
- First release.
Contact
If you would like to help develop LibCSS, or have questions about the library, please join the NetSurf developer mailing list.