Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: LayoutTests/fast/css/getComputedStyle/computed-style-top-of-absolute-positioned-element.html

Issue 1007623003: Fix incorrect percentage top for positioned elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698