Page MenuHomePhabricator

VisualEditor: Deal with universal types like mw:Error, mw:ExpandedAttrs, mw:Placeholder
Closed, ResolvedPublic40 Estimated Story PointsFeature

Description

Some types like mw:ExpandedAttrs are universal, meaning they can apply to any element and their presence shouldn't be taken into account when figuring out which node handler to invoke. The node handlers themselves probably do need to make decisions based on their presence, but that's fine, they can do that already.

For now the approach I'm considering is to add the concept of a universal RDFa type, which will be ignored by ve.dm.ModelRegistry#matchElement for all purposes (including the "if not all mw: types are matched it's not a match" logic and all of that). mw:ExpandedAttrs and mw:Error (the latter would be introduced by bug 50788) would be universal types. mw:Placeholder wouldn't be one, because it needs to trigger alienation.


Version: unspecified
Severity: major

Details

Reference
bz61969

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:58 AM
bzimport set Reference to bz61969.
Jdforrester-WMF lowered the priority of this task from High to Medium.Feb 24 2015, 10:14 PM
Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 15 2022, 9:40 PM
matmarex added a subscriber: matmarex.

We've dealt with it by introducing allowedRdfaTypes (in 2015: T98999). Nodes that wish to handle the "universal" types can do it like this:

ve.dm.MWImageNode.static.allowedRdfaTypes = [ 'mw:Error' ];

The required handling is different for each node type, so the above is not set globally, each node type has to be "opted in".