jenkins-bot has submitted this change and it was merged. Change subject: mw.ViewPageTarget: Use .mw-body-content for content styling ......................................................................
mw.ViewPageTarget: Use .mw-body-content for content styling * font-size and line-height differed between read mode and edit mode. This makes them match by using the same css class as MediaWiki core uses for the body content. Depends on I66c56c57 in MediaWiki core. * Document padding / margin hack on surface, and sync the values. In edit mode, the text was being nudged to the right by a few pixels. * Bump the wfUseMw call as this is a symptom of how VisualEditor now depends on MediaWiki 1.23. Bug: 64599 Change-Id: I5818dce626545c4cbc8bd84fd551dc08baedbe32 --- M VisualEditor.hooks.php M modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-vector.css M modules/ve-mw/init/ve.init.mw.Target.js 3 files changed, 12 insertions(+), 3 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php index bf5bd7a..790daae 100644 --- a/VisualEditor.hooks.php +++ b/VisualEditor.hooks.php @@ -20,7 +20,7 @@ // parties who attempt to install VisualEditor onto non-alpha wikis, as // this should have no impact on deploying to Wikimedia's wiki cluster. // Is fine for release tarballs because 1.22wmf11 < 1.22alpha < 1.22.0. - wfUseMW( '1.22' ); + wfUseMW( '1.23' ); // Add tab messages to the init init module foreach ( $wgVisualEditorTabMessages as $msg ) { diff --git a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-vector.css b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-vector.css index 6668d61..b236fe9 100644 --- a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-vector.css +++ b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-vector.css @@ -6,12 +6,20 @@ */ .ve-init-mw-viewPageTarget-surface { + /* + In order to allow placing the text cursor to the start or end of the text by + clicking in the margin area, we expand the outer boundary of the surface + outside the parent container using negative margin. Then we shrink the visible + rendering by applying inner padding. The end result is that the content is + the same width as in read mode, except with the padding around it now being + part of it instead of its parent, thus making it treat the area as part + of content editable. + */ margin: 0.8em -1.5em 0 -1.5em; } .ve-init-mw-viewPageTarget-surface .ve-ce-documentNode { - font-size: 0.8em; - padding: 0 1.875em; /* 1.5/0.8 */ + padding: 0 1.5em; } .ve-init-mw-viewPageTarget-surface .oo-ui-menuWidget { diff --git a/modules/ve-mw/init/ve.init.mw.Target.js b/modules/ve-mw/init/ve.init.mw.Target.js index 647f1e6..941db9a 100644 --- a/modules/ve-mw/init/ve.init.mw.Target.js +++ b/modules/ve-mw/init/ve.init.mw.Target.js @@ -1315,6 +1315,7 @@ setTimeout( function () { // Initialize surface target.surface.getContext().hide(); + target.surface.$element.addClass( 'mw-body-content' ); target.$document = target.surface.$element.find( '.ve-ce-documentNode' ); target.$element.append( target.surface.$element ); target.setUpToolbar(); -- To view, visit https://gerrit.wikimedia.org/r/130507 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5818dce626545c4cbc8bd84fd551dc08baedbe32 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: wmf/1.24wmf2 Gerrit-Owner: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits