jenkins-bot has submitted this change and it was merged.
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(+), 23 deletions(-)
Approvals:
Esanders: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceListNode.js
b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceListNode.js
index 6f55005..a013484 100644
--- a/modules/ve-mw/dm/nodes/ve.dm.MWReferenceListNode.js
+++ b/modules/ve-mw/dm/nodes/ve.dm.MWReferenceListNode.js
@@ -47,7 +47,6 @@
'attributes': {
'mw': mwData,
'originalMw': mwDataJSON,
- 'about': domElements[0].getAttribute( 'about' ),
'domElements': ve.copy( domElements ),
'refGroup': refGroup,
'listGroup': listGroup
@@ -90,9 +89,6 @@
delete mwData.attrs.refGroup;
}
- if ( attribs.about ) {
- el.setAttribute( 'about', attribs.about );
- }
el.setAttribute( 'typeof', 'mw:Extension/references' );
if ( contentsData.length > 2 ) {
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 a81d1da..dccd2be 100644
--- a/modules/ve-mw/test/dm/ve.dm.mwExample.js
+++ b/modules/ve-mw/test/dm/ve.dm.mwExample.js
@@ -366,7 +366,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt2',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 0,
@@ -396,7 +395,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt6',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 1,
@@ -424,7 +422,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt7',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 2,
@@ -452,7 +449,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt8',
'contentsUsed': false,
'listGroup': 'mwReference/',
'listIndex': 1,
@@ -481,7 +477,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt11',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 3,
@@ -508,7 +503,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt12',
'contentsUsed': true,
'listGroup': 'mwReference/',
'listIndex': 4,
@@ -536,7 +530,6 @@
{
'type': 'mwReferenceList',
'attributes': {
- 'about': '#mwt12',
'mw': {
'name': 'references',
'attrs': {}
@@ -871,7 +864,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt1',
'listIndex': 0,
'listGroup': 'mwReference/',
'listKey': 'bar',
@@ -907,7 +899,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt2',
'listIndex': 1,
'listGroup': 'mwReference/',
'listKey': 'quux',
@@ -936,7 +927,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt3',
'listIndex': 0,
'listGroup': 'mwReference/',
'listKey': 'bar',
@@ -965,7 +955,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt4',
'listIndex': 2,
'listGroup': 'mwReference/g1',
'listKey': null,
@@ -994,7 +983,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt5',
'listIndex': 0,
'listGroup': 'mwReference/',
'listKey': 'bar',
@@ -1023,7 +1011,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt6',
'listGroup': 'mwReference/',
'listIndex': 3,
'listKey': 'foo',
@@ -1052,7 +1039,6 @@
{
'type': 'mwReferenceList',
'attributes': {
- 'about': '#mwt7',
'mw': {
'name': 'references',
'attrs': {},
@@ -1071,7 +1057,6 @@
{
'type': 'mwReference',
'attributes': {
- 'about': '#mwt8',
'childDomElements': $( '<a
href="#cite_note-foo-3">[3]</a>' ).toArray(),
'contentsUsed': true,
'listGroup': 'mwReference/',
@@ -1179,7 +1164,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: merged
Gerrit-Change-Id: Id40d53c72a35412d612ae9441ae3d561622c1bec
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits