-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Basic SVG support project
Josh Matthews edited this page Sep 14, 2016
·
1 revision
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
SVGElementDOM interface (guarded by adom.svg.enabledpreference) -
create the
SVGCircleElementDOM interface (guarded by adom.svg.enabledpreference) - make
create_elementreturn the new elements when thesvgandcircletags are encountered in the SVG namespace -
write a test in
tests/wpt/mozilla/tests/mozilla/showing that the new elements are recognized when thedom.svg.enabledpreference is enabled
Subsequent steps:
- implement the graphics primitives necessary for WebRender
- add a
SVGtype toSpecificFragmentInfothat contains width/height information and a vector of circle data (use theCanvastype as a model, since it is very similar) - create an instance of
SpecicFragmentInfo::SVGinbuild_fragment_for_block - add a
build_display_list_for_svg_fragmentindisplay_list_builder.rs, and call it frombuild_fragment_type_specific_display_itemsTODO