Page MenuHomePhabricator

Lots of time spent animating CSS properties of slugs
Closed, ResolvedPublic1 Estimated Story Points

Description

Event Timeline

ori created this task.Feb 3 2015, 1:45 AM
ori raised the priority of this task from to Needs Triage.
ori updated the task description. (Show Details)
ori added subscribers: Krinkle, Catrope, ori, Aklapper.
Krinkle claimed this task.Feb 3 2015, 4:23 AM

@Catrope and I spent some more time debugging this and we verified that none of the slug-related elements or classes are changed throughout the loading process. The styles are specified at once (and ahead of time) and the elements are created at once and inserted atomically.

The culprit is in the styles using em-values for the font-size and margin:

.ve-ce-branchNode-blockSlugWrapper-unfocused .ve-ce-branchNode-blockSlug,
.ve-ce-branchNode-blockSlugWrapper-former-unfocused p {
	font-size: 0.8em;
	margin: 0.2em 0;
}

The em reference is being changed by a cascading class. Namely, mw-body-content is added after the content is attach to the document.

			// Create ui.Surface (also creates ce.Surface and dm.Surface and builds CE tree)
			var surface = target.addSurface( dmDoc );
			surface.$element
				.addClass( 've-init-mw-viewPageTarget-surface' )
				.addClass( target.protectedClasses )
				.appendTo( target.$element );
			target.setSurface( surface );

			setTimeout( function () {
				var surfaceView = surface.getView(),
					$documentNode = surfaceView.getDocument().getDocumentNode().$element;

				// ..

				surfaceView.$element.addClass( 'mw-body-content' );
				$documentNode.addClass(
					// Add appropriately mw-content-ltr or mw-content-rtl class
					'mw-content-' + mw.config.get( 'wgVisualEditor' ).pageLanguageDir
				);
gerritbot added a subscriber: gerritbot.

Change 188295 had a related patch set uploaded (by Krinkle):
mw.Target: Add mw-body-content class before we attach surface

https://gerrit.wikimedia.org/r/188295

Patch-For-Review

Change 188295 merged by jenkins-bot:
mw.Target: Add mw-body-content class before we attach surface

https://gerrit.wikimedia.org/r/188295

Jdforrester-WMF closed this task as Resolved.Feb 3 2015, 4:32 PM
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF moved this task from To Triage to Q4 on the VisualEditor board.
Jdforrester-WMF set Security to None.
ori moved this task from Backlog to Done on the VisualEditor-Performance board.Feb 19 2015, 2:28 AM