| OLD | NEW |
| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 registerMockedHttpURLLoad("rgm_contains_fixed_position_test.html"); | 284 registerMockedHttpURLLoad("rgm_contains_fixed_position_test.html"); |
| 285 FrameTestHelpers::WebViewHelper webViewHelper; | 285 FrameTestHelpers::WebViewHelper webViewHelper; |
| 286 WebView* webView = webViewHelper.initializeAndLoad( | 286 WebView* webView = webViewHelper.initializeAndLoad( |
| 287 m_baseURL + "rgm_contains_fixed_position_test.html", true, 0, 0); | 287 m_baseURL + "rgm_contains_fixed_position_test.html", true, 0, 0); |
| 288 webView->resize(WebSize(1000, 1000)); | 288 webView->resize(WebSize(1000, 1000)); |
| 289 webView->updateAllLifecyclePhases(); | 289 webView->updateAllLifecyclePhases(); |
| 290 | 290 |
| 291 FloatRect rect(0.0f, 0.0f, 100.0f, 100.0f); | 291 FloatRect rect(0.0f, 0.0f, 100.0f, 100.0f); |
| 292 LayoutGeometryMap rgm; | 292 LayoutGeometryMap rgm; |
| 293 | 293 |
| 294 // This fixed position element is not contained and so is attached at the top
of the viewport. | 294 // This fixed position element is not contained and so is attached at the top |
| 295 // of the viewport. |
| 295 rgm.pushMappingsToAncestor(getLayoutBox(webView, "simple-container"), 0); | 296 rgm.pushMappingsToAncestor(getLayoutBox(webView, "simple-container"), 0); |
| 296 EXPECT_EQ(FloatQuad(FloatRect(8.0f, 100.0f, 100.0f, 100.0f)), | 297 EXPECT_EQ(FloatQuad(FloatRect(8.0f, 100.0f, 100.0f, 100.0f)), |
| 297 rgm.mapToAncestor(rect, nullptr)); | 298 rgm.mapToAncestor(rect, nullptr)); |
| 298 rgm.pushMappingsToAncestor(getLayoutBox(webView, "fixed1"), | 299 rgm.pushMappingsToAncestor(getLayoutBox(webView, "fixed1"), |
| 299 getLayoutBox(webView, "simple-container")); | 300 getLayoutBox(webView, "simple-container")); |
| 300 EXPECT_EQ(FloatQuad(FloatRect(8.0f, 50.0f, 100.0f, 100.0f)), | 301 EXPECT_EQ(FloatQuad(FloatRect(8.0f, 50.0f, 100.0f, 100.0f)), |
| 301 rgm.mapToAncestor(rect, nullptr)); | 302 rgm.mapToAncestor(rect, nullptr)); |
| 302 rgm.popMappingsToAncestor(static_cast<PaintLayer*>(nullptr)); | 303 rgm.popMappingsToAncestor(static_cast<PaintLayer*>(nullptr)); |
| 303 | 304 |
| 304 // Transforms contain fixed position descendants. | 305 // Transforms contain fixed position descendants. |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 rgm.popMappingsToAncestor(static_cast<PaintLayer*>(nullptr)); | 463 rgm.popMappingsToAncestor(static_cast<PaintLayer*>(nullptr)); |
| 463 rgm.pushMappingsToAncestor(getLayoutBox(webView, "Col3"), nullptr); | 464 rgm.pushMappingsToAncestor(getLayoutBox(webView, "Col3"), nullptr); |
| 464 EXPECT_NEAR(8.0f + offset * 2.0f, | 465 EXPECT_NEAR(8.0f + offset * 2.0f, |
| 465 rectFromQuad(rgm.mapToAncestor(rect, nullptr)).x(), 0.1f); | 466 rectFromQuad(rgm.mapToAncestor(rect, nullptr)).x(), 0.1f); |
| 466 EXPECT_NEAR(8.0f, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).y(), 0.1f); | 467 EXPECT_NEAR(8.0f, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).y(), 0.1f); |
| 467 EXPECT_EQ(5.0f, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).width()); | 468 EXPECT_EQ(5.0f, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).width()); |
| 468 EXPECT_EQ(3.0f, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).height()); | 469 EXPECT_EQ(3.0f, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).height()); |
| 469 } | 470 } |
| 470 | 471 |
| 471 } // namespace blink | 472 } // namespace blink |
| OLD | NEW |