Gooch, here are the canonists Bouscaren and Ellis on the canon in question:
"It is illicit for Catholics in any way to assist actively or take part in sacred worship of non-Catholics (c. 1258/1). Passive or merely material presence, for sake of civil courtesy, duty or respect, for a grave reason which in case of doubt should have the approval of the Bishop may be tolerated at the funerals, weddings and other such celebration of non-Catholics, provided there is no danger of perversion or of scandal (c. 1258/2).
1. Active Participation. A person would participate actively in the worship of non-Catholics if, besides being physically present in the place where such worship was being conducted, he placed some positive act of worship in common with the non-Catholic worshipers. Such co-operation would be formal if it were done with the intention of really taking part in the worship; it would be merely material if done without that intention but for some other reaosn, for example mere civility or friendship. All active participation is forbidden by the first paragraph of this canon, whether it be formal or merely material.
2. Passive Presence. The second paragraph speaks of "merely passive or material presence." A person is passively present if he is present without joining in any positive act of worship; his presence is voluntary but he abstains from any positive action. It is conceivable that even merely passive presence might be accompanied by an internal intention to approve, assent to, or encourage the non-Catholic worship; if that were true it would be formal cooperation in an evil act, and forbidden by the natural law. The canon supposes that this is not the case, and consequently that the passive presence is merely material. Even then such presence is not simply permitted because, though not intrinsically wrong by reason of it's object (the thing done) it is likely to be wrong by reason of it's circumstances or consequences. Hence three conditions are laid down for it's licitness: (1) That there be a grave reason based on considerations of civil courtesy, duty, or respect; (2) that in case of doubt the sufficiency of the reason be approved by the Bishop; (3) that there be no danger either of perversion or scandal. The functions at which such presence is then permitted are given by way of example, "funerals, weddings and other similar celebrations." Applications of this canon are very numerous and varied; their discussion pertains rather to moral theology (Bouscaren and Ellis, 1946, pp 639-640 emphasis added)."