Backed out changeset 0cf3688e2bcf (bug 1879286) for causing mochitest failures at layout/inspector/tests/test_getRegisteredCustomProperties.html CLOSED TREE

This commit is contained in:
Sandor Molnar 2024-02-08 18:49:48 +02:00
parent 87ec8b723e
commit 032ee988a6
7 changed files with 28 additions and 70 deletions

View file

@ -156,9 +156,6 @@ dictionary InspectorCSSPropertyDefinition {
required boolean inherits; required boolean inherits;
required UTF8String? initialValue; required UTF8String? initialValue;
required boolean fromJS; required boolean fromJS;
required unsigned long line;
required unsigned long column;
required DOMString uri;
}; };
[Func="nsContentUtils::IsCallerChromeOrFuzzingEnabled", [Func="nsContentUtils::IsCallerChromeOrFuzzingEnabled",

View file

@ -898,11 +898,6 @@ void InspectorUtils::GetCSSRegisteredProperties(
property.mInitialValue.SetIsVoid(true); property.mInitialValue.SetIsVoid(true);
} }
property.mFromJS = propDef.from_js; property.mFromJS = propDef.from_js;
NS_MakeAbsoluteURI(property.mUri, property.mUri,
propDef.url_data->BaseURI());
property.mLine = propDef.line;
property.mColumn = propDef.column;
} }
} }

View file

@ -1,4 +0,0 @@
@property --color-2 {
syntax: "*";
inherits: false;
}

View file

@ -1,12 +0,0 @@
CSS.registerProperty({
name: "--length-3",
syntax: "*",
inherits: false,
});
CSS.registerProperty({
name: "--length-4",
syntax: "*",
initialValue: "",
inherits: false,
});

View file

@ -6,11 +6,9 @@ prefs = [
"dom.customHighlightAPI.enabled=true", "dom.customHighlightAPI.enabled=true",
] ]
support-files = [ support-files = [
"at_property.css",
"bug1202095.css", "bug1202095.css",
"bug1202095-2.css", "bug1202095-2.css",
"bug856317.css", "bug856317.css",
"css_register_property.js",
"file_bug522601.html", "file_bug522601.html",
] ]

View file

@ -4,29 +4,17 @@
<title>Test InspectorUtils.getCSSRegisteredProperties</title> <title>Test InspectorUtils.getCSSRegisteredProperties</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script> <script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<link rel="stylesheet" type="text/css" href="at_property.css"/>
<style> <style>
@property --color-1 { @property --color-1 {
syntax: "<color>"; syntax: "<color>";
inherits: true; inherits: true;
initial-value: blue; initial-value: blue;
} }
@property --color-2 {
syntax: "*";
inherits: false;
}
</style> </style>
<script>
CSS.registerProperty({
name: "--length-1",
syntax: "<length>",
initialValue: "10px",
inherits: true,
});
CSS.registerProperty({
name: "--length-2",
syntax: "foo | <integer>+ | <percentage> | <length># | auto",
initialValue: "100vw",
inherits: true
});
</script>
<script src="css_register_property.js"></script>
</head> </head>
<body> <body>
<code>InspectorUtils.getCSSRegisteredProperties</code> <code>InspectorUtils.getCSSRegisteredProperties</code>
@ -41,15 +29,35 @@ const { Assert } = SpecialPowers.ChromeUtils.importESModule(
); );
const InspectorUtils = SpecialPowers.InspectorUtils; const InspectorUtils = SpecialPowers.InspectorUtils;
CSS.registerProperty({
name: "--length-1",
syntax: "<length>",
initialValue: "10px",
inherits: true,
});
CSS.registerProperty({
name: "--length-2",
syntax: "foo | <integer>+ | <percentage> | <length># | auto",
initialValue: "100vw",
inherits: true
});
CSS.registerProperty({
name: "--length-3",
syntax: "*",
inherits: false
});
CSS.registerProperty({
name: "--length-4",
syntax: "*",
initialValue: "",
inherits: false
});
// The order isn't guaranteed, so sort variable by their name. // The order isn't guaranteed, so sort variable by their name.
// We get a Proxy, so build another array to properly sort it. // We get a Proxy, so build another array to properly sort it.
const results = Array.from(InspectorUtils.getCSSRegisteredProperties(document)); const results = Array.from(InspectorUtils.getCSSRegisteredProperties(document));
results.sort((a,b) => a.name < b.name ? -1 : 1) results.sort((a,b) => a.name < b.name ? -1 : 1)
const TEST_FOLDER = "http://mochi.test:8888/tests/layout/inspector/tests/";
const TEST_URL = TEST_FOLDER + "test_getRegisteredCustomProperties.html";
const CSS_TEST_FILE_URL = TEST_FOLDER + "at_property.css";
Assert.deepEqual( Assert.deepEqual(
results, results,
[{ [{
@ -58,54 +66,36 @@ Assert.deepEqual(
inherits: true, inherits: true,
initialValue: "blue", initialValue: "blue",
fromJS: false, fromJS: false,
uri :TEST_URL,
line: 1,
column: 5,
},{ },{
name: "--color-2", name: "--color-2",
syntax: "*", syntax: "*",
inherits: false, inherits: false,
initialValue: null, initialValue: null,
fromJS: false, fromJS: false,
uri :CSS_TEST_FILE_URL,
line: 0,
column: 1,
},{ },{
name: "--length-1", name: "--length-1",
syntax: "<length>", syntax: "<length>",
inherits: true, inherits: true,
initialValue: "10px", initialValue: "10px",
fromJS: true, fromJS: true,
uri :TEST_URL,
line: 0,
column: 0,
}, { }, {
name: "--length-2", name: "--length-2",
syntax: "foo | <integer>+ | <percentage> | <length># | auto", syntax: "foo | <integer>+ | <percentage> | <length># | auto",
inherits: true, inherits: true,
initialValue: "100vw", initialValue: "100vw",
fromJS: true, fromJS: true,
uri :TEST_URL,
line: 0,
column: 0,
}, { }, {
name: "--length-3", name: "--length-3",
syntax: "*", syntax: "*",
inherits: false, inherits: false,
initialValue: null, initialValue: null,
fromJS: true, fromJS: true,
uri :TEST_URL,
line: 0,
column: 0,
}, { }, {
name: "--length-4", name: "--length-4",
syntax: "*", syntax: "*",
inherits: false, inherits: false,
initialValue: "", initialValue: "",
fromJS: true, fromJS: true,
uri :TEST_URL,
line: 0,
column: 0,
}], }],
`Got registered CSS properties` `Got registered CSS properties`
); );

View file

@ -8837,9 +8837,6 @@ pub struct PropDef {
pub initial_value: nsCString, pub initial_value: nsCString,
// True if the property was set with CSS.registerProperty // True if the property was set with CSS.registerProperty
pub from_js: bool, pub from_js: bool,
pub url_data: *mut URLExtraData,
pub line: u32,
pub column: u32,
} }
impl PropDef { impl PropDef {
@ -8865,9 +8862,6 @@ impl PropDef {
has_initial_value: property_registration.data.initial_value.is_some(), has_initial_value: property_registration.data.initial_value.is_some(),
initial_value, initial_value,
from_js, from_js,
url_data: property_registration.url_data.ptr(),
line: property_registration.source_location.line,
column: property_registration.source_location.column,
} }
} }
} }