Skip to content

Commit 57bf957

Browse files
committed
Image and iframe are ok to have explicit height / width
During initial rendering, having explicit height and width attributes for iframes or images allow for them to take up rendered space before styling can be applied. Whitelist those from the check for inline height / width attributes (most other elements should probably add these values to the CSS).
1 parent 1286864 commit 57bf957

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎debugCSS.css‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ table[bgcolor]:after,
5656
table[border]:after,
5757
table[cellpadding]:after,
5858
table[cellspacing]:after,
59-
*[width]:after, /* Acceptable for transitional doctypes, but should probably be relegated to CSS */
60-
*[height]:after,
59+
*:not(img):not(iframe)[width]:after, /* Acceptable for transitional doctypes, but should probably be relegated to CSS */
60+
*:not(img):not(iframe)[height]:after,
6161
*[border]:after,
6262
div:empty:after,
6363
span:empty:after,
@@ -350,8 +350,8 @@ table[bgcolor]:after,
350350
table[border]:after,
351351
table[cellpadding]:after,
352352
table[cellspacing]:after,
353-
*[width]:after,
354-
*[height]:after,
353+
*:not(img):not(iframe)[width]:after,
354+
*:not(img):not(iframe)[height]:after,
355355
*[border]:after {
356356
background: #FFFF88;
357357
content: 'Element has inline style';
@@ -700,8 +700,8 @@ table[bgcolor],
700700
table[border],
701701
table[cellpadding],
702702
table[cellspacing],
703-
*[width],
704-
*[height],
703+
*:not(img):not(iframe)[width],
704+
*:not(img):not(iframe)[height],
705705
*[border],
706706
div:empty:after,
707707
span:empty,

0 commit comments

Comments
 (0)