#LoqiCalli: tantek left you a message 2 hours, 19 minutes ago: Try constructing some simple span class markup with the tree you gave "vcard" > "adr h-adr" > "p-locality" and using one of the live textarea entry parsers to check! http://microformats.org/wiki/microformats2#Parsers
#tantekwhereas Calli's example looks like it is bout having both *property* class names
#tantekI *think* (that's upon quick reading of the issue and example)
#Calliyes. This is a minimal test: <div class="vcard"><div class="given-name">MF1</div><div class="p-given-name">MF2</div></div>
#CalliIn that test, we expect only an MF1 property to appear in the output
#CalliThe next more complex example is: <div class="vcard"><div class="adr"><div class="locality">MF1</div><div class="p-locality">MF2</div></div></div>
#CalliWhere we've got an extra level of nesting. But still I think we expect only the MF1 property to appear in the output.
#CalliAnd then we get to the example where I'm not sure the spec is clear about what has to happen: <div class="vcard"><div class="adr h-adr"><div class="locality">MF1</div><div class="p-locality">MF2</div></div></div>
#tantekkevinmarks - pretty sure that glennjones already has tests in there for those test cases
#CalliIn this case the question is whether the "adr h-adr" element has an MF1 compat context, and MF2 context, or both
#tantekCalli - in the case of the presence of both roots, the mf2 roots take predence
#CalliBTW my rejiggered implementation matches the glennjones result: MF2 context turns off the MF1 compat so you only get locality = MF2
#CalliI don't know if that's right though - so that'smy question
#tantekah right - that's the detail of what to do with mf2 roots as properties of classic microformats properties!
#tantekthat is more subtle yes - you are correct to point that out separately
nitot joined the channel
#CalliSo is the feeling that for the "adr h-adr" example that we should only honor the MF2 context. I think it will make my implementation more complex if I need to honor both (while still maintaining the other rules).
#tantekagreed that trying to honor both inside any object would be more complex
#tantekand thus consideration of different treatment
#tantekCalli, if I understand you correctly, you are proposing that in the "adr h-adr" example, the nested object is parsed as an mf2 h-adr, thus only looking at the p-location, and not the "location" class name
#tantekthat seems reasonable to me and I'd like to document that as a proposed resolution to this issue
#tantekCalli++ looks like we have a pretty decent consensus with your proposal, Glenn Jones's implementation, and another implementer (kylewm works on the python mf2 parser)
#CalliI think we're saying that the general principle is that if an element has an h- it will never have a compat type no matter where the element appears right?
#tantekyes that seems consistent, and most predictable
tantek, andicascadesf, gRegorLove and Calli joined the channel
#CalliGoing to write a summary of MF2 compat parsing concepts based on yesterdays discussion:
#CalliDefns: "Compatibility Map" contains all possible mappings from MF1 classes to MF2 classes. It doesn't change.
#Calli"Compatibility Class Map" maps from MF1 type classes to MF2 type classes. It doesn't change. It's the subset of the Compatibility Map that deals with mapping types.
#Calli"Compatibility Context" maps from MF1 property classes to MF2 property and type classes. It can be different for each HTML element. It's the relevant subset of the Compatibility Map.
#CalliEvery HTML element in the source document _defines_ a Compatibility Context:
#CalliIf the HTML element contains an MF2 type class (prefix h-), it defines an empty Compatibility Context
#CalliElse if the HTML element contains any MF1 type classes, it defines a Compatibility Context that consists of the union of the compatibility mappings for those types.
#CalliOtherwise it defines a Compatibility Context that is the same as its parent Compatibility Context.
#CalliThe Compatibility Context is _used_ when examining child elements:
#CalliThe active properties on an element are defined this way:
#CalliIf the Compatibility Context is empty, the properties of the element are the MF2 property classes on that element
#CalliOtherwise the properties of that element are obtained by mapping the MF1 property classes through the Compatibility Context to obtain MF2 property classes. (In this case, MF2 property classes on the element itself are ignored)
#CalliThe active types on an element are defined this way:
#CalliIf the HTML element contains any MF2 type classes (prefix h-), the active types are exactly those types
#CalliI think that gives results that match the intentions of the spec and covers the cases discussed yesterday
#CalliThe microformats 2 parsing page needs a prominent place for the "Compatibility Map" - it's not possible to produce interoperable MF2 parsers without this map
#CalliI borrowed mine from another parser and adjusted it to my programming language (C++) and preferences, but it needs to be part of the spec
#tantekI'm not sure more terminology would help the parsing spec be more understandable
#tantekI'd prefer to keep the parsing spec very direct in terms of what to do with what inputs
#Calliand whatever the concensus is on what the actual data should be
#tantekok that makes sense. I'm thinking a summary of the backcompat roots would be sufficient for the parsing spec, linked to each of the backcompat properties sections for each root - rather than duplicating
#CalliI guess the info can be pieced together from http://microformats.org/wiki/microformats2 but that page has a certain amount of discussion and options and inconsistent use of new vs old types
#tantekagreed - it can be made simpler / easier for implementers
#CalliYes, if you want better consistency across implementations and to make life easier for implementers a simple data file would be better
#tantekthanks for pointing this out - really helps to have a fresh pair of eyes look at it
#tantekI'm thinking a summary list to start with, and then maybe links to data files of existing parser implementations
#tantekthis is excellent - this way we can hopefully submit pull requests to fix all these to be consistent
#CalliThere aren't that many language-specific extras on the PHP and Python maps so I'd be OK if the spec included a map that actually compiles as code in some language as the core data (rather than language-independent)
#CalliThe overall hit-rate on working online MF2 parsers and actively maintained repos for parsers on the wiki isn't super high right now - if you have some preferred implementations and/or parsers that you know are being actively worked on, I'd suggested moving them to the top of the list
#tantekmicroformatshiv is very active, and mf2py and phpmf2 after that
#tantekI think the others are more in a "development" phase
#tantekwhereas the first three are all used in production on various sites
#Calliyeah those three seem good. My rec would be to put links to the most reliable sites with textarea input right at the top of the list, followed by active repos by language, followed by others