зеркало из https://github.com/mozilla/gecko-dev.git
Bug 448161. Don't crash when getting computed style for a link that's not in the document
This commit is contained in:
Родитель
c110005e1f
Коммит
375ecaad19
|
@ -0,0 +1,22 @@
|
|||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
|
||||
function boom()
|
||||
{
|
||||
var r = document.createRange();
|
||||
r.setStart(document.body, 0);
|
||||
r.setEnd(document.getElementById("g"), 0);
|
||||
r.deleteContents();
|
||||
|
||||
// Give spell-check a chance to run
|
||||
setTimeout(function() { document.documentElement.className = ""; },
|
||||
50);
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="boom();" contenteditable="true"><span><span contenteditable="true"><a href="http://www.mozilla.org/">5</a></span></span><span id="g"></span></body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,9 @@
|
|||
<html>
|
||||
<body>
|
||||
<script>
|
||||
var node = document.createElement("a");
|
||||
node.href = "http://www.mozilla.org";
|
||||
document.defaultView.getComputedStyle(node, "").color
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -18,3 +18,5 @@ load 444237-1.html
|
|||
load 444848-1.html
|
||||
load 447776-1.html
|
||||
load 447783-1.html
|
||||
load 448161-1.html
|
||||
load 448161-2.html
|
||||
|
|
|
@ -466,8 +466,8 @@ PRBool nsStyleUtil::IsHTMLLink(nsIContent *aContent, nsIAtom *aTag,
|
|||
} else {
|
||||
linkState = eLinkState_NotLink;
|
||||
}
|
||||
if (linkState != eLinkState_NotLink && aForStyling) {
|
||||
NS_ASSERTION(aContent->GetCurrentDoc(), "Must have document!");
|
||||
if (linkState != eLinkState_NotLink && aForStyling &&
|
||||
aContent->IsInDoc()) {
|
||||
aContent->GetCurrentDoc()->AddStyleRelevantLink(aContent, hrefURI);
|
||||
}
|
||||
link->SetLinkState(linkState);
|
||||
|
@ -500,8 +500,7 @@ PRBool nsStyleUtil::IsLink(nsIContent *aContent,
|
|||
nsCOMPtr<nsIURI> absURI;
|
||||
if (aContent->IsLink(getter_AddRefs(absURI))) {
|
||||
*aState = GetLinkStateFromURI(absURI, aContent, aLinkHandler);
|
||||
if (aForStyling) {
|
||||
NS_ASSERTION(aContent->GetCurrentDoc(), "Must have document!");
|
||||
if (aForStyling && aContent->IsInDoc()) {
|
||||
aContent->GetCurrentDoc()->AddStyleRelevantLink(aContent, absURI);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче