Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
43ae349c
Commit
43ae349c
authored
Mar 28, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Support SVG element style.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
39434794
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
11 deletions
+46
-11
htmlstyle.c
dlls/mshtml/htmlstyle.c
+21
-7
nsiface.idl
dlls/mshtml/nsiface.idl
+13
-0
elements.js
dlls/mshtml/tests/elements.js
+12
-4
No files found.
dlls/mshtml/htmlstyle.c
View file @
43ae349c
...
@@ -10171,6 +10171,7 @@ static dispex_static_data_t HTMLStyle_dispex = {
...
@@ -10171,6 +10171,7 @@ static dispex_static_data_t HTMLStyle_dispex = {
static
HRESULT
get_style_from_elem
(
HTMLElement
*
elem
,
nsIDOMCSSStyleDeclaration
**
ret
)
static
HRESULT
get_style_from_elem
(
HTMLElement
*
elem
,
nsIDOMCSSStyleDeclaration
**
ret
)
{
{
nsIDOMElementCSSInlineStyle
*
nselemstyle
;
nsIDOMElementCSSInlineStyle
*
nselemstyle
;
nsIDOMSVGElement
*
svg_element
;
nsresult
nsres
;
nsresult
nsres
;
if
(
!
elem
->
dom_element
)
{
if
(
!
elem
->
dom_element
)
{
...
@@ -10180,16 +10181,29 @@ static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration
...
@@ -10180,16 +10181,29 @@ static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration
nsres
=
nsIDOMElement_QueryInterface
(
elem
->
dom_element
,
&
IID_nsIDOMElementCSSInlineStyle
,
nsres
=
nsIDOMElement_QueryInterface
(
elem
->
dom_element
,
&
IID_nsIDOMElementCSSInlineStyle
,
(
void
**
)
&
nselemstyle
);
(
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
=
nsIDOMElementCSSInlineStyle_GetStyle
(
nselemstyle
,
ret
);
nsres
=
nsIDOMElement_QueryInterface
(
elem
->
dom_element
,
&
IID_nsIDOMSVGElement
,
(
void
**
)
&
svg_element
);
nsIDOMElementCSSInlineStyle_Release
(
nselemstyle
);
if
(
NS_SUCCEEDED
(
nsres
))
{
if
(
NS_FAILED
(
nsres
))
{
nsres
=
nsIDOMSVGElement_GetStyle
(
svg_element
,
ret
);
ERR
(
"GetStyle failed: %08x
\n
"
,
nsres
);
nsIDOMSVGElement_Release
(
svg_element
);
return
E_FAIL
;
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetStyle failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
return
S_OK
;
}
}
return
S_OK
;
FIXME
(
"Unsupported element type
\n
"
);
return
E_NOTIMPL
;
}
}
void
init_css_style
(
CSSStyle
*
style
,
nsIDOMCSSStyleDeclaration
*
nsstyle
,
style_qi_t
qi
,
void
init_css_style
(
CSSStyle
*
style
,
nsIDOMCSSStyleDeclaration
*
nsstyle
,
style_qi_t
qi
,
...
...
dlls/mshtml/nsiface.idl
View file @
43ae349c
...
@@ -1154,6 +1154,19 @@ interface nsIDOMHTMLElement : nsIDOMElement
...
@@ -1154,6 +1154,19 @@ interface nsIDOMHTMLElement : nsIDOMElement
[
[
object,
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),
uuid(59b80014-00f5-412d-846f-725494122d42),
local
local
]
]
...
...
dlls/mshtml/tests/elements.js
View file @
43ae349c
...
@@ -279,9 +279,11 @@ function test_document_owner() {
...
@@ -279,9 +279,11 @@ function test_document_owner() {
}
}
function
test_style_properties
()
{
function
test_style_properties
()
{
var
style
=
document
.
body
.
style
;
document
.
body
.
innerHTML
=
'<div>test</div><svg></svg>'
;
var
current_style
=
document
.
body
.
currentStyle
;
var
elem
=
document
.
body
.
firstChild
;
var
computed_style
=
window
.
getComputedStyle
(
document
.
body
);
var
style
=
elem
.
style
;
var
current_style
=
elem
.
currentStyle
;
var
computed_style
=
window
.
getComputedStyle
(
elem
);
var
val
;
var
val
;
style
.
cssFloat
=
"left"
;
style
.
cssFloat
=
"left"
;
...
@@ -350,7 +352,7 @@ function test_style_properties() {
...
@@ -350,7 +352,7 @@ function test_style_properties() {
ok
(
computed_style
.
clip
===
"rect(1px, 1px, 10px, 10px)"
,
ok
(
computed_style
.
clip
===
"rect(1px, 1px, 10px, 10px)"
,
"computed_style.clip = "
+
current_style
.
clip
);
"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
(
current_style
.
zIndex
===
2
,
"current_style.zIndex = "
+
current_style
.
zIndex
);
ok
(
computed_style
.
zIndex
===
2
,
"computed_style.zIndex = "
+
computed_style
.
zIndex
);
ok
(
computed_style
.
zIndex
===
2
,
"computed_style.zIndex = "
+
computed_style
.
zIndex
);
...
@@ -364,6 +366,12 @@ function test_style_properties() {
...
@@ -364,6 +366,12 @@ function test_style_properties() {
ok
(
false
,
"expected exception"
);
ok
(
false
,
"expected exception"
);
}
catch
(
e
)
{}
}
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
();
next_test
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment