mshtml: Support SVG element style.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
394347945c
commit
43ae349c96
|
@ -10171,6 +10171,7 @@ static dispex_static_data_t HTMLStyle_dispex = {
|
|||
static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration **ret)
|
||||
{
|
||||
nsIDOMElementCSSInlineStyle *nselemstyle;
|
||||
nsIDOMSVGElement *svg_element;
|
||||
nsresult nsres;
|
||||
|
||||
if(!elem->dom_element) {
|
||||
|
@ -10180,18 +10181,31 @@ static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration
|
|||
|
||||
nsres = nsIDOMElement_QueryInterface(elem->dom_element, &IID_nsIDOMElementCSSInlineStyle,
|
||||
(void**)&nselemstyle);
|
||||
assert(nsres == NS_OK);
|
||||
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsres = nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle, ret);
|
||||
nsIDOMElementCSSInlineStyle_Release(nselemstyle);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetStyle failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
nsres = nsIDOMElement_QueryInterface(elem->dom_element, &IID_nsIDOMSVGElement, (void**)&svg_element);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsres = nsIDOMSVGElement_GetStyle(svg_element, ret);
|
||||
nsIDOMSVGElement_Release(svg_element);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetStyle failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
FIXME("Unsupported element type\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
void init_css_style(CSSStyle *style, nsIDOMCSSStyleDeclaration *nsstyle, style_qi_t qi,
|
||||
dispex_static_data_t *dispex_info, compat_mode_t compat_mode)
|
||||
{
|
||||
|
|
|
@ -1152,6 +1152,19 @@ interface nsIDOMHTMLElement : nsIDOMElement
|
|||
nsresult GetOffsetHeight(int32_t *aOffsetHeight);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(c63517c5-8bab-4cd1-8694-bccafc32a195),
|
||||
local
|
||||
]
|
||||
interface nsIDOMSVGElement : nsIDOMElement
|
||||
{
|
||||
nsresult GetOwnerSVGElement(nsIDOMSVGElement **aOwnerSVGElement);
|
||||
nsresult GetViewportElement(nsIDOMSVGElement **aViewportElement);
|
||||
nsresult GetSVGClassName(nsISupports **aClassName);
|
||||
nsresult GetStyle(nsIDOMCSSStyleDeclaration **aStyle);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(59b80014-00f5-412d-846f-725494122d42),
|
||||
|
|
|
@ -279,9 +279,11 @@ function test_document_owner() {
|
|||
}
|
||||
|
||||
function test_style_properties() {
|
||||
var style = document.body.style;
|
||||
var current_style = document.body.currentStyle;
|
||||
var computed_style = window.getComputedStyle(document.body);
|
||||
document.body.innerHTML = '<div>test</div><svg></svg>';
|
||||
var elem = document.body.firstChild;
|
||||
var style = elem.style;
|
||||
var current_style = elem.currentStyle;
|
||||
var computed_style = window.getComputedStyle(elem);
|
||||
var val;
|
||||
|
||||
style.cssFloat = "left";
|
||||
|
@ -350,7 +352,7 @@ function test_style_properties() {
|
|||
ok(computed_style.clip === "rect(1px, 1px, 10px, 10px)",
|
||||
"computed_style.clip = " + current_style.clip);
|
||||
|
||||
document.body.style.zIndex = 2;
|
||||
style.zIndex = 2;
|
||||
ok(current_style.zIndex === 2, "current_style.zIndex = " + current_style.zIndex);
|
||||
ok(computed_style.zIndex === 2, "computed_style.zIndex = " + computed_style.zIndex);
|
||||
|
||||
|
@ -364,6 +366,12 @@ function test_style_properties() {
|
|||
ok(false, "expected exception");
|
||||
}catch(e) {}
|
||||
|
||||
elem = elem.nextSibling;
|
||||
computed_style = window.getComputedStyle(elem);
|
||||
|
||||
elem.style.zIndex = 4;
|
||||
ok(computed_style.zIndex === 4, "computed_style.zIndex = " + computed_style.zIndex);
|
||||
|
||||
next_test();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue