@@ -1030,77 +1030,73 @@ describe('The Styles pane', () => {
10301030 assert . deepEqual ( inspectedRulesBefore , expectedInspectedRulesBefore ) ;
10311031 } ) ;
10321032
1033- // Fails on Mac-arm64
1034- it . skipOnPlatforms (
1035- [ 'mac' ] ,
1036- '[crbug.com/362505638]:(shows styles from injected user stylesheets for a injected iframe (ported layout test)' ,
1037- async ( ) => {
1038- const { target} = getBrowserAndPages ( ) ;
1039- await goToResourceAndWaitForStyleSection ( 'elements/css-inject-stylesheet.html' ) ;
1040- await prepareElementsTab ( ) ;
1041-
1042- await target . evaluate ( async ( ) => {
1043- const iframe = document . createElement ( 'iframe' ) ;
1044- iframe . src = 'css-inject-stylesheet-iframe-data.html' ;
1045- document . getElementById ( 'main' ) ?. appendChild ( iframe ) ;
1046- } ) ;
1047-
1048- await expandSelectedNodeRecursively ( ) ;
1049- await target . evaluate ( async ( ) => {
1050- const iframe = document . querySelector ( 'iframe' ) ;
1051- if ( ! iframe ?. contentDocument ) {
1052- return ;
1053- }
1054- const style = iframe . contentDocument . createElement ( 'style' ) ;
1055- style . textContent = '#iframeBody { background: red }' ;
1056- iframe . contentDocument . head . append ( style ) ;
1057- } ) ;
1058-
1059- await waitForAndClickTreeElementWithPartialText ( 'id=\u200B"iframeBody"' ) ;
1060- await waitForStyleRule ( '#iframeBody' ) ;
1061- const inspectedRulesAfter = await getDisplayedStyleRulesCompact ( ) ;
1062- const expectedInspectedRulesAfter = [
1063- {
1064- selectorText : 'element.style' ,
1065- propertyNames : [ ] ,
1066- } ,
1067- {
1068- selectorText : '#iframeBody' ,
1069- propertyNames : [
1070- 'background' ,
1071- 'background-image' ,
1072- 'background-position-x' ,
1073- 'background-position-y' ,
1074- 'background-size' ,
1075- 'background-repeat' ,
1076- 'background-attachment' ,
1077- 'background-origin' ,
1078- 'background-clip' ,
1079- 'background-color' ,
1080- ] ,
1081- } ,
1082- {
1083- selectorText : 'body' ,
1084- propertyNames : [
1085- 'background' ,
1086- 'background-image' ,
1087- 'background-position-x' ,
1088- 'background-position-y' ,
1089- 'background-size' ,
1090- 'background-repeat' ,
1091- 'background-attachment' ,
1092- 'background-origin' ,
1093- 'background-clip' ,
1094- 'background-color' ,
1095- ] ,
1096- } ,
1097- {
1098- selectorText : 'body' ,
1099- propertyNames : [ 'display' , 'margin' , 'margin-top' , 'margin-right' , 'margin-bottom' , 'margin-left' ] ,
1100- } ,
1101- ] ;
1102- assert . deepEqual ( inspectedRulesAfter , expectedInspectedRulesAfter ) ;
1103- } ) ;
1033+ it ( 'shows styles from injected user stylesheets for a injected iframe (ported layout test)' , async ( ) => {
1034+ const { target} = getBrowserAndPages ( ) ;
1035+ await goToResourceAndWaitForStyleSection ( 'elements/css-inject-stylesheet.html' ) ;
1036+ await prepareElementsTab ( ) ;
1037+
1038+ await target . evaluate ( async ( ) => {
1039+ const iframe = document . createElement ( 'iframe' ) ;
1040+ iframe . src = 'css-inject-stylesheet-iframe-data.html' ;
1041+ document . getElementById ( 'main' ) ?. appendChild ( iframe ) ;
1042+ } ) ;
1043+
1044+ await expandSelectedNodeRecursively ( ) ;
1045+ await target . evaluate ( async ( ) => {
1046+ const iframe = document . querySelector ( 'iframe' ) ;
1047+ if ( ! iframe ?. contentDocument ) {
1048+ return ;
1049+ }
1050+ const style = iframe . contentDocument . createElement ( 'style' ) ;
1051+ style . textContent = '#iframeBody { background: red }' ;
1052+ iframe . contentDocument . head . append ( style ) ;
1053+ } ) ;
1054+
1055+ await waitForAndClickTreeElementWithPartialText ( 'id=\u200B"iframeBody"' ) ;
1056+ await waitForStyleRule ( '#iframeBody' ) ;
1057+ const inspectedRulesAfter = await getDisplayedStyleRulesCompact ( ) ;
1058+ const expectedInspectedRulesAfter = [
1059+ {
1060+ selectorText : 'element.style' ,
1061+ propertyNames : [ ] ,
1062+ } ,
1063+ {
1064+ selectorText : '#iframeBody' ,
1065+ propertyNames : [
1066+ 'background' ,
1067+ 'background-image' ,
1068+ 'background-position-x' ,
1069+ 'background-position-y' ,
1070+ 'background-size' ,
1071+ 'background-repeat' ,
1072+ 'background-attachment' ,
1073+ 'background-origin' ,
1074+ 'background-clip' ,
1075+ 'background-color' ,
1076+ ] ,
1077+ } ,
1078+ {
1079+ selectorText : 'body' ,
1080+ propertyNames : [
1081+ 'background' ,
1082+ 'background-image' ,
1083+ 'background-position-x' ,
1084+ 'background-position-y' ,
1085+ 'background-size' ,
1086+ 'background-repeat' ,
1087+ 'background-attachment' ,
1088+ 'background-origin' ,
1089+ 'background-clip' ,
1090+ 'background-color' ,
1091+ ] ,
1092+ } ,
1093+ {
1094+ selectorText : 'body' ,
1095+ propertyNames : [ 'display' , 'margin' , 'margin-top' , 'margin-right' , 'margin-bottom' , 'margin-left' ] ,
1096+ } ,
1097+ ] ;
1098+ assert . deepEqual ( inspectedRulesAfter , expectedInspectedRulesAfter ) ;
1099+ } ) ;
11041100
11051101 it ( 'can parse webkit css region styling (ported layout test)' , async ( ) => {
11061102 await goToResourceAndWaitForStyleSection ( 'elements/css-webkit-region.html' ) ;
0 commit comments