зеркало из https://github.com/mozilla/pjs.git
Bug 580685. We might not have a root element to resolve 'rem' against. r=dbaron
This commit is contained in:
Родитель
287b776bec
Коммит
89554c16ad
|
@ -0,0 +1,10 @@
|
|||
<html>
|
||||
<head></head>
|
||||
<body style="outline-offset: 0.1rem; ">
|
||||
<script>
|
||||
var body = document.body;
|
||||
document.removeChild(document.documentElement);
|
||||
var compstyle = window.getComputedStyle(body, null).getPropertyValue('outline-offset');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -59,3 +59,4 @@ load 565248-1.html
|
|||
load 558943-1.xhtml
|
||||
load 571105-1.xhtml
|
||||
load 573127-1.html
|
||||
load 580685.html
|
||||
|
|
|
@ -277,12 +277,15 @@ static nscoord CalcLengthWith(const nsCSSValue& aValue,
|
|||
const nsStyleFont *rootStyleFont = styleFont;
|
||||
Element* docElement = aPresContext->Document()->GetRootElement();
|
||||
|
||||
rootStyle = aPresContext->StyleSet()->ResolveStyleFor(docElement,
|
||||
nsnull);
|
||||
if (rootStyle) {
|
||||
rootStyleFont = rootStyle->GetStyleFont();
|
||||
rootFontSize = rootStyleFont->mFont.size;
|
||||
if (docElement) {
|
||||
rootStyle = aPresContext->StyleSet()->ResolveStyleFor(docElement,
|
||||
nsnull);
|
||||
if (rootStyle) {
|
||||
rootStyleFont = rootStyle->GetStyleFont();
|
||||
}
|
||||
}
|
||||
|
||||
rootFontSize = rootStyleFont->mFont.size;
|
||||
}
|
||||
|
||||
return ScaleCoord(aValue, float(rootFontSize));
|
||||
|
|
|
@ -132,6 +132,7 @@ _TEST_FILES = test_acid3_test46.html \
|
|||
test_bug524175.html \
|
||||
test_bug534804.html \
|
||||
test_bug573255.html \
|
||||
test_bug580685.html \
|
||||
test_cascade.html \
|
||||
test_compute_data_with_start_struct.html \
|
||||
test_computed_style_no_pseudo.html \
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=580685
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 580685</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=580685">Mozilla Bug 580685</a>
|
||||
<p id="display">
|
||||
<iframe id="f" src="data:text/html,<body style='outline-offset: 1rem'>">
|
||||
</iframe>
|
||||
</p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 580685 **/
|
||||
SimpleTest.waitForExplicitFinish()
|
||||
addLoadEvent(function() {
|
||||
var doc = $("f").contentDocument;
|
||||
var b = doc.body;
|
||||
doc.removeChild(doc.documentElement);
|
||||
is(doc.defaultView.getComputedStyle(b, "").outlineOffset,
|
||||
doc.defaultView.getComputedStyle(b, "").fontSize,
|
||||
"1rem did not compute correctly");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче