Mooeypoo has uploaded a new change for review.
https://gerrit.wikimedia.org/r/115533
Change subject: Use CSS to style figure and figcaption
......................................................................
Use CSS to style figure and figcaption
In order to make the output if <figure> and <figcaption> as close to the
generalized parsoid output, this fix removes the explicit size dimensions
from <figure> and uses CSS styles instead to format the figure and caption.
Change-Id: I348e55ddea94f3b67f647c66ba53f7384d683584
---
M modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js
M modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-shared.css
2 files changed, 10 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/33/115533/1
diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js
b/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js
index 0828184..026705a 100644
--- a/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js
+++ b/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js
@@ -206,12 +206,6 @@
}
this.$image.css( dimensions );
-
- this.$figure.css( {
- // If we have a border then the width is increased by 2
- 'width': dimensions.width + ( this.captionVisible ? 2 : 0 ),
- 'height': this.captionVisible ? 'auto' : dimensions.height
- } );
};
/**
diff --git a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-shared.css
b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-shared.css
index 0290e39..6125611 100644
--- a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-shared.css
+++ b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-shared.css
@@ -39,8 +39,18 @@
figure[typeof='mw:Image/Thumb'], figure[typeof='mw:Image/Frame'] {
background-color: #f9f9f9;
border: 1px solid #cccccc;
+ border-bottom: none !important;
padding: 3px !important;
font-size: 94%;
+ display: table;
+}
+
+figcaption {
+ display: table-caption;
+ caption-side: bottom;
+ background-color: #f9f9f9;
+ border: 1px #cccccc solid !important;
+ border-top: none !important;
}
/* TODO: Merge with .thumbimage styles */
--
To view, visit https://gerrit.wikimedia.org/r/115533
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I348e55ddea94f3b67f647c66ba53f7384d683584
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits