Commit bc68a3bf authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

css: Make CSS an IDL namespace

Blink-V8 bindings haven't supported IDL namespaces for a long
time, however, finally IDL namespaces get supported.

This patch changes `window.CSS` from an IDL interface to an IDL
namespace in conformance to the standard.

Change-Id: I60a7129df48b68e890ed30bf7ed03d7f79228522
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2434404Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821692}
parent e4f7d9c3
...@@ -519,8 +519,6 @@ generated_interface_sources_in_core = [ ...@@ -519,8 +519,6 @@ generated_interface_sources_in_core = [
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_count_queuing_strategy.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_count_queuing_strategy.h",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_csp_violation_report_body.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_csp_violation_report_body.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_csp_violation_report_body.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_csp_violation_report_body.h",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_css.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_css.h",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_css_animation.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_css_animation.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_css_animation.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_css_animation.h",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_css_condition_rule.cc", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_css_condition_rule.cc",
...@@ -1393,7 +1391,10 @@ generated_interface_sources_in_core = [ ...@@ -1393,7 +1391,10 @@ generated_interface_sources_in_core = [
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_xslt_processor.h", "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_xslt_processor.h",
] ]
generated_namespace_sources_in_core = [] generated_namespace_sources_in_core = [
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_css.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_css.h",
]
# Generated sources for testing # Generated sources for testing
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
[ [
Exposed=Window, Exposed=Window,
ImplementedAs=DOMWindowCSS ImplementedAs=DOMWindowCSS
] interface CSS { ] namespace CSS {
[CallWith=ExecutionContext] static boolean supports(DOMString property, DOMString value); [CallWith=ExecutionContext] boolean supports(DOMString property, DOMString value);
[CallWith=ExecutionContext] static boolean supports(DOMString conditionText); [CallWith=ExecutionContext] boolean supports(DOMString conditionText);
static DOMString escape(DOMString ident); DOMString escape(DOMString ident);
}; };
...@@ -6,52 +6,52 @@ ...@@ -6,52 +6,52 @@
[ [
ImplementedAs=CSSUnitValues ImplementedAs=CSSUnitValues
] partial interface CSS { ] partial namespace CSS {
[NewObject] static CSSUnitValue number(double value); [NewObject] CSSUnitValue number(double value);
[NewObject] static CSSUnitValue percent(double value); [NewObject] CSSUnitValue percent(double value);
// <length> // <length>
[NewObject] static CSSUnitValue em(double value); [NewObject] CSSUnitValue em(double value);
[NewObject] static CSSUnitValue ex(double value); [NewObject] CSSUnitValue ex(double value);
[NewObject] static CSSUnitValue ch(double value); [NewObject] CSSUnitValue ch(double value);
[NewObject] static CSSUnitValue rem(double value); [NewObject] CSSUnitValue rem(double value);
[NewObject] static CSSUnitValue vw(double value); [NewObject] CSSUnitValue vw(double value);
[NewObject] static CSSUnitValue vh(double value); [NewObject] CSSUnitValue vh(double value);
[NewObject] static CSSUnitValue vmin(double value); [NewObject] CSSUnitValue vmin(double value);
[NewObject] static CSSUnitValue vmax(double value); [NewObject] CSSUnitValue vmax(double value);
[NewObject] static CSSUnitValue cm(double value); [NewObject] CSSUnitValue cm(double value);
[NewObject] static CSSUnitValue mm(double value); [NewObject] CSSUnitValue mm(double value);
[NewObject] static CSSUnitValue in(double value); [NewObject] CSSUnitValue in(double value);
[NewObject] static CSSUnitValue pt(double value); [NewObject] CSSUnitValue pt(double value);
[NewObject] static CSSUnitValue pc(double value); [NewObject] CSSUnitValue pc(double value);
[NewObject] static CSSUnitValue px(double value); [NewObject] CSSUnitValue px(double value);
[NewObject] static CSSUnitValue Q(double value); [NewObject] CSSUnitValue Q(double value);
// TODO: Currently unsupported length units that are specified // TODO: Currently unsupported length units that are specified
// [NewObject] static CSSUnitValue ic(double value); // [NewObject] CSSUnitValue ic(double value);
// [NewObject] static CSSUnitValue lh(double value); // [NewObject] CSSUnitValue lh(double value);
// [NewObject] static CSSUnitValue rlh(double value); // [NewObject] CSSUnitValue rlh(double value);
// [NewObject] static CSSUnitValue vi(double value); // [NewObject] CSSUnitValue vi(double value);
// [NewObject] static CSSUnitValue vb(double value); // [NewObject] CSSUnitValue vb(double value);
// <angle> // <angle>
[NewObject] static CSSUnitValue deg(double value); [NewObject] CSSUnitValue deg(double value);
[NewObject] static CSSUnitValue grad(double value); [NewObject] CSSUnitValue grad(double value);
[NewObject] static CSSUnitValue rad(double value); [NewObject] CSSUnitValue rad(double value);
[NewObject] static CSSUnitValue turn(double value); [NewObject] CSSUnitValue turn(double value);
// <time> // <time>
[NewObject] static CSSUnitValue s(double value); [NewObject] CSSUnitValue s(double value);
[NewObject] static CSSUnitValue ms(double value); [NewObject] CSSUnitValue ms(double value);
// <frequency> // <frequency>
[NewObject] static CSSUnitValue Hz(double value); [NewObject] CSSUnitValue Hz(double value);
[NewObject] static CSSUnitValue kHz(double value); [NewObject] CSSUnitValue kHz(double value);
// <resolution> // <resolution>
[NewObject] static CSSUnitValue dpi(double value); [NewObject] CSSUnitValue dpi(double value);
[NewObject] static CSSUnitValue dpcm(double value); [NewObject] CSSUnitValue dpcm(double value);
[NewObject] static CSSUnitValue dppx(double value); [NewObject] CSSUnitValue dppx(double value);
// <flex> // <flex>
[NewObject] static CSSUnitValue fr(double value); [NewObject] CSSUnitValue fr(double value);
}; };
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// https://drafts.css-houdini.org/css-properties-values-api/#registering-custom-properties // https://drafts.css-houdini.org/css-properties-values-api/#registering-custom-properties
[ [
ImplementedAs=PropertyRegistration ImplementedAs=PropertyRegistration
] partial interface CSS { ] partial namespace CSS {
[MeasureAs=CSSRegisterProperty, CallWith=ExecutionContext, RaisesException] [MeasureAs=CSSRegisterProperty, CallWith=ExecutionContext, RaisesException]
static void registerProperty(PropertyDefinition definition); void registerProperty(PropertyDefinition definition);
}; };
...@@ -9,6 +9,6 @@ ...@@ -9,6 +9,6 @@
RuntimeEnabled=CSSLayoutAPI, RuntimeEnabled=CSSLayoutAPI,
MeasureAs=LayoutWorklet, MeasureAs=LayoutWorklet,
SecureContext SecureContext
] partial interface CSS { ] partial namespace CSS {
[CallWith=ScriptState] static readonly attribute Worklet layoutWorklet; [CallWith=ScriptState] readonly attribute Worklet layoutWorklet;
}; };
...@@ -6,6 +6,6 @@ ...@@ -6,6 +6,6 @@
ImplementedAs=CSSAnimationWorklet, ImplementedAs=CSSAnimationWorklet,
RuntimeEnabled=AnimationWorklet, RuntimeEnabled=AnimationWorklet,
SecureContext SecureContext
] partial interface CSS { ] partial namespace CSS {
[CallWith=ScriptState] static readonly attribute Worklet animationWorklet; [CallWith=ScriptState] readonly attribute Worklet animationWorklet;
}; };
\ No newline at end of file
...@@ -7,6 +7,6 @@ ...@@ -7,6 +7,6 @@
[ [
ImplementedAs=CSSPaintWorklet, ImplementedAs=CSSPaintWorklet,
SecureContext SecureContext
] partial interface CSS { ] partial namespace CSS {
[CallWith=ScriptState,MeasureAs=PaintWorklet] static readonly attribute Worklet paintWorklet; [CallWith=ScriptState,MeasureAs=PaintWorklet] readonly attribute Worklet paintWorklet;
}; };
This is a testharness.js-based test.
FAIL @@toStringTag exists on the namespace object with the appropriate descriptor assert_own_property: expected property symbol "Symbol(Symbol.toStringTag)" missing
FAIL Object.prototype.toString applied to the namespace object assert_equals: expected "[object CSS]" but got "function CSS() { [native code] }"
FAIL Object.prototype.toString applied after modifying the namespace object's @@toStringTag assert_own_property: Precondition: @@toStringTag on the namespace object expected property symbol "Symbol(Symbol.toStringTag)" missing
FAIL Object.prototype.toString applied after deleting @@toStringTag assert_own_property: Precondition: @@toStringTag on the namespace object expected property symbol "Symbol(Symbol.toStringTag)" missing
Harness: the test ran to completion.
This is a testharness.js-based test. This is a testharness.js-based test.
Found 435 tests; 378 PASS, 57 FAIL, 0 TIMEOUT, 0 NOTRUN. Found 435 tests; 380 PASS, 55 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS idl_test setup PASS idl_test setup
PASS idl_test validation PASS idl_test validation
PASS Partial interface CSSStyleSheet: original interface defined PASS Partial interface CSSStyleSheet: original interface defined
...@@ -417,8 +417,8 @@ PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit p ...@@ -417,8 +417,8 @@ PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit p
PASS CSS namespace: extended attributes PASS CSS namespace: extended attributes
PASS CSS namespace: property descriptor PASS CSS namespace: property descriptor
PASS CSS namespace: [[Extensible]] is true PASS CSS namespace: [[Extensible]] is true
FAIL CSS namespace: [[Prototype]] is Object.prototype assert_equals: expected (object) object "[object Object]" but got (function) function "function () { [native code] }" PASS CSS namespace: [[Prototype]] is Object.prototype
FAIL CSS namespace: typeof is "object" assert_equals: expected "object" but got "function" PASS CSS namespace: typeof is "object"
PASS CSS namespace: operation escape(CSSOMString) PASS CSS namespace: operation escape(CSSOMString)
PASS SVGElement interface: attribute style PASS SVGElement interface: attribute style
PASS SVGElement interface: svg_element must inherit property "style" with the proper type PASS SVGElement interface: svg_element must inherit property "style" with the proper type
......
This is a testharness.js-based test.
FAIL getComputedStyle() round-trips in presence of scrollbars assert_equals: width round-trips expected "85px" but got "70px"
Harness: the test ran to completion.
...@@ -378,42 +378,6 @@ interface ByteLengthQueuingStrategy ...@@ -378,42 +378,6 @@ interface ByteLengthQueuingStrategy
interface CDATASection : Text interface CDATASection : Text
attribute @@toStringTag attribute @@toStringTag
method constructor method constructor
interface CSS
static getter paintWorklet
static method Hz
static method Q
static method ch
static method cm
static method deg
static method dpcm
static method dpi
static method dppx
static method em
static method escape
static method ex
static method fr
static method grad
static method in
static method kHz
static method mm
static method ms
static method number
static method pc
static method percent
static method pt
static method px
static method rad
static method registerProperty
static method rem
static method s
static method supports
static method turn
static method vh
static method vmax
static method vmin
static method vw
attribute @@toStringTag
method constructor
interface CSSAnimation : Animation interface CSSAnimation : Animation
attribute @@toStringTag attribute @@toStringTag
getter animationName getter animationName
...@@ -9559,6 +9523,41 @@ interface webkitURL ...@@ -9559,6 +9523,41 @@ interface webkitURL
setter search setter search
setter username setter username
[NAMESPACES] [NAMESPACES]
namespace CSS
attribute @@toStringTag
getter paintWorklet
method Hz
method Q
method ch
method cm
method deg
method dpcm
method dpi
method dppx
method em
method escape
method ex
method fr
method grad
method in
method kHz
method mm
method ms
method number
method pc
method percent
method pt
method px
method rad
method registerProperty
method rem
method s
method supports
method turn
method vh
method vmax
method vmin
method vw
[GLOBAL OBJECT] [GLOBAL OBJECT]
attribute GCController attribute GCController
attribute accessibilityController attribute accessibilityController
......
...@@ -597,44 +597,6 @@ interface ByteLengthQueuingStrategy ...@@ -597,44 +597,6 @@ interface ByteLengthQueuingStrategy
interface CDATASection : Text interface CDATASection : Text
attribute @@toStringTag attribute @@toStringTag
method constructor method constructor
interface CSS
static getter animationWorklet
static getter layoutWorklet
static getter paintWorklet
static method Hz
static method Q
static method ch
static method cm
static method deg
static method dpcm
static method dpi
static method dppx
static method em
static method escape
static method ex
static method fr
static method grad
static method in
static method kHz
static method mm
static method ms
static method number
static method pc
static method percent
static method pt
static method px
static method rad
static method registerProperty
static method rem
static method s
static method supports
static method turn
static method vh
static method vmax
static method vmin
static method vw
attribute @@toStringTag
method constructor
interface CSSAnimation : Animation interface CSSAnimation : Animation
attribute @@toStringTag attribute @@toStringTag
getter animationName getter animationName
...@@ -11766,6 +11728,43 @@ interface webkitURL ...@@ -11766,6 +11728,43 @@ interface webkitURL
setter search setter search
setter username setter username
[NAMESPACES] [NAMESPACES]
namespace CSS
attribute @@toStringTag
getter animationWorklet
getter layoutWorklet
getter paintWorklet
method Hz
method Q
method ch
method cm
method deg
method dpcm
method dpi
method dppx
method em
method escape
method ex
method fr
method grad
method in
method kHz
method mm
method ms
method number
method pc
method percent
method pt
method px
method rad
method registerProperty
method rem
method s
method supports
method turn
method vh
method vmax
method vmin
method vw
[GLOBAL OBJECT] [GLOBAL OBJECT]
attribute GCController attribute GCController
attribute accessibilityController attribute accessibilityController
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment