Bug 1470229 part 2 - Allow aria attributes. r?hsivonen draft
authorXidorn Quan <me@upsuper.org>
Fri, 22 Jun 2018 15:29:43 +1000
changeset 809457 c2fc788bc65ecb16594b311853ce2505d77ad51e
parent 809456 70056a83e7f3d22f8105d6d67b5c0020ebf258a9
push id113683
push userxquan@mozilla.com
push dateFri, 22 Jun 2018 05:30:18 +0000
reviewershsivonen
bugs1470229
milestone62.0a1
Bug 1470229 part 2 - Allow aria attributes. r?hsivonen MozReview-Commit-ID: 6tDCQLHYsH7
dom/base/nsTreeSanitizer.cpp
--- a/dom/base/nsTreeSanitizer.cpp
+++ b/dom/base/nsTreeSanitizer.cpp
@@ -1242,18 +1242,20 @@ nsTreeSanitizer::SanitizeAttributes(mozi
         // <meta name itemprop> or
         // <link rel itemprop>
         continue;
       }
       const char16_t* localStr = attrLocal->GetUTF16String();
       uint32_t localLen = attrLocal->GetLength();
       // Allow underscore to cater to the MCE editor library.
       // Allow data-* on SVG and MathML, too, as a forward-compat measure.
+      // Allow aria-* on all for simplicity.
       if (UTF16StringStartsWith(localStr, localLen, u"_") ||
-          UTF16StringStartsWith(localStr, localLen, u"data-")) {
+          UTF16StringStartsWith(localStr, localLen, u"data-") ||
+          UTF16StringStartsWith(localStr, localLen, u"aria-")) {
         continue;
       }
       // else not allowed
     } else if (kNameSpaceID_XML == attrNs) {
       if (nsGkAtoms::base == attrLocal) {
         if (SanitizeURL(aElement, attrNs, attrLocal)) {
           // in case the attribute removal shuffled the attribute order, start
           // the loop again.