Description
Description
Details
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
mw.Target: Add mw-body-content class before we attach surface | mediawiki/extensions/VisualEditor | master | +15 -13 |
Related Objects
Related Objects
Event Timeline
Comment Actions
@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 );
Comment Actions
Change 188295 had a related patch set uploaded (by Krinkle):
mw.Target: Add mw-body-content class before we attach surface
Comment Actions
Change 188295 merged by jenkins-bot:
mw.Target: Add mw-body-content class before we attach surface