From dfe04960c0b47f0f99097687795542d0f7cb48a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Arrufat?= Date: Thu, 12 Mar 2026 22:47:41 +0900 Subject: [PATCH] css: remove cssText setter from CSSRule and CSSStyleRule --- src/browser/webapi/css/CSSRule.zig | 17 ++++------------- src/browser/webapi/css/CSSStyleRule.zig | 8 +------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/browser/webapi/css/CSSRule.zig b/src/browser/webapi/css/CSSRule.zig index 6b03c53e..a96fe82b 100644 --- a/src/browser/webapi/css/CSSRule.zig +++ b/src/browser/webapi/css/CSSRule.zig @@ -48,20 +48,11 @@ pub fn getType(self: *const CSSRule) u16 { return @as(u16, @intFromEnum(std.meta.activeTag(self._type))) + 1; } -pub fn getCssText(self: *const CSSRule, page: *Page) []const u8 { - _ = self; - _ = page; +pub fn getCssText(_: *const CSSRule, _: *Page) []const u8 { return ""; } -pub fn setCssText(self: *CSSRule, text: []const u8, page: *Page) !void { - _ = self; - _ = text; - _ = page; -} - -pub fn getParentRule(self: *const CSSRule) ?*CSSRule { - _ = self; +pub fn getParentRule(_: *const CSSRule) ?*CSSRule { return null; } @@ -75,8 +66,8 @@ pub const JsApi = struct { pub const Meta = struct { pub const name = "CSSRule"; - pub var class_id: bridge.ClassId = undefined; pub const prototype_chain = bridge.prototypeChain(); + pub var class_id: bridge.ClassId = undefined; }; pub const STYLE_RULE = 1; @@ -97,7 +88,7 @@ pub const JsApi = struct { pub const REGION_STYLE_RULE = 16; 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 parentStyleSheet = bridge.accessor(CSSRule.getParentStyleSheet, null, .{}); }; diff --git a/src/browser/webapi/css/CSSStyleRule.zig b/src/browser/webapi/css/CSSStyleRule.zig index 6d07ab5d..561d39c1 100644 --- a/src/browser/webapi/css/CSSStyleRule.zig +++ b/src/browser/webapi/css/CSSStyleRule.zig @@ -45,12 +45,6 @@ pub fn getCssText(self: *CSSStyleRule, page: *Page) ![]const u8 { return buf.written(); } -pub fn setCssText(self: *CSSStyleRule, text: []const u8, page: *Page) !void { - _ = self; - _ = text; - _ = page; -} - pub const JsApi = struct { 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 style = bridge.accessor(CSSStyleRule.getStyle, null, .{}); - pub const cssText = bridge.accessor(CSSStyleRule.getCssText, CSSStyleRule.setCssText, .{}); + pub const cssText = bridge.accessor(CSSStyleRule.getCssText, null, .{}); };