Skip to content
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

SVGStyleElement implements LinkStyle #922

Merged
merged 4 commits into from
Oct 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14454,8 +14454,7 @@ declare var SVGStringList: {
};

/** Corresponds to the SVG <style> element. */
interface SVGStyleElement extends SVGElement {
disabled: boolean;
conniefan marked this conversation as resolved.
Show resolved Hide resolved
interface SVGStyleElement extends SVGElement, LinkStyle {
media: string;
title: string;
type: string;
Expand Down Expand Up @@ -19025,6 +19024,7 @@ declare var console: Console;

/** Holds useful CSS-related methods. No object with this interface are implemented: it contains only static methods and therefore is a utilitarian interface. */
declare namespace CSS {
function escape(ident: string): string;
function escape(ident: string): string;
conniefan marked this conversation as resolved.
Show resolved Hide resolved
function supports(property: string, value: string): boolean;
function supports(conditionText: string): boolean;
Expand Down Expand Up @@ -19462,7 +19462,6 @@ interface SVGElementTagNameMap {
"rect": SVGRectElement;
"script": SVGScriptElement;
"stop": SVGStopElement;
"style": SVGStyleElement;
conniefan marked this conversation as resolved.
Show resolved Hide resolved
"svg": SVGSVGElement;
"switch": SVGSwitchElement;
"symbol": SVGSymbolElement;
Expand Down
143 changes: 143 additions & 0 deletions inputfiles/idl/Link Style.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
[Exposed=Window]
interface MediaList {
stringifier attribute [LegacyNullToEmptyString] CSSOMString mediaText;
readonly attribute unsigned long length;
getter CSSOMString? item(unsigned long index);
undefined appendMedium(CSSOMString medium);
undefined deleteMedium(CSSOMString medium);
};

[Exposed=Window]
interface StyleSheet {
readonly attribute CSSOMString type;
readonly attribute USVString? href;
readonly attribute (Element or ProcessingInstruction)? ownerNode;
readonly attribute CSSStyleSheet? parentStyleSheet;
readonly attribute DOMString? title;
[SameObject, PutForwards=mediaText] readonly attribute MediaList media;
attribute boolean disabled;
};

[Exposed=Window]
interface CSSStyleSheet : StyleSheet {
readonly attribute CSSRule? ownerRule;
[SameObject] readonly attribute CSSRuleList cssRules;
unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0);
undefined deleteRule(unsigned long index);
};

partial interface CSSStyleSheet {
[SameObject] readonly attribute CSSRuleList rules;
long addRule(optional DOMString selector = "undefined", optional DOMString style = "undefined", optional unsigned long index);
undefined removeRule(optional unsigned long index = 0);
};

[Exposed=Window]
interface StyleSheetList {
getter CSSStyleSheet? item(unsigned long index);
readonly attribute unsigned long length;
};

partial interface mixin DocumentOrShadowRoot {
[SameObject] readonly attribute StyleSheetList styleSheets;
};

interface mixin LinkStyle {
readonly attribute CSSStyleSheet? sheet;
};

ProcessingInstruction includes LinkStyle;

[Exposed=Window]
interface CSSRuleList {
getter CSSRule? item(unsigned long index);
readonly attribute unsigned long length;
};

[Exposed=Window]
interface CSSRule {
attribute CSSOMString cssText;
readonly attribute CSSRule? parentRule;
readonly attribute CSSStyleSheet? parentStyleSheet;

// the following attribute and constants are historical
readonly attribute unsigned short type;
const unsigned short STYLE_RULE = 1;
const unsigned short CHARSET_RULE = 2;
const unsigned short IMPORT_RULE = 3;
const unsigned short MEDIA_RULE = 4;
const unsigned short FONT_FACE_RULE = 5;
const unsigned short PAGE_RULE = 6;
const unsigned short MARGIN_RULE = 9;
const unsigned short NAMESPACE_RULE = 10;
};

[Exposed=Window]
interface CSSStyleRule : CSSRule {
attribute CSSOMString selectorText;
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
};

[Exposed=Window]
interface CSSImportRule : CSSRule {
readonly attribute USVString href;
[SameObject, PutForwards=mediaText] readonly attribute MediaList media;
[SameObject] readonly attribute CSSStyleSheet styleSheet;
};

[Exposed=Window]
interface CSSGroupingRule : CSSRule {
[SameObject] readonly attribute CSSRuleList cssRules;
unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0);
undefined deleteRule(unsigned long index);
};

[Exposed=Window]
interface CSSPageRule : CSSGroupingRule {
attribute CSSOMString selectorText;
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
};

[Exposed=Window]
interface CSSMarginRule : CSSRule {
readonly attribute CSSOMString name;
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
};

[Exposed=Window]
interface CSSNamespaceRule : CSSRule {
readonly attribute CSSOMString namespaceURI;
readonly attribute CSSOMString prefix;
};

[Exposed=Window]
interface CSSStyleDeclaration {
[CEReactions] attribute CSSOMString cssText;
readonly attribute unsigned long length;
getter CSSOMString item(unsigned long index);
CSSOMString getPropertyValue(CSSOMString property);
CSSOMString getPropertyPriority(CSSOMString property);
[CEReactions] undefined setProperty(CSSOMString property, [LegacyNullToEmptyString] CSSOMString value, optional [LegacyNullToEmptyString] CSSOMString priority = "");
[CEReactions] CSSOMString removeProperty(CSSOMString property);
readonly attribute CSSRule? parentRule;
[CEReactions] attribute [LegacyNullToEmptyString] CSSOMString cssFloat;
};

interface mixin ElementCSSInlineStyle {
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
};

HTMLElement includes ElementCSSInlineStyle;

SVGElement includes ElementCSSInlineStyle;

MathMLElement includes ElementCSSInlineStyle;

partial interface Window {
[NewObject] CSSStyleDeclaration getComputedStyle(Element elt, optional CSSOMString? pseudoElt);
};

[Exposed=Window]
namespace CSS {
CSSOMString escape(CSSOMString ident);
};
8 changes: 8 additions & 0 deletions inputfiles/idl/SVG - Style Element.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Exposed=Window]
interface SVGStyleElement : SVGElement {
attribute DOMString type;
attribute DOMString media;
attribute DOMString title;
};

SVGStyleElement includes LinkStyle;
8 changes: 8 additions & 0 deletions inputfiles/idlSources.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@
"url": "https://www.w3.org/TR/intersection-observer/",
"title": "Intersection Observer"
},
{
"url": "https://drafts.csswg.org/cssom/",
"title": "Link Style"
},
{
"url": "https://w3c.github.io/mediacapture-main/",
"title": "Media Capture and Streams"
Expand Down Expand Up @@ -486,6 +490,10 @@
"url": "https://www.w3.org/TR/SVG2/text.html",
"title": "SVG - Text"
},
{
"url": "https://www.w3.org/TR/SVG2/styling.html",
"title": "SVG - Style Element"
},
{
"url": "https://w3c.github.io/touch-events/",
"title": "Touch Events"
Expand Down