| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2013 Adobe Systems Incorporated. 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 { | 75 { |
| 76 OwnPtr<Shape> shape = createBoxShape(FloatRoundedRect(0, 0, 100, 50), 10); | 76 OwnPtr<Shape> shape = createBoxShape(FloatRoundedRect(0, 0, 100, 50), 10); |
| 77 EXPECT_FALSE(shape->isEmpty()); | 77 EXPECT_FALSE(shape->isEmpty()); |
| 78 | 78 |
| 79 EXPECT_EQ(LayoutRect(-10, -10, 120, 70), shape->shapeMarginLogicalBoundingBo
x()); | 79 EXPECT_EQ(LayoutRect(-10, -10, 120, 70), shape->shapeMarginLogicalBoundingBo
x()); |
| 80 | 80 |
| 81 // A BoxShape's bounds include the top edge but not the bottom edge. | 81 // A BoxShape's bounds include the top edge but not the bottom edge. |
| 82 // Similarly a "line", specified as top,height to the overlap methods, | 82 // Similarly a "line", specified as top,height to the overlap methods, |
| 83 // is defined as top <= y < top + height. | 83 // is defined as top <= y < top + height. |
| 84 | 84 |
| 85 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(-9, 1)); | 85 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(-9), LayoutUnit(
1))); |
| 86 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(-10, 0)); | 86 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(-10), LayoutUnit
(0))); |
| 87 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(-10, 200)); | 87 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(-10), LayoutUnit
(200))); |
| 88 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(5, 10)); | 88 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(5), LayoutUnit(1
0))); |
| 89 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(59, 1)); | 89 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(59), LayoutUnit(
1))); |
| 90 | 90 |
| 91 EXPECT_FALSE(shape->lineOverlapsShapeMarginBounds(-12, 2)); | 91 EXPECT_FALSE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(-12), LayoutUni
t(2))); |
| 92 EXPECT_FALSE(shape->lineOverlapsShapeMarginBounds(60, 1)); | 92 EXPECT_FALSE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(60), LayoutUnit
(1))); |
| 93 EXPECT_FALSE(shape->lineOverlapsShapeMarginBounds(100, 200)); | 93 EXPECT_FALSE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(100), LayoutUni
t(200))); |
| 94 | 94 |
| 95 TEST_EXCLUDED_INTERVAL(shape, -9, 1, -10, 110); | 95 TEST_EXCLUDED_INTERVAL(shape, -9, 1, -10, 110); |
| 96 TEST_EXCLUDED_INTERVAL(shape, -10, 0, -10, 110); | 96 TEST_EXCLUDED_INTERVAL(shape, -10, 0, -10, 110); |
| 97 TEST_EXCLUDED_INTERVAL(shape, -10, 200, -10, 110); | 97 TEST_EXCLUDED_INTERVAL(shape, -10, 200, -10, 110); |
| 98 TEST_EXCLUDED_INTERVAL(shape, 5, 10, -10, 110); | 98 TEST_EXCLUDED_INTERVAL(shape, 5, 10, -10, 110); |
| 99 TEST_EXCLUDED_INTERVAL(shape, 59, 1, -10, 110); | 99 TEST_EXCLUDED_INTERVAL(shape, 59, 1, -10, 110); |
| 100 | 100 |
| 101 TEST_NO_EXCLUDED_INTERVAL(shape, -12, 2); | 101 TEST_NO_EXCLUDED_INTERVAL(shape, -12, 2); |
| 102 TEST_NO_EXCLUDED_INTERVAL(shape, 60, 1); | 102 TEST_NO_EXCLUDED_INTERVAL(shape, 60, 1); |
| 103 TEST_NO_EXCLUDED_INTERVAL(shape, 100, 200); | 103 TEST_NO_EXCLUDED_INTERVAL(shape, 100, 200); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 127 TEST_EXCLUDED_INTERVAL(shape, 5, 25, 0, 100); | 127 TEST_EXCLUDED_INTERVAL(shape, 5, 25, 0, 100); |
| 128 TEST_EXCLUDED_INTERVAL(shape, 15, 6, 0, 100); | 128 TEST_EXCLUDED_INTERVAL(shape, 15, 6, 0, 100); |
| 129 TEST_EXCLUDED_INTERVAL(shape, 20, 50, 0, 100); | 129 TEST_EXCLUDED_INTERVAL(shape, 20, 50, 0, 100); |
| 130 TEST_EXCLUDED_INTERVAL(shape, 69, 5, 0, 100); | 130 TEST_EXCLUDED_INTERVAL(shape, 69, 5, 0, 100); |
| 131 TEST_EXCLUDED_INTERVAL(shape, 85, 10, 0, 97.320511f); | 131 TEST_EXCLUDED_INTERVAL(shape, 85, 10, 0, 97.320511f); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // anonymous namespace | 134 } // anonymous namespace |
| 135 | 135 |
| 136 } // namespace blink | 136 } // namespace blink |
| OLD | NEW |