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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 EXPECT_NEAR(2.232, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).height(), | 401 EXPECT_NEAR(2.232, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).height(), |
402 0.0001f); | 402 0.0001f); |
403 | 403 |
404 rgm.popMappingsToAncestor(static_cast<PaintLayer*>(nullptr)); | 404 rgm.popMappingsToAncestor(static_cast<PaintLayer*>(nullptr)); |
405 rgmNoFrame.popMappingsToAncestor(static_cast<PaintLayer*>(nullptr)); | 405 rgmNoFrame.popMappingsToAncestor(static_cast<PaintLayer*>(nullptr)); |
406 | 406 |
407 rgm.pushMappingsToAncestor(getFrameElement("test_frame", webView, "InnerDiv"), | 407 rgm.pushMappingsToAncestor(getFrameElement("test_frame", webView, "InnerDiv"), |
408 0); | 408 0); |
409 rgmNoFrame.pushMappingsToAncestor( | 409 rgmNoFrame.pushMappingsToAncestor( |
410 getFrameElement("test_frame", webView, "InnerDiv"), 0); | 410 getFrameElement("test_frame", webView, "InnerDiv"), 0); |
411 EXPECT_EQ(FloatQuad(FloatRect(21.0f, 6.0f, 1.0f, 2.0f)), | 411 EXPECT_EQ( |
412 rgm.mapToAncestor(rect, getFrameLayoutContainer( | 412 FloatQuad(FloatRect(21.0f, 6.0f, 1.0f, 2.0f)), |
413 "test_frame", webView, "CenterDiv"))); | 413 rgm.mapToAncestor( |
| 414 rect, getFrameLayoutContainer("test_frame", webView, "CenterDiv"))); |
414 EXPECT_EQ( | 415 EXPECT_EQ( |
415 FloatQuad(FloatRect(21.0f, 6.0f, 1.0f, 2.0f)), | 416 FloatQuad(FloatRect(21.0f, 6.0f, 1.0f, 2.0f)), |
416 rgmNoFrame.mapToAncestor( | 417 rgmNoFrame.mapToAncestor( |
417 rect, getFrameLayoutContainer("test_frame", webView, "CenterDiv"))); | 418 rect, getFrameLayoutContainer("test_frame", webView, "CenterDiv"))); |
418 | 419 |
419 rgm.pushMappingsToAncestor( | 420 rgm.pushMappingsToAncestor( |
420 getFrameElement("test_frame", webView, "OtherDiv"), | 421 getFrameElement("test_frame", webView, "OtherDiv"), |
421 getFrameLayoutContainer("test_frame", webView, "InnerDiv")); | 422 getFrameLayoutContainer("test_frame", webView, "InnerDiv")); |
422 rgmNoFrame.pushMappingsToAncestor( | 423 rgmNoFrame.pushMappingsToAncestor( |
423 getFrameElement("test_frame", webView, "OtherDiv"), | 424 getFrameElement("test_frame", webView, "OtherDiv"), |
424 getFrameLayoutContainer("test_frame", webView, "InnerDiv")); | 425 getFrameLayoutContainer("test_frame", webView, "InnerDiv")); |
425 EXPECT_EQ(FloatQuad(FloatRect(22.0f, 12.0f, 1.0f, 2.0f)), | 426 EXPECT_EQ( |
426 rgm.mapToAncestor(rect, getFrameLayoutContainer( | 427 FloatQuad(FloatRect(22.0f, 12.0f, 1.0f, 2.0f)), |
427 "test_frame", webView, "CenterDiv"))); | 428 rgm.mapToAncestor( |
| 429 rect, getFrameLayoutContainer("test_frame", webView, "CenterDiv"))); |
428 EXPECT_EQ( | 430 EXPECT_EQ( |
429 FloatQuad(FloatRect(22.0f, 12.0f, 1.0f, 2.0f)), | 431 FloatQuad(FloatRect(22.0f, 12.0f, 1.0f, 2.0f)), |
430 rgmNoFrame.mapToAncestor( | 432 rgmNoFrame.mapToAncestor( |
431 rect, getFrameLayoutContainer("test_frame", webView, "CenterDiv"))); | 433 rect, getFrameLayoutContainer("test_frame", webView, "CenterDiv"))); |
432 | 434 |
433 EXPECT_EQ(FloatQuad(FloatRect(1.0f, 6.0f, 1.0f, 2.0f)), | 435 EXPECT_EQ( |
434 rgm.mapToAncestor(rect, getFrameLayoutContainer( | 436 FloatQuad(FloatRect(1.0f, 6.0f, 1.0f, 2.0f)), |
435 "test_frame", webView, "InnerDiv"))); | 437 rgm.mapToAncestor( |
| 438 rect, getFrameLayoutContainer("test_frame", webView, "InnerDiv"))); |
436 EXPECT_EQ( | 439 EXPECT_EQ( |
437 FloatQuad(FloatRect(1.0f, 6.0f, 1.0f, 2.0f)), | 440 FloatQuad(FloatRect(1.0f, 6.0f, 1.0f, 2.0f)), |
438 rgmNoFrame.mapToAncestor( | 441 rgmNoFrame.mapToAncestor( |
439 rect, getFrameLayoutContainer("test_frame", webView, "InnerDiv"))); | 442 rect, getFrameLayoutContainer("test_frame", webView, "InnerDiv"))); |
440 | 443 |
441 EXPECT_NEAR(87.8975f, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).x(), | 444 EXPECT_NEAR(87.8975f, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).x(), |
442 0.0001f); | 445 0.0001f); |
443 EXPECT_NEAR(8.1532f, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).y(), | 446 EXPECT_NEAR(8.1532f, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).y(), |
444 0.0001f); | 447 0.0001f); |
445 EXPECT_NEAR(1.866, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).width(), | 448 EXPECT_NEAR(1.866, rectFromQuad(rgm.mapToAncestor(rect, nullptr)).width(), |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 EXPECT_EQ(FloatRect(263.0f, 154.0f, 10.0f, 8.0f), | 531 EXPECT_EQ(FloatRect(263.0f, 154.0f, 10.0f, 8.0f), |
529 rectFromQuad(rgm.mapToAncestor(rect, nullptr))); | 532 rectFromQuad(rgm.mapToAncestor(rect, nullptr))); |
530 | 533 |
531 rgm.pushMappingsToAncestor(floating, span); | 534 rgm.pushMappingsToAncestor(floating, span); |
532 EXPECT_EQ(rect, rectFromQuad(rgm.mapToAncestor(rect, container))); | 535 EXPECT_EQ(rect, rectFromQuad(rgm.mapToAncestor(rect, container))); |
533 EXPECT_EQ(FloatRect(63.0f, 54.0f, 10.0f, 8.0f), | 536 EXPECT_EQ(FloatRect(63.0f, 54.0f, 10.0f, 8.0f), |
534 rectFromQuad(rgm.mapToAncestor(rect, nullptr))); | 537 rectFromQuad(rgm.mapToAncestor(rect, nullptr))); |
535 } | 538 } |
536 | 539 |
537 } // namespace blink | 540 } // namespace blink |
OLD | NEW |