-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Microdata project
Josh Matthews edited this page Oct 6, 2017
·
3 revisions
Background information: The WHATWG HTML standard defines a Microdata API that allows authors to embed machine-readable metadata in web content. The goal of this work is to implement the fundamental pieces required to support this API.
Tracking issue: https://github.com/servo/servo/issues/18528 (please ask questions here)
Initial steps:
- email the mozilla.dev.servo mailing list (be sure to subscribe to it first!) introducing your group and asking any necessary questions
- edit the HTMLElement interface to add the itemscope and itemprop attributes.
- Implement stub methods for the attributes in
components/script/dom/htmlelement.rs
. - hide the new attributes by default by adding a
[Pref="dom.microdata.enabled"]
attribute to each one in the WebIDL file and add a corresponding preference toresources/prefs.json
- create new directories
tests/wpt/mozilla/tests/mozilla/microdata
andtests/wpt/mozilla/meta/mozilla/microdata
which will include any tests you write. - add a
__dir__.ini
file totests/wpt/mozilla/meta/mozilla/microdata
which enables the new preference. - tests can now be added to
tests/wpt/mozilla/tests/mozilla/microdata
. - implement the microdata attributes, by adding fields to the
HTMLElement
foritemscope
anditemprop
.
Subsequent steps:
- implement and test the algorithm to extract JSON from microdata.
- implement and test the algorithm to extract a vCard from microdata.
- use these algorithms to extract metadata from each page after it finishes loading and send it to the compositor
- notify any embedding code of the newly-extracted metadata
- modify the servoshell embedding to use the new notification and create a vCard file if available