diff options
Diffstat (limited to 'dom/base/nsTreeSanitizer.cpp')
-rw-r--r-- | dom/base/nsTreeSanitizer.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dom/base/nsTreeSanitizer.cpp b/dom/base/nsTreeSanitizer.cpp index 323c851c12..4719564437 100644 --- a/dom/base/nsTreeSanitizer.cpp +++ b/dom/base/nsTreeSanitizer.cpp @@ -1385,6 +1385,8 @@ nsTreeSanitizer::SanitizeChildren(nsINode* aRoot) nsAutoString styleText; nsContentUtils::GetNodeTextContent(node, false, styleText); + RemoveAllAttributesFromDescendants(elt); + nsAutoString sanitizedStyle; nsCOMPtr<nsIURI> baseURI = node->GetBaseURI(); if (SanitizeStyleSheet(styleText, @@ -1480,6 +1482,17 @@ nsTreeSanitizer::RemoveAllAttributes(nsIContent* aElement) } } +void nsTreeSanitizer::RemoveAllAttributesFromDescendants(mozilla::dom::Element* aElement) { + nsIContent* node = aElement->GetFirstChild(); + while (node) { + if (node->IsElement()) { + mozilla::dom::Element* elt = node->AsElement(); + RemoveAllAttributes(elt); + } + node = node->GetNextNode(aElement); + } +} + void nsTreeSanitizer::InitializeStatics() { |