jenkins-bot has submitted this change and it was merged.
Change subject: No need to run attribute expander on Parsoid-added marker meta
tags
......................................................................
No need to run attribute expander on Parsoid-added marker meta tags
* TSRMarker, Placeholder, Transclusion, Param, Includes,
Extension/ref/Marker meta tags do not have any expandable
attributes. So, no need to go through that path.
With this change, while running parser tests, 36% fewer tokens
pass through AttributeExpander without processing.
Change-Id: Ia8768c2c9579fc05f871bf4e3f4c242184055983
---
M lib/ext.core.AttributeExpander.js
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
Arlolra: Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/ext.core.AttributeExpander.js
b/lib/ext.core.AttributeExpander.js
index f26db6e..ccf6ecb 100644
--- a/lib/ext.core.AttributeExpander.js
+++ b/lib/ext.core.AttributeExpander.js
@@ -175,8 +175,11 @@
// console.warn( 'AttributeExpander.onToken: ', JSON.stringify( token )
);
if ( (token.constructor === TagTk || token.constructor ===
SelfclosingTagTk) &&
// Do not process dom-fragment tokens: a separate handler deals
with them.
+ token.attribs && token.attribs.length &&
token.name !== 'mw:dom-fragment-token' &&
- token.attribs && token.attribs.length ) {
+ (token.name !== 'meta' ||
+
!/mw:(TSRMarker|Placeholder|Transclusion|Param|Includes|Extension\/ref\/Marker)/.test(token.getAttribute('typeof')))
+ ) {
cb( { async: true } );
(new AttributeTransformManager(
this.manager,
--
To view, visit https://gerrit.wikimedia.org/r/187731
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8768c2c9579fc05f871bf4e3f4c242184055983
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits