Pierre Tachoire 47e52b8217 dom: implement lwc_string
and unit tests for document.GetElementByClassName
2023-11-20 14:57:42 +01:00
2023-11-20 14:57:42 +01:00
2023-11-15 15:01:04 +01:00
2023-09-22 16:10:22 +02:00
2023-10-19 15:14:19 +02:00
2023-11-14 11:36:33 +01:00
2023-10-20 14:25:28 +02:00
2023-11-20 14:57:42 +01:00

Browsercore

Build

Prerequisites

Browsercore is written with Zig 0.11.0. You have to install it with the right version in order to build the project.

Browsercore also depends on js-runtimelib and lexbor libs.

To be able to build the v8 engine for js-runtimelib, you have to install some libs:

For Debian/Ubuntu based Linux:

sudo apt install xz-utils \
    python3 ca-certificates git \
    pkg-config libglib2.0-dev \
    gperf libexpat1-dev \
    cmake clang

For MacOS, you only need Python 3 and cmake.

To be able to build lexbor, you need to install also cmake.

Install and build dependencies

The project uses git submodule for dependencies. The make install-submodule will init and update the submodules in the vendor/ directory.

make install-submodule

Build netsurf

The command make install-netsurf will build netsurf libs used by browsercore.

make install-netsurf

Build lexbor

The command make install-lexbor will build lexbor lib used by browsercore.

make install-lexbor

Build jsruntime-lib

The command make install-jsruntime-dev uses jsruntime-lib's zig-v8 dependency to build v8 engine lib. Be aware the build task is very long and cpu consuming.

Build v8 engine for debug/dev version, it creates vendor/jsruntime-lib/vendor/v8/$ARCH/debug/libc_v8.a file.

make install-jsruntime-dev

You should also build a release vesion of v8 with:

make install-jsruntime

All in one build

You can run make intall and make install-dev to install deps all in one.

Test

Unit Tests

You can test browsercore by running make test.

Web Platform Tests

Browsercore is tested against the standardized Web Platform Tests.

The relevant tests cases for Browsercore are commit with the project. All the tests cases executed are located in tests/wpt dir.

For reference, you can easily execute a WPT test case with your browser via wpt.live.

Run WPT test suite

You can run all the test. The runner execute all the tests ending with .html.

make wpt

Or one specific test by using a suffix.

make wpt Node-childNodes.html

Add a new WPT test case

We add new tests cases files with implemented changes in Browsercore.

Copy the test case you want to add from the WPT repo into test/wpt dir and commit the files.

⚠️ Please keep the original directory tree structure into test/wpt.

Description
The open-source browser made for headless usage
Readme AGPL-3.0 18 MiB
Languages
Zig 92.7%
HTML 6.5%
Makefile 0.3%
JavaScript 0.3%