forked from servo/servo
-
Notifications
You must be signed in to change notification settings - Fork 0
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
SVGElement
DOM interface (guarded by adom.svg.enabled
preference) -
create the
SVGCircleElement
DOM interface (guarded by adom.svg.enabled
preference) - make
create_element
return the new elements when thesvg
andcircle
tags 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.enabled
preference is enabled
Subsequent steps:
- implement the graphics primitives necessary for WebRender
- add a
SVG
type toSpecificFragmentInfo
that contains width/height information and a vector of circle data (use theCanvas
type as a model, since it is very similar) - create an instance of
SpecicFragmentInfo::SVG
inbuild_fragment_for_block
- add a
build_display_list_for_svg_fragment
indisplay_list_builder.rs
, and call it frombuild_fragment_type_specific_display_items
TODO