Skip to content

Rework WPT runner #589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/wpt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

- uses: ./.github/actions/install

- run: zig build wpt -- --safe --summary
- run: zig build wpt -- --summary

# For now WPT tests doesn't pass at all.
# We accept then to continue the job on failure.
Expand All @@ -80,7 +80,7 @@ jobs:
- uses: ./.github/actions/install

- name: json output
run: zig build wpt -- --safe --json > wpt.json
run: zig build wpt -- --json > wpt.json

- name: write commit
run: |
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ shell:
## Run WPT tests
wpt:
@printf "\e[36mBuilding wpt...\e[0m\n"
@$(ZIG) build wpt -- --safe $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
@$(ZIG) build wpt -- $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)

wpt-summary:
@printf "\e[36mBuilding wpt...\e[0m\n"
@$(ZIG) build wpt -- --safe --summary $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
@$(ZIG) build wpt -- --summary $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)

## Test
test:
Expand Down
2 changes: 1 addition & 1 deletion src/browser/browser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ pub const Page = struct {
.url = URL.empty,
.session = session,
.renderer = FlatRenderer.init(arena),
.window_clicked_event_node = .{ .func = windowClicked },
.window_clicked_event_node = .{ .func = windowClicked },
.state = .{
.arena = arena,
.document = null,
Expand Down
8 changes: 8 additions & 0 deletions src/browser/netsurf.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,14 @@ pub fn elementHTMLGetTagType(elem_html: *ElementHTML) !Tag {
var tag_type: c.dom_html_element_type = undefined;
const err = elementHTMLVtable(elem_html).dom_html_element_get_tag_type.?(elem_html, &tag_type);
try DOMErr(err);

if (tag_type >= 255) {
// This is questionable, but std.meta.intToEnum has more overhead
// Added this because this WPT test started to fail once we
// introduced an SVGElement:
// html/dom/documents/dom-tree-accessors/document.title-09.html
return Tag.undef;
}
return @as(Tag, @enumFromInt(tag_type));
}

Expand Down
Loading
Loading