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

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

Issue 2642763009: Fix paint and rect mapping issues for stacked float under stacked inline (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 rectFromQuad(rgm.mapToAncestor(rect, container))); 526 rectFromQuad(rgm.mapToAncestor(rect, container)));
527 EXPECT_EQ(FloatRect(263.0f, 154.0f, 10.0f, 8.0f), 527 EXPECT_EQ(FloatRect(263.0f, 154.0f, 10.0f, 8.0f),
528 rectFromQuad(rgm.mapToAncestor(rect, nullptr))); 528 rectFromQuad(rgm.mapToAncestor(rect, nullptr)));
529 529
530 rgm.pushMappingsToAncestor(floating, span); 530 rgm.pushMappingsToAncestor(floating, span);
531 EXPECT_EQ(rect, rectFromQuad(rgm.mapToAncestor(rect, container))); 531 EXPECT_EQ(rect, rectFromQuad(rgm.mapToAncestor(rect, container)));
532 EXPECT_EQ(FloatRect(63.0f, 54.0f, 10.0f, 8.0f), 532 EXPECT_EQ(FloatRect(63.0f, 54.0f, 10.0f, 8.0f),
533 rectFromQuad(rgm.mapToAncestor(rect, nullptr))); 533 rectFromQuad(rgm.mapToAncestor(rect, nullptr)));
534 } 534 }
535 535
536 TEST_P(LayoutGeometryMapTest, StackedFloatUnderInlineLayer) {
537 registerMockedHttpURLLoad("rgm_stacked_float_under_inline.html");
538 FrameTestHelpers::WebViewHelper webViewHelper;
539 WebView* webView = webViewHelper.initializeAndLoad(
540 m_baseURL + "rgm_stacked_float_under_inline.html", true, 0, 0);
541 webView->resize(WebSize(1000, 1000));
542 webView->updateAllLifecyclePhases();
543
544 LayoutGeometryMap rgm;
545 auto* layerUnderFloat = getLayoutBox(webView, "layer-under-float");
546 auto* span = getElement(webView, "span")->layoutBoxModelObject();
547 auto* floating = getLayoutBox(webView, "float");
548 auto* container = getLayoutBox(webView, "container");
549 FloatRect rect(3.0f, 4.0f, 10.0f, 8.0f);
550
551 rgm.pushMappingsToAncestor(container->layer(), nullptr);
552 rgm.pushMappingsToAncestor(span->layer(), container->layer());
553 rgm.pushMappingsToAncestor(layerUnderFloat->layer(), span->layer());
554 // Includes offsets of span, floating and layerUnderFloat.
555 EXPECT_EQ(FloatRect(253.0f, 154.0f, 10.0f, 8.0f),
556 rectFromQuad(rgm.mapToAncestor(rect, container)));
557 // Includes all offsets.
558 EXPECT_EQ(FloatRect(313.0f, 204.0f, 10.0f, 8.0f),
559 rectFromQuad(rgm.mapToAncestor(rect, nullptr)));
560
561 rgm.popMappingsToAncestor(span->layer());
562 // Includes offset of span.
563 EXPECT_EQ(FloatRect(203.0f, 104.0f, 10.0f, 8.0f),
564 rectFromQuad(rgm.mapToAncestor(rect, container)));
565 // Includes offsets of container and span.
566 EXPECT_EQ(FloatRect(263.0f, 154.0f, 10.0f, 8.0f),
567 rectFromQuad(rgm.mapToAncestor(rect, nullptr)));
568
569 rgm.pushMappingsToAncestor(floating, span);
570 // Includes offsets of span and floating.
571 EXPECT_EQ(FloatRect(243.0f, 134.0f, 10.0f, 8.0f),
572 rectFromQuad(rgm.mapToAncestor(rect, container)));
573 // Includes offsets of container, span and floating.
574 EXPECT_EQ(FloatRect(303.0f, 184.0f, 10.0f, 8.0f),
575 rectFromQuad(rgm.mapToAncestor(rect, nullptr)));
576 }
577
536 } // namespace blink 578 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698