Path: blob/trunk/third_party/closure/goog/html/sanitizer/attributewhitelist.js
2868 views
// Copyright 2016 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.131415/**16* @fileoverview Contains the attribute whitelists for use in the Html17* sanitizer.18*/1920goog.provide('goog.html.sanitizer.AttributeSanitizedWhitelist');21goog.provide('goog.html.sanitizer.AttributeWhitelist');222324/**25* A whitelist for attributes that are always safe and allowed by default.26* The sanitizer only applies whitespace trimming to these.27* @const @dict {boolean}28*/29goog.html.sanitizer.AttributeWhitelist = {30'* ARIA-CHECKED': true,31'* ARIA-DESCRIBEDBY': true,32'* ARIA-DISABLED': true,33'* ARIA-LABEL': true,34'* ARIA-LABELLEDBY': true,35'* ARIA-READONLY': true,36'* ARIA-REQUIRED': true,37'* ARIA-SELECTED': true,38'* ABBR': true,39'* ACCEPT': true,40'* ACCESSKEY': true,41'* ALIGN': true,42'* ALT': true,43'* AUTOCOMPLETE': true,44'* AXIS': true,45'* BGCOLOR': true,46'* BORDER': true,47'* CELLPADDING': true,48'* CELLSPACING': true,49'* CHAROFF': true,50'* CHAR': true,51'* CHECKED': true,52'* CLEAR': true,53'* COLOR': true,54'* COLSPAN': true,55'* COLS': true,56'* COMPACT': true,57'* COORDS': true,58'* DATETIME': true,59'* DIR': true,60'* DISABLED': true,61'* ENCTYPE': true,62'* FACE': true,63'* FRAME': true,64'* HEIGHT': true,65'* HREFLANG': true,66'* HSPACE': true,67'* ISMAP': true,68'* LABEL': true,69'* LANG': true,70'* MAXLENGTH': true,71'* METHOD': true,72'* MULTIPLE': true,73'* NOHREF': true,74'* NOSHADE': true,75'* NOWRAP': true,76'* READONLY': true,77'* REL': true,78'* REV': true,79'* ROWSPAN': true,80'* ROWS': true,81'* RULES': true,82'* SCOPE': true,83'* SELECTED': true,84'* SHAPE': true,85'* SIZE': true,86'* SPAN': true,87'* START': true,88'* SUMMARY': true,89'* TABINDEX': true,90'* TITLE': true,91'* TYPE': true,92'* VALIGN': true,93'* VALUE': true,94'* VSPACE': true,95'* WIDTH': true96};9798/**99* A whitelist for attributes that are not safe to allow unrestricted, but are100* made safe by default policies installed by the sanitizer in101* goog.html.sanitizer.HtmlSanitizer.Builder.prototype.build, and thus allowed102* by default under these policies.103* @const @dict {boolean}104*/105goog.html.sanitizer.AttributeSanitizedWhitelist = {106107// Attributes which can contain URL fragments108'* USEMAP': true,109// Attributes which can contain URLs110'* ACTION': true,111'* CITE': true,112'* HREF': true,113// Attributes which can cause network requests114'* LONGDESC': true,115'* SRC': true,116'LINK HREF': true,117// Prevents clobbering118'* FOR': true,119'* HEADERS': true,120'* NAME': true,121// Controls where a window is opened. Prevents tab-nabbing122'A TARGET': true,123124// Attributes which could cause UI redressing.125'* CLASS': true,126'* ID': true,127128// CSS style can cause network requests and XSSs129'* STYLE': true130};131132133