css: remove cssText setter from CSSRule and CSSStyleRule

This commit is contained in:
Adrià Arrufat
2026-03-12 22:47:41 +09:00
parent de2b1cc6fe
commit dfe04960c0
2 changed files with 5 additions and 20 deletions

View File

@@ -48,20 +48,11 @@ pub fn getType(self: *const CSSRule) u16 {
return @as(u16, @intFromEnum(std.meta.activeTag(self._type))) + 1; return @as(u16, @intFromEnum(std.meta.activeTag(self._type))) + 1;
} }
pub fn getCssText(self: *const CSSRule, page: *Page) []const u8 { pub fn getCssText(_: *const CSSRule, _: *Page) []const u8 {
_ = self;
_ = page;
return ""; return "";
} }
pub fn setCssText(self: *CSSRule, text: []const u8, page: *Page) !void { pub fn getParentRule(_: *const CSSRule) ?*CSSRule {
_ = self;
_ = text;
_ = page;
}
pub fn getParentRule(self: *const CSSRule) ?*CSSRule {
_ = self;
return null; return null;
} }
@@ -75,8 +66,8 @@ pub const JsApi = struct {
pub const Meta = struct { pub const Meta = struct {
pub const name = "CSSRule"; pub const name = "CSSRule";
pub var class_id: bridge.ClassId = undefined;
pub const prototype_chain = bridge.prototypeChain(); pub const prototype_chain = bridge.prototypeChain();
pub var class_id: bridge.ClassId = undefined;
}; };
pub const STYLE_RULE = 1; pub const STYLE_RULE = 1;
@@ -97,7 +88,7 @@ pub const JsApi = struct {
pub const REGION_STYLE_RULE = 16; pub const REGION_STYLE_RULE = 16;
pub const @"type" = bridge.accessor(CSSRule.getType, null, .{}); pub const @"type" = bridge.accessor(CSSRule.getType, null, .{});
pub const cssText = bridge.accessor(CSSRule.getCssText, CSSRule.setCssText, .{}); pub const cssText = bridge.accessor(CSSRule.getCssText, null, .{});
pub const parentRule = bridge.accessor(CSSRule.getParentRule, null, .{}); pub const parentRule = bridge.accessor(CSSRule.getParentRule, null, .{});
pub const parentStyleSheet = bridge.accessor(CSSRule.getParentStyleSheet, null, .{}); pub const parentStyleSheet = bridge.accessor(CSSRule.getParentStyleSheet, null, .{});
}; };

View File

@@ -45,12 +45,6 @@ pub fn getCssText(self: *CSSStyleRule, page: *Page) ![]const u8 {
return buf.written(); return buf.written();
} }
pub fn setCssText(self: *CSSStyleRule, text: []const u8, page: *Page) !void {
_ = self;
_ = text;
_ = page;
}
pub const JsApi = struct { pub const JsApi = struct {
pub const bridge = js.Bridge(CSSStyleRule); pub const bridge = js.Bridge(CSSStyleRule);
@@ -62,5 +56,5 @@ pub const JsApi = struct {
pub const selectorText = bridge.accessor(CSSStyleRule.getSelectorText, CSSStyleRule.setSelectorText, .{}); pub const selectorText = bridge.accessor(CSSStyleRule.getSelectorText, CSSStyleRule.setSelectorText, .{});
pub const style = bridge.accessor(CSSStyleRule.getStyle, null, .{}); pub const style = bridge.accessor(CSSStyleRule.getStyle, null, .{});
pub const cssText = bridge.accessor(CSSStyleRule.getCssText, CSSStyleRule.setCssText, .{}); pub const cssText = bridge.accessor(CSSStyleRule.getCssText, null, .{});
}; };