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

Unified Diff: third_party/WebKit/LayoutTests/fast/block/large-padding.html

Issue 2716583002: Avoid negative content box sizes. (Closed)
Patch Set: code review Created 3 years, 10 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: third_party/WebKit/LayoutTests/fast/block/large-padding.html
diff --git a/third_party/WebKit/LayoutTests/fast/block/large-padding.html b/third_party/WebKit/LayoutTests/fast/block/large-padding.html
new file mode 100644
index 0000000000000000000000000000000000000000..adac9f6c424372a69a66b47e0f652a0a37d80701
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/block/large-padding.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<div style="position:relative; width:500px;">
+ <!-- With such large horizontal borders and padding, the content box width
+ of the following block should become 0, since its available width is
+ just 500px. The percentage padding specified on its child should
+ resolve to 0 for all sides, since percentage padding is always
+ resolved against the logical *width* of the containing block (even for
+ padding-top and padding-bottom). -->
+ <div style="position:relative; padding:0 1234567890px; border-width:0 1234567890px; border-style:solid;">
+ <div id="inner" style="padding:10%; height:300px;"></div>
+ </div>
+ <!-- And here's a sibling to verify that the insane border and padding and
+ percentage padding resolution didn't have any ill effects on block
+ progression. -->
+ <div id="sibling"></div>
+</div>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+ test(() => {
+ assert_equals(document.getElementById("sibling").offsetTop, 300);
+ assert_equals(document.getElementById("inner").offsetWidth, 0);
+ assert_equals(document.getElementById("inner").offsetHeight, 300);
+ }, "Sizes should never become negative");
+</script>

Powered by Google App Engine
This is Rietveld 408576698