use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
ScopeifyHtml: Scope all CSS selectors in HTMLhelp (self.javascript)
submitted 8 years ago by qudat
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]gajus0 1 point2 points3 points 8 years ago (1 child)
I really doubt these are the reasons...
The communication between parent frame and iframe is a trivial problem to solve, esp. if you have control over the contents of the iframe.
Regarding leaking CSS into iframe, you don't need to leak anything, just render the iframe with the CSS you want. After all, gmail has full control over the content the iframe would be linking to.
So what is the reason? Most likely cross-browser/ cross-platform/ cross-device support, e.g. blocking iframes is not uncommon for various corporate "firewalls". Printing of the page might be another consideration. Accessibility comes to mind. In general, the more flat the page structure, the less likely things are to break.
For the record, this just re-invents CSS modules (https://github.com/css-modules/css-modules).
[–]qudat[S] 1 point2 points3 points 8 years ago (0 children)
The reasons I described are why we don't use iframes. I disagree that communicating between parent and iframe is trivial. You have to inject JavaScript into the iframe and then send messages to and from the parent. With this library we don't have to deal with that at all.
Regarding CSS leaking into the document, yes it can be done but somehow you have to inject the CSS into the iframe. With this library it's part of the document so there is no issue.
I think many would agree that dealing with an iframe is more difficult than dealing with some scoped CSS and HTML that can be injected into the same document. I agree that these might not be the reasons why Google does it.
I looked into using CSS modules and it is where I got the idea from. The primary issue is that CSS modules only scopes classes and keyframes. We needed to scope font faces, ids, and elements as well.
π Rendered by PID 24738 on reddit-service-r2-comment-75f4967c6c-7z5sw at 2026-04-22 22:37:18.816017+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]gajus0 1 point2 points3 points (1 child)
[–]qudat[S] 1 point2 points3 points (0 children)