closure 1.1.692
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.yardopts +3 -0
- data/LICENSE +202 -0
- data/README.md +26 -0
- data/beanshell/LICENSE +12 -0
- data/beanshell/bsh-core-2.0b4.jar +0 -0
- data/closure-compiler/COPYING +202 -0
- data/closure-compiler/README +278 -0
- data/closure-compiler/compiler.jar +0 -0
- data/closure-library/AUTHORS +12 -0
- data/closure-library/LICENSE +176 -0
- data/closure-library/README +6 -0
- data/closure-library/all_tests.html +113 -0
- data/closure-library/alltests.js +16 -0
- data/closure-library/closure/bin/build/closurebuilder.py +257 -0
- data/closure-library/closure/bin/build/depstree.py +186 -0
- data/closure-library/closure/bin/build/depstree_test.py +127 -0
- data/closure-library/closure/bin/build/depswriter.py +197 -0
- data/closure-library/closure/bin/build/jscompiler.py +69 -0
- data/closure-library/closure/bin/build/source.py +86 -0
- data/closure-library/closure/bin/build/source_test.py +57 -0
- data/closure-library/closure/bin/build/treescan.py +78 -0
- data/closure-library/closure/bin/calcdeps.py +570 -0
- data/closure-library/closure/bin/scopify.py +211 -0
- data/closure-library/closure/css/inlay/g-base.css +82 -0
- data/closure-library/closure/css/inlay/g-fixed.css +158 -0
- data/closure-library/closure/css/inlay/g-ratio.css +253 -0
- data/closure-library/closure/goog/array/array.js +1300 -0
- data/closure-library/closure/goog/array/array_test.html +1524 -0
- data/closure-library/closure/goog/asserts/asserts.js +277 -0
- data/closure-library/closure/goog/asserts/asserts_test.html +163 -0
- data/closure-library/closure/goog/async/conditionaldelay.js +238 -0
- data/closure-library/closure/goog/async/conditionaldelay_test.html +227 -0
- data/closure-library/closure/goog/async/delay.js +174 -0
- data/closure-library/closure/goog/async/delay_test.html +148 -0
- data/closure-library/closure/goog/async/throttle.js +189 -0
- data/closure-library/closure/goog/async/throttle_test.html +102 -0
- data/closure-library/closure/goog/base.js +1471 -0
- data/closure-library/closure/goog/base_test.html +1166 -0
- data/closure-library/closure/goog/bootstrap/webworkers.js +37 -0
- data/closure-library/closure/goog/color/alpha.js +436 -0
- data/closure-library/closure/goog/color/alpha_test.html +234 -0
- data/closure-library/closure/goog/color/color.js +757 -0
- data/closure-library/closure/goog/color/color_test.html +645 -0
- data/closure-library/closure/goog/color/names.js +176 -0
- data/closure-library/closure/goog/crypt/arc4.js +141 -0
- data/closure-library/closure/goog/crypt/arc4_test.html +42 -0
- data/closure-library/closure/goog/crypt/base64.js +267 -0
- data/closure-library/closure/goog/crypt/base64_test.html +106 -0
- data/closure-library/closure/goog/crypt/basen.js +242 -0
- data/closure-library/closure/goog/crypt/basen_test.html +167 -0
- data/closure-library/closure/goog/crypt/crypt.js +103 -0
- data/closure-library/closure/goog/crypt/crypt_test.html +68 -0
- data/closure-library/closure/goog/crypt/hash32.js +184 -0
- data/closure-library/closure/goog/crypt/hash32_test.html +287 -0
- data/closure-library/closure/goog/crypt/sha1.js +238 -0
- data/closure-library/closure/goog/crypt/sha1_test.html +47 -0
- data/closure-library/closure/goog/css/autocomplete.css +43 -0
- data/closure-library/closure/goog/css/bubble.css +84 -0
- data/closure-library/closure/goog/css/button.css +38 -0
- data/closure-library/closure/goog/css/charpicker.css +201 -0
- data/closure-library/closure/goog/css/checkbox.css +38 -0
- data/closure-library/closure/goog/css/colormenubutton.css +25 -0
- data/closure-library/closure/goog/css/colorpalette.css +54 -0
- data/closure-library/closure/goog/css/colorpicker-simplegrid.css +50 -0
- data/closure-library/closure/goog/css/combobox.css +57 -0
- data/closure-library/closure/goog/css/common.css +41 -0
- data/closure-library/closure/goog/css/css3button.css +77 -0
- data/closure-library/closure/goog/css/css3menubutton.css +23 -0
- data/closure-library/closure/goog/css/custombutton.css +164 -0
- data/closure-library/closure/goog/css/datepicker.css +148 -0
- data/closure-library/closure/goog/css/dialog.css +72 -0
- data/closure-library/closure/goog/css/dimensionpicker.css +47 -0
- data/closure-library/closure/goog/css/dragdropdetector.css +48 -0
- data/closure-library/closure/goog/css/editor/bubble.css +73 -0
- data/closure-library/closure/goog/css/editor/dialog.css +66 -0
- data/closure-library/closure/goog/css/editor/linkdialog.css +36 -0
- data/closure-library/closure/goog/css/editortoolbar.css +225 -0
- data/closure-library/closure/goog/css/filteredmenu.css +30 -0
- data/closure-library/closure/goog/css/filterobservingmenuitem.css +25 -0
- data/closure-library/closure/goog/css/flatbutton.css +65 -0
- data/closure-library/closure/goog/css/flatmenubutton.css +63 -0
- data/closure-library/closure/goog/css/hovercard.css +51 -0
- data/closure-library/closure/goog/css/hsvapalette.css +231 -0
- data/closure-library/closure/goog/css/hsvpalette.css +179 -0
- data/closure-library/closure/goog/css/imagelessbutton.css +160 -0
- data/closure-library/closure/goog/css/imagelessmenubutton.css +23 -0
- data/closure-library/closure/goog/css/inputdatepicker.css +12 -0
- data/closure-library/closure/goog/css/linkbutton.css +26 -0
- data/closure-library/closure/goog/css/menu.css +27 -0
- data/closure-library/closure/goog/css/menubutton.css +169 -0
- data/closure-library/closure/goog/css/menuitem.css +96 -0
- data/closure-library/closure/goog/css/menuseparator.css +19 -0
- data/closure-library/closure/goog/css/multitestrunner.css +121 -0
- data/closure-library/closure/goog/css/offline.css +147 -0
- data/closure-library/closure/goog/css/palette.css +36 -0
- data/closure-library/closure/goog/css/popupdatepicker.css +17 -0
- data/closure-library/closure/goog/css/roundedpanel.css +29 -0
- data/closure-library/closure/goog/css/roundedtab.css +158 -0
- data/closure-library/closure/goog/css/submenu.css +28 -0
- data/closure-library/closure/goog/css/tab.css +91 -0
- data/closure-library/closure/goog/css/tabbar.css +52 -0
- data/closure-library/closure/goog/css/tablesorter.css +14 -0
- data/closure-library/closure/goog/css/toolbar.css +400 -0
- data/closure-library/closure/goog/css/tooltip.css +14 -0
- data/closure-library/closure/goog/css/tree.css +147 -0
- data/closure-library/closure/goog/css/tristatemenuitem.css +43 -0
- data/closure-library/closure/goog/cssom/cssom.js +447 -0
- data/closure-library/closure/goog/cssom/cssom_test.html +343 -0
- data/closure-library/closure/goog/cssom/cssom_test_import_1.css +11 -0
- data/closure-library/closure/goog/cssom/cssom_test_import_2.css +10 -0
- data/closure-library/closure/goog/cssom/cssom_test_link_1.css +10 -0
- data/closure-library/closure/goog/cssom/iframe/style.js +1020 -0
- data/closure-library/closure/goog/cssom/iframe/style_test.html +391 -0
- data/closure-library/closure/goog/cssom/iframe/style_test_import.css +10 -0
- data/closure-library/closure/goog/datasource/datamanager.js +566 -0
- data/closure-library/closure/goog/datasource/datasource.js +646 -0
- data/closure-library/closure/goog/datasource/datasource_test.html +265 -0
- data/closure-library/closure/goog/datasource/expr.js +544 -0
- data/closure-library/closure/goog/datasource/expr_test.html +97 -0
- data/closure-library/closure/goog/datasource/fastdatanode.js +792 -0
- data/closure-library/closure/goog/datasource/fastdatanode_test.html +254 -0
- data/closure-library/closure/goog/datasource/jsdatasource.js +460 -0
- data/closure-library/closure/goog/datasource/jsondatasource.js +146 -0
- data/closure-library/closure/goog/datasource/jsxmlhttpdatasource.js +191 -0
- data/closure-library/closure/goog/datasource/jsxmlhttpdatasource_test.html +94 -0
- data/closure-library/closure/goog/datasource/xmldatasource.js +407 -0
- data/closure-library/closure/goog/date/date.js +1642 -0
- data/closure-library/closure/goog/date/date_test.html +1293 -0
- data/closure-library/closure/goog/date/datelike.js +27 -0
- data/closure-library/closure/goog/date/daterange.js +398 -0
- data/closure-library/closure/goog/date/daterange_test.html +213 -0
- data/closure-library/closure/goog/date/relative.js +425 -0
- data/closure-library/closure/goog/date/relative_test.html +124 -0
- data/closure-library/closure/goog/date/utcdatetime.js +178 -0
- data/closure-library/closure/goog/date/utcdatetime_test.html +119 -0
- data/closure-library/closure/goog/debug/console.js +138 -0
- data/closure-library/closure/goog/debug/debug.js +452 -0
- data/closure-library/closure/goog/debug/debug_test.html +32 -0
- data/closure-library/closure/goog/debug/debugwindow.js +582 -0
- data/closure-library/closure/goog/debug/devcss/devcss.js +435 -0
- data/closure-library/closure/goog/debug/devcss/devcss_test.html +365 -0
- data/closure-library/closure/goog/debug/devcss/devcssrunner.js +26 -0
- data/closure-library/closure/goog/debug/divconsole.js +141 -0
- data/closure-library/closure/goog/debug/enhanceerror_test.html +138 -0
- data/closure-library/closure/goog/debug/entrypointregistry.js +111 -0
- data/closure-library/closure/goog/debug/entrypointregistry_test.html +63 -0
- data/closure-library/closure/goog/debug/error.js +47 -0
- data/closure-library/closure/goog/debug/error_test.html +85 -0
- data/closure-library/closure/goog/debug/errorhandler.js +234 -0
- data/closure-library/closure/goog/debug/errorhandler_async_test.html +112 -0
- data/closure-library/closure/goog/debug/errorhandler_test.html +186 -0
- data/closure-library/closure/goog/debug/errorhandlerweakdep.js +38 -0
- data/closure-library/closure/goog/debug/errorreporter.js +324 -0
- data/closure-library/closure/goog/debug/errorreporter_test.html +289 -0
- data/closure-library/closure/goog/debug/fancywindow.js +265 -0
- data/closure-library/closure/goog/debug/formatter.js +314 -0
- data/closure-library/closure/goog/debug/gcdiagnostics.js +143 -0
- data/closure-library/closure/goog/debug/logbuffer.js +147 -0
- data/closure-library/closure/goog/debug/logbuffer_test.html +105 -0
- data/closure-library/closure/goog/debug/logger.js +809 -0
- data/closure-library/closure/goog/debug/logger_test.html +208 -0
- data/closure-library/closure/goog/debug/logrecord.js +271 -0
- data/closure-library/closure/goog/debug/reflect.js +159 -0
- data/closure-library/closure/goog/debug/reflect_test.html +81 -0
- data/closure-library/closure/goog/debug/relativetimeprovider.js +83 -0
- data/closure-library/closure/goog/debug/tracer.js +750 -0
- data/closure-library/closure/goog/debug/tracer_test.html +57 -0
- data/closure-library/closure/goog/demos/advancedtooltip.html +78 -0
- data/closure-library/closure/goog/demos/animationqueue.html +149 -0
- data/closure-library/closure/goog/demos/autocomplete-basic.html +56 -0
- data/closure-library/closure/goog/demos/autocompleteremote.html +40 -0
- data/closure-library/closure/goog/demos/autocompleteremotedata.js +18 -0
- data/closure-library/closure/goog/demos/autocompleterichremote.html +137 -0
- data/closure-library/closure/goog/demos/autocompleterichremotedata.js +33 -0
- data/closure-library/closure/goog/demos/bidiinput.html +72 -0
- data/closure-library/closure/goog/demos/bubble.html +250 -0
- data/closure-library/closure/goog/demos/button.html +395 -0
- data/closure-library/closure/goog/demos/charcounter.html +57 -0
- data/closure-library/closure/goog/demos/charpicker.html +64 -0
- data/closure-library/closure/goog/demos/checkbox.html +122 -0
- data/closure-library/closure/goog/demos/color-contrast.html +60 -0
- data/closure-library/closure/goog/demos/colormenubutton.html +213 -0
- data/closure-library/closure/goog/demos/colorpicker.html +43 -0
- data/closure-library/closure/goog/demos/combobox.html +125 -0
- data/closure-library/closure/goog/demos/container.html +670 -0
- data/closure-library/closure/goog/demos/control.html +477 -0
- data/closure-library/closure/goog/demos/css/demo.css +75 -0
- data/closure-library/closure/goog/demos/css/emojipicker.css +36 -0
- data/closure-library/closure/goog/demos/css/emojisprite.css +92 -0
- data/closure-library/closure/goog/demos/css3button.html +166 -0
- data/closure-library/closure/goog/demos/css3menubutton.html +285 -0
- data/closure-library/closure/goog/demos/cssspriteanimation.html +80 -0
- data/closure-library/closure/goog/demos/datepicker.html +183 -0
- data/closure-library/closure/goog/demos/debug.html +119 -0
- data/closure-library/closure/goog/demos/depsgraph.html +221 -0
- data/closure-library/closure/goog/demos/dialog.html +156 -0
- data/closure-library/closure/goog/demos/dimensionpicker.html +108 -0
- data/closure-library/closure/goog/demos/dimensionpicker_rtl.html +123 -0
- data/closure-library/closure/goog/demos/dom_selection.html +88 -0
- data/closure-library/closure/goog/demos/drag.html +191 -0
- data/closure-library/closure/goog/demos/dragdrop.html +263 -0
- data/closure-library/closure/goog/demos/dragdropdetector.html +46 -0
- data/closure-library/closure/goog/demos/dragdropdetector_target.html +17 -0
- data/closure-library/closure/goog/demos/dragger.html +83 -0
- data/closure-library/closure/goog/demos/draglistgroup.html +261 -0
- data/closure-library/closure/goog/demos/drilldownrow.html +78 -0
- data/closure-library/closure/goog/demos/editor/deps.js +20 -0
- data/closure-library/closure/goog/demos/editor/editor.html +139 -0
- data/closure-library/closure/goog/demos/editor/field_basic.html +74 -0
- data/closure-library/closure/goog/demos/editor/helloworld.html +91 -0
- data/closure-library/closure/goog/demos/editor/helloworld.js +81 -0
- data/closure-library/closure/goog/demos/editor/helloworld_test.html +75 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialog.js +163 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialog_test.html +100 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialogplugin.js +110 -0
- data/closure-library/closure/goog/demos/editor/helloworlddialogplugin_test.html +198 -0
- data/closure-library/closure/goog/demos/editor/seamlessfield.html +106 -0
- data/closure-library/closure/goog/demos/effects.html +142 -0
- data/closure-library/closure/goog/demos/emoji/200.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/201.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/202.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/203.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/204.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/205.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/206.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2BF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2C9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2CF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2D9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2DF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2E9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2ED.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2EF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F0.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F1.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F2.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F3.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F4.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F5.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F6.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F7.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F8.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2F9.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FA.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FB.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FC.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FD.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FE.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/2FF.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/none.gif +0 -0
- data/closure-library/closure/goog/demos/emoji/sprite.png +0 -0
- data/closure-library/closure/goog/demos/emoji/sprite2.png +0 -0
- data/closure-library/closure/goog/demos/emoji/unknown.gif +0 -0
- data/closure-library/closure/goog/demos/event-propagation.html +192 -0
- data/closure-library/closure/goog/demos/events.html +99 -0
- data/closure-library/closure/goog/demos/eventtarget.html +70 -0
- data/closure-library/closure/goog/demos/filedrophandler.html +63 -0
- data/closure-library/closure/goog/demos/filteredmenu.html +118 -0
- data/closure-library/closure/goog/demos/focushandler.html +58 -0
- data/closure-library/closure/goog/demos/gauge.html +158 -0
- data/closure-library/closure/goog/demos/graphics/advancedcoordinates.html +141 -0
- data/closure-library/closure/goog/demos/graphics/advancedcoordinates2.html +130 -0
- data/closure-library/closure/goog/demos/graphics/basicelements.html +264 -0
- data/closure-library/closure/goog/demos/graphics/events.html +113 -0
- data/closure-library/closure/goog/demos/graphics/modifyelements.html +195 -0
- data/closure-library/closure/goog/demos/graphics/subpixel.html +80 -0
- data/closure-library/closure/goog/demos/graphics/tiger.html +105 -0
- data/closure-library/closure/goog/demos/graphics/tigerdata.js +2840 -0
- data/closure-library/closure/goog/demos/history1.html +132 -0
- data/closure-library/closure/goog/demos/history2.html +100 -0
- data/closure-library/closure/goog/demos/history3.html +106 -0
- data/closure-library/closure/goog/demos/history3js.html +36 -0
- data/closure-library/closure/goog/demos/history_blank.html +25 -0
- data/closure-library/closure/goog/demos/hovercard.html +177 -0
- data/closure-library/closure/goog/demos/hsvapalette.html +55 -0
- data/closure-library/closure/goog/demos/hsvpalette.html +56 -0
- data/closure-library/closure/goog/demos/html5history.html +87 -0
- data/closure-library/closure/goog/demos/imagelessbutton.html +221 -0
- data/closure-library/closure/goog/demos/imagelessmenubutton.html +285 -0
- data/closure-library/closure/goog/demos/imagelessroundedcorner.html +231 -0
- data/closure-library/closure/goog/demos/index.html +19 -0
- data/closure-library/closure/goog/demos/index_nav.html +253 -0
- data/closure-library/closure/goog/demos/index_splash.html +22 -0
- data/closure-library/closure/goog/demos/inline_block_quirks.html +125 -0
- data/closure-library/closure/goog/demos/inline_block_standards.html +126 -0
- data/closure-library/closure/goog/demos/inputdatepicker.html +60 -0
- data/closure-library/closure/goog/demos/inputhandler.html +72 -0
- data/closure-library/closure/goog/demos/jsonprettyprinter.html +80 -0
- data/closure-library/closure/goog/demos/keyboardshortcuts.html +112 -0
- data/closure-library/closure/goog/demos/keyhandler.html +127 -0
- data/closure-library/closure/goog/demos/labelinput.html +42 -0
- data/closure-library/closure/goog/demos/menu.html +220 -0
- data/closure-library/closure/goog/demos/menubutton.html +318 -0
- data/closure-library/closure/goog/demos/mousewheelhandler.html +109 -0
- data/closure-library/closure/goog/demos/offline.html +268 -0
- data/closure-library/closure/goog/demos/onlinehandler.html +77 -0
- data/closure-library/closure/goog/demos/palette.html +302 -0
- data/closure-library/closure/goog/demos/pastehandler.html +54 -0
- data/closure-library/closure/goog/demos/plaintextspellchecker.html +106 -0
- data/closure-library/closure/goog/demos/popup.html +200 -0
- data/closure-library/closure/goog/demos/popupcolorpicker.html +49 -0
- data/closure-library/closure/goog/demos/popupdatepicker.html +53 -0
- data/closure-library/closure/goog/demos/popupemojipicker.html +407 -0
- data/closure-library/closure/goog/demos/popupmenu.html +89 -0
- data/closure-library/closure/goog/demos/progressbar.html +97 -0
- data/closure-library/closure/goog/demos/prompt.html +92 -0
- data/closure-library/closure/goog/demos/quadtree.html +107 -0
- data/closure-library/closure/goog/demos/ratings.html +120 -0
- data/closure-library/closure/goog/demos/richtextspellchecker.html +92 -0
- data/closure-library/closure/goog/demos/roundedpanel.html +139 -0
- data/closure-library/closure/goog/demos/samplecomponent.html +75 -0
- data/closure-library/closure/goog/demos/samplecomponent.js +206 -0
- data/closure-library/closure/goog/demos/scrollfloater.html +117 -0
- data/closure-library/closure/goog/demos/select.html +324 -0
- data/closure-library/closure/goog/demos/selectionmenubutton.html +186 -0
- data/closure-library/closure/goog/demos/serverchart.html +122 -0
- data/closure-library/closure/goog/demos/silverlightclipboardbutton.html +71 -0
- data/closure-library/closure/goog/demos/slider.html +110 -0
- data/closure-library/closure/goog/demos/splitbehavior.html +164 -0
- data/closure-library/closure/goog/demos/splitpane.html +243 -0
- data/closure-library/closure/goog/demos/stopevent.html +171 -0
- data/closure-library/closure/goog/demos/submenus.html +130 -0
- data/closure-library/closure/goog/demos/submenus2.html +150 -0
- data/closure-library/closure/goog/demos/tabbar.html +289 -0
- data/closure-library/closure/goog/demos/tablesorter.html +116 -0
- data/closure-library/closure/goog/demos/tabpane.html +302 -0
- data/closure-library/closure/goog/demos/textarea.html +128 -0
- data/closure-library/closure/goog/demos/timers.html +291 -0
- data/closure-library/closure/goog/demos/toolbar.html +703 -0
- data/closure-library/closure/goog/demos/tooltip.html +91 -0
- data/closure-library/closure/goog/demos/tracer.html +92 -0
- data/closure-library/closure/goog/demos/tree/demo.html +126 -0
- data/closure-library/closure/goog/demos/tree/testdata.js +260 -0
- data/closure-library/closure/goog/demos/tweakui.html +121 -0
- data/closure-library/closure/goog/demos/twothumbslider.html +121 -0
- data/closure-library/closure/goog/demos/useragent.html +173 -0
- data/closure-library/closure/goog/demos/viewportsizemonitor.html +71 -0
- data/closure-library/closure/goog/demos/xpc/blank.html +7 -0
- data/closure-library/closure/goog/demos/xpc/index.html +89 -0
- data/closure-library/closure/goog/demos/xpc/inner.html +58 -0
- data/closure-library/closure/goog/demos/xpc/minimal/blank.html +7 -0
- data/closure-library/closure/goog/demos/xpc/minimal/index.html +105 -0
- data/closure-library/closure/goog/demos/xpc/minimal/inner.html +75 -0
- data/closure-library/closure/goog/demos/xpc/minimal/relay.html +7 -0
- data/closure-library/closure/goog/demos/xpc/relay.html +7 -0
- data/closure-library/closure/goog/demos/xpc/xpcdemo.js +304 -0
- data/closure-library/closure/goog/demos/zippy.html +127 -0
- data/closure-library/closure/goog/deps.js +672 -0
- data/closure-library/closure/goog/disposable/disposable.js +167 -0
- data/closure-library/closure/goog/disposable/disposable_test.html +202 -0
- data/closure-library/closure/goog/dom/a11y.js +438 -0
- data/closure-library/closure/goog/dom/a11y_test.html +86 -0
- data/closure-library/closure/goog/dom/abstractmultirange.js +77 -0
- data/closure-library/closure/goog/dom/abstractrange.js +514 -0
- data/closure-library/closure/goog/dom/abstractrange_test.html +73 -0
- data/closure-library/closure/goog/dom/annotate.js +352 -0
- data/closure-library/closure/goog/dom/annotate_test.html +187 -0
- data/closure-library/closure/goog/dom/browserfeature.js +50 -0
- data/closure-library/closure/goog/dom/browserrange/abstractrange.js +316 -0
- data/closure-library/closure/goog/dom/browserrange/browserrange.js +149 -0
- data/closure-library/closure/goog/dom/browserrange/browserrange_test.html +562 -0
- data/closure-library/closure/goog/dom/browserrange/geckorange.js +82 -0
- data/closure-library/closure/goog/dom/browserrange/ierange.js +970 -0
- data/closure-library/closure/goog/dom/browserrange/operarange.js +83 -0
- data/closure-library/closure/goog/dom/browserrange/w3crange.js +364 -0
- data/closure-library/closure/goog/dom/browserrange/webkitrange.js +112 -0
- data/closure-library/closure/goog/dom/classes.js +233 -0
- data/closure-library/closure/goog/dom/classes_test.html +228 -0
- data/closure-library/closure/goog/dom/controlrange.js +511 -0
- data/closure-library/closure/goog/dom/controlrange_test.html +246 -0
- data/closure-library/closure/goog/dom/dataset.js +90 -0
- data/closure-library/closure/goog/dom/dataset_test.html +104 -0
- data/closure-library/closure/goog/dom/dom.js +2424 -0
- data/closure-library/closure/goog/dom/dom_quirks_test.html +104 -0
- data/closure-library/closure/goog/dom/dom_test.html +103 -0
- data/closure-library/closure/goog/dom/dom_test.js +1129 -0
- data/closure-library/closure/goog/dom/fontsizemonitor.js +159 -0
- data/closure-library/closure/goog/dom/fontsizemonitor_test.html +283 -0
- data/closure-library/closure/goog/dom/forms.js +403 -0
- data/closure-library/closure/goog/dom/forms_test.html +483 -0
- data/closure-library/closure/goog/dom/iframe.js +128 -0
- data/closure-library/closure/goog/dom/iframe_test.html +87 -0
- data/closure-library/closure/goog/dom/iter.js +127 -0
- data/closure-library/closure/goog/dom/iter_test.html +97 -0
- data/closure-library/closure/goog/dom/multirange.js +519 -0
- data/closure-library/closure/goog/dom/multirange_test.html +67 -0
- data/closure-library/closure/goog/dom/nodeiterator.js +85 -0
- data/closure-library/closure/goog/dom/nodeiterator_test.html +49 -0
- data/closure-library/closure/goog/dom/nodeoffset.js +111 -0
- data/closure-library/closure/goog/dom/nodeoffset_test.html +88 -0
- data/closure-library/closure/goog/dom/pattern/abstractpattern.js +60 -0
- data/closure-library/closure/goog/dom/pattern/allchildren.js +73 -0
- data/closure-library/closure/goog/dom/pattern/callback/callback.js +82 -0
- data/closure-library/closure/goog/dom/pattern/callback/counter.js +72 -0
- data/closure-library/closure/goog/dom/pattern/callback/test.js +77 -0
- data/closure-library/closure/goog/dom/pattern/childmatches.js +152 -0
- data/closure-library/closure/goog/dom/pattern/endtag.js +53 -0
- data/closure-library/closure/goog/dom/pattern/fulltag.js +92 -0
- data/closure-library/closure/goog/dom/pattern/matcher.js +150 -0
- data/closure-library/closure/goog/dom/pattern/matcher_test.html +204 -0
- data/closure-library/closure/goog/dom/pattern/nodetype.js +57 -0
- data/closure-library/closure/goog/dom/pattern/pattern.js +93 -0
- data/closure-library/closure/goog/dom/pattern/pattern_test.html +614 -0
- data/closure-library/closure/goog/dom/pattern/repeat.js +188 -0
- data/closure-library/closure/goog/dom/pattern/sequence.js +139 -0
- data/closure-library/closure/goog/dom/pattern/starttag.js +53 -0
- data/closure-library/closure/goog/dom/pattern/tag.js +149 -0
- data/closure-library/closure/goog/dom/pattern/text.js +69 -0
- data/closure-library/closure/goog/dom/range.js +220 -0
- data/closure-library/closure/goog/dom/range_test.html +702 -0
- data/closure-library/closure/goog/dom/rangeendpoint.js +32 -0
- data/closure-library/closure/goog/dom/savedcaretrange.js +203 -0
- data/closure-library/closure/goog/dom/savedcaretrange_test.html +235 -0
- data/closure-library/closure/goog/dom/savedrange.js +74 -0
- data/closure-library/closure/goog/dom/savedrange_test.html +61 -0
- data/closure-library/closure/goog/dom/selection.js +470 -0
- data/closure-library/closure/goog/dom/selection_test.html +329 -0
- data/closure-library/closure/goog/dom/tagiterator.js +365 -0
- data/closure-library/closure/goog/dom/tagiterator_test.html +589 -0
- data/closure-library/closure/goog/dom/tagname.js +121 -0
- data/closure-library/closure/goog/dom/tagname_test.html +37 -0
- data/closure-library/closure/goog/dom/textrange.js +611 -0
- data/closure-library/closure/goog/dom/textrange_test.html +127 -0
- data/closure-library/closure/goog/dom/textrangeiterator.js +246 -0
- data/closure-library/closure/goog/dom/textrangeiterator_test.html +142 -0
- data/closure-library/closure/goog/dom/viewportsizemonitor.js +220 -0
- data/closure-library/closure/goog/dom/viewportsizemonitor_test.html +166 -0
- data/closure-library/closure/goog/dom/xml.js +187 -0
- data/closure-library/closure/goog/dom/xml_test.html +77 -0
- data/closure-library/closure/goog/editor/browserfeature.js +251 -0
- data/closure-library/closure/goog/editor/browserfeature_test.html +124 -0
- data/closure-library/closure/goog/editor/clicktoeditwrapper.js +438 -0
- data/closure-library/closure/goog/editor/clicktoeditwrapper_test.html +137 -0
- data/closure-library/closure/goog/editor/command.js +74 -0
- data/closure-library/closure/goog/editor/defines.js +34 -0
- data/closure-library/closure/goog/editor/field.js +2594 -0
- data/closure-library/closure/goog/editor/field_test.html +1000 -0
- data/closure-library/closure/goog/editor/focus.js +32 -0
- data/closure-library/closure/goog/editor/focus_test.html +66 -0
- data/closure-library/closure/goog/editor/icontent.js +296 -0
- data/closure-library/closure/goog/editor/icontent_test.html +209 -0
- data/closure-library/closure/goog/editor/link.js +279 -0
- data/closure-library/closure/goog/editor/link_test.html +234 -0
- data/closure-library/closure/goog/editor/node.js +435 -0
- data/closure-library/closure/goog/editor/node_test.html +590 -0
- data/closure-library/closure/goog/editor/plugin.js +444 -0
- data/closure-library/closure/goog/editor/plugin_test.html +187 -0
- data/closure-library/closure/goog/editor/plugins/abstractbubbleplugin.js +535 -0
- data/closure-library/closure/goog/editor/plugins/abstractbubbleplugin_test.html +227 -0
- data/closure-library/closure/goog/editor/plugins/abstractdialogplugin.js +336 -0
- data/closure-library/closure/goog/editor/plugins/abstractdialogplugin_test.html +399 -0
- data/closure-library/closure/goog/editor/plugins/abstracttabhandler.js +78 -0
- data/closure-library/closure/goog/editor/plugins/abstracttabhandler_test.html +91 -0
- data/closure-library/closure/goog/editor/plugins/basictextformatter.js +1740 -0
- data/closure-library/closure/goog/editor/plugins/basictextformatter_test.html +1171 -0
- data/closure-library/closure/goog/editor/plugins/blockquote.js +422 -0
- data/closure-library/closure/goog/editor/plugins/blockquote_test.html +149 -0
- data/closure-library/closure/goog/editor/plugins/emoticons.js +83 -0
- data/closure-library/closure/goog/editor/plugins/emoticons_test.html +67 -0
- data/closure-library/closure/goog/editor/plugins/enterhandler.js +730 -0
- data/closure-library/closure/goog/editor/plugins/enterhandler_test.html +739 -0
- data/closure-library/closure/goog/editor/plugins/headerformatter.js +95 -0
- data/closure-library/closure/goog/editor/plugins/headerformatter_test.html +100 -0
- data/closure-library/closure/goog/editor/plugins/linkbubble.js +458 -0
- data/closure-library/closure/goog/editor/plugins/linkbubble_test.html +309 -0
- data/closure-library/closure/goog/editor/plugins/linkdialogplugin.js +222 -0
- data/closure-library/closure/goog/editor/plugins/linkdialogplugin_test.html +370 -0
- data/closure-library/closure/goog/editor/plugins/listtabhandler.js +66 -0
- data/closure-library/closure/goog/editor/plugins/listtabhandler_test.html +177 -0
- data/closure-library/closure/goog/editor/plugins/loremipsum.js +186 -0
- data/closure-library/closure/goog/editor/plugins/loremipsum_test.html +169 -0
- data/closure-library/closure/goog/editor/plugins/removeformatting.js +772 -0
- data/closure-library/closure/goog/editor/plugins/removeformatting_test.html +920 -0
- data/closure-library/closure/goog/editor/plugins/spacestabhandler.js +93 -0
- data/closure-library/closure/goog/editor/plugins/spacestabhandler_test.html +186 -0
- data/closure-library/closure/goog/editor/plugins/tableeditor.js +496 -0
- data/closure-library/closure/goog/editor/plugins/tableeditor_test.html +299 -0
- data/closure-library/closure/goog/editor/plugins/tagonenterhandler.js +741 -0
- data/closure-library/closure/goog/editor/plugins/tagonenterhandler_test.html +481 -0
- data/closure-library/closure/goog/editor/plugins/undoredo.js +1014 -0
- data/closure-library/closure/goog/editor/plugins/undoredo_test.html +525 -0
- data/closure-library/closure/goog/editor/plugins/undoredomanager.js +337 -0
- data/closure-library/closure/goog/editor/plugins/undoredomanager_test.html +394 -0
- data/closure-library/closure/goog/editor/plugins/undoredostate.js +84 -0
- data/closure-library/closure/goog/editor/plugins/undoredostate_test.html +44 -0
- data/closure-library/closure/goog/editor/range.js +602 -0
- data/closure-library/closure/goog/editor/range_test.html +880 -0
- data/closure-library/closure/goog/editor/seamlessfield.js +720 -0
- data/closure-library/closure/goog/editor/seamlessfield_quirks_test.html +30 -0
- data/closure-library/closure/goog/editor/seamlessfield_test.html +33 -0
- data/closure-library/closure/goog/editor/seamlessfield_test.js +392 -0
- data/closure-library/closure/goog/editor/style.js +222 -0
- data/closure-library/closure/goog/editor/style_test.html +177 -0
- data/closure-library/closure/goog/editor/table.js +566 -0
- data/closure-library/closure/goog/editor/table_test.html +522 -0
- data/closure-library/closure/goog/events/actioneventwrapper.js +131 -0
- data/closure-library/closure/goog/events/actioneventwrapper_test.html +176 -0
- data/closure-library/closure/goog/events/actionhandler.js +189 -0
- data/closure-library/closure/goog/events/actionhandler_test.html +82 -0
- data/closure-library/closure/goog/events/browserevent.js +412 -0
- data/closure-library/closure/goog/events/browserevent_test.html +145 -0
- data/closure-library/closure/goog/events/browserfeature.js +43 -0
- data/closure-library/closure/goog/events/event.js +123 -0
- data/closure-library/closure/goog/events/event_test.html +70 -0
- data/closure-library/closure/goog/events/eventhandler.js +348 -0
- data/closure-library/closure/goog/events/eventhandler_test.html +230 -0
- data/closure-library/closure/goog/events/events.js +1101 -0
- data/closure-library/closure/goog/events/events_test.html +362 -0
- data/closure-library/closure/goog/events/eventtarget.js +197 -0
- data/closure-library/closure/goog/events/eventtarget_test.html +423 -0
- data/closure-library/closure/goog/events/eventtype.js +107 -0
- data/closure-library/closure/goog/events/eventwrapper.js +67 -0
- data/closure-library/closure/goog/events/filedrophandler.js +224 -0
- data/closure-library/closure/goog/events/filedrophandler_test.html +258 -0
- data/closure-library/closure/goog/events/focushandler.js +111 -0
- data/closure-library/closure/goog/events/imehandler.js +365 -0
- data/closure-library/closure/goog/events/imehandler_test.html +271 -0
- data/closure-library/closure/goog/events/inputhandler.js +218 -0
- data/closure-library/closure/goog/events/keycodes.js +314 -0
- data/closure-library/closure/goog/events/keycodes_test.html +72 -0
- data/closure-library/closure/goog/events/keyhandler.js +522 -0
- data/closure-library/closure/goog/events/keyhandler_test.html +621 -0
- data/closure-library/closure/goog/events/keynames.js +124 -0
- data/closure-library/closure/goog/events/listener.js +160 -0
- data/closure-library/closure/goog/events/mousewheelhandler.js +280 -0
- data/closure-library/closure/goog/events/mousewheelhandler_test.html +331 -0
- data/closure-library/closure/goog/events/onlinehandler.js +176 -0
- data/closure-library/closure/goog/events/onlinelistener_test.html +214 -0
- data/closure-library/closure/goog/events/pastehandler.js +444 -0
- data/closure-library/closure/goog/events/pastehandler_test.html +354 -0
- data/closure-library/closure/goog/events/pools.js +342 -0
- data/closure-library/closure/goog/format/emailaddress.js +329 -0
- data/closure-library/closure/goog/format/emailaddress_test.html +179 -0
- data/closure-library/closure/goog/format/format.js +451 -0
- data/closure-library/closure/goog/format/format_test.html +257 -0
- data/closure-library/closure/goog/format/htmlprettyprinter.js +406 -0
- data/closure-library/closure/goog/format/htmlprettyprinter_test.html +205 -0
- data/closure-library/closure/goog/format/jsonprettyprinter.js +405 -0
- data/closure-library/closure/goog/format/jsonprettyprinter_test.html +111 -0
- data/closure-library/closure/goog/fs/entry.js +406 -0
- data/closure-library/closure/goog/fs/error.js +103 -0
- data/closure-library/closure/goog/fs/filesaver.js +214 -0
- data/closure-library/closure/goog/fs/filesystem.js +59 -0
- data/closure-library/closure/goog/fs/filewriter.js +106 -0
- data/closure-library/closure/goog/fs/fs.js +183 -0
- data/closure-library/closure/goog/fs/fs_test.html +270 -0
- data/closure-library/closure/goog/functions/functions.js +219 -0
- data/closure-library/closure/goog/functions/functions_test.html +198 -0
- data/closure-library/closure/goog/fx/abstractdragdrop.js +1451 -0
- data/closure-library/closure/goog/fx/abstractdragdrop_test.html +430 -0
- data/closure-library/closure/goog/fx/animation.js +621 -0
- data/closure-library/closure/goog/fx/animationqueue.js +348 -0
- data/closure-library/closure/goog/fx/cssspriteanimation.js +112 -0
- data/closure-library/closure/goog/fx/cssspriteanimation_test.html +125 -0
- data/closure-library/closure/goog/fx/dom.js +610 -0
- data/closure-library/closure/goog/fx/dragdrop.js +49 -0
- data/closure-library/closure/goog/fx/dragdropgroup.js +107 -0
- data/closure-library/closure/goog/fx/dragdropgroup_test.html +234 -0
- data/closure-library/closure/goog/fx/dragger.js +731 -0
- data/closure-library/closure/goog/fx/dragger_test.html +415 -0
- data/closure-library/closure/goog/fx/draglistgroup.js +1159 -0
- data/closure-library/closure/goog/fx/draglistgroup_test.html +231 -0
- data/closure-library/closure/goog/fx/dragscrollsupport.js +274 -0
- data/closure-library/closure/goog/fx/dragscrollsupport_test.html +253 -0
- data/closure-library/closure/goog/fx/easing.js +50 -0
- data/closure-library/closure/goog/fx/fx.js +30 -0
- data/closure-library/closure/goog/fx/fx_test.html +157 -0
- data/closure-library/closure/goog/gears/basestore.js +523 -0
- data/closure-library/closure/goog/gears/basestore_test.html +247 -0
- data/closure-library/closure/goog/gears/database.js +935 -0
- data/closure-library/closure/goog/gears/database_test.html +699 -0
- data/closure-library/closure/goog/gears/fakeworkerpool.js +252 -0
- data/closure-library/closure/goog/gears/fakeworkerpool_test.html +188 -0
- data/closure-library/closure/goog/gears/gears.js +228 -0
- data/closure-library/closure/goog/gears/gears_test.html +78 -0
- data/closure-library/closure/goog/gears/httprequest.js +77 -0
- data/closure-library/closure/goog/gears/loggerclient.js +131 -0
- data/closure-library/closure/goog/gears/loggerclient_test.html +171 -0
- data/closure-library/closure/goog/gears/loggerserver.js +158 -0
- data/closure-library/closure/goog/gears/loggerserver_test.html +118 -0
- data/closure-library/closure/goog/gears/logstore.js +479 -0
- data/closure-library/closure/goog/gears/logstore_test.html +600 -0
- data/closure-library/closure/goog/gears/managedresourcestore.js +553 -0
- data/closure-library/closure/goog/gears/managedresourcestore_test.html +453 -0
- data/closure-library/closure/goog/gears/multipartformdata.js +203 -0
- data/closure-library/closure/goog/gears/multipartformdata_test.html +220 -0
- data/closure-library/closure/goog/gears/statustype.js +37 -0
- data/closure-library/closure/goog/gears/urlcapture.js +370 -0
- data/closure-library/closure/goog/gears/urlcapture_test.html +392 -0
- data/closure-library/closure/goog/gears/worker.js +201 -0
- data/closure-library/closure/goog/gears/workerchannel.js +205 -0
- data/closure-library/closure/goog/gears/workerchannel_test.html +207 -0
- data/closure-library/closure/goog/gears/workerpool.js +241 -0
- data/closure-library/closure/goog/gears/workerpool_test.html +203 -0
- data/closure-library/closure/goog/graphics/abstractgraphics.js +439 -0
- data/closure-library/closure/goog/graphics/affinetransform.js +497 -0
- data/closure-library/closure/goog/graphics/affinetransform_test.html +316 -0
- data/closure-library/closure/goog/graphics/canvaselement.js +776 -0
- data/closure-library/closure/goog/graphics/canvasgraphics.js +632 -0
- data/closure-library/closure/goog/graphics/element.js +145 -0
- data/closure-library/closure/goog/graphics/ellipseelement.js +59 -0
- data/closure-library/closure/goog/graphics/ext/coordinates.js +158 -0
- data/closure-library/closure/goog/graphics/ext/coordinates_test.html +74 -0
- data/closure-library/closure/goog/graphics/ext/element.js +970 -0
- data/closure-library/closure/goog/graphics/ext/element_test.html +144 -0
- data/closure-library/closure/goog/graphics/ext/ellipse.js +58 -0
- data/closure-library/closure/goog/graphics/ext/ext.js +29 -0
- data/closure-library/closure/goog/graphics/ext/graphics.js +209 -0
- data/closure-library/closure/goog/graphics/ext/group.js +213 -0
- data/closure-library/closure/goog/graphics/ext/image.js +62 -0
- data/closure-library/closure/goog/graphics/ext/path.js +140 -0
- data/closure-library/closure/goog/graphics/ext/path_test.html +46 -0
- data/closure-library/closure/goog/graphics/ext/rectangle.js +53 -0
- data/closure-library/closure/goog/graphics/ext/shape.js +144 -0
- data/closure-library/closure/goog/graphics/ext/strokeandfillelement.js +69 -0
- data/closure-library/closure/goog/graphics/fill.js +29 -0
- data/closure-library/closure/goog/graphics/font.js +59 -0
- data/closure-library/closure/goog/graphics/graphics.js +124 -0
- data/closure-library/closure/goog/graphics/groupelement.js +54 -0
- data/closure-library/closure/goog/graphics/imageelement.js +67 -0
- data/closure-library/closure/goog/graphics/lineargradient.js +131 -0
- data/closure-library/closure/goog/graphics/path.js +508 -0
- data/closure-library/closure/goog/graphics/path_test.html +359 -0
- data/closure-library/closure/goog/graphics/pathelement.js +50 -0
- data/closure-library/closure/goog/graphics/paths.js +86 -0
- data/closure-library/closure/goog/graphics/paths_test.html +97 -0
- data/closure-library/closure/goog/graphics/rectelement.js +59 -0
- data/closure-library/closure/goog/graphics/solidfill.js +70 -0
- data/closure-library/closure/goog/graphics/stroke.js +63 -0
- data/closure-library/closure/goog/graphics/strokeandfillelement.js +110 -0
- data/closure-library/closure/goog/graphics/svgelement.js +262 -0
- data/closure-library/closure/goog/graphics/svggraphics.js +813 -0
- data/closure-library/closure/goog/graphics/textelement.js +51 -0
- data/closure-library/closure/goog/graphics/vmlelement.js +380 -0
- data/closure-library/closure/goog/graphics/vmlgraphics.js +863 -0
- data/closure-library/closure/goog/history/event.js +54 -0
- data/closure-library/closure/goog/history/eventtype.js +30 -0
- data/closure-library/closure/goog/history/history.js +979 -0
- data/closure-library/closure/goog/history/html5history.js +303 -0
- data/closure-library/closure/goog/history/html5history_test.html +163 -0
- data/closure-library/closure/goog/i18n/bidi.js +772 -0
- data/closure-library/closure/goog/i18n/bidi_test.html +414 -0
- data/closure-library/closure/goog/i18n/bidiformatter.js +488 -0
- data/closure-library/closure/goog/i18n/bidiformatter_test.html +343 -0
- data/closure-library/closure/goog/i18n/charlistdecompressor.js +157 -0
- data/closure-library/closure/goog/i18n/charlistdecompressor_test.html +65 -0
- data/closure-library/closure/goog/i18n/charpickerdata.js +3185 -0
- data/closure-library/closure/goog/i18n/currency.js +385 -0
- data/closure-library/closure/goog/i18n/currency_test.html +202 -0
- data/closure-library/closure/goog/i18n/currencycodemap.js +210 -0
- data/closure-library/closure/goog/i18n/datetimeformat.js +636 -0
- data/closure-library/closure/goog/i18n/datetimeformat_test.html +436 -0
- data/closure-library/closure/goog/i18n/datetimeparse.js +1111 -0
- data/closure-library/closure/goog/i18n/datetimeparse_test.html +796 -0
- data/closure-library/closure/goog/i18n/datetimepatterns.js +1586 -0
- data/closure-library/closure/goog/i18n/datetimepatternsext.js +7386 -0
- data/closure-library/closure/goog/i18n/datetimesymbols.js +3350 -0
- data/closure-library/closure/goog/i18n/datetimesymbolsext.js +12938 -0
- data/closure-library/closure/goog/i18n/graphemebreak.js +181 -0
- data/closure-library/closure/goog/i18n/graphemebreak_test.html +72 -0
- data/closure-library/closure/goog/i18n/messageformat.js +553 -0
- data/closure-library/closure/goog/i18n/messageformat_test.html +323 -0
- data/closure-library/closure/goog/i18n/mime.js +100 -0
- data/closure-library/closure/goog/i18n/mime_test.html +51 -0
- data/closure-library/closure/goog/i18n/numberformat.js +763 -0
- data/closure-library/closure/goog/i18n/numberformat_test.html +605 -0
- data/closure-library/closure/goog/i18n/numberformatsymbols.js +10358 -0
- data/closure-library/closure/goog/i18n/pluralrules.js +695 -0
- data/closure-library/closure/goog/i18n/timezone.js +341 -0
- data/closure-library/closure/goog/i18n/timezone_test.html +163 -0
- data/closure-library/closure/goog/i18n/uchar.js +1160 -0
- data/closure-library/closure/goog/i18n/uchar_test.html +72 -0
- data/closure-library/closure/goog/images/blank.gif +0 -0
- data/closure-library/closure/goog/images/bubble_close.jpg +0 -0
- data/closure-library/closure/goog/images/bubble_left.gif +0 -0
- data/closure-library/closure/goog/images/bubble_right.gif +0 -0
- data/closure-library/closure/goog/images/button-bg.gif +0 -0
- data/closure-library/closure/goog/images/check-outline.gif +0 -0
- data/closure-library/closure/goog/images/check-sprite.gif +0 -0
- data/closure-library/closure/goog/images/check.gif +0 -0
- data/closure-library/closure/goog/images/close_box.gif +0 -0
- data/closure-library/closure/goog/images/color-swatch-tick.gif +0 -0
- data/closure-library/closure/goog/images/dialog_close_box.gif +0 -0
- data/closure-library/closure/goog/images/dimension-highlighted.png +0 -0
- data/closure-library/closure/goog/images/dimension-unhighlighted.png +0 -0
- data/closure-library/closure/goog/images/dropdn.gif +0 -0
- data/closure-library/closure/goog/images/dropdn_disabled.gif +0 -0
- data/closure-library/closure/goog/images/dropdown.gif +0 -0
- data/closure-library/closure/goog/images/gears_bluedot.gif +0 -0
- data/closure-library/closure/goog/images/gears_offline.gif +0 -0
- data/closure-library/closure/goog/images/gears_online.gif +0 -0
- data/closure-library/closure/goog/images/gears_paused.gif +0 -0
- data/closure-library/closure/goog/images/gears_syncing.gif +0 -0
- data/closure-library/closure/goog/images/hsv-sprite-sm.gif +0 -0
- data/closure-library/closure/goog/images/hsv-sprite-sm.png +0 -0
- data/closure-library/closure/goog/images/hsv-sprite.gif +0 -0
- data/closure-library/closure/goog/images/hsv-sprite.png +0 -0
- data/closure-library/closure/goog/images/hsva-sprite-sm.gif +0 -0
- data/closure-library/closure/goog/images/hsva-sprite-sm.png +0 -0
- data/closure-library/closure/goog/images/hsva-sprite.gif +0 -0
- data/closure-library/closure/goog/images/hsva-sprite.png +0 -0
- data/closure-library/closure/goog/images/left_anchor_bubble_bot.gif +0 -0
- data/closure-library/closure/goog/images/left_anchor_bubble_top.gif +0 -0
- data/closure-library/closure/goog/images/menu-arrows.gif +0 -0
- data/closure-library/closure/goog/images/minus.png +0 -0
- data/closure-library/closure/goog/images/no_anchor_bubble_bot.gif +0 -0
- data/closure-library/closure/goog/images/no_anchor_bubble_top.gif +0 -0
- data/closure-library/closure/goog/images/offlineicons.png +0 -0
- data/closure-library/closure/goog/images/plus.png +0 -0
- data/closure-library/closure/goog/images/ratingstars.gif +0 -0
- data/closure-library/closure/goog/images/right_anchor_bubble_bot.gif +0 -0
- data/closure-library/closure/goog/images/right_anchor_bubble_top.gif +0 -0
- data/closure-library/closure/goog/images/toolbar-bg.png +0 -0
- data/closure-library/closure/goog/images/toolbar-separator.gif +0 -0
- data/closure-library/closure/goog/images/toolbar_icons.gif +0 -0
- data/closure-library/closure/goog/images/tree/I.png +0 -0
- data/closure-library/closure/goog/images/tree/cleardot.gif +0 -0
- data/closure-library/closure/goog/images/tree/tree.gif +0 -0
- data/closure-library/closure/goog/images/tree/tree.png +0 -0
- data/closure-library/closure/goog/images/ui_controls.jpg +0 -0
- data/closure-library/closure/goog/iter/iter.js +627 -0
- data/closure-library/closure/goog/iter/iter_test.html +443 -0
- data/closure-library/closure/goog/json/json.js +302 -0
- data/closure-library/closure/goog/json/json_test.html +501 -0
- data/closure-library/closure/goog/locale/countries.js +288 -0
- data/closure-library/closure/goog/locale/countrylanguagenames_test.html +233 -0
- data/closure-library/closure/goog/locale/defaultlocalenameconstants.js +847 -0
- data/closure-library/closure/goog/locale/genericfontnames.js +73 -0
- data/closure-library/closure/goog/locale/genericfontnames_test.html +97 -0
- data/closure-library/closure/goog/locale/genericfontnamesdata.js +328 -0
- data/closure-library/closure/goog/locale/locale.js +397 -0
- data/closure-library/closure/goog/locale/nativenameconstants.js +1354 -0
- data/closure-library/closure/goog/locale/scriptToLanguages.js +482 -0
- data/closure-library/closure/goog/locale/timezonedetection.js +117 -0
- data/closure-library/closure/goog/locale/timezonedetection_test.html +130 -0
- data/closure-library/closure/goog/locale/timezonefingerprint.js +250 -0
- data/closure-library/closure/goog/locale/timezonelist.js +129 -0
- data/closure-library/closure/goog/locale/timezonelist_test.html +165 -0
- data/closure-library/closure/goog/math/bezier.js +244 -0
- data/closure-library/closure/goog/math/bezier_test.html +70 -0
- data/closure-library/closure/goog/math/box.js +236 -0
- data/closure-library/closure/goog/math/box_test.html +139 -0
- data/closure-library/closure/goog/math/coordinate.js +136 -0
- data/closure-library/closure/goog/math/coordinate3.js +168 -0
- data/closure-library/closure/goog/math/coordinate3_test.html +208 -0
- data/closure-library/closure/goog/math/coordinate_test.html +92 -0
- data/closure-library/closure/goog/math/integer.js +736 -0
- data/closure-library/closure/goog/math/integer_test.html +1653 -0
- data/closure-library/closure/goog/math/line.js +177 -0
- data/closure-library/closure/goog/math/line_test.html +62 -0
- data/closure-library/closure/goog/math/long.js +801 -0
- data/closure-library/closure/goog/math/long_test.html +1571 -0
- data/closure-library/closure/goog/math/math.js +355 -0
- data/closure-library/closure/goog/math/math_test.html +254 -0
- data/closure-library/closure/goog/math/matrix.js +669 -0
- data/closure-library/closure/goog/math/matrix_test.html +427 -0
- data/closure-library/closure/goog/math/range.js +146 -0
- data/closure-library/closure/goog/math/range_test.html +103 -0
- data/closure-library/closure/goog/math/rangeset.js +368 -0
- data/closure-library/closure/goog/math/rangeset_test.html +619 -0
- data/closure-library/closure/goog/math/rect.js +340 -0
- data/closure-library/closure/goog/math/rect_test.html +315 -0
- data/closure-library/closure/goog/math/size.js +201 -0
- data/closure-library/closure/goog/math/size_test.html +174 -0
- data/closure-library/closure/goog/math/vec2.js +255 -0
- data/closure-library/closure/goog/math/vec2_test.html +203 -0
- data/closure-library/closure/goog/math/vec3.js +327 -0
- data/closure-library/closure/goog/math/vec3_test.html +231 -0
- data/closure-library/closure/goog/memoize/memoize.js +98 -0
- data/closure-library/closure/goog/memoize/memoize_test.html +157 -0
- data/closure-library/closure/goog/messaging/abstractchannel.js +209 -0
- data/closure-library/closure/goog/messaging/abstractchannel_test.html +90 -0
- data/closure-library/closure/goog/messaging/bufferedchannel.js +277 -0
- data/closure-library/closure/goog/messaging/bufferedchannel_test.html +205 -0
- data/closure-library/closure/goog/messaging/deferredchannel.js +79 -0
- data/closure-library/closure/goog/messaging/deferredchannel_test.html +107 -0
- data/closure-library/closure/goog/messaging/loggerclient.js +131 -0
- data/closure-library/closure/goog/messaging/loggerclient_test.html +102 -0
- data/closure-library/closure/goog/messaging/loggerserver.js +94 -0
- data/closure-library/closure/goog/messaging/loggerserver_test.html +101 -0
- data/closure-library/closure/goog/messaging/messagechannel.js +115 -0
- data/closure-library/closure/goog/messaging/messaging.js +34 -0
- data/closure-library/closure/goog/messaging/messaging_test.html +42 -0
- data/closure-library/closure/goog/messaging/multichannel.js +303 -0
- data/closure-library/closure/goog/messaging/multichannel_test.html +122 -0
- data/closure-library/closure/goog/messaging/portchannel.js +341 -0
- data/closure-library/closure/goog/messaging/portchannel_test.html +359 -0
- data/closure-library/closure/goog/messaging/testdata/portchannel_worker.js +37 -0
- data/closure-library/closure/goog/module/abstractmoduleloader.js +46 -0
- data/closure-library/closure/goog/module/basemodule.js +45 -0
- data/closure-library/closure/goog/module/basemoduleloader.js +210 -0
- data/closure-library/closure/goog/module/loader.js +269 -0
- data/closure-library/closure/goog/module/module.js +166 -0
- data/closure-library/closure/goog/module/moduleinfo.js +336 -0
- data/closure-library/closure/goog/module/moduleinfo_test.html +109 -0
- data/closure-library/closure/goog/module/moduleloadcallback.js +84 -0
- data/closure-library/closure/goog/module/moduleloadcallback_test.html +57 -0
- data/closure-library/closure/goog/module/moduleloader.js +250 -0
- data/closure-library/closure/goog/module/moduleloader_test.html +244 -0
- data/closure-library/closure/goog/module/modulemanager.js +1008 -0
- data/closure-library/closure/goog/module/modulemanager_test.html +1240 -0
- data/closure-library/closure/goog/module/testdata/modA_1.js +22 -0
- data/closure-library/closure/goog/module/testdata/modA_2.js +24 -0
- data/closure-library/closure/goog/module/testdata/modB_1.js +24 -0
- data/closure-library/closure/goog/net/browserchannel.js +2441 -0
- data/closure-library/closure/goog/net/browserchannel_test.html +1176 -0
- data/closure-library/closure/goog/net/browsertestchannel.js +552 -0
- data/closure-library/closure/goog/net/bulkloader.js +174 -0
- data/closure-library/closure/goog/net/bulkloader_test.html +232 -0
- data/closure-library/closure/goog/net/bulkloaderhelper.js +129 -0
- data/closure-library/closure/goog/net/channeldebug.js +288 -0
- data/closure-library/closure/goog/net/channelrequest.js +1125 -0
- data/closure-library/closure/goog/net/channelrequest_test.html +158 -0
- data/closure-library/closure/goog/net/cookies.js +401 -0
- data/closure-library/closure/goog/net/cookies_test.html +255 -0
- data/closure-library/closure/goog/net/crossdomainrpc.js +848 -0
- data/closure-library/closure/goog/net/crossdomainrpc_test.gif +0 -0
- data/closure-library/closure/goog/net/crossdomainrpc_test.html +120 -0
- data/closure-library/closure/goog/net/crossdomainrpc_test_response.html +59 -0
- data/closure-library/closure/goog/net/errorcode.js +130 -0
- data/closure-library/closure/goog/net/eventtype.js +37 -0
- data/closure-library/closure/goog/net/iframe_xhr_test.html +142 -0
- data/closure-library/closure/goog/net/iframe_xhr_test_response.html +17 -0
- data/closure-library/closure/goog/net/iframeio.js +1342 -0
- data/closure-library/closure/goog/net/iframeio_different_base_test.data +2 -0
- data/closure-library/closure/goog/net/iframeio_different_base_test.html +42 -0
- data/closure-library/closure/goog/net/iframeio_test.html +368 -0
- data/closure-library/closure/goog/net/iframeloadmonitor.js +199 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test.html +113 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test_frame.html +12 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test_frame2.html +12 -0
- data/closure-library/closure/goog/net/iframeloadmonitor_test_frame3.html +12 -0
- data/closure-library/closure/goog/net/imageloader.js +237 -0
- data/closure-library/closure/goog/net/imageloader_test.html +200 -0
- data/closure-library/closure/goog/net/imageloader_testimg1.gif +0 -0
- data/closure-library/closure/goog/net/imageloader_testimg2.gif +0 -0
- data/closure-library/closure/goog/net/imageloader_testimg3.gif +0 -0
- data/closure-library/closure/goog/net/jsonp.js +379 -0
- data/closure-library/closure/goog/net/jsonp_test.html +328 -0
- data/closure-library/closure/goog/net/mockiframeio.js +318 -0
- data/closure-library/closure/goog/net/mockxhrlite.js +34 -0
- data/closure-library/closure/goog/net/mockxhrlite_test.html +109 -0
- data/closure-library/closure/goog/net/multiiframeloadmonitor.js +116 -0
- data/closure-library/closure/goog/net/multiiframeloadmonitor_test.html +172 -0
- data/closure-library/closure/goog/net/networktester.js +383 -0
- data/closure-library/closure/goog/net/networktester_test.html +227 -0
- data/closure-library/closure/goog/net/tmpnetwork.js +168 -0
- data/closure-library/closure/goog/net/wrapperxmlhttpfactory.js +68 -0
- data/closure-library/closure/goog/net/xhrio.js +1093 -0
- data/closure-library/closure/goog/net/xhrio_test.html +603 -0
- data/closure-library/closure/goog/net/xhriopool.js +87 -0
- data/closure-library/closure/goog/net/xhrlite.js +119 -0
- data/closure-library/closure/goog/net/xhrlite_test.html +156 -0
- data/closure-library/closure/goog/net/xhrlitepool.js +37 -0
- data/closure-library/closure/goog/net/xhrmanager.js +763 -0
- data/closure-library/closure/goog/net/xhrmonitor.js +254 -0
- data/closure-library/closure/goog/net/xhrmonitor_test.html +199 -0
- data/closure-library/closure/goog/net/xmlhttp.js +215 -0
- data/closure-library/closure/goog/net/xmlhttpfactory.js +64 -0
- data/closure-library/closure/goog/net/xpc/crosspagechannel.js +624 -0
- data/closure-library/closure/goog/net/xpc/crosspagechannel_test.html +422 -0
- data/closure-library/closure/goog/net/xpc/frameelementmethodtransport.js +251 -0
- data/closure-library/closure/goog/net/xpc/iframepollingtransport.js +822 -0
- data/closure-library/closure/goog/net/xpc/iframerelaytransport.js +288 -0
- data/closure-library/closure/goog/net/xpc/nativemessagingtransport.js +280 -0
- data/closure-library/closure/goog/net/xpc/nativemessagingtransport_test.html +164 -0
- data/closure-library/closure/goog/net/xpc/nixtransport.js +454 -0
- data/closure-library/closure/goog/net/xpc/relay.js +72 -0
- data/closure-library/closure/goog/net/xpc/testdata/inner_peer.html +106 -0
- data/closure-library/closure/goog/net/xpc/transport.js +104 -0
- data/closure-library/closure/goog/net/xpc/xpc.js +238 -0
- data/closure-library/closure/goog/object/object.js +553 -0
- data/closure-library/closure/goog/object/object_test.html +376 -0
- data/closure-library/closure/goog/positioning/absoluteposition.js +73 -0
- data/closure-library/closure/goog/positioning/abstractposition.js +47 -0
- data/closure-library/closure/goog/positioning/anchoredposition.js +78 -0
- data/closure-library/closure/goog/positioning/anchoredviewportposition.js +126 -0
- data/closure-library/closure/goog/positioning/anchoredviewportposition_test.html +117 -0
- data/closure-library/closure/goog/positioning/anchoredviewportposition_test_iframe.html +35 -0
- data/closure-library/closure/goog/positioning/clientposition.js +75 -0
- data/closure-library/closure/goog/positioning/menuanchoredposition.js +97 -0
- data/closure-library/closure/goog/positioning/positioning.js +476 -0
- data/closure-library/closure/goog/positioning/positioning_test.html +877 -0
- data/closure-library/closure/goog/positioning/positioning_test_iframe1.html +16 -0
- data/closure-library/closure/goog/positioning/positioning_test_iframe2.html +13 -0
- data/closure-library/closure/goog/positioning/positioning_test_quirk.html +9 -0
- data/closure-library/closure/goog/positioning/positioning_test_standard.html +13 -0
- data/closure-library/closure/goog/positioning/viewportclientposition.js +102 -0
- data/closure-library/closure/goog/positioning/viewportclientposition_test.html +172 -0
- data/closure-library/closure/goog/positioning/viewportposition.js +63 -0
- data/closure-library/closure/goog/proto/proto.js +43 -0
- data/closure-library/closure/goog/proto/serializer.js +68 -0
- data/closure-library/closure/goog/proto/serializer_test.html +43 -0
- data/closure-library/closure/goog/proto2/descriptor.js +198 -0
- data/closure-library/closure/goog/proto2/descriptor_test.html +60 -0
- data/closure-library/closure/goog/proto2/fielddescriptor.js +288 -0
- data/closure-library/closure/goog/proto2/fielddescriptor_test.html +124 -0
- data/closure-library/closure/goog/proto2/lazydeserializer.js +69 -0
- data/closure-library/closure/goog/proto2/message.js +726 -0
- data/closure-library/closure/goog/proto2/message_test.html +356 -0
- data/closure-library/closure/goog/proto2/objectserializer.js +159 -0
- data/closure-library/closure/goog/proto2/objectserializer_test.html +423 -0
- data/closure-library/closure/goog/proto2/package_test.pb.js +164 -0
- data/closure-library/closure/goog/proto2/pbliteserializer.js +150 -0
- data/closure-library/closure/goog/proto2/pbliteserializer_test.html +267 -0
- data/closure-library/closure/goog/proto2/proto_test.html +693 -0
- data/closure-library/closure/goog/proto2/serializer.js +148 -0
- data/closure-library/closure/goog/proto2/test.pb.js +2820 -0
- data/closure-library/closure/goog/proto2/util.js +54 -0
- data/closure-library/closure/goog/pubsub/pubsub.js +326 -0
- data/closure-library/closure/goog/pubsub/pubsub_test.html +635 -0
- data/closure-library/closure/goog/reflect/reflect.js +50 -0
- data/closure-library/closure/goog/spell/spellcheck.js +474 -0
- data/closure-library/closure/goog/spell/spellcheck_test.html +112 -0
- data/closure-library/closure/goog/string/path.js +100 -0
- data/closure-library/closure/goog/string/path_test.html +59 -0
- data/closure-library/closure/goog/string/string.js +1207 -0
- data/closure-library/closure/goog/string/string_test.html +877 -0
- data/closure-library/closure/goog/string/stringbuffer.js +167 -0
- data/closure-library/closure/goog/string/stringbuffer_test.html +101 -0
- data/closure-library/closure/goog/string/stringformat.js +247 -0
- data/closure-library/closure/goog/string/stringformat_test.html +211 -0
- data/closure-library/closure/goog/structs/avltree.js +769 -0
- data/closure-library/closure/goog/structs/avltree_test.html +241 -0
- data/closure-library/closure/goog/structs/circularbuffer.js +219 -0
- data/closure-library/closure/goog/structs/circularbuffer_test.html +105 -0
- data/closure-library/closure/goog/structs/heap.js +332 -0
- data/closure-library/closure/goog/structs/heap_test.html +220 -0
- data/closure-library/closure/goog/structs/inversionmap.js +159 -0
- data/closure-library/closure/goog/structs/inversionmap_test.html +157 -0
- data/closure-library/closure/goog/structs/linkedmap.js +472 -0
- data/closure-library/closure/goog/structs/linkedmap_test.html +300 -0
- data/closure-library/closure/goog/structs/map.js +446 -0
- data/closure-library/closure/goog/structs/map_test.html +430 -0
- data/closure-library/closure/goog/structs/node.js +74 -0
- data/closure-library/closure/goog/structs/pool.js +344 -0
- data/closure-library/closure/goog/structs/pool_test.html +265 -0
- data/closure-library/closure/goog/structs/prioritypool.js +147 -0
- data/closure-library/closure/goog/structs/prioritypool_test.html +478 -0
- data/closure-library/closure/goog/structs/priorityqueue.js +64 -0
- data/closure-library/closure/goog/structs/priorityqueue_test.html +179 -0
- data/closure-library/closure/goog/structs/quadtree.js +571 -0
- data/closure-library/closure/goog/structs/quadtree_test.html +179 -0
- data/closure-library/closure/goog/structs/queue.js +157 -0
- data/closure-library/closure/goog/structs/queue_test.html +140 -0
- data/closure-library/closure/goog/structs/set.js +251 -0
- data/closure-library/closure/goog/structs/set_test.html +551 -0
- data/closure-library/closure/goog/structs/simplepool.js +203 -0
- data/closure-library/closure/goog/structs/stringset.js +404 -0
- data/closure-library/closure/goog/structs/stringset_test.html +251 -0
- data/closure-library/closure/goog/structs/structs.js +341 -0
- data/closure-library/closure/goog/structs/structs_test.html +1050 -0
- data/closure-library/closure/goog/structs/treenode.js +312 -0
- data/closure-library/closure/goog/structs/treenode_test.html +285 -0
- data/closure-library/closure/goog/structs/trie.js +368 -0
- data/closure-library/closure/goog/structs/trie_test.html +378 -0
- data/closure-library/closure/goog/style/cursor.js +125 -0
- data/closure-library/closure/goog/style/cursor_test.html +131 -0
- data/closure-library/closure/goog/style/style.js +1804 -0
- data/closure-library/closure/goog/style/style_quirks_test.html +1928 -0
- data/closure-library/closure/goog/style/style_test.html +2073 -0
- data/closure-library/closure/goog/style/style_test_iframe_quirk.html +29 -0
- data/closure-library/closure/goog/style/style_test_iframe_standard.html +30 -0
- data/closure-library/closure/goog/style/style_test_quirk.html +9 -0
- data/closure-library/closure/goog/style/style_test_standard.html +11 -0
- data/closure-library/closure/goog/testing/asserts.js +970 -0
- data/closure-library/closure/goog/testing/asserts_test.html +966 -0
- data/closure-library/closure/goog/testing/async/mockcontrol.js +174 -0
- data/closure-library/closure/goog/testing/async/mockcontrol_test.html +224 -0
- data/closure-library/closure/goog/testing/asynctestcase.js +812 -0
- data/closure-library/closure/goog/testing/asynctestcase_async_test.html +102 -0
- data/closure-library/closure/goog/testing/asynctestcase_noasync_test.html +98 -0
- data/closure-library/closure/goog/testing/benchmark.js +87 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizebutton.js +64 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizebutton_test.html +58 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizetoolbar.js +66 -0
- data/closure-library/closure/goog/testing/benchmarks/jsbinarysizetoolbar_test.html +49 -0
- data/closure-library/closure/goog/testing/continuationtestcase.js +682 -0
- data/closure-library/closure/goog/testing/continuationtestcase_test.html +349 -0
- data/closure-library/closure/goog/testing/deferredtestcase.js +157 -0
- data/closure-library/closure/goog/testing/deferredtestcase_test.html +152 -0
- data/closure-library/closure/goog/testing/dom.js +596 -0
- data/closure-library/closure/goog/testing/dom_test.html +438 -0
- data/closure-library/closure/goog/testing/editor/dom.js +293 -0
- data/closure-library/closure/goog/testing/editor/dom_test.html +295 -0
- data/closure-library/closure/goog/testing/editor/fieldmock.js +90 -0
- data/closure-library/closure/goog/testing/editor/testhelper.js +168 -0
- data/closure-library/closure/goog/testing/editor/testhelper_test.html +176 -0
- data/closure-library/closure/goog/testing/events/eventobserver.js +85 -0
- data/closure-library/closure/goog/testing/events/eventobserver_test.html +70 -0
- data/closure-library/closure/goog/testing/events/events.js +540 -0
- data/closure-library/closure/goog/testing/events/events_test.html +434 -0
- data/closure-library/closure/goog/testing/events/matchers.js +41 -0
- data/closure-library/closure/goog/testing/events/matchers_test.html +40 -0
- data/closure-library/closure/goog/testing/expectedfailures.js +236 -0
- data/closure-library/closure/goog/testing/expectedfailures_test.html +122 -0
- data/closure-library/closure/goog/testing/fs/blob.js +74 -0
- data/closure-library/closure/goog/testing/fs/blob_test.html +53 -0
- data/closure-library/closure/goog/testing/fs/directoryentry_test.html +185 -0
- data/closure-library/closure/goog/testing/fs/entry.js +511 -0
- data/closure-library/closure/goog/testing/fs/entry_test.html +153 -0
- data/closure-library/closure/goog/testing/fs/file.js +51 -0
- data/closure-library/closure/goog/testing/fs/fileentry_test.html +54 -0
- data/closure-library/closure/goog/testing/fs/filesystem.js +64 -0
- data/closure-library/closure/goog/testing/fs/filewriter.js +314 -0
- data/closure-library/closure/goog/testing/fs/filewriter_test.html +248 -0
- data/closure-library/closure/goog/testing/fs/fs.js +146 -0
- data/closure-library/closure/goog/testing/fs/fs_test.html +54 -0
- data/closure-library/closure/goog/testing/fs/integration_test.html +219 -0
- data/closure-library/closure/goog/testing/functionmock.js +157 -0
- data/closure-library/closure/goog/testing/functionmock_test.html +357 -0
- data/closure-library/closure/goog/testing/graphics.js +64 -0
- data/closure-library/closure/goog/testing/jsunit.js +144 -0
- data/closure-library/closure/goog/testing/loosemock.js +240 -0
- data/closure-library/closure/goog/testing/loosemock_test.html +343 -0
- data/closure-library/closure/goog/testing/messaging/mockmessagechannel.js +77 -0
- data/closure-library/closure/goog/testing/messaging/mockmessageevent.js +100 -0
- data/closure-library/closure/goog/testing/mock.js +556 -0
- data/closure-library/closure/goog/testing/mock_test.html +208 -0
- data/closure-library/closure/goog/testing/mockclassfactory.js +580 -0
- data/closure-library/closure/goog/testing/mockclassfactory_test.html +241 -0
- data/closure-library/closure/goog/testing/mockclock.js +395 -0
- data/closure-library/closure/goog/testing/mockclock_test.html +413 -0
- data/closure-library/closure/goog/testing/mockcontrol.js +210 -0
- data/closure-library/closure/goog/testing/mockcontrol_test.html +127 -0
- data/closure-library/closure/goog/testing/mockinterface.js +45 -0
- data/closure-library/closure/goog/testing/mockmatchers.js +395 -0
- data/closure-library/closure/goog/testing/mockmatchers_test.html +388 -0
- data/closure-library/closure/goog/testing/mockrandom.js +128 -0
- data/closure-library/closure/goog/testing/mockrandom_test.html +56 -0
- data/closure-library/closure/goog/testing/mockrange.js +65 -0
- data/closure-library/closure/goog/testing/mockrange_test.html +41 -0
- data/closure-library/closure/goog/testing/mockuseragent.js +143 -0
- data/closure-library/closure/goog/testing/mockuseragent_test.html +59 -0
- data/closure-library/closure/goog/testing/multitestrunner.js +1442 -0
- data/closure-library/closure/goog/testing/net/xhrio.js +595 -0
- data/closure-library/closure/goog/testing/net/xhrio_test.html +321 -0
- data/closure-library/closure/goog/testing/objectpropertystring.js +67 -0
- data/closure-library/closure/goog/testing/performancetable.css +46 -0
- data/closure-library/closure/goog/testing/performancetable.js +162 -0
- data/closure-library/closure/goog/testing/performancetimer.js +166 -0
- data/closure-library/closure/goog/testing/performancetimer_test.html +107 -0
- data/closure-library/closure/goog/testing/propertyreplacer.js +243 -0
- data/closure-library/closure/goog/testing/propertyreplacer_test.html +368 -0
- data/closure-library/closure/goog/testing/pseudorandom.js +162 -0
- data/closure-library/closure/goog/testing/pseudorandom_test.html +98 -0
- data/closure-library/closure/goog/testing/recordfunction.js +194 -0
- data/closure-library/closure/goog/testing/recordfunction_test.html +147 -0
- data/closure-library/closure/goog/testing/singleton.js +82 -0
- data/closure-library/closure/goog/testing/singleton_test.html +39 -0
- data/closure-library/closure/goog/testing/stacktrace.js +470 -0
- data/closure-library/closure/goog/testing/stacktrace_test.html +229 -0
- data/closure-library/closure/goog/testing/strictmock.js +124 -0
- data/closure-library/closure/goog/testing/strictmock_test.html +368 -0
- data/closure-library/closure/goog/testing/style/layoutasserts.js +368 -0
- data/closure-library/closure/goog/testing/style/layoutasserts_test.html +269 -0
- data/closure-library/closure/goog/testing/testcase.js +1053 -0
- data/closure-library/closure/goog/testing/testqueue.js +66 -0
- data/closure-library/closure/goog/testing/testrunner.js +391 -0
- data/closure-library/closure/goog/testing/ui/rendererasserts.js +50 -0
- data/closure-library/closure/goog/testing/ui/rendererasserts_test.html +51 -0
- data/closure-library/closure/goog/testing/ui/rendererharness.js +175 -0
- data/closure-library/closure/goog/testing/ui/style.js +137 -0
- data/closure-library/closure/goog/testing/ui/style_reference.html +27 -0
- data/closure-library/closure/goog/testing/ui/style_test.html +130 -0
- data/closure-library/closure/goog/timer/timer.js +285 -0
- data/closure-library/closure/goog/timer/timer_test.html +118 -0
- data/closure-library/closure/goog/tweak/entries.js +990 -0
- data/closure-library/closure/goog/tweak/entries_test.html +94 -0
- data/closure-library/closure/goog/tweak/registry.js +310 -0
- data/closure-library/closure/goog/tweak/registry_test.html +144 -0
- data/closure-library/closure/goog/tweak/testhelpers.js +111 -0
- data/closure-library/closure/goog/tweak/tweak.js +318 -0
- data/closure-library/closure/goog/tweak/tweakui.js +817 -0
- data/closure-library/closure/goog/tweak/tweakui_test.html +280 -0
- data/closure-library/closure/goog/ui/abstractspellchecker.js +1069 -0
- data/closure-library/closure/goog/ui/activitymonitor.js +286 -0
- data/closure-library/closure/goog/ui/activitymonitor_test.html +44 -0
- data/closure-library/closure/goog/ui/advancedtooltip.js +369 -0
- data/closure-library/closure/goog/ui/advancedtooltip_test.html +274 -0
- data/closure-library/closure/goog/ui/animatedzippy.js +190 -0
- data/closure-library/closure/goog/ui/attachablemenu.js +464 -0
- data/closure-library/closure/goog/ui/autocomplete/arraymatcher.js +156 -0
- data/closure-library/closure/goog/ui/autocomplete/arraymatcher_test.html +130 -0
- data/closure-library/closure/goog/ui/autocomplete/autocomplete.js +627 -0
- data/closure-library/closure/goog/ui/autocomplete/autocomplete_test.html +537 -0
- data/closure-library/closure/goog/ui/autocomplete/basic.js +53 -0
- data/closure-library/closure/goog/ui/autocomplete/basic_test.html +204 -0
- data/closure-library/closure/goog/ui/autocomplete/inputhandler.js +1209 -0
- data/closure-library/closure/goog/ui/autocomplete/inputhandler_test.html +555 -0
- data/closure-library/closure/goog/ui/autocomplete/remote.js +117 -0
- data/closure-library/closure/goog/ui/autocomplete/remotearraymatcher.js +273 -0
- data/closure-library/closure/goog/ui/autocomplete/remotearraymatcher_test.html +73 -0
- data/closure-library/closure/goog/ui/autocomplete/renderer.js +852 -0
- data/closure-library/closure/goog/ui/autocomplete/renderer_test.html +386 -0
- data/closure-library/closure/goog/ui/autocomplete/richinputhandler.js +59 -0
- data/closure-library/closure/goog/ui/autocomplete/richremote.js +108 -0
- data/closure-library/closure/goog/ui/autocomplete/richremotearraymatcher.js +126 -0
- data/closure-library/closure/goog/ui/basicmenu.js +930 -0
- data/closure-library/closure/goog/ui/bidiinput.js +164 -0
- data/closure-library/closure/goog/ui/bubble.js +475 -0
- data/closure-library/closure/goog/ui/button.js +208 -0
- data/closure-library/closure/goog/ui/button_test.html +257 -0
- data/closure-library/closure/goog/ui/buttonrenderer.js +205 -0
- data/closure-library/closure/goog/ui/buttonrenderer_test.html +190 -0
- data/closure-library/closure/goog/ui/buttonside.js +40 -0
- data/closure-library/closure/goog/ui/cccbutton.js +281 -0
- data/closure-library/closure/goog/ui/charcounter.js +200 -0
- data/closure-library/closure/goog/ui/charpicker.js +807 -0
- data/closure-library/closure/goog/ui/checkbox.js +303 -0
- data/closure-library/closure/goog/ui/checkbox_test.html +224 -0
- data/closure-library/closure/goog/ui/checkboxmenuitem.js +53 -0
- data/closure-library/closure/goog/ui/colorbutton.js +58 -0
- data/closure-library/closure/goog/ui/colorbutton_test.html +70 -0
- data/closure-library/closure/goog/ui/colorbuttonrenderer.js +72 -0
- data/closure-library/closure/goog/ui/colormenubutton.js +213 -0
- data/closure-library/closure/goog/ui/colormenubuttonrenderer.js +144 -0
- data/closure-library/closure/goog/ui/colormenubuttonrenderer_test.html +88 -0
- data/closure-library/closure/goog/ui/colorpalette.js +162 -0
- data/closure-library/closure/goog/ui/colorpalette_test.html +169 -0
- data/closure-library/closure/goog/ui/colorpicker.js +344 -0
- data/closure-library/closure/goog/ui/colorsplitbehavior.js +61 -0
- data/closure-library/closure/goog/ui/combobox.js +894 -0
- data/closure-library/closure/goog/ui/combobox_test.html +208 -0
- data/closure-library/closure/goog/ui/component.js +1187 -0
- data/closure-library/closure/goog/ui/component_test.html +723 -0
- data/closure-library/closure/goog/ui/container.js +1296 -0
- data/closure-library/closure/goog/ui/container_test.html +450 -0
- data/closure-library/closure/goog/ui/containerrenderer.js +370 -0
- data/closure-library/closure/goog/ui/containerrenderer_test.html +227 -0
- data/closure-library/closure/goog/ui/containerscroller.js +221 -0
- data/closure-library/closure/goog/ui/containerscroller_test.html +213 -0
- data/closure-library/closure/goog/ui/control.js +1348 -0
- data/closure-library/closure/goog/ui/control_test.html +2128 -0
- data/closure-library/closure/goog/ui/controlcontent.js +28 -0
- data/closure-library/closure/goog/ui/controlrenderer.js +808 -0
- data/closure-library/closure/goog/ui/controlrenderer_test.html +840 -0
- data/closure-library/closure/goog/ui/cookieeditor.js +182 -0
- data/closure-library/closure/goog/ui/cookieeditor_test.html +102 -0
- data/closure-library/closure/goog/ui/css3buttonrenderer.js +147 -0
- data/closure-library/closure/goog/ui/css3menubuttonrenderer.js +144 -0
- data/closure-library/closure/goog/ui/cssnames.js +28 -0
- data/closure-library/closure/goog/ui/custombutton.js +58 -0
- data/closure-library/closure/goog/ui/custombuttonrenderer.js +254 -0
- data/closure-library/closure/goog/ui/customcolorpalette.js +137 -0
- data/closure-library/closure/goog/ui/customcolorpalette_test.html +60 -0
- data/closure-library/closure/goog/ui/datepicker.js +1339 -0
- data/closure-library/closure/goog/ui/datepicker_test.html +190 -0
- data/closure-library/closure/goog/ui/decorate.js +37 -0
- data/closure-library/closure/goog/ui/decorate_test.html +113 -0
- data/closure-library/closure/goog/ui/deprecatedbutton.js +381 -0
- data/closure-library/closure/goog/ui/dialog.js +1776 -0
- data/closure-library/closure/goog/ui/dialog_test.html +493 -0
- data/closure-library/closure/goog/ui/dimensionpicker.js +289 -0
- data/closure-library/closure/goog/ui/dimensionpicker_test.html +128 -0
- data/closure-library/closure/goog/ui/dimensionpickerrenderer.js +387 -0
- data/closure-library/closure/goog/ui/dragdropdetector.js +642 -0
- data/closure-library/closure/goog/ui/drilldownrow.js +494 -0
- data/closure-library/closure/goog/ui/editor/abstractdialog.js +443 -0
- data/closure-library/closure/goog/ui/editor/abstractdialog_test.html +467 -0
- data/closure-library/closure/goog/ui/editor/bubble.js +520 -0
- data/closure-library/closure/goog/ui/editor/bubble_test.html +264 -0
- data/closure-library/closure/goog/ui/editor/defaulttoolbar.js +1062 -0
- data/closure-library/closure/goog/ui/editor/linkdialog.js +833 -0
- data/closure-library/closure/goog/ui/editor/linkdialog_test.html +449 -0
- data/closure-library/closure/goog/ui/editor/messages.js +115 -0
- data/closure-library/closure/goog/ui/editor/tabpane.js +183 -0
- data/closure-library/closure/goog/ui/editor/toolbarcontroller.js +293 -0
- data/closure-library/closure/goog/ui/editor/toolbarfactory.js +437 -0
- data/closure-library/closure/goog/ui/editor/toolbarfactory_test.html +73 -0
- data/closure-library/closure/goog/ui/emoji/emoji.js +72 -0
- data/closure-library/closure/goog/ui/emoji/emojipalette.js +298 -0
- data/closure-library/closure/goog/ui/emoji/emojipaletterenderer.js +206 -0
- data/closure-library/closure/goog/ui/emoji/emojipicker.js +797 -0
- data/closure-library/closure/goog/ui/emoji/emojipicker_test.html +840 -0
- data/closure-library/closure/goog/ui/emoji/fast_nonprogressive_emojipicker_test.html +256 -0
- data/closure-library/closure/goog/ui/emoji/fast_progressive_emojipicker_test.html +256 -0
- data/closure-library/closure/goog/ui/emoji/popupemojipicker.js +410 -0
- data/closure-library/closure/goog/ui/emoji/popupemojipicker_test.html +80 -0
- data/closure-library/closure/goog/ui/emoji/progressiveemojipaletterenderer.js +97 -0
- data/closure-library/closure/goog/ui/emoji/spriteinfo.js +212 -0
- data/closure-library/closure/goog/ui/emoji/spriteinfo_test.html +51 -0
- data/closure-library/closure/goog/ui/filteredmenu.js +562 -0
- data/closure-library/closure/goog/ui/filteredmenu_test.html +299 -0
- data/closure-library/closure/goog/ui/filterobservingmenuitem.js +97 -0
- data/closure-library/closure/goog/ui/filterobservingmenuitemrenderer.js +60 -0
- data/closure-library/closure/goog/ui/flatbuttonrenderer.js +138 -0
- data/closure-library/closure/goog/ui/flatmenubuttonrenderer.js +199 -0
- data/closure-library/closure/goog/ui/formpost.js +109 -0
- data/closure-library/closure/goog/ui/formpost_test.html +109 -0
- data/closure-library/closure/goog/ui/gauge.js +999 -0
- data/closure-library/closure/goog/ui/gaugetheme.js +169 -0
- data/closure-library/closure/goog/ui/hovercard.js +447 -0
- data/closure-library/closure/goog/ui/hovercard_test.html +343 -0
- data/closure-library/closure/goog/ui/hsvapalette.js +311 -0
- data/closure-library/closure/goog/ui/hsvapalette_test.html +152 -0
- data/closure-library/closure/goog/ui/hsvpalette.js +470 -0
- data/closure-library/closure/goog/ui/hsvpalette_test.html +202 -0
- data/closure-library/closure/goog/ui/idgenerator.js +57 -0
- data/closure-library/closure/goog/ui/idletimer.js +299 -0
- data/closure-library/closure/goog/ui/idletimer_test.html +100 -0
- data/closure-library/closure/goog/ui/iframemask.js +256 -0
- data/closure-library/closure/goog/ui/iframemask_test.html +230 -0
- data/closure-library/closure/goog/ui/imagelessbuttonrenderer.js +204 -0
- data/closure-library/closure/goog/ui/imagelessmenubuttonrenderer.js +202 -0
- data/closure-library/closure/goog/ui/imagelessroundedcorner.js +971 -0
- data/closure-library/closure/goog/ui/inputdatepicker.js +306 -0
- data/closure-library/closure/goog/ui/inputdatepicker_test.html +109 -0
- data/closure-library/closure/goog/ui/itemevent.js +50 -0
- data/closure-library/closure/goog/ui/keyboardshortcuthandler.js +981 -0
- data/closure-library/closure/goog/ui/keyboardshortcuthandler_test.html +671 -0
- data/closure-library/closure/goog/ui/labelinput.js +439 -0
- data/closure-library/closure/goog/ui/linkbuttonrenderer.js +67 -0
- data/closure-library/closure/goog/ui/media/flashobject.js +629 -0
- data/closure-library/closure/goog/ui/media/flashobject_test.html +236 -0
- data/closure-library/closure/goog/ui/media/flickr.js +309 -0
- data/closure-library/closure/goog/ui/media/flickr_test.html +90 -0
- data/closure-library/closure/goog/ui/media/media.js +284 -0
- data/closure-library/closure/goog/ui/media/media_test.html +161 -0
- data/closure-library/closure/goog/ui/media/mediamodel.js +840 -0
- data/closure-library/closure/goog/ui/media/mp3.js +225 -0
- data/closure-library/closure/goog/ui/media/mp3_test.html +78 -0
- data/closure-library/closure/goog/ui/media/photo.js +139 -0
- data/closure-library/closure/goog/ui/media/photo_test.html +62 -0
- data/closure-library/closure/goog/ui/media/picasa.js +317 -0
- data/closure-library/closure/goog/ui/media/picasa_test.html +131 -0
- data/closure-library/closure/goog/ui/media/vimeo.js +264 -0
- data/closure-library/closure/goog/ui/media/vimeo_test.html +79 -0
- data/closure-library/closure/goog/ui/media/youtube.js +328 -0
- data/closure-library/closure/goog/ui/media/youtube_test.html +185 -0
- data/closure-library/closure/goog/ui/menu.js +435 -0
- data/closure-library/closure/goog/ui/menu_test.html +129 -0
- data/closure-library/closure/goog/ui/menubase.js +191 -0
- data/closure-library/closure/goog/ui/menubutton.js +809 -0
- data/closure-library/closure/goog/ui/menubutton_test.html +440 -0
- data/closure-library/closure/goog/ui/menubutton_test_frame.html +41 -0
- data/closure-library/closure/goog/ui/menubuttonrenderer.js +226 -0
- data/closure-library/closure/goog/ui/menubuttonrenderer_test.html +161 -0
- data/closure-library/closure/goog/ui/menuheader.js +62 -0
- data/closure-library/closure/goog/ui/menuheaderrenderer.js +55 -0
- data/closure-library/closure/goog/ui/menuitem.js +154 -0
- data/closure-library/closure/goog/ui/menuitem_test.html +506 -0
- data/closure-library/closure/goog/ui/menuitemrenderer.js +353 -0
- data/closure-library/closure/goog/ui/menuitemrenderer_test.html +190 -0
- data/closure-library/closure/goog/ui/menurenderer.js +118 -0
- data/closure-library/closure/goog/ui/menuseparator.js +51 -0
- data/closure-library/closure/goog/ui/menuseparatorrenderer.js +102 -0
- data/closure-library/closure/goog/ui/mockactivitymonitor.js +54 -0
- data/closure-library/closure/goog/ui/nativebuttonrenderer.js +205 -0
- data/closure-library/closure/goog/ui/nativebuttonrenderer_test.html +213 -0
- data/closure-library/closure/goog/ui/offlineinstalldialog.js +1086 -0
- data/closure-library/closure/goog/ui/offlinestatuscard.js +580 -0
- data/closure-library/closure/goog/ui/offlinestatuscomponent.js +545 -0
- data/closure-library/closure/goog/ui/option.js +67 -0
- data/closure-library/closure/goog/ui/palette.js +528 -0
- data/closure-library/closure/goog/ui/paletterenderer.js +318 -0
- data/closure-library/closure/goog/ui/plaintextspellchecker.js +668 -0
- data/closure-library/closure/goog/ui/plaintextspellchecker_test.html +240 -0
- data/closure-library/closure/goog/ui/popup.js +410 -0
- data/closure-library/closure/goog/ui/popup_test.html +137 -0
- data/closure-library/closure/goog/ui/popupbase.js +721 -0
- data/closure-library/closure/goog/ui/popupbase_test.html +186 -0
- data/closure-library/closure/goog/ui/popupcolorpicker.js +441 -0
- data/closure-library/closure/goog/ui/popupcolorpicker_test.html +71 -0
- data/closure-library/closure/goog/ui/popupdatepicker.js +273 -0
- data/closure-library/closure/goog/ui/popupmenu.js +539 -0
- data/closure-library/closure/goog/ui/popupmenu_test.html +197 -0
- data/closure-library/closure/goog/ui/progressbar.js +390 -0
- data/closure-library/closure/goog/ui/prompt.js +307 -0
- data/closure-library/closure/goog/ui/prompt_test.html +65 -0
- data/closure-library/closure/goog/ui/rangemodel.js +301 -0
- data/closure-library/closure/goog/ui/rangemodel_test.html +270 -0
- data/closure-library/closure/goog/ui/ratings.js +441 -0
- data/closure-library/closure/goog/ui/registry.js +166 -0
- data/closure-library/closure/goog/ui/registry_test.html +236 -0
- data/closure-library/closure/goog/ui/richtextspellchecker.js +600 -0
- data/closure-library/closure/goog/ui/richtextspellchecker_test.html +224 -0
- data/closure-library/closure/goog/ui/roundedcorners.js +694 -0
- data/closure-library/closure/goog/ui/roundedpanel.js +609 -0
- data/closure-library/closure/goog/ui/roundedpanel_test.html +57 -0
- data/closure-library/closure/goog/ui/roundedtabrenderer.js +196 -0
- data/closure-library/closure/goog/ui/scrollfloater.js +394 -0
- data/closure-library/closure/goog/ui/scrollfloater_test.html +46 -0
- data/closure-library/closure/goog/ui/select.js +397 -0
- data/closure-library/closure/goog/ui/select_test.html +152 -0
- data/closure-library/closure/goog/ui/selectionmenubutton.js +277 -0
- data/closure-library/closure/goog/ui/selectionmenubutton_test.html +237 -0
- data/closure-library/closure/goog/ui/selectionmodel.js +291 -0
- data/closure-library/closure/goog/ui/separator.js +74 -0
- data/closure-library/closure/goog/ui/serverchart.js +1791 -0
- data/closure-library/closure/goog/ui/serverchart_test.html +598 -0
- data/closure-library/closure/goog/ui/slider.js +125 -0
- data/closure-library/closure/goog/ui/sliderbase.js +1087 -0
- data/closure-library/closure/goog/ui/sliderbase_test.html +198 -0
- data/closure-library/closure/goog/ui/splitbehavior.js +348 -0
- data/closure-library/closure/goog/ui/splitbehavior_test.html +161 -0
- data/closure-library/closure/goog/ui/splitpane.js +844 -0
- data/closure-library/closure/goog/ui/splitpane_test.html +143 -0
- data/closure-library/closure/goog/ui/style/app/buttonrenderer.js +204 -0
- data/closure-library/closure/goog/ui/style/app/buttonrenderer_test.html +155 -0
- data/closure-library/closure/goog/ui/style/app/menubuttonrenderer.js +227 -0
- data/closure-library/closure/goog/ui/style/app/menubuttonrenderer_test.html +167 -0
- data/closure-library/closure/goog/ui/style/app/primaryactionbuttonrenderer.js +88 -0
- data/closure-library/closure/goog/ui/style/app/primaryactionbuttonrenderer_test.html +76 -0
- data/closure-library/closure/goog/ui/submenu.js +660 -0
- data/closure-library/closure/goog/ui/submenu_test.html +446 -0
- data/closure-library/closure/goog/ui/submenurenderer.js +188 -0
- data/closure-library/closure/goog/ui/tab.js +102 -0
- data/closure-library/closure/goog/ui/tab_test.html +61 -0
- data/closure-library/closure/goog/ui/tabbar.js +393 -0
- data/closure-library/closure/goog/ui/tabbar_test.html +611 -0
- data/closure-library/closure/goog/ui/tabbarrenderer.js +173 -0
- data/closure-library/closure/goog/ui/tabbarrenderer_test.html +137 -0
- data/closure-library/closure/goog/ui/tablesorter.js +304 -0
- data/closure-library/closure/goog/ui/tablesorter_test.html +127 -0
- data/closure-library/closure/goog/ui/tabpane.js +674 -0
- data/closure-library/closure/goog/ui/tabpane_test.html +107 -0
- data/closure-library/closure/goog/ui/tabrenderer.js +152 -0
- data/closure-library/closure/goog/ui/tabrenderer_test.html +132 -0
- data/closure-library/closure/goog/ui/textarea.js +573 -0
- data/closure-library/closure/goog/ui/textarea_test.html +305 -0
- data/closure-library/closure/goog/ui/textarearenderer.js +167 -0
- data/closure-library/closure/goog/ui/togglebutton.js +58 -0
- data/closure-library/closure/goog/ui/toolbar.js +45 -0
- data/closure-library/closure/goog/ui/toolbarbutton.js +54 -0
- data/closure-library/closure/goog/ui/toolbarbuttonrenderer.js +55 -0
- data/closure-library/closure/goog/ui/toolbarcolormenubutton.js +57 -0
- data/closure-library/closure/goog/ui/toolbarcolormenubuttonrenderer.js +95 -0
- data/closure-library/closure/goog/ui/toolbarcolormenubuttonrenderer_test.html +66 -0
- data/closure-library/closure/goog/ui/toolbarmenubutton.js +56 -0
- data/closure-library/closure/goog/ui/toolbarmenubuttonrenderer.js +55 -0
- data/closure-library/closure/goog/ui/toolbarrenderer.js +95 -0
- data/closure-library/closure/goog/ui/toolbarselect.js +55 -0
- data/closure-library/closure/goog/ui/toolbarseparator.js +51 -0
- data/closure-library/closure/goog/ui/toolbarseparatorrenderer.js +87 -0
- data/closure-library/closure/goog/ui/toolbartogglebutton.js +53 -0
- data/closure-library/closure/goog/ui/tooltip.js +975 -0
- data/closure-library/closure/goog/ui/tooltip_test.html +351 -0
- data/closure-library/closure/goog/ui/tree/basenode.js +1457 -0
- data/closure-library/closure/goog/ui/tree/basenode_test.html +218 -0
- data/closure-library/closure/goog/ui/tree/treecontrol.js +656 -0
- data/closure-library/closure/goog/ui/tree/treecontrol_test.html +113 -0
- data/closure-library/closure/goog/ui/tree/treenode.js +102 -0
- data/closure-library/closure/goog/ui/tree/typeahead.js +332 -0
- data/closure-library/closure/goog/ui/tree/typeahead_test.html +133 -0
- data/closure-library/closure/goog/ui/tristatemenuitem.js +185 -0
- data/closure-library/closure/goog/ui/tristatemenuitemrenderer.js +86 -0
- data/closure-library/closure/goog/ui/twothumbslider.js +134 -0
- data/closure-library/closure/goog/ui/zippy.js +277 -0
- data/closure-library/closure/goog/ui/zippy_test.html +223 -0
- data/closure-library/closure/goog/uri/uri.js +1595 -0
- data/closure-library/closure/goog/uri/uri_test.html +837 -0
- data/closure-library/closure/goog/uri/utils.js +972 -0
- data/closure-library/closure/goog/uri/utils_test.html +521 -0
- data/closure-library/closure/goog/useragent/adobereader.js +90 -0
- data/closure-library/closure/goog/useragent/adobereader_test.html +34 -0
- data/closure-library/closure/goog/useragent/flash.js +113 -0
- data/closure-library/closure/goog/useragent/flash_test.html +34 -0
- data/closure-library/closure/goog/useragent/iphoto.js +86 -0
- data/closure-library/closure/goog/useragent/jscript.js +94 -0
- data/closure-library/closure/goog/useragent/jscript_test.html +65 -0
- data/closure-library/closure/goog/useragent/picasa.js +111 -0
- data/closure-library/closure/goog/useragent/platform.js +70 -0
- data/closure-library/closure/goog/useragent/platform_test.html +108 -0
- data/closure-library/closure/goog/useragent/product.js +253 -0
- data/closure-library/closure/goog/useragent/product_isversion.js +99 -0
- data/closure-library/closure/goog/useragent/product_test.html +322 -0
- data/closure-library/closure/goog/useragent/useragent.js +464 -0
- data/closure-library/closure/goog/useragent/useragent_test.html +290 -0
- data/closure-library/closure/goog/window/window.js +206 -0
- data/closure-library/closure/goog/window/window_test.html +185 -0
- data/closure-library/third_party/closure/goog/base.js +2 -0
- data/closure-library/third_party/closure/goog/caja/string/html/htmlparser.js +611 -0
- data/closure-library/third_party/closure/goog/caja/string/html/htmlsanitizer.js +605 -0
- data/closure-library/third_party/closure/goog/deps.js +26 -0
- data/closure-library/third_party/closure/goog/dojo/dom/query.js +1532 -0
- data/closure-library/third_party/closure/goog/dojo/dom/query_test.html +63 -0
- data/closure-library/third_party/closure/goog/dojo/dom/query_test.js +160 -0
- data/closure-library/third_party/closure/goog/jpeg_encoder/jpeg_encoder_basic.js +751 -0
- data/closure-library/third_party/closure/goog/loremipsum/text/loremipsum.js +712 -0
- data/closure-library/third_party/closure/goog/loremipsum/text/loremipsum_test.html +61 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferred.js +530 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferred_test.html +627 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferredlist.js +199 -0
- data/closure-library/third_party/closure/goog/mochikit/async/deferredlist_test.html +426 -0
- data/closure-library/third_party/closure/goog/osapi/osapi.js +91 -0
- data/closure-library/third_party/closure/goog/silverlight/AppManifest.xml +6 -0
- data/closure-library/third_party/closure/goog/silverlight/AssemblyInfo.cs +35 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButton.xaml +9 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButton.xaml.cs +74 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButtonApp.xaml +8 -0
- data/closure-library/third_party/closure/goog/silverlight/ClipboardButtonApp.xaml.cs +75 -0
- data/closure-library/third_party/closure/goog/silverlight/ClosureClipboardButton.csproj +108 -0
- data/closure-library/third_party/closure/goog/silverlight/ClosureClipboardButton.csproj.user +29 -0
- data/closure-library/third_party/closure/goog/silverlight/clipboardbutton.js +279 -0
- data/closure-library/third_party/closure/goog/silverlight/silverlight.js +758 -0
- data/closure-library/third_party/closure/goog/silverlight/supporteduseragent.js +138 -0
- data/closure-library/third_party/closure/goog/silverlight/xap_files +0 -0
- data/closure-templates/COPYING +202 -0
- data/closure-templates/README +47 -0
- data/closure-templates/SoyToJsSrcCompiler.jar +0 -0
- data/closure-templates/soyutils.js +880 -0
- data/closure-templates/soyutils_usegoog.js +308 -0
- data/closure.gemspec +20 -0
- data/config.ru +40 -0
- data/java_src/ClosureScript.java +89 -0
- data/java_src/make.rb +19 -0
- data/lib/closure/beanshell.rb +80 -0
- data/lib/closure/compiler.rb +184 -0
- data/lib/closure/file_response.rb +90 -0
- data/lib/closure/goog.rb +143 -0
- data/lib/closure/middleware.rb +43 -0
- data/lib/closure/sass.rb +56 -0
- data/lib/closure/script.rb +139 -0
- data/lib/closure/server.rb +83 -0
- data/lib/closure/sources.rb +310 -0
- data/lib/closure/templates.rb +156 -0
- data/lib/closure/version.rb +20 -0
- data/lib/closure.jar +0 -0
- data/lib/closure.rb +134 -0
- data/scripts/demos/compile.js.erb +8 -0
- data/scripts/demos/compile.out +1 -0
- data/scripts/demos/compiler.haml +17 -0
- data/scripts/demos/compiler.js +12 -0
- data/scripts/demos/deps.js.erb +1 -0
- data/scripts/demos/externs.haml +16 -0
- data/scripts/demos/externs.js.erb +8 -0
- data/scripts/demos/externs.out +1 -0
- data/scripts/demos/externs_jquery.externs +849 -0
- data/scripts/demos/externs_jquery.js +167 -0
- data/scripts/demos/externs_jquerytest.js +11 -0
- data/scripts/demos/helloworld.haml +15 -0
- data/scripts/demos/helloworld.js +58 -0
- data/scripts/demos/helloworld.soy +45 -0
- data/scripts/demos/index.haml +21 -0
- data/scripts/demos/rails_ujs.haml +24 -0
- data/scripts/examples/rails/ujs.js +136 -0
- data/scripts/favicon.ico +0 -0
- data/scripts/fixtures/_partial.haml +2 -0
- data/scripts/fixtures/erb.html.erb +8 -0
- data/scripts/fixtures/haml.haml +6 -0
- data/scripts/fixtures/html.html +9 -0
- data/scripts/fixtures/route_js.js.erb +1 -0
- data/scripts/index.haml +14 -0
- data/test/beanshell_test.rb +22 -0
- data/test/server_test.rb +67 -0
- data/test/sources_test.rb +41 -0
- data/test/test_helper.rb +12 -0
- metadata +1577 -0
@@ -0,0 +1,2424 @@
|
|
1
|
+
// Copyright 2006 The Closure Library Authors. All Rights Reserved.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS-IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
/**
|
16
|
+
* @fileoverview Utilities for manipulating the browser's Document Object Model
|
17
|
+
* Inspiration taken *heavily* from mochikit (http://mochikit.com/).
|
18
|
+
*
|
19
|
+
* You can use {@link goog.dom.DomHelper} to create new dom helpers that refer
|
20
|
+
* to a different document object. This is useful if you are working with
|
21
|
+
* frames or multiple windows.
|
22
|
+
*
|
23
|
+
*/
|
24
|
+
|
25
|
+
|
26
|
+
// TODO(user): Rename/refactor getTextContent and getRawTextContent. The problem
|
27
|
+
// is that getTextContent should mimic the DOM3 textContent. We should add a
|
28
|
+
// getInnerText (or getText) which tries to return the visible text, innerText.
|
29
|
+
|
30
|
+
|
31
|
+
goog.provide('goog.dom');
|
32
|
+
goog.provide('goog.dom.DomHelper');
|
33
|
+
goog.provide('goog.dom.NodeType');
|
34
|
+
|
35
|
+
goog.require('goog.array');
|
36
|
+
goog.require('goog.dom.BrowserFeature');
|
37
|
+
goog.require('goog.dom.TagName');
|
38
|
+
goog.require('goog.dom.classes');
|
39
|
+
goog.require('goog.math.Coordinate');
|
40
|
+
goog.require('goog.math.Size');
|
41
|
+
goog.require('goog.object');
|
42
|
+
goog.require('goog.string');
|
43
|
+
goog.require('goog.userAgent');
|
44
|
+
|
45
|
+
|
46
|
+
/**
|
47
|
+
* @define {boolean} Whether we know at compile time that the browser is in
|
48
|
+
* quirks mode.
|
49
|
+
*/
|
50
|
+
goog.dom.ASSUME_QUIRKS_MODE = false;
|
51
|
+
|
52
|
+
|
53
|
+
/**
|
54
|
+
* @define {boolean} Whether we know at compile time that the browser is in
|
55
|
+
* standards compliance mode.
|
56
|
+
*/
|
57
|
+
goog.dom.ASSUME_STANDARDS_MODE = false;
|
58
|
+
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Whether we know the compatibility mode at compile time.
|
62
|
+
* @type {boolean}
|
63
|
+
* @private
|
64
|
+
*/
|
65
|
+
goog.dom.COMPAT_MODE_KNOWN_ =
|
66
|
+
goog.dom.ASSUME_QUIRKS_MODE || goog.dom.ASSUME_STANDARDS_MODE;
|
67
|
+
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Enumeration for DOM node types (for reference)
|
71
|
+
* @enum {number}
|
72
|
+
*/
|
73
|
+
goog.dom.NodeType = {
|
74
|
+
ELEMENT: 1,
|
75
|
+
ATTRIBUTE: 2,
|
76
|
+
TEXT: 3,
|
77
|
+
CDATA_SECTION: 4,
|
78
|
+
ENTITY_REFERENCE: 5,
|
79
|
+
ENTITY: 6,
|
80
|
+
PROCESSING_INSTRUCTION: 7,
|
81
|
+
COMMENT: 8,
|
82
|
+
DOCUMENT: 9,
|
83
|
+
DOCUMENT_TYPE: 10,
|
84
|
+
DOCUMENT_FRAGMENT: 11,
|
85
|
+
NOTATION: 12
|
86
|
+
};
|
87
|
+
|
88
|
+
|
89
|
+
/**
|
90
|
+
* Gets the DomHelper object for the document where the element resides.
|
91
|
+
* @param {Node|Window=} opt_element If present, gets the DomHelper for this
|
92
|
+
* element.
|
93
|
+
* @return {!goog.dom.DomHelper} The DomHelper.
|
94
|
+
*/
|
95
|
+
goog.dom.getDomHelper = function(opt_element) {
|
96
|
+
return opt_element ?
|
97
|
+
new goog.dom.DomHelper(goog.dom.getOwnerDocument(opt_element)) :
|
98
|
+
(goog.dom.defaultDomHelper_ ||
|
99
|
+
(goog.dom.defaultDomHelper_ = new goog.dom.DomHelper()));
|
100
|
+
};
|
101
|
+
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Cached default DOM helper.
|
105
|
+
* @type {goog.dom.DomHelper}
|
106
|
+
* @private
|
107
|
+
*/
|
108
|
+
goog.dom.defaultDomHelper_;
|
109
|
+
|
110
|
+
|
111
|
+
/**
|
112
|
+
* Gets the document object being used by the dom library.
|
113
|
+
* @return {!Document} Document object.
|
114
|
+
*/
|
115
|
+
goog.dom.getDocument = function() {
|
116
|
+
return document;
|
117
|
+
};
|
118
|
+
|
119
|
+
|
120
|
+
/**
|
121
|
+
* Alias for getElementById. If a DOM node is passed in then we just return
|
122
|
+
* that.
|
123
|
+
* @param {string|Element} element Element ID or a DOM node.
|
124
|
+
* @return {Element} The element with the given ID, or the node passed in.
|
125
|
+
*/
|
126
|
+
goog.dom.getElement = function(element) {
|
127
|
+
return goog.isString(element) ?
|
128
|
+
document.getElementById(element) : element;
|
129
|
+
};
|
130
|
+
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Alias for getElement.
|
134
|
+
* @param {string|Element} element Element ID or a DOM node.
|
135
|
+
* @return {Element} The element with the given ID, or the node passed in.
|
136
|
+
* @deprecated Use {@link goog.dom.getElement} instead.
|
137
|
+
*/
|
138
|
+
goog.dom.$ = goog.dom.getElement;
|
139
|
+
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Looks up elements by both tag and class name, using browser native functions
|
143
|
+
* ({@code querySelectorAll}, {@code getElementsByTagName} or
|
144
|
+
* {@code getElementsByClassName}) where possible. This function
|
145
|
+
* is a useful, if limited, way of collecting a list of DOM elements
|
146
|
+
* with certain characteristics. {@code goog.dom.query} offers a
|
147
|
+
* more powerful and general solution which allows matching on CSS3
|
148
|
+
* selector expressions, but at increased cost in code size. If all you
|
149
|
+
* need is particular tags belonging to a single class, this function
|
150
|
+
* is fast and sleek.
|
151
|
+
*
|
152
|
+
* @see {goog.dom.query}
|
153
|
+
*
|
154
|
+
* @param {?string=} opt_tag Element tag name.
|
155
|
+
* @param {?string=} opt_class Optional class name.
|
156
|
+
* @param {Document|Element=} opt_el Optional element to look in.
|
157
|
+
* @return { {length: number} } Array-like list of elements (only a length
|
158
|
+
* property and numerical indices are guaranteed to exist).
|
159
|
+
*/
|
160
|
+
goog.dom.getElementsByTagNameAndClass = function(opt_tag, opt_class, opt_el) {
|
161
|
+
return goog.dom.getElementsByTagNameAndClass_(document, opt_tag, opt_class,
|
162
|
+
opt_el);
|
163
|
+
};
|
164
|
+
|
165
|
+
|
166
|
+
/**
|
167
|
+
* Returns an array of all the elements with the provided className.
|
168
|
+
* @see {goog.dom.query}
|
169
|
+
* @param {!string} className the name of the class to look for.
|
170
|
+
* @param {Document|Element=} opt_el Optional element to look in.
|
171
|
+
* @return { {length: number} } The items found with the class name provided.
|
172
|
+
*/
|
173
|
+
goog.dom.getElementsByClass = function(className, opt_el) {
|
174
|
+
var parent = opt_el || document;
|
175
|
+
if (goog.dom.canUseQuerySelector_(parent)) {
|
176
|
+
return parent.querySelectorAll('.' + className);
|
177
|
+
} else if (parent.getElementsByClassName) {
|
178
|
+
return parent.getElementsByClassName(className);
|
179
|
+
}
|
180
|
+
return goog.dom.getElementsByTagNameAndClass_(
|
181
|
+
document, '*', className, opt_el);
|
182
|
+
};
|
183
|
+
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Returns the first element with the provided className.
|
187
|
+
* @see {goog.dom.query}
|
188
|
+
* @param {!string} className the name of the class to look for.
|
189
|
+
* @param {Element|Document=} opt_el Optional element to look in.
|
190
|
+
* @return {Element} The first item with the class name provided.
|
191
|
+
*/
|
192
|
+
goog.dom.getElementByClass = function(className, opt_el) {
|
193
|
+
var parent = opt_el || document;
|
194
|
+
var retVal = null;
|
195
|
+
if (goog.dom.canUseQuerySelector_(parent)) {
|
196
|
+
retVal = parent.querySelector('.' + className);
|
197
|
+
} else {
|
198
|
+
retVal = goog.dom.getElementsByClass(className, opt_el)[0];
|
199
|
+
}
|
200
|
+
return retVal || null;
|
201
|
+
};
|
202
|
+
|
203
|
+
|
204
|
+
/**
|
205
|
+
* Prefer the standardized (http://www.w3.org/TR/selectors-api/), native and
|
206
|
+
* fast W3C Selectors API. However, the version of WebKit that shipped with
|
207
|
+
* Safari 3.1 and Chrome has a bug where it will not correctly match mixed-
|
208
|
+
* case class name selectors in quirks mode.
|
209
|
+
* @param {!Element|Document} parent The parent document object.
|
210
|
+
* @return {boolean} whether or not we can use parent.querySelector* APIs.
|
211
|
+
* @private
|
212
|
+
*/
|
213
|
+
goog.dom.canUseQuerySelector_ = function(parent) {
|
214
|
+
return parent.querySelectorAll &&
|
215
|
+
parent.querySelector &&
|
216
|
+
(!goog.userAgent.WEBKIT || goog.dom.isCss1CompatMode_(document) ||
|
217
|
+
goog.userAgent.isVersion('528'));
|
218
|
+
};
|
219
|
+
|
220
|
+
|
221
|
+
/**
|
222
|
+
* Helper for {@code getElementsByTagNameAndClass}.
|
223
|
+
* @param {!Document} doc The document to get the elements in.
|
224
|
+
* @param {?string=} opt_tag Element tag name.
|
225
|
+
* @param {?string=} opt_class Optional class name.
|
226
|
+
* @param {Document|Element=} opt_el Optional element to look in.
|
227
|
+
* @return { {length: number} } Array-like list of elements (only a length
|
228
|
+
* property and numerical indices are guaranteed to exist).
|
229
|
+
* @private
|
230
|
+
*/
|
231
|
+
goog.dom.getElementsByTagNameAndClass_ = function(doc, opt_tag, opt_class,
|
232
|
+
opt_el) {
|
233
|
+
var parent = opt_el || doc;
|
234
|
+
var tagName = (opt_tag && opt_tag != '*') ? opt_tag.toUpperCase() : '';
|
235
|
+
|
236
|
+
if (goog.dom.canUseQuerySelector_(parent) &&
|
237
|
+
(tagName || opt_class)) {
|
238
|
+
var query = tagName + (opt_class ? '.' + opt_class : '');
|
239
|
+
return parent.querySelectorAll(query);
|
240
|
+
}
|
241
|
+
|
242
|
+
// Use the native getElementsByClassName if available, under the assumption
|
243
|
+
// that even when the tag name is specified, there will be fewer elements to
|
244
|
+
// filter through when going by class than by tag name
|
245
|
+
if (opt_class && parent.getElementsByClassName) {
|
246
|
+
var els = parent.getElementsByClassName(opt_class);
|
247
|
+
|
248
|
+
if (tagName) {
|
249
|
+
var arrayLike = {};
|
250
|
+
var len = 0;
|
251
|
+
|
252
|
+
// Filter for specific tags if requested.
|
253
|
+
for (var i = 0, el; el = els[i]; i++) {
|
254
|
+
if (tagName == el.nodeName) {
|
255
|
+
arrayLike[len++] = el;
|
256
|
+
}
|
257
|
+
}
|
258
|
+
arrayLike.length = len;
|
259
|
+
|
260
|
+
return arrayLike;
|
261
|
+
} else {
|
262
|
+
return els;
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
var els = parent.getElementsByTagName(tagName || '*');
|
267
|
+
|
268
|
+
if (opt_class) {
|
269
|
+
var arrayLike = {};
|
270
|
+
var len = 0;
|
271
|
+
for (var i = 0, el; el = els[i]; i++) {
|
272
|
+
var className = el.className;
|
273
|
+
// Check if className has a split function since SVG className does not.
|
274
|
+
if (typeof className.split == 'function' &&
|
275
|
+
goog.array.contains(className.split(/\s+/), opt_class)) {
|
276
|
+
arrayLike[len++] = el;
|
277
|
+
}
|
278
|
+
}
|
279
|
+
arrayLike.length = len;
|
280
|
+
return arrayLike;
|
281
|
+
} else {
|
282
|
+
return els;
|
283
|
+
}
|
284
|
+
};
|
285
|
+
|
286
|
+
|
287
|
+
/**
|
288
|
+
* Alias for {@code getElementsByTagNameAndClass}.
|
289
|
+
* @param {?string=} opt_tag Element tag name.
|
290
|
+
* @param {?string=} opt_class Optional class name.
|
291
|
+
* @param {Element=} opt_el Optional element to look in.
|
292
|
+
* @return { {length: number} } Array-like list of elements (only a length
|
293
|
+
* property and numerical indices are guaranteed to exist).
|
294
|
+
* @deprecated Use {@link goog.dom.getElementsByTagNameAndClass} instead.
|
295
|
+
*/
|
296
|
+
goog.dom.$$ = goog.dom.getElementsByTagNameAndClass;
|
297
|
+
|
298
|
+
|
299
|
+
/**
|
300
|
+
* Sets multiple properties on a node.
|
301
|
+
* @param {Element} element DOM node to set properties on.
|
302
|
+
* @param {Object} properties Hash of property:value pairs.
|
303
|
+
*/
|
304
|
+
goog.dom.setProperties = function(element, properties) {
|
305
|
+
goog.object.forEach(properties, function(val, key) {
|
306
|
+
if (key == 'style') {
|
307
|
+
element.style.cssText = val;
|
308
|
+
} else if (key == 'class') {
|
309
|
+
element.className = val;
|
310
|
+
} else if (key == 'for') {
|
311
|
+
element.htmlFor = val;
|
312
|
+
} else if (key in goog.dom.DIRECT_ATTRIBUTE_MAP_) {
|
313
|
+
element.setAttribute(goog.dom.DIRECT_ATTRIBUTE_MAP_[key], val);
|
314
|
+
} else {
|
315
|
+
element[key] = val;
|
316
|
+
}
|
317
|
+
});
|
318
|
+
};
|
319
|
+
|
320
|
+
|
321
|
+
/**
|
322
|
+
* Map of attributes that should be set using
|
323
|
+
* element.setAttribute(key, val) instead of element[key] = val. Used
|
324
|
+
* by goog.dom.setProperties.
|
325
|
+
*
|
326
|
+
* @type {Object}
|
327
|
+
* @private
|
328
|
+
*/
|
329
|
+
goog.dom.DIRECT_ATTRIBUTE_MAP_ = {
|
330
|
+
'cellpadding': 'cellPadding',
|
331
|
+
'cellspacing': 'cellSpacing',
|
332
|
+
'colspan': 'colSpan',
|
333
|
+
'rowspan': 'rowSpan',
|
334
|
+
'valign': 'vAlign',
|
335
|
+
'height': 'height',
|
336
|
+
'width': 'width',
|
337
|
+
'usemap': 'useMap',
|
338
|
+
'frameborder': 'frameBorder',
|
339
|
+
'maxlength': 'maxLength',
|
340
|
+
'type': 'type'
|
341
|
+
};
|
342
|
+
|
343
|
+
|
344
|
+
/**
|
345
|
+
* Gets the dimensions of the viewport.
|
346
|
+
*
|
347
|
+
* Gecko Standards mode:
|
348
|
+
* docEl.clientWidth Width of viewport excluding scrollbar.
|
349
|
+
* win.innerWidth Width of viewport including scrollbar.
|
350
|
+
* body.clientWidth Width of body element.
|
351
|
+
*
|
352
|
+
* docEl.clientHeight Height of viewport excluding scrollbar.
|
353
|
+
* win.innerHeight Height of viewport including scrollbar.
|
354
|
+
* body.clientHeight Height of document.
|
355
|
+
*
|
356
|
+
* Gecko Backwards compatible mode:
|
357
|
+
* docEl.clientWidth Width of viewport excluding scrollbar.
|
358
|
+
* win.innerWidth Width of viewport including scrollbar.
|
359
|
+
* body.clientWidth Width of viewport excluding scrollbar.
|
360
|
+
*
|
361
|
+
* docEl.clientHeight Height of document.
|
362
|
+
* win.innerHeight Height of viewport including scrollbar.
|
363
|
+
* body.clientHeight Height of viewport excluding scrollbar.
|
364
|
+
*
|
365
|
+
* IE6/7 Standards mode:
|
366
|
+
* docEl.clientWidth Width of viewport excluding scrollbar.
|
367
|
+
* win.innerWidth Undefined.
|
368
|
+
* body.clientWidth Width of body element.
|
369
|
+
*
|
370
|
+
* docEl.clientHeight Height of viewport excluding scrollbar.
|
371
|
+
* win.innerHeight Undefined.
|
372
|
+
* body.clientHeight Height of document element.
|
373
|
+
*
|
374
|
+
* IE5 + IE6/7 Backwards compatible mode:
|
375
|
+
* docEl.clientWidth 0.
|
376
|
+
* win.innerWidth Undefined.
|
377
|
+
* body.clientWidth Width of viewport excluding scrollbar.
|
378
|
+
*
|
379
|
+
* docEl.clientHeight 0.
|
380
|
+
* win.innerHeight Undefined.
|
381
|
+
* body.clientHeight Height of viewport excluding scrollbar.
|
382
|
+
*
|
383
|
+
* Opera 9 Standards and backwards compatible mode:
|
384
|
+
* docEl.clientWidth Width of viewport excluding scrollbar.
|
385
|
+
* win.innerWidth Width of viewport including scrollbar.
|
386
|
+
* body.clientWidth Width of viewport excluding scrollbar.
|
387
|
+
*
|
388
|
+
* docEl.clientHeight Height of document.
|
389
|
+
* win.innerHeight Height of viewport including scrollbar.
|
390
|
+
* body.clientHeight Height of viewport excluding scrollbar.
|
391
|
+
*
|
392
|
+
* WebKit:
|
393
|
+
* Safari 2
|
394
|
+
* docEl.clientHeight Same as scrollHeight.
|
395
|
+
* docEl.clientWidth Same as innerWidth.
|
396
|
+
* win.innerWidth Width of viewport excluding scrollbar.
|
397
|
+
* win.innerHeight Height of the viewport including scrollbar.
|
398
|
+
* frame.innerHeight Height of the viewport exluding scrollbar.
|
399
|
+
*
|
400
|
+
* Safari 3 (tested in 522)
|
401
|
+
*
|
402
|
+
* docEl.clientWidth Width of viewport excluding scrollbar.
|
403
|
+
* docEl.clientHeight Height of viewport excluding scrollbar in strict mode.
|
404
|
+
* body.clientHeight Height of viewport excluding scrollbar in quirks mode.
|
405
|
+
*
|
406
|
+
* @param {Window=} opt_window Optional window element to test.
|
407
|
+
* @return {!goog.math.Size} Object with values 'width' and 'height'.
|
408
|
+
*/
|
409
|
+
goog.dom.getViewportSize = function(opt_window) {
|
410
|
+
// TODO(user): This should not take an argument
|
411
|
+
return goog.dom.getViewportSize_(opt_window || window);
|
412
|
+
};
|
413
|
+
|
414
|
+
|
415
|
+
/**
|
416
|
+
* Helper for {@code getViewportSize}.
|
417
|
+
* @param {Window} win The window to get the view port size for.
|
418
|
+
* @return {!goog.math.Size} Object with values 'width' and 'height'.
|
419
|
+
* @private
|
420
|
+
*/
|
421
|
+
goog.dom.getViewportSize_ = function(win) {
|
422
|
+
var doc = win.document;
|
423
|
+
|
424
|
+
if (goog.userAgent.WEBKIT && !goog.userAgent.isVersion('500') &&
|
425
|
+
!goog.userAgent.MOBILE) {
|
426
|
+
// TODO(user): Sometimes we get something that isn't a valid window
|
427
|
+
// object. In this case we just revert to the current window. We need to
|
428
|
+
// figure out when this happens and find a real fix for it.
|
429
|
+
// See the comments on goog.dom.getWindow.
|
430
|
+
if (typeof win.innerHeight == 'undefined') {
|
431
|
+
win = window;
|
432
|
+
}
|
433
|
+
var innerHeight = win.innerHeight;
|
434
|
+
var scrollHeight = win.document.documentElement.scrollHeight;
|
435
|
+
|
436
|
+
if (win == win.top) {
|
437
|
+
if (scrollHeight < innerHeight) {
|
438
|
+
innerHeight -= 15; // Scrollbars are 15px wide on Mac
|
439
|
+
}
|
440
|
+
}
|
441
|
+
return new goog.math.Size(win.innerWidth, innerHeight);
|
442
|
+
}
|
443
|
+
|
444
|
+
var readsFromDocumentElement = goog.dom.isCss1CompatMode_(doc);
|
445
|
+
if (goog.userAgent.OPERA && !goog.userAgent.isVersion('9.50')) {
|
446
|
+
// Older versions of Opera used to read from document.body, but this
|
447
|
+
// changed with 9.5.
|
448
|
+
readsFromDocumentElement = false;
|
449
|
+
}
|
450
|
+
var el = readsFromDocumentElement ? doc.documentElement : doc.body;
|
451
|
+
|
452
|
+
return new goog.math.Size(el.clientWidth, el.clientHeight);
|
453
|
+
};
|
454
|
+
|
455
|
+
|
456
|
+
/**
|
457
|
+
* Calculates the height of the document.
|
458
|
+
*
|
459
|
+
* @return {number} The height of the current document.
|
460
|
+
*/
|
461
|
+
goog.dom.getDocumentHeight = function() {
|
462
|
+
return goog.dom.getDocumentHeight_(window);
|
463
|
+
};
|
464
|
+
|
465
|
+
|
466
|
+
/**
|
467
|
+
* Calculates the height of the document of the given window.
|
468
|
+
*
|
469
|
+
* Function code copied from the opensocial gadget api:
|
470
|
+
* gadgets.window.adjustHeight(opt_height)
|
471
|
+
*
|
472
|
+
* @private
|
473
|
+
* @param {Window} win The window whose document height to retrieve.
|
474
|
+
* @return {number} The height of the document of the given window.
|
475
|
+
*/
|
476
|
+
goog.dom.getDocumentHeight_ = function(win) {
|
477
|
+
// NOTE(user): This method will return the window size rather than the document
|
478
|
+
// size in webkit quirks mode.
|
479
|
+
var doc = win.document;
|
480
|
+
var height = 0;
|
481
|
+
|
482
|
+
if (doc) {
|
483
|
+
// Calculating inner content height is hard and different between
|
484
|
+
// browsers rendering in Strict vs. Quirks mode. We use a combination of
|
485
|
+
// three properties within document.body and document.documentElement:
|
486
|
+
// - scrollHeight
|
487
|
+
// - offsetHeight
|
488
|
+
// - clientHeight
|
489
|
+
// These values differ significantly between browsers and rendering modes.
|
490
|
+
// But there are patterns. It just takes a lot of time and persistence
|
491
|
+
// to figure out.
|
492
|
+
|
493
|
+
// Get the height of the viewport
|
494
|
+
var vh = goog.dom.getViewportSize_(win).height;
|
495
|
+
var body = doc.body;
|
496
|
+
var docEl = doc.documentElement;
|
497
|
+
if (goog.dom.isCss1CompatMode_(doc) && docEl.scrollHeight) {
|
498
|
+
// In Strict mode:
|
499
|
+
// The inner content height is contained in either:
|
500
|
+
// document.documentElement.scrollHeight
|
501
|
+
// document.documentElement.offsetHeight
|
502
|
+
// Based on studying the values output by different browsers,
|
503
|
+
// use the value that's NOT equal to the viewport height found above.
|
504
|
+
height = docEl.scrollHeight != vh ?
|
505
|
+
docEl.scrollHeight : docEl.offsetHeight;
|
506
|
+
} else {
|
507
|
+
// In Quirks mode:
|
508
|
+
// documentElement.clientHeight is equal to documentElement.offsetHeight
|
509
|
+
// except in IE. In most browsers, document.documentElement can be used
|
510
|
+
// to calculate the inner content height.
|
511
|
+
// However, in other browsers (e.g. IE), document.body must be used
|
512
|
+
// instead. How do we know which one to use?
|
513
|
+
// If document.documentElement.clientHeight does NOT equal
|
514
|
+
// document.documentElement.offsetHeight, then use document.body.
|
515
|
+
var sh = docEl.scrollHeight;
|
516
|
+
var oh = docEl.offsetHeight;
|
517
|
+
if (docEl.clientHeight != oh) {
|
518
|
+
sh = body.scrollHeight;
|
519
|
+
oh = body.offsetHeight;
|
520
|
+
}
|
521
|
+
|
522
|
+
// Detect whether the inner content height is bigger or smaller
|
523
|
+
// than the bounding box (viewport). If bigger, take the larger
|
524
|
+
// value. If smaller, take the smaller value.
|
525
|
+
if (sh > vh) {
|
526
|
+
// Content is larger
|
527
|
+
height = sh > oh ? sh : oh;
|
528
|
+
} else {
|
529
|
+
// Content is smaller
|
530
|
+
height = sh < oh ? sh : oh;
|
531
|
+
}
|
532
|
+
}
|
533
|
+
}
|
534
|
+
|
535
|
+
return height;
|
536
|
+
};
|
537
|
+
|
538
|
+
|
539
|
+
/**
|
540
|
+
* Gets the page scroll distance as a coordinate object.
|
541
|
+
*
|
542
|
+
* @param {Window=} opt_window Optional window element to test.
|
543
|
+
* @return {!goog.math.Coordinate} Object with values 'x' and 'y'.
|
544
|
+
* @deprecated Use {@link goog.dom.getDocumentScroll} instead.
|
545
|
+
*/
|
546
|
+
goog.dom.getPageScroll = function(opt_window) {
|
547
|
+
var win = opt_window || goog.global || window;
|
548
|
+
return goog.dom.getDomHelper(win.document).getDocumentScroll();
|
549
|
+
};
|
550
|
+
|
551
|
+
|
552
|
+
/**
|
553
|
+
* Gets the document scroll distance as a coordinate object.
|
554
|
+
*
|
555
|
+
* @return {!goog.math.Coordinate} Object with values 'x' and 'y'.
|
556
|
+
*/
|
557
|
+
goog.dom.getDocumentScroll = function() {
|
558
|
+
return goog.dom.getDocumentScroll_(document);
|
559
|
+
};
|
560
|
+
|
561
|
+
|
562
|
+
/**
|
563
|
+
* Helper for {@code getDocumentScroll}.
|
564
|
+
*
|
565
|
+
* @param {!Document} doc The document to get the scroll for.
|
566
|
+
* @return {!goog.math.Coordinate} Object with values 'x' and 'y'.
|
567
|
+
* @private
|
568
|
+
*/
|
569
|
+
goog.dom.getDocumentScroll_ = function(doc) {
|
570
|
+
var el = goog.dom.getDocumentScrollElement_(doc);
|
571
|
+
return new goog.math.Coordinate(el.scrollLeft, el.scrollTop);
|
572
|
+
};
|
573
|
+
|
574
|
+
|
575
|
+
/**
|
576
|
+
* Gets the document scroll element.
|
577
|
+
* @return {Element} Scrolling element.
|
578
|
+
*/
|
579
|
+
goog.dom.getDocumentScrollElement = function() {
|
580
|
+
return goog.dom.getDocumentScrollElement_(document);
|
581
|
+
};
|
582
|
+
|
583
|
+
|
584
|
+
/**
|
585
|
+
* Helper for {@code getDocumentScrollElement}.
|
586
|
+
* @param {!Document} doc The document to get the scroll element for.
|
587
|
+
* @return {Element} Scrolling element.
|
588
|
+
* @private
|
589
|
+
*/
|
590
|
+
goog.dom.getDocumentScrollElement_ = function(doc) {
|
591
|
+
// Safari (2 and 3) needs body.scrollLeft in both quirks mode and strict mode.
|
592
|
+
return !goog.userAgent.WEBKIT && goog.dom.isCss1CompatMode_(doc) ?
|
593
|
+
doc.documentElement : doc.body;
|
594
|
+
};
|
595
|
+
|
596
|
+
|
597
|
+
/**
|
598
|
+
* Gets the window object associated with the given document.
|
599
|
+
*
|
600
|
+
* @param {Document=} opt_doc Document object to get window for.
|
601
|
+
* @return {Window} The window associated with the given document.
|
602
|
+
*/
|
603
|
+
goog.dom.getWindow = function(opt_doc) {
|
604
|
+
// TODO(user): This should not take an argument.
|
605
|
+
return opt_doc ? goog.dom.getWindow_(opt_doc) : window;
|
606
|
+
};
|
607
|
+
|
608
|
+
|
609
|
+
/**
|
610
|
+
* Helper for {@code getWindow}.
|
611
|
+
*
|
612
|
+
* @param {!Document} doc Document object to get window for.
|
613
|
+
* @return {!Window} The window associated with the given document.
|
614
|
+
* @private
|
615
|
+
*/
|
616
|
+
goog.dom.getWindow_ = function(doc) {
|
617
|
+
return doc.parentWindow || doc.defaultView;
|
618
|
+
};
|
619
|
+
|
620
|
+
|
621
|
+
/**
|
622
|
+
* Returns a dom node with a set of attributes. This function accepts varargs
|
623
|
+
* for subsequent nodes to be added. Subsequent nodes will be added to the
|
624
|
+
* first node as childNodes.
|
625
|
+
*
|
626
|
+
* So:
|
627
|
+
* <code>createDom('div', null, createDom('p'), createDom('p'));</code>
|
628
|
+
* would return a div with two child paragraphs
|
629
|
+
*
|
630
|
+
* @param {string} tagName Tag to create.
|
631
|
+
* @param {Object|Array.<string>|string=} opt_attributes If object, then a map
|
632
|
+
* of name-value pairs for attributes. If a string, then this is the
|
633
|
+
* className of the new element. If an array, the elements will be joined
|
634
|
+
* together as the className of the new element.
|
635
|
+
* @param {...Object|string|Array|NodeList} var_args Further DOM nodes or
|
636
|
+
* strings for text nodes. If one of the var_args is an array or NodeList,i
|
637
|
+
* its elements will be added as childNodes instead.
|
638
|
+
* @return {!Element} Reference to a DOM node.
|
639
|
+
*/
|
640
|
+
goog.dom.createDom = function(tagName, opt_attributes, var_args) {
|
641
|
+
return goog.dom.createDom_(document, arguments);
|
642
|
+
};
|
643
|
+
|
644
|
+
|
645
|
+
/**
|
646
|
+
* Helper for {@code createDom}.
|
647
|
+
* @param {!Document} doc The document to create the DOM in.
|
648
|
+
* @param {!Arguments} args Argument object passed from the callers. See
|
649
|
+
* {@code goog.dom.createDom} for details.
|
650
|
+
* @return {!Element} Reference to a DOM node.
|
651
|
+
* @private
|
652
|
+
*/
|
653
|
+
goog.dom.createDom_ = function(doc, args) {
|
654
|
+
var tagName = args[0];
|
655
|
+
var attributes = args[1];
|
656
|
+
|
657
|
+
// Internet Explorer is dumb: http://msdn.microsoft.com/workshop/author/
|
658
|
+
// dhtml/reference/properties/name_2.asp
|
659
|
+
// Also does not allow setting of 'type' attribute on 'input' or 'button'.
|
660
|
+
if (!goog.dom.BrowserFeature.CAN_ADD_NAME_OR_TYPE_ATTRIBUTES && attributes &&
|
661
|
+
(attributes.name || attributes.type)) {
|
662
|
+
var tagNameArr = ['<', tagName];
|
663
|
+
if (attributes.name) {
|
664
|
+
tagNameArr.push(' name="', goog.string.htmlEscape(attributes.name),
|
665
|
+
'"');
|
666
|
+
}
|
667
|
+
if (attributes.type) {
|
668
|
+
tagNameArr.push(' type="', goog.string.htmlEscape(attributes.type),
|
669
|
+
'"');
|
670
|
+
|
671
|
+
// Clone attributes map to remove 'type' without mutating the input.
|
672
|
+
var clone = {};
|
673
|
+
goog.object.extend(clone, attributes);
|
674
|
+
attributes = clone;
|
675
|
+
delete attributes.type;
|
676
|
+
}
|
677
|
+
tagNameArr.push('>');
|
678
|
+
tagName = tagNameArr.join('');
|
679
|
+
}
|
680
|
+
|
681
|
+
var element = doc.createElement(tagName);
|
682
|
+
|
683
|
+
if (attributes) {
|
684
|
+
if (goog.isString(attributes)) {
|
685
|
+
element.className = attributes;
|
686
|
+
} else if (goog.isArray(attributes)) {
|
687
|
+
goog.dom.classes.add.apply(null, [element].concat(attributes));
|
688
|
+
} else {
|
689
|
+
goog.dom.setProperties(element, attributes);
|
690
|
+
}
|
691
|
+
}
|
692
|
+
|
693
|
+
if (args.length > 2) {
|
694
|
+
goog.dom.append_(doc, element, args, 2);
|
695
|
+
}
|
696
|
+
|
697
|
+
return element;
|
698
|
+
};
|
699
|
+
|
700
|
+
|
701
|
+
/**
|
702
|
+
* Appends a node with text or other nodes.
|
703
|
+
* @param {!Document} doc The document to create new nodes in.
|
704
|
+
* @param {!Node} parent The node to append nodes to.
|
705
|
+
* @param {!Arguments} args The values to add. See {@code goog.dom.append}.
|
706
|
+
* @param {number} startIndex The index of the array to start from.
|
707
|
+
* @private
|
708
|
+
*/
|
709
|
+
goog.dom.append_ = function(doc, parent, args, startIndex) {
|
710
|
+
function childHandler(child) {
|
711
|
+
// TODO(user): More coercion, ala MochiKit?
|
712
|
+
if (child) {
|
713
|
+
parent.appendChild(goog.isString(child) ?
|
714
|
+
doc.createTextNode(child) : child);
|
715
|
+
}
|
716
|
+
}
|
717
|
+
|
718
|
+
for (var i = startIndex; i < args.length; i++) {
|
719
|
+
var arg = args[i];
|
720
|
+
// TODO(user): Fix isArrayLike to return false for a text node.
|
721
|
+
if (goog.isArrayLike(arg) && !goog.dom.isNodeLike(arg)) {
|
722
|
+
// If the argument is a node list, not a real array, use a clone,
|
723
|
+
// because forEach can't be used to mutate a NodeList.
|
724
|
+
goog.array.forEach(goog.dom.isNodeList(arg) ?
|
725
|
+
goog.array.clone(arg) : arg,
|
726
|
+
childHandler);
|
727
|
+
} else {
|
728
|
+
childHandler(arg);
|
729
|
+
}
|
730
|
+
}
|
731
|
+
};
|
732
|
+
|
733
|
+
|
734
|
+
/**
|
735
|
+
* Alias for {@code createDom}.
|
736
|
+
* @param {string} tagName Tag to create.
|
737
|
+
* @param {string|Object=} opt_attributes If object, then a map of name-value
|
738
|
+
* pairs for attributes. If a string, then this is the className of the new
|
739
|
+
* element.
|
740
|
+
* @param {...Object|string|Array|NodeList} var_args Further DOM nodes or
|
741
|
+
* strings for text nodes. If one of the var_args is an array, its
|
742
|
+
* children will be added as childNodes instead.
|
743
|
+
* @return {!Element} Reference to a DOM node.
|
744
|
+
* @deprecated Use {@link goog.dom.createDom} instead.
|
745
|
+
*/
|
746
|
+
goog.dom.$dom = goog.dom.createDom;
|
747
|
+
|
748
|
+
|
749
|
+
/**
|
750
|
+
* Creates a new element.
|
751
|
+
* @param {string} name Tag name.
|
752
|
+
* @return {!Element} The new element.
|
753
|
+
*/
|
754
|
+
goog.dom.createElement = function(name) {
|
755
|
+
return document.createElement(name);
|
756
|
+
};
|
757
|
+
|
758
|
+
|
759
|
+
/**
|
760
|
+
* Creates a new text node.
|
761
|
+
* @param {string} content Content.
|
762
|
+
* @return {!Text} The new text node.
|
763
|
+
*/
|
764
|
+
goog.dom.createTextNode = function(content) {
|
765
|
+
return document.createTextNode(content);
|
766
|
+
};
|
767
|
+
|
768
|
+
|
769
|
+
/**
|
770
|
+
* Create a table.
|
771
|
+
* @param {number} rows The number of rows in the table. Must be >= 1.
|
772
|
+
* @param {number} columns The number of columns in the table. Must be >= 1.
|
773
|
+
* @param {boolean=} opt_fillWithNbsp If true, fills table entries with nsbps.
|
774
|
+
* @return {!Element} The created table.
|
775
|
+
*/
|
776
|
+
goog.dom.createTable = function(rows, columns, opt_fillWithNbsp) {
|
777
|
+
return goog.dom.createTable_(document, rows, columns, !!opt_fillWithNbsp);
|
778
|
+
};
|
779
|
+
|
780
|
+
|
781
|
+
/**
|
782
|
+
* Create a table.
|
783
|
+
* @param {!Document} doc Document object to use to create the table.
|
784
|
+
* @param {number} rows The number of rows in the table. Must be >= 1.
|
785
|
+
* @param {number} columns The number of columns in the table. Must be >= 1.
|
786
|
+
* @param {boolean} fillWithNbsp If true, fills table entries with nsbps.
|
787
|
+
* @return {!Element} The created table.
|
788
|
+
* @private
|
789
|
+
*/
|
790
|
+
goog.dom.createTable_ = function(doc, rows, columns, fillWithNbsp) {
|
791
|
+
var rowHtml = ['<tr>'];
|
792
|
+
for (var i = 0; i < columns; i++) {
|
793
|
+
rowHtml.push(fillWithNbsp ? '<td> </td>' : '<td></td>');
|
794
|
+
}
|
795
|
+
rowHtml.push('</tr>');
|
796
|
+
rowHtml = rowHtml.join('');
|
797
|
+
var totalHtml = ['<table>'];
|
798
|
+
for (i = 0; i < rows; i++) {
|
799
|
+
totalHtml.push(rowHtml);
|
800
|
+
}
|
801
|
+
totalHtml.push('</table>');
|
802
|
+
|
803
|
+
var elem = doc.createElement(goog.dom.TagName.DIV);
|
804
|
+
elem.innerHTML = totalHtml.join('');
|
805
|
+
return /** @type {!Element} */ (elem.removeChild(elem.firstChild));
|
806
|
+
};
|
807
|
+
|
808
|
+
|
809
|
+
/**
|
810
|
+
* Converts an HTML string into a document fragment.
|
811
|
+
*
|
812
|
+
* @param {string} htmlString The HTML string to convert.
|
813
|
+
* @return {!Node} The resulting document fragment.
|
814
|
+
*/
|
815
|
+
goog.dom.htmlToDocumentFragment = function(htmlString) {
|
816
|
+
return goog.dom.htmlToDocumentFragment_(document, htmlString);
|
817
|
+
};
|
818
|
+
|
819
|
+
|
820
|
+
/**
|
821
|
+
* Helper for {@code htmlToDocumentFragment}.
|
822
|
+
*
|
823
|
+
* @param {!Document} doc The document.
|
824
|
+
* @param {string} htmlString The HTML string to convert.
|
825
|
+
* @return {!Node} The resulting document fragment.
|
826
|
+
* @private
|
827
|
+
*/
|
828
|
+
goog.dom.htmlToDocumentFragment_ = function(doc, htmlString) {
|
829
|
+
var tempDiv = doc.createElement('div');
|
830
|
+
if (goog.dom.BrowserFeature.INNER_HTML_NEEDS_SCOPED_ELEMENT) {
|
831
|
+
tempDiv.innerHTML = '<br>' + htmlString;
|
832
|
+
tempDiv.removeChild(tempDiv.firstChild);
|
833
|
+
} else {
|
834
|
+
tempDiv.innerHTML = htmlString;
|
835
|
+
}
|
836
|
+
if (tempDiv.childNodes.length == 1) {
|
837
|
+
return /** @type {!Node} */ (tempDiv.removeChild(tempDiv.firstChild));
|
838
|
+
} else {
|
839
|
+
var fragment = doc.createDocumentFragment();
|
840
|
+
while (tempDiv.firstChild) {
|
841
|
+
fragment.appendChild(tempDiv.firstChild);
|
842
|
+
}
|
843
|
+
return fragment;
|
844
|
+
}
|
845
|
+
};
|
846
|
+
|
847
|
+
|
848
|
+
/**
|
849
|
+
* Returns the compatMode of the document.
|
850
|
+
* @return {string} The result is either CSS1Compat or BackCompat.
|
851
|
+
* @deprecated use goog.dom.isCss1CompatMode instead.
|
852
|
+
*/
|
853
|
+
goog.dom.getCompatMode = function() {
|
854
|
+
return goog.dom.isCss1CompatMode() ? 'CSS1Compat' : 'BackCompat';
|
855
|
+
};
|
856
|
+
|
857
|
+
|
858
|
+
/**
|
859
|
+
* Returns true if the browser is in "CSS1-compatible" (standards-compliant)
|
860
|
+
* mode, false otherwise.
|
861
|
+
* @return {boolean} True if in CSS1-compatible mode.
|
862
|
+
*/
|
863
|
+
goog.dom.isCss1CompatMode = function() {
|
864
|
+
return goog.dom.isCss1CompatMode_(document);
|
865
|
+
};
|
866
|
+
|
867
|
+
|
868
|
+
/**
|
869
|
+
* Returns true if the browser is in "CSS1-compatible" (standards-compliant)
|
870
|
+
* mode, false otherwise.
|
871
|
+
* @param {Document} doc The document to check.
|
872
|
+
* @return {boolean} True if in CSS1-compatible mode.
|
873
|
+
* @private
|
874
|
+
*/
|
875
|
+
goog.dom.isCss1CompatMode_ = function(doc) {
|
876
|
+
if (goog.dom.COMPAT_MODE_KNOWN_) {
|
877
|
+
return goog.dom.ASSUME_STANDARDS_MODE;
|
878
|
+
}
|
879
|
+
|
880
|
+
return doc.compatMode == 'CSS1Compat';
|
881
|
+
};
|
882
|
+
|
883
|
+
|
884
|
+
/**
|
885
|
+
* Determines if the given node can contain children, intended to be used for
|
886
|
+
* HTML generation.
|
887
|
+
*
|
888
|
+
* IE natively supports node.canHaveChildren but has inconsistent behavior.
|
889
|
+
* Prior to IE8 the base tag allows children and in IE9 all nodes return true
|
890
|
+
* for canHaveChildren.
|
891
|
+
*
|
892
|
+
* In practice all non-IE browsers allow you to add children to any node, but
|
893
|
+
* the behavior is inconsistent:
|
894
|
+
*
|
895
|
+
* <pre>
|
896
|
+
* var a = document.createElement('br');
|
897
|
+
* a.appendChild(document.createTextNode('foo'));
|
898
|
+
* a.appendChild(document.createTextNode('bar'));
|
899
|
+
* console.log(a.childNodes.length); // 2
|
900
|
+
* console.log(a.innerHTML); // Chrome: "", IE9: "foobar", FF3.5: "foobar"
|
901
|
+
* </pre>
|
902
|
+
*
|
903
|
+
* TODO(user): Rename shouldAllowChildren() ?
|
904
|
+
*
|
905
|
+
* @param {Node} node The node to check.
|
906
|
+
* @return {boolean} Whether the node can contain children.
|
907
|
+
*/
|
908
|
+
goog.dom.canHaveChildren = function(node) {
|
909
|
+
if (node.nodeType != goog.dom.NodeType.ELEMENT) {
|
910
|
+
return false;
|
911
|
+
}
|
912
|
+
switch (node.tagName) {
|
913
|
+
case goog.dom.TagName.APPLET:
|
914
|
+
case goog.dom.TagName.AREA:
|
915
|
+
case goog.dom.TagName.BASE:
|
916
|
+
case goog.dom.TagName.BR:
|
917
|
+
case goog.dom.TagName.COL:
|
918
|
+
case goog.dom.TagName.FRAME:
|
919
|
+
case goog.dom.TagName.HR:
|
920
|
+
case goog.dom.TagName.IMG:
|
921
|
+
case goog.dom.TagName.INPUT:
|
922
|
+
case goog.dom.TagName.IFRAME:
|
923
|
+
case goog.dom.TagName.ISINDEX:
|
924
|
+
case goog.dom.TagName.LINK:
|
925
|
+
case goog.dom.TagName.NOFRAMES:
|
926
|
+
case goog.dom.TagName.NOSCRIPT:
|
927
|
+
case goog.dom.TagName.META:
|
928
|
+
case goog.dom.TagName.OBJECT:
|
929
|
+
case goog.dom.TagName.PARAM:
|
930
|
+
case goog.dom.TagName.SCRIPT:
|
931
|
+
case goog.dom.TagName.STYLE:
|
932
|
+
return false;
|
933
|
+
}
|
934
|
+
return true;
|
935
|
+
};
|
936
|
+
|
937
|
+
|
938
|
+
/**
|
939
|
+
* Appends a child to a node.
|
940
|
+
* @param {Node} parent Parent.
|
941
|
+
* @param {Node} child Child.
|
942
|
+
*/
|
943
|
+
goog.dom.appendChild = function(parent, child) {
|
944
|
+
parent.appendChild(child);
|
945
|
+
};
|
946
|
+
|
947
|
+
|
948
|
+
/**
|
949
|
+
* Appends a node with text or other nodes.
|
950
|
+
* @param {!Node} parent The node to append nodes to.
|
951
|
+
* @param {...goog.dom.Appendable} var_args The things to append to the node.
|
952
|
+
* If this is a Node it is appended as is.
|
953
|
+
* If this is a string then a text node is appended.
|
954
|
+
* If this is an array like object then fields 0 to length - 1 are appended.
|
955
|
+
*/
|
956
|
+
goog.dom.append = function(parent, var_args) {
|
957
|
+
goog.dom.append_(goog.dom.getOwnerDocument(parent), parent, arguments, 1);
|
958
|
+
};
|
959
|
+
|
960
|
+
|
961
|
+
/**
|
962
|
+
* Removes all the child nodes on a DOM node.
|
963
|
+
* @param {Node} node Node to remove children from.
|
964
|
+
*/
|
965
|
+
goog.dom.removeChildren = function(node) {
|
966
|
+
// Note: Iterations over live collections can be slow, this is the fastest
|
967
|
+
// we could find. The double parenthesis are used to prevent JsCompiler and
|
968
|
+
// strict warnings.
|
969
|
+
var child;
|
970
|
+
while ((child = node.firstChild)) {
|
971
|
+
node.removeChild(child);
|
972
|
+
}
|
973
|
+
};
|
974
|
+
|
975
|
+
|
976
|
+
/**
|
977
|
+
* Inserts a new node before an existing reference node (i.e. as the previous
|
978
|
+
* sibling). If the reference node has no parent, then does nothing.
|
979
|
+
* @param {Node} newNode Node to insert.
|
980
|
+
* @param {Node} refNode Reference node to insert before.
|
981
|
+
*/
|
982
|
+
goog.dom.insertSiblingBefore = function(newNode, refNode) {
|
983
|
+
if (refNode.parentNode) {
|
984
|
+
refNode.parentNode.insertBefore(newNode, refNode);
|
985
|
+
}
|
986
|
+
};
|
987
|
+
|
988
|
+
|
989
|
+
/**
|
990
|
+
* Inserts a new node after an existing reference node (i.e. as the next
|
991
|
+
* sibling). If the reference node has no parent, then does nothing.
|
992
|
+
* @param {Node} newNode Node to insert.
|
993
|
+
* @param {Node} refNode Reference node to insert after.
|
994
|
+
*/
|
995
|
+
goog.dom.insertSiblingAfter = function(newNode, refNode) {
|
996
|
+
if (refNode.parentNode) {
|
997
|
+
refNode.parentNode.insertBefore(newNode, refNode.nextSibling);
|
998
|
+
}
|
999
|
+
};
|
1000
|
+
|
1001
|
+
|
1002
|
+
/**
|
1003
|
+
* Removes a node from its parent.
|
1004
|
+
* @param {Node} node The node to remove.
|
1005
|
+
* @return {Node} The node removed if removed; else, null.
|
1006
|
+
*/
|
1007
|
+
goog.dom.removeNode = function(node) {
|
1008
|
+
return node && node.parentNode ? node.parentNode.removeChild(node) : null;
|
1009
|
+
};
|
1010
|
+
|
1011
|
+
|
1012
|
+
/**
|
1013
|
+
* Replaces a node in the DOM tree. Will do nothing if {@code oldNode} has no
|
1014
|
+
* parent.
|
1015
|
+
* @param {Node} newNode Node to insert.
|
1016
|
+
* @param {Node} oldNode Node to replace.
|
1017
|
+
*/
|
1018
|
+
goog.dom.replaceNode = function(newNode, oldNode) {
|
1019
|
+
var parent = oldNode.parentNode;
|
1020
|
+
if (parent) {
|
1021
|
+
parent.replaceChild(newNode, oldNode);
|
1022
|
+
}
|
1023
|
+
};
|
1024
|
+
|
1025
|
+
|
1026
|
+
/**
|
1027
|
+
* Flattens an element. That is, removes it and replace it with its children.
|
1028
|
+
* Does nothing if the element is not in the document.
|
1029
|
+
* @param {Element} element The element to flatten.
|
1030
|
+
* @return {Element|undefined} The original element, detached from the document
|
1031
|
+
* tree, sans children; or undefined, if the element was not in the
|
1032
|
+
* document to begin with.
|
1033
|
+
*/
|
1034
|
+
goog.dom.flattenElement = function(element) {
|
1035
|
+
var child, parent = element.parentNode;
|
1036
|
+
if (parent && parent.nodeType != goog.dom.NodeType.DOCUMENT_FRAGMENT) {
|
1037
|
+
// Use IE DOM method (supported by Opera too) if available
|
1038
|
+
if (element.removeNode) {
|
1039
|
+
return /** @type {Element} */ (element.removeNode(false));
|
1040
|
+
} else {
|
1041
|
+
// Move all children of the original node up one level.
|
1042
|
+
while ((child = element.firstChild)) {
|
1043
|
+
parent.insertBefore(child, element);
|
1044
|
+
}
|
1045
|
+
|
1046
|
+
// Detach the original element.
|
1047
|
+
return /** @type {Element} */ (goog.dom.removeNode(element));
|
1048
|
+
}
|
1049
|
+
}
|
1050
|
+
};
|
1051
|
+
|
1052
|
+
|
1053
|
+
/**
|
1054
|
+
* Returns the first child node that is an element.
|
1055
|
+
* @param {Node} node The node to get the first child element of.
|
1056
|
+
* @return {Element} The first child node of {@code node} that is an element.
|
1057
|
+
*/
|
1058
|
+
goog.dom.getFirstElementChild = function(node) {
|
1059
|
+
return goog.dom.getNextElementNode_(node.firstChild, true);
|
1060
|
+
};
|
1061
|
+
|
1062
|
+
|
1063
|
+
/**
|
1064
|
+
* Returns the last child node that is an element.
|
1065
|
+
* @param {Node} node The node to get the last child element of.
|
1066
|
+
* @return {Element} The last child node of {@code node} that is an element.
|
1067
|
+
*/
|
1068
|
+
goog.dom.getLastElementChild = function(node) {
|
1069
|
+
return goog.dom.getNextElementNode_(node.lastChild, false);
|
1070
|
+
};
|
1071
|
+
|
1072
|
+
|
1073
|
+
/**
|
1074
|
+
* Returns the first next sibling that is an element.
|
1075
|
+
* @param {Node} node The node to get the next sibling element of.
|
1076
|
+
* @return {Element} The next sibling of {@code node} that is an element.
|
1077
|
+
*/
|
1078
|
+
goog.dom.getNextElementSibling = function(node) {
|
1079
|
+
return goog.dom.getNextElementNode_(node.nextSibling, true);
|
1080
|
+
};
|
1081
|
+
|
1082
|
+
|
1083
|
+
/**
|
1084
|
+
* Returns the first previous sibling that is an element.
|
1085
|
+
* @param {Node} node The node to get the previous sibling element of.
|
1086
|
+
* @return {Element} The first previous sibling of {@code node} that is
|
1087
|
+
* an element.
|
1088
|
+
*/
|
1089
|
+
goog.dom.getPreviousElementSibling = function(node) {
|
1090
|
+
return goog.dom.getNextElementNode_(node.previousSibling, false);
|
1091
|
+
};
|
1092
|
+
|
1093
|
+
|
1094
|
+
/**
|
1095
|
+
* Returns the first node that is an element in the specified direction,
|
1096
|
+
* starting with {@code node}.
|
1097
|
+
* @param {Node} node The node to get the next element from.
|
1098
|
+
* @param {boolean} forward Whether to look forwards or backwards.
|
1099
|
+
* @return {Element} The first element.
|
1100
|
+
* @private
|
1101
|
+
*/
|
1102
|
+
goog.dom.getNextElementNode_ = function(node, forward) {
|
1103
|
+
while (node && node.nodeType != goog.dom.NodeType.ELEMENT) {
|
1104
|
+
node = forward ? node.nextSibling : node.previousSibling;
|
1105
|
+
}
|
1106
|
+
|
1107
|
+
return /** @type {Element} */ (node);
|
1108
|
+
};
|
1109
|
+
|
1110
|
+
|
1111
|
+
/**
|
1112
|
+
* Returns the next node in source order from the given node.
|
1113
|
+
* @param {Node} node The node.
|
1114
|
+
* @return {Node} The next node in the DOM tree, or null if this was the last
|
1115
|
+
* node.
|
1116
|
+
*/
|
1117
|
+
goog.dom.getNextNode = function(node) {
|
1118
|
+
if (!node) {
|
1119
|
+
return null;
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
if (node.firstChild) {
|
1123
|
+
return node.firstChild;
|
1124
|
+
}
|
1125
|
+
|
1126
|
+
while (node && !node.nextSibling) {
|
1127
|
+
node = node.parentNode;
|
1128
|
+
}
|
1129
|
+
|
1130
|
+
return node ? node.nextSibling : null;
|
1131
|
+
};
|
1132
|
+
|
1133
|
+
|
1134
|
+
/**
|
1135
|
+
* Returns the previous node in source order from the given node.
|
1136
|
+
* @param {Node} node The node.
|
1137
|
+
* @return {Node} The previous node in the DOM tree, or null if this was the
|
1138
|
+
* first node.
|
1139
|
+
*/
|
1140
|
+
goog.dom.getPreviousNode = function(node) {
|
1141
|
+
if (!node) {
|
1142
|
+
return null;
|
1143
|
+
}
|
1144
|
+
|
1145
|
+
if (!node.previousSibling) {
|
1146
|
+
return node.parentNode;
|
1147
|
+
}
|
1148
|
+
|
1149
|
+
node = node.previousSibling;
|
1150
|
+
while (node && node.lastChild) {
|
1151
|
+
node = node.lastChild;
|
1152
|
+
}
|
1153
|
+
|
1154
|
+
return node;
|
1155
|
+
};
|
1156
|
+
|
1157
|
+
|
1158
|
+
/**
|
1159
|
+
* Whether the object looks like a DOM node.
|
1160
|
+
* @param {*} obj The object being tested for node likeness.
|
1161
|
+
* @return {boolean} Whether the object looks like a DOM node.
|
1162
|
+
*/
|
1163
|
+
goog.dom.isNodeLike = function(obj) {
|
1164
|
+
return goog.isObject(obj) && obj.nodeType > 0;
|
1165
|
+
};
|
1166
|
+
|
1167
|
+
|
1168
|
+
/**
|
1169
|
+
* Returns true if the specified value is a Window object. This includes the
|
1170
|
+
* global window for HTML pages, and iframe windows.
|
1171
|
+
* @param {*} obj Variable to test.
|
1172
|
+
* @return {boolean} Whether the variable is a window.
|
1173
|
+
*/
|
1174
|
+
goog.dom.isWindow = function(obj) {
|
1175
|
+
return goog.isObject(obj) && obj['window'] == obj;
|
1176
|
+
};
|
1177
|
+
|
1178
|
+
|
1179
|
+
/**
|
1180
|
+
* Whether a node contains another node.
|
1181
|
+
* @param {Node} parent The node that should contain the other node.
|
1182
|
+
* @param {Node} descendant The node to test presence of.
|
1183
|
+
* @return {boolean} Whether the parent node contains the descendent node.
|
1184
|
+
*/
|
1185
|
+
goog.dom.contains = function(parent, descendant) {
|
1186
|
+
// We use browser specific methods for this if available since it is faster
|
1187
|
+
// that way.
|
1188
|
+
|
1189
|
+
// IE DOM
|
1190
|
+
if (parent.contains && descendant.nodeType == goog.dom.NodeType.ELEMENT) {
|
1191
|
+
return parent == descendant || parent.contains(descendant);
|
1192
|
+
}
|
1193
|
+
|
1194
|
+
// W3C DOM Level 3
|
1195
|
+
if (typeof parent.compareDocumentPosition != 'undefined') {
|
1196
|
+
return parent == descendant ||
|
1197
|
+
Boolean(parent.compareDocumentPosition(descendant) & 16);
|
1198
|
+
}
|
1199
|
+
|
1200
|
+
// W3C DOM Level 1
|
1201
|
+
while (descendant && parent != descendant) {
|
1202
|
+
descendant = descendant.parentNode;
|
1203
|
+
}
|
1204
|
+
return descendant == parent;
|
1205
|
+
};
|
1206
|
+
|
1207
|
+
|
1208
|
+
/**
|
1209
|
+
* Compares the document order of two nodes, returning 0 if they are the same
|
1210
|
+
* node, a negative number if node1 is before node2, and a positive number if
|
1211
|
+
* node2 is before node1. Note that we compare the order the tags appear in the
|
1212
|
+
* document so in the tree <b><i>text</i></b> the B node is considered to be
|
1213
|
+
* before the I node.
|
1214
|
+
*
|
1215
|
+
* @param {Node} node1 The first node to compare.
|
1216
|
+
* @param {Node} node2 The second node to compare.
|
1217
|
+
* @return {number} 0 if the nodes are the same node, a negative number if node1
|
1218
|
+
* is before node2, and a positive number if node2 is before node1.
|
1219
|
+
*/
|
1220
|
+
goog.dom.compareNodeOrder = function(node1, node2) {
|
1221
|
+
// Fall out quickly for equality.
|
1222
|
+
if (node1 == node2) {
|
1223
|
+
return 0;
|
1224
|
+
}
|
1225
|
+
|
1226
|
+
// Use compareDocumentPosition where available
|
1227
|
+
if (node1.compareDocumentPosition) {
|
1228
|
+
// 4 is the bitmask for FOLLOWS.
|
1229
|
+
return node1.compareDocumentPosition(node2) & 2 ? 1 : -1;
|
1230
|
+
}
|
1231
|
+
|
1232
|
+
// Process in IE using sourceIndex - we check to see if the first node has
|
1233
|
+
// a source index or if its parent has one.
|
1234
|
+
if ('sourceIndex' in node1 ||
|
1235
|
+
(node1.parentNode && 'sourceIndex' in node1.parentNode)) {
|
1236
|
+
var isElement1 = node1.nodeType == goog.dom.NodeType.ELEMENT;
|
1237
|
+
var isElement2 = node2.nodeType == goog.dom.NodeType.ELEMENT;
|
1238
|
+
|
1239
|
+
if (isElement1 && isElement2) {
|
1240
|
+
return node1.sourceIndex - node2.sourceIndex;
|
1241
|
+
} else {
|
1242
|
+
var parent1 = node1.parentNode;
|
1243
|
+
var parent2 = node2.parentNode;
|
1244
|
+
|
1245
|
+
if (parent1 == parent2) {
|
1246
|
+
return goog.dom.compareSiblingOrder_(node1, node2);
|
1247
|
+
}
|
1248
|
+
|
1249
|
+
if (!isElement1 && goog.dom.contains(parent1, node2)) {
|
1250
|
+
return -1 * goog.dom.compareParentsDescendantNodeIe_(node1, node2);
|
1251
|
+
}
|
1252
|
+
|
1253
|
+
|
1254
|
+
if (!isElement2 && goog.dom.contains(parent2, node1)) {
|
1255
|
+
return goog.dom.compareParentsDescendantNodeIe_(node2, node1);
|
1256
|
+
}
|
1257
|
+
|
1258
|
+
return (isElement1 ? node1.sourceIndex : parent1.sourceIndex) -
|
1259
|
+
(isElement2 ? node2.sourceIndex : parent2.sourceIndex);
|
1260
|
+
}
|
1261
|
+
}
|
1262
|
+
|
1263
|
+
// For Safari, we compare ranges.
|
1264
|
+
var doc = goog.dom.getOwnerDocument(node1);
|
1265
|
+
|
1266
|
+
var range1, range2;
|
1267
|
+
range1 = doc.createRange();
|
1268
|
+
range1.selectNode(node1);
|
1269
|
+
range1.collapse(true);
|
1270
|
+
|
1271
|
+
range2 = doc.createRange();
|
1272
|
+
range2.selectNode(node2);
|
1273
|
+
range2.collapse(true);
|
1274
|
+
|
1275
|
+
return range1.compareBoundaryPoints(goog.global['Range'].START_TO_END,
|
1276
|
+
range2);
|
1277
|
+
};
|
1278
|
+
|
1279
|
+
|
1280
|
+
/**
|
1281
|
+
* Utility function to compare the position of two nodes, when
|
1282
|
+
* {@code textNode}'s parent is an ancestor of {@code node}. If this entry
|
1283
|
+
* condition is not met, this function will attempt to reference a null object.
|
1284
|
+
* @param {Node} textNode The textNode to compare.
|
1285
|
+
* @param {Node} node The node to compare.
|
1286
|
+
* @return {number} -1 if node is before textNode, +1 otherwise.
|
1287
|
+
* @private
|
1288
|
+
*/
|
1289
|
+
goog.dom.compareParentsDescendantNodeIe_ = function(textNode, node) {
|
1290
|
+
var parent = textNode.parentNode;
|
1291
|
+
if (parent == node) {
|
1292
|
+
// If textNode is a child of node, then node comes first.
|
1293
|
+
return -1;
|
1294
|
+
}
|
1295
|
+
var sibling = node;
|
1296
|
+
while (sibling.parentNode != parent) {
|
1297
|
+
sibling = sibling.parentNode;
|
1298
|
+
}
|
1299
|
+
return goog.dom.compareSiblingOrder_(sibling, textNode);
|
1300
|
+
};
|
1301
|
+
|
1302
|
+
|
1303
|
+
/**
|
1304
|
+
* Utility function to compare the position of two nodes known to be non-equal
|
1305
|
+
* siblings.
|
1306
|
+
* @param {Node} node1 The first node to compare.
|
1307
|
+
* @param {Node} node2 The second node to compare.
|
1308
|
+
* @return {number} -1 if node1 is before node2, +1 otherwise.
|
1309
|
+
* @private
|
1310
|
+
*/
|
1311
|
+
goog.dom.compareSiblingOrder_ = function(node1, node2) {
|
1312
|
+
var s = node2;
|
1313
|
+
while ((s = s.previousSibling)) {
|
1314
|
+
if (s == node1) {
|
1315
|
+
// We just found node1 before node2.
|
1316
|
+
return -1;
|
1317
|
+
}
|
1318
|
+
}
|
1319
|
+
|
1320
|
+
// Since we didn't find it, node1 must be after node2.
|
1321
|
+
return 1;
|
1322
|
+
};
|
1323
|
+
|
1324
|
+
|
1325
|
+
/**
|
1326
|
+
* Find the deepest common ancestor of the given nodes.
|
1327
|
+
* @param {...Node} var_args The nodes to find a common ancestor of.
|
1328
|
+
* @return {Node} The common ancestor of the nodes, or null if there is none.
|
1329
|
+
* null will only be returned if two or more of the nodes are from different
|
1330
|
+
* documents.
|
1331
|
+
*/
|
1332
|
+
goog.dom.findCommonAncestor = function(var_args) {
|
1333
|
+
var i, count = arguments.length;
|
1334
|
+
if (!count) {
|
1335
|
+
return null;
|
1336
|
+
} else if (count == 1) {
|
1337
|
+
return arguments[0];
|
1338
|
+
}
|
1339
|
+
|
1340
|
+
var paths = [];
|
1341
|
+
var minLength = Infinity;
|
1342
|
+
for (i = 0; i < count; i++) {
|
1343
|
+
// Compute the list of ancestors.
|
1344
|
+
var ancestors = [];
|
1345
|
+
var node = arguments[i];
|
1346
|
+
while (node) {
|
1347
|
+
ancestors.unshift(node);
|
1348
|
+
node = node.parentNode;
|
1349
|
+
}
|
1350
|
+
|
1351
|
+
// Save the list for comparison.
|
1352
|
+
paths.push(ancestors);
|
1353
|
+
minLength = Math.min(minLength, ancestors.length);
|
1354
|
+
}
|
1355
|
+
var output = null;
|
1356
|
+
for (i = 0; i < minLength; i++) {
|
1357
|
+
var first = paths[0][i];
|
1358
|
+
for (var j = 1; j < count; j++) {
|
1359
|
+
if (first != paths[j][i]) {
|
1360
|
+
return output;
|
1361
|
+
}
|
1362
|
+
}
|
1363
|
+
output = first;
|
1364
|
+
}
|
1365
|
+
return output;
|
1366
|
+
};
|
1367
|
+
|
1368
|
+
|
1369
|
+
/**
|
1370
|
+
* Returns the owner document for a node.
|
1371
|
+
* @param {Node|Window} node The node to get the document for.
|
1372
|
+
* @return {!Document} The document owning the node.
|
1373
|
+
*/
|
1374
|
+
goog.dom.getOwnerDocument = function(node) {
|
1375
|
+
// TODO(user): Remove IE5 code.
|
1376
|
+
// IE5 uses document instead of ownerDocument
|
1377
|
+
return /** @type {!Document} */ (
|
1378
|
+
node.nodeType == goog.dom.NodeType.DOCUMENT ? node :
|
1379
|
+
node.ownerDocument || node.document);
|
1380
|
+
};
|
1381
|
+
|
1382
|
+
|
1383
|
+
/**
|
1384
|
+
* Cross-browser function for getting the document element of a frame or iframe.
|
1385
|
+
* @param {Element} frame Frame element.
|
1386
|
+
* @return {!Document} The frame content document.
|
1387
|
+
*/
|
1388
|
+
goog.dom.getFrameContentDocument = function(frame) {
|
1389
|
+
var doc;
|
1390
|
+
if (goog.userAgent.WEBKIT) {
|
1391
|
+
doc = (frame.document || frame.contentWindow.document);
|
1392
|
+
} else {
|
1393
|
+
doc = (frame.contentDocument || frame.contentWindow.document);
|
1394
|
+
}
|
1395
|
+
return doc;
|
1396
|
+
};
|
1397
|
+
|
1398
|
+
|
1399
|
+
/**
|
1400
|
+
* Cross-browser function for getting the window of a frame or iframe.
|
1401
|
+
* @param {HTMLIFrameElement|HTMLFrameElement} frame Frame element.
|
1402
|
+
* @return {Window} The window associated with the given frame.
|
1403
|
+
*/
|
1404
|
+
goog.dom.getFrameContentWindow = function(frame) {
|
1405
|
+
return frame.contentWindow ||
|
1406
|
+
goog.dom.getWindow_(goog.dom.getFrameContentDocument(frame));
|
1407
|
+
};
|
1408
|
+
|
1409
|
+
|
1410
|
+
/**
|
1411
|
+
* Cross-browser function for setting the text content of an element.
|
1412
|
+
* @param {Element} element The element to change the text content of.
|
1413
|
+
* @param {string} text The string that should replace the current element
|
1414
|
+
* content.
|
1415
|
+
*/
|
1416
|
+
goog.dom.setTextContent = function(element, text) {
|
1417
|
+
if ('textContent' in element) {
|
1418
|
+
element.textContent = text;
|
1419
|
+
} else if (element.firstChild &&
|
1420
|
+
element.firstChild.nodeType == goog.dom.NodeType.TEXT) {
|
1421
|
+
// If the first child is a text node we just change its data and remove the
|
1422
|
+
// rest of the children.
|
1423
|
+
while (element.lastChild != element.firstChild) {
|
1424
|
+
element.removeChild(element.lastChild);
|
1425
|
+
}
|
1426
|
+
element.firstChild.data = text;
|
1427
|
+
} else {
|
1428
|
+
goog.dom.removeChildren(element);
|
1429
|
+
var doc = goog.dom.getOwnerDocument(element);
|
1430
|
+
element.appendChild(doc.createTextNode(text));
|
1431
|
+
}
|
1432
|
+
};
|
1433
|
+
|
1434
|
+
|
1435
|
+
/**
|
1436
|
+
* Gets the outerHTML of a node, which islike innerHTML, except that it
|
1437
|
+
* actually contains the HTML of the node itself.
|
1438
|
+
* @param {Element} element The element to get the HTML of.
|
1439
|
+
* @return {string} The outerHTML of the given element.
|
1440
|
+
*/
|
1441
|
+
goog.dom.getOuterHtml = function(element) {
|
1442
|
+
// IE, Opera and WebKit all have outerHTML.
|
1443
|
+
if ('outerHTML' in element) {
|
1444
|
+
return element.outerHTML;
|
1445
|
+
} else {
|
1446
|
+
var doc = goog.dom.getOwnerDocument(element);
|
1447
|
+
var div = doc.createElement('div');
|
1448
|
+
div.appendChild(element.cloneNode(true));
|
1449
|
+
return div.innerHTML;
|
1450
|
+
}
|
1451
|
+
};
|
1452
|
+
|
1453
|
+
|
1454
|
+
/**
|
1455
|
+
* Finds the first descendant node that matches the filter function, using
|
1456
|
+
* a depth first search. This function offers the most general purpose way
|
1457
|
+
* of finding a matching element. You may also wish to consider
|
1458
|
+
* {@code goog.dom.query} which can express many matching criteria using
|
1459
|
+
* CSS selector expressions. These expressions often result in a more
|
1460
|
+
* compact representation of the desired result.
|
1461
|
+
* @see goog.dom.query
|
1462
|
+
*
|
1463
|
+
* @param {Node} root The root of the tree to search.
|
1464
|
+
* @param {function(Node) : boolean} p The filter function.
|
1465
|
+
* @return {Node|undefined} The found node or undefined if none is found.
|
1466
|
+
*/
|
1467
|
+
goog.dom.findNode = function(root, p) {
|
1468
|
+
var rv = [];
|
1469
|
+
var found = goog.dom.findNodes_(root, p, rv, true);
|
1470
|
+
return found ? rv[0] : undefined;
|
1471
|
+
};
|
1472
|
+
|
1473
|
+
|
1474
|
+
/**
|
1475
|
+
* Finds all the descendant nodes that match the filter function, using a
|
1476
|
+
* a depth first search. This function offers the most general-purpose way
|
1477
|
+
* of finding a set of matching elements. You may also wish to consider
|
1478
|
+
* {@code goog.dom.query} which can express many matching criteria using
|
1479
|
+
* CSS selector expressions. These expressions often result in a more
|
1480
|
+
* compact representation of the desired result.
|
1481
|
+
|
1482
|
+
* @param {Node} root The root of the tree to search.
|
1483
|
+
* @param {function(Node) : boolean} p The filter function.
|
1484
|
+
* @return {Array.<Node>} The found nodes or an empty array if none are found.
|
1485
|
+
*/
|
1486
|
+
goog.dom.findNodes = function(root, p) {
|
1487
|
+
var rv = [];
|
1488
|
+
goog.dom.findNodes_(root, p, rv, false);
|
1489
|
+
return rv;
|
1490
|
+
};
|
1491
|
+
|
1492
|
+
|
1493
|
+
/**
|
1494
|
+
* Finds the first or all the descendant nodes that match the filter function,
|
1495
|
+
* using a depth first search.
|
1496
|
+
* @param {Node} root The root of the tree to search.
|
1497
|
+
* @param {function(Node) : boolean} p The filter function.
|
1498
|
+
* @param {Array.<Node>} rv The found nodes are added to this array.
|
1499
|
+
* @param {boolean} findOne If true we exit after the first found node.
|
1500
|
+
* @return {boolean} Whether the search is complete or not. True in case findOne
|
1501
|
+
* is true and the node is found. False otherwise.
|
1502
|
+
* @private
|
1503
|
+
*/
|
1504
|
+
goog.dom.findNodes_ = function(root, p, rv, findOne) {
|
1505
|
+
if (root != null) {
|
1506
|
+
for (var i = 0, child; child = root.childNodes[i]; i++) {
|
1507
|
+
if (p(child)) {
|
1508
|
+
rv.push(child);
|
1509
|
+
if (findOne) {
|
1510
|
+
return true;
|
1511
|
+
}
|
1512
|
+
}
|
1513
|
+
if (goog.dom.findNodes_(child, p, rv, findOne)) {
|
1514
|
+
return true;
|
1515
|
+
}
|
1516
|
+
}
|
1517
|
+
}
|
1518
|
+
return false;
|
1519
|
+
};
|
1520
|
+
|
1521
|
+
|
1522
|
+
/**
|
1523
|
+
* Map of tags whose content to ignore when calculating text length.
|
1524
|
+
* @type {Object}
|
1525
|
+
* @private
|
1526
|
+
*/
|
1527
|
+
goog.dom.TAGS_TO_IGNORE_ = {
|
1528
|
+
'SCRIPT': 1,
|
1529
|
+
'STYLE': 1,
|
1530
|
+
'HEAD': 1,
|
1531
|
+
'IFRAME': 1,
|
1532
|
+
'OBJECT': 1
|
1533
|
+
};
|
1534
|
+
|
1535
|
+
|
1536
|
+
/**
|
1537
|
+
* Map of tags which have predefined values with regard to whitespace.
|
1538
|
+
* @type {Object}
|
1539
|
+
* @private
|
1540
|
+
*/
|
1541
|
+
goog.dom.PREDEFINED_TAG_VALUES_ = {'IMG': ' ', 'BR': '\n'};
|
1542
|
+
|
1543
|
+
|
1544
|
+
/**
|
1545
|
+
* Returns true if the element has a tab index that allows it to receive
|
1546
|
+
* keyboard focus (tabIndex >= 0), false otherwise. Note that form elements
|
1547
|
+
* natively support keyboard focus, even if they have no tab index.
|
1548
|
+
* @param {Element} element Element to check.
|
1549
|
+
* @return {boolean} Whether the element has a tab index that allows keyboard
|
1550
|
+
* focus.
|
1551
|
+
* @see http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
|
1552
|
+
*/
|
1553
|
+
goog.dom.isFocusableTabIndex = function(element) {
|
1554
|
+
// IE returns 0 for an unset tabIndex, so we must use getAttributeNode(),
|
1555
|
+
// which returns an object with a 'specified' property if tabIndex is
|
1556
|
+
// specified. This works on other browsers, too.
|
1557
|
+
var attrNode = element.getAttributeNode('tabindex'); // Must be lowercase!
|
1558
|
+
if (attrNode && attrNode.specified) {
|
1559
|
+
var index = element.tabIndex;
|
1560
|
+
return goog.isNumber(index) && index >= 0;
|
1561
|
+
}
|
1562
|
+
return false;
|
1563
|
+
};
|
1564
|
+
|
1565
|
+
|
1566
|
+
/**
|
1567
|
+
* Enables or disables keyboard focus support on the element via its tab index.
|
1568
|
+
* Only elements for which {@link goog.dom.isFocusableTabIndex} returns true
|
1569
|
+
* (or elements that natively support keyboard focus, like form elements) can
|
1570
|
+
* receive keyboard focus. See http://go/tabindex for more info.
|
1571
|
+
* @param {Element} element Element whose tab index is to be changed.
|
1572
|
+
* @param {boolean} enable Whether to set or remove a tab index on the element
|
1573
|
+
* that supports keyboard focus.
|
1574
|
+
*/
|
1575
|
+
goog.dom.setFocusableTabIndex = function(element, enable) {
|
1576
|
+
if (enable) {
|
1577
|
+
element.tabIndex = 0;
|
1578
|
+
} else {
|
1579
|
+
element.removeAttribute('tabIndex'); // Must be camelCase!
|
1580
|
+
}
|
1581
|
+
};
|
1582
|
+
|
1583
|
+
|
1584
|
+
/**
|
1585
|
+
* Returns the text content of the current node, without markup and invisible
|
1586
|
+
* symbols. New lines are stripped and whitespace is collapsed,
|
1587
|
+
* such that each character would be visible.
|
1588
|
+
*
|
1589
|
+
* In browsers that support it, innerText is used. Other browsers attempt to
|
1590
|
+
* simulate it via node traversal. Line breaks are canonicalized in IE.
|
1591
|
+
*
|
1592
|
+
* @param {Node} node The node from which we are getting content.
|
1593
|
+
* @return {string} The text content.
|
1594
|
+
*/
|
1595
|
+
goog.dom.getTextContent = function(node) {
|
1596
|
+
var textContent;
|
1597
|
+
// Note(user): IE9, Opera, and Safara 3 support innerText but they include
|
1598
|
+
// text nodes in script tags. So we revert to use a user agent test here.
|
1599
|
+
if (goog.dom.BrowserFeature.CAN_USE_INNER_TEXT && ('innerText' in node)) {
|
1600
|
+
textContent = goog.string.canonicalizeNewlines(node.innerText);
|
1601
|
+
// Unfortunately .innerText() returns text with ­ symbols
|
1602
|
+
// We need to filter it out and then remove duplicate whitespaces
|
1603
|
+
} else {
|
1604
|
+
var buf = [];
|
1605
|
+
goog.dom.getTextContent_(node, buf, true);
|
1606
|
+
textContent = buf.join('');
|
1607
|
+
}
|
1608
|
+
|
1609
|
+
// Strip ­ entities. goog.format.insertWordBreaks inserts them in Opera.
|
1610
|
+
textContent = textContent.replace(/ \xAD /g, ' ').replace(/\xAD/g, '');
|
1611
|
+
// Strip ​ entities. goog.format.insertWordBreaks inserts them in IE8.
|
1612
|
+
textContent = textContent.replace(/\u200B/g, '');
|
1613
|
+
|
1614
|
+
// Skip this replacement on IE, which automatically turns into ' '
|
1615
|
+
// and / +/ into ' ' when reading innerText.
|
1616
|
+
if (!goog.userAgent.IE) {
|
1617
|
+
textContent = textContent.replace(/ +/g, ' ');
|
1618
|
+
}
|
1619
|
+
if (textContent != ' ') {
|
1620
|
+
textContent = textContent.replace(/^\s*/, '');
|
1621
|
+
}
|
1622
|
+
|
1623
|
+
return textContent;
|
1624
|
+
};
|
1625
|
+
|
1626
|
+
|
1627
|
+
/**
|
1628
|
+
* Returns the text content of the current node, without markup.
|
1629
|
+
*
|
1630
|
+
* Unlike {@code getTextContent} this method does not collapse whitespaces
|
1631
|
+
* or normalize lines breaks.
|
1632
|
+
*
|
1633
|
+
* @param {Node} node The node from which we are getting content.
|
1634
|
+
* @return {string} The raw text content.
|
1635
|
+
*/
|
1636
|
+
goog.dom.getRawTextContent = function(node) {
|
1637
|
+
var buf = [];
|
1638
|
+
goog.dom.getTextContent_(node, buf, false);
|
1639
|
+
|
1640
|
+
return buf.join('');
|
1641
|
+
};
|
1642
|
+
|
1643
|
+
|
1644
|
+
/**
|
1645
|
+
* Recursive support function for text content retrieval.
|
1646
|
+
*
|
1647
|
+
* @param {Node} node The node from which we are getting content.
|
1648
|
+
* @param {Array} buf string buffer.
|
1649
|
+
* @param {boolean} normalizeWhitespace Whether to normalize whitespace.
|
1650
|
+
* @private
|
1651
|
+
*/
|
1652
|
+
goog.dom.getTextContent_ = function(node, buf, normalizeWhitespace) {
|
1653
|
+
if (node.nodeName in goog.dom.TAGS_TO_IGNORE_) {
|
1654
|
+
// ignore certain tags
|
1655
|
+
} else if (node.nodeType == goog.dom.NodeType.TEXT) {
|
1656
|
+
if (normalizeWhitespace) {
|
1657
|
+
buf.push(String(node.nodeValue).replace(/(\r\n|\r|\n)/g, ''));
|
1658
|
+
} else {
|
1659
|
+
buf.push(node.nodeValue);
|
1660
|
+
}
|
1661
|
+
} else if (node.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) {
|
1662
|
+
buf.push(goog.dom.PREDEFINED_TAG_VALUES_[node.nodeName]);
|
1663
|
+
} else {
|
1664
|
+
var child = node.firstChild;
|
1665
|
+
while (child) {
|
1666
|
+
goog.dom.getTextContent_(child, buf, normalizeWhitespace);
|
1667
|
+
child = child.nextSibling;
|
1668
|
+
}
|
1669
|
+
}
|
1670
|
+
};
|
1671
|
+
|
1672
|
+
|
1673
|
+
/**
|
1674
|
+
* Returns the text length of the text contained in a node, without markup. This
|
1675
|
+
* is equivalent to the selection length if the node was selected, or the number
|
1676
|
+
* of cursor movements to traverse the node. Images & BRs take one space. New
|
1677
|
+
* lines are ignored.
|
1678
|
+
*
|
1679
|
+
* @param {Node} node The node whose text content length is being calculated.
|
1680
|
+
* @return {number} The length of {@code node}'s text content.
|
1681
|
+
*/
|
1682
|
+
goog.dom.getNodeTextLength = function(node) {
|
1683
|
+
return goog.dom.getTextContent(node).length;
|
1684
|
+
};
|
1685
|
+
|
1686
|
+
|
1687
|
+
/**
|
1688
|
+
* Returns the text offset of a node relative to one of its ancestors. The text
|
1689
|
+
* length is the same as the length calculated by goog.dom.getNodeTextLength.
|
1690
|
+
*
|
1691
|
+
* @param {Node} node The node whose offset is being calculated.
|
1692
|
+
* @param {Node=} opt_offsetParent The node relative to which the offset will
|
1693
|
+
* be calculated. Defaults to the node's owner document's body.
|
1694
|
+
* @return {number} The text offset.
|
1695
|
+
*/
|
1696
|
+
goog.dom.getNodeTextOffset = function(node, opt_offsetParent) {
|
1697
|
+
var root = opt_offsetParent || goog.dom.getOwnerDocument(node).body;
|
1698
|
+
var buf = [];
|
1699
|
+
while (node && node != root) {
|
1700
|
+
var cur = node;
|
1701
|
+
while ((cur = cur.previousSibling)) {
|
1702
|
+
buf.unshift(goog.dom.getTextContent(cur));
|
1703
|
+
}
|
1704
|
+
node = node.parentNode;
|
1705
|
+
}
|
1706
|
+
// Trim left to deal with FF cases when there might be line breaks and empty
|
1707
|
+
// nodes at the front of the text
|
1708
|
+
return goog.string.trimLeft(buf.join('')).replace(/ +/g, ' ').length;
|
1709
|
+
};
|
1710
|
+
|
1711
|
+
|
1712
|
+
/**
|
1713
|
+
* Returns the node at a given offset in a parent node. If an object is
|
1714
|
+
* provided for the optional third parameter, the node and the remainder of the
|
1715
|
+
* offset will stored as properties of this object.
|
1716
|
+
* @param {Node} parent The parent node.
|
1717
|
+
* @param {number} offset The offset into the parent node.
|
1718
|
+
* @param {Object=} opt_result Object to be used to store the return value. The
|
1719
|
+
* return value will be stored in the form {node: Node, remainder: number}
|
1720
|
+
* if this object is provided.
|
1721
|
+
* @return {Node} The node at the given offset.
|
1722
|
+
*/
|
1723
|
+
goog.dom.getNodeAtOffset = function(parent, offset, opt_result) {
|
1724
|
+
var stack = [parent], pos = 0, cur;
|
1725
|
+
while (stack.length > 0 && pos < offset) {
|
1726
|
+
cur = stack.pop();
|
1727
|
+
if (cur.nodeName in goog.dom.TAGS_TO_IGNORE_) {
|
1728
|
+
// ignore certain tags
|
1729
|
+
} else if (cur.nodeType == goog.dom.NodeType.TEXT) {
|
1730
|
+
var text = cur.nodeValue.replace(/(\r\n|\r|\n)/g, '').replace(/ +/g, ' ');
|
1731
|
+
pos += text.length;
|
1732
|
+
} else if (cur.nodeName in goog.dom.PREDEFINED_TAG_VALUES_) {
|
1733
|
+
pos += goog.dom.PREDEFINED_TAG_VALUES_[cur.nodeName].length;
|
1734
|
+
} else {
|
1735
|
+
for (var i = cur.childNodes.length - 1; i >= 0; i--) {
|
1736
|
+
stack.push(cur.childNodes[i]);
|
1737
|
+
}
|
1738
|
+
}
|
1739
|
+
}
|
1740
|
+
if (goog.isObject(opt_result)) {
|
1741
|
+
opt_result.remainder = cur ? cur.nodeValue.length + offset - pos - 1 : 0;
|
1742
|
+
opt_result.node = cur;
|
1743
|
+
}
|
1744
|
+
|
1745
|
+
return cur;
|
1746
|
+
};
|
1747
|
+
|
1748
|
+
|
1749
|
+
/**
|
1750
|
+
* Returns true if the object is a {@code NodeList}. To qualify as a NodeList,
|
1751
|
+
* the object must have a numeric length property and an item function (which
|
1752
|
+
* has type 'string' on IE for some reason).
|
1753
|
+
* @param {Object} val Object to test.
|
1754
|
+
* @return {boolean} Whether the object is a NodeList.
|
1755
|
+
*/
|
1756
|
+
goog.dom.isNodeList = function(val) {
|
1757
|
+
// TODO(user): Now the isNodeList is part of goog.dom we can use
|
1758
|
+
// goog.userAgent to make this simpler.
|
1759
|
+
// A NodeList must have a length property of type 'number' on all platforms.
|
1760
|
+
if (val && typeof val.length == 'number') {
|
1761
|
+
// A NodeList is an object everywhere except Safari, where it's a function.
|
1762
|
+
if (goog.isObject(val)) {
|
1763
|
+
// A NodeList must have an item function (on non-IE platforms) or an item
|
1764
|
+
// property of type 'string' (on IE).
|
1765
|
+
return typeof val.item == 'function' || typeof val.item == 'string';
|
1766
|
+
} else if (goog.isFunction(val)) {
|
1767
|
+
// On Safari, a NodeList is a function with an item property that is also
|
1768
|
+
// a function.
|
1769
|
+
return typeof val.item == 'function';
|
1770
|
+
}
|
1771
|
+
}
|
1772
|
+
|
1773
|
+
// Not a NodeList.
|
1774
|
+
return false;
|
1775
|
+
};
|
1776
|
+
|
1777
|
+
|
1778
|
+
/**
|
1779
|
+
* Walks up the DOM hierarchy returning the first ancestor that has the passed
|
1780
|
+
* tag name and/or class name. If the passed element matches the specified
|
1781
|
+
* criteria, the element itself is returned.
|
1782
|
+
* @param {Node} element The DOM node to start with.
|
1783
|
+
* @param {?string=} opt_tag The tag name to match (or null/undefined to match
|
1784
|
+
* any node regardless of tag name). Must be uppercase (goog.dom.TagName).
|
1785
|
+
* @param {?string=} opt_class The class name to match (or null/undefined to
|
1786
|
+
* match any node regardless of class name).
|
1787
|
+
* @return {Node} The first ancestor that matches the passed criteria, or
|
1788
|
+
* null if none match.
|
1789
|
+
*/
|
1790
|
+
goog.dom.getAncestorByTagNameAndClass = function(element, opt_tag, opt_class) {
|
1791
|
+
var tagName = opt_tag ? opt_tag.toUpperCase() : null;
|
1792
|
+
return goog.dom.getAncestor(element,
|
1793
|
+
function(node) {
|
1794
|
+
return (!tagName || node.nodeName == tagName) &&
|
1795
|
+
(!opt_class || goog.dom.classes.has(node, opt_class));
|
1796
|
+
}, true);
|
1797
|
+
};
|
1798
|
+
|
1799
|
+
|
1800
|
+
/**
|
1801
|
+
* Walks up the DOM hierarchy returning the first ancestor that has the passed
|
1802
|
+
* class name. If the passed element matches the specified criteria, the
|
1803
|
+
* element itself is returned.
|
1804
|
+
* @param {Node} element The DOM node to start with.
|
1805
|
+
* @param {?string=} opt_class The class name to match (or null/undefined to
|
1806
|
+
* match any node regardless of class name).
|
1807
|
+
* @return {Node} The first ancestor that matches the passed criteria, or
|
1808
|
+
* null if none match.
|
1809
|
+
*/
|
1810
|
+
goog.dom.getAncestorByClass = function(element, opt_class) {
|
1811
|
+
return goog.dom.getAncestorByTagNameAndClass(element, null, opt_class);
|
1812
|
+
};
|
1813
|
+
|
1814
|
+
|
1815
|
+
/**
|
1816
|
+
* Walks up the DOM hierarchy returning the first ancestor that passes the
|
1817
|
+
* matcher function.
|
1818
|
+
* @param {Node} element The DOM node to start with.
|
1819
|
+
* @param {function(Node) : boolean} matcher A function that returns true if the
|
1820
|
+
* passed node matches the desired criteria.
|
1821
|
+
* @param {boolean=} opt_includeNode If true, the node itself is included in
|
1822
|
+
* the search (the first call to the matcher will pass startElement as
|
1823
|
+
* the node to test).
|
1824
|
+
* @param {number=} opt_maxSearchSteps Maximum number of levels to search up the
|
1825
|
+
* dom.
|
1826
|
+
* @return {Node} DOM node that matched the matcher, or null if there was
|
1827
|
+
* no match.
|
1828
|
+
*/
|
1829
|
+
goog.dom.getAncestor = function(
|
1830
|
+
element, matcher, opt_includeNode, opt_maxSearchSteps) {
|
1831
|
+
if (!opt_includeNode) {
|
1832
|
+
element = element.parentNode;
|
1833
|
+
}
|
1834
|
+
var ignoreSearchSteps = opt_maxSearchSteps == null;
|
1835
|
+
var steps = 0;
|
1836
|
+
while (element && (ignoreSearchSteps || steps <= opt_maxSearchSteps)) {
|
1837
|
+
if (matcher(element)) {
|
1838
|
+
return element;
|
1839
|
+
}
|
1840
|
+
element = element.parentNode;
|
1841
|
+
steps++;
|
1842
|
+
}
|
1843
|
+
// Reached the root of the DOM without a match
|
1844
|
+
return null;
|
1845
|
+
};
|
1846
|
+
|
1847
|
+
|
1848
|
+
|
1849
|
+
/**
|
1850
|
+
* Create an instance of a DOM helper with a new document object.
|
1851
|
+
* @param {Document=} opt_document Document object to associate with this
|
1852
|
+
* DOM helper.
|
1853
|
+
* @constructor
|
1854
|
+
*/
|
1855
|
+
goog.dom.DomHelper = function(opt_document) {
|
1856
|
+
/**
|
1857
|
+
* Reference to the document object to use
|
1858
|
+
* @type {!Document}
|
1859
|
+
* @private
|
1860
|
+
*/
|
1861
|
+
this.document_ = opt_document || goog.global.document || document;
|
1862
|
+
};
|
1863
|
+
|
1864
|
+
|
1865
|
+
/**
|
1866
|
+
* Gets the dom helper object for the document where the element resides.
|
1867
|
+
* @param {Node=} opt_node If present, gets the DomHelper for this node.
|
1868
|
+
* @return {!goog.dom.DomHelper} The DomHelper.
|
1869
|
+
*/
|
1870
|
+
goog.dom.DomHelper.prototype.getDomHelper = goog.dom.getDomHelper;
|
1871
|
+
|
1872
|
+
|
1873
|
+
/**
|
1874
|
+
* Sets the document object.
|
1875
|
+
* @param {!Document} document Document object.
|
1876
|
+
*/
|
1877
|
+
goog.dom.DomHelper.prototype.setDocument = function(document) {
|
1878
|
+
this.document_ = document;
|
1879
|
+
};
|
1880
|
+
|
1881
|
+
|
1882
|
+
/**
|
1883
|
+
* Gets the document object being used by the dom library.
|
1884
|
+
* @return {!Document} Document object.
|
1885
|
+
*/
|
1886
|
+
goog.dom.DomHelper.prototype.getDocument = function() {
|
1887
|
+
return this.document_;
|
1888
|
+
};
|
1889
|
+
|
1890
|
+
|
1891
|
+
/**
|
1892
|
+
* Alias for {@code getElementById}. If a DOM node is passed in then we just
|
1893
|
+
* return that.
|
1894
|
+
* @param {string|Element} element Element ID or a DOM node.
|
1895
|
+
* @return {Element} The element with the given ID, or the node passed in.
|
1896
|
+
*/
|
1897
|
+
goog.dom.DomHelper.prototype.getElement = function(element) {
|
1898
|
+
if (goog.isString(element)) {
|
1899
|
+
return this.document_.getElementById(element);
|
1900
|
+
} else {
|
1901
|
+
return element;
|
1902
|
+
}
|
1903
|
+
};
|
1904
|
+
|
1905
|
+
|
1906
|
+
/**
|
1907
|
+
* Alias for {@code getElement}.
|
1908
|
+
* @param {string|Element} element Element ID or a DOM node.
|
1909
|
+
* @return {Element} The element with the given ID, or the node passed in.
|
1910
|
+
* @deprecated Use {@link goog.dom.DomHelper.prototype.getElement} instead.
|
1911
|
+
*/
|
1912
|
+
goog.dom.DomHelper.prototype.$ = goog.dom.DomHelper.prototype.getElement;
|
1913
|
+
|
1914
|
+
|
1915
|
+
/**
|
1916
|
+
* Looks up elements by both tag and class name, using browser native functions
|
1917
|
+
* ({@code querySelectorAll}, {@code getElementsByTagName} or
|
1918
|
+
* {@code getElementsByClassName}) where possible. The returned array is a live
|
1919
|
+
* NodeList or a static list depending on the code path taken.
|
1920
|
+
*
|
1921
|
+
* @see goog.dom.query
|
1922
|
+
*
|
1923
|
+
* @param {?string=} opt_tag Element tag name or * for all tags.
|
1924
|
+
* @param {?string=} opt_class Optional class name.
|
1925
|
+
* @param {Document|Element=} opt_el Optional element to look in.
|
1926
|
+
* @return { {length: number} } Array-like list of elements (only a length
|
1927
|
+
* property and numerical indices are guaranteed to exist).
|
1928
|
+
*/
|
1929
|
+
goog.dom.DomHelper.prototype.getElementsByTagNameAndClass = function(opt_tag,
|
1930
|
+
opt_class,
|
1931
|
+
opt_el) {
|
1932
|
+
return goog.dom.getElementsByTagNameAndClass_(this.document_, opt_tag,
|
1933
|
+
opt_class, opt_el);
|
1934
|
+
};
|
1935
|
+
|
1936
|
+
|
1937
|
+
/**
|
1938
|
+
* Returns an array of all the elements with the provided className.
|
1939
|
+
* @see {goog.dom.query}
|
1940
|
+
* @param {!string} className the name of the class to look for.
|
1941
|
+
* @param {Element|Document=} opt_el Optional element to look in.
|
1942
|
+
* @return { {length: number} } The items found with the class name provided.
|
1943
|
+
*/
|
1944
|
+
goog.dom.DomHelper.prototype.getElementsByClass = function(className, opt_el) {
|
1945
|
+
var doc = opt_el || this.document_;
|
1946
|
+
return goog.dom.getElementsByClass(className, doc);
|
1947
|
+
};
|
1948
|
+
|
1949
|
+
|
1950
|
+
/**
|
1951
|
+
* Returns the first element we find matching the provided class name.
|
1952
|
+
* @see {goog.dom.query}
|
1953
|
+
* @param {!string} className the name of the class to look for.
|
1954
|
+
* @param {Element|Document=} opt_el Optional element to look in.
|
1955
|
+
* @return {Element} The first item found with the class name provided.
|
1956
|
+
*/
|
1957
|
+
goog.dom.DomHelper.prototype.getElementByClass = function(className, opt_el) {
|
1958
|
+
var doc = opt_el || this.document_;
|
1959
|
+
return goog.dom.getElementByClass(className, doc);
|
1960
|
+
};
|
1961
|
+
|
1962
|
+
|
1963
|
+
/**
|
1964
|
+
* Alias for {@code getElementsByTagNameAndClass}.
|
1965
|
+
* @deprecated Use DomHelper getElementsByTagNameAndClass.
|
1966
|
+
* @see goog.dom.query
|
1967
|
+
*
|
1968
|
+
* @param {?string=} opt_tag Element tag name.
|
1969
|
+
* @param {?string=} opt_class Optional class name.
|
1970
|
+
* @param {Element=} opt_el Optional element to look in.
|
1971
|
+
* @return { {length: number} } Array-like list of elements (only a length
|
1972
|
+
* property and numerical indices are guaranteed to exist).
|
1973
|
+
*/
|
1974
|
+
goog.dom.DomHelper.prototype.$$ =
|
1975
|
+
goog.dom.DomHelper.prototype.getElementsByTagNameAndClass;
|
1976
|
+
|
1977
|
+
|
1978
|
+
/**
|
1979
|
+
* Sets a number of properties on a node.
|
1980
|
+
* @param {Element} element DOM node to set properties on.
|
1981
|
+
* @param {Object} properties Hash of property:value pairs.
|
1982
|
+
*/
|
1983
|
+
goog.dom.DomHelper.prototype.setProperties = goog.dom.setProperties;
|
1984
|
+
|
1985
|
+
|
1986
|
+
/**
|
1987
|
+
* Gets the dimensions of the viewport.
|
1988
|
+
* @param {Window=} opt_window Optional window element to test. Defaults to
|
1989
|
+
* the window of the Dom Helper.
|
1990
|
+
* @return {!goog.math.Size} Object with values 'width' and 'height'.
|
1991
|
+
*/
|
1992
|
+
goog.dom.DomHelper.prototype.getViewportSize = function(opt_window) {
|
1993
|
+
// TODO(user): This should not take an argument. That breaks the rule of a
|
1994
|
+
// a DomHelper representing a single frame/window/document.
|
1995
|
+
return goog.dom.getViewportSize(opt_window || this.getWindow());
|
1996
|
+
};
|
1997
|
+
|
1998
|
+
|
1999
|
+
/**
|
2000
|
+
* Calculates the height of the document.
|
2001
|
+
*
|
2002
|
+
* @return {number} The height of the document.
|
2003
|
+
*/
|
2004
|
+
goog.dom.DomHelper.prototype.getDocumentHeight = function() {
|
2005
|
+
return goog.dom.getDocumentHeight_(this.getWindow());
|
2006
|
+
};
|
2007
|
+
|
2008
|
+
|
2009
|
+
/**
|
2010
|
+
* Typedef for use with goog.dom.createDom and goog.dom.append.
|
2011
|
+
* @typedef {Object|string|Array|NodeList}
|
2012
|
+
*/
|
2013
|
+
goog.dom.Appendable;
|
2014
|
+
|
2015
|
+
|
2016
|
+
/**
|
2017
|
+
* Returns a dom node with a set of attributes. This function accepts varargs
|
2018
|
+
* for subsequent nodes to be added. Subsequent nodes will be added to the
|
2019
|
+
* first node as childNodes.
|
2020
|
+
*
|
2021
|
+
* So:
|
2022
|
+
* <code>createDom('div', null, createDom('p'), createDom('p'));</code>
|
2023
|
+
* would return a div with two child paragraphs
|
2024
|
+
*
|
2025
|
+
* An easy way to move all child nodes of an existing element to a new parent
|
2026
|
+
* element is:
|
2027
|
+
* <code>createDom('div', null, oldElement.childNodes);</code>
|
2028
|
+
* which will remove all child nodes from the old element and add them as
|
2029
|
+
* child nodes of the new DIV.
|
2030
|
+
*
|
2031
|
+
* @param {string} tagName Tag to create.
|
2032
|
+
* @param {Object|string=} opt_attributes If object, then a map of name-value
|
2033
|
+
* pairs for attributes. If a string, then this is the className of the new
|
2034
|
+
* element.
|
2035
|
+
* @param {...goog.dom.Appendable} var_args Further DOM nodes or
|
2036
|
+
* strings for text nodes. If one of the var_args is an array or
|
2037
|
+
* NodeList, its elements will be added as childNodes instead.
|
2038
|
+
* @return {!Element} Reference to a DOM node.
|
2039
|
+
*/
|
2040
|
+
goog.dom.DomHelper.prototype.createDom = function(tagName,
|
2041
|
+
opt_attributes,
|
2042
|
+
var_args) {
|
2043
|
+
return goog.dom.createDom_(this.document_, arguments);
|
2044
|
+
};
|
2045
|
+
|
2046
|
+
|
2047
|
+
/**
|
2048
|
+
* Alias for {@code createDom}.
|
2049
|
+
* @param {string} tagName Tag to create.
|
2050
|
+
* @param {Object|string=} opt_attributes If object, then a map of name-value
|
2051
|
+
* pairs for attributes. If a string, then this is the className of the new
|
2052
|
+
* element.
|
2053
|
+
* @param {...goog.dom.Appendable} var_args Further DOM nodes or strings for
|
2054
|
+
* text nodes. If one of the var_args is an array, its children will be
|
2055
|
+
* added as childNodes instead.
|
2056
|
+
* @return {!Element} Reference to a DOM node.
|
2057
|
+
* @deprecated Use {@link goog.dom.DomHelper.prototype.createDom} instead.
|
2058
|
+
*/
|
2059
|
+
goog.dom.DomHelper.prototype.$dom = goog.dom.DomHelper.prototype.createDom;
|
2060
|
+
|
2061
|
+
|
2062
|
+
/**
|
2063
|
+
* Creates a new element.
|
2064
|
+
* @param {string} name Tag name.
|
2065
|
+
* @return {!Element} The new element.
|
2066
|
+
*/
|
2067
|
+
goog.dom.DomHelper.prototype.createElement = function(name) {
|
2068
|
+
return this.document_.createElement(name);
|
2069
|
+
};
|
2070
|
+
|
2071
|
+
|
2072
|
+
/**
|
2073
|
+
* Creates a new text node.
|
2074
|
+
* @param {string} content Content.
|
2075
|
+
* @return {!Text} The new text node.
|
2076
|
+
*/
|
2077
|
+
goog.dom.DomHelper.prototype.createTextNode = function(content) {
|
2078
|
+
return this.document_.createTextNode(content);
|
2079
|
+
};
|
2080
|
+
|
2081
|
+
|
2082
|
+
/**
|
2083
|
+
* Create a table.
|
2084
|
+
* @param {number} rows The number of rows in the table. Must be >= 1.
|
2085
|
+
* @param {number} columns The number of columns in the table. Must be >= 1.
|
2086
|
+
* @param {boolean=} opt_fillWithNbsp If true, fills table entries with nsbps.
|
2087
|
+
* @return {!Element} The created table.
|
2088
|
+
*/
|
2089
|
+
goog.dom.DomHelper.prototype.createTable = function(rows, columns,
|
2090
|
+
opt_fillWithNbsp) {
|
2091
|
+
return goog.dom.createTable_(this.document_, rows, columns,
|
2092
|
+
!!opt_fillWithNbsp);
|
2093
|
+
};
|
2094
|
+
|
2095
|
+
|
2096
|
+
/**
|
2097
|
+
* Converts an HTML string into a node or a document fragment. A single Node
|
2098
|
+
* is used if the {@code htmlString} only generates a single node. If the
|
2099
|
+
* {@code htmlString} generates multiple nodes then these are put inside a
|
2100
|
+
* {@code DocumentFragment}.
|
2101
|
+
*
|
2102
|
+
* @param {string} htmlString The HTML string to convert.
|
2103
|
+
* @return {!Node} The resulting node.
|
2104
|
+
*/
|
2105
|
+
goog.dom.DomHelper.prototype.htmlToDocumentFragment = function(htmlString) {
|
2106
|
+
return goog.dom.htmlToDocumentFragment_(this.document_, htmlString);
|
2107
|
+
};
|
2108
|
+
|
2109
|
+
|
2110
|
+
/**
|
2111
|
+
* Returns the compatMode of the document.
|
2112
|
+
* @return {string} The result is either CSS1Compat or BackCompat.
|
2113
|
+
* @deprecated use goog.dom.DomHelper.prototype.isCss1CompatMode instead.
|
2114
|
+
*/
|
2115
|
+
goog.dom.DomHelper.prototype.getCompatMode = function() {
|
2116
|
+
return this.isCss1CompatMode() ? 'CSS1Compat' : 'BackCompat';
|
2117
|
+
};
|
2118
|
+
|
2119
|
+
|
2120
|
+
/**
|
2121
|
+
* Returns true if the browser is in "CSS1-compatible" (standards-compliant)
|
2122
|
+
* mode, false otherwise.
|
2123
|
+
* @return {boolean} True if in CSS1-compatible mode.
|
2124
|
+
*/
|
2125
|
+
goog.dom.DomHelper.prototype.isCss1CompatMode = function() {
|
2126
|
+
return goog.dom.isCss1CompatMode_(this.document_);
|
2127
|
+
};
|
2128
|
+
|
2129
|
+
|
2130
|
+
/**
|
2131
|
+
* Gets the window object associated with the document.
|
2132
|
+
* @return {!Window} The window associated with the given document.
|
2133
|
+
*/
|
2134
|
+
goog.dom.DomHelper.prototype.getWindow = function() {
|
2135
|
+
return goog.dom.getWindow_(this.document_);
|
2136
|
+
};
|
2137
|
+
|
2138
|
+
|
2139
|
+
/**
|
2140
|
+
* Gets the document scroll element.
|
2141
|
+
* @return {Element} Scrolling element.
|
2142
|
+
*/
|
2143
|
+
goog.dom.DomHelper.prototype.getDocumentScrollElement = function() {
|
2144
|
+
return goog.dom.getDocumentScrollElement_(this.document_);
|
2145
|
+
};
|
2146
|
+
|
2147
|
+
|
2148
|
+
/**
|
2149
|
+
* Gets the document scroll distance as a coordinate object.
|
2150
|
+
* @return {!goog.math.Coordinate} Object with properties 'x' and 'y'.
|
2151
|
+
*/
|
2152
|
+
goog.dom.DomHelper.prototype.getDocumentScroll = function() {
|
2153
|
+
return goog.dom.getDocumentScroll_(this.document_);
|
2154
|
+
};
|
2155
|
+
|
2156
|
+
|
2157
|
+
/**
|
2158
|
+
* Appends a child to a node.
|
2159
|
+
* @param {Node} parent Parent.
|
2160
|
+
* @param {Node} child Child.
|
2161
|
+
*/
|
2162
|
+
goog.dom.DomHelper.prototype.appendChild = goog.dom.appendChild;
|
2163
|
+
|
2164
|
+
|
2165
|
+
/**
|
2166
|
+
* Appends a node with text or other nodes.
|
2167
|
+
* @param {!Node} parent The node to append nodes to.
|
2168
|
+
* @param {...goog.dom.Appendable} var_args The things to append to the node.
|
2169
|
+
* If this is a Node it is appended as is.
|
2170
|
+
* If this is a string then a text node is appended.
|
2171
|
+
* If this is an array like object then fields 0 to length - 1 are appended.
|
2172
|
+
*/
|
2173
|
+
goog.dom.DomHelper.prototype.append = goog.dom.append;
|
2174
|
+
|
2175
|
+
|
2176
|
+
/**
|
2177
|
+
* Removes all the child nodes on a DOM node.
|
2178
|
+
* @param {Node} node Node to remove children from.
|
2179
|
+
*/
|
2180
|
+
goog.dom.DomHelper.prototype.removeChildren = goog.dom.removeChildren;
|
2181
|
+
|
2182
|
+
|
2183
|
+
/**
|
2184
|
+
* Inserts a new node before an existing reference node (i.e., as the previous
|
2185
|
+
* sibling). If the reference node has no parent, then does nothing.
|
2186
|
+
* @param {Node} newNode Node to insert.
|
2187
|
+
* @param {Node} refNode Reference node to insert before.
|
2188
|
+
*/
|
2189
|
+
goog.dom.DomHelper.prototype.insertSiblingBefore = goog.dom.insertSiblingBefore;
|
2190
|
+
|
2191
|
+
|
2192
|
+
/**
|
2193
|
+
* Inserts a new node after an existing reference node (i.e., as the next
|
2194
|
+
* sibling). If the reference node has no parent, then does nothing.
|
2195
|
+
* @param {Node} newNode Node to insert.
|
2196
|
+
* @param {Node} refNode Reference node to insert after.
|
2197
|
+
*/
|
2198
|
+
goog.dom.DomHelper.prototype.insertSiblingAfter = goog.dom.insertSiblingAfter;
|
2199
|
+
|
2200
|
+
|
2201
|
+
/**
|
2202
|
+
* Removes a node from its parent.
|
2203
|
+
* @param {Node} node The node to remove.
|
2204
|
+
* @return {Node} The node removed if removed; else, null.
|
2205
|
+
*/
|
2206
|
+
goog.dom.DomHelper.prototype.removeNode = goog.dom.removeNode;
|
2207
|
+
|
2208
|
+
|
2209
|
+
/**
|
2210
|
+
* Replaces a node in the DOM tree. Will do nothing if {@code oldNode} has no
|
2211
|
+
* parent.
|
2212
|
+
* @param {Node} newNode Node to insert.
|
2213
|
+
* @param {Node} oldNode Node to replace.
|
2214
|
+
*/
|
2215
|
+
goog.dom.DomHelper.prototype.replaceNode = goog.dom.replaceNode;
|
2216
|
+
|
2217
|
+
|
2218
|
+
/**
|
2219
|
+
* Flattens an element. That is, removes it and replace it with its children.
|
2220
|
+
* @param {Element} element The element to flatten.
|
2221
|
+
* @return {Element|undefined} The original element, detached from the document
|
2222
|
+
* tree, sans children, or undefined if the element was already not in the
|
2223
|
+
* document.
|
2224
|
+
*/
|
2225
|
+
goog.dom.DomHelper.prototype.flattenElement = goog.dom.flattenElement;
|
2226
|
+
|
2227
|
+
|
2228
|
+
/**
|
2229
|
+
* Returns the first child node that is an element.
|
2230
|
+
* @param {Node} node The node to get the first child element of.
|
2231
|
+
* @return {Element} The first child node of {@code node} that is an element.
|
2232
|
+
*/
|
2233
|
+
goog.dom.DomHelper.prototype.getFirstElementChild =
|
2234
|
+
goog.dom.getFirstElementChild;
|
2235
|
+
|
2236
|
+
|
2237
|
+
/**
|
2238
|
+
* Returns the last child node that is an element.
|
2239
|
+
* @param {Node} node The node to get the last child element of.
|
2240
|
+
* @return {Element} The last child node of {@code node} that is an element.
|
2241
|
+
*/
|
2242
|
+
goog.dom.DomHelper.prototype.getLastElementChild = goog.dom.getLastElementChild;
|
2243
|
+
|
2244
|
+
|
2245
|
+
/**
|
2246
|
+
* Returns the first next sibling that is an element.
|
2247
|
+
* @param {Node} node The node to get the next sibling element of.
|
2248
|
+
* @return {Element} The next sibling of {@code node} that is an element.
|
2249
|
+
*/
|
2250
|
+
goog.dom.DomHelper.prototype.getNextElementSibling =
|
2251
|
+
goog.dom.getNextElementSibling;
|
2252
|
+
|
2253
|
+
|
2254
|
+
/**
|
2255
|
+
* Returns the first previous sibling that is an element.
|
2256
|
+
* @param {Node} node The node to get the previous sibling element of.
|
2257
|
+
* @return {Element} The first previous sibling of {@code node} that is
|
2258
|
+
* an element.
|
2259
|
+
*/
|
2260
|
+
goog.dom.DomHelper.prototype.getPreviousElementSibling =
|
2261
|
+
goog.dom.getPreviousElementSibling;
|
2262
|
+
|
2263
|
+
|
2264
|
+
/**
|
2265
|
+
* Returns the next node in source order from the given node.
|
2266
|
+
* @param {Node} node The node.
|
2267
|
+
* @return {Node} The next node in the DOM tree, or null if this was the last
|
2268
|
+
* node.
|
2269
|
+
*/
|
2270
|
+
goog.dom.DomHelper.prototype.getNextNode =
|
2271
|
+
goog.dom.getNextNode;
|
2272
|
+
|
2273
|
+
|
2274
|
+
/**
|
2275
|
+
* Returns the previous node in source order from the given node.
|
2276
|
+
* @param {Node} node The node.
|
2277
|
+
* @return {Node} The previous node in the DOM tree, or null if this was the
|
2278
|
+
* first node.
|
2279
|
+
*/
|
2280
|
+
goog.dom.DomHelper.prototype.getPreviousNode =
|
2281
|
+
goog.dom.getPreviousNode;
|
2282
|
+
|
2283
|
+
|
2284
|
+
/**
|
2285
|
+
* Whether the object looks like a DOM node.
|
2286
|
+
* @param {*} obj The object being tested for node likeness.
|
2287
|
+
* @return {boolean} Whether the object looks like a DOM node.
|
2288
|
+
*/
|
2289
|
+
goog.dom.DomHelper.prototype.isNodeLike = goog.dom.isNodeLike;
|
2290
|
+
|
2291
|
+
|
2292
|
+
/**
|
2293
|
+
* Whether a node contains another node.
|
2294
|
+
* @param {Node} parent The node that should contain the other node.
|
2295
|
+
* @param {Node} descendant The node to test presence of.
|
2296
|
+
* @return {boolean} Whether the parent node contains the descendent node.
|
2297
|
+
*/
|
2298
|
+
goog.dom.DomHelper.prototype.contains = goog.dom.contains;
|
2299
|
+
|
2300
|
+
|
2301
|
+
/**
|
2302
|
+
* Returns the owner document for a node.
|
2303
|
+
* @param {Node} node The node to get the document for.
|
2304
|
+
* @return {!Document} The document owning the node.
|
2305
|
+
*/
|
2306
|
+
goog.dom.DomHelper.prototype.getOwnerDocument = goog.dom.getOwnerDocument;
|
2307
|
+
|
2308
|
+
|
2309
|
+
/**
|
2310
|
+
* Cross browser function for getting the document element of an iframe.
|
2311
|
+
* @param {HTMLIFrameElement|HTMLFrameElement} iframe Iframe element.
|
2312
|
+
* @return {!HTMLDocument} The frame content document.
|
2313
|
+
*/
|
2314
|
+
goog.dom.DomHelper.prototype.getFrameContentDocument =
|
2315
|
+
goog.dom.getFrameContentDocument;
|
2316
|
+
|
2317
|
+
|
2318
|
+
/**
|
2319
|
+
* Cross browser function for getting the window of a frame or iframe.
|
2320
|
+
* @param {HTMLIFrameElement|HTMLFrameElement} frame Frame element.
|
2321
|
+
* @return {Window} The window associated with the given frame.
|
2322
|
+
*/
|
2323
|
+
goog.dom.DomHelper.prototype.getFrameContentWindow =
|
2324
|
+
goog.dom.getFrameContentWindow;
|
2325
|
+
|
2326
|
+
|
2327
|
+
/**
|
2328
|
+
* Cross browser function for setting the text content of an element.
|
2329
|
+
* @param {Element} element The element to change the text content of.
|
2330
|
+
* @param {string} text The string that should replace the current element
|
2331
|
+
* content with.
|
2332
|
+
*/
|
2333
|
+
goog.dom.DomHelper.prototype.setTextContent = goog.dom.setTextContent;
|
2334
|
+
|
2335
|
+
|
2336
|
+
/**
|
2337
|
+
* Finds the first descendant node that matches the filter function. This does
|
2338
|
+
* a depth first search.
|
2339
|
+
* @param {Node} root The root of the tree to search.
|
2340
|
+
* @param {function(Node) : boolean} p The filter function.
|
2341
|
+
* @return {(Node, undefined)} The found node or undefined if none is found.
|
2342
|
+
*/
|
2343
|
+
goog.dom.DomHelper.prototype.findNode = goog.dom.findNode;
|
2344
|
+
|
2345
|
+
|
2346
|
+
/**
|
2347
|
+
* Finds all the descendant nodes that matches the filter function. This does a
|
2348
|
+
* depth first search.
|
2349
|
+
* @param {Node} root The root of the tree to search.
|
2350
|
+
* @param {function(Node) : boolean} p The filter function.
|
2351
|
+
* @return {Array.<Node>} The found nodes or an empty array if none are found.
|
2352
|
+
*/
|
2353
|
+
goog.dom.DomHelper.prototype.findNodes = goog.dom.findNodes;
|
2354
|
+
|
2355
|
+
|
2356
|
+
/**
|
2357
|
+
* Returns the text contents of the current node, without markup. New lines are
|
2358
|
+
* stripped and whitespace is collapsed, such that each character would be
|
2359
|
+
* visible.
|
2360
|
+
*
|
2361
|
+
* In browsers that support it, innerText is used. Other browsers attempt to
|
2362
|
+
* simulate it via node traversal. Line breaks are canonicalized in IE.
|
2363
|
+
*
|
2364
|
+
* @param {Node} node The node from which we are getting content.
|
2365
|
+
* @return {string} The text content.
|
2366
|
+
*/
|
2367
|
+
goog.dom.DomHelper.prototype.getTextContent = goog.dom.getTextContent;
|
2368
|
+
|
2369
|
+
|
2370
|
+
/**
|
2371
|
+
* Returns the text length of the text contained in a node, without markup. This
|
2372
|
+
* is equivalent to the selection length if the node was selected, or the number
|
2373
|
+
* of cursor movements to traverse the node. Images & BRs take one space. New
|
2374
|
+
* lines are ignored.
|
2375
|
+
*
|
2376
|
+
* @param {Node} node The node whose text content length is being calculated.
|
2377
|
+
* @return {number} The length of {@code node}'s text content.
|
2378
|
+
*/
|
2379
|
+
goog.dom.DomHelper.prototype.getNodeTextLength = goog.dom.getNodeTextLength;
|
2380
|
+
|
2381
|
+
|
2382
|
+
/**
|
2383
|
+
* Returns the text offset of a node relative to one of its ancestors. The text
|
2384
|
+
* length is the same as the length calculated by
|
2385
|
+
* {@code goog.dom.getNodeTextLength}.
|
2386
|
+
*
|
2387
|
+
* @param {Node} node The node whose offset is being calculated.
|
2388
|
+
* @param {Node=} opt_offsetParent Defaults to the node's owner document's body.
|
2389
|
+
* @return {number} The text offset.
|
2390
|
+
*/
|
2391
|
+
goog.dom.DomHelper.prototype.getNodeTextOffset = goog.dom.getNodeTextOffset;
|
2392
|
+
|
2393
|
+
|
2394
|
+
/**
|
2395
|
+
* Walks up the DOM hierarchy returning the first ancestor that has the passed
|
2396
|
+
* tag name and/or class name. If the passed element matches the specified
|
2397
|
+
* criteria, the element itself is returned.
|
2398
|
+
* @param {Node} element The DOM node to start with.
|
2399
|
+
* @param {?string=} opt_tag The tag name to match (or null/undefined to match
|
2400
|
+
* any node regardless of tag name). Must be uppercase (goog.dom.TagName).
|
2401
|
+
* @param {?string=} opt_class The class name to match (or null/undefined to
|
2402
|
+
* match any node regardless of class name).
|
2403
|
+
* @return {Node} The first ancestor that matches the passed criteria, or
|
2404
|
+
* null if none match.
|
2405
|
+
*/
|
2406
|
+
goog.dom.DomHelper.prototype.getAncestorByTagNameAndClass =
|
2407
|
+
goog.dom.getAncestorByTagNameAndClass;
|
2408
|
+
|
2409
|
+
|
2410
|
+
/**
|
2411
|
+
* Walks up the DOM hierarchy returning the first ancestor that passes the
|
2412
|
+
* matcher function.
|
2413
|
+
* @param {Node} element The DOM node to start with.
|
2414
|
+
* @param {function(Node) : boolean} matcher A function that returns true if the
|
2415
|
+
* passed node matches the desired criteria.
|
2416
|
+
* @param {boolean=} opt_includeNode If true, the node itself is included in
|
2417
|
+
* the search (the first call to the matcher will pass startElement as
|
2418
|
+
* the node to test).
|
2419
|
+
* @param {number=} opt_maxSearchSteps Maximum number of levels to search up the
|
2420
|
+
* dom.
|
2421
|
+
* @return {Node} DOM node that matched the matcher, or null if there was
|
2422
|
+
* no match.
|
2423
|
+
*/
|
2424
|
+
goog.dom.DomHelper.prototype.getAncestor = goog.dom.getAncestor;
|