Bug 865147 - Fix crash in nsContentUtils::ContentIsDescendantOf by checking parent of 'before' node, r=bz, feedback=Ms2ger