| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(LayoutUnit(-9), LayoutUnit(
1))); | 85 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(-9), LayoutUnit(
1))); |
| 86 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(-10), LayoutUnit
(0))); | 86 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(-10), LayoutUnit
())); |
| 87 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(-10), LayoutUnit
(200))); | 87 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(-10), LayoutUnit
(200))); |
| 88 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(5), LayoutUnit(1
0))); | 88 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(5), LayoutUnit(1
0))); |
| 89 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(59), LayoutUnit(
1))); | 89 EXPECT_TRUE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(59), LayoutUnit(
1))); |
| 90 | 90 |
| 91 EXPECT_FALSE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(-12), LayoutUni
t(2))); | 91 EXPECT_FALSE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(-12), LayoutUni
t(2))); |
| 92 EXPECT_FALSE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(60), LayoutUnit
(1))); | 92 EXPECT_FALSE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(60), LayoutUnit
(1))); |
| 93 EXPECT_FALSE(shape->lineOverlapsShapeMarginBounds(LayoutUnit(100), LayoutUni
t(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); |
| (...skipping 30 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 |