https://bugzilla.wikimedia.org/show_bug.cgi?id=50788

--- Comment #7 from Gabriel Wicke <gwi...@wikimedia.org> ---
[15:09] <gwicke> RoanKattouw, re
https://bugzilla.wikimedia.org/show_bug.cgi?id=50788: the idea is to have a
generic way to represent errored content
[15:09] <gwicke> while still matching CSS etc so that it renders as expected
[15:09] <RoanKattouw> Right
[15:09] <RoanKattouw> I guess I could hack tolerance for that into VE's type
system
[15:10] <RoanKattouw> I think it's kind of an abuse of a type but I see why
you'd do it
[15:10] <RoanKattouw> You want to have a single unified thing to easily
identify error nodes
[15:11] <gwicke> yeah; there is a chance that querySelectorAll also supports
typeof
[15:12] <gwicke> [typeof~=mw:Error]
[15:12] <RoanKattouw> Exactl
[15:12] <RoanKattouw> y
[15:12] <gwicke> which is more efficient than [data-mw] and then decoding each
& look for errors
[15:14] <gwicke> RoanKattouw, I think you are already giving mw:Placeholder a
high precedence
[15:14] <gwicke> could mw:Error have a similarly high precedence?
[15:15] <RoanKattouw> gwicke: No, mw:Placeholder is unrecognized
[15:15] <RoanKattouw> Any unrecognized type matching /^mw:/ triggers immediate
alienation
[15:15] <RoanKattouw> For mw:Error we'd need the reverse
[15:15] <gwicke> yeah, but aren't you handling typeof="mw:Placeholder mw:Image"
already?
[15:15] <RoanKattouw> Which is ignore mw:Error as a type completely, otherwise
either everything with mw:Error would be alienated, or everything would have to
specify mw:Error
[15:16] <gwicke> (by letting the placeholder win)
[15:16] <RoanKattouw> No, the placeholder doesn't win
[15:16] <gwicke> ah, I see
[15:16] <RoanKattouw> The rules for "special" type prefixes (for ve-mw, that's
only /^mw:/ ) are as follows:
[15:16] <gwicke> that's a problem
[15:16] <RoanKattouw> A class matches if:
[15:16] <RoanKattouw> * It specifies some type that's present on the element
[15:17] <RoanKattouw> * It specifies ALL mw: types that are present on the
element
[15:17] <RoanKattouw> (i.e. both of those have to be true)
[15:17] <RoanKattouw> Additionally, we don't currently have a facility for
saying "I recognize either mw:Foo or mw:Foo+mw:Error"
[15:17] <RoanKattouw> You can only do AND, not OR
[15:17] <gwicke> RoanKattouw: I see, that makes mw:Error harder to handle for
you
[15:18] <RoanKattouw> I mean, I can do it
[15:18] <RoanKattouw> By introducing the concept of ignored types or whatever I
want to call it
[15:18] <RoanKattouw> I could even make mw:Placeholder one
[15:18] <RoanKattouw> Then placeholderized images could be handled
[15:18] <RoanKattouw> Handlers for node types still have the option to trigger
alienation by returning null
[15:18] <gwicke> we already have mw:Image and mw:ExpandedAttrs
[15:19] <gwicke> and all permutations of images of course
[15:19] <RoanKattouw> So if mw:Image+mw:Placeholder meant "alienate except in
certain cases", then we could send it to the image handler and do if (
conditions ) { return null; // Alienate
[15:19] <RoanKattouw> Right, mw:ExpandedAttrs is another good candidate for an
ignored typer
[15:19] <RoanKattouw> It can apply to anything
[15:19] <RoanKattouw> And sometimes we need to alienate and sometimes we don't
[15:19] <RoanKattouw> Hmm, maybe the jargon should be "universal type"
[15:19] <gwicke> yup, so the general ability to match that kind of thing is
needed in any case
[15:20] <RoanKattouw> Yeah
[15:20] <RoanKattouw> I will file a bug about this

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to