浏览代码

LibWeb: Extract the LinkStyle IDL mixin

Sam Atkins 3 年之前
父节点
当前提交
899fa30bdd
共有 2 个文件被更改,包括 14 次插入4 次删除
  1. 6 0
      Userland/Libraries/LibWeb/CSS/LinkStyle.idl
  2. 8 4
      Userland/Libraries/LibWeb/HTML/HTMLStyleElement.idl

+ 6 - 0
Userland/Libraries/LibWeb/CSS/LinkStyle.idl

@@ -0,0 +1,6 @@
+#import <CSS/CSSStyleSheet.idl>
+
+// https://www.w3.org/TR/cssom-1/#ref-for-linkstyle
+interface mixin LinkStyle {
+    readonly attribute CSSStyleSheet? sheet;
+};

+ 8 - 4
Userland/Libraries/LibWeb/HTML/HTMLStyleElement.idl

@@ -1,13 +1,17 @@
 #import <CSS/CSSStyleSheet.idl>
 #import <CSS/CSSStyleSheet.idl>
+#import <CSS/LinkStyle.idl>
 #import <HTML/HTMLElement.idl>
 #import <HTML/HTMLElement.idl>
 
 
+// https://html.spec.whatwg.org/multipage/semantics.html#htmlstyleelement
 interface HTMLStyleElement : HTMLElement {
 interface HTMLStyleElement : HTMLElement {
+    // FIXME: [HTMLConstructor] constructor();
 
 
+    // FIXME: attribute boolean disabled;
     [Reflect] attribute DOMString media;
     [Reflect] attribute DOMString media;
+    // FIXME: [SameObject, PutForwards=value] readonly attribute DOMTokenList blocking;
 
 
+    // Obsolete
     [Reflect] attribute DOMString type;
     [Reflect] attribute DOMString type;
-
-    // FIXME: This should come from a LinkStyle mixin
-    readonly attribute CSSStyleSheet? sheet;
-
 };
 };
+
+HTMLStyleElement includes LinkStyle;