https://bugzilla.wikimedia.org/show_bug.cgi?id=35815

Krinkle <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Krinkle <[email protected]> 2012-04-08 14:41:05 UTC ---
I understand your issue summary but the title is confusing. What do you mean by
applying styles server-side?

I've adjusted the summery:
> - ResourceLoader modules which define only CSS styles should be applied at 
> server-side.
> + ResourceLoader modules that style server output should be loadable without 
> javascript or FOUC[1]

To answer your question, if you see unstyled content while the page is loading,
use "position" => "top", to load it before the page content is loaded.

Although javascript disabled contexts are not fully supported, for modules that
only style server output (e.g. no styles that apply to content inserted or
manipulated by JavaScript), you can use $out->addModuleStyles() to instead load
the module as a <link> tag in the top.

Don't use the old addLink() link since that will not take advantage of load
optimalisation and doesn't cache properly (in that it might remain in user
cache after it has changed, and it won't remain long enough if it doesn't
change), ResourceLoader takes care of that with addModuleStyles().

Be careful not to use addModuleStyles() for modules that contain javascript
because if you later load the module again with addModules(), the style will be
loaded twice. If this situation occurs, separate your modules into a style-only
module for server output and another module with javascript and styling for the
dynamically generated content.

Assuming addModuleStyles() is the solution to your problem, I've marked this
report as INVALID since the bug in question is not a bug but was already
solved, the solution was just not documented enough for you to find it. If this
doesn't solve your problem, please feel free to re-open it.


[1] Flash of unstyled content

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to