Catrope has uploaded a new change for review.
https://gerrit.wikimedia.org/r/76836
Change subject: Remove the DM 'about' attribute from references and reference
lists
......................................................................
Remove the DM 'about' attribute from references and reference lists
It's totally unnecessary, and actually caused a bug where new references
got about="undefined", which caused Parsoid to about-group adjacent
new references together.
Bug: 52228
Change-Id: Id40d53c72a35412d612ae9441ae3d561622c1bec
---
M modules/ve-mw/dm/nodes/ve.dm.MWReferenceListNode.js
M modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
M modules/ve-mw/test/dm/ve.dm.mwExample.js
3 files changed, 0 insertions(+), 21 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/36/76836/1
diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceListNode.js
b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceListNode.js
index b2bc8ec..492c265 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceListNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceListNode.js
@@ -44,7 +44,6 @@
'attributes': {
'mw': mwData,
'originalMw': mwDataJSON,
- 'about': domElements[0].getAttribute( 'about' ),
'domElements': ve.copy( domElements ),
'refGroup': refGroup,
'listGroup': listGroup
@@ -75,9 +74,6 @@
delete mwData.attrs.refGroup;
}
- if ( attribs.about ) {
- el.setAttribute( 'about', attribs.about );
- }
el.setAttribute( 'typeof', 'mw:Extension/references' );
// If mwData and originalMw are the same, use originalMw to prevent
reserialization.
diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
index 6ec731b..27d6d9d 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceNode.js
@@ -41,7 +41,6 @@
ve.dm.MWReferenceNode.static.toDataElement = function ( domElements, converter
) {
var dataElement,
- about = domElements[0].getAttribute( 'about' ),
mwDataJSON = domElements[0].getAttribute( 'data-mw' ),
mwData = mwDataJSON ? JSON.parse( mwDataJSON ) : {},
body = mwData.body ? mwData.body.html : '',
@@ -58,7 +57,6 @@
'mw': mwData,
'originalMw': mwDataJSON,
'childDomElements': ve.copy(
Array.prototype.slice.apply( domElements[0].childNodes ) ),
- 'about': about,
'listIndex': listIndex,
'listGroup': listGroup,
'listKey': listKey,
@@ -77,7 +75,6 @@
itemNode = converter.internalList.getItemNode(
dataElement.attributes.listIndex ),
itemNodeRange = itemNode.getRange();
- el.setAttribute( 'about', dataElement.attributes.about );
el.setAttribute( 'typeof', 'mw:Extension/ref' );
mwData = dataElement.attributes.mw ? ve.copy( dataElement.attributes.mw
) : {};
diff --git a/modules/ve-mw/test/dm/ve.dm.mwExample.js
b/modules/ve-mw/test/dm/ve.dm.mwExample.js
index 073c2d0..f4a0229 100644
--- a/modules/ve-mw/test/dm/ve.dm.mwExample.js
+++ b/modules/ve-mw/test/dm/ve.dm.mwExample.js
@@ -354,7 +354,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt2',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 0,
@@ -384,7 +383,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt6',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 1,
@@ -412,7 +410,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt7',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 2,
@@ -440,7 +437,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt8',
'contentsUsed': false,
'listGroup': 'mwReference/',
'listIndex': 1,
@@ -469,7 +465,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt11',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 3,
@@ -496,7 +491,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt12',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 4,
@@ -524,7 +518,6 @@
{
'type': 'mwReferenceList',
'attributes': {
- 'about': '#mwt12',
'mw': {
'name': 'references',
'attrs': {}
@@ -869,7 +862,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt5',
'listIndex': 0,
'listGroup': 'mwReference/',
'listKey': 'bar',
@@ -905,7 +897,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt6',
'listIndex': 1,
'listGroup': 'mwReference/',
'listKey': 'quux',
@@ -941,7 +932,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt7',
'listIndex': 0,
'listGroup': 'mwReference/',
'listKey': 'bar',
@@ -977,7 +967,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt8',
'listIndex': 2,
'listGroup': 'mwReference/g1',
'listKey': null,
@@ -1013,7 +1002,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt9',
'listIndex': 0,
'listGroup': 'mwReference/',
'listKey': 'bar',
@@ -1049,7 +1037,6 @@
{
'type': 'mwReferenceList',
'attributes': {
- 'about': '#mwt12',
'mw': {
'name': 'references',
'attrs': {}
@@ -1143,7 +1130,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt2',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 0,
--
To view, visit https://gerrit.wikimedia.org/r/76836
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id40d53c72a35412d612ae9441ae3d561622c1bec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits