def test_intersect02(self): a = DOMRect() b = DOMRect(30, 50, 100, 200) c = a.intersect(b) self.assertTrue(c.isempty()) self.assertTrue(not c.isvalid()) self.assertTrue(a.isempty()) self.assertTrue(not a.isvalid()) self.assertEqual((30, 50, 100, 200), (b.x, b.y, b.width, b.height))
def test_intersect03(self): a = DOMRect(30, 50, 100, 200) b = DOMRect() c = a.intersect(b) self.assertTrue(not c.isempty()) self.assertTrue(c.isvalid()) self.assertEqual((30, 50, 100, 200), (c.x, c.y, c.width, c.height)) self.assertEqual((30, 50, 100, 200), (a.x, a.y, a.width, a.height)) self.assertTrue(b.isempty()) self.assertTrue(not b.isvalid())
def test_intersect01(self): a = DOMRect() b = DOMRect() c = a.intersect(b) self.assertTrue(c.isempty()) self.assertTrue(not c.isvalid())