📜 ⬆️ ⬇️

WebKit and expression

Yes, this is not a typo! Suddenly found that the design:

.myclass {behavior:expression((function(){})(this))}

WebKit (Chrome, Safari) is read by browsers and the browser does not perceive styles after it and, accordingly, does not apply. It was empirically established that the problem in this construction is in the characters "{" and "}, which together cause some metamorphosis in browsers. And if you remove the "{", then the bug disappears, and if "}", then it remains. Naturally, the presence of ";" at the end of the rule, the type of the selector (that is, even if it is a selector for an IE, like * html [selector]), the type of the rule (for example, the preceding rule "//" or "_") does NOT correct the situation, otherwise it would not too scary!

Especially the knowledge of this bug is useful for people who like to merge all styles into one file, without putting styles for IE into a separate file, instead using star-hack and others like it! In any case, if you treat those who do not make styles for Internet Explorer in a separate file, write at least the expressions at the end of the file, otherwise you will look for the cause of problems for a long time!

')

Source: https://habr.com/ru/post/74565/


All Articles