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

Side by Side Diff: third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp

Issue 2733633002: Handle nested position:sticky elements correctly (compositor) (Closed)
Patch Set: Use FindNodeIndexFromOwningLayerId Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 layer->stickyPositionConstraint(); 366 layer->stickyPositionConstraint();
367 ASSERT_TRUE(constraint.isSticky); 367 ASSERT_TRUE(constraint.isSticky);
368 EXPECT_TRUE(constraint.isAnchoredTop && constraint.isAnchoredLeft && 368 EXPECT_TRUE(constraint.isAnchoredTop && constraint.isAnchoredLeft &&
369 !constraint.isAnchoredRight && !constraint.isAnchoredBottom); 369 !constraint.isAnchoredRight && !constraint.isAnchoredBottom);
370 EXPECT_EQ(1.f, constraint.topOffset); 370 EXPECT_EQ(1.f, constraint.topOffset);
371 EXPECT_EQ(1.f, constraint.leftOffset); 371 EXPECT_EQ(1.f, constraint.leftOffset);
372 EXPECT_EQ(IntRect(100, 100, 10, 10), 372 EXPECT_EQ(IntRect(100, 100, 10, 10),
373 IntRect(constraint.scrollContainerRelativeStickyBoxRect)); 373 IntRect(constraint.scrollContainerRelativeStickyBoxRect));
374 EXPECT_EQ(IntRect(100, 100, 200, 200), 374 EXPECT_EQ(IntRect(100, 100, 200, 200),
375 IntRect(constraint.scrollContainerRelativeContainingBlockRect)); 375 IntRect(constraint.scrollContainerRelativeContainingBlockRect));
376 EXPECT_EQ(IntPoint(100, 100), 376 EXPECT_EQ(FloatPoint(100, 100),
377 IntPoint(constraint.parentRelativeStickyBoxOffset)); 377 FloatPoint(constraint.parentRelativeStickyBoxOffset));
378 } 378 }
379 { 379 {
380 Element* element = document->getElementById("div-tr"); 380 Element* element = document->getElementById("div-tr");
381 ASSERT_TRUE(element); 381 ASSERT_TRUE(element);
382 WebLayer* layer = webLayerFromElement(element); 382 WebLayer* layer = webLayerFromElement(element);
383 ASSERT_TRUE(layer); 383 ASSERT_TRUE(layer);
384 WebLayerStickyPositionConstraint constraint = 384 WebLayerStickyPositionConstraint constraint =
385 layer->stickyPositionConstraint(); 385 layer->stickyPositionConstraint();
386 ASSERT_TRUE(constraint.isSticky); 386 ASSERT_TRUE(constraint.isSticky);
387 EXPECT_TRUE(constraint.isAnchoredTop && !constraint.isAnchoredLeft && 387 EXPECT_TRUE(constraint.isAnchoredTop && !constraint.isAnchoredLeft &&
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 WebLayer* layer = webLayerFromElement(element); 441 WebLayer* layer = webLayerFromElement(element);
442 ASSERT_TRUE(layer); 442 ASSERT_TRUE(layer);
443 WebLayerStickyPositionConstraint constraint = 443 WebLayerStickyPositionConstraint constraint =
444 layer->stickyPositionConstraint(); 444 layer->stickyPositionConstraint();
445 ASSERT_TRUE(constraint.isSticky); 445 ASSERT_TRUE(constraint.isSticky);
446 EXPECT_TRUE(constraint.isAnchoredTop); 446 EXPECT_TRUE(constraint.isAnchoredTop);
447 EXPECT_EQ(IntRect(100, 110, 10, 10), 447 EXPECT_EQ(IntRect(100, 110, 10, 10),
448 IntRect(constraint.scrollContainerRelativeStickyBoxRect)); 448 IntRect(constraint.scrollContainerRelativeStickyBoxRect));
449 EXPECT_EQ(IntRect(100, 100, 200, 200), 449 EXPECT_EQ(IntRect(100, 100, 200, 200),
450 IntRect(constraint.scrollContainerRelativeContainingBlockRect)); 450 IntRect(constraint.scrollContainerRelativeContainingBlockRect));
451 EXPECT_EQ(IntPoint(0, 10), 451 EXPECT_EQ(FloatPoint(0, 10),
452 IntPoint(constraint.parentRelativeStickyBoxOffset)); 452 FloatPoint(constraint.parentRelativeStickyBoxOffset));
453 } 453 }
454 } 454 }
455 455
456 TEST_P(ScrollingCoordinatorTest, touchEventHandler) { 456 TEST_P(ScrollingCoordinatorTest, touchEventHandler) {
457 registerMockedHttpURLLoad("touch-event-handler.html"); 457 registerMockedHttpURLLoad("touch-event-handler.html");
458 navigateTo(m_baseURL + "touch-event-handler.html"); 458 navigateTo(m_baseURL + "touch-event-handler.html");
459 forceFullCompositingUpdate(); 459 forceFullCompositingUpdate();
460 460
461 ASSERT_EQ(WebEventListenerProperties::Blocking, 461 ASSERT_EQ(WebEventListenerProperties::Blocking,
462 webLayerTreeView()->eventListenerProperties( 462 webLayerTreeView()->eventListenerProperties(
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 MainThreadScrollingReason::kHasOpacityAndLCDText | 1165 MainThreadScrollingReason::kHasOpacityAndLCDText |
1166 MainThreadScrollingReason::kHasBorderRadius); 1166 MainThreadScrollingReason::kHasBorderRadius);
1167 } 1167 }
1168 1168
1169 TEST_P(StyleRelatedMainThreadScrollingReasonTest, BoxShadowTest) { 1169 TEST_P(StyleRelatedMainThreadScrollingReasonTest, BoxShadowTest) {
1170 testStyle("box-shadow", 1170 testStyle("box-shadow",
1171 MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer); 1171 MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer);
1172 } 1172 }
1173 1173
1174 } // namespace blink 1174 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698