Danbooru

CSS web font import in notes (translation formatting)

Posted under Bugs & Features

r0d3n7z said:

Any chance we could whitelist scoped <style> tags within notes? Would that do the trick?

@font-face does work in <style> elements, but <style> elements apply to the whole page. So a user could easily abuse <style> elements to restyle parts of the site not limited to the note which would be a security flaw.

r0d3n7z said:

Any chance we could whitelist scoped <style> tags within notes? Would that do the trick?

I just realized you said scoped <style> tags.

It still wouldn't work because @font-face doesn't work when the style tag is scoped (see this bug).

Even if that bug was fixed, scoped is only supported in Firefox. This means that the style tag would act not-scoped for all other browsers, bringing us back to the problem of it affecting the whole page instead of just the note.

1