Servo: Implement SVGElement.style

Created on 4 Jun 2020  路  4Comments  路  Source: servo/servo

Spec: https://drafts.csswg.org/cssom/#dom-elementcssinlinestyle-style

With implementing this, we should be able to fix #26032.

A-contendom A-contensvg

Most helpful comment

Yes, that should help.

All 4 comments

Tried to implement style for SVGElement, I found it doesn't fix #26032 and we still can't get style for the create svg circle element :/

const x = document.createElementNS("http://www.w3.org/2000/svg", "circle");
console.log(x.style);

In Gecko, this will log an empty CSS2Properties but it will log undefined in Servo even SVGElement includes ElementCSSInlineStyle.

I have a suspicion that the element returned from createElementNS is a generic Element, rather than an SVGElement. It's worth checking if that is the case.

Cool! Yes! It currently returns a generic Element.

https://github.com/servo/servo/blob/3d6fed85ffffcc289a6e0decb0dd70a2985542b0/components/script/dom/create.rs#L111-L114

Before implementing other svg elements, should we return a generic SVGElement here instead?

Yes, that should help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jdm picture jdm  路  3Comments

jdm picture jdm  路  3Comments

shinglyu picture shinglyu  路  4Comments

CYBAI picture CYBAI  路  4Comments

gterzian picture gterzian  路  3Comments