CSC/ECE 517 Fall 2017/Semester Project - Implement the Microdata API: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 23: Line 23:
5) Modify the servoshell embedding to use the new notification and create a vCard file if available
5) Modify the servoshell embedding to use the new notification and create a vCard file if available


==='''Sample outcomes'''===
==='''Sample Outcomes'''===


Sample outputs of the extraction algorithms are given below


[https://html.spec.whatwg.org/multipage/microdata.html#extracting-json Sample JSON conversion output]
[https://html.spec.whatwg.org/multipage/microdata.html#extracting-json JSON conversion output]


[https://html.spec.whatwg.org/multipage/microdata.html#extracting-a-vcard Sample vCard conversion output]
[https://html.spec.whatwg.org/multipage/microdata.html#extracting-a-vcard vCard conversion output]


=='''Design'''==
=='''Design'''==

Revision as of 05:33, 7 November 2017

Background

This project is the second phase of the OSS project - M1752 Implement the Microdata API. Please refer to the phase 1 documentation on the Wiki prior to going through this document to gain familiarity with the components involved and build instructions

Introduction

Servoshell

Servoshell is a work-in-progress front-end for the servo browser engine.

Requirements & Scope

The scope of this project is to implement algorithms to interpret JSON and vCard data present in the form of microdata, in a webpage and to notify the embedder, in this case servoshell. This would allow the embedder to display this data as required.

The following steps are to be performed -

1) Implement and test the algorithm to extract JSON from microdata. Specification Details

2) Implement and test the algorithm to extract a vCard from microdata. Specification Details

3) Use these algorithms to extract metadata from each page after it finishes loading and send it to the compositor

4) Notify any embedding code of the newly-extracted metadata

5) Modify the servoshell embedding to use the new notification and create a vCard file if available

Sample Outcomes

Sample outputs of the extraction algorithms are given below

JSON conversion output

vCard conversion output

Design

The algorithms for converting microdata to JSON and vCard formats would be implemented in the Rust implementation of the Document Object Model - document.rs. The WHATWG specification provides the details for the necessary checks that have to be performed on the microdata before conversion.

Once the vCard and JSON files have been created, a notification would be sent to servoshell, via a lightweight data-structure, so that it can detect the presence of microdata. As per our design, the servoshell would be modified to be able to make the vCard file available for the user to download.

The below diagram provides details on the components involved in the process flow for the changes in scope

The diagram below outlines the sequence of operations that take place in order for servoshell to interpret the microdata.

References

Microdata Project

Phase 1 Wiki Page

Servoshell

http://html5doctor.com/microdata/

http://web-platform-tests.org/writing-tests/testharness-api.html

https://html.spec.whatwg.org/multipage/microdata.html

https://code.tutsplus.com/tutorials/html5-microdata-welcome-to-the-machine--net-12356

http://www.servo.org