- Open https://en.wikipedia.org/wiki/Barack_Obama?veaction=edit
- Click on a reference that uses a {{cite..}} template (most of them)
- Observe that the browser takes a few seconds to render the context item:
Description
Details
Related Objects
- Mentioned Here
- T330800: Re-duplicating TemplateStyles slows down rendering
Event Timeline
The time here is spent with recalculating styles, and experimenting this appears to be the TemplateStyles <style> tag. Stripping these style tags from the preview solves the performance issue.
I think the extra <style> tag is often unnecessary because the styles are already included in the main document.
There may be other places that are being slow because of this?
Change 893038 had a related patch set uploaded (by Esanders; author: Esanders):
[VisualEditor/VisualEditor@master] PreviewElement: Add a #beforeAppend method so nodes can be modified
Change 893039 had a related patch set uploaded (by Esanders; author: Esanders):
[mediawiki/extensions/VisualEditor@master] MWPreviewElement: Strip already-present TemplateStyles when building elements
Change 893038 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] PreviewElement: Add a #beforeAppend method so nodes can be modified
Change 897959 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (bcb501475)
Change 897959 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (bcb501475)
Change 893039 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] MWPreviewElement: Strip already-present TemplateStyles when building elements
It takes about a second or 2 now. That's an improvement but is the target here milliseconds?