Bug 598090 - Sync up the list of white-listed HTML tags and attributes in the sanitizing fragment sink with the HTML5 spec; r,a=bzbarsky
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 20 Sep 2010 17:32:04 -0400
changeset 54371 0fb87b689b2cad72775f35193346a177138dfa36
parent 54370 9fee371c01065df76c1fcaecc62406f1501ebad3
child 54372 fa3912a9240962cb863d7fe7a0c2ca46437dba03
push idunknown
push userunknown
push dateunknown
reviewersbzbarsky
bugs598090
milestone2.0b7pre
Bug 598090 - Sync up the list of white-listed HTML tags and attributes in the sanitizing fragment sink with the HTML5 spec; r,a=bzbarsky
content/base/src/nsContentSink.cpp
content/base/src/nsGkAtomList.h
--- a/content/base/src/nsContentSink.cpp
+++ b/content/base/src/nsContentSink.cpp
@@ -1730,106 +1730,132 @@ IsAttrURI(nsIAtom *aName)
 // Thanks to Mark Pilgrim and Sam Ruby for the initial whitelist
 //
 nsIAtom** const kDefaultAllowedTags [] = {
   &nsGkAtoms::a,
   &nsGkAtoms::abbr,
   &nsGkAtoms::acronym,
   &nsGkAtoms::address,
   &nsGkAtoms::area,
+  &nsGkAtoms::article,
+  &nsGkAtoms::aside,
 #ifdef MOZ_MEDIA
   &nsGkAtoms::audio,
 #endif
   &nsGkAtoms::b,
   &nsGkAtoms::bdo,
   &nsGkAtoms::big,
   &nsGkAtoms::blockquote,
   &nsGkAtoms::br,
   &nsGkAtoms::button,
+  &nsGkAtoms::canvas,
   &nsGkAtoms::caption,
   &nsGkAtoms::center,
   &nsGkAtoms::cite,
   &nsGkAtoms::code,
   &nsGkAtoms::col,
   &nsGkAtoms::colgroup,
+  &nsGkAtoms::command,
+  &nsGkAtoms::datalist,
   &nsGkAtoms::dd,
   &nsGkAtoms::del,
+  &nsGkAtoms::details,
   &nsGkAtoms::dfn,
   &nsGkAtoms::dir,
   &nsGkAtoms::div,
   &nsGkAtoms::dl,
   &nsGkAtoms::dt,
   &nsGkAtoms::em,
   &nsGkAtoms::fieldset,
+  &nsGkAtoms::figcaption,
+  &nsGkAtoms::figure,
   &nsGkAtoms::font,
+  &nsGkAtoms::footer,
   &nsGkAtoms::form,
   &nsGkAtoms::h1,
   &nsGkAtoms::h2,
   &nsGkAtoms::h3,
   &nsGkAtoms::h4,
   &nsGkAtoms::h5,
   &nsGkAtoms::h6,
+  &nsGkAtoms::header,
+  &nsGkAtoms::hgroup,
   &nsGkAtoms::hr,
   &nsGkAtoms::i,
   &nsGkAtoms::img,
   &nsGkAtoms::input,
   &nsGkAtoms::ins,
   &nsGkAtoms::kbd,
   &nsGkAtoms::label,
   &nsGkAtoms::legend,
   &nsGkAtoms::li,
   &nsGkAtoms::listing,
   &nsGkAtoms::map,
+  &nsGkAtoms::mark,
   &nsGkAtoms::menu,
+  &nsGkAtoms::meter,
+  &nsGkAtoms::nav,
   &nsGkAtoms::nobr,
+  &nsGkAtoms::noscript,
   &nsGkAtoms::ol,
   &nsGkAtoms::optgroup,
   &nsGkAtoms::option,
+  &nsGkAtoms::output,
   &nsGkAtoms::p,
   &nsGkAtoms::pre,
+  &nsGkAtoms::progress,
   &nsGkAtoms::q,
+  &nsGkAtoms::rp,
+  &nsGkAtoms::rt,
+  &nsGkAtoms::ruby,
   &nsGkAtoms::s,
   &nsGkAtoms::samp,
+  &nsGkAtoms::section,
   &nsGkAtoms::select,
   &nsGkAtoms::small,
 #ifdef MOZ_MEDIA
   &nsGkAtoms::source,
 #endif
   &nsGkAtoms::span,
   &nsGkAtoms::strike,
   &nsGkAtoms::strong,
   &nsGkAtoms::sub,
+  &nsGkAtoms::summary,
   &nsGkAtoms::sup,
   &nsGkAtoms::table,
   &nsGkAtoms::tbody,
   &nsGkAtoms::td,
   &nsGkAtoms::textarea,
   &nsGkAtoms::tfoot,
   &nsGkAtoms::th,
   &nsGkAtoms::thead,
+  &nsGkAtoms::time,
   &nsGkAtoms::tr,
+  &nsGkAtoms::track,
   &nsGkAtoms::tt,
   &nsGkAtoms::u,
   &nsGkAtoms::ul,
   &nsGkAtoms::var,
 #ifdef MOZ_MEDIA
   &nsGkAtoms::video,
 #endif
+  &nsGkAtoms::wbr,
   nsnull
 };
 
 nsIAtom** const kDefaultAllowedAttributes [] = {
   &nsGkAtoms::abbr,
   &nsGkAtoms::accept,
   &nsGkAtoms::acceptcharset,
   &nsGkAtoms::accesskey,
   &nsGkAtoms::action,
   &nsGkAtoms::align,
   &nsGkAtoms::alt,
   &nsGkAtoms::autocomplete,
+  &nsGkAtoms::autofocus,
 #ifdef MOZ_MEDIA
   &nsGkAtoms::autoplay,
 #endif
   &nsGkAtoms::axis,
   &nsGkAtoms::background,
   &nsGkAtoms::bgcolor,
   &nsGkAtoms::border,
   &nsGkAtoms::cellpadding,
@@ -1839,82 +1865,114 @@ nsIAtom** const kDefaultAllowedAttribute
   &nsGkAtoms::charset,
   &nsGkAtoms::checked,
   &nsGkAtoms::cite,
   &nsGkAtoms::_class,
   &nsGkAtoms::clear,
   &nsGkAtoms::cols,
   &nsGkAtoms::colspan,
   &nsGkAtoms::color,
+  &nsGkAtoms::contenteditable,
+  &nsGkAtoms::contextmenu,
 #ifdef MOZ_MEDIA
   &nsGkAtoms::controls,
 #endif
   &nsGkAtoms::compact,
   &nsGkAtoms::coords,
   &nsGkAtoms::datetime,
   &nsGkAtoms::dir,
   &nsGkAtoms::disabled,
+  &nsGkAtoms::draggable,
   &nsGkAtoms::enctype,
   &nsGkAtoms::face,
   &nsGkAtoms::_for,
   &nsGkAtoms::frame,
   &nsGkAtoms::headers,
   &nsGkAtoms::height,
+  &nsGkAtoms::hidden,
+  &nsGkAtoms::high,
   &nsGkAtoms::href,
   &nsGkAtoms::hreflang,
   &nsGkAtoms::hspace,
+  &nsGkAtoms::icon,
   &nsGkAtoms::id,
   &nsGkAtoms::ismap,
+  &nsGkAtoms::itemid,
+  &nsGkAtoms::itemprop,
+  &nsGkAtoms::itemref,
+  &nsGkAtoms::itemscope,
+  &nsGkAtoms::itemtype,
+  &nsGkAtoms::kind,
   &nsGkAtoms::label,
   &nsGkAtoms::lang,
+  &nsGkAtoms::list,
   &nsGkAtoms::longdesc,
 #ifdef MOZ_MEDIA
+  &nsGkAtoms::loop,
   &nsGkAtoms::loopend,
   &nsGkAtoms::loopstart,
 #endif
+  &nsGkAtoms::low,
+  &nsGkAtoms::max,
   &nsGkAtoms::maxlength,
   &nsGkAtoms::media,
   &nsGkAtoms::method,
+  &nsGkAtoms::min,
 #ifdef MOZ_MAIL_NEWS
   &nsGkAtoms::mozdonotsend,
 #endif
   &nsGkAtoms::multiple,
   &nsGkAtoms::name,
   &nsGkAtoms::nohref,
   &nsGkAtoms::noshade,
+  &nsGkAtoms::novalidate,
   &nsGkAtoms::nowrap,
+  &nsGkAtoms::open,
+  &nsGkAtoms::optimum,
+  &nsGkAtoms::pattern,
 #ifdef MOZ_MEDIA
   &nsGkAtoms::pixelratio,
+#endif
+  &nsGkAtoms::placeholder,
+#ifdef MOZ_MEDIA
   &nsGkAtoms::playbackrate,
   &nsGkAtoms::playcount,
 #endif
   &nsGkAtoms::pointSize,
 #ifdef MOZ_MEDIA
   &nsGkAtoms::poster,
   &nsGkAtoms::preload,
 #endif
   &nsGkAtoms::prompt,
+  &nsGkAtoms::pubdate,
+  &nsGkAtoms::radiogroup,
   &nsGkAtoms::readonly,
   &nsGkAtoms::rel,
+  &nsGkAtoms::required,
   &nsGkAtoms::rev,
+  &nsGkAtoms::reversed,
   &nsGkAtoms::role,
   &nsGkAtoms::rows,
   &nsGkAtoms::rowspan,
   &nsGkAtoms::rules,
+  &nsGkAtoms::scoped,
   &nsGkAtoms::scope,
   &nsGkAtoms::selected,
   &nsGkAtoms::shape,
   &nsGkAtoms::size,
   &nsGkAtoms::span,
+  &nsGkAtoms::spellcheck,
   &nsGkAtoms::src,
+  &nsGkAtoms::srclang,
   &nsGkAtoms::start,
   &nsGkAtoms::summary,
   &nsGkAtoms::tabindex,
   &nsGkAtoms::target,
   &nsGkAtoms::title,
   &nsGkAtoms::type,
   &nsGkAtoms::usemap,
   &nsGkAtoms::valign,
   &nsGkAtoms::value,
   &nsGkAtoms::vspace,
   &nsGkAtoms::width,
+  &nsGkAtoms::wrap,
   nsnull
 };
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -289,16 +289,17 @@ GK_ATOM(defaultplaybackrate, "defaultpla
 #endif
 GK_ATOM(defer, "defer")
 GK_ATOM(del, "del")
 GK_ATOM(descendant, "descendant")
 GK_ATOM(descendantOrSelf, "descendant-or-self")
 GK_ATOM(descending, "descending")
 GK_ATOM(description, "description")
 GK_ATOM(destructor, "destructor")
+GK_ATOM(details, "details")
 GK_ATOM(deviceAspectRatio, "device-aspect-ratio")
 GK_ATOM(deviceHeight, "device-height")
 GK_ATOM(deviceWidth, "device-width")
 GK_ATOM(dfn, "dfn")
 GK_ATOM(dialog, "dialog")
 GK_ATOM(difference, "difference")
 GK_ATOM(digit, "digit")
 GK_ATOM(dir, "dir")
@@ -427,26 +428,28 @@ GK_ATOM(hasSameNode, "has-same-node")
 GK_ATOM(hbox, "hbox")
 GK_ATOM(head, "head")
 GK_ATOM(header, "header")
 GK_ATOM(headers, "headers")
 GK_ATOM(height, "height")
 GK_ATOM(hgroup, "hgroup")
 GK_ATOM(hidden, "hidden")
 GK_ATOM(hidechrome, "hidechrome")
+GK_ATOM(high, "high")
 GK_ATOM(highest, "highest")
 GK_ATOM(horizontal, "horizontal")
 GK_ATOM(hover, "hover")
 GK_ATOM(hr, "hr")
 GK_ATOM(href, "href")
 GK_ATOM(hreflang, "hreflang")
 GK_ATOM(hspace, "hspace")
 GK_ATOM(html, "html")
 GK_ATOM(httpEquiv, "http-equiv")
 GK_ATOM(i, "i")
+GK_ATOM(icon, "icon")
 GK_ATOM(id, "id")
 GK_ATOM(_if, "if")
 GK_ATOM(iframe, "iframe")
 GK_ATOM(ignorecase, "ignorecase")
 GK_ATOM(ignorekeys, "ignorekeys")
 GK_ATOM(ilayer, "ilayer")
 GK_ATOM(image, "image")
 GK_ATOM(imageClickedPoint, "image-clicked-point")
@@ -474,26 +477,32 @@ GK_ATOM(instanceOf, "instanceOf")
 GK_ATOM(int32, "int32")
 GK_ATOM(int64, "int64")
 GK_ATOM(integer, "integer")
 GK_ATOM(intersection, "intersection")
 GK_ATOM(iscontainer, "iscontainer")
 GK_ATOM(isempty, "isempty")
 GK_ATOM(isindex, "isindex")
 GK_ATOM(ismap, "ismap")
+GK_ATOM(itemid, "itemid")
+GK_ATOM(itemprop, "itemprop")
+GK_ATOM(itemref, "itemref")
+GK_ATOM(itemscope, "itemscope")
+GK_ATOM(itemtype, "itemtype")
 GK_ATOM(kbd, "kbd")
 GK_ATOM(noautofocus, "noautofocus")
 GK_ATOM(keepcurrentinview, "keepcurrentinview")
 GK_ATOM(key, "key")
 GK_ATOM(keycode, "keycode")
 GK_ATOM(keydown, "keydown")
 GK_ATOM(keypress, "keypress")
 GK_ATOM(keyset, "keyset")
 GK_ATOM(keytext, "keytext")
 GK_ATOM(keyup, "keyup")
+GK_ATOM(kind, "kind")
 GK_ATOM(label, "label")
 GK_ATOM(lang, "lang")
 GK_ATOM(last, "last")
 GK_ATOM(layer, "layer")
 GK_ATOM(layout, "layout")
 GK_ATOM(leading, "leading")
 GK_ATOM(leaf, "leaf")
 GK_ATOM(left, "left")
@@ -518,19 +527,21 @@ GK_ATOM(listheader, "listheader")
 GK_ATOM(listing, "listing")
 GK_ATOM(listitem, "listitem")
 GK_ATOM(listrows, "listrows")
 GK_ATOM(load, "load")
 GK_ATOM(localedir, "localedir")
 GK_ATOM(localName, "local-name")
 GK_ATOM(longdesc, "longdesc")
 #ifdef MOZ_MEDIA
+GK_ATOM(loop, "loop")
 GK_ATOM(loopend, "loopend")
 GK_ATOM(loopstart, "loopstart")
 #endif
+GK_ATOM(low, "low")
 GK_ATOM(lowerFirst, "lower-first")
 GK_ATOM(lowest, "lowest")
 GK_ATOM(lowsrc, "lowsrc")
 GK_ATOM(ltr, "ltr")
 GK_ATOM(lwtheme, "lwtheme")
 GK_ATOM(lwthemetextcolor, "lwthemetextcolor")
 GK_ATOM(map, "map")
 GK_ATOM(manifest, "manifest")
@@ -553,16 +564,17 @@ GK_ATOM(menu, "menu")
 GK_ATOM(menubar, "menubar")
 GK_ATOM(menubutton, "menubutton")
 GK_ATOM(menugenerated, "menugenerated")
 GK_ATOM(menuitem, "menuitem")
 GK_ATOM(menulist, "menulist")
 GK_ATOM(menupopup, "menupopup")
 GK_ATOM(message, "message")
 GK_ATOM(meta, "meta")
+GK_ATOM(meter, "meter")
 GK_ATOM(method, "method")
 GK_ATOM(middle, "middle")
 GK_ATOM(min, "min")
 GK_ATOM(minheight, "minheight")
 GK_ATOM(minimum_scale, "minimum-scale")
 GK_ATOM(minpos, "minpos")
 GK_ATOM(minusSign, "minus-sign")
 GK_ATOM(minwidth, "minwidth")
@@ -703,16 +715,17 @@ GK_ATOM(onselect, "onselect")
 GK_ATOM(onset, "onset")
 GK_ATOM(onsubmit, "onsubmit")
 GK_ATOM(ontext, "ontext")
 GK_ATOM(ontransitionend, "ontransitionend")
 GK_ATOM(onunderflow, "onunderflow")
 GK_ATOM(onunload, "onunload")
 GK_ATOM(open, "open")
 GK_ATOM(optgroup, "optgroup")
+GK_ATOM(optimum, "optimum")
 GK_ATOM(option, "option")
 GK_ATOM(_or, "or")
 GK_ATOM(order, "order")
 GK_ATOM(ordinal, "ordinal")
 GK_ATOM(orient, "orient")
 GK_ATOM(orientation, "orientation")
 GK_ATOM(otherwise, "otherwise")
 GK_ATOM(output, "output")
@@ -789,16 +802,17 @@ GK_ATOM(profile, "profile")
 GK_ATOM(progressmeter, "progressmeter")
 GK_ATOM(progressNormal, "progressNormal")
 GK_ATOM(progressUndetermined, "progressUndetermined")
 GK_ATOM(projection, "projection")
 GK_ATOM(prompt, "prompt")
 GK_ATOM(propagate, "propagate")
 GK_ATOM(properties, "properties")
 GK_ATOM(property, "property")
+GK_ATOM(pubdate, "pubdate")
 GK_ATOM(pushedFloatsList, "PushedFloats-list")
 GK_ATOM(q, "q")
 GK_ATOM(query, "query")
 GK_ATOM(queryset, "queryset")
 GK_ATOM(querytype, "querytype")
 GK_ATOM(radio, "radio")
 GK_ATOM(radiogroup, "radiogroup")
 GK_ATOM(readonly, "readonly")
@@ -819,34 +833,39 @@ GK_ATOM(resizebefore, "resizebefore")
 GK_ATOM(resizer, "resizer")
 GK_ATOM(resolution, "resolution")
 GK_ATOM(resource, "resource")
 GK_ATOM(resources, "resources")
 GK_ATOM(result, "result")
 GK_ATOM(resultPrefix, "result-prefix")
 GK_ATOM(rev, "rev")
 GK_ATOM(reverse, "reverse")
+GK_ATOM(reversed, "reversed")
 GK_ATOM(richlistbox, "richlistbox")
 GK_ATOM(right, "right")
 GK_ATOM(rightmargin, "rightmargin")
 GK_ATOM(rightpadding, "rightpadding")
 GK_ATOM(role, "role")
 GK_ATOM(round, "round")
 GK_ATOM(row, "row")
 GK_ATOM(rows, "rows")
 GK_ATOM(rowspan, "rowspan")
+GK_ATOM(rp, "rp")
+GK_ATOM(rt, "rt")
 GK_ATOM(rtl, "rtl")
+GK_ATOM(ruby, "ruby")
 GK_ATOM(rule, "rule")
 GK_ATOM(rules, "rules")
 GK_ATOM(s, "s")
 GK_ATOM(samp, "samp")
 GK_ATOM(scale, "scale")
 GK_ATOM(scan, "scan")
 GK_ATOM(scheme, "scheme")
 GK_ATOM(scope, "scope")
+GK_ATOM(scoped, "scoped")
 GK_ATOM(screen, "screen")
 GK_ATOM(screenX, "screenX")
 GK_ATOM(screenY, "screenY")
 GK_ATOM(script, "script")
 GK_ATOM(scriptEnabledBeforePrintOrPreview, "scriptEnabledBeforePrintOrPreview")
 GK_ATOM(scrollbar, "scrollbar")
 GK_ATOM(scrollbarbutton, "scrollbarbutton")
 GK_ATOM(scrollbox, "scrollbox")
@@ -892,16 +911,17 @@ GK_ATOM(space, "space")
 GK_ATOM(spacer, "spacer")
 GK_ATOM(span, "span")
 GK_ATOM(spellcheck, "spellcheck")
 GK_ATOM(spinner, "spinner")
 GK_ATOM(split, "split")
 GK_ATOM(splitter, "splitter")
 GK_ATOM(spring, "spring")
 GK_ATOM(src, "src")
+GK_ATOM(srclang, "srclang")
 GK_ATOM(stack, "stack")
 GK_ATOM(standalone, "standalone")
 GK_ATOM(standby, "standby")
 GK_ATOM(start, "start")
 GK_ATOM(start_after, "start_after")
 GK_ATOM(start_before, "start_before")
 GK_ATOM(startsWith, "starts-with")
 GK_ATOM(state, "state")
@@ -947,16 +967,17 @@ GK_ATOM(test, "test")
 GK_ATOM(text, "text")
 GK_ATOM(textarea, "textarea")
 GK_ATOM(textbox, "textbox")
 GK_ATOM(textnode, "textnode")
 GK_ATOM(tfoot, "tfoot")
 GK_ATOM(th, "th")
 GK_ATOM(thead, "thead")
 GK_ATOM(thumb, "thumb")
+GK_ATOM(time, "time")
 GK_ATOM(title, "title")
 GK_ATOM(titlebar, "titlebar")
 GK_ATOM(titletip, "titletip")
 GK_ATOM(toggled, "toggled")
 GK_ATOM(token, "token")
 GK_ATOM(tokenize, "tokenize")
 GK_ATOM(toolbar, "toolbar")
 GK_ATOM(toolbarbutton, "toolbarbutton")
@@ -965,16 +986,17 @@ GK_ATOM(toolbox, "toolbox")
 GK_ATOM(tooltip, "tooltip")
 GK_ATOM(tooltiptext, "tooltiptext")
 GK_ATOM(top, "top")
 GK_ATOM(topleft, "topleft")
 GK_ATOM(topmargin, "topmargin")
 GK_ATOM(toppadding, "toppadding")
 GK_ATOM(topright, "topright")
 GK_ATOM(tr, "tr")
+GK_ATOM(track, "track")
 GK_ATOM(trailing, "trailing")
 GK_ATOM(transform, "transform")
 GK_ATOM(transformiix, "transformiix")
 GK_ATOM(translate, "translate")
 GK_ATOM(transparent, "transparent")
 GK_ATOM(tree, "tree")
 GK_ATOM(treecell, "treecell")
 GK_ATOM(treechildren, "treechildren")