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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/sticky/sticky-position-valid-after-insertion.html

Issue 2647533002: Force compositing inputs to be clean for getBoundingClientRect (Closed)
Patch Set: Rebase Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/sticky/sticky-position-valid-after-layout.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/sticky/sticky-position-valid-after-insertion.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-position-valid-after-insertion.html b/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-position-valid-after-insertion.html
new file mode 100644
index 0000000000000000000000000000000000000000..194c845bfbdd694cdead415f21d0fd254d277a35
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-position-valid-after-insertion.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<style>
+body {
+ margin: 0;
+}
+
+.scroller {
+ height: 100px;
+ width: 200px;
+ overflow: scroll;
+}
+
+.padding {
+ width: 400px;
+ height: 500px;
+}
+
+.sticky {
+ width: 25px;
+ height: 25px;
+ position: sticky;
+ top: 20px;
+ left: 50px;
+}
+</style>
+
+<div class="scroller" id="scroller">
+ <div class="padding" id="padding"></div>
+</div>
+
+<div class="scroller" id="scroller2">
+ <div class="padding" id="padding2"></div>
+</div>
+
+<script>
+if (window.internals) {
+ internals.settings.setCSSStickyPositionEnabled(true);
+}
+
+test(function() {
+ var scroller = document.getElementById('scroller');
+ scroller.scrollTop = 100;
+ scroller.scrollLeft = 50;
+
+ var sticky = document.createElement('div');
+ sticky.className = 'sticky';
+ scroller.insertBefore(sticky, document.getElementById('padding'));
+
+ assert_equals(sticky.offsetTop, scroller.scrollTop + 20);
+ assert_equals(sticky.offsetLeft, scroller.scrollLeft + 50);
+}, "offsetTop/offsetLeft should be correct for sticky after insertion");
+
+test(function() {
+ var scroller = document.getElementById('scroller2');
+ scroller.scrollTop = 100;
+ scroller.scrollLeft = 50;
+
+ var sticky = document.createElement('div');
+ sticky.className = 'sticky';
+ scroller.insertBefore(sticky, document.getElementById('padding2'));
+
+ assert_equals(sticky.getBoundingClientRect().top, 120);
+ assert_equals(sticky.getBoundingClientRect().left, 50);
+}, "getBoundingClientRect should be correct for sticky after insertion");
+
+
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/sticky/sticky-position-valid-after-layout.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698