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

Unified Diff: LayoutTests/fast/block/align-bigger-child.html

Issue 790943004: An align attribute should not be applied for wider children (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebaseline the failed testcase (reftest) Created 6 years 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 | LayoutTests/fast/block/align-bigger-child-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/block/align-bigger-child.html
diff --git a/LayoutTests/fast/block/align-bigger-child.html b/LayoutTests/fast/block/align-bigger-child.html
new file mode 100644
index 0000000000000000000000000000000000000000..74f223fe3a8471052244516e56ded18bfa49dceb
--- /dev/null
+++ b/LayoutTests/fast/block/align-bigger-child.html
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+
+<style>
+body{margin:0px}
+.narrow_block{width:100px}
+.narrow_block>div{background:lime;width:200px;height:20px;border:1px solid black}
+</style>
+
+<script src="../../resources/js-test.js"></script>
+
+<!-- Wider blocks inside the LTR block should be left-aligned regardless of align attribute -->
+<div align="left" class="narrow_block">
+ <div dir="rtl" id="rtl_in_ltr_left"></div>
+ <div dir="ltr" id="ltr_in_ltr_left"></div>
+</div>
+
+<div align="right" class="narrow_block">
+ <div dir="rtl" id="rtl_in_ltr_right"></div>
+ <div dir="ltr" id="ltr_in_ltr_right"></div>
+</div>
+
+<div align="center" class="narrow_block">
+ <div dir="rtl" id="rtl_in_ltr_center"></div>
+ <div dir="ltr" id="ltr_in_ltr_center"></div>
+</div>
+
+<!-- Wider blocks inside the RTL block should be right-aligned regardless of align attribute -->
+<div dir="rtl" align="right" class="narrow_block">
+ <div dir="rtl" id="rtl_in_rtl_right"></div>
+ <div dir="ltr" id="ltr_in_rtl_right"></div>
+</div>
+
+<div dir="rtl" align="left" class="narrow_block">
+ <div dir="rtl" id="rtl_in_rtl_left"></div>
+ <div dir="ltr" id="ltr_in_rtl_left"></div>
+</div>
+
+<div dir="rtl" align="center" class="narrow_block">
+ <div dir="rtl" id="rtl_in_rtl_center"></div>
+ <div dir="ltr" id="ltr_in_rtl_center"></div>
+</div>
+
+<script>
+ rtl_in_ltr_left = document.getElementById("rtl_in_ltr_left");
+ ltr_in_ltr_left = document.getElementById("ltr_in_ltr_left");
+ shouldBe("rtl_in_ltr_left.getBoundingClientRect().left","0");
+ shouldBe("ltr_in_ltr_left.getBoundingClientRect().left","0");
+
+ rtl_in_ltr_right = document.getElementById("rtl_in_ltr_right");
+ ltr_in_ltr_right = document.getElementById("ltr_in_ltr_right");
+ shouldBe("rtl_in_ltr_right.getBoundingClientRect().left","0");
+ shouldBe("ltr_in_ltr_right.getBoundingClientRect().left","0");
+
+ rtl_in_ltr_center = document.getElementById("rtl_in_ltr_center");
+ ltr_in_ltr_center = document.getElementById("ltr_in_ltr_center");
+ shouldBe("rtl_in_ltr_center.getBoundingClientRect().left","0");
+ shouldBe("ltr_in_ltr_center.getBoundingClientRect().left","0");
+
+ rtl_in_rtl_right = document.getElementById("rtl_in_rtl_right");
+ ltr_in_rtl_right = document.getElementById("ltr_in_rtl_right");
+ shouldBe("rtl_in_rtl_right.getBoundingClientRect().right","100");
+ shouldBe("ltr_in_rtl_right.getBoundingClientRect().right","100");
+
+ rtl_in_rtl_left = document.getElementById("rtl_in_rtl_left");
+ ltr_in_rtl_left = document.getElementById("ltr_in_rtl_left");
+ shouldBe("rtl_in_rtl_left.getBoundingClientRect().right","100");
+ shouldBe("ltr_in_rtl_left.getBoundingClientRect().right","100");
+
+ rtl_in_rtl_center = document.getElementById("rtl_in_rtl_center");
+ ltr_in_rtl_center = document.getElementById("ltr_in_rtl_center");
+ shouldBe("rtl_in_rtl_center.getBoundingClientRect().right","100");
+ shouldBe("ltr_in_rtl_center.getBoundingClientRect().right","100");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/block/align-bigger-child-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698