forked from mirrors/gecko-dev
		
	Backed out changeset 0cf3688e2bcf (bug 1879286) for causing mochitest failures at layout/inspector/tests/test_getRegisteredCustomProperties.html CLOSED TREE
This commit is contained in:
		
							parent
							
								
									87ec8b723e
								
							
						
					
					
						commit
						032ee988a6
					
				
					 7 changed files with 28 additions and 70 deletions
				
			
		|  | @ -156,9 +156,6 @@ dictionary InspectorCSSPropertyDefinition { | |||
|   required boolean inherits; | ||||
|   required UTF8String? initialValue; | ||||
|   required boolean fromJS; | ||||
|   required unsigned long line; | ||||
|   required unsigned long column; | ||||
|   required DOMString uri; | ||||
| }; | ||||
| 
 | ||||
| [Func="nsContentUtils::IsCallerChromeOrFuzzingEnabled", | ||||
|  |  | |||
|  | @ -898,11 +898,6 @@ void InspectorUtils::GetCSSRegisteredProperties( | |||
|       property.mInitialValue.SetIsVoid(true); | ||||
|     } | ||||
|     property.mFromJS = propDef.from_js; | ||||
| 
 | ||||
|     NS_MakeAbsoluteURI(property.mUri, property.mUri, | ||||
|                        propDef.url_data->BaseURI()); | ||||
|     property.mLine = propDef.line; | ||||
|     property.mColumn = propDef.column; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,4 +0,0 @@ | |||
| @property --color-2 { | ||||
|     syntax: "*"; | ||||
|     inherits: false; | ||||
| } | ||||
|  | @ -1,12 +0,0 @@ | |||
| CSS.registerProperty({ | ||||
|   name: "--length-3", | ||||
|   syntax: "*", | ||||
|   inherits: false, | ||||
| }); | ||||
| 
 | ||||
| CSS.registerProperty({ | ||||
|   name: "--length-4", | ||||
|   syntax: "*", | ||||
|   initialValue: "", | ||||
|   inherits: false, | ||||
| }); | ||||
|  | @ -6,11 +6,9 @@ prefs = [ | |||
|   "dom.customHighlightAPI.enabled=true", | ||||
| ] | ||||
| support-files = [ | ||||
|   "at_property.css", | ||||
|   "bug1202095.css", | ||||
|   "bug1202095-2.css", | ||||
|   "bug856317.css", | ||||
|   "css_register_property.js", | ||||
|   "file_bug522601.html", | ||||
| ] | ||||
| 
 | ||||
|  |  | |||
|  | @ -4,29 +4,17 @@ | |||
|   <title>Test InspectorUtils.getCSSRegisteredProperties</title> | ||||
|   <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="at_property.css"/> | ||||
|   <style> | ||||
|     @property --color-1 { | ||||
|       syntax: "<color>"; | ||||
|       inherits: true; | ||||
|       initial-value: blue; | ||||
|     } | ||||
|     @property --color-2 { | ||||
|       syntax: "*"; | ||||
|       inherits: false; | ||||
|     } | ||||
|   </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> | ||||
| <body> | ||||
| <code>InspectorUtils.getCSSRegisteredProperties</code> | ||||
|  | @ -41,15 +29,35 @@ const { Assert } = SpecialPowers.ChromeUtils.importESModule( | |||
| ); | ||||
| 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. | ||||
| // We get a Proxy, so build another array to properly sort it. | ||||
| const results = Array.from(InspectorUtils.getCSSRegisteredProperties(document)); | ||||
| 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( | ||||
|   results, | ||||
|   [{ | ||||
|  | @ -58,54 +66,36 @@ Assert.deepEqual( | |||
|     inherits: true, | ||||
|     initialValue: "blue", | ||||
|     fromJS: false, | ||||
|     uri :TEST_URL, | ||||
|     line: 1, | ||||
|     column: 5, | ||||
|   },{ | ||||
|     name: "--color-2", | ||||
|     syntax: "*", | ||||
|     inherits: false, | ||||
|     initialValue: null, | ||||
|     fromJS: false, | ||||
|     uri :CSS_TEST_FILE_URL, | ||||
|     line: 0, | ||||
|     column: 1, | ||||
|   },{ | ||||
|     name: "--length-1", | ||||
|     syntax: "<length>", | ||||
|     inherits: true, | ||||
|     initialValue: "10px", | ||||
|     fromJS: true, | ||||
|     uri :TEST_URL, | ||||
|     line: 0, | ||||
|     column: 0, | ||||
|   }, { | ||||
|     name: "--length-2", | ||||
|     syntax: "foo | <integer>+ | <percentage> | <length># | auto", | ||||
|     inherits: true, | ||||
|     initialValue: "100vw", | ||||
|     fromJS: true, | ||||
|     uri :TEST_URL, | ||||
|     line: 0, | ||||
|     column: 0, | ||||
|   }, { | ||||
|     name: "--length-3", | ||||
|     syntax: "*", | ||||
|     inherits: false, | ||||
|     initialValue: null, | ||||
|     fromJS: true, | ||||
|     uri :TEST_URL, | ||||
|     line: 0, | ||||
|     column: 0, | ||||
|   }, { | ||||
|     name: "--length-4", | ||||
|     syntax: "*", | ||||
|     inherits: false, | ||||
|     initialValue: "", | ||||
|     fromJS: true, | ||||
|     uri :TEST_URL, | ||||
|     line: 0, | ||||
|     column: 0, | ||||
|   }], | ||||
|   `Got registered CSS properties` | ||||
| ); | ||||
|  |  | |||
|  | @ -8837,9 +8837,6 @@ pub struct PropDef { | |||
|     pub initial_value: nsCString, | ||||
|     // True if the property was set with CSS.registerProperty
 | ||||
|     pub from_js: bool, | ||||
|     pub url_data: *mut URLExtraData, | ||||
|     pub line: u32, | ||||
|     pub column: u32, | ||||
| } | ||||
| 
 | ||||
| impl PropDef { | ||||
|  | @ -8865,9 +8862,6 @@ impl PropDef { | |||
|             has_initial_value: property_registration.data.initial_value.is_some(), | ||||
|             initial_value, | ||||
|             from_js, | ||||
|             url_data: property_registration.url_data.ptr(), | ||||
|             line: property_registration.source_location.line, | ||||
|             column: property_registration.source_location.column, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Sandor Molnar
						Sandor Molnar