Skip to content

Commit 859b166

Browse files
authored
Refactor generation logic so partials come after (#304)
Currently, the generator adds members to interfacelikes as we process various IDL files. This may lead to partial interfaces being added before the interface definition. Instead, this CL adds partials after the interface definition, and then applies mixins. It also dedups some logic around browser compatibility so that we only check compatibility and process in one location. While there is a diff in the generated files, it is functionally the same because all we do is move members around in the same extension type.
1 parent d8549a3 commit 859b166

17 files changed

+1406
-1407
lines changed

web/lib/src/dom/cssom.dart

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -352,18 +352,6 @@ extension type CSSRuleList._(JSObject _) implements JSObject {
352352
/// API documentation sourced from
353353
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSRule).
354354
extension type CSSRule._(JSObject _) implements JSObject {
355-
static const int KEYFRAMES_RULE = 7;
356-
357-
static const int KEYFRAME_RULE = 8;
358-
359-
static const int SUPPORTS_RULE = 12;
360-
361-
static const int COUNTER_STYLE_RULE = 11;
362-
363-
static const int FONT_FEATURE_VALUES_RULE = 14;
364-
365-
static const int VIEW_TRANSITION_RULE = 15;
366-
367355
static const int STYLE_RULE = 1;
368356

369357
static const int CHARSET_RULE = 2;
@@ -380,6 +368,18 @@ extension type CSSRule._(JSObject _) implements JSObject {
380368

381369
static const int NAMESPACE_RULE = 10;
382370

371+
static const int KEYFRAMES_RULE = 7;
372+
373+
static const int KEYFRAME_RULE = 8;
374+
375+
static const int SUPPORTS_RULE = 12;
376+
377+
static const int COUNTER_STYLE_RULE = 11;
378+
379+
static const int FONT_FEATURE_VALUES_RULE = 14;
380+
381+
static const int VIEW_TRANSITION_RULE = 15;
382+
383383
/// The **`cssText`** property of the [CSSRule]
384384
/// interface returns the actual text of a [CSSStyleSheet] style-rule.
385385
///
@@ -439,11 +439,6 @@ extension type CSSRule._(JSObject _) implements JSObject {
439439
/// API documentation sourced from
440440
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleRule).
441441
extension type CSSStyleRule._(JSObject _) implements CSSGroupingRule, JSObject {
442-
/// The **`styleMap`** read-only property of the
443-
/// [CSSStyleRule] interface returns a [StylePropertyMap] object
444-
/// which provides access to the rule's property-value pairs.
445-
external StylePropertyMap get styleMap;
446-
447442
/// The **`selectorText`** property of the [CSSStyleRule] interface gets and
448443
/// sets the selectors associated with the `CSSStyleRule`.
449444
external String get selectorText;
@@ -454,6 +449,11 @@ extension type CSSStyleRule._(JSObject _) implements CSSGroupingRule, JSObject {
454449
/// [declaration block](https://www.w3.org/TR/1998/REC-CSS2-19980512/syndata.html#block)
455450
/// of the [CSSStyleRule].
456451
external JSObject get style;
452+
453+
/// The **`styleMap`** read-only property of the
454+
/// [CSSStyleRule] interface returns a [StylePropertyMap] object
455+
/// which provides access to the rule's property-value pairs.
456+
external StylePropertyMap get styleMap;
457457
}
458458

459459
/// The **`CSSImportRule`** interface represents an
@@ -1930,6 +1930,7 @@ external $CSS get CSS;
19301930
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/CSS).
19311931
@JS('CSS')
19321932
extension type $CSS._(JSObject _) implements JSObject {
1933+
external String escape(String ident);
19331934
external bool supports(
19341935
String conditionTextOrProperty, [
19351936
String value,
@@ -1999,6 +2000,5 @@ extension type $CSS._(JSObject _) implements JSObject {
19992000
external CSSUnitValue dpcm(num value);
20002001
external CSSUnitValue dppx(num value);
20012002
external CSSUnitValue fr(num value);
2002-
external String escape(String ident);
20032003
external HighlightRegistry get highlights;
20042004
}

0 commit comments

Comments
 (0)