All Downloads are FREE. Search and download functionalities are using the official Maven repository.

goog.labs.html.attribute_rewriter.js Maven / Gradle / Ivy

// Copyright 2014 The Closure Library Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


goog.provide('goog.labs.html.AttributeRewriter');
goog.provide('goog.labs.html.AttributeValue');
goog.provide('goog.labs.html.attributeRewriterPresubmitWorkaround');


/**
 * The type of an attribute value.
 * 

* Many HTML attributes contain structured data like URLs, CSS, or even entire * HTML documents, so the type is a union of several variants. * * @typedef {(string | * goog.html.SafeHtml | goog.html.SafeStyle | goog.html.SafeUrl)} */ goog.labs.html.AttributeValue; /** * A function that takes an attribute value, and returns a safe value. *

* Since rewriters can be chained, a rewriter must be able to accept the output * of another rewriter, instead of just a string though a rewriter that coerces * its input to a string before checking its safety will fail safe. *

* The meaning of the result is: *

* * * * * *
{@code null}Unsafe. The attribute should not be output.
a stringThe plain text (not HTML-entity encoded) of a safe attribute * value.
a {@link goog.html.SafeHtml}A fragment that is safe to be included as embedded HTML as in * {@code