Page MenuHomePhabricator

[Regression] mw.loader.addEmbeddedCSS causes repaints when changing stylesheets
Closed, ResolvedPublic

Description

By default we should always create a new <style> tag.

Appending text to a <style> tag means the contents have to be re-parsed.

Not by the DOM, but for the stylesheet, since the CSS parser can't continue after it ended (it could be left it an open bracket state etc.)

As a result, the browser may have to do various re-paints which are a significant slowdown.

We originally did this "right", but to address the IE stylesheet limit (bug 31676) we changed it to appending text nodes. We should change it back to the right way and only do this hack for IE <= 9.

Modern browsers shouldn't suffer from it.


Version: 1.18.x
Severity: major

Details

Reference
bz45810

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:24 AM
bzimport set Reference to bz45810.

content hidden as private in Bugzilla

content hidden as private in Bugzilla

Addressed by these 2 changes:

  • Create new style tags I52252e699a518dc1c1327ee598a9e023cc2555e2
  • Buffer cssText I430fba9998b133a85dd3ac38237dc44b38630a9c

(In reply to comment #3 by Krinkle)

Addressed by these 2 changes:

Both patches have been committed - is anything else needed here to resolve this bug report as FIXED?

(In reply to comment #4)

(In reply to comment #3 by Krinkle)

Addressed by these 2 changes:

Both patches have been committed - is anything else needed here to resolve
this bug report as FIXED?

Waiting for them to be deployed on the cluster for final confirmation when it plays together with extensions, one a big Wikipedia article and on a mobile device.

According to Paul Irish this has made a big improvement.