Index: LayoutTests/fast/css/getComputedStyle/computed-style-top-of-absolute-positioned-element.html |
diff --git a/LayoutTests/fast/css/getComputedStyle/computed-style-top-of-absolute-positioned-element.html b/LayoutTests/fast/css/getComputedStyle/computed-style-top-of-absolute-positioned-element.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d5ad63258674c05c1423d122cdf14712d119d6bc |
--- /dev/null |
+++ b/LayoutTests/fast/css/getComputedStyle/computed-style-top-of-absolute-positioned-element.html |
@@ -0,0 +1,34 @@ |
+<!DOCTYPE html> |
+<style> |
+.outer { |
+ position: absolute; |
+} |
+.outerMarginBorderPadding { |
+ position: absolute; |
+ border: 10px solid red; |
+ margin: 20px; |
+ padding: 30px; |
+} |
+ |
+.inner { |
+ width: 20px; |
+ height: 20px; |
+ top: 50%; |
+ background: blue; |
+ position: absolute; |
+} |
+ |
+</style> |
+<div class='outer'> |
+ <div class='inner'></div> |
+</div> |
+<script src="../../../resources/js-test.js"></script> |
+<script> |
+ var inner = document.querySelector(".inner"); |
+ var outer = document.querySelector(".outer"); |
+ var computedStyle = window.getComputedStyle(inner, null); |
+ shouldBeEqualToString("computedStyle.getPropertyValue('top')", "0px"); |
+ |
+ outer.className = "outerMarginBorderPadding"; |
+ shouldBeEqualToString("computedStyle.getPropertyValue('top')", "30px"); |
+</script> |