From 1fdff5dabf3f35953e4b780cdecbde031a505652 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Mon, 25 Jan 2016 13:37:50 +1300 Subject: [PATCH] Bug 1241394 - Hit testing with 3d transforms should use fuzzy when comparing depths. r=thinker --- layout/base/nsDisplayList.cpp | 2 +- layout/base/tests/mochitest.ini | 2 + ...reserve3d_sorting_hit_testing2_iframe.html | 97 +++++++++++++++++++ .../test_preserve3d_sorting_hit_testing2.html | 40 ++++++++ 4 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 layout/base/tests/preserve3d_sorting_hit_testing2_iframe.html create mode 100644 layout/base/tests/test_preserve3d_sorting_hit_testing2.html diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index e17dc7e0e3fc..597e84cabc90 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1856,7 +1856,7 @@ struct FramesWithDepth {} bool operator<(const FramesWithDepth& aOther) const { - if (mDepth != aOther.mDepth) { + if (!FuzzyEqual(mDepth,aOther.mDepth, 0.1)) { // We want to sort so that the shallowest item (highest depth value) is first return mDepth > aOther.mDepth; } diff --git a/layout/base/tests/mochitest.ini b/layout/base/tests/mochitest.ini index aee1fab0d417..de65f5b71a54 100644 --- a/layout/base/tests/mochitest.ini +++ b/layout/base/tests/mochitest.ini @@ -5,6 +5,7 @@ support-files = Ahem.ttf border_radius_hit_testing_iframe.html preserve3d_sorting_hit_testing_iframe.html + preserve3d_sorting_hit_testing2_iframe.html image_rgrg-256x256.png image_rrgg-256x256.png bug369950-subframe.xml @@ -41,6 +42,7 @@ support-files = multi-range-script-select-ref.html [test_preserve3d_sorting_hit_testing.html] +[test_preserve3d_sorting_hit_testing2.html] [test_after_paint_pref.html] [test_bug993936.html] skip-if = e10s diff --git a/layout/base/tests/preserve3d_sorting_hit_testing2_iframe.html b/layout/base/tests/preserve3d_sorting_hit_testing2_iframe.html new file mode 100644 index 000000000000..e9fa71977aca --- /dev/null +++ b/layout/base/tests/preserve3d_sorting_hit_testing2_iframe.html @@ -0,0 +1,97 @@ + + + + + + + +
+
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer sagittis nisi urna, a ultrices est facilisis a. Morbi porttitor vulputate odio, eu lacinia nisi. Suspendisse felis sapien, facilisis nec ex in, blandit tincidunt tellus. Sed at commodo nunc. In nibh lectus, facilisis nec magna nec, bibendum egestas nunc. Nam varius lorem in fringilla cursus. Integer dignissim, lectus vitae sodales molestie, libero purus malesuada arcu, vitae facilisis nunc dolor non mi. In nunc tortor, tempor non pharetra vitae, mattis a purus. Nulla rhoncus vitae metus vel ornare. Nunc augue dui, suscipit ac urna vel, consectetur volutpat ipsum. Nunc ac nulla ut enim laoreet placerat. Sed luctus aliquam purus, sollicitudin blandit dui blandit id. Aenean venenatis risus dolor, at viverra urna aliquam non. Morbi sit amet pellentesque justo, eget viverra augue. +

+

     + Praesent posuere ultricies orci sit amet lacinia. Suspendisse lacinia scelerisque risus, sodales egestas turpis cursus sed. Proin sed mollis mauris, vitae ultricies nibh. Nulla bibendum leo a mauris luctus, sit amet iaculis arcu blandit. Etiam pulvinar, odio et rutrum egestas, elit mi maximus ex, id elementum est tortor id turpis. Duis rhoncus et lorem vel maximus. Aenean at justo sagittis, aliquet eros eget, iaculis magna. Nam non orci congue, dapibus dui eget, sagittis nisl. Phasellus venenatis id est et tempor. Aenean condimentum tristique nibh sit amet varius. Vestibulum et lectus quis eros dapibus consectetur nec auctor dolor. Sed euismod eu felis aliquam fermentum. Donec lacinia fringilla erat, at eleifend velit tempus at. +

+
+

     + Cras justo turpis, vulputate eget venenatis sit amet, bibendum quis dolor. Cras at interdum libero. Quisque convallis rutrum magna in ultrices. Donec ut magna dolor. Mauris pulvinar ut sapien a posuere. Sed nisi elit, tincidunt vitae magna eu, dapibus suscipit purus. Maecenas tincidunt mollis eros et dictum. Duis est nulla, rhoncus tincidunt velit at, venenatis elementum velit. Phasellus lobortis sem tellus, id sodales quam dignissim nec. Phasellus pulvinar metus ex, nec gravida nunc elementum vel. Ut mattis varius fringilla. Phasellus imperdiet sit amet risus a elementum. Donec pulvinar ante sit amet massa blandit ullamcorper. Donec vitae malesuada nisl, et laoreet sem. +

+

     + Suspendisse bibendum elit blandit arcu vulputate, nec hendrerit dui vehicula. Vestibulum porta finibus odio vitae maximus. Duis in vulputate risus. Donec mattis turpis ex, vitae semper sem ultrices eu. Aliquam in ex blandit erat ultrices sollicitudin. Vestibulum porta nisl in porttitor rutrum. Integer consectetur porttitor ligula facilisis malesuada. Proin placerat enim sed lacus commodo mollis nec eu arcu. In hac habitasse platea dictumst. Curabitur luctus est risus, sit amet fringilla nunc condimentum vel. Integer mauris lorem, molestie ut nisl sit amet, pellentesque mollis quam. Aliquam posuere purus non nisi molestie semper. +

+
+

     + Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Mauris facilisis nisi diam, eu pulvinar ex sollicitudin sed. Maecenas sed eros id quam suscipit ultricies ut tincidunt quam. Donec iaculis, justo at fringilla laoreet, quam sem dapibus urna, ut eleifend odio eros et ligula. Proin urna ante, condimentum vitae sollicitudin sit amet, egestas ac nunc. Aenean sapien velit, porta a eros quis, iaculis dignissim felis. Suspendisse mollis vulputate metus vel interdum. Aliquam hendrerit elementum erat, sit amet commodo velit suscipit et. Sed semper sem at mauris rhoncus, id efficitur arcu molestie. Nam feugiat lorem pretium, consectetur felis et, fringilla dolor. Nunc dui velit, elementum non hendrerit nec, sagittis vitae odio. Curabitur nec leo tincidunt, pellentesque metus at, condimentum risus. +

+
+
+ + + + + diff --git a/layout/base/tests/test_preserve3d_sorting_hit_testing2.html b/layout/base/tests/test_preserve3d_sorting_hit_testing2.html new file mode 100644 index 000000000000..991b94640dc5 --- /dev/null +++ b/layout/base/tests/test_preserve3d_sorting_hit_testing2.html @@ -0,0 +1,40 @@ + + + + + Test for Bug 1241394 + + + + +Mozilla Bug 1241394 +
+
+
+ +