Page MenuHomePhabricator

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

Description

Screen_Shot_2015-02-02_at_17.44.57.png (1×988 px, 143 KB)

Event Timeline

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.

@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.

screenshot.png (1×684 px, 224 KB)

			// 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 subscribed.

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 triaged this task as Medium priority.
Jdforrester-WMF moved this task from To Triage to FY 18-19 Q3/Q4 on the VisualEditor board.
Jdforrester-WMF set Security to None.