mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Don't call SetSheet with a null sheet. (Bug 645951) r=bzbarsky
This commit is contained in:
parent
2d607acb83
commit
809999141b
4
layout/style/crashtests/645951-1-ref.html
Normal file
4
layout/style/crashtests/645951-1-ref.html
Normal file
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test, bug 645951</title>
|
||||
<body>
|
||||
<p style="color: green">Should not crash, and should be green too.</p>
|
1
layout/style/crashtests/645951-1.css
Normal file
1
layout/style/crashtests/645951-1.css
Normal file
@ -0,0 +1 @@
|
||||
@import url(chrome:///browser/skin/);
|
11
layout/style/crashtests/645951-1.html
Normal file
11
layout/style/crashtests/645951-1.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test, bug 645951</title>
|
||||
<link rel=stylesheet href="645951-1.css">
|
||||
<link id="two" rel=stylesheet href="645951-1.css">
|
||||
<body onload="run()">
|
||||
<script>
|
||||
function run() {
|
||||
document.getElementById("two").sheet.insertRule("p { color: green}", 1);
|
||||
}
|
||||
</script>
|
||||
<p>Should not crash, and should be green too.</p>
|
@ -64,3 +64,4 @@ load 592698-1.html
|
||||
load 601437-1.html
|
||||
load 601439-1.html
|
||||
load 605689-1.html
|
||||
== 645951-1.html 645951-1-ref.html
|
||||
|
@ -368,12 +368,15 @@ ImportRule::ImportRule(const ImportRule& aCopy)
|
||||
: nsCSSRule(aCopy),
|
||||
mURLSpec(aCopy.mURLSpec)
|
||||
{
|
||||
nsRefPtr<nsCSSStyleSheet> sheet;
|
||||
// Whether or not an @import rule has a null sheet is a permanent
|
||||
// property of that @import rule, since it is null only if the target
|
||||
// sheet failed security checks.
|
||||
if (aCopy.mChildSheet) {
|
||||
sheet = aCopy.mChildSheet->Clone(nsnull, this, nsnull, nsnull);
|
||||
nsRefPtr<nsCSSStyleSheet> sheet =
|
||||
aCopy.mChildSheet->Clone(nsnull, this, nsnull, nsnull);
|
||||
SetSheet(sheet);
|
||||
// SetSheet sets mMedia appropriately
|
||||
}
|
||||
SetSheet(sheet);
|
||||
// SetSheet sets mMedia appropriately
|
||||
}
|
||||
|
||||
ImportRule::~ImportRule()
|
||||
|
Loading…
Reference in New Issue
Block a user