Add valid attribute entries for schema.org RDFa syntax#6739
Add valid attribute entries for schema.org RDFa syntax#6739Gregable merged 5 commits intoampproject:masterfrom
Conversation
|
/to @Gregable |
Gregable
left a comment
There was a problem hiding this comment.
Thanks for the PR addressing this issue!
| attrs: { name: "itemtype" } | ||
| # Also for schema.org, RDFa syntax | ||
| attrs: { name: "about" } | ||
| attrs: { name: "content" } |
There was a problem hiding this comment.
All of these are fine, except content. We have some specific rules related to the content attribute for <meta> tags that we need to make sure we still are enforcing, for example <meta name=viewport content=...>.
I think the non-global attribute rules will override the global ones, but if we are adding this, it would be good to add a test which demonstrates this. Can you add a feature test showing that this fails validation:
<meta name=viewport content=invalid>
There was a problem hiding this comment.
Thanks for the feedback! I have added a check that the meta rules are still enforced, clearly the more specific rules get picked up over generic ones. This also led me to notice that there were specific rules for link that would break with RDFa, so I have added a rule for that case. It is modelled on the itemprop one and (just like itemprop before it) it doesn't break link in other cases.
There was a problem hiding this comment.
(Also, sorry for the duplicated git commit message, I did run git commit --amend on that one but clearly I failed at it.)
|
Looks good to me. I'll go ahead and merge. Just to warn you, it'll be a few weeks before this change gets released. |
|
Understood, thanks a lot! If there's any publicly-documented information about when it might ship I would be thankful, otherwise I'll just wait! |
|
Unfortunately, the schedule is a bit unpredictable. |
* add valid attribute entries for schema.org RDFa syntax * add tests for RDFa validation support * check that adding RDFa did not break meta@content * check that adding RDFa did not break meta@content * add a rule for RDFa link
* add valid attribute entries for schema.org RDFa syntax * add tests for RDFa validation support * check that adding RDFa did not break meta@content * check that adding RDFa did not break meta@content * add a rule for RDFa link
* add valid attribute entries for schema.org RDFa syntax * add tests for RDFa validation support * check that adding RDFa did not break meta@content * check that adding RDFa did not break meta@content * add a rule for RDFa link
|
This is great, thanks! :) From a schema.org perspective I might mention that our use of the content attribute has leaked across from RDFa into various of the Microdata examples on schema.org even if it is not historically part of the Microdata story. |
AMP is currently in the somewhat contradictory state of encouraging schema.org and considering one of the syntaxes used for that sort of annotation (namely RDFa) invalid. Accepting RDFa is harmless in terms of performance (browsers don't do anything with it).
This was reported in #4919.