Dividend stripping: the loss meets the dividend
The first rule targets a classic manoeuvre: buying a share just before it pays a dividend, collecting the dividend, then selling just after when the price has dropped by roughly the dividend, and booking the fall as a loss. Under Section 94(7), if you bought the share within three months before the record date and sell it within three months after, the loss on the sale is disallowed to the extent of the dividend you received. For mutual-fund units the after-window is nine months.
So the loss and the dividend are netted against each other, and you cannot use the loss to shelter other gains while pocketing the dividend. The dividend stays taxable in your hands, and the loss simply disappears up to that amount. Any loss beyond the dividend is still allowed. The point is that the artificial part, the fall that matches the dividend, is stripped out.