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

Unified Diff: third_party/WebKit/LayoutTests/fragmentation/remove-unbreakable-block-in-line-float.html

Issue 2521963002: Add test for line float that removes a tall unbreakable block child. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fragmentation/remove-unbreakable-block-in-line-float.html
diff --git a/third_party/WebKit/LayoutTests/fragmentation/remove-unbreakable-block-in-line-float.html b/third_party/WebKit/LayoutTests/fragmentation/remove-unbreakable-block-in-line-float.html
new file mode 100644
index 0000000000000000000000000000000000000000..9e5ec95743138c74cd3a13f06c13ec6a273bebf6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fragmentation/remove-unbreakable-block-in-line-float.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<p>There should be two blue squares below.</p>
+<div style="position:relative; columns:2; column-fill:auto; height:120px; line-height:20px; orphans:1; widows:1;">
+ <!-- line 1 --><br>
+ <!-- line 2 --><br>
+ <!-- line 3 --><br>
+ <!-- line 4 --><br>
+ <div id="floater" style="float:left; width:40px; height:80px; background:blue;">
+ <div id="child" style="break-inside:avoid; height:80px;"></div>
+ </div>
+ <!-- line 5 --><br>
+ <!-- line 6 --><br>
+ <!-- line 7 --><br>
+ <!-- line 8 --><br>
+</div>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<script>
+test(() => {
+ var floater = document.getElementById("floater");
+ var child = document.getElementById("child");
+ document.body.offsetTop;
+
+ assert_equals(floater.offsetTop, 0);
+ // The float contains a tall unbreakable block. Its natural position would
+ // be to start flush with line 5, because that's where it lies in the DOM,
+ // but since we only have 40px column space left at that point, and it
+ // contains something unbreakable that's 80px tall, it needs to be pushed to
+ // the next column, and therefore end up next to line 7. Now, if we remove
+ // the unbreakable block, it should jump back to line 5, though.
+ child.style.display = "none";
+ assert_equals(floater.offsetTop, 80);
+}, "Remove a tall unbreakable block inside a float.");
+</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698