diff --git a/examples/acroforms/index.html b/examples/acroforms/index.html index 3011e016a..1936ae1e1 100644 --- a/examples/acroforms/index.html +++ b/examples/acroforms/index.html @@ -11,6 +11,7 @@ + + + diff --git a/test/unit/unit_test.html b/test/unit/unit_test.html index 5fe1f254b..687bd5201 100644 --- a/test/unit/unit_test.html +++ b/test/unit/unit_test.html @@ -36,6 +36,7 @@ + diff --git a/web/annotations_layer_builder.js b/web/annotations_layer_builder.js index 7e81c7e0e..752e43134 100644 --- a/web/annotations_layer_builder.js +++ b/web/annotations_layer_builder.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/*globals PDFJS, CustomStyle, mozL10n, SimpleLinkService */ +/*globals PDFJS, mozL10n, SimpleLinkService */ 'use strict'; @@ -27,6 +27,8 @@ * @class */ var AnnotationsLayerBuilder = (function AnnotationsLayerBuilderClosure() { + var CustomStyle = PDFJS.CustomStyle; + /** * @param {AnnotationsLayerBuilderOptions} options * @constructs AnnotationsLayerBuilder diff --git a/web/pdf_page_view.js b/web/pdf_page_view.js index 52b3f59df..021fe7f4a 100644 --- a/web/pdf_page_view.js +++ b/web/pdf_page_view.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals RenderingStates, PDFJS, CustomStyle, CSS_UNITS, getOutputScale, +/* globals RenderingStates, PDFJS, CSS_UNITS, getOutputScale, TextLayerBuilder, AnnotationsLayerBuilder, Promise, approximateFraction, roundToDivide */ @@ -36,6 +36,8 @@ var TEXT_LAYER_RENDER_DELAY = 200; // ms * @implements {IRenderableView} */ var PDFPageView = (function PDFPageViewClosure() { + var CustomStyle = PDFJS.CustomStyle; + /** * @constructs PDFPageView * @param {PDFPageViewOptions} options diff --git a/web/text_layer_builder.js b/web/text_layer_builder.js index 0691c8c14..805498de5 100644 --- a/web/text_layer_builder.js +++ b/web/text_layer_builder.js @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals CustomStyle, PDFJS */ +/* globals PDFJS */ 'use strict'; @@ -119,7 +119,7 @@ var TextLayerBuilder = (function TextLayerBuilderClosure() { transform = 'rotate(' + rotation + 'deg) ' + transform; } if (transform) { - CustomStyle.setProp('transform' , textDiv, transform); + PDFJS.CustomStyle.setProp('transform' , textDiv, transform); } } } diff --git a/web/ui_utils.js b/web/ui_utils.js index 6f5aa26c7..5f4b4fdc7 100644 --- a/web/ui_utils.js +++ b/web/ui_utils.js @@ -23,57 +23,6 @@ var MAX_AUTO_SCALE = 1.25; var SCROLLBAR_PADDING = 40; var VERTICAL_PADDING = 5; -// optimised CSS custom property getter/setter -var CustomStyle = (function CustomStyleClosure() { - - // As noted on: http://www.zachstronaut.com/posts/2009/02/17/ - // animate-css-transforms-firefox-webkit.html - // in some versions of IE9 it is critical that ms appear in this list - // before Moz - var prefixes = ['ms', 'Moz', 'Webkit', 'O']; - var _cache = {}; - - function CustomStyle() {} - - CustomStyle.getProp = function get(propName, element) { - // check cache only when no element is given - if (arguments.length === 1 && typeof _cache[propName] === 'string') { - return _cache[propName]; - } - - element = element || document.documentElement; - var style = element.style, prefixed, uPropName; - - // test standard property first - if (typeof style[propName] === 'string') { - return (_cache[propName] = propName); - } - - // capitalize - uPropName = propName.charAt(0).toUpperCase() + propName.slice(1); - - // test vendor specific properties - for (var i = 0, l = prefixes.length; i < l; i++) { - prefixed = prefixes[i] + uPropName; - if (typeof style[prefixed] === 'string') { - return (_cache[propName] = prefixed); - } - } - - //if all fails then set to undefined - return (_cache[propName] = 'undefined'); - }; - - CustomStyle.setProp = function set(propName, element, str) { - var prop = this.getProp(propName); - if (prop !== 'undefined') { - element.style[prop] = str; - } - }; - - return CustomStyle; -})(); - var NullCharactersRegExp = /\x00/g; function removeNullCharacters(str) { diff --git a/web/viewer.html b/web/viewer.html index 8a65736ee..217d3f2a3 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -60,6 +60,7 @@ See https://github.com/adobe-type-tools/cmap-resources +