New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stop FOUC #326
Comments
So, there are a number of challenges:
My solution would be to only use the style module if document is running async. Otherwise, add the following to profile-w3c-common.js - using a MutationObserver, it watches for when the var sync = (document.currentScript && !document.currentScript.async) || false;
if(sync){
//if we have mutation observer support
if (window.MutationObserver && !window.respecConfig) {
var observer = new MutationObserver(function(mutation) {
if (window.respecConfig) {
observer.disconnect();
addStyle(window.respecConfig);
}
});
observer.observe(document.head, {
childList: true
});
} else if (window.respecConfig) {
addStyle(window.respecConfig);
}
}
//add the style - basically the same as w3c/style module
function addStyle(conf) {
...
} The other option is for Editors to just include a |
Since for some documents the initial load can take a very long time, I On Sat, Jul 26, 2014 at 11:59 PM, Marcos Caceres notifications@github.com
Shane McCarron |
I think that's a related but different problem. Ideally, we just want to On Sunday, July 27, 2014, Shane McCarron notifications@github.com wrote:
|
Fix(style): reduce ReSpec FOUC (relates to #326)
* 'develop' of github.com:w3c/respec: Fix(SpecHelper): remove isPhantom() dead code Feat(utils): map/reduce linkCSS() instead of jQuery Fix (SpecHelper): reduce dependece on jQuery Fix(style): reduce ReSpec FOUC (relates to #326)
* develop: v3.2.124 Fix(ui): close ui when doc is clicked (closes #772) Fix(base-runner): improve error reporting Fix(markdown): use Array.from instead of for/of loop Fix(headers-spec): should query doc, not document Fix(markdown-spec): should query doc, not document Feat(markdown): disable md linking via 'nolinks' class (closes #777) Chore(travis): Bump node version to 6.2 Chore(appveyor): Bump node version to 6.2 Feat(save-html): beautify HTML/XML output (closes #750) Feat(hightlight): use new highlighter (#767) Fix(SpecHelper): remove isPhantom() dead code Feat(utils): map/reduce linkCSS() instead of jQuery Fix (SpecHelper): reduce dependece on jQuery Fix(style): reduce ReSpec FOUC (relates to #326) Feat(utils): add makeOwnerSwapper() (#766) Fix(beautify-options): disable wrap_line_length, as it gets confused
Note to future @marcoscaceres: if you combine all the styles into a single element, and insert it into the document on end-all, that will reduce the number of style recalculations significantly. Also, you should not insert styles that are not needed (e.g., if there is not WebIDL in the spec, then don't include the WebIDL styles... dummy). If we can move more stuff to base.css, then that is also a huge win. |
FWIW if there are easy ways to just rely on what is ALREADY in base.css that would be a huge win too. In that we would have more consistency within and among specs. Right @fantasai ? |
Maybe we can get consistent notes, warnings, tables, etc. Those are the low hanging fruits.
|
* develop: v10.1.4 fix: Reduce FOUC (closes #326)
* develop: v10.1.5 Revert "fix: Reduce FOUC (closes #326)"
base.css intentionally doesn't include syntax highlighting rules. Definitely should be relying on it for styling tables, etc. -- anything documented in http://fantasai.inkedblade.net/style/design/w3c-restyle/2016/sample really. |
@fantasai, unrelated... but tables are still super broken :( |
* develop: v10.1.6 chore(package): update dependencies fix: Reduce FOUC (closes #326)
Adds support for two markers in close proximity.
when respec loads doc often there is a flash of unstyled content, would be nice if it did not occur
The text was updated successfully, but these errors were encountered: