Skip to content

Minimal CSSStyleSheet #790

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Minimal CSSStyleSheet #790

wants to merge 3 commits into from

Conversation

mookums
Copy link
Contributor

@mookums mookums commented Jun 18, 2025

This is a super barebones CSSStyleSheet, mostly for just resolving various Custom Elements complaining about a lack of the CSSStyleSheet interface.

A lot of functionality is not implemented but it seems to allow more components to load on the Reddit example.

pub const CSSStyleSheet = struct {
pub const prototype = *StyleSheet;

css_rules: *CSSRuleList,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a pointer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer a pointer

return .{ .css_rules = rules, .owner_rule = null };
}

pub fn get_ownerRule(_: *CSSStyleSheet) ?*CSSImportRule {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub fn get_ownerRule(_: *CSSStyleSheet) ?*CSSImportRule {
pub fn get_ownerRule(_: *CSSStyleSheet) ?*CSSImportRule {

Not a big deal. Can also be done in get_cssRules

title: []const u8,
type: []const u8,

pub fn get_disabled(self: *StyleSheet) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub fn get_disabled(self: *StyleSheet) bool {
pub fn get_disabled(self: *const StyleSheet) bool {

(same as for the other ones)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants