mediawiki-extensions-Visual.../modules/ve-mw/init/styles
Timo Tijhof 7dae6496b3 mw.ViewPageTarget: Get rid of FOUC on edit section brackets
We don't have a FOUC on the appearing of the 'edit' link. That
one is handled quite intelligently:
* Via the stylesheet that is also loaded in noscript mode, its
  (hidden) appearance is already predetermined. So as soon as
  those elements are seen by the browser they style correctly
  for users without JavaScript (display: none).
* This same stylesheet also hides it for users with JavaScript
  but where VE is not available (e.g. due to browser support).
  While ve-not-available is added very early on (before
  document ready), it could in theory cause a short FOUC, but
  that's okay. We simply don't know that VE isn't supported
  until then. We optimise for the common case (JavaScript
  enabled, VE available), while still ensuring that it is
  always hidden in noscript, and is hidden as soon as possible
  when VE turns out not to be available.

For some reason, one small detail (the little bit of whitespace
added inside the brackets), was left out of this and was
implemented by adding the class 'mw-editsection-expanded' to them
from a document ready handler.

* First step, get rid of the script that adds this class and
  use ve-available instead. That means they're styled
  correctly much earlier (we add the class to <html> before
  document ready). This can still cause a brief FOUC, though
  in most cases they're correct from the start.

* Step two, make brackets expand by default for script users,
  and let ve-not-available reset it. This way, like with edit tabs,
  a FOUC will never happen for ve-available. And even for
  ve-not-available, a FOUC is rare since we add it before
  document ready via <html> look-ahead styling.

There was still a brief reflow jump because of negative margins
between two paint events. One was undoing the other at a later
time. These negative margins are a remnant of when we were doing
animations (follows-up I4b9c47fd65a70). They were added to reduce
reflows and content shift, but were now actually causing them.

Removed "padding-right" from mw-editsection, and negative margin
from the brackets.

Also:

* Don't add inline 'style="direction: ltr;"' on every single
  editsection throughout the DOM. This was the only operation we
  were doing unconditionally. While I doubt the need of it in
  general, we can at least allow MediaWiki to do it right, and
  only add the override if needed. This saves quite a few DOM
  operations.

Change-Id: I7a729edc2cd4a66ebc0ad6935ffd02cb9b948bff
2014-05-09 12:20:24 +02:00
..
images Reverse the progress image for RTL 2013-08-22 23:46:59 +03:00
ve.init.mw.MobileViewTarget.css Update VE core submodule to master (520299e) 2014-03-14 13:13:02 -07:00
ve.init.mw.ViewPageTarget-apex.css Revert "Converting ViewPageTarget CSS files to LESS" 2014-02-20 22:55:49 +00:00
ve.init.mw.ViewPageTarget-monobook.css Revert "Converting ViewPageTarget CSS files to LESS" 2014-02-20 22:55:49 +00:00
ve.init.mw.ViewPageTarget-shared.css Deal with 'none'/'border' and default size in media edit 2014-03-05 03:53:46 +00:00
ve.init.mw.ViewPageTarget-vector-hd.css Show the debug bar in MW if ve.debug is set 2014-04-02 17:33:29 -07:00
ve.init.mw.ViewPageTarget-vector.css mw.ViewPageTarget: Move .mw-body-content down to .ve-ce-surface 2014-04-30 21:09:54 +00:00
ve.init.mw.ViewPageTarget.css Use new OOUI pending feature rather than loading bar thing on save dialog 2014-04-18 21:57:14 +01:00
ve.init.mw.ViewPageTarget.Icons-raster.css Revert "Converting ViewPageTarget CSS files to LESS" 2014-02-20 22:55:49 +00:00
ve.init.mw.ViewPageTarget.Icons-vector.css Revert "Converting ViewPageTarget CSS files to LESS" 2014-02-20 22:55:49 +00:00
ve.init.mw.ViewPageTarget.init.css mw.ViewPageTarget: Get rid of FOUC on edit section brackets 2014-05-09 12:20:24 +02:00
ve.init.mw.ViewPageTarget.noscript.css mw.ViewPageTarget: Get rid of FOUC on edit section brackets 2014-05-09 12:20:24 +02:00