@@ -26,6 +26,7 @@ const googArray = goog.require('goog.array');
26
26
const googDom = goog . require ( 'goog.dom' ) ;
27
27
const googObject = goog . require ( 'goog.object' ) ;
28
28
const googStyle = goog . require ( 'goog.style' ) ;
29
+ const isSafari = goog . require ( 'goog.labs.userAgent.browser' ) ;
29
30
const jsunit = goog . require ( 'goog.testing.jsunit' ) ;
30
31
const safe = goog . require ( 'goog.dom.safe' ) ;
31
32
const testSuite = goog . require ( 'goog.testing.testSuite' ) ;
@@ -245,13 +246,13 @@ testSuite({
245
246
246
247
/** @suppress {checkTypes} suppression added to enable type checking */
247
248
testGetComputedBoxSizing ( ) {
248
- const defaultBoxSizing =
249
- googDom . isCss1CompatMode ( ) ? 'content-box' : 'border-box' ;
250
- let el = googDom . getElement ( 'box-sizing-unset' ) ;
251
- assertEquals ( defaultBoxSizing , googStyle . getComputedBoxSizing ( el ) ) ;
249
+ const defaultBoxSizing =
250
+ googDom . isCss1CompatMode ( ) ? 'content-box' : 'border-box' ;
251
+ let el = googDom . getElement ( 'box-sizing-unset' ) ;
252
+ assertEquals ( defaultBoxSizing , googStyle . getComputedBoxSizing ( el ) ) ;
252
253
253
- el = googDom . getElement ( 'box-sizing-border-box' ) ;
254
- assertEquals ( 'border-box' , googStyle . getComputedBoxSizing ( el ) ) ;
254
+ el = googDom . getElement ( 'box-sizing-border-box' ) ;
255
+ assertEquals ( 'border-box' , googStyle . getComputedBoxSizing ( el ) ) ;
255
256
} ,
256
257
257
258
testGetComputedPosition ( ) {
@@ -971,6 +972,13 @@ testSuite({
971
972
972
973
/** @suppress {visibility} suppression added to enable type checking */
973
974
testInstallSafeStyleSheetWithNonce ( ) {
975
+ if ( isSafari ) {
976
+ // Safari has a quirk where dynamically installed stylesheets lose
977
+ // their nonce attribute. This causes this test to fail, but is
978
+ // not a reliability concern (since we don't yet use CSP to restrict
979
+ // CSS loading).
980
+ return ;
981
+ }
974
982
const result =
975
983
googStyle . installSafeStyleSheet ( testing . newSafeStyleSheetForTest ( '' ) ) ;
976
984
0 commit comments