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

Unified Diff: LayoutTests/fast/css/absolute-position-with-negative-width.html

Issue 578723003: Don't allow negative width for positioned elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a test Created 6 years, 3 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/absolute-position-with-negative-width.html
diff --git a/LayoutTests/fast/css/absolute-position-with-negative-width.html b/LayoutTests/fast/css/absolute-position-with-negative-width.html
new file mode 100644
index 0000000000000000000000000000000000000000..3d04849952d1d8232da6593a0c8e8d0e8dd505a3
--- /dev/null
+++ b/LayoutTests/fast/css/absolute-position-with-negative-width.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<html>
rune 2014/09/17 11:32:57 No need to include html, head or body elements.
Kyungtae Kim 2014/09/18 12:50:07 Done.
+<head>
+ <script src="../../resources/js-test.js"></script>
+ <script type="text/javascript">
rune 2014/09/17 11:32:56 Drop the type attribute.
Kyungtae Kim 2014/09/18 12:50:06 Done.
+ function test()
+ {
+ if (!window.testRunner)
rune 2014/09/17 11:32:57 There nothing below relying on testRunner below af
Kyungtae Kim 2014/09/18 12:50:06 Done.
+ return;
+ absolute_with_left_right = document.getElementById("absolute_with_left_right");
+ shouldBe("absolute_with_left_right.getBoundingClientRect().width","0");
+ shouldBe("absolute_with_left_right.getClientRects()[0].width","0");
+ shouldBe("absolute_with_left_right.offsetWidth","0");
+ absolute_with_negative_width = document.getElementById("absolute_with_negative_width");
+ shouldBe("absolute_with_negative_width.getBoundingClientRect().width","0");
+ shouldBe("absolute_with_negative_width.getClientRects()[0].width","0");
+ shouldBe("absolute_with_negative_width.offsetWidth","0");
+ }
+ </script>
+</head>
+<body onLoad="test()">
rune 2014/09/17 11:32:57 Why does this test need to wait for the onload eve
Kyungtae Kim 2014/09/18 12:50:07 Done.
+ <div style="position: relative; width: 0px">
+ <div style="position: absolute; left: 1px; right: 1px;" id="absolute_with_left_right"></div>
+ <div style="position: absolute; left: 1px; right: 1px; width:-10px" id="absolute_with_negative_width"></div>
rune 2014/09/17 11:32:56 This element and corresponding tests don't add any
Kyungtae Kim 2014/09/18 12:50:07 Done.
+ </div>
+</body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698