Skip to content

Basic SVG support project

Josh Matthews edited this page Sep 14, 2016 · 1 revision

Implement basic SVG support

Background information: Scalable Vector Graphics (SVG) are a vector image format that can be embedded directly in HTML web content (example). Full SVG support in Servo is a huge project; the goal of this project is to implement an extremely small subset in order to explore the capabilities of our experimental WebRender technology.

Note: the scope of this project is encapsulated in https://github.com/servo/servo/issues/12974, https://github.com/servo/servo/issues/12975 and https://github.com/servo/webrender/issues/402

Initial steps:

  • compile Servo and ensure that it runs on tests/html/about-mozilla.html
  • clone webrender and use a Cargo override to build Servo with the local clone
  • email the mozilla.dev.servo mailing list (be sure to subscribe first!) introducing your group and asking any necessary questions
  • create the SVGElement DOM interface (guarded by a dom.svg.enabled preference)
  • create the SVGCircleElement DOM interface (guarded by a dom.svg.enabled preference)
  • make create_element return the new elements when the svg and circle tags are encountered in the SVG namespace
  • write a test in tests/wpt/mozilla/tests/mozilla/ showing that the new elements are recognized when the dom.svg.enabled preference is enabled

Subsequent steps:

  • implement the graphics primitives necessary for WebRender
  • add a SVG type to SpecificFragmentInfo that contains width/height information and a vector of circle data (use the Canvas type as a model, since it is very similar)
  • create an instance of SpecicFragmentInfo::SVG in build_fragment_for_block
  • add a build_display_list_for_svg_fragment in display_list_builder.rs, and call it from build_fragment_type_specific_display_items TODO
Clone this wiki locally