From 6cfd64d931dcca833fae5dab440388ec09d519c2 Mon Sep 17 00:00:00 2001 From: roytam1 Date: Fri, 17 Nov 2023 12:07:03 +0800 Subject: [PATCH] import changes from `dev' branch of rmottola/Arctic-Fox: - Bug 1195173 - Test asyncopen2 security checks for stylesheets (r=bz,ehsan) (358ae850a4) - Bug 1223644 - Clean up the nsSVGClipPathFrame reference loop detection code. r=longsonr (65042c3148) - Bug 1157064 - font-display descriptor parsing. r=dbaron (18f63d9244) - Bug 1242523 - Guard against GetWidget getting called with a null shell. r=snorp (55de891c6c) - Bug 1247679, part 3 - Replace NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK with JS_MEMBER. r=smaug (09435e582c) - Bug 1247515 - Check nsScriptErrorWithStack's mStack member for null before tracing; r=mccr8 (0cb1e09aa9) - Bug 1178803. Fix the handling of the 'length' key in IDB keypaths when operating on a string. r=bent (69f15272a8) - Bug 1201037 - coalesce network-events on Windows, r=mcmanus (5f48aab5c3) - Bug 1131626, fix autoscroll tests to work in e10s, r=felipe (c47adbaa10) - Bug 1231529 - Increase the timeout of browser_bug295977_autoscroll_overflow.js (691d27224d) - Bug 416611 - Changed BookmarkHTMLUtils.jsm to import bookmark tags from HTML document. r=mak (49a0accc13) - Bug 1130858 - Recipient autocomplete suggestion overrides ANY manual address input if quickly entered/pasted and confirmed with Enter/Tab before autocomplete suggestions disappear. r=mak (308196e116) - Bug 1197361. Optimize page thumbnails based on screen size. r=ttaubert (29dca20366) - Bug 555087 - Add check for exception when passing undefined parameter. r=adw (3588477c56) - Bug 1203803: Force cleanup for specific states only; r=khuey a=CLOSED TREE (2f9f78ad72) - Bug 1203803 - Remove forced cleanup from FactoryOp::ActorDestroy() since it cause more harm than good; r=khuey (76a00e58cb) - Bug 1195149 - Upgrade the check to a MOZ_RELEASE_ASSERT. r=janv (071d1fc267) - Bug 1185223 - crash at [@ mozilla::dom::quota::QuotaObject::Release() ]; r=khuey (d460972a45) - Bug 1229376 - Downgrade lastVacuumSize > 0 assertion to an NS_ASSERTION so we don't have to star it all over the place, rs=khuey (81d715ab71) - Bug 1239666 - part 1, get rid of the default parameter. r=waldo (639fb79ec3) - Bug 1239666 - part 2, dom/indexedDB change. r=khuey (6faaf25df4) - Bug 1239666 - part 3, devtools test case changes. r=sphink (c010d06a77) - Bug 1248309 - Fix caret size not updated when only zoom level is changed. r=roc (91cc5b35df) - Bug 1245649: Turn on no-trailing-spaces. r=Gijs (7f87c967af) - Bug 1245649: Enable no-negated-in-lhs, no-native-reassign, no-func-assign and no-labels. r=MattN (5f801e4a4c) - Bug 1197966 - Fix typo when releasing content-side probes in PerformanceStats-content.js. r=felipe (9241324efd) - Bug 1219144 - Performance alerts are now labelled with isJankVisible; r=avih,froydnj (c1549a24f5) - Bug 1219144 - Using the nsRefreshDriver's jank indication for performance monitoring;f?froydnj r=froydnj (735c6fba9c) - Bug 1211783 - Add KeyframeEffect interface to dom/webidl/KeyframeEffect.webidl. r=smaug,birtles (fca332fea0) - Bug 795681 - Print out failures in mozunit runner. r=gps (ce418e5ea8) - Bug 801679 - Handle expected failures and skipped tests in mozunit runner. r=gps (396ca02893) - Bug 1247833 - Display the class name in mozunit output. r=gps (0b5724f41c) - Bug 1245022 - Kill stlport's Makefile.in. r=mshal (225f662efc) - Bug 1194603 - Remove INTERNAL_TOOLS; r=mshal (e8e90ec1c3) - Bug 1247743 - Expose non-pinning JS_Atomize[UC]String JSAPI functions; r=terrence (66aa23066d) - Bug 1230071 - Enable warnings-as-errors in js/src. r=Waldo (a0c8acf6ad) - Bug 1007136 - Ensure malloc/free always match when using JSAutoByteString; r=bz (81dfcf036a) - Bug 1246850 - check the NotifyIpInterfaceChange() return code, r=mcmanus (bc224f287c) - Bug 739029 - null check a thread allocation in notifyaddrlistener r=bagder (ce0ddfc44c) --- browser/app/profile/palemoon.js | 6 + build/stlport/Makefile.in | 9 - build/stlport/moz.build | 4 + build/unix/elfhack/Makefile.in | 2 - build/unix/elfhack/inject/Makefile.in | 2 - config/config.mk | 5 - config/mozunit.py | 41 +- dom/animation/KeyframeEffect.cpp | 7 + dom/animation/KeyframeEffect.h | 13 + dom/base/Console.cpp | 2 +- dom/base/DOMException.cpp | 2 +- dom/base/DOMRequest.cpp | 2 +- dom/base/nsDocument.cpp | 2 +- dom/base/nsFrameMessageManager.cpp | 2 +- dom/base/nsJSEnvironment.cpp | 4 +- dom/base/nsJSTimeoutHandler.cpp | 2 +- dom/base/nsXMLHttpRequest.cpp | 2 +- dom/bindings/Codegen.py | 4 +- dom/events/MessageEvent.cpp | 2 +- dom/html/HTMLFormElement.cpp | 2 +- dom/html/nsDOMStringMap.cpp | 2 +- dom/indexedDB/ActorsParent.cpp | 72 +- dom/indexedDB/IDBCursor.cpp | 6 +- dom/indexedDB/IDBIndex.cpp | 2 +- dom/indexedDB/IDBKeyRange.cpp | 4 +- dom/indexedDB/IDBObjectStore.cpp | 2 +- dom/indexedDB/IDBRequest.cpp | 2 +- dom/indexedDB/KeyPath.cpp | 20 +- .../test/unit/test_indexes_funny_things.js | 2 +- dom/notification/Notification.cpp | 2 +- dom/promise/Promise.cpp | 2 +- .../mochitest/general/test_interfaces.html | 2 + dom/webidl/KeyframeEffect.webidl | 20 +- dom/workers/ServiceWorkerEvents.cpp | 2 +- dom/workers/ServiceWorkerMessageEvent.cpp | 2 +- dom/workers/XMLHttpRequest.cpp | 2 +- gfx/thebes/gfxFontConstants.h | 6 + js/src/jsapi-tests/moz.build | 3 - js/src/jsapi-tests/testArrayBufferView.cpp | 3 +- js/src/jsapi-tests/testBug604087.cpp | 13 +- .../testCallNonGenericMethodOnProxy.cpp | 8 +- js/src/jsapi-tests/testChromeBuffer.cpp | 3 +- js/src/jsapi-tests/testDebugger.cpp | 4 +- js/src/jsapi-tests/testGCMarking.cpp | 3 +- js/src/jsapi-tests/testMutedErrors.cpp | 4 +- js/src/jsapi-tests/testStructuredClone.cpp | 3 +- js/src/jsapi-tests/testUbiNode.cpp | 6 +- js/src/jsapi.cpp | 30 +- js/src/jsapi.h | 18 +- js/src/moz.build | 5 +- js/src/shell/js.cpp | 4 +- js/src/shell/moz.build | 3 - js/xpconnect/src/nsScriptErrorWithStack.cpp | 2 +- layout/base/AccessibleCaret.cpp | 29 +- layout/base/AccessibleCaret.h | 9 +- layout/base/ZoomConstraintsClient.cpp | 3 + layout/base/nsRefreshDriver.cpp | 26 + layout/base/nsRefreshDriver.h | 16 + layout/style/nsCSSFontDescList.h | 1 + layout/style/nsCSSKeywordList.h | 3 + layout/style/nsCSSParser.cpp | 8 +- layout/style/nsCSSProps.cpp | 30 +- layout/style/nsCSSProps.h | 1 + layout/style/nsCSSRules.cpp | 7 + layout/style/test/mochitest.ini | 1 + layout/style/test/test_asyncopen2.html | 54 ++ layout/style/test/test_font_face_parser.html | 25 + layout/svg/nsSVGClipPathFrame.cpp | 32 +- layout/svg/nsSVGClipPathFrame.h | 97 +- modules/libpref/init/all.js | 13 +- netwerk/system/win32/nsNotifyAddrListener.cpp | 89 +- netwerk/system/win32/nsNotifyAddrListener.h | 23 +- storage/mozStorageStatement.cpp | 2 + storage/test/unit/test_storage_statement.js | 11 + .../meta/IndexedDB/keypath.htm.ini | 8 - .../fetch-request-resources.https.html | 8 +- toolkit/.eslintrc | 10 +- .../components/alerts/test/test_alerts.html | 2 +- .../asyncshutdown/AsyncShutdown.jsm | 2 +- .../autocomplete/nsAutoCompleteController.cpp | 38 +- .../tests/unit/head_autocomplete.js | 75 +- .../autocomplete/tests/unit/test_378079.js | 106 +-- .../autocomplete/tests/unit/test_393191.js | 98 +- .../tests/unit/test_autocomplete_multiple.js | 96 +- .../tests/unit/test_badDefaultIndex.js | 4 +- .../unit/test_completeDefaultIndex_casing.js | 4 +- .../tests/unit/test_finalCompleteValue.js | 4 +- .../test_finalCompleteValue_forceComplete.js | 62 +- .../unit/test_finalDefaultCompleteValue.js | 4 +- .../tests/unit/test_hiddenResult.js | 8 +- .../tests/unit/test_immediate_search.js | 6 +- .../tests/unit/test_previousResult.js | 86 +- .../tests/unit/test_stopSearch.js | 12 +- .../commandlines/test/unit/test_bug666224.js | 2 +- toolkit/components/console/content/console.js | 6 +- .../console/content/consoleBindings.xml | 12 +- .../tests/unit/head_contentPrefs.js | 2 +- .../contentprefs/tests/unit/test_bug503971.js | 2 +- .../contentprefs/tests/unit/test_bug679784.js | 2 +- .../unit/test_unusedGroupsAndSettings.js | 6 +- .../cookie/content/cookieAcceptDialog.js | 10 +- toolkit/components/crashes/CrashManager.jsm | 2 +- .../downloads/nsDownloadManagerUI.js | 2 +- .../test/browser/browser_bug414214.js | 2 +- .../browser/browser_nsIDownloadManagerUI.js | 2 +- .../test/unit/test_download_samename.js | 2 +- .../test/unit/test_history_expiration.js | 2 +- toolkit/components/feeds/FeedProcessor.js | 172 ++-- toolkit/components/feeds/test/test_xml.js | 2 +- .../filepicker/content/filepicker.js | 28 +- .../formautofill/FormAutofillStartup.js | 2 +- .../components/microformats/Microformats.js | 56 +- .../microformats/microformat-shiv.js | 840 +++++++++--------- .../test/interface-tests/count-test.js | 88 +- .../test/interface-tests/experimental-test.js | 10 +- .../test/interface-tests/getParent-test.js | 100 +-- .../interface-tests/hasMicroformats-test.js | 160 ++-- .../interface-tests/isMicroformat-test.js | 122 +-- .../components/microformats/test/lib/dates.js | 90 +- .../components/microformats/test/lib/html.js | 66 +- .../microformats/test/lib/isodate.js | 210 ++--- .../microformats/test/lib/maps/h-adr.js | 4 +- .../microformats/test/lib/maps/h-card.js | 8 +- .../microformats/test/lib/maps/h-entry.js | 10 +- .../microformats/test/lib/maps/h-event.js | 8 +- .../microformats/test/lib/maps/h-feed.js | 6 +- .../microformats/test/lib/maps/h-geo.js | 4 +- .../microformats/test/lib/maps/h-item.js | 6 +- .../microformats/test/lib/maps/h-listing.js | 4 +- .../microformats/test/lib/maps/h-news.js | 6 +- .../microformats/test/lib/maps/h-org.js | 4 +- .../microformats/test/lib/maps/h-product.js | 4 +- .../microformats/test/lib/maps/h-recipe.js | 4 +- .../microformats/test/lib/maps/h-resume.js | 4 +- .../test/lib/maps/h-review-aggregate.js | 6 +- .../microformats/test/lib/maps/h-review.js | 4 +- .../microformats/test/lib/maps/rel.js | 48 +- .../microformats/test/lib/parser-implied.js | 174 ++-- .../microformats/test/lib/parser-includes.js | 52 +- .../microformats/test/lib/parser-rels.js | 68 +- .../components/microformats/test/lib/text.js | 86 +- .../microformats/test/lib/utilities.js | 62 +- .../test/module-tests/dates-test.js | 46 +- .../test/module-tests/domutils-test.js | 146 +-- .../test/module-tests/html-test.js | 34 +- .../test/module-tests/isodate-test.js | 106 +-- .../test/module-tests/text-test.js | 38 +- .../test/module-tests/url-test.js | 10 +- .../test/module-tests/utilities-test.js | 58 +- .../mf-mixed-h-card-mixedpropertries.js | 2 +- .../mf-mixed-h-card-tworoots.js | 2 +- .../mf-mixed-h-entry-mixedroots.js | 2 +- .../mf-mixed-h-resume-mixedroots.js | 2 +- .../mf-v1-adr-simpleproperties.js | 2 +- .../standards-tests/mf-v1-geo-abbrpattern.js | 2 +- .../test/standards-tests/mf-v1-geo-hidden.js | 2 +- .../mf-v1-geo-simpleproperties.js | 2 +- .../mf-v1-geo-valuetitleclass.js | 2 +- .../standards-tests/mf-v1-hcalendar-ampm.js | 2 +- .../mf-v1-hcalendar-attendees.js | 2 +- .../mf-v1-hcalendar-combining.js | 2 +- .../mf-v1-hcalendar-concatenate.js | 2 +- .../standards-tests/mf-v1-hcalendar-time.js | 2 +- .../test/standards-tests/mf-v1-hcard-email.js | 2 +- .../standards-tests/mf-v1-hcard-format.js | 2 +- .../mf-v1-hcard-hyperlinkedphoto.js | 2 +- .../mf-v1-hcard-justahyperlink.js | 2 +- .../standards-tests/mf-v1-hcard-justaname.js | 2 +- .../standards-tests/mf-v1-hcard-multiple.js | 2 +- .../test/standards-tests/mf-v1-hcard-name.js | 2 +- .../standards-tests/mf-v1-hcard-single.js | 2 +- .../mf-v1-hentry-summarycontent.js | 2 +- .../standards-tests/mf-v1-hfeed-simple.js | 2 +- .../test/standards-tests/mf-v1-hnews-all.js | 2 +- .../standards-tests/mf-v1-hnews-minimum.js | 2 +- .../mf-v1-hproduct-aggregate.js | 2 +- .../mf-v1-hproduct-simpleproperties.js | 2 +- .../mf-v1-hresume-affiliation.js | 2 +- .../standards-tests/mf-v1-hresume-contact.js | 2 +- .../mf-v1-hresume-education.js | 2 +- .../standards-tests/mf-v1-hresume-skill.js | 2 +- .../standards-tests/mf-v1-hresume-work.js | 2 +- .../mf-v1-hreview-aggregate-hcard.js | 2 +- .../mf-v1-hreview-aggregate-justahyperlink.js | 2 +- .../mf-v1-hreview-aggregate-vevent.js | 2 +- .../standards-tests/mf-v1-hreview-item.js | 2 +- .../standards-tests/mf-v1-hreview-vcard.js | 2 +- .../mf-v1-includes-hcarditemref.js | 2 +- .../mf-v1-includes-heventitemref.js | 2 +- .../mf-v1-includes-hyperlink.js | 2 +- .../standards-tests/mf-v1-includes-object.js | 2 +- .../standards-tests/mf-v1-includes-table.js | 2 +- .../test/standards-tests/mf-v2-h-adr-geo.js | 2 +- .../standards-tests/mf-v2-h-adr-geourl.js | 2 +- .../standards-tests/mf-v2-h-adr-justaname.js | 2 +- .../mf-v2-h-adr-simpleproperties.js | 2 +- .../standards-tests/mf-v2-h-as-note-note.js | 2 +- .../standards-tests/mf-v2-h-card-baseurl.js | 2 +- .../mf-v2-h-card-childimplied.js | 2 +- .../mf-v2-h-card-extendeddescription.js | 2 +- .../standards-tests/mf-v2-h-card-hcard.js | 2 +- .../standards-tests/mf-v2-h-card-horghcard.js | 2 +- .../mf-v2-h-card-hyperlinkedphoto.js | 2 +- .../mf-v2-h-card-impliedname.js | 2 +- .../mf-v2-h-card-impliedphoto.js | 2 +- .../mf-v2-h-card-impliedurl.js | 2 +- .../mf-v2-h-card-justahyperlink.js | 2 +- .../standards-tests/mf-v2-h-card-justaname.js | 2 +- .../standards-tests/mf-v2-h-card-nested.js | 2 +- .../mf-v2-h-card-p-property.js | 2 +- .../mf-v2-h-card-relativeurls.js | 2 +- .../mf-v2-h-entry-impliedvalue-nested.js | 2 +- .../mf-v2-h-entry-justahyperlink.js | 2 +- .../mf-v2-h-entry-justaname.js | 2 +- .../mf-v2-h-entry-summarycontent.js | 2 +- .../mf-v2-h-entry-u-property.js | 2 +- .../mf-v2-h-entry-urlincontent.js | 2 +- .../standards-tests/mf-v2-h-event-ampm.js | 2 +- .../mf-v2-h-event-attendees.js | 2 +- .../mf-v2-h-event-combining.js | 2 +- .../mf-v2-h-event-concatenate.js | 2 +- .../standards-tests/mf-v2-h-event-dates.js | 2 +- .../mf-v2-h-event-dt-property.js | 2 +- .../mf-v2-h-event-justahyperlink.js | 2 +- .../mf-v2-h-event-justaname.js | 2 +- .../standards-tests/mf-v2-h-event-time.js | 2 +- .../mf-v2-h-feed-implied-title.js | 2 +- .../standards-tests/mf-v2-h-feed-simple.js | 2 +- .../mf-v2-h-geo-abbrpattern.js | 2 +- .../standards-tests/mf-v2-h-geo-altitude.js | 2 +- .../standards-tests/mf-v2-h-geo-hidden.js | 2 +- .../standards-tests/mf-v2-h-geo-justaname.js | 2 +- .../mf-v2-h-geo-simpleproperties.js | 2 +- .../mf-v2-h-geo-valuetitleclass.js | 2 +- .../test/standards-tests/mf-v2-h-news-all.js | 2 +- .../standards-tests/mf-v2-h-news-minimum.js | 2 +- .../standards-tests/mf-v2-h-org-hyperlink.js | 2 +- .../standards-tests/mf-v2-h-org-simple.js | 2 +- .../mf-v2-h-org-simpleproperties.js | 2 +- .../mf-v2-h-product-aggregate.js | 2 +- .../mf-v2-h-product-justahyperlink.js | 2 +- .../mf-v2-h-product-justaname.js | 2 +- .../mf-v2-h-product-simpleproperties.js | 2 +- .../standards-tests/mf-v2-h-recipe-all.js | 2 +- .../standards-tests/mf-v2-h-recipe-minimum.js | 2 +- .../mf-v2-h-resume-affiliation.js | 2 +- .../standards-tests/mf-v2-h-resume-contact.js | 2 +- .../mf-v2-h-resume-education.js | 2 +- .../mf-v2-h-resume-justaname.js | 2 +- .../standards-tests/mf-v2-h-resume-skill.js | 2 +- .../standards-tests/mf-v2-h-resume-work.js | 2 +- .../mf-v2-h-review-aggregate-hevent.js | 2 +- ...mf-v2-h-review-aggregate-justahyperlink.js | 2 +- ...-v2-h-review-aggregate-simpleproperties.js | 2 +- .../mf-v2-h-review-hyperlink.js | 2 +- .../mf-v2-h-review-implieditem.js | 2 +- .../standards-tests/mf-v2-h-review-item.js | 2 +- .../mf-v2-h-review-justaname.js | 2 +- .../standards-tests/mf-v2-h-review-photo.js | 2 +- .../standards-tests/mf-v2-h-review-vcard.js | 2 +- .../mf-v2-rel-duplicate-rels.js | 2 +- .../test/standards-tests/mf-v2-rel-license.js | 2 +- .../standards-tests/mf-v2-rel-nofollow.js | 2 +- .../standards-tests/mf-v2-rel-rel-urls.js | 2 +- .../mf-v2-rel-varying-text-duplicate-rels.js | 2 +- .../test/standards-tests/mf-v2-rel-xfn-all.js | 2 +- .../mf-v2-rel-xfn-elsewhere.js | 2 +- .../test/static/javascript/DOMParser.js | 4 +- .../test/static/javascript/beautify.js | 6 +- .../test/static/javascript/chai.js | 6 +- .../test/static/javascript/count.js | 30 +- .../test/static/javascript/parse.js | 58 +- .../test/static/javascript/prettify.js | 92 +- .../test/static/javascript/testrunner.js | 48 +- .../tests/test_Microformats_geo.html | 2 +- .../tests/test_Microformats_getters.html | 2 +- .../tests/test_Microformats_hCard.html | 12 +- toolkit/components/nsDefaultCLH.js | 4 +- .../osfile/NativeOSFileInternals.cpp | 2 +- .../PerformanceStats-content.js | 3 +- .../perfmonitoring/nsIPerformanceStats.idl | 74 +- .../perfmonitoring/nsPerformanceStats.cpp | 116 ++- .../perfmonitoring/nsPerformanceStats.h | 74 +- .../browser_webpagePerformanceAlerts.js | 2 +- .../components/places/BookmarkHTMLUtils.jsm | 14 +- toolkit/components/places/Bookmarks.jsm | 4 +- toolkit/components/places/PlacesBackups.jsm | 2 +- toolkit/components/places/PlacesUtils.jsm | 20 +- toolkit/components/places/nsTaggingService.js | 18 +- .../autocomplete/test_match_beginning.js | 2 +- .../places/tests/bookmarks/test_384228.js | 2 +- .../places/tests/bookmarks/test_385829.js | 2 +- .../places/tests/bookmarks/test_388695.js | 2 +- .../places/tests/bookmarks/test_395101.js | 2 +- .../bookmarks/test_405938_restore_queries.js | 4 +- .../test_417228-exclude-from-backup.js | 2 +- .../test_424958-json-quoted-folders.js | 2 +- .../places/tests/bookmarks/test_448584.js | 2 +- .../test_818584-discard-duplicate-backups.js | 2 +- .../test_997030-bookmarks-html-encode.js | 2 +- .../places/tests/bookmarks/test_bmindex.js | 2 +- .../tests/bookmarks/test_bookmarks_fetch.js | 2 +- .../places/tests/browser/browser_bug680727.js | 6 +- .../places/tests/queries/test_415716.js | 2 +- .../tests/queries/test_onlyBookmarked.js | 8 +- .../places/tests/queries/test_transitions.js | 2 +- .../places/tests/unit/test_331487.js | 4 +- .../places/tests/unit/test_384370.js | 2 +- .../places/tests/unit/test_385397.js | 2 +- .../places/tests/unit/test_408221.js | 40 +- .../places/tests/unit/test_413784.js | 4 +- .../unit/test_419792_node_tags_property.js | 4 +- .../unit/test_429505_remove_shortcuts.js | 4 +- .../unit/test_PlacesUtils_lazyobservers.js | 2 +- .../tests/unit/test_adaptive_bug527311.js | 2 +- .../tests/unit/test_async_history_api.js | 2 +- .../places/tests/unit/test_bookmark_catobs.js | 2 +- .../unit/test_bookmarks_html_import_tags.js | 57 ++ .../places/tests/unit/test_frecency.js | 2 +- .../places/tests/unit/test_history.js | 2 +- .../unit/test_history_autocomplete_tags.js | 36 +- .../places/tests/unit/test_history_sidebar.js | 2 +- .../places/tests/unit/test_isvisited.js | 4 +- .../places/tests/unit/test_placeURIs.js | 2 +- .../unit/test_removeVisitsByTimeframe.js | 2 +- .../unit/test_tag_autocomplete_search.js | 40 +- .../test_utils_getURLsForContainerNode.js | 2 +- .../components/places/tests/unit/xpcshell.ini | 1 + .../printing/content/printPageSetup.js | 14 +- .../printing/content/printPreviewProgress.js | 16 +- .../printing/content/printProgress.js | 38 +- .../components/printing/content/printUtils.js | 2 +- .../printing/content/printdialog.js | 26 +- .../printing/content/printjoboptions.js | 54 +- .../prompts/test/test_bug619644.html | 2 +- .../satchel/test/test_form_autocomplete.html | 2 +- .../test_form_autocomplete_with_list.html | 4 +- toolkit/components/social/WorkerAPI.jsm | 2 +- .../tests/unit/test_TelemetryLateWrites.js | 2 +- .../tests/unit/test_TelemetryLockCount.js | 2 +- .../telemetry/tests/unit/test_nsITelemetry.js | 2 +- .../components/thumbnails/PageThumbUtils.jsm | 173 +++- toolkit/components/thumbnails/PageThumbs.jsm | 23 +- .../content/backgroundPageThumbsContent.js | 14 +- .../test/browser_thumbnails_bug727765.js | 11 +- .../timermanager/nsUpdateTimerManager.js | 4 +- .../components/viewconfig/content/config.js | 18 +- toolkit/content/browser-child.js | 24 +- toolkit/content/findUtils.js | 4 +- toolkit/content/finddialog.js | 18 +- toolkit/content/globalOverlay.js | 6 +- toolkit/content/nsDragAndDrop.js | 180 ++-- toolkit/content/tests/browser/browser.ini | 3 - .../browser/browser_autoscroll_disabled.js | 118 ++- .../browser_bug295977_autoscroll_overflow.js | 203 ++--- .../tests/browser/browser_bug982298.js | 2 +- .../browser/browser_f7_caret_browsing.js | 2 +- .../browser_keyevents_during_autoscrolling.js | 108 +-- .../tests/chrome/RegisterUnregisterChrome.js | 6 +- toolkit/content/tests/chrome/popup_trigger.js | 2 +- .../content/tests/chrome/xul_selectcontrol.js | 4 +- .../tests/unit/test_contentAreaUtils.js | 2 +- toolkit/content/tests/widgets/popup_shared.js | 2 +- toolkit/content/tests/widgets/tree_shared.js | 10 +- toolkit/content/widgets/button.xml | 36 +- toolkit/content/widgets/colorpicker.xml | 56 +- toolkit/content/widgets/datetimepicker.xml | 2 +- toolkit/content/widgets/dialog.xml | 30 +- toolkit/content/widgets/filefield.xml | 14 +- toolkit/content/widgets/listbox.xml | 24 +- toolkit/content/widgets/popup.xml | 30 +- toolkit/content/widgets/preferences.xml | 198 ++--- toolkit/content/widgets/progressmeter.xml | 6 +- toolkit/content/widgets/radio.xml | 18 +- toolkit/content/widgets/scrollbox.xml | 12 +- toolkit/content/widgets/spinbuttons.xml | 4 +- toolkit/content/widgets/textbox.xml | 2 +- toolkit/content/widgets/toolbar.xml | 41 +- toolkit/content/widgets/tree.xml | 66 +- toolkit/content/widgets/wizard.xml | 102 +-- toolkit/devtools/server/nsJSInspector.cpp | 4 +- .../tests/gtest/DoesCrossZoneBoundaries.cpp | 4 +- .../tests/gtest/DoesntCrossZoneBoundaries.cpp | 4 +- ...einspector_csslogic-content-stylesheets.js | 24 +- toolkit/identity/tests/unit/test_log_utils.js | 4 +- toolkit/modules/CertUtils.jsm | 2 +- toolkit/modules/debug.js | 2 +- .../secondscreen/SimpleServiceDiscovery.jsm | 2 +- .../modules/tests/xpcshell/test_Promise.js | 2 +- .../mozapps/downloads/content/download.xml | 36 +- .../mozapps/downloads/content/downloads.js | 2 +- .../mozapps/downloads/content/helperApps.js | 128 +-- .../mozapps/downloads/tests/chrome/utils.js | 2 +- .../extensions/ChromeManifestParser.jsm | 14 +- toolkit/mozapps/extensions/content/list.js | 8 +- .../extensions/content/selectAddons.xml | 2 +- .../mozapps/extensions/content/setting.xml | 2 +- .../extensions/content/xpinstallConfirm.js | 8 +- .../test/browser/browser_bug557956.js | 2 +- .../test/browser/browser_bug562797.js | 2 +- .../test/browser/browser_bug562890.js | 2 +- .../test/browser/browser_bug567127.js | 2 +- .../test/browser/browser_bug570760.js | 2 +- .../test/browser/browser_bug573062.js | 2 +- .../test/browser/browser_bug587970.js | 10 +- .../test/browser/browser_bug593535.js | 10 +- .../test/browser/browser_bug608316.js | 2 +- .../test/browser/browser_bug618502.js | 2 +- .../test/browser/browser_discovery.js | 2 +- .../extensions/test/browser/browser_list.js | 2 +- .../test/browser/browser_manualupdates.js | 6 +- .../test/browser/browser_recentupdates.js | 2 +- .../test/browser/browser_searching.js | 6 +- .../test/xpcshell/test_AddonRepository.js | 2 +- .../xpcshell/test_ChromeManifestParser.js | 2 +- .../test/xpcshell/test_bug455906.js | 14 +- .../test/xpcshell/test_bug468528.js | 2 +- .../test/xpcshell/test_bug514327_3.js | 12 +- .../test/xpcshell/test_bug563256.js | 2 +- .../test/xpcshell/test_bug594058.js | 2 +- .../test/xpcshell/test_bug619730.js | 2 +- .../test/xpcshell/test_compatoverrides.js | 2 +- .../test/xpcshell/test_dictionary.js | 4 +- .../test/xpcshell/test_duplicateplugins.js | 2 +- .../test/xpcshell/test_filepointer.js | 4 +- .../test/xpcshell/test_hasbinarycomponents.js | 2 +- .../test/xpcshell/test_isDebuggable.js | 2 +- .../extensions/test/xpcshell/test_migrate4.js | 6 +- .../test/xpcshell/test_migrate_max_version.js | 2 +- .../extensions/test/xpcshell/test_plugins.js | 2 +- .../test/xpcshell/test_strictcompatibility.js | 2 +- .../test/xpinstall/browser_localfile2.js | 6 +- .../test/xpinstall/browser_signed_multiple.js | 2 +- toolkit/mozapps/handling/content/dialog.js | 14 +- .../handling/nsContentDispatchChooser.js | 2 +- toolkit/mozapps/preferences/changemp.js | 26 +- toolkit/mozapps/preferences/fontbuilder.js | 22 +- toolkit/mozapps/preferences/removemp.js | 14 +- toolkit/mozapps/update/content/history.js | 18 +- toolkit/mozapps/update/content/updates.xml | 28 +- .../downloadCompleteAfterPartialFailure.js | 2 +- .../tests/unit_aus_update/updateManagerXML.js | 2 +- .../marAppInUseStageSuccessComplete_unix.js | 2 +- .../marStageSuccessComplete.js | 2 +- .../marStageSuccessCompleteSvc.js | 2 +- toolkit/obsolete/content/dialogOverlay.js | 20 +- toolkit/obsolete/content/nsClipboard.js | 20 +- toolkit/obsolete/content/nsUserSettings.js | 12 +- toolkit/obsolete/content/strres.js | 6 +- xpcom/glue/nsCycleCollectionParticipant.h | 3 - xpcom/typelib/xpt/tools/Makefile.in | 2 - 451 files changed, 4390 insertions(+), 3522 deletions(-) delete mode 100644 build/stlport/Makefile.in create mode 100644 layout/style/test/test_asyncopen2.html delete mode 100644 testing/web-platform/meta/IndexedDB/keypath.htm.ini create mode 100644 toolkit/components/places/tests/unit/test_bookmarks_html_import_tags.js diff --git a/browser/app/profile/palemoon.js b/browser/app/profile/palemoon.js index 41f67ff3ff..477f3feb74 100644 --- a/browser/app/profile/palemoon.js +++ b/browser/app/profile/palemoon.js @@ -1277,6 +1277,12 @@ pref("dom.serviceWorkers.openWindow.enabled", true); // Enable Push API. pref("dom.push.enabled", true); +// These are the thumbnail width/height set in about:newtab. +// If you change this, ENSURE IT IS THE SAME SIZE SET +// by about:newtab. These values are in CSS pixels. +pref("toolkit.pageThumbs.minWidth", 280); +pref("toolkit.pageThumbs.minHeight", 190); + // ****************** domain-specific UAs ****************** // AMO needs "Firefox", obviously - pass on the OS (determined at build time) diff --git a/build/stlport/Makefile.in b/build/stlport/Makefile.in deleted file mode 100644 index ca11f30788..0000000000 --- a/build/stlport/Makefile.in +++ /dev/null @@ -1,9 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this file, -# You can obtain one at http://mozilla.org/MPL/2.0/. - -MODULES = stlport - -include $(topsrcdir)/config/rules.mk - -CXXFLAGS += -fuse-cxa-atexit diff --git a/build/stlport/moz.build b/build/stlport/moz.build index ef8627069a..915b8c9ea2 100644 --- a/build/stlport/moz.build +++ b/build/stlport/moz.build @@ -72,3 +72,7 @@ NO_EXPAND_LIBS = True # We allow warnings for third-party code that can be updated from upstream. ALLOW_COMPILER_WARNINGS = True + +CXXFLAGS += [ + '-fuse-cxa-atexit', +] diff --git a/build/unix/elfhack/Makefile.in b/build/unix/elfhack/Makefile.in index fdc6ab1072..f1c8c91ee5 100644 --- a/build/unix/elfhack/Makefile.in +++ b/build/unix/elfhack/Makefile.in @@ -3,8 +3,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -INTERNAL_TOOLS = 1 - OS_CXXFLAGS := $(filter-out -fno-exceptions,$(OS_CXXFLAGS)) -fexceptions include $(topsrcdir)/config/rules.mk diff --git a/build/unix/elfhack/inject/Makefile.in b/build/unix/elfhack/inject/Makefile.in index 07357a2b94..ef27b077be 100644 --- a/build/unix/elfhack/inject/Makefile.in +++ b/build/unix/elfhack/inject/Makefile.in @@ -3,8 +3,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -INTERNAL_TOOLS = 1 - include $(topsrcdir)/config/rules.mk export:: $(CSRCS:.c=.$(OBJ_SUFFIX)) diff --git a/config/config.mk b/config/config.mk index d4a1ce9515..42e71cdefe 100644 --- a/config/config.mk +++ b/config/config.mk @@ -242,11 +242,6 @@ endif # WINNT && !GNU_CC # _ENABLE_PIC=1 -# No sense in profiling tools -ifdef INTERNAL_TOOLS -NO_PROFILE_GUIDED_OPTIMIZE = 1 -endif - # Don't build SIMPLE_PROGRAMS with PGO, since they don't need it anyway, # and we don't have the same build logic to re-link them in the second pass. ifdef SIMPLE_PROGRAMS diff --git a/config/mozunit.py b/config/mozunit.py index 964927e10f..6d89b88004 100644 --- a/config/mozunit.py +++ b/config/mozunit.py @@ -32,19 +32,44 @@ class _MozTestResult(_TestResult): else: return str(test) + def printStatus(self, status, test, message=''): + line = "{status} | {file} | {klass}.{test}{sep}{message}".format( + status=status, + file=inspect.getfile(test.__class__), + klass=test.__class__.__name__, + test=test._testMethodName, + sep=', ' if message else '', + message=message, + ) + self.stream.writeln(line) + def addSuccess(self, test): _TestResult.addSuccess(self, test) - filename = inspect.getfile(test.__class__) - testname = test._testMethodName - self.stream.writeln("TEST-PASS | {0} | {1}".format(filename, testname)) + self.printStatus('TEST-PASS', test) + + def addSkip(self, test, reason): + _TestResult.addSkip(self, test, reason) + self.printStatus('TEST-SKIP', test) + + def addExpectedFailure(self, test, err): + _TestResult.addExpectedFailure(self, test, err) + self.printStatus('TEST-KNOWN-FAIL', test) + + def addUnexpectedSuccess(self, test): + _TestResult.addUnexpectedSuccess(self, test) + self.printStatus('TEST-UNEXPECTED-PASS', test) def addError(self, test, err): _TestResult.addError(self, test, err) self.printFail(test, err) + self.stream.writeln("ERROR: {0}".format(self.getDescription(test))) + self.stream.writeln(self.errors[-1][1]) def addFailure(self, test, err): _TestResult.addFailure(self, test, err) self.printFail(test,err) + self.stream.writeln("FAIL: {0}".format(self.getDescription(test))) + self.stream.writeln(self.failures[-1][1]) def printFail(self, test, err): exctype, value, tb = err @@ -54,13 +79,8 @@ class _MozTestResult(_TestResult): if not tb: self.stream.writeln("TEST-UNEXPECTED-FAIL | NO TRACEBACK |") _f, _ln, _t = inspect.getframeinfo(tb)[:3] - self.stream.writeln("TEST-UNEXPECTED-FAIL | {0} | line {1}, {2}: {3}" - .format(_f, _ln, _t, value.message)) - - def printErrorList(self): - for test, err in self.errors: - self.stream.writeln("ERROR: {0}".format(self.getDescription(test))) - self.stream.writeln("{0}".format(err)) + self.printStatus('TEST-UNEXPECTED-FAIL', test, + 'line {0}: {1}'.format(_ln, value.message)) class MozTestRunner(_TestRunner): @@ -69,7 +89,6 @@ class MozTestRunner(_TestRunner): def run(self, test): result = self._makeResult() test(result) - result.printErrorList() return result class MockedFile(StringIO): diff --git a/dom/animation/KeyframeEffect.cpp b/dom/animation/KeyframeEffect.cpp index 39e21f1308..8562f8a5b7 100644 --- a/dom/animation/KeyframeEffect.cpp +++ b/dom/animation/KeyframeEffect.cpp @@ -2063,5 +2063,12 @@ KeyframeEffectReadOnly::ShouldBlockCompositorAnimations(const nsIFrame* return false; } +JSObject* +KeyframeEffect::WrapObject(JSContext* aCx, + JS::Handle aGivenProto) +{ + return KeyframeEffectBinding::Wrap(aCx, this, aGivenProto); +} + } // namespace dom } // namespace mozilla diff --git a/dom/animation/KeyframeEffect.h b/dom/animation/KeyframeEffect.h index 5a4a52b5f2..64a92b042a 100644 --- a/dom/animation/KeyframeEffect.h +++ b/dom/animation/KeyframeEffect.h @@ -384,6 +384,19 @@ private: static const TimeDuration OverflowRegionRefreshInterval(); }; +class KeyframeEffect : public KeyframeEffectReadOnly +{ +public: + KeyframeEffect(nsIDocument* aDocument, + Element* aTarget, + nsCSSPseudoElements::Type aPseudoType, + const TimingParams& aTiming) + : KeyframeEffectReadOnly(aDocument, aTarget, aPseudoType, aTiming) { } + + JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; +}; + } // namespace dom } // namespace mozilla diff --git a/dom/base/Console.cpp b/dom/base/Console.cpp index 6aeecb9fb9..6a5ddf7543 100644 --- a/dom/base/Console.cpp +++ b/dom/base/Console.cpp @@ -153,7 +153,7 @@ public: ConsoleCallData* tmp = this; for (uint32_t i = 0; i < mCopiedArguments.Length(); ++i) { - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCopiedArguments[i]); + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCopiedArguments[i]) } } diff --git a/dom/base/DOMException.cpp b/dom/base/DOMException.cpp index c5ea640b09..a035a4f98f 100644 --- a/dom/base/DOMException.cpp +++ b/dom/base/DOMException.cpp @@ -182,7 +182,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Exception) NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mThrownJSVal); + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mThrownJSVal) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Exception) diff --git a/dom/base/DOMRequest.cpp b/dom/base/DOMRequest.cpp index 8f23c059e1..1f31874da4 100644 --- a/dom/base/DOMRequest.cpp +++ b/dom/base/DOMRequest.cpp @@ -63,7 +63,7 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(DOMRequest, DOMEventTargetHelper) // Don't need NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER because // DOMEventTargetHelper does it for us. - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mResult) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mResult) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DOMRequest) diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 31cb13be12..745adb7fe5 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -1909,7 +1909,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(nsDocument) NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDocument) if (tmp->PreservingWrapper()) { - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mExpandoAndGeneration.expando); + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mExpandoAndGeneration.expando) } NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER NS_IMPL_CYCLE_COLLECTION_TRACE_END diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp index b3fd4509ad..7489cb6945 100644 --- a/dom/base/nsFrameMessageManager.cpp +++ b/dom/base/nsFrameMessageManager.cpp @@ -138,7 +138,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsFrameMessageManager) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsFrameMessageManager) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mInitialProcessData) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mInitialProcessData) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsFrameMessageManager) diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 7392b0280d..9a917a662d 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -2795,8 +2795,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsJSArgArray) if (tmp->mArgv) { for (uint32_t i = 0; i < tmp->mArgc; ++i) { - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mArgv[i]) - } + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mArgv[i]) + } } NS_IMPL_CYCLE_COLLECTION_TRACE_END diff --git a/dom/base/nsJSTimeoutHandler.cpp b/dom/base/nsJSTimeoutHandler.cpp index bc4b36c5e1..7c4d18b76a 100644 --- a/dom/base/nsJSTimeoutHandler.cpp +++ b/dom/base/nsJSTimeoutHandler.cpp @@ -129,7 +129,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsJSScriptTimeoutHandler) for (uint32_t i = 0; i < tmp->mArgs.Length(); ++i) { - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mArgs[i]) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mArgs[i]) } NS_IMPL_CYCLE_COLLECTION_TRACE_END diff --git a/dom/base/nsXMLHttpRequest.cpp b/dom/base/nsXMLHttpRequest.cpp index 97d72f14ee..fd3e5ece64 100644 --- a/dom/base/nsXMLHttpRequest.cpp +++ b/dom/base/nsXMLHttpRequest.cpp @@ -455,7 +455,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(nsXMLHttpRequest, nsXHREventTarget) NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mResultArrayBuffer) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mResultJSON) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mResultJSON) NS_IMPL_CYCLE_COLLECTION_TRACE_END // QueryInterface implementation for nsXMLHttpRequest diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index ff4ae5dfa2..c4700847f2 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -16549,9 +16549,7 @@ class CGEventClass(CGBindingImplClass): for m in self.descriptor.interface.members: if m.isAttr(): name = CGDictionary.makeMemberName(m.identifier.name) - if m.type.isAny(): - retVal += " NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(" + name + ")\n" - elif m.type.isObject() or m.type.isSpiderMonkeyInterface(): + if m.type.isAny() or m.type.isObject() or m.type.isSpiderMonkeyInterface(): retVal += " NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(" + name + ")\n" elif typeNeedsRooting(m.type): raise TypeError("Need to implement tracing for event " diff --git a/dom/events/MessageEvent.cpp b/dom/events/MessageEvent.cpp index dbf56837e0..c944e35c03 100644 --- a/dom/events/MessageEvent.cpp +++ b/dom/events/MessageEvent.cpp @@ -33,7 +33,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(MessageEvent, Event) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(MessageEvent, Event) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mData) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mData) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(MessageEvent) diff --git a/dom/html/HTMLFormElement.cpp b/dom/html/HTMLFormElement.cpp index 43cceead6c..3c68c79fae 100644 --- a/dom/html/HTMLFormElement.cpp +++ b/dom/html/HTMLFormElement.cpp @@ -153,7 +153,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(HTMLFormElement, nsGenericHTMLElement) if (tmp->PreservingWrapper()) { - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mExpandoAndGeneration.expando); + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mExpandoAndGeneration.expando) } NS_IMPL_CYCLE_COLLECTION_TRACE_END diff --git a/dom/html/nsDOMStringMap.cpp b/dom/html/nsDOMStringMap.cpp index fe2b863886..831fb83ef0 100644 --- a/dom/html/nsDOMStringMap.cpp +++ b/dom/html/nsDOMStringMap.cpp @@ -38,7 +38,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMStringMap) NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER if (tmp->PreservingWrapper()) { - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mExpandoAndGeneration.expando); + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mExpandoAndGeneration.expando) } NS_IMPL_CYCLE_COLLECTION_TRACE_END diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 0061bb22c0..4a23849149 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -5723,14 +5723,20 @@ private: public: NS_DECL_ISUPPORTS_INHERITED + bool + IsOnOwningThread() const + { + MOZ_ASSERT(mOwningThread); + + bool current; + return NS_SUCCEEDED(mOwningThread->IsOnCurrentThread(¤t)) && current; + } + void AssertIsOnOwningThread() const { - AssertIsOnBackgroundThread(); - MOZ_ASSERT(mOwningThread); - DebugOnly current; - MOZ_ASSERT(NS_SUCCEEDED(mOwningThread->IsOnCurrentThread(¤t))); - MOZ_ASSERT(current); + MOZ_ASSERT(IsOnBackgroundThread()); + MOZ_ASSERT(IsOnOwningThread()); } void @@ -10229,7 +10235,7 @@ DatabaseConnection::Close() AssertIsOnConnectionThread(); MOZ_ASSERT(mStorageConnection); MOZ_ASSERT(!mDEBUGSavepointCount); - MOZ_ASSERT(!mInWriteTransaction); + MOZ_RELEASE_ASSERT(!mInWriteTransaction); PROFILER_LABEL("IndexedDB", "DatabaseConnection::Close", @@ -17310,6 +17316,25 @@ QuotaClient::PerformIdleMaintenanceOnDatabaseInternal( MOZ_ASSERT(!aMaintenanceInfo.mGroup.IsEmpty()); MOZ_ASSERT(!aMaintenanceInfo.mOrigin.IsEmpty()); + class MOZ_STACK_CLASS AutoClose final + { + nsCOMPtr mConnection; + + public: + explicit AutoClose(mozIStorageConnection* aConnection) + : mConnection(aConnection) + { + MOZ_ASSERT(aConnection); + } + + ~AutoClose() + { + MOZ_ASSERT(mConnection); + + MOZ_ALWAYS_TRUE(NS_SUCCEEDED(mConnection->Close())); + } + }; + nsCOMPtr databaseFile = GetFileForPath(aMaintenanceInfo.mDatabasePath); MOZ_ASSERT(databaseFile); @@ -17347,6 +17372,8 @@ QuotaClient::PerformIdleMaintenanceOnDatabaseInternal( return; } + AutoClose autoClose(connection); + if (IdleMaintenanceMustEnd(aRunId)) { return; } @@ -17578,7 +17605,7 @@ QuotaClient::DetermineMaintenanceAction(mozIStorageConnection* aConnection, return rv; } - MOZ_ASSERT(lastVacuumSize > 0); + NS_ASSERTION(lastVacuumSize > 0, "Thy last vacuum size shall be greater than zero, less than zero shall thy last vacuum size not be. Zero is right out."); // This shouldn't really be possible... if (NS_WARN_IF(mMaintenanceStartTime <= lastVacuumTime)) { @@ -19830,10 +19857,6 @@ FactoryOp::Run() SendResults(); return NS_OK; - // We raced, no need to crash. - case State::Completed: - return NS_OK; - default: MOZ_CRASH("Bad state!"); } @@ -19847,8 +19870,12 @@ FactoryOp::Run() // thread. mState = State::SendingResults; - MOZ_ALWAYS_TRUE(NS_SUCCEEDED(mOwningThread->Dispatch(this, - NS_DISPATCH_NORMAL))); + if (IsOnOwningThread()) { + SendResults(); + } else { + MOZ_ALWAYS_TRUE(NS_SUCCEEDED( + mOwningThread->Dispatch(this, NS_DISPATCH_NORMAL))); + } } return NS_OK; @@ -19891,19 +19918,6 @@ FactoryOp::ActorDestroy(ActorDestroyReason aWhy) AssertIsOnBackgroundThread(); NoteActorDestroyed(); - - // There may be an event in the event queue that would do the cleanup later, - // but if we are being destroyed abnormally (not by calling - // PBackgroundIDBFactoryRequestParent::Send__delete__) we need to do the - // cleanup here and just ignore the cleanup event in FactoryOp::Run. - // Otherwise some Database objects may be still alive and registered in - // gLiveDatabaseHashtable at the time the last factory is destroyed. - if (aWhy != Deletion) { - mState = State::SendingResults; - IDB_REPORT_INTERNAL_ERR(); - mResultCode = NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR; - SendResults(); - } } bool @@ -20652,8 +20666,7 @@ OpenDatabaseOp::NoteDatabaseClosed(Database* aDatabase) MOZ_ASSERT(aDatabase); MOZ_ASSERT(mState == State::WaitingForOtherDatabasesToClose || mState == State::WaitingForTransactionsToComplete || - mState == State::DatabaseWorkVersionChange || - mState == State::SendingResults); + mState == State::DatabaseWorkVersionChange); if (mState != State::WaitingForOtherDatabasesToClose) { MOZ_ASSERT(mMaybeBlockedDatabases.IsEmpty()); @@ -23276,8 +23289,9 @@ NormalJSRuntime::Init() JSAutoRequest ar(mContext); + JS::CompartmentOptions options; mGlobal = JS_NewGlobalObject(mContext, &kGlobalClass, nullptr, - JS::FireOnNewGlobalHook); + JS::FireOnNewGlobalHook, options); if (NS_WARN_IF(!mGlobal)) { return false; } diff --git a/dom/indexedDB/IDBCursor.cpp b/dom/indexedDB/IDBCursor.cpp index d40b69af52..287f342388 100644 --- a/dom/indexedDB/IDBCursor.cpp +++ b/dom/indexedDB/IDBCursor.cpp @@ -867,9 +867,9 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBCursor) NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mScriptOwner) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedKey) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedPrimaryKey) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedValue) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCachedKey) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCachedPrimaryKey) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCachedValue) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(IDBCursor) diff --git a/dom/indexedDB/IDBIndex.cpp b/dom/indexedDB/IDBIndex.cpp index 25698fae6f..4ecb34c939 100644 --- a/dom/indexedDB/IDBIndex.cpp +++ b/dom/indexedDB/IDBIndex.cpp @@ -593,7 +593,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(IDBIndex) NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBIndex) NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedKeyPath) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCachedKeyPath) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBIndex) diff --git a/dom/indexedDB/IDBKeyRange.cpp b/dom/indexedDB/IDBKeyRange.cpp index 46a04d3b9d..5aa2c2bc35 100644 --- a/dom/indexedDB/IDBKeyRange.cpp +++ b/dom/indexedDB/IDBKeyRange.cpp @@ -242,8 +242,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBKeyRange) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBKeyRange) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedLowerVal) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedUpperVal) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCachedLowerVal) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCachedUpperVal) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(IDBKeyRange) diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp index 299e236397..665f62851d 100644 --- a/dom/indexedDB/IDBObjectStore.cpp +++ b/dom/indexedDB/IDBObjectStore.cpp @@ -1616,7 +1616,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(IDBObjectStore) NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBObjectStore) NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedKeyPath) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCachedKeyPath) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBObjectStore) diff --git a/dom/indexedDB/IDBRequest.cpp b/dom/indexedDB/IDBRequest.cpp index 5c2b2dab06..40013d190f 100644 --- a/dom/indexedDB/IDBRequest.cpp +++ b/dom/indexedDB/IDBRequest.cpp @@ -436,7 +436,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(IDBRequest, IDBWrapperCache) // Don't need NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER because // DOMEventTargetHelper does it for us. - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mResultVal) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mResultVal) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(IDBRequest) diff --git a/dom/indexedDB/KeyPath.cpp b/dom/indexedDB/KeyPath.cpp index bd804fbe5b..dc8d10668f 100644 --- a/dom/indexedDB/KeyPath.cpp +++ b/dom/indexedDB/KeyPath.cpp @@ -89,8 +89,8 @@ GetJSValFromKeyPathString(JSContext* aCx, nsString targetObjectPropName; JS::Rooted targetObject(aCx, nullptr); - JS::Rooted obj(aCx, - aValue.isPrimitive() ? nullptr : aValue.toObjectOrNull()); + JS::Rooted currentVal(aCx, aValue); + JS::Rooted obj(aCx); while (tokenizer.hasMoreTokens()) { const nsDependentSubstring& token = tokenizer.nextToken(); @@ -103,9 +103,18 @@ GetJSValFromKeyPathString(JSContext* aCx, bool hasProp; if (!targetObject) { // We're still walking the chain of existing objects - if (!obj) { + // http://w3c.github.io/IndexedDB/#dfn-evaluate-a-key-path-on-a-value + // step 4 substep 1: check for .length on a String value. + if (currentVal.isString() && !tokenizer.hasMoreTokens() && + token.EqualsLiteral("length") && aOptions == DoNotCreateProperties) { + aKeyJSVal->setNumber(double(JS_GetStringLength(currentVal.toString()))); + break; + } + + if (!currentVal.isObject()) { return NS_ERROR_DOM_INDEXEDDB_DATA_ERR; } + obj = ¤tVal.toObject(); bool ok = JS_HasUCProperty(aCx, obj, keyPathChars, keyPathLen, &hasProp); @@ -123,10 +132,7 @@ GetJSValFromKeyPathString(JSContext* aCx, } if (tokenizer.hasMoreTokens()) { // ...and walk to it if there are more steps... - if (intermediate.isPrimitive()) { - return NS_ERROR_DOM_INDEXEDDB_DATA_ERR; - } - obj = intermediate.toObjectOrNull(); + currentVal = intermediate; } else { // ...otherwise use it as key diff --git a/dom/indexedDB/test/unit/test_indexes_funny_things.js b/dom/indexedDB/test/unit/test_indexes_funny_things.js index 33386e079f..af0384c771 100644 --- a/dom/indexedDB/test/unit/test_indexes_funny_things.js +++ b/dom/indexedDB/test/unit/test_indexes_funny_things.js @@ -45,7 +45,7 @@ function testSteps() const objectStoreDataLengthSort = [ { key: "5", value: arr}, - //{ key: "4", value: str}, + { key: "4", value: str}, ]; let request = indexedDB.open(name, 1); diff --git a/dom/notification/Notification.cpp b/dom/notification/Notification.cpp index 7406fe0c5f..e829890b83 100644 --- a/dom/notification/Notification.cpp +++ b/dom/notification/Notification.cpp @@ -1226,7 +1226,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(Notification, DOMEventTargetHe NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(Notification, DOMEventTargetHelper) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mData); + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mData) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_ADDREF_INHERITED(Notification, DOMEventTargetHelper) diff --git a/dom/promise/Promise.cpp b/dom/promise/Promise.cpp index 19e1d8ba1c..65bd76f5dc 100644 --- a/dom/promise/Promise.cpp +++ b/dom/promise/Promise.cpp @@ -416,7 +416,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Promise) #ifndef SPIDERMONKEY_PROMISE - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mResult) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mResult) NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mAllocationStack) NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mRejectionStack) NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mFullfillmentStack) diff --git a/dom/tests/mochitest/general/test_interfaces.html b/dom/tests/mochitest/general/test_interfaces.html index ee0714dcea..61da0f5cb3 100644 --- a/dom/tests/mochitest/general/test_interfaces.html +++ b/dom/tests/mochitest/general/test_interfaces.html @@ -729,6 +729,8 @@ var interfaceNamesInGlobalScope = "KeyboardEvent", // IMPORTANT: Do not change this list without review from a DOM peer! {name: "KeyframeEffectReadOnly", release: false}, +// IMPORTANT: Do not change this list without review from a DOM peer! + {name: "KeyframeEffect", release: false}, // IMPORTANT: Do not change this list without review from a DOM peer! "LocalMediaStream", // IMPORTANT: Do not change this list without review from a DOM peer! diff --git a/dom/webidl/KeyframeEffect.webidl b/dom/webidl/KeyframeEffect.webidl index 04786e4693..d17c400ac4 100644 --- a/dom/webidl/KeyframeEffect.webidl +++ b/dom/webidl/KeyframeEffect.webidl @@ -4,7 +4,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. * * The origin of this IDL file is - * http://w3c.github.io/web-animations/#the-keyframeeffect-interfaces + * https://w3c.github.io/web-animations/#the-keyframeeffect-interfaces * * Copyright © 2015 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C * liability, trademark and document use rules apply. @@ -44,3 +44,21 @@ interface KeyframeEffectReadOnly : AnimationEffectReadOnly { // property-value pairs on the object. [Throws] sequence getFrames(); }; + + +// Bug 1211783 Implement KeyframeEffect constructor +// [Constructor (Animatable? target, +// object? frames, +// optional (unrestricted double or KeyframeEffectOptions) options)] +interface KeyframeEffect : KeyframeEffectReadOnly { + // Bug 1067769 - Allow setting KeyframeEffect.target + // inherit attribute Animatable? target; + // Bug 1216843 - implement animation composition + // inherit attribute IterationCompositeOperation iterationComposite; + // Bug 1216844 - implement additive animation + // inherit attribute CompositeOperation composite; + // Bug 1244590 - implement spacing modes + // inherit attribute DOMString spacing; + // Bug 1244591 - implement setFrames + // void setFrames (object? frames); +}; diff --git a/dom/workers/ServiceWorkerEvents.cpp b/dom/workers/ServiceWorkerEvents.cpp index c1d0fd0b29..daf3d6021c 100644 --- a/dom/workers/ServiceWorkerEvents.cpp +++ b/dom/workers/ServiceWorkerEvents.cpp @@ -1225,7 +1225,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(ExtendableMessageEvent, Event) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(ExtendableMessageEvent, Event) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mData) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mData) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ExtendableMessageEvent) diff --git a/dom/workers/ServiceWorkerMessageEvent.cpp b/dom/workers/ServiceWorkerMessageEvent.cpp index fab9e1d2ea..43fde83497 100644 --- a/dom/workers/ServiceWorkerMessageEvent.cpp +++ b/dom/workers/ServiceWorkerMessageEvent.cpp @@ -33,7 +33,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(ServiceWorkerMessageEvent, Eve NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(ServiceWorkerMessageEvent, Event) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mData) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mData) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(ServiceWorkerMessageEvent) diff --git a/dom/workers/XMLHttpRequest.cpp b/dom/workers/XMLHttpRequest.cpp index 252e961660..acb0d73bb1 100644 --- a/dom/workers/XMLHttpRequest.cpp +++ b/dom/workers/XMLHttpRequest.cpp @@ -1617,7 +1617,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(XMLHttpRequest, nsXHREventTarget) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mStateData.mResponse) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mStateData.mResponse) NS_IMPL_CYCLE_COLLECTION_TRACE_END JSObject* diff --git a/gfx/thebes/gfxFontConstants.h b/gfx/thebes/gfxFontConstants.h index 1ed31e47d0..ca2adca43e 100644 --- a/gfx/thebes/gfxFontConstants.h +++ b/gfx/thebes/gfxFontConstants.h @@ -41,6 +41,12 @@ #define NS_FONT_SYNTHESIS_WEIGHT 0x1 #define NS_FONT_SYNTHESIS_STYLE 0x2 +#define NS_FONT_DISPLAY_AUTO 0 +#define NS_FONT_DISPLAY_BLOCK 1 +#define NS_FONT_DISPLAY_SWAP 2 +#define NS_FONT_DISPLAY_FALLBACK 3 +#define NS_FONT_DISPLAY_OPTIONAL 4 + enum { eFeatureAlternates_historical, eFeatureAlternates_stylistic, diff --git a/js/src/jsapi-tests/moz.build b/js/src/jsapi-tests/moz.build index e0e7cb2f6b..fb57071f50 100644 --- a/js/src/jsapi-tests/moz.build +++ b/js/src/jsapi-tests/moz.build @@ -120,6 +120,3 @@ USE_LIBS += [ ] OS_LIBS += CONFIG['MOZ_ZLIB_LIBS'] - -if not CONFIG['GNU_CXX']: - ALLOW_COMPILER_WARNINGS = True diff --git a/js/src/jsapi-tests/testArrayBufferView.cpp b/js/src/jsapi-tests/testArrayBufferView.cpp index cc9e4ccc0f..e0b4f3af60 100644 --- a/js/src/jsapi-tests/testArrayBufferView.cpp +++ b/js/src/jsapi-tests/testArrayBufferView.cpp @@ -137,7 +137,8 @@ bool TestViewType(JSContext* cx) } JS::CompartmentOptions options; - JS::RootedObject otherGlobal(cx, JS_NewGlobalObject(cx, basicGlobalClass(), nullptr, JS::DontFireOnNewGlobalHook, options)); + JS::RootedObject otherGlobal(cx, JS_NewGlobalObject(cx, basicGlobalClass(), nullptr, + JS::DontFireOnNewGlobalHook, options)); CHECK(otherGlobal); JS::Rooted buffer(cx); diff --git a/js/src/jsapi-tests/testBug604087.cpp b/js/src/jsapi-tests/testBug604087.cpp index 47a1fd676a..27009d678c 100644 --- a/js/src/jsapi-tests/testBug604087.cpp +++ b/js/src/jsapi-tests/testBug604087.cpp @@ -60,9 +60,16 @@ BEGIN_TEST(testBug604087) options.setClass(&OuterWrapperClass); options.setSingleton(true); JS::RootedObject outerObj(cx, js::Wrapper::New(cx, global, &js::Wrapper::singleton, options)); - JS::RootedObject compartment2(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, JS::FireOnNewGlobalHook)); - JS::RootedObject compartment3(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, JS::FireOnNewGlobalHook)); - JS::RootedObject compartment4(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, JS::FireOnNewGlobalHook)); + JS::CompartmentOptions globalOptions; + JS::RootedObject compartment2(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, + JS::FireOnNewGlobalHook, globalOptions)); + CHECK(compartment2 != nullptr); + JS::RootedObject compartment3(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, + JS::FireOnNewGlobalHook, globalOptions)); + CHECK(compartment3 != nullptr); + JS::RootedObject compartment4(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, + JS::FireOnNewGlobalHook, globalOptions)); + CHECK(compartment4 != nullptr); JS::RootedObject c2wrapper(cx, wrap(cx, outerObj, compartment2)); CHECK(c2wrapper); diff --git a/js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp b/js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp index 9968e8d93c..060d2f309a 100644 --- a/js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp +++ b/js/src/jsapi-tests/testCallNonGenericMethodOnProxy.cpp @@ -37,7 +37,9 @@ CustomMethod(JSContext* cx, unsigned argc, Value* vp) BEGIN_TEST(test_CallNonGenericMethodOnProxy) { // Create the first global object and compartment - JS::RootedObject globalA(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, JS::FireOnNewGlobalHook)); + JS::CompartmentOptions options; + JS::RootedObject globalA(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, + JS::FireOnNewGlobalHook, options)); CHECK(globalA); JS::RootedObject customA(cx, JS_NewObject(cx, &CustomClass)); @@ -55,7 +57,9 @@ BEGIN_TEST(test_CallNonGenericMethodOnProxy) // Now create the second global object and compartment... { - JS::RootedObject globalB(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, JS::FireOnNewGlobalHook)); + JS::CompartmentOptions options; + JS::RootedObject globalB(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, + JS::FireOnNewGlobalHook, options)); CHECK(globalB); // ...and enter it. diff --git a/js/src/jsapi-tests/testChromeBuffer.cpp b/js/src/jsapi-tests/testChromeBuffer.cpp index d4544a87db..ae729f9366 100644 --- a/js/src/jsapi-tests/testChromeBuffer.cpp +++ b/js/src/jsapi-tests/testChromeBuffer.cpp @@ -50,8 +50,9 @@ BEGIN_TEST(testChromeBuffer) { JS_SetTrustedPrincipals(rt, &system_principals); + JS::CompartmentOptions options; trusted_glob.init(cx, JS_NewGlobalObject(cx, &global_class, &system_principals, - JS::FireOnNewGlobalHook)); + JS::FireOnNewGlobalHook, options)); CHECK(trusted_glob); JS::RootedFunction fun(cx); diff --git a/js/src/jsapi-tests/testDebugger.cpp b/js/src/jsapi-tests/testDebugger.cpp index aaecf9f422..e03e3ab169 100644 --- a/js/src/jsapi-tests/testDebugger.cpp +++ b/js/src/jsapi-tests/testDebugger.cpp @@ -15,7 +15,9 @@ BEGIN_TEST(testDebugger_newScriptHook) { // Test that top-level indirect eval fires the newScript hook. CHECK(JS_DefineDebuggerObject(cx, global)); - JS::RootedObject g(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, JS::FireOnNewGlobalHook)); + JS::CompartmentOptions options; + JS::RootedObject g(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, + JS::FireOnNewGlobalHook, options)); CHECK(g); { JSAutoCompartment ae(cx, g); diff --git a/js/src/jsapi-tests/testGCMarking.cpp b/js/src/jsapi-tests/testGCMarking.cpp index fd3eea1449..8ddc2d2e44 100644 --- a/js/src/jsapi-tests/testGCMarking.cpp +++ b/js/src/jsapi-tests/testGCMarking.cpp @@ -42,8 +42,9 @@ BEGIN_TEST(testTracingIncomingCCWs) JS::RootedObject global1(cx, JS::CurrentGlobalOrNull(cx)); CHECK(global1); + JS::CompartmentOptions options; JS::RootedObject global2(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, - JS::FireOnNewGlobalHook)); + JS::FireOnNewGlobalHook, options)); CHECK(global2); CHECK(global1->zone() != global2->zone()); diff --git a/js/src/jsapi-tests/testMutedErrors.cpp b/js/src/jsapi-tests/testMutedErrors.cpp index 7826b09feb..1b9c7280e6 100644 --- a/js/src/jsapi-tests/testMutedErrors.cpp +++ b/js/src/jsapi-tests/testMutedErrors.cpp @@ -50,7 +50,9 @@ eval(const char* asciiChars, bool mutedErrors, JS::MutableHandleValue rval) chars[i] = asciiChars[i]; chars[len] = 0; - JS::RootedObject global(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, JS::FireOnNewGlobalHook)); + JS::CompartmentOptions globalOptions; + JS::RootedObject global(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, + JS::FireOnNewGlobalHook, globalOptions)); CHECK(global); JSAutoCompartment ac(cx, global); CHECK(JS_InitStandardClasses(cx, global)); diff --git a/js/src/jsapi-tests/testStructuredClone.cpp b/js/src/jsapi-tests/testStructuredClone.cpp index 277d50cb19..14c3997d15 100644 --- a/js/src/jsapi-tests/testStructuredClone.cpp +++ b/js/src/jsapi-tests/testStructuredClone.cpp @@ -155,8 +155,9 @@ BEGIN_TEST(testStructuredClone_SavedFrame) for (auto* pp = principalsToTest; pp->principals != DONE; pp++) { fprintf(stderr, "Testing with principals '%s'\n", pp->name); + JS::CompartmentOptions options; JS::RootedObject g(cx, JS_NewGlobalObject(cx, getGlobalClass(), pp->principals, - JS::FireOnNewGlobalHook)); + JS::FireOnNewGlobalHook, options)); CHECK(g); JSAutoCompartment ac(cx, g); diff --git a/js/src/jsapi-tests/testUbiNode.cpp b/js/src/jsapi-tests/testUbiNode.cpp index e45136475b..756eec55d7 100644 --- a/js/src/jsapi-tests/testUbiNode.cpp +++ b/js/src/jsapi-tests/testUbiNode.cpp @@ -73,8 +73,9 @@ BEGIN_TEST(test_ubiNodeZone) CHECK(global1); CHECK(JS::ubi::Node(global1).zone() == cx->zone()); + JS::CompartmentOptions globalOptions; RootedObject global2(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, - JS::FireOnNewGlobalHook)); + JS::FireOnNewGlobalHook, globalOptions)); CHECK(global2); CHECK(global1->zone() != global2->zone()); CHECK(JS::ubi::Node(global2).zone() == global2->zone()); @@ -116,8 +117,9 @@ BEGIN_TEST(test_ubiNodeCompartment) CHECK(global1); CHECK(JS::ubi::Node(global1).compartment() == cx->compartment()); + JS::CompartmentOptions globalOptions; RootedObject global2(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr, - JS::FireOnNewGlobalHook)); + JS::FireOnNewGlobalHook, globalOptions)); CHECK(global2); CHECK(global1->compartment() != global2->compartment()); CHECK(JS::ubi::Node(global2).compartment() == global2->compartment()); diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 0f6d634e27..792c59b8f9 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -1900,7 +1900,7 @@ JS::CompartmentBehaviorsRef(JSContext* cx) JS_PUBLIC_API(JSObject*) JS_NewGlobalObject(JSContext* cx, const JSClass* clasp, JSPrincipals* principals, JS::OnNewGlobalHookOption hookOption, - const JS::CompartmentOptions& options /* = JS::CompartmentOptions() */) + const JS::CompartmentOptions& options) { AssertHeapIsIdle(cx); CHECK_REQUEST(cx); @@ -4757,6 +4757,20 @@ JS_AtomizeAndPinJSString(JSContext* cx, HandleString str) return atom; } +JS_PUBLIC_API(JSString*) +JS_AtomizeString(JSContext* cx, const char* s) +{ + return JS_AtomizeStringN(cx, s, strlen(s)); +} + +JS_PUBLIC_API(JSString*) +JS_AtomizeStringN(JSContext* cx, const char* s, size_t length) +{ + AssertHeapIsIdle(cx); + CHECK_REQUEST(cx); + return Atomize(cx, s, length, DoNotPinAtom); +} + JS_PUBLIC_API(JSString*) JS_AtomizeAndPinString(JSContext* cx, const char* s) { @@ -4801,6 +4815,20 @@ JS_NewUCStringCopyZ(JSContext* cx, const char16_t* s) return NewStringCopyZ(cx, s); } +JS_PUBLIC_API(JSString*) +JS_AtomizeUCString(JSContext* cx, const char16_t* s) +{ + return JS_AtomizeUCStringN(cx, s, js_strlen(s)); +} + +JS_PUBLIC_API(JSString*) +JS_AtomizeUCStringN(JSContext* cx, const char16_t* s, size_t length) +{ + AssertHeapIsIdle(cx); + CHECK_REQUEST(cx); + return AtomizeChars(cx, s, length, DoNotPinAtom); +} + JS_PUBLIC_API(JSString*) JS_AtomizeAndPinUCStringN(JSContext* cx, const char16_t* s, size_t length) { diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 2a271d82a2..e0c2507b0e 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -2490,7 +2490,7 @@ enum OnNewGlobalHookOption { extern JS_PUBLIC_API(JSObject*) JS_NewGlobalObject(JSContext* cx, const JSClass* clasp, JSPrincipals* principals, JS::OnNewGlobalHookOption hookOption, - const JS::CompartmentOptions& options = JS::CompartmentOptions()); + const JS::CompartmentOptions& options); /** * Spidermonkey does not have a good way of keeping track of what compartments should be marked on * their own. We can mark the roots unconditionally, but marking GC things only relevant in live @@ -4370,6 +4370,12 @@ JS_NewStringCopyZ(JSContext* cx, const char* s); extern JS_PUBLIC_API(JSString*) JS_AtomizeAndPinJSString(JSContext* cx, JS::HandleString str); +extern JS_PUBLIC_API(JSString*) +JS_AtomizeStringN(JSContext* cx, const char* s, size_t length); + +extern JS_PUBLIC_API(JSString*) +JS_AtomizeString(JSContext* cx, const char* s); + extern JS_PUBLIC_API(JSString*) JS_AtomizeAndPinStringN(JSContext* cx, const char* s, size_t length); @@ -4385,6 +4391,12 @@ JS_NewUCStringCopyN(JSContext* cx, const char16_t* s, size_t n); extern JS_PUBLIC_API(JSString*) JS_NewUCStringCopyZ(JSContext* cx, const char16_t* s); +extern JS_PUBLIC_API(JSString*) +JS_AtomizeUCStringN(JSContext* cx, const char16_t* s, size_t length); + +extern JS_PUBLIC_API(JSString*) +JS_AtomizeUCString(JSContext* cx, const char16_t* s); + extern JS_PUBLIC_API(JSString*) JS_AtomizeAndPinUCStringN(JSContext* cx, const char16_t* s, size_t length); @@ -4594,7 +4606,7 @@ class MOZ_RAII JSAutoByteString } ~JSAutoByteString() { - js_free(mBytes); + JS_free(nullptr, mBytes); } /* Take ownership of the given byte array. */ @@ -4639,7 +4651,7 @@ class MOZ_RAII JSAutoByteString } private: - char* mBytes; + char* mBytes; MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER /* Copy and assignment are not supported. */ diff --git a/js/src/moz.build b/js/src/moz.build index 8a9ddd956c..ac1f71f0b7 100644 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -661,6 +661,8 @@ if CONFIG['_MSC_VER']: # Parser definition, see bug 1167030. CXXFLAGS += ['-wd4661'] CXXFLAGS += ['-we4067', '-we4258', '-we4275'] + CXXFLAGS += ['-wd4146'] # FIXME: unary minus operator applied to unsigned type (bug 1229189) + CXXFLAGS += ['-wd4273'] # FIXME: inconsistent dll linkage (bug 1229666) if CONFIG['OS_ARCH'] not in ('WINNT', 'HP-UX'): OS_LIBS += [ @@ -689,9 +691,6 @@ CFLAGS += CONFIG['MOZ_ICU_CFLAGS'] CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS'] LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES'] -if not CONFIG['GNU_CXX']: - ALLOW_COMPILER_WARNINGS = True - NO_EXPAND_LIBS = True DIST_INSTALL = True diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index e0b058b420..a63500535a 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -2610,8 +2610,10 @@ SetStandardCompartmentOptions(JS::CompartmentOptions& options) static JSObject* NewSandbox(JSContext* cx, bool lazy) { + JS::CompartmentOptions options; + SetStandardCompartmentOptions(options); RootedObject obj(cx, JS_NewGlobalObject(cx, &sandbox_class, nullptr, - JS::DontFireOnNewGlobalHook)); + JS::DontFireOnNewGlobalHook, options)); if (!obj) return nullptr; diff --git a/js/src/shell/moz.build b/js/src/shell/moz.build index e78504b57c..b632df7a37 100644 --- a/js/src/shell/moz.build +++ b/js/src/shell/moz.build @@ -35,9 +35,6 @@ LOCAL_INCLUDES += [ OS_LIBS += CONFIG['EDITLINE_LIBS'] OS_LIBS += CONFIG['MOZ_ZLIB_LIBS'] -if not CONFIG['GNU_CXX']: - ALLOW_COMPILER_WARNINGS = True - # Prepare module loader JS code for embedding GENERATED_FILES += ['shellmoduleloader.out.h'] shellmoduleloader = GENERATED_FILES['shellmoduleloader.out.h'] diff --git a/js/xpconnect/src/nsScriptErrorWithStack.cpp b/js/xpconnect/src/nsScriptErrorWithStack.cpp index 670a5275aa..edc12fa767 100644 --- a/js/xpconnect/src/nsScriptErrorWithStack.cpp +++ b/js/xpconnect/src/nsScriptErrorWithStack.cpp @@ -49,7 +49,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsScriptErrorWithStack) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsScriptErrorWithStack) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mStack) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mStack) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTING_ADDREF(nsScriptErrorWithStack) diff --git a/layout/base/AccessibleCaret.cpp b/layout/base/AccessibleCaret.cpp index 4450f3cb7f..dfb7cbbbee 100644 --- a/layout/base/AccessibleCaret.cpp +++ b/layout/base/AccessibleCaret.cpp @@ -7,6 +7,7 @@ #include "AccessibleCaret.h" #include "AccessibleCaretLogger.h" +#include "mozilla/FloatingPoint.h" #include "mozilla/Preferences.h" #include "mozilla/ToString.h" #include "nsCanvasFrame.h" @@ -116,6 +117,7 @@ AccessibleCaret::SetAppearance(Appearance aAppearance) // Need to reset rect since the cached rect will be compared in SetPosition. if (mAppearance == Appearance::None) { mImaginaryCaretRect = nsRect(); + mZoomLevel = 0.0f; } } @@ -255,25 +257,29 @@ AccessibleCaret::SetPosition(nsIFrame* aFrame, int32_t aOffset) if (imaginaryCaretRectInFrame.IsEmpty()) { // Don't bother to set the caret position since it's invisible. mImaginaryCaretRect = nsRect(); + mZoomLevel = 0.0f; return PositionChangedResult::Invisible; } nsRect imaginaryCaretRect = imaginaryCaretRectInFrame; nsLayoutUtils::TransformRect(aFrame, RootFrame(), imaginaryCaretRect); + float zoomLevel = GetZoomLevel(); - if (imaginaryCaretRect.IsEqualEdges(mImaginaryCaretRect)) { + if (imaginaryCaretRect.IsEqualEdges(mImaginaryCaretRect) && + FuzzyEqualsMultiplicative(zoomLevel, mZoomLevel)) { return PositionChangedResult::NotChanged; } mImaginaryCaretRect = imaginaryCaretRect; + mZoomLevel = zoomLevel; // SetCaretElementStyle() and SetSelectionBarElementStyle() require the // input rect relative to container frame. nsRect imaginaryCaretRectInContainerFrame = imaginaryCaretRectInFrame; nsLayoutUtils::TransformRect(aFrame, CustomContentContainerFrame(), imaginaryCaretRectInContainerFrame); - SetCaretElementStyle(imaginaryCaretRectInContainerFrame); - SetSelectionBarElementStyle(imaginaryCaretRectInContainerFrame); + SetCaretElementStyle(imaginaryCaretRectInContainerFrame, mZoomLevel); + SetSelectionBarElementStyle(imaginaryCaretRectInContainerFrame, mZoomLevel); return PositionChangedResult::Changed; } @@ -288,7 +294,7 @@ AccessibleCaret::CustomContentContainerFrame() const } void -AccessibleCaret::SetCaretElementStyle(const nsRect& aRect) +AccessibleCaret::SetCaretElementStyle(const nsRect& aRect, float aZoomLevel) { nsPoint position = CaretElementPosition(aRect); nsAutoString styleStr; @@ -297,11 +303,10 @@ AccessibleCaret::SetCaretElementStyle(const nsRect& aRect) nsPresContext::AppUnitsToIntCSSPixels(position.y), nsPresContext::AppUnitsToIntCSSPixels(aRect.height)); - float zoomLevel = GetZoomLevel(); styleStr.AppendPrintf(" width: %.2fpx; height: %.2fpx; margin-left: %.2fpx", - sWidth / zoomLevel, - sHeight / zoomLevel, - sMarginLeft / zoomLevel); + sWidth / aZoomLevel, + sHeight / aZoomLevel, + sMarginLeft / aZoomLevel); ErrorResult rv; CaretElement()->SetAttribute(NS_LITERAL_STRING("style"), styleStr, rv); @@ -311,15 +316,15 @@ AccessibleCaret::SetCaretElementStyle(const nsRect& aRect) } void -AccessibleCaret::SetSelectionBarElementStyle(const nsRect& aRect) +AccessibleCaret::SetSelectionBarElementStyle(const nsRect& aRect, + float aZoomLevel) { int32_t height = nsPresContext::AppUnitsToIntCSSPixels(aRect.height); nsAutoString barStyleStr; barStyleStr.AppendPrintf("margin-top: -%dpx; height: %dpx;", height, height); - float zoomLevel = GetZoomLevel(); - barStyleStr.AppendPrintf(" width: %.2fpx;", sBarWidth / zoomLevel); + barStyleStr.AppendPrintf(" width: %.2fpx;", sBarWidth / aZoomLevel); ErrorResult rv; SelectionBarElement()->SetAttribute(NS_LITERAL_STRING("style"), barStyleStr, rv); @@ -334,7 +339,7 @@ AccessibleCaret::GetZoomLevel() // Full zoom on desktop. float fullZoom = mPresShell->GetPresContext()->GetFullZoom(); - // Pinch-zoom on B2G. + // Pinch-zoom on B2G or fennec. float resolution = mPresShell->GetCumulativeResolution(); return fullZoom * resolution; diff --git a/layout/base/AccessibleCaret.h b/layout/base/AccessibleCaret.h index 8ff1717e9d..59b47f0381 100644 --- a/layout/base/AccessibleCaret.h +++ b/layout/base/AccessibleCaret.h @@ -104,7 +104,7 @@ public: // Position is not changed. NotChanged, - // Position is changed. + // Position or zoom level is changed. Changed, // Position is out of scroll port. @@ -138,8 +138,8 @@ public: protected: // Argument aRect should be relative to CustomContentContainerFrame(). - void SetCaretElementStyle(const nsRect& aRect); - void SetSelectionBarElementStyle(const nsRect& aRect); + void SetCaretElementStyle(const nsRect& aRect, float aZoomLevel); + void SetSelectionBarElementStyle(const nsRect& aRect, float aZoomLevel); // Get current zoom level. float GetZoomLevel(); @@ -210,6 +210,9 @@ protected: // mImaginaryCaretRect is relative to root frame. nsRect mImaginaryCaretRect; + // Cache current zoom level to determine whether position is changed. + float mZoomLevel = 0.0f; + // A no-op touch-start listener which prevents APZ from panning when dragging // the caret. RefPtr mDummyTouchListener{new DummyTouchListener()}; diff --git a/layout/base/ZoomConstraintsClient.cpp b/layout/base/ZoomConstraintsClient.cpp index cab14234f5..e2a4e53921 100644 --- a/layout/base/ZoomConstraintsClient.cpp +++ b/layout/base/ZoomConstraintsClient.cpp @@ -48,6 +48,9 @@ ZoomConstraintsClient::~ZoomConstraintsClient() static nsIWidget* GetWidget(nsIPresShell* aShell) { + if (!aShell) { + return nullptr; + } if (nsIFrame* rootFrame = aShell->GetRootFrame()) { #if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_UIKIT) return rootFrame->GetNearestWidget(); diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index 1831b2ed2d..abfb15121e 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -94,6 +94,13 @@ namespace { // jank-critical mode if and only if at least one vsync driver has // at least one observer. static uint64_t sActiveVsyncTimers = 0; + + // The latest value of process-wide jank levels. + // + // For each i, sJankLevels[i] counts the number of times delivery of + // vsync to the main thread has been delayed by at least 2^i ms. Use + // GetJankLevels to grab a copy of this array. + uint64_t sJankLevels[12]; } namespace mozilla { @@ -449,6 +456,7 @@ private: sample); Telemetry::Accumulate(Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, sample); + RecordJank(sample); } else if (mVsyncRate != TimeDuration::Forever()) { TimeDuration contentDelay = (TimeStamp::Now() - mLastChildTick) - mVsyncRate; if (contentDelay.ToMilliseconds() < 0 ){ @@ -461,6 +469,7 @@ private: sample); Telemetry::Accumulate(Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, sample); + RecordJank(sample); } else { // Request the vsync rate from the parent process. Might be a few vsyncs // until the parent responds. @@ -469,6 +478,16 @@ private: #endif } + void RecordJank(uint32_t aJankMS) + { + uint32_t duration = 1 /* ms */; + for (size_t i = 0; + i < mozilla::ArrayLength(sJankLevels) && duration < aJankMS; + ++i, duration *= 2) { + sJankLevels[i]++; + } + } + void TickRefreshDriver(TimeStamp aVsyncTimestamp) { MOZ_ASSERT(NS_IsMainThread()); @@ -824,6 +843,7 @@ CreateVsyncRefreshTimer() { MOZ_ASSERT(NS_IsMainThread()); + PodArrayZero(sJankLevels); // Sometimes, gfxPrefs is not initialized here. Make sure the gfxPrefs is // ready. gfxPrefs::GetSingleton(); @@ -2134,4 +2154,10 @@ nsRefreshDriver::IsJankCritical() return sActiveVsyncTimers > 0; } +/* static */ bool +nsRefreshDriver::GetJankLevels(Vector& aJank) { + aJank.clear(); + return aJank.append(sJankLevels, ArrayLength(sJankLevels)); +} + #undef LOG diff --git a/layout/base/nsRefreshDriver.h b/layout/base/nsRefreshDriver.h index e1a167a7c0..c1fc4c8051 100644 --- a/layout/base/nsRefreshDriver.h +++ b/layout/base/nsRefreshDriver.h @@ -13,6 +13,8 @@ #define nsRefreshDriver_h_ #include "mozilla/TimeStamp.h" +#include "mozilla/Vector.h" + #include "mozFlushType.h" #include "nsTObserverArray.h" #include "nsTArray.h" @@ -283,6 +285,20 @@ public: bool IsInRefresh() { return mInRefresh; } + /** + * The latest value of process-wide jank levels. + * + * For each i, sJankLevels[i] counts the number of times delivery of + * vsync to the main thread has been delayed by at least 2^i + * ms. This data structure has been designed to make it easy to + * determine how much jank has taken place between two instants in + * time. + * + * Return `false` if `aJank` needs to be grown to accomodate the + * data but we didn't have enough memory. + */ + static bool GetJankLevels(mozilla::Vector& aJank); + // mozilla::layers::TransactionIdAllocator virtual uint64_t GetTransactionId() override; void NotifyTransactionCompleted(uint64_t aTransactionId) override; diff --git a/layout/style/nsCSSFontDescList.h b/layout/style/nsCSSFontDescList.h index f4255fc61d..0c614c9b20 100644 --- a/layout/style/nsCSSFontDescList.h +++ b/layout/style/nsCSSFontDescList.h @@ -11,3 +11,4 @@ CSS_FONT_DESC(src, Src) CSS_FONT_DESC(unicode-range, UnicodeRange) CSS_FONT_DESC(font-feature-settings, FontFeatureSettings) CSS_FONT_DESC(font-language-override, FontLanguageOverride) +CSS_FONT_DESC(font-display, Display) diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h index c51a31a053..27044ee816 100644 --- a/layout/style/nsCSSKeywordList.h +++ b/layout/style/nsCSSKeywordList.h @@ -263,6 +263,7 @@ CSS_KEY(extends, extends) CSS_KEY(extra-condensed, extra_condensed) CSS_KEY(extra-expanded, extra_expanded) CSS_KEY(ew-resize, ew_resize) +CSS_KEY(fallback, fallback) CSS_KEY(fantasy, fantasy) CSS_KEY(farthest-side, farthest_side) CSS_KEY(farthest-corner, farthest_corner) @@ -412,6 +413,7 @@ CSS_KEY(oldstyle-nums, oldstyle_nums) CSS_KEY(opacity, opacity) CSS_KEY(open, open) CSS_KEY(open-quote, open_quote) +CSS_KEY(optional, optional) CSS_KEY(ordinal, ordinal) CSS_KEY(ornaments, ornaments) CSS_KEY(outset, outset) @@ -552,6 +554,7 @@ CSS_KEY(substract, substract) CSS_KEY(super, super) CSS_KEY(sw-resize, sw_resize) CSS_KEY(swash, swash) +CSS_KEY(swap, swap) CSS_KEY(table, table) CSS_KEY(table-caption, table_caption) CSS_KEY(table-cell, table_cell) diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 5d09820ac2..9a8348ab59 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -4006,7 +4006,9 @@ CSSParserImpl::ParseFontDescriptor(nsCSSFontFaceRule* aRule) nsCSSFontDesc descID = nsCSSProps::LookupFontDesc(descName); nsCSSValue value; - if (descID == eCSSFontDesc_UNKNOWN) { + if (descID == eCSSFontDesc_UNKNOWN || + (descID == eCSSFontDesc_Display && + !Preferences::GetBool("layout.css.font-display.enabled"))) { if (NonMozillaVendorIdentifier(descName)) { // silently skip other vendors' extensions SkipDeclaration(true); @@ -11692,6 +11694,10 @@ CSSParserImpl::ParseFontDescriptorValue(nsCSSFontDesc aDescID, return ParseSingleTokenVariant(aValue, VARIANT_KEYWORD | VARIANT_NORMAL, nsCSSProps::kFontStyleKTable); + case eCSSFontDesc_Display: + return ParseSingleTokenVariant(aValue, VARIANT_KEYWORD, + nsCSSProps::kFontDisplayKTable); + case eCSSFontDesc_Weight: return (ParseFontWeight(aValue) && aValue.GetUnit() != eCSSUnit_Inherit && diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index dbeb018655..66adc731f5 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -613,7 +613,19 @@ nsCSSFontDesc nsCSSProps::LookupFontDesc(const nsACString& aFontDesc) { MOZ_ASSERT(gFontDescTable, "no lookup table, needs addref"); - return nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc)); + nsCSSFontDesc which = nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc)); + + if (which == eCSSFontDesc_Display && + !Preferences::GetBool("layout.css.font-display.enabled")) { + which = eCSSFontDesc_UNKNOWN; + } else if (which == eCSSFontDesc_UNKNOWN) { + // check for unprefixed font-feature-settings/font-language-override + nsAutoCString prefixedProp; + prefixedProp.AppendLiteral("-moz-"); + prefixedProp.Append(aFontDesc); + which = nsCSSFontDesc(gFontDescTable->Lookup(prefixedProp)); + } + return which; } nsCSSFontDesc @@ -622,8 +634,11 @@ nsCSSProps::LookupFontDesc(const nsAString& aFontDesc) MOZ_ASSERT(gFontDescTable, "no lookup table, needs addref"); nsCSSFontDesc which = nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc)); - // check for unprefixed font-feature-settings/font-language-override - if (which == eCSSFontDesc_UNKNOWN) { + if (which == eCSSFontDesc_Display && + !Preferences::GetBool("layout.css.font-display.enabled")) { + which = eCSSFontDesc_UNKNOWN; + } else if (which == eCSSFontDesc_UNKNOWN) { + // check for unprefixed font-feature-settings/font-language-override nsAutoString prefixedProp; prefixedProp.AppendLiteral("-moz-"); prefixedProp.Append(aFontDesc); @@ -1405,6 +1420,15 @@ const KTableEntry nsCSSProps::kFloatEdgeKTable[] = { { eCSSKeyword_UNKNOWN, -1 } }; +const KTableEntry nsCSSProps::kFontDisplayKTable[] = { + { eCSSKeyword_auto, NS_FONT_DISPLAY_AUTO }, + { eCSSKeyword_block, NS_FONT_DISPLAY_BLOCK }, + { eCSSKeyword_swap, NS_FONT_DISPLAY_SWAP }, + { eCSSKeyword_fallback, NS_FONT_DISPLAY_FALLBACK }, + { eCSSKeyword_optional, NS_FONT_DISPLAY_OPTIONAL }, + { eCSSKeyword_UNKNOWN, -1 } +}; + const KTableEntry nsCSSProps::kFontKTable[] = { // CSS2. { eCSSKeyword_caption, NS_STYLE_FONT_CAPTION }, diff --git a/layout/style/nsCSSProps.h b/layout/style/nsCSSProps.h index 9afc434d6f..742daa9cb6 100644 --- a/layout/style/nsCSSProps.h +++ b/layout/style/nsCSSProps.h @@ -746,6 +746,7 @@ public: // "layout.css.float-logical-values.enabled" changes: static KTableEntry kFloatKTable[]; static const KTableEntry kFloatEdgeKTable[]; + static const KTableEntry kFontDisplayKTable[]; static const KTableEntry kFontKTable[]; static const KTableEntry kFontKerningKTable[]; static const KTableEntry kFontSizeKTable[]; diff --git a/layout/style/nsCSSRules.cpp b/layout/style/nsCSSRules.cpp index 6ffb5d7d60..73961e12b3 100644 --- a/layout/style/nsCSSRules.cpp +++ b/layout/style/nsCSSRules.cpp @@ -1315,6 +1315,13 @@ nsCSSFontFaceStyleDecl::GetPropertyValue(nsCSSFontDesc aFontDescID, nsCSSValue::eNormalized); return NS_OK; + case eCSSFontDesc_Display: + NS_ASSERTION(val.GetUnit() == eCSSUnit_Enumerated, + "unknown unit for font-display descriptor"); + AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(val.GetIntValue(), + nsCSSProps::kFontDisplayKTable), aResult); + return NS_OK; + case eCSSFontDesc_Src: nsStyleUtil::AppendSerializedFontSrc(val, aResult); return NS_OK; diff --git a/layout/style/test/mochitest.ini b/layout/style/test/mochitest.ini index ce4a2d0060..0bd7f87c07 100644 --- a/layout/style/test/mochitest.ini +++ b/layout/style/test/mochitest.ini @@ -293,3 +293,4 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(bug 870262, skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(bug 870262, :visited support) b2g-debug(bug 870262, :visited support) b2g-desktop(bug 870262, :visited support) [test_webkit_box_orient.html] [test_webkit_device_pixel_ratio.html] +[test_asyncopen2.html] diff --git a/layout/style/test/test_asyncopen2.html b/layout/style/test/test_asyncopen2.html new file mode 100644 index 0000000000..6dda6848a6 --- /dev/null +++ b/layout/style/test/test_asyncopen2.html @@ -0,0 +1,54 @@ + + + + + Bug 1195173 - Test asyncOpen2 security exception + + + + + + + + +Mozilla Bug 1195173 +

+ + + + + diff --git a/layout/style/test/test_font_face_parser.html b/layout/style/test/test_font_face_parser.html index 82a8004b36..75eba7293b 100644 --- a/layout/style/test/test_font_face_parser.html +++ b/layout/style/test/test_font_face_parser.html @@ -14,6 +14,7 @@

 
 
 
 
diff --git a/layout/svg/nsSVGClipPathFrame.cpp b/layout/svg/nsSVGClipPathFrame.cpp
index a46e35b1c7..74264a293a 100644
--- a/layout/svg/nsSVGClipPathFrame.cpp
+++ b/layout/svg/nsSVGClipPathFrame.cpp
@@ -39,8 +39,8 @@ nsSVGClipPathFrame::ApplyClipPath(gfxContext& aContext,
 
   DrawTarget& aDrawTarget = *aContext.GetDrawTarget();
 
-  // No need for AutoClipPathReferencer since simple clip paths can't create a
-  // reference loop.
+  // No need for AutoReferenceLoopDetector since simple clip paths can't create
+  // a reference loop (they don't reference other clip paths).
 
   // Restore current transform after applying clip path:
   gfxContextMatrixAutoSaveRestore autoRestore(&aContext);
@@ -90,14 +90,11 @@ nsSVGClipPathFrame::GetClipMask(gfxContext& aReferenceContext,
 
   DrawTarget& aReferenceDT = *aReferenceContext.GetDrawTarget();
 
-  // If the flag is set when we get here, it means this clipPath frame
-  // has already been used painting the current clip, and the document
-  // has a clip reference loop.
-  if (mInUse) {
-    NS_WARNING("Clip loop detected!");
+  AutoReferenceLoopDetector loopDetector;
+  if (!loopDetector.MarkAsInUse(this)) {
+    // Reference loop! This reference should be ignored, so return nullptr.
     return nullptr;
   }
-  AutoClipPathReferencer clipRef(this);
 
   IntRect devSpaceClipExtents;
   {
@@ -242,14 +239,12 @@ bool
 nsSVGClipPathFrame::PointIsInsideClipPath(nsIFrame* aClippedFrame,
                                           const gfxPoint &aPoint)
 {
-  // If the flag is set when we get here, it means this clipPath frame
-  // has already been used in hit testing against the current clip,
-  // and the document has a clip reference loop.
-  if (mInUse) {
-    NS_WARNING("Clip loop detected!");
-    return false;
+  AutoReferenceLoopDetector loopDetector;
+  if (!loopDetector.MarkAsInUse(this)) {
+    // Reference loop! This reference is ignored, so return true (point not
+    // clipped out).
+    return true;
   }
-  AutoClipPathReferencer clipRef(this);
 
   gfxMatrix matrix = GetClipPathTransform(aClippedFrame);
   if (!matrix.Invert()) {
@@ -328,11 +323,10 @@ nsSVGClipPathFrame::IsTrivial(nsISVGChildFrame **aSingleChild)
 bool
 nsSVGClipPathFrame::IsValid()
 {
-  if (mInUse) {
-    NS_WARNING("Clip loop detected!");
-    return false;
+  AutoReferenceLoopDetector loopDetector;
+  if (!loopDetector.MarkAsInUse(this)) {
+    return false; // Reference loop!
   }
-  AutoClipPathReferencer clipRef(this);
 
   bool isOK = true;
   nsSVGEffects::GetEffectProperties(this).GetClipPathFrame(&isOK);
diff --git a/layout/svg/nsSVGClipPathFrame.h b/layout/svg/nsSVGClipPathFrame.h
index 00f037ad9c..84ec21c6f8 100644
--- a/layout/svg/nsSVGClipPathFrame.h
+++ b/layout/svg/nsSVGClipPathFrame.h
@@ -130,35 +130,80 @@ public:
    */
   gfxMatrix GetClipPathTransform(nsIFrame* aClippedFrame);
 
- private:
-  // A helper class to allow us to paint clip paths safely. The helper
-  // automatically sets and clears the mInUse flag on the clip path frame
-  // (to prevent nasty reference loops). It's easy to mess this up
-  // and break things, so this helper makes the code far more robust.
-  class MOZ_RAII AutoClipPathReferencer
-  {
-  public:
-    explicit AutoClipPathReferencer(nsSVGClipPathFrame *aFrame
-                                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
-       : mFrame(aFrame) {
-      MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-      NS_ASSERTION(!mFrame->mInUse, "reference loop!");
-      mFrame->mInUse = true;
-    }
-    ~AutoClipPathReferencer() {
-      mFrame->mInUse = false;
-    }
-  private:
-    nsSVGClipPathFrame *mFrame;
-    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
-  };
-
-  gfxMatrix mMatrixForChildren;
-  // recursion prevention flag
-  bool mInUse;
+private:
 
   // nsSVGContainerFrame methods:
   virtual gfxMatrix GetCanvasTM() override;
+
+  /**
+   * SVG content may contain reference loops where an SVG effect (a clipPath,
+   * say) may reference itself (directly or indirectly via a reference chain).
+   * This helper class allows us to detect and break such reference loops when
+   * applying an effect so that we can safely do so without the reference loop
+   * causing us to recurse until we run out of stack space and crash.
+   * The helper automatically sets and clears the mInUse flag on the frame.
+   */
+  class MOZ_RAII AutoReferenceLoopDetector
+  {
+  public:
+    explicit AutoReferenceLoopDetector()
+       : mFrame(nullptr)
+#ifdef DEBUG
+       , mMarkAsInUseCalled(false)
+#endif
+    {}
+
+    ~AutoReferenceLoopDetector() {
+      MOZ_ASSERT(mMarkAsInUseCalled,
+                 "Instances of this class are useless if MarkAsInUse() is "
+                 "not called on them");
+      if (mFrame) {
+        mFrame->mInUse = false;
+      }
+    }
+
+    /**
+     * Returns true on success (no reference loop), else returns false on
+     * failure (aFrame is already in use; that is, there is a reference loop).
+     */
+    MOZ_WARN_UNUSED_RESULT bool MarkAsInUse(nsSVGClipPathFrame* aFrame) {
+#ifdef DEBUG
+      MOZ_ASSERT(!mMarkAsInUseCalled, "Must only be called once");
+      mMarkAsInUseCalled = true;
+#endif
+      if (aFrame->mInUse) {
+        // XXX This is an error in the document, not in Mozilla code, so stop
+        // using NS_WARNING and send a message to the console instead.
+        NS_WARNING("clipPath reference loop!");
+        return false;
+      }
+      aFrame->mInUse = true;
+      mFrame = aFrame;
+      return true;
+    }
+
+  private:
+    nsSVGClipPathFrame* mFrame;
+    DebugOnly mMarkAsInUseCalled;
+  };
+
+  // Set, during a GetClipMask() call, to the transform that still needs to be
+  // concatenated to the transform of the DrawTarget that was passed to
+  // GetClipMask in order to establish the coordinate space that the clipPath
+  // establishes for its contents (i.e. including applying 'clipPathUnits' and
+  // any 'transform' attribute set on the clipPath) specifically for clipping
+  // the frame that was passed to GetClipMask at that moment in time.  This is
+  // set so that if our GetCanvasTM method is called while GetClipMask is
+  // painting its children, the returned matrix will include the transforms
+  // that should be used when creating the mask for the frame passed to
+  // GetClipMask.
+  //
+  // Note: The removal of GetCanvasTM is nearly complete, so our GetCanvasTM
+  // may not even be called soon/any more.
+  gfxMatrix mMatrixForChildren;
+
+  // Flag used by AutoReferenceLoopDetector to protect against reference loops:
+  bool mInUse;
 };
 
 #endif
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index 018681f4ca..5db13716d5 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2663,6 +2663,9 @@ pref("layout.css.float-logical-values.enabled", false);
 // Is support for the CSS4 image-orientation property enabled?
 pref("layout.css.image-orientation.enabled", true);
 
+// Is support for the font-display @font-face descriptor enabled?
+pref("layout.css.font-display.enabled", false);
+
 // Are sets of prefixed properties supported?
 pref("layout.css.prefixes.border-image", true);
 pref("layout.css.prefixes.transforms", true);
@@ -5444,9 +5447,6 @@ pref("dom.fetch.enabled", true);
 // Add Mozilla AudioChannel APIs.
 pref("media.useAudioChannelAPI", false);
 
-// Turn rewriting of youtube embeds on/off
-pref("plugins.rewrite_youtube_embeds", true);
-
 // Expose Request.cache. Currently disabled since the implementation is incomplete.
 pref("dom.requestcache.enabled", false);
 
@@ -5455,7 +5455,14 @@ pref("dom.requestcontext.enabled", false);
 
 pref("dom.mozKillSwitch.enabled", false);
 
+pref("toolkit.pageThumbs.screenSizeDivisor", 7);
+pref("toolkit.pageThumbs.minWidth", 0);
+pref("toolkit.pageThumbs.minHeight", 0);
+
 // Allow customization of the fallback directory for file uploads
 pref("dom.input.fallbackUploadDir", "");
 
+// Turn rewriting of youtube embeds on/off
+pref("plugins.rewrite_youtube_embeds", true);
+
 pref("devtools.serviceWorkers.testing.enabled", false);
diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp
index ad9a5d21ed..3fbb127092 100644
--- a/netwerk/system/win32/nsNotifyAddrListener.cpp
+++ b/netwerk/system/win32/nsNotifyAddrListener.cpp
@@ -47,6 +47,10 @@ static decltype(CancelMibChangeNotify2)* sCancelMibChangeNotify2;
 
 #define NETWORK_NOTIFY_CHANGED_PREF "network.notify.changed"
 
+// period during which to absorb subsequent network change events, in
+// milliseconds
+static const unsigned int kNetworkChangeCoalescingPeriod  = 1000;
+
 static void InitIphlpapi(void)
 {
     if (!sIphlpapi) {
@@ -98,9 +102,11 @@ nsNotifyAddrListener::nsNotifyAddrListener()
     : mLinkUp(true)  // assume true by default
     , mStatusKnown(false)
     , mCheckAttempted(false)
-    , mShutdownEvent(nullptr)
+    , mCheckEvent(nullptr)
+    , mShutdown(false)
     , mIPInterfaceChecksum(0)
     , mAllowChangedEvent(true)
+    , mCoalescingActive(false)
 {
     InitIphlpapi();
 }
@@ -149,12 +155,30 @@ static void WINAPI OnInterfaceChange(PVOID callerContext,
     notify->CheckLinkStatus();
 }
 
+DWORD
+nsNotifyAddrListener::nextCoalesceWaitTime()
+{
+    // check if coalescing period should continue
+    double period = (TimeStamp::Now() - mChangeTime).ToMilliseconds();
+    if (period >= kNetworkChangeCoalescingPeriod) {
+        SendEvent(NS_NETWORK_LINK_DATA_CHANGED);
+        mCoalescingActive = false;
+        return INFINITE; // return default
+    } else {
+        // wait no longer than to the end of the period
+        return static_cast
+            (kNetworkChangeCoalescingPeriod - period);
+    }
+}
+
 NS_IMETHODIMP
 nsNotifyAddrListener::Run()
 {
     PR_SetCurrentThreadName("Link Monitor");
 
-    mChangedTime = TimeStamp::Now();
+    mStartTime = TimeStamp::Now();
+
+    DWORD waitTime = INFINITE;
 
     if (!sNotifyIpInterfaceChange || !sCancelMibChangeNotify2) {
         // For Windows versions which are older than Vista which lack
@@ -162,7 +186,7 @@ nsNotifyAddrListener::Run()
         HANDLE ev = CreateEvent(nullptr, FALSE, FALSE, nullptr);
         NS_ENSURE_TRUE(ev, NS_ERROR_OUT_OF_MEMORY);
 
-        HANDLE handles[2] = { ev, mShutdownEvent };
+        HANDLE handles[2] = { ev, mCheckEvent };
         OVERLAPPED overlapped = { 0 };
         bool shuttingDown = false;
 
@@ -172,9 +196,11 @@ nsNotifyAddrListener::Run()
             DWORD ret = NotifyAddrChange(&h, &overlapped);
 
             if (ret == ERROR_IO_PENDING) {
-                ret = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
+                ret = WaitForMultipleObjects(2, handles, FALSE, waitTime);
                 if (ret == WAIT_OBJECT_0) {
                     CheckLinkStatus();
+                } else if (!mShutdown) {
+                    waitTime = nextCoalesceWaitTime();
                 } else {
                     shuttingDown = true;
                 }
@@ -195,9 +221,20 @@ nsNotifyAddrListener::Run()
             &interfacechange);
 
         if (ret == NO_ERROR) {
-            ret = WaitForSingleObject(mShutdownEvent, INFINITE);
+            do {
+                ret = WaitForSingleObject(mCheckEvent, waitTime);
+                if (!mShutdown) {
+                    waitTime = nextCoalesceWaitTime();
+                }
+                else {
+                    break;
+                }
+            } while (ret != WAIT_FAILED);
+            sCancelMibChangeNotify2(interfacechange);
+        } else {
+            LOG(("Link Monitor: sNotifyIpInterfaceChange returned %d\n",
+                 (int)ret));
         }
-        sCancelMibChangeNotify2(interfacechange);
     }
     return NS_OK;
 }
@@ -228,8 +265,8 @@ nsNotifyAddrListener::Init(void)
     Preferences::AddBoolVarCache(&mAllowChangedEvent,
                                  NETWORK_NOTIFY_CHANGED_PREF, true);
 
-    mShutdownEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
-    NS_ENSURE_TRUE(mShutdownEvent, NS_ERROR_OUT_OF_MEMORY);
+    mCheckEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
+    NS_ENSURE_TRUE(mCheckEvent, NS_ERROR_OUT_OF_MEMORY);
 
     rv = NS_NewThread(getter_AddRefs(mThread), this);
     NS_ENSURE_SUCCESS(rv, rv);
@@ -246,24 +283,46 @@ nsNotifyAddrListener::Shutdown(void)
     if (observerService)
         observerService->RemoveObserver(this, "xpcom-shutdown-threads");
 
-    if (!mShutdownEvent)
+    if (!mCheckEvent)
         return NS_OK;
 
-    SetEvent(mShutdownEvent);
+    mShutdown = true;
+    SetEvent(mCheckEvent);
 
-    nsresult rv = mThread->Shutdown();
+    nsresult rv = mThread ? mThread->Shutdown() : NS_OK;
 
     // Have to break the cycle here, otherwise nsNotifyAddrListener holds
     // onto the thread and the thread holds onto the nsNotifyAddrListener
     // via its mRunnable
     mThread = nullptr;
 
-    CloseHandle(mShutdownEvent);
-    mShutdownEvent = nullptr;
+    CloseHandle(mCheckEvent);
+    mCheckEvent = nullptr;
 
     return rv;
 }
 
+/*
+ * A network event has been registered. Delay the actual sending of the event
+ * for a while and absorb subsequent events in the mean time in an effort to
+ * squash potentially many triggers into a single event.
+ * Only ever called from the same thread.
+ */
+nsresult
+nsNotifyAddrListener::NetworkChanged()
+{
+    if (mCoalescingActive) {
+        LOG(("NetworkChanged: absorbed an event (coalescing active)\n"));
+    } else {
+        // A fresh trigger!
+        mChangeTime = TimeStamp::Now();
+        mCoalescingActive = true;
+        SetEvent(mCheckEvent);
+        LOG(("NetworkChanged: coalescing period started\n"));
+    }
+    return NS_OK;
+}
+
 /* Sends the given event.  Assumes aEventID never goes out of scope (static
  * strings are ideal).
  */
@@ -514,12 +573,12 @@ nsNotifyAddrListener::CheckLinkStatus(void)
         }
 
         if (mLinkUp && (prevCsum != mIPInterfaceChecksum)) {
-            TimeDuration since = TimeStamp::Now() - mChangedTime;
+            TimeDuration since = TimeStamp::Now() - mStartTime;
 
             // Network is online. Topology has changed. Always send CHANGED
             // before UP - if allowed to and having cooled down.
             if (mAllowChangedEvent && (since.ToMilliseconds() > 2000)) {
-                SendEvent(NS_NETWORK_LINK_DATA_CHANGED);
+                NetworkChanged();
             }
         }
         if (prevLinkUp != mLinkUp) {
diff --git a/netwerk/system/win32/nsNotifyAddrListener.h b/netwerk/system/win32/nsNotifyAddrListener.h
index 4a0f383e18..8ef6650b3e 100644
--- a/netwerk/system/win32/nsNotifyAddrListener.h
+++ b/netwerk/system/win32/nsNotifyAddrListener.h
@@ -60,18 +60,33 @@ protected:
 
     nsCOMPtr mThread;
 
-    HANDLE        mShutdownEvent;
-
 private:
+    // Returns the new timeout period for coalescing (or INFINITE)
+    DWORD nextCoalesceWaitTime();
+
+    // Called for every detected network change
+    nsresult NetworkChanged();
+
+    HANDLE mCheckEvent;
+
+    // set true when mCheckEvent means shutdown
+    bool mShutdown;
+
     // This is a checksum of various meta data for all network interfaces
     // considered UP at last check.
     ULONG mIPInterfaceChecksum;
 
-    // time of the last sent changed event
-    mozilla::TimeStamp mChangedTime;
+    // start time of the checking
+    mozilla::TimeStamp mStartTime;
 
     // Network changed events are enabled
     bool mAllowChangedEvent;
+
+    // Flag set while coalescing change events
+    bool mCoalescingActive;
+
+    // Time stamp for first event during coalescing
+    mozilla::TimeStamp mChangeTime;
 };
 
 #endif /* NSNOTIFYADDRLISTENER_H_ */
diff --git a/storage/mozStorageStatement.cpp b/storage/mozStorageStatement.cpp
index 109554eaa1..220e8fa150 100644
--- a/storage/mozStorageStatement.cpp
+++ b/storage/mozStorageStatement.cpp
@@ -545,6 +545,8 @@ Statement::Reset()
 NS_IMETHODIMP
 Statement::BindParameters(mozIStorageBindingParamsArray *aParameters)
 {
+  NS_ENSURE_ARG_POINTER(aParameters);
+
   if (!mDBStatement)
     return NS_ERROR_NOT_INITIALIZED;
 
diff --git a/storage/test/unit/test_storage_statement.js b/storage/test/unit/test_storage_statement.js
index be030d4158..221a8d0664 100644
--- a/storage/test/unit/test_storage_statement.js
+++ b/storage/test/unit/test_storage_statement.js
@@ -165,6 +165,16 @@ function test_failed_execute()
   stmt.finalize();
 }
 
+function test_bind_undefined()
+{
+  var stmt = createStatement("INSERT INTO test (name) VALUES ('foo')");
+
+  expectError(Cr.NS_ERROR_ILLEGAL_VALUE,
+              () => stmt.bindParameters(undefined));
+
+  stmt.finalize();
+}
+
 var tests = [test_parameterCount_none, test_parameterCount_one,
              test_getParameterName, test_getParameterIndex_different,
              test_getParameterIndex_same, test_columnCount,
@@ -173,6 +183,7 @@ var tests = [test_parameterCount_none, test_parameterCount_one,
              test_state_executing, test_state_after_finalize,
              test_getColumnDecltype,
              test_failed_execute,
+             test_bind_undefined,
 ];
 
 function run_test()
diff --git a/testing/web-platform/meta/IndexedDB/keypath.htm.ini b/testing/web-platform/meta/IndexedDB/keypath.htm.ini
deleted file mode 100644
index 511ccc70a1..0000000000
--- a/testing/web-platform/meta/IndexedDB/keypath.htm.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[keypath.htm]
-  type: testharness
-  [Keypath - str.length]
-    expected: FAIL
-
-  [Keypath - length]
-    expected: FAIL
-
diff --git a/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-request-resources.https.html b/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-request-resources.https.html
index 6affec9761..1ae5172294 100644
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-request-resources.https.html
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/fetch-request-resources.https.html
@@ -109,12 +109,12 @@ async_test(function(t) {
       .then(function(f) {
         frame = f;
 
-        // TODO: Disable 'no-cors' tests for image and stylesheet until
+        // TODO: Disable 'no-cors' tests for image until
         //       AsyncOpen2 and cookie policy is supported.
         // image_test(f, LOCAL_URL, '', 'no-cors', 'include');
         // image_test(f, REMOTE_URL, '', 'no-cors', 'include');
-        // css_test(f, LOCAL_URL, '', 'no-cors', 'include');
-        // css_test(f, REMOTE_URL, '', 'no-cors', 'include');
+        css_test(f, LOCAL_URL, '', 'no-cors', 'include');
+        css_test(f, REMOTE_URL, '', 'no-cors', 'include');
 
         image_test(f, LOCAL_URL, 'anonymous', 'cors', 'same-origin');
         image_test(f, LOCAL_URL, 'use-credentials', 'cors', 'include');
@@ -130,7 +130,7 @@ async_test(function(t) {
 
         css_test(f, LOCAL_URL, 'anonymous', 'cors', 'same-origin');
         css_test(f, LOCAL_URL, 'use-credentials', 'cors', 'include');
-        css_test(f, REMOTE_URL, 'anonymous', 'cors', 'omit');
+        css_test(f, REMOTE_URL, 'anonymous', 'cors', 'same-origin');
         css_test(f, REMOTE_URL, 'use-credentials', 'cors', 'include');
 
         font_face_test(f, LOCAL_URL, 'cors', 'same-origin');
diff --git a/toolkit/.eslintrc b/toolkit/.eslintrc
index 402c0f3593..8d14186b98 100644
--- a/toolkit/.eslintrc
+++ b/toolkit/.eslintrc
@@ -62,7 +62,7 @@
     "no-duplicate-case": 2,
 
     // No labels
-    // "no-labels": 2,
+    "no-labels": 2,
 
     // If an if block ends with a return no need for an else block
     // "no-else-return": 2,
@@ -86,7 +86,7 @@
     // "no-extra-semi": 2,
 
     // No overwriting defined functions
-    // "no-func-assign": 2,
+    "no-func-assign": 2,
 
     // No invalid regular expresions
     // "no-invalid-regexp": 2,
@@ -104,10 +104,10 @@
     // "no-multi-spaces": [2, { exceptions: { "AssignmentExpression": true, "VariableDeclarator": true, "ArrayExpression": true, "ObjectExpression": true } }],
 
     // No reassigning native JS objects
-    // "no-native-reassign": 2,
+    "no-native-reassign": 2,
 
     // No (!foo in bar)
-    // "no-negated-in-lhs": 2,
+    "no-negated-in-lhs": 2,
 
     // Nested ternary statements are confusing
     // "no-nested-ternary": 2,
@@ -137,7 +137,7 @@
     // "no-spaced-func": 2,
 
     // No trailing whitespace
-    // "no-trailing-spaces": 2,
+    "no-trailing-spaces": 2,
 
     // No using undeclared variables
     // "no-undef": 2,
diff --git a/toolkit/components/alerts/test/test_alerts.html b/toolkit/components/alerts/test/test_alerts.html
index 0ef92a5044..b6d4a9fe24 100644
--- a/toolkit/components/alerts/test/test_alerts.html
+++ b/toolkit/components/alerts/test/test_alerts.html
@@ -52,7 +52,7 @@ function runTest() {
                getService(Ci.nsIAlertsService);
     ok(true, "Alerts service is available");
   } catch (ex) {
-    todo(false, 
+    todo(false,
          "Alerts service is not available.", ex);
     return;
   }
diff --git a/toolkit/components/asyncshutdown/AsyncShutdown.jsm b/toolkit/components/asyncshutdown/AsyncShutdown.jsm
index 1477ff2d82..9e44b71c9e 100644
--- a/toolkit/components/asyncshutdown/AsyncShutdown.jsm
+++ b/toolkit/components/asyncshutdown/AsyncShutdown.jsm
@@ -178,7 +178,7 @@ PromiseSet.prototype = {
     if (!key || typeof key != "object") {
       throw new Error("Expected an object");
     }
-    if ((!"then" in key) || typeof key.then != "function") {
+    if ((!("then" in key)) || typeof key.then != "function") {
       throw new Error("Expected a Promise");
     }
   },
diff --git a/toolkit/components/autocomplete/nsAutoCompleteController.cpp b/toolkit/components/autocomplete/nsAutoCompleteController.cpp
index fb3d006b9c..55ead98250 100644
--- a/toolkit/components/autocomplete/nsAutoCompleteController.cpp
+++ b/toolkit/components/autocomplete/nsAutoCompleteController.cpp
@@ -1386,7 +1386,7 @@ nsAutoCompleteController::EnterMatch(bool aIsPopupSelection)
         value = defaultIndexValue;
     }
 
-    if (forceComplete && value.IsEmpty()) {
+    if (forceComplete && value.IsEmpty() && shouldComplete) {
       // See if inputValue is one of the autocomplete results. It can be an
       // identical value, or if it matched the middle of a result it can be
       // something like "bar >> foobar" (user entered bar and foobar is
@@ -1405,34 +1405,39 @@ nsAutoCompleteController::EnterMatch(bool aIsPopupSelection)
         suggestedValue = inputValue;
       }
 
-      nsAutoString defaultValue;
       for (uint32_t i = 0; i < mResults.Length(); ++i) {
         nsIAutoCompleteResult *result = mResults[i];
         if (result) {
-          if (defaultValue.IsEmpty()) {
-            int32_t defaultIndex;
-            result->GetDefaultIndex(&defaultIndex);
-            if (defaultIndex >= 0) {
-              result->GetFinalCompleteValueAt(defaultIndex, defaultValue);
-            }
-          }
-
           uint32_t matchCount = 0;
           result->GetMatchCount(&matchCount);
           for (uint32_t j = 0; j < matchCount; ++j) {
             nsAutoString matchValue;
-            result->GetFinalCompleteValueAt(j, matchValue);
+            result->GetValueAt(j, matchValue);
             if (suggestedValue.Equals(matchValue, nsCaseInsensitiveStringComparator())) {
-              value = matchValue;
+              nsAutoString finalMatchValue;
+              result->GetFinalCompleteValueAt(j, finalMatchValue);
+              value = finalMatchValue;
               break;
             }
           }
         }
       }
-      if (value.IsEmpty()) {
-        // Since nothing was selected, and forceComplete is specified, that means
-        // we have to enter the first default match instead.
-        value = defaultValue;
+      // The value should have been set at this point. If not, then it's not
+      // a value that should be autocompleted.
+    }
+    else if (forceComplete && value.IsEmpty() && completeSelection) {
+      // Since nothing was selected, and forceComplete is specified, that means
+      // we have to find the first default match and enter it instead.
+      for (uint32_t i = 0; i < mResults.Length(); ++i) {
+        nsIAutoCompleteResult *result = mResults[i];
+        if (result) {
+          int32_t defaultIndex;
+          result->GetDefaultIndex(&defaultIndex);
+          if (defaultIndex >= 0) {
+            result->GetFinalCompleteValueAt(defaultIndex, value);
+            break;
+          }
+        }
       }
     }
   }
@@ -1808,6 +1813,7 @@ nsAutoCompleteController::CompleteValue(nsString &aValue)
  * contained in mSearchString. */
 {
   MOZ_ASSERT(mInput, "Must have a valid input");
+
   nsCOMPtr input(mInput);
   const int32_t mSearchStringLength = mSearchString.Length();
   int32_t endSelect = aValue.Length();  // By default, select all of aValue.
diff --git a/toolkit/components/autocomplete/tests/unit/head_autocomplete.js b/toolkit/components/autocomplete/tests/unit/head_autocomplete.js
index 2de56eb9fe..79d84ef71c 100644
--- a/toolkit/components/autocomplete/tests/unit/head_autocomplete.js
+++ b/toolkit/components/autocomplete/tests/unit/head_autocomplete.js
@@ -3,28 +3,28 @@
 
 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
 
-const Cc = Components.classes;
-const Ci = Components.interfaces;
+var Cc = Components.classes;
+var Ci = Components.interfaces;
 
 /**
  * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names. 
- * 
+ * the given list of AutoCompleteSearch names.
+ *
  * Implements only the methods needed for this test.
  */
 function AutoCompleteInputBase(aSearches) {
   this.searches = aSearches;
 }
 AutoCompleteInputBase.prototype = {
- 
+
   // Array of AutoCompleteSearch names
   searches: null,
-  
+
   minResultsForPopup: 0,
   timeout: 10,
   searchParam: "",
   textValue: "",
-  disableAutoComplete: false,  
+  disableAutoComplete: false,
   completeDefaultIndex: false,
 
   // Text selection range
@@ -40,40 +40,39 @@ AutoCompleteInputBase.prototype = {
     this._selStart = aStart;
     this._selEnd = aEnd;
   },
-  
+
   get searchCount() {
     return this.searches.length;
   },
-  
+
   getSearchAt: function(aIndex) {
     return this.searches[aIndex];
   },
-  
+
   onSearchBegin: function() {},
   onSearchComplete: function() {},
-  
-  popupOpen: false,  
-  
-  popup: { 
-    selectedIndex: 0,
-    invalidate: function() {},
 
-    // nsISupports implementation
-    QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompletePopup])   
+  popupOpen: false,
+
+  get popup() {
+    if (!this._popup) {
+      this._popup = new AutocompletePopupBase(this);
+    }
+    return this._popup;
   },
-    
+
   // nsISupports implementation
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteInput])
 }
 
-/** 
+/**
  * nsIAutoCompleteResult implementation
  */
 function AutoCompleteResultBase(aValues) {
   this._values = aValues;
 }
 AutoCompleteResultBase.prototype = {
-  
+
   // Arrays
   _values: null,
   _comments: [],
@@ -82,9 +81,9 @@ AutoCompleteResultBase.prototype = {
 
   searchString: "",
   searchResult: null,
-  
+
   defaultIndex: -1,
-  
+
   _typeAheadResult: false,
   get typeAheadResult() {
     return this._typeAheadResult;
@@ -101,15 +100,15 @@ AutoCompleteResultBase.prototype = {
   getLabelAt: function(aIndex) {
     return this.getValueAt(aIndex);
   },
-  
+
   getCommentAt: function(aIndex) {
     return this._comments[aIndex];
   },
-  
+
   getStyleAt: function(aIndex) {
     return this._styles[aIndex];
   },
-  
+
   getImageAt: function(aIndex) {
     return "";
   },
@@ -124,7 +123,7 @@ AutoCompleteResultBase.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteResult])
 }
 
-/** 
+/**
  * nsIAutoCompleteSearch implementation that always returns
  * the same result set.
  */
@@ -133,36 +132,36 @@ function AutoCompleteSearchBase(aName, aResult) {
   this._result = aResult;
 }
 AutoCompleteSearchBase.prototype = {
-  
+
   // Search name. Used by AutoCompleteController
   name: null,
 
   // AutoCompleteResult
   _result: null,
 
-  startSearch: function(aSearchString, 
-                        aSearchParam, 
-                        aPreviousResult, 
+  startSearch: function(aSearchString,
+                        aSearchParam,
+                        aPreviousResult,
                         aListener) {
     var result = this._result;
 
     result.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS;
     aListener.onSearchResult(this, result);
   },
-  
+
   stopSearch: function() {},
 
   // nsISupports implementation
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory,
                                          Ci.nsIAutoCompleteSearch]),
-  
+
   // nsIFactory implementation
   createInstance: function(outer, iid) {
     return this.QueryInterface(iid);
   }
 }
 
-/** 
+/**
  * Helper to register an AutoCompleteSearch with the given name.
  * Allows the AutoCompleteController to find the search.
  */
@@ -178,15 +177,15 @@ function registerAutoCompleteSearch(aSearch) {
   componentManager.registerFactory(cid, desc, name, aSearch);
 
   // Keep the id on the object so we can unregister later
-  aSearch.cid = cid; 
+  aSearch.cid = cid;
 }
 
-/** 
- * Helper to unregister an AutoCompleteSearch. 
+/**
+ * Helper to unregister an AutoCompleteSearch.
  */
 function unregisterAutoCompleteSearch(aSearch) {
   var componentManager = Components.manager
-                                   .QueryInterface(Ci.nsIComponentRegistrar);  
+                                   .QueryInterface(Ci.nsIComponentRegistrar);
   componentManager.unregisterFactory(aSearch.cid, aSearch);
 }
 
diff --git a/toolkit/components/autocomplete/tests/unit/test_378079.js b/toolkit/components/autocomplete/tests/unit/test_378079.js
index 75510980a4..ad7e5590f2 100644
--- a/toolkit/components/autocomplete/tests/unit/test_378079.js
+++ b/toolkit/components/autocomplete/tests/unit/test_378079.js
@@ -13,40 +13,40 @@
 
 /**
  * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names. 
- * 
+ * the given list of AutoCompleteSearch names.
+ *
  * Implements only the methods needed for this test.
  */
 function AutoCompleteInput(aSearches) {
   this.searches = aSearches;
 }
 AutoCompleteInput.prototype = {
-  constructor: AutoCompleteInput, 
-  
+  constructor: AutoCompleteInput,
+
   // Array of AutoCompleteSearch names
   searches: null,
-  
+
   minResultsForPopup: 0,
   timeout: 10,
   searchParam: "",
   textValue: "",
-  disableAutoComplete: false,  
+  disableAutoComplete: false,
   completeDefaultIndex: false,
-  
+
   get searchCount() {
     return this.searches.length;
   },
-  
+
   getSearchAt: function(aIndex) {
     return this.searches[aIndex];
   },
-  
+
   onSearchBegin: function() {},
   onSearchComplete: function() {},
-  
-  popupOpen: false,  
-  
-  popup: { 
+
+  popupOpen: false,
+
+  popup: {
     setSelectedIndex: function(aIndex) {},
     invalidate: function() {},
 
@@ -57,9 +57,9 @@ AutoCompleteInput.prototype = {
         return this;
 
       throw Components.results.NS_ERROR_NO_INTERFACE;
-    }    
+    }
   },
-    
+
   // nsISupports implementation
   QueryInterface: function(iid) {
     if (iid.equals(Ci.nsISupports) ||
@@ -72,14 +72,14 @@ AutoCompleteInput.prototype = {
 
 
 
-/** 
+/**
  * nsIAutoCompleteResult implementation
  */
 function AutoCompleteResult(aValues, aComments, aStyles) {
   this._values = aValues;
   this._comments = aComments;
   this._styles = aStyles;
-  
+
   if (this._values.length > 0) {
     this.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS;
   } else {
@@ -88,15 +88,15 @@ function AutoCompleteResult(aValues, aComments, aStyles) {
 }
 AutoCompleteResult.prototype = {
   constructor: AutoCompleteResult,
-  
+
   // Arrays
   _values: null,
   _comments: null,
   _styles: null,
-  
+
   searchString: "",
   searchResult: null,
-  
+
   defaultIndex: 0,
 
   get matchCount() {
@@ -106,19 +106,19 @@ AutoCompleteResult.prototype = {
   getValueAt: function(aIndex) {
     return this._values[aIndex];
   },
- 
+
   getLabelAt: function(aIndex) {
     return this.getValueAt(aIndex);
   },
-  
+
   getCommentAt: function(aIndex) {
     return this._comments[aIndex];
   },
-  
+
   getStyleAt: function(aIndex) {
     return this._styles[aIndex];
   },
-  
+
   getImageAt: function(aIndex) {
     return "";
   },
@@ -136,12 +136,12 @@ AutoCompleteResult.prototype = {
       return this;
 
     throw Components.results.NS_ERROR_NO_INTERFACE;
-  }  
+  }
 }
 
 
 
-/** 
+/**
  * nsIAutoCompleteSearch implementation that always returns
  * the same result set.
  */
@@ -151,25 +151,25 @@ function AutoCompleteSearch(aName, aResult) {
 }
 AutoCompleteSearch.prototype = {
   constructor: AutoCompleteSearch,
-  
+
   // Search name. Used by AutoCompleteController
   name: null,
 
   // AutoCompleteResult
-  _result:null,  
-  
-  
+  _result:null,
+
+
   /**
    * Return the same result set for every search
    */
-  startSearch: function(aSearchString, 
-                        aSearchParam, 
-                        aPreviousResult, 
-                        aListener) 
+  startSearch: function(aSearchString,
+                        aSearchParam,
+                        aPreviousResult,
+                        aListener)
   {
     aListener.onSearchResult(this, this._result);
   },
-  
+
   stopSearch: function() {},
 
   // nsISupports implementation
@@ -181,7 +181,7 @@ AutoCompleteSearch.prototype = {
 
     throw Components.results.NS_ERROR_NO_INTERFACE;
   },
-  
+
   // nsIFactory implementation
   createInstance: function(outer, iid) {
     return this.QueryInterface(iid);
@@ -190,7 +190,7 @@ AutoCompleteSearch.prototype = {
 
 
 
-/** 
+/**
  * Helper to register an AutoCompleteSearch with the given name.
  * Allows the AutoCompleteController to find the search.
  */
@@ -202,49 +202,49 @@ function registerAutoCompleteSearch(aSearch) {
   var cid = uuidGenerator.generateUUID();
 
   var desc = "Test AutoCompleteSearch";
-  
+
   var componentManager = Components.manager
                                    .QueryInterface(Ci.nsIComponentRegistrar);
   componentManager.registerFactory(cid, desc, name, aSearch);
 
   // Keep the id on the object so we can unregister later
-  aSearch.cid = cid; 
+  aSearch.cid = cid;
 }
 
 
 
-/** 
- * Helper to unregister an AutoCompleteSearch. 
+/**
+ * Helper to unregister an AutoCompleteSearch.
  */
 function unregisterAutoCompleteSearch(aSearch) {
   var componentManager = Components.manager
-                                   .QueryInterface(Ci.nsIComponentRegistrar);  
+                                   .QueryInterface(Ci.nsIComponentRegistrar);
   componentManager.unregisterFactory(aSearch.cid, aSearch);
 }
 
 
 
-/** 
+/**
  * Test AutoComplete with multiple AutoCompleteSearch sources.
  */
 function run_test() {
-  
+
   // Make an AutoCompleteSearch that always returns nothing
-  var emptySearch = new AutoCompleteSearch("test-empty-search", 
+  var emptySearch = new AutoCompleteSearch("test-empty-search",
                              new AutoCompleteResult([], [], []));
-  
+
   // Make an AutoCompleteSearch that returns two values
   var expectedValues = ["test1", "test2"];
   var regularSearch = new AutoCompleteSearch("test-regular-search",
                              new AutoCompleteResult(expectedValues, [], []));
-  
+
   // Register searches so AutoCompleteController can find them
   registerAutoCompleteSearch(emptySearch);
   registerAutoCompleteSearch(regularSearch);
-    
+
   var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
-                   getService(Components.interfaces.nsIAutoCompleteController);  
-  
+                   getService(Components.interfaces.nsIAutoCompleteController);
+
   // Make an AutoCompleteInput that uses our searches
   // and confirms results on search complete
   var input = new AutoCompleteInput([emptySearch.name, regularSearch.name]);
@@ -259,13 +259,13 @@ function run_test() {
 
     do_check_eq(numSearchesStarted, 1);
 
-    do_check_eq(controller.searchStatus, 
+    do_check_eq(controller.searchStatus,
                 Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
     do_check_eq(controller.matchCount, 2);
 
     // Confirm expected result values
     for (var i = 0; i < expectedValues.length; i++) {
-      do_check_eq(expectedValues[i], controller.getValueAt(i)); 
+      do_check_eq(expectedValues[i], controller.getValueAt(i));
     }
 
     // Unregister searches
@@ -279,7 +279,7 @@ function run_test() {
 
   // Search is asynchronous, so don't let the test finish immediately
   do_test_pending();
-  
+
   controller.startSearch("test");
 }
 
diff --git a/toolkit/components/autocomplete/tests/unit/test_393191.js b/toolkit/components/autocomplete/tests/unit/test_393191.js
index 30c782e717..6fb57e6c4a 100644
--- a/toolkit/components/autocomplete/tests/unit/test_393191.js
+++ b/toolkit/components/autocomplete/tests/unit/test_393191.js
@@ -12,40 +12,40 @@
 
 /**
  * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names. 
- * 
+ * the given list of AutoCompleteSearch names.
+ *
  * Implements only the methods needed for this test.
  */
 function AutoCompleteInput(aSearches) {
   this.searches = aSearches;
 }
 AutoCompleteInput.prototype = {
-  constructor: AutoCompleteInput, 
-  
+  constructor: AutoCompleteInput,
+
   // Array of AutoCompleteSearch names
   searches: null,
-  
+
   minResultsForPopup: 0,
   timeout: 10,
   searchParam: "",
   textValue: "",
-  disableAutoComplete: false,  
+  disableAutoComplete: false,
   completeDefaultIndex: false,
-  
+
   get searchCount() {
     return this.searches.length;
   },
-  
+
   getSearchAt: function(aIndex) {
     return this.searches[aIndex];
   },
-  
+
   onSearchBegin: function() {},
   onSearchComplete: function() {},
-  
-  popupOpen: false,  
-  
-  popup: { 
+
+  popupOpen: false,
+
+  popup: {
     setSelectedIndex: function(aIndex) {},
     invalidate: function() {},
 
@@ -56,9 +56,9 @@ AutoCompleteInput.prototype = {
         return this;
 
       throw Components.results.NS_ERROR_NO_INTERFACE;
-    }    
+    }
   },
-    
+
   // nsISupports implementation
   QueryInterface: function(iid) {
     if (iid.equals(Ci.nsISupports) ||
@@ -71,14 +71,14 @@ AutoCompleteInput.prototype = {
 
 
 
-/** 
+/**
  * nsIAutoCompleteResult implementation
  */
 function AutoCompleteResult(aValues, aComments, aStyles) {
   this._values = aValues;
   this._comments = aComments;
   this._styles = aStyles;
-  
+
   if (this._values.length > 0) {
     this.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS;
   } else {
@@ -87,15 +87,15 @@ function AutoCompleteResult(aValues, aComments, aStyles) {
 }
 AutoCompleteResult.prototype = {
   constructor: AutoCompleteResult,
-  
+
   // Arrays
   _values: null,
   _comments: null,
   _styles: null,
-  
+
   searchString: "",
   searchResult: null,
-  
+
   defaultIndex: 0,
 
   get matchCount() {
@@ -109,15 +109,15 @@ AutoCompleteResult.prototype = {
   getLabelAt: function(aIndex) {
     return this.getValueAt(aIndex);
   },
-  
+
   getCommentAt: function(aIndex) {
     return this._comments[aIndex];
   },
-  
+
   getStyleAt: function(aIndex) {
     return this._styles[aIndex];
   },
-  
+
   getImageAt: function(aIndex) {
     return "";
   },
@@ -135,12 +135,12 @@ AutoCompleteResult.prototype = {
       return this;
 
     throw Components.results.NS_ERROR_NO_INTERFACE;
-  }  
+  }
 }
 
 
 
-/** 
+/**
  * nsIAutoCompleteSearch implementation that always returns
  * the same result set.
  */
@@ -150,25 +150,25 @@ function AutoCompleteSearch(aName, aResult) {
 }
 AutoCompleteSearch.prototype = {
   constructor: AutoCompleteSearch,
-  
+
   // Search name. Used by AutoCompleteController
   name: null,
 
   // AutoCompleteResult
   _result: null,
-  
-  
+
+
   /**
    * Return the same result set for every search
    */
-  startSearch: function(aSearchString, 
-                        aSearchParam, 
-                        aPreviousResult, 
-                        aListener) 
+  startSearch: function(aSearchString,
+                        aSearchParam,
+                        aPreviousResult,
+                        aListener)
   {
     aListener.onSearchResult(this, this._result);
   },
-  
+
   stopSearch: function() {},
 
   // nsISupports implementation
@@ -180,7 +180,7 @@ AutoCompleteSearch.prototype = {
 
     throw Components.results.NS_ERROR_NO_INTERFACE;
   },
-  
+
   // nsIFactory implementation
   createInstance: function(outer, iid) {
     return this.QueryInterface(iid);
@@ -189,7 +189,7 @@ AutoCompleteSearch.prototype = {
 
 
 
-/** 
+/**
  * Helper to register an AutoCompleteSearch with the given name.
  * Allows the AutoCompleteController to find the search.
  */
@@ -201,43 +201,43 @@ function registerAutoCompleteSearch(aSearch) {
   var cid = uuidGenerator.generateUUID();
 
   var desc = "Test AutoCompleteSearch";
-  
+
   var componentManager = Components.manager
                                    .QueryInterface(Ci.nsIComponentRegistrar);
   componentManager.registerFactory(cid, desc, name, aSearch);
 
   // Keep the id on the object so we can unregister later
-  aSearch.cid = cid; 
+  aSearch.cid = cid;
 }
 
 
 
-/** 
- * Helper to unregister an AutoCompleteSearch. 
+/**
+ * Helper to unregister an AutoCompleteSearch.
  */
 function unregisterAutoCompleteSearch(aSearch) {
   var componentManager = Components.manager
-                                   .QueryInterface(Ci.nsIComponentRegistrar);  
+                                   .QueryInterface(Ci.nsIComponentRegistrar);
   componentManager.unregisterFactory(aSearch.cid, aSearch);
 }
 
 
 
-/** 
+/**
  * Test AutoComplete with a search that returns a null result
  */
 function run_test() {
-  
+
   // Make an AutoCompleteSearch that always returns nothing
-  var emptySearch = new AutoCompleteSearch("test-empty-search", 
+  var emptySearch = new AutoCompleteSearch("test-empty-search",
                              new AutoCompleteResult([], [], []));
-  
+
   // Register search so AutoCompleteController can find them
   registerAutoCompleteSearch(emptySearch);
-    
+
   var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
-                   getService(Components.interfaces.nsIAutoCompleteController);  
-  
+                   getService(Components.interfaces.nsIAutoCompleteController);
+
   // Make an AutoCompleteInput that uses our search
   // and confirms results on search complete
   var input = new AutoCompleteInput([emptySearch.name]);
@@ -252,7 +252,7 @@ function run_test() {
 
     do_check_eq(numSearchesStarted, 1);
 
-    do_check_eq(controller.searchStatus, 
+    do_check_eq(controller.searchStatus,
                 Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH);
     do_check_eq(controller.matchCount, 0);
 
@@ -266,7 +266,7 @@ function run_test() {
 
   // Search is asynchronous, so don't let the test finish immediately
   do_test_pending();
-  
+
   controller.startSearch("test");
 }
 
diff --git a/toolkit/components/autocomplete/tests/unit/test_autocomplete_multiple.js b/toolkit/components/autocomplete/tests/unit/test_autocomplete_multiple.js
index 87c3dff7aa..b769836484 100644
--- a/toolkit/components/autocomplete/tests/unit/test_autocomplete_multiple.js
+++ b/toolkit/components/autocomplete/tests/unit/test_autocomplete_multiple.js
@@ -6,40 +6,40 @@
 
 /**
  * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names. 
- * 
+ * the given list of AutoCompleteSearch names.
+ *
  * Implements only the methods needed for this test.
  */
 function AutoCompleteInput(aSearches) {
   this.searches = aSearches;
 }
 AutoCompleteInput.prototype = {
-  constructor: AutoCompleteInput, 
-  
+  constructor: AutoCompleteInput,
+
   // Array of AutoCompleteSearch names
   searches: null,
-  
+
   minResultsForPopup: 0,
   timeout: 10,
   searchParam: "",
   textValue: "",
-  disableAutoComplete: false,  
+  disableAutoComplete: false,
   completeDefaultIndex: false,
-  
+
   get searchCount() {
     return this.searches.length;
   },
-  
+
   getSearchAt: function(aIndex) {
     return this.searches[aIndex];
   },
-  
+
   onSearchBegin: function() {},
   onSearchComplete: function() {},
-  
-  popupOpen: false,  
-  
-  popup: { 
+
+  popupOpen: false,
+
+  popup: {
     setSelectedIndex: function(aIndex) {},
     invalidate: function() {},
 
@@ -50,9 +50,9 @@ AutoCompleteInput.prototype = {
         return this;
 
       throw Components.results.NS_ERROR_NO_INTERFACE;
-    }    
+    }
   },
-    
+
   // nsISupports implementation
   QueryInterface: function(iid) {
     if (iid.equals(Ci.nsISupports) ||
@@ -65,7 +65,7 @@ AutoCompleteInput.prototype = {
 
 
 
-/** 
+/**
  * nsIAutoCompleteResult implementation
  */
 function AutoCompleteResult(aValues, aComments, aStyles) {
@@ -75,15 +75,15 @@ function AutoCompleteResult(aValues, aComments, aStyles) {
 }
 AutoCompleteResult.prototype = {
   constructor: AutoCompleteResult,
-  
+
   // Arrays
   _values: null,
   _comments: null,
   _styles: null,
-  
+
   searchString: "",
   searchResult: null,
-  
+
   defaultIndex: 0,
 
   get matchCount() {
@@ -97,15 +97,15 @@ AutoCompleteResult.prototype = {
   getLabelAt: function(aIndex) {
     return this.getValueAt(aIndex);
   },
-  
+
   getCommentAt: function(aIndex) {
     return this._comments[aIndex];
   },
-  
+
   getStyleAt: function(aIndex) {
     return this._styles[aIndex];
   },
-  
+
   getImageAt: function(aIndex) {
     return "";
   },
@@ -123,12 +123,12 @@ AutoCompleteResult.prototype = {
       return this;
 
     throw Components.results.NS_ERROR_NO_INTERFACE;
-  }  
+  }
 }
 
 
 
-/** 
+/**
  * nsIAutoCompleteSearch implementation that always returns
  * the same result set.
  */
@@ -138,21 +138,21 @@ function AutoCompleteSearch(aName, aResult) {
 }
 AutoCompleteSearch.prototype = {
   constructor: AutoCompleteSearch,
-  
+
   // Search name. Used by AutoCompleteController
   name: null,
 
   // AutoCompleteResult
-  _result:null,  
-  
-  
+  _result:null,
+
+
   /**
    * Return the same result set for every search
    */
-  startSearch: function(aSearchString, 
-                        aSearchParam, 
-                        aPreviousResult, 
-                        aListener) 
+  startSearch: function(aSearchString,
+                        aSearchParam,
+                        aPreviousResult,
+                        aListener)
   {
     var result = this._result;
     if (result._values.length > 0) {
@@ -169,7 +169,7 @@ AutoCompleteSearch.prototype = {
     }
     aListener.onSearchResult(this, result);
   },
-  
+
   stopSearch: function() {},
 
   // nsISupports implementation
@@ -181,7 +181,7 @@ AutoCompleteSearch.prototype = {
 
     throw Components.results.NS_ERROR_NO_INTERFACE;
   },
-  
+
   // nsIFactory implementation
   createInstance: function(outer, iid) {
     return this.QueryInterface(iid);
@@ -190,7 +190,7 @@ AutoCompleteSearch.prototype = {
 
 
 
-/** 
+/**
  * Helper to register an AutoCompleteSearch with the given name.
  * Allows the AutoCompleteController to find the search.
  */
@@ -202,46 +202,46 @@ function registerAutoCompleteSearch(aSearch) {
   var cid = uuidGenerator.generateUUID();
 
   var desc = "Test AutoCompleteSearch";
-  
+
   var componentManager = Components.manager
                                    .QueryInterface(Ci.nsIComponentRegistrar);
   componentManager.registerFactory(cid, desc, name, aSearch);
 
   // Keep the id on the object so we can unregister later
-  aSearch.cid = cid; 
+  aSearch.cid = cid;
 }
 
 
 
-/** 
- * Helper to unregister an AutoCompleteSearch. 
+/**
+ * Helper to unregister an AutoCompleteSearch.
  */
 function unregisterAutoCompleteSearch(aSearch) {
   var componentManager = Components.manager
-                                   .QueryInterface(Ci.nsIComponentRegistrar);  
+                                   .QueryInterface(Ci.nsIComponentRegistrar);
   componentManager.unregisterFactory(aSearch.cid, aSearch);
 }
 
 
 
-/** 
+/**
  * Test AutoComplete with multiple AutoCompleteSearch sources.
  */
 function run_test() {
   var expected1 = ["1","2","3"];
   var expected2 = ["a","b","c"];
-  var search1 = new AutoCompleteSearch("search1", 
+  var search1 = new AutoCompleteSearch("search1",
                              new AutoCompleteResult(expected1, [], []));
   var search2 = new AutoCompleteSearch("search2",
                              new AutoCompleteResult(expected2, [], []));
-  
+
   // Register searches so AutoCompleteController can find them
   registerAutoCompleteSearch(search1);
   registerAutoCompleteSearch(search2);
-    
+
   var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
-                   getService(Components.interfaces.nsIAutoCompleteController);  
-  
+                   getService(Components.interfaces.nsIAutoCompleteController);
+
   // Make an AutoCompleteInput that uses our searches
   // and confirms results on search complete
   var input = new AutoCompleteInput([search1.name, search2.name]);
@@ -256,7 +256,7 @@ function run_test() {
 
     do_check_eq(numSearchesStarted, 1);
 
-    do_check_eq(controller.searchStatus, 
+    do_check_eq(controller.searchStatus,
                 Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
     do_check_eq(controller.matchCount, expected1.length + expected2.length);
 
@@ -271,6 +271,6 @@ function run_test() {
 
   // Search is asynchronous, so don't let the test finish immediately
   do_test_pending();
-  
+
   controller.startSearch("test");
 }
diff --git a/toolkit/components/autocomplete/tests/unit/test_badDefaultIndex.js b/toolkit/components/autocomplete/tests/unit/test_badDefaultIndex.js
index 0ccbae319f..17f735388e 100644
--- a/toolkit/components/autocomplete/tests/unit/test_badDefaultIndex.js
+++ b/toolkit/components/autocomplete/tests/unit/test_badDefaultIndex.js
@@ -42,7 +42,7 @@ add_test(function autocomplete_noMatch_success() {
   do_check_eq(input.selectionEnd, strLen);
 
   let controller = Cc["@mozilla.org/autocomplete/controller;1"].
-                   getService(Ci.nsIAutoCompleteController);  
+                   getService(Ci.nsIAutoCompleteController);
   controller.input = input;
   controller.startSearch(INPUT_STR);
 
@@ -77,7 +77,7 @@ add_test(function autocomplete_defaultIndex_exceeds_matchCount() {
   do_check_eq(input.selectionEnd, strLen);
 
   let controller = Cc["@mozilla.org/autocomplete/controller;1"].
-                   getService(Ci.nsIAutoCompleteController);  
+                   getService(Ci.nsIAutoCompleteController);
   controller.input = input;
   controller.startSearch(INPUT_STR);
 
diff --git a/toolkit/components/autocomplete/tests/unit/test_completeDefaultIndex_casing.js b/toolkit/components/autocomplete/tests/unit/test_completeDefaultIndex_casing.js
index b4478a00dc..c25b009071 100644
--- a/toolkit/components/autocomplete/tests/unit/test_completeDefaultIndex_casing.js
+++ b/toolkit/components/autocomplete/tests/unit/test_completeDefaultIndex_casing.js
@@ -41,8 +41,8 @@ function doSearch(aSearchString, aResultValue, aOnCompleteCallback) {
   registerAutoCompleteSearch(search);
 
   let controller = Cc["@mozilla.org/autocomplete/controller;1"].
-                   getService(Ci.nsIAutoCompleteController);  
-  
+                   getService(Ci.nsIAutoCompleteController);
+
   // Make an AutoCompleteInput that uses our searches and confirms results.
   let input = new AutoCompleteInput([ search.name ]);
   input.textValue = aSearchString;
diff --git a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue.js b/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue.js
index 27304d03aa..17a1798fdd 100644
--- a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue.js
+++ b/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue.js
@@ -31,8 +31,8 @@ function doSearch(aSearchString, aResultValue, aFinalCompleteValue, aOnCompleteC
   registerAutoCompleteSearch(search);
 
   let controller = Cc["@mozilla.org/autocomplete/controller;1"].
-                   getService(Ci.nsIAutoCompleteController);  
-  
+                   getService(Ci.nsIAutoCompleteController);
+
   // Make an AutoCompleteInput that uses our searches and confirms results.
   let input = new AutoCompleteInput([ search.name ]);
   input.textValue = aSearchString;
diff --git a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_forceComplete.js b/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_forceComplete.js
index c2deafad41..5642d3e3ec 100644
--- a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_forceComplete.js
+++ b/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_forceComplete.js
@@ -19,17 +19,59 @@ function run_test() {
   run_next_test();
 }
 
-add_test(function test_handleEnter() {
-  doSearch("", "mozilla.com", "http://www.mozilla.com", function(aController) {
-    do_check_eq(aController.input.textValue, "");
+add_test(function test_handleEnterWithDirectMatchCompleteSelectedIndex() {
+  doSearch("moz", "mozilla.com", "http://www.mozilla.com",
+    { forceComplete: true, completeSelectedIndex: true }, function(aController) {
+    do_check_eq(aController.input.textValue, "moz");
     do_check_eq(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
-    aController.input.forceComplete = true;
     aController.handleEnter(false);
+    // After enter the final complete value should be shown in the input.
     do_check_eq(aController.input.textValue, "http://www.mozilla.com");
   });
 });
 
-function doSearch(aSearchString, aResultValue, aFinalCompleteValue, aOnCompleteCallback) {
+add_test(function test_handleEnterWithDirectMatch() {
+  doSearch("mozilla", "mozilla.com", "http://www.mozilla.com",
+    { forceComplete: true, completeDefaultIndex: true }, function(aController) {
+    // Should autocomplete the search string to a suggestion.
+    do_check_eq(aController.input.textValue, "mozilla.com");
+    do_check_eq(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
+    aController.handleEnter(false);
+    // After enter the final complete value should be shown in the input.
+    do_check_eq(aController.input.textValue, "http://www.mozilla.com");
+  });
+});
+
+add_test(function test_handleEnterWithNoMatch() {
+  doSearch("mozilla", "mozilla.com", "http://www.mozilla.com",
+    { forceComplete: true, completeDefaultIndex: true }, function(aController) {
+    // Should autocomplete the search string to a suggestion.
+    do_check_eq(aController.input.textValue, "mozilla.com");
+    do_check_eq(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
+    // Now input something that does not match...
+    aController.input.textValue = "mozillax";
+    // ... and confirm. We don't want one of the values from the previous
+    // results to be taken, since what's now in the input field doesn't match.
+    aController.handleEnter(false);
+    do_check_eq(aController.input.textValue, "mozillax");
+  });
+});
+
+add_test(function test_handleEnterWithIndirectMatch() {
+  doSearch("com", "mozilla.com", "http://www.mozilla.com",
+    { forceComplete: true, completeDefaultIndex: true }, function(aController) {
+    // Should autocomplete the search string to a suggestion.
+    do_check_eq(aController.input.textValue, "com >> mozilla.com");
+    do_check_eq(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
+    aController.handleEnter(false);
+    // After enter the final complete value from the suggestion should be shown
+    // in the input.
+    do_check_eq(aController.input.textValue, "http://www.mozilla.com");
+  });
+});
+
+function doSearch(aSearchString, aResultValue, aFinalCompleteValue,
+                  aInputProps, aOnCompleteCallback) {
   let search = new AutoCompleteSearchBase(
     "search",
     new AutoCompleteResult([ aResultValue ], [ aFinalCompleteValue ])
@@ -37,11 +79,17 @@ function doSearch(aSearchString, aResultValue, aFinalCompleteValue, aOnCompleteC
   registerAutoCompleteSearch(search);
 
   let controller = Cc["@mozilla.org/autocomplete/controller;1"].
-                   getService(Ci.nsIAutoCompleteController);  
-  
+                   getService(Ci.nsIAutoCompleteController);
+
   // Make an AutoCompleteInput that uses our searches and confirms results.
   let input = new AutoCompleteInput([ search.name ]);
+  for (var p in aInputProps) {
+    input[p] = aInputProps[p];
+  }
   input.textValue = aSearchString;
+  // Place the cursor at the end of the input so that completion to
+  // default index will kick in.
+  input.selectTextRange(aSearchString.length, aSearchString.length);
 
   controller.input = input;
   controller.startSearch(aSearchString);
diff --git a/toolkit/components/autocomplete/tests/unit/test_finalDefaultCompleteValue.js b/toolkit/components/autocomplete/tests/unit/test_finalDefaultCompleteValue.js
index c6302351d9..c983d969b3 100644
--- a/toolkit/components/autocomplete/tests/unit/test_finalDefaultCompleteValue.js
+++ b/toolkit/components/autocomplete/tests/unit/test_finalDefaultCompleteValue.js
@@ -44,8 +44,8 @@ function doSearch(aSearchString, aResultValue, aFinalCompleteValue, aOnCompleteC
   registerAutoCompleteSearch(search);
 
   let controller = Cc["@mozilla.org/autocomplete/controller;1"].
-                   getService(Ci.nsIAutoCompleteController);  
-  
+                   getService(Ci.nsIAutoCompleteController);
+
   // Make an AutoCompleteInput that uses our searches and confirms results.
   let input = new AutoCompleteInput([ search.name ]);
   input.textValue = aSearchString;
diff --git a/toolkit/components/autocomplete/tests/unit/test_hiddenResult.js b/toolkit/components/autocomplete/tests/unit/test_hiddenResult.js
index ed46602146..8e24857165 100644
--- a/toolkit/components/autocomplete/tests/unit/test_hiddenResult.js
+++ b/toolkit/components/autocomplete/tests/unit/test_hiddenResult.js
@@ -16,7 +16,7 @@ function AutoCompleteTypeAheadResult(aValues) {
 AutoCompleteTypeAheadResult.prototype = Object.create(AutoCompleteResultBase.prototype);
 
 
-/** 
+/**
  * Test AutoComplete with multiple AutoCompleteSearch sources, with one of them
  * being hidden from the popup, but can still do typeahead completion.
  */
@@ -31,11 +31,11 @@ function run_test() {
   // Regular result
   var searchNormal = new AutoCompleteSearchBase("search2",
                                                 new AutoCompleteResult(["mozillaTest2"]));
-  
+
   // Register searches so AutoCompleteController can find them
   registerAutoCompleteSearch(searchNormal);
   registerAutoCompleteSearch(searchTypeAhead);
-  
+
   // Make an AutoCompleteInput that uses our searches
   // and confirms results on search complete.
   var input = new AutoCompleteInputBase([searchTypeAhead.name, searchNormal.name]);
@@ -50,7 +50,7 @@ function run_test() {
   do_check_eq(input.selectionEnd, strLen);
 
   var controller = Cc["@mozilla.org/autocomplete/controller;1"].
-                   getService(Ci.nsIAutoCompleteController);  
+                   getService(Ci.nsIAutoCompleteController);
 
   controller.input = input;
   controller.startSearch(inputStr);
diff --git a/toolkit/components/autocomplete/tests/unit/test_immediate_search.js b/toolkit/components/autocomplete/tests/unit/test_immediate_search.js
index 4c2d0edfbd..17016cefb8 100644
--- a/toolkit/components/autocomplete/tests/unit/test_immediate_search.js
+++ b/toolkit/components/autocomplete/tests/unit/test_immediate_search.js
@@ -46,7 +46,7 @@ add_test(function test_immediate_search() {
   registerAutoCompleteSearch(delayedSearch);
 
   let controller = Cc["@mozilla.org/autocomplete/controller;1"].
-                   getService(Ci.nsIAutoCompleteController);  
+                   getService(Ci.nsIAutoCompleteController);
 
   let input = new AutoCompleteInputBase([delayedSearch.name,
                                          immediateSearch.name]);
@@ -91,7 +91,7 @@ add_test(function test_immediate_search_notimeout() {
   registerAutoCompleteSearch(delayedSearch);
 
   let controller = Cc["@mozilla.org/autocomplete/controller;1"].
-                   getService(Ci.nsIAutoCompleteController);  
+                   getService(Ci.nsIAutoCompleteController);
 
   let input = new AutoCompleteInputBase([delayedSearch.name,
                                          immediateSearch.name]);
@@ -132,7 +132,7 @@ add_test(function test_delayed_search_notimeout() {
   registerAutoCompleteSearch(delayedSearch);
 
   let controller = Cc["@mozilla.org/autocomplete/controller;1"].
-                   getService(Ci.nsIAutoCompleteController);  
+                   getService(Ci.nsIAutoCompleteController);
 
   let input = new AutoCompleteInputBase([delayedSearch.name]);
   input.completeDefaultIndex = true;
diff --git a/toolkit/components/autocomplete/tests/unit/test_previousResult.js b/toolkit/components/autocomplete/tests/unit/test_previousResult.js
index 3038e77856..426d4397ee 100644
--- a/toolkit/components/autocomplete/tests/unit/test_previousResult.js
+++ b/toolkit/components/autocomplete/tests/unit/test_previousResult.js
@@ -12,40 +12,40 @@
 
 /**
  * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names. 
- * 
+ * the given list of AutoCompleteSearch names.
+ *
  * Implements only the methods needed for this test.
  */
 function AutoCompleteInput(aSearches) {
   this.searches = aSearches;
 }
 AutoCompleteInput.prototype = {
-  constructor: AutoCompleteInput, 
-  
+  constructor: AutoCompleteInput,
+
   // Array of AutoCompleteSearch names
   searches: null,
-  
+
   minResultsForPopup: 0,
   timeout: 10,
   searchParam: "",
   textValue: "",
-  disableAutoComplete: false,  
+  disableAutoComplete: false,
   completeDefaultIndex: false,
-  
+
   get searchCount() {
     return this.searches.length;
   },
-  
+
   getSearchAt: function(aIndex) {
     return this.searches[aIndex];
   },
-  
+
   onSearchBegin: function() {},
   onSearchComplete: function() {},
-  
-  popupOpen: false,  
-  
-  popup: { 
+
+  popupOpen: false,
+
+  popup: {
     setSelectedIndex: function(aIndex) {},
     invalidate: function() {},
 
@@ -56,9 +56,9 @@ AutoCompleteInput.prototype = {
         return this;
 
       throw Components.results.NS_ERROR_NO_INTERFACE;
-    }    
+    }
   },
-    
+
   // nsISupports implementation
   QueryInterface: function(iid) {
     if (iid.equals(Ci.nsISupports) ||
@@ -71,7 +71,7 @@ AutoCompleteInput.prototype = {
 
 
 
-/** 
+/**
  * nsIAutoCompleteResult implementation
  */
 function AutoCompleteResult(aValues, aComments, aStyles) {
@@ -86,15 +86,15 @@ function AutoCompleteResult(aValues, aComments, aStyles) {
 }
 AutoCompleteResult.prototype = {
   constructor: AutoCompleteResult,
-  
+
   // Arrays
   _values: null,
   _comments: null,
   _styles: null,
-  
+
   searchString: "",
   searchResult: null,
-  
+
   defaultIndex: 0,
 
   get matchCount() {
@@ -108,15 +108,15 @@ AutoCompleteResult.prototype = {
   getLabelAt: function(aIndex) {
     return this.getValueAt(aIndex);
   },
-  
+
   getCommentAt: function(aIndex) {
     return this._comments[aIndex];
   },
-  
+
   getStyleAt: function(aIndex) {
     return this._styles[aIndex];
   },
-  
+
   getImageAt: function(aIndex) {
     return "";
   },
@@ -134,11 +134,11 @@ AutoCompleteResult.prototype = {
       return this;
 
     throw Components.results.NS_ERROR_NO_INTERFACE;
-  }  
+  }
 }
 
 
-/** 
+/**
  * nsIAutoCompleteSearch implementation that always returns
  * the same result set.
  */
@@ -148,7 +148,7 @@ function AutoCompleteSearch(aName, aResult) {
 }
 AutoCompleteSearch.prototype = {
   constructor: AutoCompleteSearch,
-  
+
   // Search name. Used by AutoCompleteController
   name: null,
 
@@ -156,20 +156,20 @@ AutoCompleteSearch.prototype = {
   _result: null,
 
   _previousResult: null,
-  
-  
+
+
   /**
    * Return the same result set for every search
    */
-  startSearch: function(aSearchString, 
-                        aSearchParam, 
-                        aPreviousResult, 
-                        aListener) 
+  startSearch: function(aSearchString,
+                        aSearchParam,
+                        aPreviousResult,
+                        aListener)
   {
     this._previousResult = aPreviousResult;
     aListener.onSearchResult(this, this._result);
   },
-  
+
   stopSearch: function() {},
 
   // nsISupports implementation
@@ -181,7 +181,7 @@ AutoCompleteSearch.prototype = {
 
     throw Components.results.NS_ERROR_NO_INTERFACE;
   },
-  
+
   // nsIFactory implementation
   createInstance: function(outer, iid) {
     return this.QueryInterface(iid);
@@ -189,7 +189,7 @@ AutoCompleteSearch.prototype = {
 }
 
 
-/** 
+/**
  * Helper to register an AutoCompleteSearch with the given name.
  * Allows the AutoCompleteController to find the search.
  */
@@ -201,34 +201,34 @@ function registerAutoCompleteSearch(aSearch) {
   var cid = uuidGenerator.generateUUID();
 
   var desc = "Test AutoCompleteSearch";
-  
+
   var componentManager = Components.manager
                                    .QueryInterface(Ci.nsIComponentRegistrar);
   componentManager.registerFactory(cid, desc, name, aSearch);
 
   // Keep the id on the object so we can unregister later
-  aSearch.cid = cid; 
+  aSearch.cid = cid;
 }
 
 
-/** 
- * Helper to unregister an AutoCompleteSearch. 
+/**
+ * Helper to unregister an AutoCompleteSearch.
  */
 function unregisterAutoCompleteSearch(aSearch) {
   var componentManager = Components.manager
-                                   .QueryInterface(Ci.nsIComponentRegistrar);  
+                                   .QueryInterface(Ci.nsIComponentRegistrar);
   componentManager.unregisterFactory(aSearch.cid, aSearch);
 }
 
 
-/** 
+/**
  */
 function run_test() {
   // Make an AutoCompleteSearch that always returns nothing
   var search1 = new AutoCompleteSearch("test-previous-result1",
     new AutoCompleteResult(["hello1"], [""], [""]));
 
-  var search2 = new AutoCompleteSearch("test-previous-result2", 
+  var search2 = new AutoCompleteSearch("test-previous-result2",
     new AutoCompleteResult(["hello2"], [""], [""]));
 
   // Register search so AutoCompleteController can find them
@@ -250,7 +250,7 @@ function run_test() {
   };
 
   input.onSearchComplete = function() {
-    do_check_eq(controller.searchStatus, 
+    do_check_eq(controller.searchStatus,
                 Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
     do_check_eq(controller.matchCount, 2);
 
@@ -278,7 +278,7 @@ function run_test() {
 
   // Search is asynchronous, so don't let the test finish immediately
   do_test_pending();
-  
+
   controller.startSearch("test");
 }
 
diff --git a/toolkit/components/autocomplete/tests/unit/test_stopSearch.js b/toolkit/components/autocomplete/tests/unit/test_stopSearch.js
index bee9808e69..9ecadd7c88 100644
--- a/toolkit/components/autocomplete/tests/unit/test_stopSearch.js
+++ b/toolkit/components/autocomplete/tests/unit/test_stopSearch.js
@@ -27,7 +27,7 @@ AutoCompleteInput.prototype = {
   timeout: 10,
   searchParam: "",
   textValue: "hello",
-  disableAutoComplete: false, 
+  disableAutoComplete: false,
   completeDefaultIndex: false,
   set popupOpen(val) { return val; }, // ignore
   get popupOpen() { return false; },
@@ -79,7 +79,7 @@ AutoCompleteSearch.prototype = {
 }
 
 
-/** 
+/**
  * Helper to register an AutoCompleteSearch with the given name.
  * Allows the AutoCompleteController to find the search.
  */
@@ -94,16 +94,16 @@ function registerAutoCompleteSearch(aSearch)
                                    .QueryInterface(Ci.nsIComponentRegistrar);
   componentManager.registerFactory(cid, desc, name, aSearch);
   // Keep the id on the object so we can unregister later
-  aSearch.cid = cid; 
+  aSearch.cid = cid;
 }
 
 
-/** 
- * Helper to unregister an AutoCompleteSearch. 
+/**
+ * Helper to unregister an AutoCompleteSearch.
  */
 function unregisterAutoCompleteSearch(aSearch) {
   let componentManager = Components.manager
-                                   .QueryInterface(Ci.nsIComponentRegistrar);  
+                                   .QueryInterface(Ci.nsIComponentRegistrar);
   componentManager.unregisterFactory(aSearch.cid, aSearch);
 }
 
diff --git a/toolkit/components/commandlines/test/unit/test_bug666224.js b/toolkit/components/commandlines/test/unit/test_bug666224.js
index e4a0d0db32..e65e13edb6 100644
--- a/toolkit/components/commandlines/test/unit/test_bug666224.js
+++ b/toolkit/components/commandlines/test/unit/test_bug666224.js
@@ -2,5 +2,5 @@ function run_test() {
     var cmdLine=Components.classes["@mozilla.org/toolkit/command-line;1"].createInstance(Components.interfaces.nsICommandLine);
     try {
         cmdLine.getArgument(cmdLine.length);
-    } catch(e) {} 
+    } catch(e) {}
 }
diff --git a/toolkit/components/console/content/console.js b/toolkit/components/console/content/console.js
index ad68026078..7bb5261bee 100644
--- a/toolkit/components/console/content/console.js
+++ b/toolkit/components/console/content/console.js
@@ -18,7 +18,7 @@ window.onload = function()
   gTextBoxEval = document.getElementById("TextboxEval");
   gEvaluator = document.getElementById("Evaluator");
   gFilter = document.getElementById("Filter");
-  
+
   updateSortCommand(gConsole.sortOrder);
   updateModeCommand(gConsole.mode);
 
@@ -45,7 +45,7 @@ function changeMode(aMode)
     case "All":
       gConsole.mode = null;
   }
-  
+
   document.persist("ConsoleBox", "mode");
 }
 
@@ -63,7 +63,7 @@ function updateSortCommand(aOrder)
 {
   var orderString = aOrder == 'reverse' ? "Descend" : "Ascend";
   var bc = document.getElementById("Console:sort"+orderString);
-  bc.setAttribute("checked", true);  
+  bc.setAttribute("checked", true);
 
   orderString = aOrder == 'reverse' ? "Ascend" : "Descend";
   bc = document.getElementById("Console:sort"+orderString);
diff --git a/toolkit/components/console/content/consoleBindings.xml b/toolkit/components/console/content/consoleBindings.xml
index c0285329ec..1908ed48e5 100644
--- a/toolkit/components/console/content/consoleBindings.xml
+++ b/toolkit/components/console/content/consoleBindings.xml
@@ -12,7 +12,7 @@
           xmlns:xbl="http://www.mozilla.org/xbl">
 
   
-      
+    
       
       
         
@@ -89,7 +89,7 @@
           this.mCount = 0;
 
           this.mConsoleListener = {
-            console: this, 
+            console: this,
             observe : function(aObject) {
               // The message can arrive a little bit after the xbl binding has been
               // unbind. So node.appendItem will not be available anymore.
@@ -360,7 +360,7 @@
       
 
       
-      
+
       
         
         
@@ -390,9 +390,9 @@
           });
         ]]>
       
-          
-       this.init(); 
-       this.destroy(); 
+
+      this.init();
+      this.destroy();
 
       
       lawyer@boyer.net (Lawyer Boyer)
 //
 // or, delightfully, a field like this:
@@ -781,7 +781,7 @@ function rssAuthor(s,author) {
   // check for RSS2 string format
   var chars = s.trim();
   var matches = chars.match(/(.*)\((.*)\)/);
-  var emailCheck = 
+  var emailCheck =
     /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
   if (matches) {
     var match1 = matches[1].trim();
@@ -837,7 +837,7 @@ function dateParse(aDateString) {
     return date.toUTCString();
   }
   return null;
-} 
+}
 
 const XHTML_NS = "http://www.w3.org/1999/xhtml";
 
@@ -855,7 +855,7 @@ function XHTMLHandler(processor, isAtom) {
 // SVG and MathML. XXX
 XHTMLHandler.prototype = {
 
-   // look back up at the declared namespaces 
+   // look back up at the declared namespaces
    // we always use the same prefixes for our safe stuff
   _isInScope: function XH__isInScope(ns) {
     for (var i in this._inScopeNS) {
@@ -875,7 +875,7 @@ XHTMLHandler.prototype = {
     ++this._depth;
     this._inScopeNS.push([]);
 
-    // RFC4287 requires XHTML to be wrapped in a div that is *not* part of 
+    // RFC4287 requires XHTML to be wrapped in a div that is *not* part of
     // the content. This prevents people from screwing up namespaces, but
     // we need to skip it here.
     if (this._isAtom && this._depth == 1 && localName == "div")
@@ -888,7 +888,7 @@ XHTMLHandler.prototype = {
       for (var i=0; i < attributes.length; ++i) {
         uri = attributes.getURI(i);
         // XHTML attributes aren't in a namespace
-        if (uri == "") { 
+        if (uri == "") {
           this._buf += (" " + attributes.getLocalName(i) + "='" +
                         xmlEscape(attributes.getValue(i)) + "'");
         } else {
@@ -898,10 +898,10 @@ XHTMLHandler.prototype = {
             // The attribute value we'll attempt to write
             var attributeValue = xmlEscape(attributes.getValue(i));
 
-            // it's an allowed attribute NS.            
+            // it's an allowed attribute NS.
             // write the attribute
-            this._buf += (" " + prefix + ":" + 
-                          attributes.getLocalName(i) + 
+            this._buf += (" " + prefix + ":" +
+                          attributes.getLocalName(i) +
                           "='" + attributeValue + "'");
 
             // write an xmlns declaration if necessary
@@ -942,7 +942,7 @@ XHTMLHandler.prototype = {
   endPrefixMapping: function FP_endPrefixMapping(prefix) {
   },
   processingInstruction: function XH_processingInstruction() {
-  }, 
+  },
 }
 
 /**
@@ -973,23 +973,23 @@ ExtensionHandler.prototype = {
     ++this._depth;
     var prefix = gNamespaces[uri] ? gNamespaces[uri] + ":" : "";
     var key =  prefix + localName;
-    
+
     if (this._depth == 1) {
       this._uri = uri;
       this._localName = localName;
       this._qName = qName;
       this._attrs = attrs;
     }
-    
+
     // if we descend into another element, we won't send text
     this._hasChildElements = (this._depth > 1);
-    
+
   },
   endElement: function EH_endElement(uri, localName, qName) {
     --this._depth;
     if (this._depth == 0) {
       var text = this._hasChildElements ? null : this._buf.trim();
-      this._processor.returnFromExtHandler(this._uri, this._localName, 
+      this._processor.returnFromExtHandler(this._uri, this._localName,
                                            text, this._attrs);
     }
   },
@@ -1002,7 +1002,7 @@ ExtensionHandler.prototype = {
   endPrefixMapping: function EH_endPrefixMapping() {
   },
   processingInstruction: function EH_processingInstruction() {
-  }, 
+  },
 };
 
 
@@ -1011,7 +1011,7 @@ ExtensionHandler.prototype = {
  * some characteristics of a feed element. For example, it
  * says whether an element can be expected to appear more
  * than once inside a given entry or feed.
- */ 
+ */
 function ElementInfo(fieldName, containerClass, closeFunc, isArray) {
   this.fieldName = fieldName;
   this.containerClass = containerClass;
@@ -1052,7 +1052,7 @@ function FeedProcessor() {
   this._extensionHandler = null;
   this._xhtmlHandler = null;
   this._haveSentResult = false;
-  
+
   // The nsIFeedResultListener waiting for the parse results
   this.listener = null;
 
@@ -1075,7 +1075,7 @@ function FeedProcessor() {
                           "atom03:content":"text"};
   this._stack = [];
 
-  this._trans = {   
+  this._trans = {
     "START": {
       //If we hit a root RSS element, treat as RSS2.
       "rss": new FeedElementInfo("RSS2", "rss2"),
@@ -1090,7 +1090,7 @@ function FeedProcessor() {
       // Treat as Atom 0.3
       "atom03:feed": new FeedElementInfo("Atom03", "atom03"),
     },
-    
+
     /********* RSS2 **********/
     "IN_RSS2": {
       "channel": new WrapperElementInfo("channel")
@@ -1145,7 +1145,7 @@ function FeedProcessor() {
       "media:content": new ElementInfo("mediacontent", null, null, true),
       "media:thumbnail": new ElementInfo("mediathumbnail", null, null, true)
     },
- 
+
     /********* RSS1 **********/
     "IN_RDF": {
       // If we hit a rss1:channel, we can verify that we have RSS1
@@ -1217,8 +1217,8 @@ function FeedProcessor() {
 }
 
 // See startElement for a long description of how feeds are processed.
-FeedProcessor.prototype = { 
-  
+FeedProcessor.prototype = {
+
   // Set ourselves as the SAX handler, and set the base URI
   _init: function FP_init(uri) {
     this._reader.contentHandler = this;
@@ -1236,7 +1236,7 @@ FeedProcessor.prototype = {
   // than the root.
   _docVerified: function FP_docVerified(version) {
     this._result.doc = Cc[FEED_CONTRACTID].createInstance(Ci.nsIFeed);
-    this._result.doc.baseURI = 
+    this._result.doc.baseURI =
       this._xmlBaseStack[this._xmlBaseStack.length - 1];
     this._result.doc.fields = this._feed;
     this._result.version = version;
@@ -1267,7 +1267,7 @@ FeedProcessor.prototype = {
   // Parsing functions
   parseFromStream: function FP_parseFromStream(stream, uri) {
     this._init(uri);
-    this._reader.parseFromStream(stream, null, stream.available(), 
+    this._reader.parseFromStream(stream, null, stream.available(),
                                  "application/xml");
     this._reader = null;
   },
@@ -1283,7 +1283,7 @@ FeedProcessor.prototype = {
     this._reader.parseAsync(requestObserver);
   },
 
-  // nsIStreamListener 
+  // nsIStreamListener
 
   // The XMLReader will throw sensible exceptions if these get called
   // out of order.
@@ -1343,7 +1343,7 @@ FeedProcessor.prototype = {
   // multiple times, such as the RSS category element and the Atom
   // link element. Most of the RSS1/DC elements can occur multiple
   // times in theory, but in practice, the only ones that do have
-  // analogues in Atom. 
+  // analogues in Atom.
   //
   // Some elements are also groups of attributes or sub-elements,
   // while others are simple text fields. For the most part, we don't
@@ -1355,7 +1355,7 @@ FeedProcessor.prototype = {
   // being dictionaries, whether they are based on attributes like RSS
   // cloud, sub-elements like Atom author, or even items and
   // entries. These elements are treated as "containers". It's
-  // theoretically possible for a container to have an attribute with 
+  // theoretically possible for a container to have an attribute with
   // the same universal name as a sub-element, but none of the feed
   // formats allow this by default, and I don't of any extension that
   // works this way.
@@ -1384,7 +1384,7 @@ FeedProcessor.prototype = {
 
     // Check to see if we need to hand this off to our XHTML handler.
     // The elements we're dealing with will look like this:
-    // 
+    //
     // 
     //   <div xmlns="http://www.w3.org/1999/xhtml">
     //     A title with <b>bold</b> and <i>italics</i>.
@@ -1392,18 +1392,18 @@ FeedProcessor.prototype = {
     // 
     //
     // When it returns in returnFromXHTMLHandler, the handler should
-    // give us back a string like this: 
-    // 
+    // give us back a string like this:
+    //
     //    "A title with bold and italics."
     //
     // The Atom spec explicitly says the div is not part of the content,
     // and explicitly allows whitespace collapsing.
-    // 
+    //
     if ((this._result.version == "atom" || this._result.version == "atom03") &&
         this._textConstructs[key] != null) {
       var type = attributes.getValueFromName("","type");
       if (type != null && type.indexOf("xhtml") >= 0) {
-        this._xhtmlHandler = 
+        this._xhtmlHandler =
           new XHTMLHandler(this, (this._result.version == "atom"));
         this._reader.contentHandler = this._xhtmlHandler;
         return;
@@ -1423,14 +1423,14 @@ FeedProcessor.prototype = {
       this._extensionHandler.startElement(uri, localName, qName, attributes);
       return;
     }
-      
+
     // This distinguishes wrappers like 'channel' from elements
     // we'd actually like to do something with (which will test true).
-    this._handlerStack[this._depth] = elementInfo; 
+    this._handlerStack[this._depth] = elementInfo;
     if (elementInfo.isWrapper) {
       this._state = "IN_" + elementInfo.fieldName.toUpperCase();
       this._stack.push([this._feed, this._state]);
-    } 
+    }
     else if (elementInfo.feedVersion) {
       this._state = "IN_" + elementInfo.fieldName.toUpperCase();
 
@@ -1459,7 +1459,7 @@ FeedProcessor.prototype = {
     //LOG("");
     if (elementInfo && !elementInfo.isWrapper)
       this._closeComplexElement(elementInfo);
-  
+
     // cut down xml:base context
     if (this._xmlBaseStack.length == this._depth + 1)
       this._xmlBaseStack = this._xmlBaseStack.slice(0, this._depth);
@@ -1477,18 +1477,18 @@ FeedProcessor.prototype = {
     this._buf += data;
   },
   // TODO: It would be nice to check new prefixes here, and if they
-  // don't conflict with the ones we've defined, throw them in a 
+  // don't conflict with the ones we've defined, throw them in a
   // dictionary to check.
   startPrefixMapping: function FP_startPrefixMapping(prefix, uri) {
   },
-  
+
   endPrefixMapping: function FP_endPrefixMapping(prefix) {
   },
-  
+
   processingInstruction: function FP_processingInstruction(target, data) {
     if (target == "xml-stylesheet") {
       var hrefAttribute = data.match(/href=[\"\'](.*?)[\"\']/);
-      if (hrefAttribute && hrefAttribute.length == 2) 
+      if (hrefAttribute && hrefAttribute.length == 2)
         this._result.stylesheet = strToURI(hrefAttribute[1], this._result.uri);
     }
   },
@@ -1501,7 +1501,7 @@ FeedProcessor.prototype = {
   function FP__processComplexElement(elementInfo, attributes) {
     var obj, key, prefix;
 
-    // If the container is an entry/item, it'll need to have its 
+    // If the container is an entry/item, it'll need to have its
     // more esoteric properties put in the 'fields' property bag.
     if (elementInfo.containerClass == Cc[ENTRY_CONTRACTID]) {
       obj = elementInfo.containerClass.createInstance(Ci.nsIFeedEntry);
@@ -1533,7 +1533,7 @@ FeedProcessor.prototype = {
     }
     catch(e) {
     }
-    
+
     if (elementInfo.isArray) {
       if (!prop) {
         container.setPropertyAsInterface(elementInfo.fieldName,
@@ -1547,11 +1547,11 @@ FeedProcessor.prototype = {
       // on large files. Bug 335638.
       newProp.QueryInterface(Ci.nsIMutableArray);
       newProp.appendElement(obj,false);
-      
+
       // If new object is an nsIFeedContainer, we want to deal with
       // its member nsIPropertyBag instead.
       if (isIFeedContainer(obj))
-        newProp = obj.fields; 
+        newProp = obj.fields;
 
     }
     else {
@@ -1561,7 +1561,7 @@ FeedProcessor.prototype = {
       }
       newProp = container.getProperty(elementInfo.fieldName);
     }
-    
+
     // make our new state name, and push the property onto the stack
     var newState = "IN_" + elementInfo.fieldName.toUpperCase();
     this._stack.push([newProp, newState, obj]);
@@ -1599,7 +1599,7 @@ FeedProcessor.prototype = {
     if (isArray)
       container.replaceElementAt(element, container.length - 1, false);
   },
-  
+
   _prefixForNS: function FP_prefixForNS(uri) {
     if (!uri)
       return "";
@@ -1650,10 +1650,10 @@ FeedProcessor.prototype = {
     // we don't take random elements inside rdf:RDF
     if (this._state == "IN_RDF")
       return;
-    
+
     // Grab the top of the stack
     var top = this._stack[this._stack.length - 1];
-    if (!top) 
+    if (!top)
       return;
 
     var container = top[0];
@@ -1662,10 +1662,10 @@ FeedProcessor.prototype = {
       var contract = this._handlerStack[this._depth].containerClass;
       // check if it's something specific, but not an entry
       if (contract && contract != Cc[ENTRY_CONTRACTID]) {
-        var el = container.queryElementAt(container.length - 1, 
+        var el = container.queryElementAt(container.length - 1,
                                           Ci.nsIFeedElementBase);
         // XXX there must be a way to flatten these interfaces
-        if (contract == Cc[PERSON_CONTRACTID]) 
+        if (contract == Cc[PERSON_CONTRACTID])
           el.QueryInterface(Ci.nsIFeedPerson);
         else
           return; // don't know about this interface
@@ -1674,13 +1674,13 @@ FeedProcessor.prototype = {
         var prefix = gNamespaces[uri];
 
         // synonyms
-        if ((uri == "" || 
+        if ((uri == "" ||
              prefix &&
              ((prefix.indexOf("atom") > -1) ||
-              (prefix.indexOf("rss") > -1))) && 
+              (prefix.indexOf("rss") > -1))) &&
             (propName == "url" || propName == "href"))
           propName = "uri";
-        
+
         try {
           if (el[propName] !== "undefined") {
             var propValue = chars;
@@ -1696,14 +1696,14 @@ FeedProcessor.prototype = {
           // ignore XPConnect errors
         }
         // the rest of the function deals with entry- and feed-level stuff
-        return; 
-      } 
+        return;
+      }
       else {
-        container = container.queryElementAt(container.length - 1, 
+        container = container.queryElementAt(container.length - 1,
                                              Ci.nsIWritablePropertyBag2);
       }
     }
-    
+
     // Make the buffer our new property
     var propName = this._prefixForNS(uri) + localName;
 
@@ -1731,7 +1731,7 @@ FeedProcessor.prototype = {
           type = "text";
         }
       }
-      
+
       // If it's rss feed-level description, it's not supposed to have html
       if (this._result.version.indexOf("rss") >= 0 &&
           this._handlerStack[this._depth].containerClass != ENTRY_CONTRACTID) {
@@ -1757,7 +1757,7 @@ FeedProcessor.prototype = {
 
     // Grab the top of the stack
     var top = this._stack[this._stack.length - 1];
-    if (!top) 
+    if (!top)
       return;
     var container = top[0];
 
@@ -1769,7 +1769,7 @@ FeedProcessor.prototype = {
     newProp.base = this._xmlBaseStack[this._xmlBaseStack.length - 1];
     container.setPropertyAsInterface(this._prefixForNS(uri) + localName,
                                      newProp);
-    
+
     // XHTML will cause us to peek too far. The XHTML handler will
     // send us an end element to call. RFC4287-valid feeds allow a
     // more graceful way to handle this. Unfortunately, we can't count
diff --git a/toolkit/components/feeds/test/test_xml.js b/toolkit/components/feeds/test/test_xml.js
index c46b6d371c..13a02c6dcb 100644
--- a/toolkit/components/feeds/test/test_xml.js
+++ b/toolkit/components/feeds/test/test_xml.js
@@ -14,7 +14,7 @@
  *      |
  *      - head.js
  *      |
- *      - xml/ -- rss1/... 
+ *      - xml/ -- rss1/...
  *             |
  *             -- rss2/...
  *             |
diff --git a/toolkit/components/filepicker/content/filepicker.js b/toolkit/components/filepicker/content/filepicker.js
index 37d4f038cd..9bfff234cc 100644
--- a/toolkit/components/filepicker/content/filepicker.js
+++ b/toolkit/components/filepicker/content/filepicker.js
@@ -71,7 +71,7 @@ function filepickerLoad() {
     textInputLabel.value = gFilePickerBundle.getString("dirTextInputLabel");
     textInputLabel.accessKey = gFilePickerBundle.getString("dirTextInputAccesskey");
   }
-  
+
   if ((filePickerMode == nsIFilePicker.modeOpen) ||
       (filePickerMode == nsIFilePicker.modeOpenMultiple) ||
       (filePickerMode == nsIFilePicker.modeSave)) {
@@ -297,7 +297,7 @@ function selectOnOK()
           var message =
             gFilePickerBundle.getFormattedString("confirmFileReplacing",
                                                  [file.path]);
-          
+
           promptService = Components.classes[NS_PROMPTSERVICE_CONTRACTID].getService(Components.interfaces.nsIPromptService);
           var rv = promptService.confirm(window, confirmTitle, message);
           if (rv) {
@@ -360,7 +360,7 @@ function selectOnOK()
 
   retvals.files = gFilesEnumerator;
   retvals.buttonStatus = ret;
-  
+
   return (ret != nsIFilePicker.returnCancel);
 }
 
@@ -420,7 +420,7 @@ function onClick(e) {
 
 function convertColumnIDtoSortType(columnID) {
   var sortKey;
-  
+
   switch (columnID) {
   case "FilenameColumn":
     sortKey = nsIFileView.sortName;
@@ -436,7 +436,7 @@ function convertColumnIDtoSortType(columnID) {
     sortKey = 0;
     break;
   }
-  
+
   return sortKey;
 }
 
@@ -444,7 +444,7 @@ function handleColumnClick(columnID) {
   var sortType = convertColumnIDtoSortType(columnID);
   var sortOrder = (treeView.sortType == sortType) ? !treeView.reverseSort : false;
   treeView.sort(sortType, sortOrder);
-  
+
   // set the sort indicator on the column we are sorted by
   var sortedColumn = document.getElementById(columnID);
   if (treeView.reverseSort) {
@@ -452,7 +452,7 @@ function handleColumnClick(columnID) {
   } else {
     sortedColumn.setAttribute("sortDirection", "ascending");
   }
-  
+
   // remove the sort indicator from the rest of the columns
   var currCol = sortedColumn.parentNode.firstChild;
   while (currCol) {
@@ -597,7 +597,7 @@ function populateAncestorList(directory) {
   while (menu.hasChildNodes()) {
     menu.removeChild(menu.firstChild);
   }
-  
+
   var menuItem = document.createElement("menuitem");
   menuItem.setAttribute("label", directory.path);
   menuItem.setAttribute("crop", "start");
@@ -613,7 +613,7 @@ function populateAncestorList(directory) {
     directory = parent;
     parent = directory.parent;
   }
-  
+
   var menuList = document.getElementById("lookInMenuList");
   menuList.selectedIndex = 0;
 }
@@ -650,7 +650,7 @@ function newDir() {
                       file);
       return false;
     }
-    
+
     file = file[0].QueryInterface(nsIFile);
     if (file.exists()) {
       showErrorDialog("errorNewDirDoesExistTitle",
@@ -681,7 +681,7 @@ function newDir() {
     }
 
     try {
-      file.create(nsIFile.DIRECTORY_TYPE, 0755); 
+      file.create(nsIFile.DIRECTORY_TYPE, 0755);
     } catch (e) {
       showErrorDialog("errorCreateNewDirTitle",
                       "errorCreateNewDirMessage",
@@ -693,7 +693,7 @@ function newDir() {
     // we remember and reshow a dirname if something goes wrong
     // so that errors can be corrected more easily. If all went well,
     // reset the default value to blank
-    gNewDirName = { value: "" }; 
+    gNewDirName = { value: "" };
   }
   return true;
 }
@@ -750,7 +750,7 @@ function processPath(path)
         nextQuote = path.indexOf('"', quoteSearchStart);
         quoteSearchStart = nextQuote + 1;
       } while (nextQuote != -1 && path[nextQuote - 1] == '\\');
-      
+
       if (nextQuote == -1) {
         // we have a filename with no trailing quote.
         // just assume that the filename ends at the end of the string.
@@ -807,7 +807,7 @@ function processPathEntry(path, fileArray)
 
   // Unescape quotes
   filePath = filePath.replace(/\\\"/g, "\"");
-  
+
   if (filePath[0] == '/')   /* an absolute path was entered */
     file.initWithPath(filePath);
   else if ((filePath.indexOf("/../") > 0) ||
diff --git a/toolkit/components/formautofill/FormAutofillStartup.js b/toolkit/components/formautofill/FormAutofillStartup.js
index 87f4de5f3b..92887f8722 100644
--- a/toolkit/components/formautofill/FormAutofillStartup.js
+++ b/toolkit/components/formautofill/FormAutofillStartup.js
@@ -49,7 +49,7 @@ FormAutofillStartup.prototype = {
     // raised in the parent process is caught and serialized into the reply
     // message that is sent to the requesting child process.
     FormAutofill.processRequestAutocomplete(aMessage.data)
-      .catch(ex => { exception: ex })
+      .catch(ex => { return { exception: ex } })
       .then(result => {
         // The browser message manager in the parent will send the reply to the
         // associated frame message manager in the child.
diff --git a/toolkit/components/microformats/Microformats.js b/toolkit/components/microformats/Microformats.js
index b8cd8b0876..14f4e1e5d1 100644
--- a/toolkit/components/microformats/Microformats.js
+++ b/toolkit/components/microformats/Microformats.js
@@ -16,7 +16,7 @@ this.Microformats = {
   },
   /**
    * Retrieves microformats objects of the given type from a document
-   * 
+   *
    * @param  name          The name of the microformat (required)
    * @param  rootElement   The DOM element at which to start searching (required)
    * @param  options       Literal object with the following options:
@@ -28,7 +28,7 @@ this.Microformats = {
    *                       debug - Whether or not we are in debug mode (optional
    *                       - defaults to false)
    * @param  targetArray  An array of microformat objects to which is added the results (optional)
-   * @return A new array of microformat objects or the passed in microformat 
+   * @return A new array of microformat objects or the passed in microformat
    *         object array with the new objects added
    */
   get: function(name, rootElement, options, targetArray) {
@@ -74,7 +74,7 @@ this.Microformats = {
       if ((microformatNodes.length == 0) && Microformats[name].alternateClassName) {
         var altClass = Microformats.getElementsByClassName(rootElement, Microformats[name].alternateClassName);
         if (altClass.length > 0) {
-          microformatNodes.push(rootElement); 
+          microformatNodes.push(rootElement);
         }
       }
     } else if (Microformats[name].attributeValues) {
@@ -82,9 +82,9 @@ this.Microformats = {
         Microformats.getElementsByAttribute(rootElement,
                                             Microformats[name].attributeName,
                                             Microformats[name].attributeValues);
-      
+
     }
-    
+
 
     function isVisible(node, checkChildren) {
       if (node.getBoundingClientRect) {
@@ -109,7 +109,7 @@ this.Microformats = {
       }
       return true;
     }
-    
+
     /* Create objects for the microformat nodes and put them into the microformats */
     /* array */
     for (let i = 0; i < microformatNodes.length; i++) {
@@ -138,7 +138,7 @@ this.Microformats = {
   },
   /**
    * Counts microformats objects of the given type from a document
-   * 
+   *
    * @param  name          The name of the microformat (required)
    * @param  rootElement   The DOM element at which to start searching (required)
    * @param  options       Literal object with the following options:
@@ -226,7 +226,7 @@ this.Microformats = {
     return null;
   },
   /**
-   * If the passed in node is a microformat, this function returns a space 
+   * If the passed in node is a microformat, this function returns a space
    * separated list of the microformat names that correspond to this node
    *
    * @param  node          DOM node to check
@@ -276,7 +276,7 @@ this.Microformats = {
       }
       var toreturn = "";
       var testArray = [];
-      
+
       for (let i in item)
       {
         if (testArray[i]) {
@@ -354,9 +354,9 @@ this.Microformats = {
         outstring = outstring.replace(/\s+$/, '');
         return outstring;
       }
-      
-      
-      if (((((propnode.localName.toLowerCase() == "abbr") || (propnode.localName.toLowerCase() == "html:abbr")) && !propnode.namespaceURI) || 
+
+
+      if (((((propnode.localName.toLowerCase() == "abbr") || (propnode.localName.toLowerCase() == "html:abbr")) && !propnode.namespaceURI) ||
          ((propnode.localName.toLowerCase() == "abbr") && (propnode.namespaceURI == "http://www.w3.org/1999/xhtml"))) && (propnode.hasAttribute("title"))) {
         return propnode.getAttribute("title");
       } else if ((propnode.nodeName.toLowerCase() == "img") && (propnode.hasAttribute("alt"))) {
@@ -441,7 +441,7 @@ this.Microformats = {
      * Basically this is to handle the face that telephone numbers use value
      * as the name as one of their subproperties, but value is also used for
      * value excerpting (http://microformats.org/wiki/hcard#Value_excerpting)
-     
+
      * @param  propnode   The DOMNode to check
      * @param  parentnode The parent node of the property. If it is a subproperty,
      *                    this is the parent property node. If it is not, this is the
@@ -668,11 +668,11 @@ this.Microformats = {
       for (let i in Microformats[microformat].properties) {
         object.__defineGetter__(i, Microformats.parser.getMicroformatPropertyGenerator(node, microformat, i, object));
       }
-      
+
       /* The node in the object should be the original node */
       object.node = in_node;
       /* we also store the node that has been "resolved" */
-      object.resolvedNode = node; 
+      object.resolvedNode = node;
       object.semanticType = microformat;
       if (validate) {
         Microformats.parser.validate(node, microformat);
@@ -683,7 +683,7 @@ this.Microformats = {
       return function() {
         var result = Microformats.parser.getMicroformatProperty(node, name, property);
 //        delete microformat[property];
-//        microformat[property] = result; 
+//        microformat[property] = result;
         return result;
       };
     },
@@ -915,7 +915,7 @@ this.Microformats = {
     normalizeISO8601: function normalizeISO8601(string)
     {
       var dateArray = string.match(/(\d\d\d\d)(?:-?(\d\d)(?:-?(\d\d)(?:[T ](\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(?:([-+Z])(?:(\d\d)(?::?(\d\d))?)?)?)?)?)?/);
-  
+
       var dateString;
       var tzOffset = 0;
       if (!dateArray) {
@@ -965,13 +965,13 @@ this.Microformats = {
    * offset and Z if present to convert the date to local time
    * NOTE: I'm using an extra parameter on the date object for this function.
    * I set date.time to true if there is a date, otherwise date.time is false.
-   * 
+   *
    * @param  string ISO8601 formatted date
-   * @return JavaScript date object that represents the ISO date. 
+   * @return JavaScript date object that represents the ISO date.
    */
   dateFromISO8601: function dateFromISO8601(string) {
     var dateArray = string.match(/(\d\d\d\d)(?:-?(\d\d)(?:-?(\d\d)(?:[T ](\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(?:([-+Z])(?:(\d\d)(?::?(\d\d))?)?)?)?)?)?/);
-  
+
     var date = new Date(dateArray[1], 0, 1);
     date.time = false;
 
@@ -1011,9 +1011,9 @@ this.Microformats = {
       if (dateArray[8]) {
         var tzOffset = date.getTimezoneOffset();
         if (tzOffset < 0) {
-          date.setMinutes(date.getMinutes() + tzOffset); 
+          date.setMinutes(date.getMinutes() + tzOffset);
         } else if (tzOffset > 0) {
-          date.setMinutes(date.getMinutes() - tzOffset); 
+          date.setMinutes(date.getMinutes() - tzOffset);
         }
       }
     }
@@ -1023,10 +1023,10 @@ this.Microformats = {
    * Converts a Javascript date object into an ISO 8601 formatted date
    * NOTE: I'm using an extra parameter on the date object for this function.
    * If date.time is NOT true, this function only outputs the date.
-   * 
+   *
    * @param  date        Javascript Date object
    * @param  punctuation true if the date should have -/:
-   * @return string with the ISO date. 
+   * @return string with the ISO date.
    */
   iso8601FromDate: function iso8601FromDate(date, punctuation) {
     var string = date.getFullYear().toString();
@@ -1077,7 +1077,7 @@ this.Microformats = {
    *
    * Retrieve elements matching all classes listed in a space-separated string.
    * I had to implement my own because I need an Array, not an nsIDomNodeList
-   * 
+   *
    * @param  rootElement      The DOM element at which to start searching (optional)
    * @param  className        A space separated list of classenames
    * @return microformatNodes An array of DOM Nodes, each representing a
@@ -1119,7 +1119,7 @@ this.Microformats = {
    * Not intended for external consumption. Microformat implementations might use it.
    *
    * Retrieve elements matching an attribute and an attribute list in a space-separated string.
-   * 
+   *
    * @param  rootElement      The DOM element at which to start searching (optional)
    * @param  atributeName     The attribute name to match against
    * @param  attributeValues  A space separated list of attribute values
@@ -1142,7 +1142,7 @@ this.Microformats = {
         }
         xpathExpression += "contains(concat(' ', @" + attributeName + ", ' '), ' " + attributeList[i] + " ')";
       }
-      xpathExpression += "]"; 
+      xpathExpression += "]";
 
       var xpathResult = (rootNode.ownerDocument || rootNode).evaluate(xpathExpression, rootNode, null, 0, null);
 
@@ -1314,7 +1314,7 @@ var hCard_definition = {
           virtual: true
         }
       },
-      plural: true   
+      plural: true
     },
     "fn" : {
       required: true
diff --git a/toolkit/components/microformats/microformat-shiv.js b/toolkit/components/microformats/microformat-shiv.js
index 8d126fb2a6..95a388fed6 100644
--- a/toolkit/components/microformats/microformat-shiv.js
+++ b/toolkit/components/microformats/microformat-shiv.js
@@ -3,7 +3,7 @@
    microformat-shiv - v1.3.3
    Built: 2015-12-31 01:12 - http://microformat-shiv.com
    Copyright (c) 2015 Glenn Jones
-   Licensed MIT 
+   Licensed MIT
 */
 
 
@@ -18,9 +18,9 @@ var Microformats; // jshint ignore:line
         root.Microformats = factory();
   }
 }(this, function () {
-    
+
     var modules = {};
-    
+
 
 	modules.version = '1.3.3';
 	modules.livingStandard = '2015-09-25T12:26:04Z';
@@ -1463,9 +1463,9 @@ var Microformats; // jshint ignore:line
 
 	// check parser module is loaded
 	if(modules.Parser){
-	
+
 		/**
-		 * applies "implied rules" microformat output structure i.e. feed-title, name, photo, url and date 
+		 * applies "implied rules" microformat output structure i.e. feed-title, name, photo, url and date
 		 *
 		 * @param  {DOM Node} node
 		 * @param  {Object} uf (microformat output structure)
@@ -1475,40 +1475,40 @@ var Microformats; // jshint ignore:line
 		 */
 		 modules.Parser.prototype.impliedRules = function(node, uf, parentClasses) {
 			var typeVersion = (uf.typeVersion)? uf.typeVersion: 'v2';
-			
+
 			// TEMP: override to allow v1 implied properties while spec changes
 			if(this.options.impliedPropertiesByVersion === false){
 				typeVersion = 'v2';
 			}
-			
+
 			if(node && uf && uf.properties) {
-				uf = this.impliedBackwardComp( node, uf, parentClasses );  
+				uf = this.impliedBackwardComp( node, uf, parentClasses );
 				if(typeVersion === 'v2'){
 					uf = this.impliedhFeedTitle( uf );
-					uf = this.impliedName( node, uf ); 
-					uf = this.impliedPhoto( node, uf ); 	
+					uf = this.impliedName( node, uf );
+					uf = this.impliedPhoto( node, uf );
 					uf = this.impliedUrl( node, uf );
 				}
 				uf = this.impliedValue( node, uf, parentClasses );
 				uf = this.impliedDate( uf );
-				
+
 				// TEMP: flagged while spec changes are put forward
 				if(this.options.parseLatLonGeo === true){
 					uf = this.impliedGeo( uf );
-				}  
+				}
 			}
 
 			return uf;
 		};
-		
-		
+
+
 		/**
 		 * apply implied name rule
 		 *
 		 * @param  {DOM Node} node
 		 * @param  {Object} uf
 		 * @return {Object}
-		 */		
+		 */
 		modules.Parser.prototype.impliedName = function(node, uf) {
 			// implied name rule
 			/*
@@ -1526,7 +1526,7 @@ var Microformats; // jshint ignore:line
 			*/
 			var name,
 				value;
-					
+
 			if(!uf.properties.name) {
 				value = this.getImpliedProperty(node, ['img', 'area', 'abbr'], this.getNameAttr);
 				var textFormat = this.options.textFormat;
@@ -1540,27 +1540,27 @@ var Microformats; // jshint ignore:line
 					uf.properties.name = name;
 				}
 			}
-			
+
 			return uf;
 		};
-		
-		
+
+
 		/**
 		 * apply implied photo rule
 		 *
 		 * @param  {DOM Node} node
 		 * @param  {Object} uf
 		 * @return {Object}
-		 */		
+		 */
 		modules.Parser.prototype.impliedPhoto = function(node, uf) {
 			// implied photo rule
 			/*
 				img.h-x[src] 												Jane Doe
 				object.h-x[data] 											Jane Doe
-				.h-x>img[src]:only-of-type:not[.h-*]						
Jane Doe
- .h-x>object[data]:only-of-type:not[.h-*]
Jane Doe
- .h-x>:only-child>img[src]:only-of-type:not[.h-*]
Jane Doe
- .h-x>:only-child>object[data]:only-of-type:not[.h-*]
Jane Doe
+ .h-x>img[src]:only-of-type:not[.h-*]
Jane Doe
+ .h-x>object[data]:only-of-type:not[.h-*]
Jane Doe
+ .h-x>:only-child>img[src]:only-of-type:not[.h-*]
Jane Doe
+ .h-x>:only-child>object[data]:only-of-type:not[.h-*]
Jane Doe
*/ var value; if(!uf.properties.photo) { @@ -1572,24 +1572,24 @@ var Microformats; // jshint ignore:line } uf.properties.photo = [modules.utils.trim(value)]; } - } + } return uf; }; - - + + /** * apply implied URL rule * * @param {DOM Node} node * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedUrl = function(node, uf) { // implied URL rule /* a.h-x[href] Glenn area.h-x[href] Glenn - .h-x>a[href]:only-of-type:not[.h-*] + .h-x>a[href]:only-of-type:not[.h-*] .h-x>area[href]:only-of-type:not[.h-*]
Glenn

...

*/ var value; @@ -1602,18 +1602,18 @@ var Microformats; // jshint ignore:line } uf.properties.url = [modules.utils.trim(value)]; } - } + } return uf; }; - - + + /** * apply implied date rule - if there is a time only property try to concat it with any date property * * @param {DOM Node} node * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedDate = function(uf) { // implied date rule // http://microformats.org/wiki/value-class-pattern#microformats2_parsers @@ -1628,8 +1628,8 @@ var Microformats; // jshint ignore:line delete uf.dates; return uf; }; - - + + /** * get an implied property value from pre-defined tag/attriubte combinations * @@ -1640,10 +1640,10 @@ var Microformats; // jshint ignore:line */ modules.Parser.prototype.getImpliedProperty = function(node, tagList, getAttrFunction) { // i.e. img.h-card - var value = getAttrFunction(node), + var value = getAttrFunction(node), descendant, child; - + if(!value) { // i.e. .h-card>img:only-of-type:not(.h-card) descendant = modules.domUtils.getSingleDescendantOfType( node, tagList); @@ -1661,17 +1661,17 @@ var Microformats; // jshint ignore:line } } } - + return value; }; - - + + /** * get an implied name value from a node * * @param {DOM Node} node * @return {String || null} - */ + */ modules.Parser.prototype.getNameAttr = function(node) { var value = modules.domUtils.getAttrValFromTagList(node, ['img','area'], 'alt'); if(!value) { @@ -1679,14 +1679,14 @@ var Microformats; // jshint ignore:line } return value; }; - - + + /** * get an implied photo value from a node * * @param {DOM Node} node * @return {String || null} - */ + */ modules.Parser.prototype.getPhotoAttr = function(node) { var value = modules.domUtils.getAttrValFromTagList(node, ['img'], 'src'); if(!value && modules.domUtils.hasAttributeValue(node, 'class', 'include') === false) { @@ -1694,62 +1694,62 @@ var Microformats; // jshint ignore:line } return value; }; - - + + /** * get an implied photo value from a node * * @param {DOM Node} node * @return {String || null} - */ + */ modules.Parser.prototype.getURLAttr = function(node) { var value = null; if(modules.domUtils.hasAttributeValue(node, 'class', 'include') === false){ - + value = modules.domUtils.getAttrValFromTagList(node, ['a'], 'href'); if(!value) { value = modules.domUtils.getAttrValFromTagList(node, ['area'], 'href'); } - + } return value; }; - - + + /** - * + * * * @param {DOM Node} node * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedValue = function(node, uf, parentClasses){ - + // intersection of implied name and implied value rules - if(uf.properties.name) { + if(uf.properties.name) { if(uf.value && parentClasses.root.length > 0 && parentClasses.properties.length === 1){ uf = this.getAltValue(uf, parentClasses.properties[0][0], 'p-name', uf.properties.name[0]); } } - + // intersection of implied URL and implied value rules if(uf.properties.url) { if(parentClasses && parentClasses.root.length === 1 && parentClasses.properties.length === 1){ uf = this.getAltValue(uf, parentClasses.properties[0][0], 'u-url', uf.properties.url[0]); } - } - + } + // apply alt value if(uf.altValue !== null){ uf.value = uf.altValue.value; } delete uf.altValue; - - + + return uf; }; - - + + /** * get alt value based on rules about parent property prefix * @@ -1758,7 +1758,7 @@ var Microformats; // jshint ignore:line * @param {String} propertyName * @param {String} value * @return {Object} - */ + */ modules.Parser.prototype.getAltValue = function(uf, parentPropertyName, propertyName, value){ if(uf.value && !uf.altValue){ // first p-name of the h-* child @@ -1776,14 +1776,14 @@ var Microformats; // jshint ignore:line } return uf; }; - - + + /** * if a h-feed does not have a title use the title tag of a page * * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedhFeedTitle = function( uf ){ if(uf.type && uf.type.indexOf('h-feed') > -1){ // has no name property @@ -1797,80 +1797,80 @@ var Microformats; // jshint ignore:line } return uf; }; - - - + + + /** * implied Geo from pattern * * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedGeo = function( uf ){ var geoPair, parts, longitude, latitude, valid = true; - + if(uf.type && uf.type.indexOf('h-geo') > -1){ - + // has no latitude or longitude property if(uf.properties.latitude === undefined || uf.properties.longitude === undefined ){ geoPair = (uf.properties.name)? uf.properties.name[0] : null; geoPair = (!geoPair && uf.properties.value)? uf.properties.value : geoPair; - + if(geoPair){ // allow for the use of a ';' as in microformats and also ',' as in Geo URL geoPair = geoPair.replace(';',','); - + // has sep char if(geoPair.indexOf(',') > -1 ){ parts = geoPair.split(','); - + // only correct if we have two or more parts if(parts.length > 1){ - // latitude no value outside the range -90 or 90 + // latitude no value outside the range -90 or 90 latitude = parseFloat( parts[0] ); if(modules.utils.isNumber(latitude) && latitude > 90 || latitude < -90){ valid = false; } - + // longitude no value outside the range -180 to 180 longitude = parseFloat( parts[1] ); if(modules.utils.isNumber(longitude) && longitude > 180 || longitude < -180){ valid = false; } - + if(valid){ uf.properties.latitude = [latitude]; uf.properties.longitude = [longitude]; } } - + } } } } return uf; }; - - + + /** * if a backwards compat built structure has no properties add name through this.impliedName * * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedBackwardComp = function(node, uf, parentClasses){ - + // look for pattern in parent classes like "p-geo h-geo" // these are structures built from backwards compat parsing of geo if(parentClasses.root.length === 1 && parentClasses.properties.length === 1) { if(parentClasses.root[0].replace('h-','') === this.removePropPrefix(parentClasses.properties[0][0])) { - + // if microformat has no properties apply the impliedName rule to get value from containing node // this will get value from html such as Brighton if( modules.utils.hasProperties(uf.properties) === false ){ @@ -1878,31 +1878,31 @@ var Microformats; // jshint ignore:line } } } - + return uf; }; - - - + + + } // check parser module is loaded if(modules.Parser){ - - + + /** * appends clones of include Nodes into the DOM structure * * @param {DOM node} rootNode - */ + */ modules.Parser.prototype.addIncludes = function(rootNode) { this.addAttributeIncludes(rootNode, 'itemref'); this.addAttributeIncludes(rootNode, 'headers'); this.addClassIncludes(rootNode); }; - - + + /** * appends clones of include Nodes into the DOM structure for attribute based includes * @@ -1916,7 +1916,7 @@ var Microformats; // jshint ignore:line x, z, y; - + arr = modules.domUtils.getNodesByAttribute(rootNode, attributeName); x = 0; i = arr.length; @@ -1933,8 +1933,8 @@ var Microformats; // jshint ignore:line x++; } }; - - + + /** * appends clones of include Nodes into the DOM structure for class based includes * @@ -1945,7 +1945,7 @@ var Microformats; // jshint ignore:line arr, x = 0, i; - + arr = modules.domUtils.getNodesByAttributeValue(rootNode, 'class', 'include'); i = arr.length; while(x < i) { @@ -1957,8 +1957,8 @@ var Microformats; // jshint ignore:line x++; } }; - - + + /** * appends a clone of an include into another Node using Id * @@ -1968,7 +1968,7 @@ var Microformats; // jshint ignore:line modules.Parser.prototype.apppendInclude = function(node, id){ var include, clone; - + id = modules.utils.trim(id.replace('#', '')); include = modules.domUtils.getElementById(this.document, id); if(include) { @@ -1977,18 +1977,18 @@ var Microformats; // jshint ignore:line modules.domUtils.appendChild(node, clone); } }; - - + + /** - * adds an attribute marker to all the child microformat roots + * adds an attribute marker to all the child microformat roots * * @param {DOM node} rootNode - */ + */ modules.Parser.prototype.markIncludeChildren = function(rootNode) { var arr, x, i; - + // loop the array and add the attribute arr = this.findRootNodes(rootNode); x = 0; @@ -2000,17 +2000,17 @@ var Microformats; // jshint ignore:line x++; } }; - - + + /** - * removes all appended include clones from DOM + * removes all appended include clones from DOM * * @param {DOM node} rootNode - */ + */ modules.Parser.prototype.removeIncludes = function(rootNode){ var arr, i; - + // remove all the items that were added as includes arr = modules.domUtils.getNodesByAttribute(rootNode, 'data-include'); i = arr.length; @@ -2018,14 +2018,14 @@ var Microformats; // jshint ignore:line modules.domUtils.removeChild(rootNode,arr[i]); } }; - - + + } // check parser module is loaded if(modules.Parser){ - + /** * finds rel=* structures * @@ -2047,36 +2047,36 @@ var Microformats; // jshint ignore:line item, value, arr; - + arr = modules.domUtils.getNodesByAttribute(rootNode, 'rel'); x = 0; i = arr.length; while(x < i) { relList = modules.domUtils.getAttribute(arr[x], 'rel'); - + if(relList) { items = relList.split(' '); - - + + // add rels z = 0; y = items.length; while(z < y) { item = modules.utils.trim(items[z]); - + // get rel value value = modules.domUtils.getAttrValFromTagList(arr[x], ['a', 'area'], 'href'); if(!value) { value = modules.domUtils.getAttrValFromTagList(arr[x], ['link'], 'href'); } - + // create the key if(!out.rels[item]) { out.rels[item] = []; } - + if(typeof this.options.baseUrl === 'string' && typeof value === 'string') { - + var resolved = modules.url.resolve(value, this.options.baseUrl); // do not add duplicate rels - based on resolved URLs if(out.rels[item].indexOf(resolved) === -1){ @@ -2085,8 +2085,8 @@ var Microformats; // jshint ignore:line } z++; } - - + + var url = null; if(modules.domUtils.hasAttribute(arr[x], 'href')){ url = modules.domUtils.getAttribute(arr[x], 'href'); @@ -2094,8 +2094,8 @@ var Microformats; // jshint ignore:line url = modules.url.resolve(url, this.options.baseUrl ); } } - - + + // add to rel-urls var relUrl = this.getRelProperties(arr[x]); relUrl.rels = items; @@ -2103,15 +2103,15 @@ var Microformats; // jshint ignore:line if(url && out['rel-urls'][url] === undefined){ out['rel-urls'][url] = relUrl; } - - + + } x++; } return out; }; - - + + /** * gets the properties of a rel=* * @@ -2120,7 +2120,7 @@ var Microformats; // jshint ignore:line */ modules.Parser.prototype.getRelProperties = function(node){ var obj = {}; - + if(modules.domUtils.hasAttribute(node, 'media')){ obj.media = modules.domUtils.getAttribute(node, 'media'); } @@ -2135,12 +2135,12 @@ var Microformats; // jshint ignore:line } if(modules.utils.trim(this.getPValue(node, false)) !== ''){ obj.text = this.getPValue(node, false); - } - + } + return obj; }; - - + + /** * finds any alt rel=* mappings for a given node/microformat * @@ -2152,7 +2152,7 @@ var Microformats; // jshint ignore:line var out, map, i; - + map = this.getMapping(ufName); if(map) { for(var key in map.properties) { @@ -2160,8 +2160,8 @@ var Microformats; // jshint ignore:line var prop = map.properties[key], propName = (prop.map) ? prop.map : 'p-' + key, relCount = 0; - - // is property an alt rel=* mapping + + // is property an alt rel=* mapping if(prop.relAlt && modules.domUtils.hasAttribute(node, 'rel')) { i = prop.relAlt.length; while(i--) { @@ -2178,8 +2178,8 @@ var Microformats; // jshint ignore:line } return out; }; - - + + /** * returns whether a node or its children has rel=* microformat * @@ -2189,8 +2189,8 @@ var Microformats; // jshint ignore:line modules.Parser.prototype.hasRel = function(node) { return (this.countRels(node) > 0); }; - - + + /** * returns the number of rel=* microformats * @@ -2203,14 +2203,14 @@ var Microformats; // jshint ignore:line } return 0; }; - - - + + + } modules.utils = { - + /** * is the object a string * @@ -2220,7 +2220,7 @@ var Microformats; // jshint ignore:line isString: function( obj ) { return typeof( obj ) === 'string'; }, - + /** * is the object a number * @@ -2230,8 +2230,8 @@ var Microformats; // jshint ignore:line isNumber: function( obj ) { return !isNaN(parseFloat( obj )) && isFinite( obj ); }, - - + + /** * is the object an array * @@ -2241,8 +2241,8 @@ var Microformats; // jshint ignore:line isArray: function( obj ) { return obj && !( obj.propertyIsEnumerable( 'length' ) ) && typeof obj === 'object' && typeof obj.length === 'number'; }, - - + + /** * is the object a function * @@ -2252,8 +2252,8 @@ var Microformats; // jshint ignore:line isFunction: function(obj) { return !!(obj && obj.constructor && obj.call && obj.apply); }, - - + + /** * does the text start with a test string * @@ -2264,8 +2264,8 @@ var Microformats; // jshint ignore:line startWith: function( text, test ) { return(text.indexOf(test) === 0); }, - - + + /** * removes spaces at front and back of text * @@ -2279,8 +2279,8 @@ var Microformats; // jshint ignore:line return ''; } }, - - + + /** * replaces a character in text * @@ -2291,13 +2291,13 @@ var Microformats; // jshint ignore:line */ replaceCharAt: function( text, index, character ) { if(text && text.length > index){ - return text.substr(0, index) + character + text.substr(index+character.length); + return text.substr(0, index) + character + text.substr(index+character.length); }else{ return text; } }, - - + + /** * removes whitespace, tabs and returns from start and end of text * @@ -2308,7 +2308,7 @@ var Microformats; // jshint ignore:line if(text && text.length){ var i = text.length, x = 0; - + // turn all whitespace chars at end into spaces while (i--) { if(this.isOnlyWhiteSpace(text[i])){ @@ -2317,7 +2317,7 @@ var Microformats; // jshint ignore:line break; } } - + // turn all whitespace chars at start into spaces i = text.length; while (x < i) { @@ -2331,8 +2331,8 @@ var Microformats; // jshint ignore:line } return this.trim(text); }, - - + + /** * does text only contain whitespace characters * @@ -2342,8 +2342,8 @@ var Microformats; // jshint ignore:line isOnlyWhiteSpace: function( text ){ return !(/[^\t\n\r ]/.test( text )); }, - - + + /** * removes whitespace from text (leaves a single space) * @@ -2353,14 +2353,14 @@ var Microformats; // jshint ignore:line collapseWhiteSpace: function( text ){ return text.replace(/[\t\n\r ]+/g, ' '); }, - - + + /** * does an object have any of its own properties * * @param {Object} obj * @return {Boolean} - */ + */ hasProperties: function( obj ) { var key; for(key in obj) { @@ -2370,15 +2370,15 @@ var Microformats; // jshint ignore:line } return false; }, - - + + /** * a sort function - to sort objects in an array by a given property * * @param {String} property * @param {Boolean} reverse * @return {Int} - */ + */ sortObjects: function(property, reverse) { reverse = (reverse) ? -1 : 1; return function (a, b) { @@ -2393,7 +2393,7 @@ var Microformats; // jshint ignore:line return 0; }; } - + }; @@ -3058,75 +3058,75 @@ var Microformats; // jshint ignore:line * @param {String} dateString * @param {String} format * @return {String} - */ + */ modules.ISODate = function ( dateString, format ) { this.clear(); - + this.format = (format)? format : 'auto'; // auto or W3C or RFC3339 or HTML5 this.setFormatSep(); - - // optional should be full iso date/time string + + // optional should be full iso date/time string if(arguments[0]) { this.parse(dateString, format); } }; - + modules.ISODate.prototype = { - - + + /** * clear all states * - */ + */ clear: function(){ this.clearDate(); this.clearTime(); this.clearTimeZone(); this.setAutoProfileState(); }, - - + + /** * clear date states * - */ + */ clearDate: function(){ this.dY = -1; this.dM = -1; this.dD = -1; this.dDDD = -1; }, - - + + /** * clear time states * - */ + */ clearTime: function(){ this.tH = -1; this.tM = -1; this.tS = -1; this.tD = -1; }, - - + + /** * clear timezone states * - */ + */ clearTimeZone: function(){ this.tzH = -1; this.tzM = -1; this.tzPN = '+'; this.z = false; }, - - + + /** * resets the auto profile state * - */ + */ setAutoProfileState: function(){ this.autoProfile = { sep: 'T', @@ -3136,31 +3136,31 @@ var Microformats; // jshint ignore:line tzZulu: 'Z' }; }, - - + + /** * parses text to find ISO date/time string i.e. 2008-05-01T15:45:19Z * * @param {String} dateString * @param {String} format * @return {String} - */ + */ parse: function( dateString, format ) { this.clear(); - + var parts = [], tzArray = [], position = 0, datePart = '', timePart = '', timeZonePart = ''; - + if(format){ this.format = format; } - - - + + + // discover date time separtor for auto profile // Set to 'T' by default if(dateString.indexOf('t') > -1) { @@ -3174,47 +3174,47 @@ var Microformats; // jshint ignore:line } if(dateString.toUpperCase().indexOf('T') === -1) { this.autoProfile.sep = ' '; - } - - + } + + dateString = dateString.toUpperCase().replace(' ','T'); - + // break on 'T' divider or space if(dateString.indexOf('T') > -1) { parts = dateString.split('T'); datePart = parts[0]; timePart = parts[1]; - - // zulu UTC + + // zulu UTC if(timePart.indexOf( 'Z' ) > -1) { this.z = true; } - + // timezone if(timePart.indexOf( '+' ) > -1 || timePart.indexOf( '-' ) > -1) { tzArray = timePart.split( 'Z' ); // incase of incorrect use of Z timePart = tzArray[0]; timeZonePart = tzArray[1]; - + // timezone if(timePart.indexOf( '+' ) > -1 || timePart.indexOf( '-' ) > -1) { position = 0; - + if(timePart.indexOf( '+' ) > -1) { position = timePart.indexOf( '+' ); } else { position = timePart.indexOf( '-' ); } - + timeZonePart = timePart.substring( position, timePart.length ); timePart = timePart.substring( 0, position ); } } - + } else { datePart = dateString; } - + if(datePart !== '') { this.parseDate( datePart ); if(timePart !== '') { @@ -3226,25 +3226,25 @@ var Microformats; // jshint ignore:line } return this.toString( format ); }, - - + + /** * parses text to find just the date element of an ISO date/time string i.e. 2008-05-01 * * @param {String} dateString * @param {String} format * @return {String} - */ + */ parseDate: function( dateString, format ) { this.clearDate(); - + var parts = []; - + // discover timezone separtor for auto profile // default is ':' if(dateString.indexOf('-') === -1) { this.autoProfile.tsep = ''; - } - + } + // YYYY-DDD parts = dateString.match( /(\d\d\d\d)-(\d\d\d)/ ); if(parts) { @@ -3255,7 +3255,7 @@ var Microformats; // jshint ignore:line this.dDDD = parts[2]; } } - + if(this.dDDD === -1) { // YYYY-MM-DD ie 2008-05-01 and YYYYMMDD ie 20080501 parts = dateString.match( /(\d\d\d\d)?-?(\d\d)?-?(\d\d)?/ ); @@ -3271,24 +3271,24 @@ var Microformats; // jshint ignore:line } return this.toString(format); }, - - + + /** * parses text to find just the time element of an ISO date/time string i.e. 13:30:45 * * @param {String} timeString * @param {String} format * @return {String} - */ + */ parseTime: function( timeString, format ) { this.clearTime(); var parts = []; - + // discover date separtor for auto profile // default is ':' if(timeString.indexOf(':') === -1) { this.autoProfile.tsep = ''; - } - + } + // finds timezone HH:MM:SS and HHMMSS ie 13:30:45, 133045 and 13:30:45.0135 parts = timeString.match( /(\d\d)?:?(\d\d)?:?(\d\d)?.?([0-9]+)?/ ); if(parts[1]) { @@ -3305,30 +3305,30 @@ var Microformats; // jshint ignore:line } return this.toTimeString(format); }, - - + + /** * parses text to find just the time element of an ISO date/time string i.e. +08:00 * * @param {String} timeString * @param {String} format * @return {String} - */ + */ parseTimeZone: function( timeString, format ) { this.clearTimeZone(); var parts = []; - + if(timeString.toLowerCase() === 'z'){ this.z = true; // set case for z this.autoProfile.tzZulu = (timeString === 'z')? 'z' : 'Z'; }else{ - + // discover timezone separtor for auto profile // default is ':' if(timeString.indexOf(':') === -1) { this.autoProfile.tzsep = ''; - } - + } + // finds timezone +HH:MM and +HHMM ie +13:30 and +1330 parts = timeString.match( /([\-\+]{1})?(\d\d)?:?(\d\d)?/ ); if(parts[1]) { @@ -3339,29 +3339,29 @@ var Microformats; // jshint ignore:line } if(parts[3]) { this.tzM = parts[3]; - } - - + } + + } - this.tzZulu = 'z'; + this.tzZulu = 'z'; return this.toTimeString( format ); }, - - + + /** * returns ISO date/time string in W3C Note, RFC 3339, HTML5, or auto profile * * @param {String} format * @return {String} - */ + */ toString: function( format ) { var output = ''; - + if(format){ this.format = format; } this.setFormatSep(); - + if(this.dY > -1) { output = this.dY; if(this.dM > 0 && this.dM < 13) { @@ -3379,26 +3379,26 @@ var Microformats; // jshint ignore:line } else if(this.tH > -1) { output += this.toTimeString( format ); } - + return output; }, - - + + /** * returns just the time string element of an ISO date/time * in W3C Note, RFC 3339, HTML5, or auto profile * * @param {String} format * @return {String} - */ + */ toTimeString: function( format ) { var out = ''; - + if(format){ this.format = format; } this.setFormatSep(); - + // time can only be created with a full date if(this.tH) { if(this.tH > -1 && this.tH < 25) { @@ -3412,10 +3412,10 @@ var Microformats; // jshint ignore:line } } } - - - - // time zone offset + + + + // time zone offset if(this.z) { out += this.tzZulu; } else { @@ -3430,12 +3430,12 @@ var Microformats; // jshint ignore:line } return out; }, - - + + /** * set the current profile to W3C Note, RFC 3339, HTML5, or auto profile * - */ + */ setFormatSep: function() { switch( this.format.toLowerCase() ) { case 'rfc3339': @@ -3468,54 +3468,54 @@ var Microformats; // jshint ignore:line this.tzZulu = this.autoProfile.tzZulu; } }, - - + + /** * does current data contain a full date i.e. 2015-03-23 * * @return {Boolean} - */ + */ hasFullDate: function() { return(this.dY !== -1 && this.dM !== -1 && this.dD !== -1); }, - - + + /** * does current data contain a minimum date which is just a year number i.e. 2015 * * @return {Boolean} - */ + */ hasDate: function() { return(this.dY !== -1); }, - - + + /** * does current data contain a minimum time which is just a hour number i.e. 13 * * @return {Boolean} - */ + */ hasTime: function() { return(this.tH !== -1); }, - + /** * does current data contain a minimum timezone i.e. -1 || +1 || z * * @return {Boolean} - */ + */ hasTimeZone: function() { return(this.tzH !== -1); } - + }; - + modules.ISODate.prototype.constructor = modules.ISODate; modules.dates = { - + /** * does text contain am * @@ -3526,8 +3526,8 @@ var Microformats; // jshint ignore:line text = text.toLowerCase(); return(text.indexOf('am') > -1 || text.indexOf('a.m.') > -1); }, - - + + /** * does text contain pm * @@ -3538,8 +3538,8 @@ var Microformats; // jshint ignore:line text = text.toLowerCase(); return(text.indexOf('pm') > -1 || text.indexOf('p.m.') > -1); }, - - + + /** * remove am and pm from text and return it * @@ -3549,8 +3549,8 @@ var Microformats; // jshint ignore:line removeAMPM: function( text ) { return text.replace('pm', '').replace('p.m.', '').replace('am', '').replace('a.m.', ''); }, - - + + /** * simple test of whether ISO date string is a duration i.e. PY17M or PW12 * @@ -3566,15 +3566,15 @@ var Microformats; // jshint ignore:line } return false; }, - - + + /** * is text a time or timezone * i.e. HH-MM-SS or z+-HH-MM-SS 08:43 | 15:23:00:0567 | 10:34pm | 10:34 p.m. | +01:00:00 | -02:00 | z15:00 | 0843 * * @param {String} text * @return {Boolean} - */ + */ isTime: function( text ) { if(modules.utils.isString(text)){ text = text.toLowerCase(); @@ -3584,7 +3584,7 @@ var Microformats; // jshint ignore:line return true; } // has ante meridiem or post meridiem - if( text.match(/^[0-9]/) && + if( text.match(/^[0-9]/) && ( this.hasAM(text) || this.hasPM(text) )) { return true; } @@ -3592,7 +3592,7 @@ var Microformats; // jshint ignore:line if( text.match(':') && !text.match(/t|\s/) ) { return true; } - + // if it's a number of 2, 4 or 6 chars if(modules.utils.isNumber(text)){ if(text.length === 2 || text.length === 4 || text.length === 6){ @@ -3602,7 +3602,7 @@ var Microformats; // jshint ignore:line } return false; }, - + /** * parses a time from text and returns 24hr time string @@ -3610,18 +3610,18 @@ var Microformats; // jshint ignore:line * * @param {String} text * @return {String} - */ + */ parseAmPmTime: function( text ) { var out = text, times = []; - + // if the string has a text : or am or pm if(modules.utils.isString(out)) { //text = text.toLowerCase(); text = text.replace(/[ ]+/g, ''); - + if(text.match(':') || this.hasAM(text) || this.hasPM(text)) { - + if(text.match(':')) { times = text.split(':'); } else { @@ -3629,31 +3629,31 @@ var Microformats; // jshint ignore:line times[0] = text; times[0] = this.removeAMPM(times[0]); } - + // change pm hours to 24hr number if(this.hasPM(text)) { if(times[0] < 12) { times[0] = parseInt(times[0], 10) + 12; } } - + // add leading zero's where needed if(times[0] && times[0].length === 1) { times[0] = '0' + times[0]; } - + // rejoin text elements together if(times[0]) { text = times.join(':'); } } } - + // remove am/pm strings return this.removeAMPM(text); }, - - + + /** * overlays a time on a date to return the union of the two * @@ -3661,11 +3661,11 @@ var Microformats; // jshint ignore:line * @param {String} time * @param {String} format ( Modules.ISODate profile format ) * @return {Object} Modules.ISODate - */ + */ dateTimeUnion: function(date, time, format) { var isodate = new modules.ISODate(date, format), isotime = new modules.ISODate(); - + isotime.parseTime(this.parseAmPmTime(time), format); if(isodate.hasFullDate() && isotime.hasTime()) { isodate.tH = isotime.tH; @@ -3680,8 +3680,8 @@ var Microformats; // jshint ignore:line return new modules.ISODate(); } }, - - + + /** * concatenate an array of date and time text fragments to create an ISODate object * used for microformat value and value-title rules @@ -3689,65 +3689,65 @@ var Microformats; // jshint ignore:line * @param {Array} arr ( Array of Strings ) * @param {String} format ( Modules.ISODate profile format ) * @return {Object} Modules.ISODate - */ + */ concatFragments: function (arr, format) { var out = new modules.ISODate(), i = 0, value = ''; - - // if the fragment already contains a full date just return it once + + // if the fragment already contains a full date just return it once if(arr[0].toUpperCase().match('T')) { return new modules.ISODate(arr[0], format); }else{ for(i = 0; i < arr.length; i++) { value = arr[i]; - + // date pattern if( value.charAt(4) === '-' && out.hasFullDate() === false ){ out.parseDate(value); } - + // time pattern if( (value.indexOf(':') > -1 || modules.utils.isNumber( this.parseAmPmTime(value) )) && out.hasTime() === false ) { // split time and timezone var items = this.splitTimeAndZone(value); value = items[0]; - + // parse any use of am/pm value = this.parseAmPmTime(value); out.parseTime(value); - - // parse any timezone + + // parse any timezone if(items.length > 1){ out.parseTimeZone(items[1], format); } } - + // timezone pattern if(value.charAt(0) === '-' || value.charAt(0) === '+' || value.toUpperCase() === 'Z') { if( out.hasTimeZone() === false ){ out.parseTimeZone(value); } } - + } return out; - + } }, - - + + /** * parses text by splitting it into an array of time and timezone strings * * @param {String} text * @return {Array} Modules.ISODate - */ + */ splitTimeAndZone: function ( text ){ var out = [text], chars = ['-','+','z','Z'], i = chars.length; - + while (i--) { if(text.indexOf(chars[i]) > -1){ out[0] = text.slice( 0, text.indexOf(chars[i]) ); @@ -3757,28 +3757,28 @@ var Microformats; // jshint ignore:line } return out; } - + }; modules.text = { - + // normalised or whitespace or whitespacetrimmed - textFormat: 'whitespacetrimmed', - + textFormat: 'whitespacetrimmed', + // block level tags, used to add line returns blockLevelTags: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'hr', 'pre', 'table', - 'address', 'article', 'aside', 'blockquote', 'caption', 'col', 'colgroup', 'dd', 'div', - 'dt', 'dir', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'header', 'hgroup', 'hr', - 'li', 'map', 'menu', 'nav', 'optgroup', 'option', 'section', 'tbody', 'testarea', + 'address', 'article', 'aside', 'blockquote', 'caption', 'col', 'colgroup', 'dd', 'div', + 'dt', 'dir', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'header', 'hgroup', 'hr', + 'li', 'map', 'menu', 'nav', 'optgroup', 'option', 'section', 'tbody', 'testarea', 'tfoot', 'th', 'thead', 'tr', 'td', 'ul', 'ol', 'dl', 'details'], - // tags to exclude + // tags to exclude excludeTags: ['noframe', 'noscript', 'template', 'script', 'style', 'frames', 'frameset'], - - + + /** - * parses the text from the DOM Node + * parses the text from the DOM Node * * @param {DOM Node} node * @param {String} textFormat @@ -3798,54 +3798,54 @@ var Microformats; // jshint ignore:line return this.formatText( doc, modules.domUtils.textContent(node), this.textFormat ); } }, - - + + /** - * parses the text from a html string + * parses the text from a html string * * @param {DOM Document} doc * @param {String} text * @param {String} textFormat * @return {String} - */ + */ parseText: function( doc, text, textFormat ){ var node = modules.domUtils.createNodeWithText( 'div', text ); return this.parse( doc, node, textFormat ); }, - - + + /** * parses the text from a html string - only for whitespace or whitespacetrimmed formats * * @param {String} text * @param {String} textFormat * @return {String} - */ + */ formatText: function( doc, text, textFormat ){ this.textFormat = (textFormat)? textFormat : this.textFormat; if(text){ var out = '', regex = /(<([^>]+)>)/ig; - - out = text.replace(regex, ''); - if(this.textFormat === 'whitespacetrimmed') { + + out = text.replace(regex, ''); + if(this.textFormat === 'whitespacetrimmed') { out = modules.utils.trimWhitespace( out ); } - + //return entities.decode( out, 2 ); return modules.domUtils.decodeEntities( doc, out ); }else{ - return ''; + return ''; } }, - - + + /** - * normalises whitespace in given text + * normalises whitespace in given text * * @param {String} text * @return {String} - */ + */ normalise: function( doc, text ){ text = text.replace( / /g, ' ') ; // exchanges html entity for space into space char text = modules.utils.collapseWhiteSpace( text ); // removes linefeeds, tabs and addtional spaces @@ -3853,27 +3853,27 @@ var Microformats; // jshint ignore:line text = text.replace( '–', '-' ); // correct dash decoding return modules.utils.trim( text ); }, - - + + /** * walks DOM tree parsing the text from DOM Nodes * * @param {DOM Node} node * @return {String} - */ + */ walkTreeForText: function( node ) { var out = '', j = 0; - + if(node.tagName && this.excludeTags.indexOf( node.tagName.toLowerCase() ) > -1){ return out; } - + // if node is a text node get its text if(node.nodeType && node.nodeType === 3){ - out += modules.domUtils.getElementText( node ); + out += modules.domUtils.getElementText( node ); } - + // get the text of the child nodes if(node.childNodes && node.childNodes.length > 0){ for (j = 0; j < node.childNodes.length; j++) { @@ -3883,34 +3883,34 @@ var Microformats; // jshint ignore:line } } } - + // if it's a block level tag add an additional space at the end if(node.tagName && this.blockLevelTags.indexOf( node.tagName.toLowerCase() ) !== -1){ out += ' '; - } - + } + return (out === '')? undefined : out ; } - + }; modules.html = { - + // elements which are self-closing selfClosingElt: ['area', 'base', 'br', 'col', 'hr', 'img', 'input', 'link', 'meta', 'param', 'command', 'keygen', 'source'], - + /** * parse the html string from DOM Node * * @param {DOM Node} node * @return {String} - */ + */ parse: function( node ){ var out = '', j = 0; - + // we do not want the outer container if(node.childNodes && node.childNodes.length > 0){ for (j = 0; j < node.childNodes.length; j++) { @@ -3920,47 +3920,47 @@ var Microformats; // jshint ignore:line } } } - + return out; }, - - + + /** * walks the DOM tree parsing the html string from the nodes * * @param {DOM Document} doc * @param {DOM Node} node * @return {String} - */ + */ walkTreeForHtml: function( node ) { var out = '', j = 0; - + // if node is a text node get its text if(node.nodeType && node.nodeType === 3){ - out += modules.domUtils.getElementText( node ); + out += modules.domUtils.getElementText( node ); } - - - // exclude text which has been added with include pattern - + + + // exclude text which has been added with include pattern - if(node.nodeType && node.nodeType === 1 && modules.domUtils.hasAttribute(node, 'data-include') === false){ - + // begin tag - out += '<' + node.tagName.toLowerCase(); - + out += '<' + node.tagName.toLowerCase(); + // add attributes var attrs = modules.domUtils.getOrderedAttributes(node); for (j = 0; j < attrs.length; j++) { out += ' ' + attrs[j].name + '=' + '"' + attrs[j].value + '"'; } - + if(this.selfClosingElt.indexOf(node.tagName.toLowerCase()) === -1){ out += '>'; } - + // get the text of the child nodes if(node.childNodes && node.childNodes.length > 0){ - + for (j = 0; j < node.childNodes.length; j++) { var text = this.walkTreeForHtml( node.childNodes[j] ); if(text !== undefined){ @@ -3968,19 +3968,19 @@ var Microformats; // jshint ignore:line } } } - + // end tag if(this.selfClosingElt.indexOf(node.tagName.toLowerCase()) > -1){ - out += ' />'; + out += ' />'; }else{ - out += ''; + out += ''; } - } - + } + return (out === '')? undefined : out; - } - - + } + + }; @@ -4025,7 +4025,7 @@ var Microformats; // jshint ignore:line 'map': 'u-email' }, 'geo': { - 'map': 'p-geo', + 'map': 'p-geo', 'uf': ['h-geo'] }, 'key': { @@ -4092,7 +4092,7 @@ var Microformats; // jshint ignore:line 'updated': { 'map': 'dt-updated' }, - 'author': { + 'author': { 'uf': ['h-card'] }, 'category': { @@ -4100,7 +4100,7 @@ var Microformats; // jshint ignore:line 'relAlt': ['tag'] }, 'geo': { - 'map': 'p-geo', + 'map': 'p-geo', 'uf': ['h-geo'] }, 'latitude': {}, @@ -4113,7 +4113,7 @@ var Microformats; // jshint ignore:line }; - modules.maps['h-event'] = { + modules.maps['h-event'] = { root: 'vevent', name: 'h-event', properties: { @@ -4159,7 +4159,7 @@ var Microformats; // jshint ignore:line 'map': 'u-attach' }, 'status': {}, - 'rdate': {}, + 'rdate': {}, 'rrule': {} } }; @@ -4176,7 +4176,7 @@ var Microformats; // jshint ignore:line 'summary': { 'map': 'p-summary' }, - 'author': { + 'author': { 'uf': ['h-card'] }, 'url': { @@ -4269,7 +4269,7 @@ var Microformats; // jshint ignore:line 'map': 'u-item-license' }, 'principles': { - 'map': 'u-principles', + 'map': 'u-principles', 'relAlt': ['principles'] } } @@ -4396,7 +4396,7 @@ var Microformats; // jshint ignore:line 'rating': {}, 'average': {}, 'best': {}, - 'worst': {}, + 'worst': {}, 'count': {}, 'votes': {}, 'category': { @@ -4448,26 +4448,26 @@ var Microformats; // jshint ignore:line modules.rels = { // xfn - 'friend': [ 'yes','external'], - 'acquaintance': [ 'yes','external'], - 'contact': [ 'yes','external'], - 'met': [ 'yes','external'], - 'co-worker': [ 'yes','external'], - 'colleague': [ 'yes','external'], - 'co-resident': [ 'yes','external'], - 'neighbor': [ 'yes','external'], - 'child': [ 'yes','external'], - 'parent': [ 'yes','external'], - 'sibling': [ 'yes','external'], - 'spouse': [ 'yes','external'], - 'kin': [ 'yes','external'], - 'muse': [ 'yes','external'], - 'crush': [ 'yes','external'], - 'date': [ 'yes','external'], - 'sweetheart': [ 'yes','external'], - 'me': [ 'yes','external'], - - // other rel=* + 'friend': [ 'yes','external'], + 'acquaintance': [ 'yes','external'], + 'contact': [ 'yes','external'], + 'met': [ 'yes','external'], + 'co-worker': [ 'yes','external'], + 'colleague': [ 'yes','external'], + 'co-resident': [ 'yes','external'], + 'neighbor': [ 'yes','external'], + 'child': [ 'yes','external'], + 'parent': [ 'yes','external'], + 'sibling': [ 'yes','external'], + 'spouse': [ 'yes','external'], + 'kin': [ 'yes','external'], + 'muse': [ 'yes','external'], + 'crush': [ 'yes','external'], + 'date': [ 'yes','external'], + 'sweetheart': [ 'yes','external'], + 'me': [ 'yes','external'], + + // other rel=* 'license': [ 'yes','yes'], 'nofollow': [ 'no','external'], 'tag': [ 'no','yes'], @@ -4480,7 +4480,7 @@ var Microformats; // jshint ignore:line 'pronunciation': [ 'no','external'], 'payment': [ 'no','external'], 'principles': [ 'no','external'] - + }; @@ -4489,43 +4489,43 @@ var Microformats; // jshint ignore:line version: modules.version, livingStandard: modules.livingStandard }; - - + + External.get = function(options){ var parser = new modules.Parser(); addV1(parser, options); return parser.get( options ); }; - - + + External.getParent = function(node, options){ var parser = new modules.Parser(); addV1(parser, options); return parser.getParent( node, options ); }; - - + + External.count = function(options){ var parser = new modules.Parser(); addV1(parser, options); return parser.count( options ); }; - - + + External.isMicroformat = function( node, options ){ var parser = new modules.Parser(); addV1(parser, options); return parser.isMicroformat( node, options ); }; - - + + External.hasMicroformats = function( node, options ){ var parser = new modules.Parser(); addV1(parser, options); return parser.hasMicroformats( node, options ); }; - - + + function addV1(parser, options){ if(options && options.maps){ if(Array.isArray(options.maps)){ @@ -4535,11 +4535,11 @@ var Microformats; // jshint ignore:line } } } - - + + return External; - - + + })); try { // mozilla jsm support diff --git a/toolkit/components/microformats/test/interface-tests/count-test.js b/toolkit/components/microformats/test/interface-tests/count-test.js index 74b5a0f0f2..baac56c2b4 100644 --- a/toolkit/components/microformats/test/interface-tests/count-test.js +++ b/toolkit/components/microformats/test/interface-tests/count-test.js @@ -6,102 +6,102 @@ assert = chai.assert; describe('Microformat.count', function() { - + it('count', function(){ - + var doc, node, result; - - var html = 'GlennJaneEvent2015-07-01'; - - + + var html = 'GlennJaneEvent2015-07-01'; + + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); node.innerHTML = html; - doc.body.appendChild(node); - + doc.body.appendChild(node); + options ={ 'node': node, }; result = Microformats.count(options); assert.deepEqual( result, {'h-event': 1,'h-card': 2} ); - + }); - - + + it('count rels', function(){ - + var doc, node, result; - - var html = 'GlennJaneEvent2015-07-01'; - - + + var html = 'GlennJaneEvent2015-07-01'; + + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); node.innerHTML = html; - doc.body.appendChild(node); - + doc.body.appendChild(node); + options ={ 'node': node, }; result = Microformats.count(options); assert.deepEqual( result, {'h-event': 1,'h-card': 2, 'rels': 1} ); - + }); - - + + it('count - no results', function(){ - + var doc, node, result; - - var html = 'Jane'; - - + + var html = 'Jane'; + + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); node.innerHTML = html; - doc.body.appendChild(node); - + doc.body.appendChild(node); + options ={ 'node': node, }; result = Microformats.count(options); assert.deepEqual( result, {} ); - + }); - - - + + + it('count - no options', function(){ - + var result; - + result = Microformats.count({}); assert.deepEqual( result, {} ); - + }); - - + + it('count - options.html', function(){ - + var options = {}, result; - - options.html = 'GlennJaneEvent2015-07-01'; + + options.html = 'GlennJaneEvent2015-07-01'; result = Microformats.count(options); assert.deepEqual( result, {'h-event': 1,'h-card': 2} ); - + }); - - - + + + }); diff --git a/toolkit/components/microformats/test/interface-tests/experimental-test.js b/toolkit/components/microformats/test/interface-tests/experimental-test.js index 9eec6d739c..4d32b83c05 100644 --- a/toolkit/components/microformats/test/interface-tests/experimental-test.js +++ b/toolkit/components/microformats/test/interface-tests/experimental-test.js @@ -8,7 +8,7 @@ assert = chai.assert; describe('experimental', function() { it('h-geo - geo data writen as lat;lon', function(){ - + var expected = { 'items': [{ 'type': ['h-geo'], @@ -20,7 +20,7 @@ describe('experimental', function() { }], 'rels': {}, 'rel-urls': {} - }, + }, options = { 'html': '
30.267991;-97.739568
', 'baseUrl': 'http://example.com', @@ -30,8 +30,8 @@ describe('experimental', function() { var result = Microformats.get(options); assert.deepEqual( result, expected ); - + }); - - + + }); diff --git a/toolkit/components/microformats/test/interface-tests/getParent-test.js b/toolkit/components/microformats/test/interface-tests/getParent-test.js index 220f7155cc..56ccbb2ba7 100644 --- a/toolkit/components/microformats/test/interface-tests/getParent-test.js +++ b/toolkit/components/microformats/test/interface-tests/getParent-test.js @@ -6,7 +6,7 @@ assert = chai.assert; describe('Microformat.getParent', function() { - + var HTML = '
Pub2015-07-01t17:30z
'; var emptyExpected = { "items": [], @@ -33,93 +33,93 @@ describe('Microformat.getParent', function() { "rel-urls": {} }; var options = {'dateFormat': 'html5'}; - - - + + + it('getParent with parent', function(){ - + var doc, node, span, result; - + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); node.innerHTML = HTML; doc.body.appendChild(node); - span = doc.querySelector('.dt-start'); - + span = doc.querySelector('.dt-start'); + result = Microformats.getParent(span,options); assert.deepEqual( result, expected ); - + }); - - - + + + it('getParent without parent', function(){ - + var doc, node, parser, result; - + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); node.innerHTML = HTML; doc.body.appendChild(node); - + result = Microformats.getParent(node,options); assert.deepEqual( result, emptyExpected ); - + }); - - + + it('getParent found with option.filters', function(){ - + var doc, node, span, result; - + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); node.innerHTML = HTML; doc.body.appendChild(node); - span = doc.querySelector('.dt-start'); - + span = doc.querySelector('.dt-start'); + result = Microformats.getParent( span, {'filters': ['h-event'], 'dateFormat': 'html5'} ); assert.deepEqual( result, expected ); - + }); - - + + it('getParent not found with option.filters', function(){ - + var doc, node, span, result; - + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); node.innerHTML = HTML; doc.body.appendChild(node); - span = doc.querySelector('.dt-start'); + span = doc.querySelector('.dt-start'); result = Microformats.getParent( span, {'filters': ['h-card'], 'dateFormat': 'html5'} ); assert.deepEqual( result, emptyExpected ); - + }); - - + + it('getParent use option.filters to up through h-*', function(){ - + var doc, node, span, result; - + var altHTML = '

test

this
Glenn Jones2015-07-01t17:30z
'; var altExpected = { "items": [ @@ -162,27 +162,27 @@ describe('Microformat.getParent', function() { "rels": {}, "rel-urls": {} }; - - + + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); node.innerHTML = altHTML; doc.body.appendChild(node); - span = doc.querySelector('.h-card .p-name'); - + span = doc.querySelector('.h-card .p-name'); + result = Microformats.getParent( span, {'filters': ['h-entry'], 'dateFormat': 'html5'} ); assert.deepEqual( result, altExpected ); - + }); - - + + it('getParent stop at first h-* parent', function(){ - + var doc, node, span, result; - + var altHTML = '

test

this
Glenn Jones2015-07-01t17:30z
'; var altExpected = { "items": [ @@ -198,23 +198,23 @@ describe('Microformat.getParent', function() { "http://glennjones.net" ] } - } + } ], "rels": {}, "rel-urls": {} }; - - + + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); node.innerHTML = altHTML; doc.body.appendChild(node); - span = doc.querySelector('.h-card .p-name'); - + span = doc.querySelector('.h-card .p-name'); + result = Microformats.getParent( span, options ); assert.deepEqual( result, altExpected ); - + }); - - + + }); diff --git a/toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js b/toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js index 84f7e32a43..98c79a8551 100644 --- a/toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js +++ b/toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js @@ -6,180 +6,180 @@ assert = chai.assert; describe('Microformat.hasMicroformats', function() { - + it('true - v2 on node', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'a' ); + node = doc.querySelector( 'a' ); assert.isTrue( Microformats.hasMicroformats( node ) ); - + }); - - + + it('true - v1 on node', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'a' ); + node = doc.querySelector( 'a' ); assert.isTrue( Microformats.hasMicroformats( node ) ); - + }); - - + + it('true - v2 filter on node', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'a' ); + node = doc.querySelector( 'a' ); assert.isTrue( Microformats.hasMicroformats( node, {'filters': ['h-card']} ) ); - + }); - - + + it('true - v1 filter on node', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'a' ); + node = doc.querySelector( 'a' ); assert.isTrue( Microformats.hasMicroformats( node, {'filters': ['h-card']} ) ); - + }); - - + + it('false - v2 filter on node', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'a' ); + node = doc.querySelector( 'a' ); assert.isFalse( Microformats.hasMicroformats( node, {'filters': ['h-entry']} ) ); - + }); - - - + + + it('false - property', function(){ - + var doc, node, parser; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'span' ); + node = doc.querySelector( 'span' ); assert.isFalse( Microformats.hasMicroformats( node ) ); - + }); - - + + it('false - no class', function(){ - + var doc, node, parser; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'span' ); + node = doc.querySelector( 'span' ); assert.isFalse( Microformats.hasMicroformats( node ) ); - + }); - - + + it('false - no node', function(){ assert.isFalse( Microformats.hasMicroformats( ) ); }); - - + + it('false - undefined node', function(){ assert.isFalse( Microformats.hasMicroformats( undefined ) ); }); - - + + it('true - child', function(){ - + var doc, node; - - var html = '
'; - + + var html = '
'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; assert.isTrue( Microformats.hasMicroformats( node ) ); - + }); - - - + + + it('true - document', function(){ - + var doc, node; - - var html = '
'; - + + var html = '
'; + var dom = new DOMParser(); doc = dom.parseFromString( html, 'text/html' ); assert.isTrue( Microformats.hasMicroformats( doc ) ); - + }); - - - - - + + + + + }); diff --git a/toolkit/components/microformats/test/interface-tests/isMicroformat-test.js b/toolkit/components/microformats/test/interface-tests/isMicroformat-test.js index 2d8e6f2a63..7081b28804 100644 --- a/toolkit/components/microformats/test/interface-tests/isMicroformat-test.js +++ b/toolkit/components/microformats/test/interface-tests/isMicroformat-test.js @@ -6,141 +6,141 @@ assert = chai.assert; describe('Microformat.isMicroformat', function() { - + it('true - v2', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'a' ); + node = doc.querySelector( 'a' ); assert.isTrue( Microformats.isMicroformat( node ) ); - + }); - - + + it('true - v1', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'a' ); + node = doc.querySelector( 'a' ); assert.isTrue( Microformats.isMicroformat( node ) ); - + }); - - + + it('true - v2 filter', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'a' ); + node = doc.querySelector( 'a' ); assert.isTrue( Microformats.isMicroformat( node, {'filters': ['h-card']} ) ); - + }); - - + + it('true - v1 filter', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'a' ); + node = doc.querySelector( 'a' ); assert.isTrue( Microformats.isMicroformat( node, {'filters': ['h-card']} ) ); - + }); - - + + it('false - v2 filter', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'a' ); + node = doc.querySelector( 'a' ); assert.isFalse( Microformats.isMicroformat( node, {'filters': ['h-entry']} ) ); - + }); - - - + + + it('false - property', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'span' ); + node = doc.querySelector( 'span' ); assert.isFalse( Microformats.isMicroformat( node ) ); - + }); - - + + it('false - no class', function(){ - + var doc, node; - - var html = 'Glenn'; - + + var html = 'Glenn'; + doc = document.implementation.createHTMLDocument('New Document'); node = document.createElement('div'); doc.body.appendChild( node ); node.innerHTML = html; - node = doc.querySelector( 'span' ); + node = doc.querySelector( 'span' ); assert.isFalse( Microformats.isMicroformat( node ) ); - + }); - - + + it('false - no node', function(){ assert.isFalse( Microformats.isMicroformat( ) ); }); - - + + it('false - undefined node', function(){ assert.isFalse( Microformats.isMicroformat( undefined ) ); }); - + }); diff --git a/toolkit/components/microformats/test/lib/dates.js b/toolkit/components/microformats/test/lib/dates.js index 394ac291ba..6d6129b083 100644 --- a/toolkit/components/microformats/test/lib/dates.js +++ b/toolkit/components/microformats/test/lib/dates.js @@ -2,7 +2,7 @@ dates These functions are based on microformats implied rules for parsing date fragments from text. They are not generalist date utilities and should only be used with the isodate.js module of this library. - + Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt Dependencies utilities.js, isodate.js @@ -10,10 +10,10 @@ var Modules = (function (modules) { - + modules.dates = { - + /** * does text contain am * @@ -24,8 +24,8 @@ var Modules = (function (modules) { text = text.toLowerCase(); return(text.indexOf('am') > -1 || text.indexOf('a.m.') > -1); }, - - + + /** * does text contain pm * @@ -36,8 +36,8 @@ var Modules = (function (modules) { text = text.toLowerCase(); return(text.indexOf('pm') > -1 || text.indexOf('p.m.') > -1); }, - - + + /** * remove am and pm from text and return it * @@ -47,8 +47,8 @@ var Modules = (function (modules) { removeAMPM: function( text ) { return text.replace('pm', '').replace('p.m.', '').replace('am', '').replace('a.m.', ''); }, - - + + /** * simple test of whether ISO date string is a duration i.e. PY17M or PW12 * @@ -64,15 +64,15 @@ var Modules = (function (modules) { } return false; }, - - + + /** * is text a time or timezone * i.e. HH-MM-SS or z+-HH-MM-SS 08:43 | 15:23:00:0567 | 10:34pm | 10:34 p.m. | +01:00:00 | -02:00 | z15:00 | 0843 * * @param {String} text * @return {Boolean} - */ + */ isTime: function( text ) { if(modules.utils.isString(text)){ text = text.toLowerCase(); @@ -82,7 +82,7 @@ var Modules = (function (modules) { return true; } // has ante meridiem or post meridiem - if( text.match(/^[0-9]/) && + if( text.match(/^[0-9]/) && ( this.hasAM(text) || this.hasPM(text) )) { return true; } @@ -90,7 +90,7 @@ var Modules = (function (modules) { if( text.match(':') && !text.match(/t|\s/) ) { return true; } - + // if it's a number of 2, 4 or 6 chars if(modules.utils.isNumber(text)){ if(text.length === 2 || text.length === 4 || text.length === 6){ @@ -100,7 +100,7 @@ var Modules = (function (modules) { } return false; }, - + /** * parses a time from text and returns 24hr time string @@ -108,18 +108,18 @@ var Modules = (function (modules) { * * @param {String} text * @return {String} - */ + */ parseAmPmTime: function( text ) { var out = text, times = []; - + // if the string has a text : or am or pm if(modules.utils.isString(out)) { //text = text.toLowerCase(); text = text.replace(/[ ]+/g, ''); - + if(text.match(':') || this.hasAM(text) || this.hasPM(text)) { - + if(text.match(':')) { times = text.split(':'); } else { @@ -127,31 +127,31 @@ var Modules = (function (modules) { times[0] = text; times[0] = this.removeAMPM(times[0]); } - + // change pm hours to 24hr number if(this.hasPM(text)) { if(times[0] < 12) { times[0] = parseInt(times[0], 10) + 12; } } - + // add leading zero's where needed if(times[0] && times[0].length === 1) { times[0] = '0' + times[0]; } - + // rejoin text elements together if(times[0]) { text = times.join(':'); } } } - + // remove am/pm strings return this.removeAMPM(text); }, - - + + /** * overlays a time on a date to return the union of the two * @@ -159,11 +159,11 @@ var Modules = (function (modules) { * @param {String} time * @param {String} format ( Modules.ISODate profile format ) * @return {Object} Modules.ISODate - */ + */ dateTimeUnion: function(date, time, format) { var isodate = new modules.ISODate(date, format), isotime = new modules.ISODate(); - + isotime.parseTime(this.parseAmPmTime(time), format); if(isodate.hasFullDate() && isotime.hasTime()) { isodate.tH = isotime.tH; @@ -178,8 +178,8 @@ var Modules = (function (modules) { return new modules.ISODate(); } }, - - + + /** * concatenate an array of date and time text fragments to create an ISODate object * used for microformat value and value-title rules @@ -187,65 +187,65 @@ var Modules = (function (modules) { * @param {Array} arr ( Array of Strings ) * @param {String} format ( Modules.ISODate profile format ) * @return {Object} Modules.ISODate - */ + */ concatFragments: function (arr, format) { var out = new modules.ISODate(), i = 0, value = ''; - - // if the fragment already contains a full date just return it once + + // if the fragment already contains a full date just return it once if(arr[0].toUpperCase().match('T')) { return new modules.ISODate(arr[0], format); }else{ for(i = 0; i < arr.length; i++) { value = arr[i]; - + // date pattern if( value.charAt(4) === '-' && out.hasFullDate() === false ){ out.parseDate(value); } - + // time pattern if( (value.indexOf(':') > -1 || modules.utils.isNumber( this.parseAmPmTime(value) )) && out.hasTime() === false ) { // split time and timezone var items = this.splitTimeAndZone(value); value = items[0]; - + // parse any use of am/pm value = this.parseAmPmTime(value); out.parseTime(value); - - // parse any timezone + + // parse any timezone if(items.length > 1){ out.parseTimeZone(items[1], format); } } - + // timezone pattern if(value.charAt(0) === '-' || value.charAt(0) === '+' || value.toUpperCase() === 'Z') { if( out.hasTimeZone() === false ){ out.parseTimeZone(value); } } - + } return out; - + } }, - - + + /** * parses text by splitting it into an array of time and timezone strings * * @param {String} text * @return {Array} Modules.ISODate - */ + */ splitTimeAndZone: function ( text ){ var out = [text], chars = ['-','+','z','Z'], i = chars.length; - + while (i--) { if(text.indexOf(chars[i]) > -1){ out[0] = text.slice( 0, text.indexOf(chars[i]) ); @@ -255,7 +255,7 @@ var Modules = (function (modules) { } return out; } - + }; diff --git a/toolkit/components/microformats/test/lib/html.js b/toolkit/components/microformats/test/lib/html.js index 0b1ca516d8..ab150d91e3 100644 --- a/toolkit/components/microformats/test/lib/html.js +++ b/toolkit/components/microformats/test/lib/html.js @@ -1,9 +1,9 @@ /* - html - Extracts a HTML string from DOM nodes. Was created to get around the issue of not being able to exclude the content - of nodes with the 'data-include' attribute. DO NOT replace with functions such as innerHTML as it will break a + html + Extracts a HTML string from DOM nodes. Was created to get around the issue of not being able to exclude the content + of nodes with the 'data-include' attribute. DO NOT replace with functions such as innerHTML as it will break a number of microformat include patterns. - + Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. MIT License: https://raw.github.com/glennjones/microformat-node/master/license.txt Dependencies utilities.js, domutils.js @@ -11,23 +11,23 @@ var Modules = (function (modules) { - + modules.html = { - + // elements which are self-closing selfClosingElt: ['area', 'base', 'br', 'col', 'hr', 'img', 'input', 'link', 'meta', 'param', 'command', 'keygen', 'source'], - + /** * parse the html string from DOM Node * * @param {DOM Node} node * @return {String} - */ + */ parse: function( node ){ var out = '', j = 0; - + // we do not want the outer container if(node.childNodes && node.childNodes.length > 0){ for (j = 0; j < node.childNodes.length; j++) { @@ -37,47 +37,47 @@ var Modules = (function (modules) { } } } - + return out; }, - - + + /** * walks the DOM tree parsing the html string from the nodes * * @param {DOM Document} doc * @param {DOM Node} node * @return {String} - */ + */ walkTreeForHtml: function( node ) { var out = '', j = 0; - + // if node is a text node get its text if(node.nodeType && node.nodeType === 3){ - out += modules.domUtils.getElementText( node ); + out += modules.domUtils.getElementText( node ); } - - - // exclude text which has been added with include pattern - + + + // exclude text which has been added with include pattern - if(node.nodeType && node.nodeType === 1 && modules.domUtils.hasAttribute(node, 'data-include') === false){ - + // begin tag - out += '<' + node.tagName.toLowerCase(); - + out += '<' + node.tagName.toLowerCase(); + // add attributes var attrs = modules.domUtils.getOrderedAttributes(node); for (j = 0; j < attrs.length; j++) { out += ' ' + attrs[j].name + '=' + '"' + attrs[j].value + '"'; } - + if(this.selfClosingElt.indexOf(node.tagName.toLowerCase()) === -1){ out += '>'; } - + // get the text of the child nodes if(node.childNodes && node.childNodes.length > 0){ - + for (j = 0; j < node.childNodes.length; j++) { var text = this.walkTreeForHtml( node.childNodes[j] ); if(text !== undefined){ @@ -85,21 +85,21 @@ var Modules = (function (modules) { } } } - + // end tag if(this.selfClosingElt.indexOf(node.tagName.toLowerCase()) > -1){ - out += ' />'; + out += ' />'; }else{ - out += ''; + out += ''; } - } - + } + return (out === '')? undefined : out; - } - - + } + + }; - + return modules; diff --git a/toolkit/components/microformats/test/lib/isodate.js b/toolkit/components/microformats/test/lib/isodate.js index dfb2ba8428..30f35f35d4 100644 --- a/toolkit/components/microformats/test/lib/isodate.js +++ b/toolkit/components/microformats/test/lib/isodate.js @@ -1,20 +1,20 @@ /*! iso date This module was built for the exact needs of parsing ISO dates to the microformats standard. - - * Parses and builds ISO dates to the W3C note, HTML5 or RFC3339 profiles. - * Also allows for profile detection using 'auto' + + * Parses and builds ISO dates to the W3C note, HTML5 or RFC3339 profiles. + * Also allows for profile detection using 'auto' * Outputs to the same level of specificity of date and time that was input - + Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ - - - + + + var Modules = (function (modules) { - - + + /** * constructor * parses text to find just the date element of an ISO date/time string i.e. 2008-05-01 @@ -22,75 +22,75 @@ var Modules = (function (modules) { * @param {String} dateString * @param {String} format * @return {String} - */ + */ modules.ISODate = function ( dateString, format ) { this.clear(); - + this.format = (format)? format : 'auto'; // auto or W3C or RFC3339 or HTML5 this.setFormatSep(); - - // optional should be full iso date/time string + + // optional should be full iso date/time string if(arguments[0]) { this.parse(dateString, format); } }; - + modules.ISODate.prototype = { - - + + /** * clear all states * - */ + */ clear: function(){ this.clearDate(); this.clearTime(); this.clearTimeZone(); this.setAutoProfileState(); }, - - + + /** * clear date states * - */ + */ clearDate: function(){ this.dY = -1; this.dM = -1; this.dD = -1; this.dDDD = -1; }, - - + + /** * clear time states * - */ + */ clearTime: function(){ this.tH = -1; this.tM = -1; this.tS = -1; this.tD = -1; }, - - + + /** * clear timezone states * - */ + */ clearTimeZone: function(){ this.tzH = -1; this.tzM = -1; this.tzPN = '+'; this.z = false; }, - - + + /** * resets the auto profile state * - */ + */ setAutoProfileState: function(){ this.autoProfile = { sep: 'T', @@ -100,31 +100,31 @@ var Modules = (function (modules) { tzZulu: 'Z' }; }, - - + + /** * parses text to find ISO date/time string i.e. 2008-05-01T15:45:19Z * * @param {String} dateString * @param {String} format * @return {String} - */ + */ parse: function( dateString, format ) { this.clear(); - + var parts = [], tzArray = [], position = 0, datePart = '', timePart = '', timeZonePart = ''; - + if(format){ this.format = format; } - - - + + + // discover date time separtor for auto profile // Set to 'T' by default if(dateString.indexOf('t') > -1) { @@ -138,47 +138,47 @@ var Modules = (function (modules) { } if(dateString.toUpperCase().indexOf('T') === -1) { this.autoProfile.sep = ' '; - } - - + } + + dateString = dateString.toUpperCase().replace(' ','T'); - + // break on 'T' divider or space if(dateString.indexOf('T') > -1) { parts = dateString.split('T'); datePart = parts[0]; timePart = parts[1]; - - // zulu UTC + + // zulu UTC if(timePart.indexOf( 'Z' ) > -1) { this.z = true; } - + // timezone if(timePart.indexOf( '+' ) > -1 || timePart.indexOf( '-' ) > -1) { tzArray = timePart.split( 'Z' ); // incase of incorrect use of Z timePart = tzArray[0]; timeZonePart = tzArray[1]; - + // timezone if(timePart.indexOf( '+' ) > -1 || timePart.indexOf( '-' ) > -1) { position = 0; - + if(timePart.indexOf( '+' ) > -1) { position = timePart.indexOf( '+' ); } else { position = timePart.indexOf( '-' ); } - + timeZonePart = timePart.substring( position, timePart.length ); timePart = timePart.substring( 0, position ); } } - + } else { datePart = dateString; } - + if(datePart !== '') { this.parseDate( datePart ); if(timePart !== '') { @@ -190,25 +190,25 @@ var Modules = (function (modules) { } return this.toString( format ); }, - - + + /** * parses text to find just the date element of an ISO date/time string i.e. 2008-05-01 * * @param {String} dateString * @param {String} format * @return {String} - */ + */ parseDate: function( dateString, format ) { this.clearDate(); - + var parts = []; - + // discover timezone separtor for auto profile // default is ':' if(dateString.indexOf('-') === -1) { this.autoProfile.tsep = ''; - } - + } + // YYYY-DDD parts = dateString.match( /(\d\d\d\d)-(\d\d\d)/ ); if(parts) { @@ -219,7 +219,7 @@ var Modules = (function (modules) { this.dDDD = parts[2]; } } - + if(this.dDDD === -1) { // YYYY-MM-DD ie 2008-05-01 and YYYYMMDD ie 20080501 parts = dateString.match( /(\d\d\d\d)?-?(\d\d)?-?(\d\d)?/ ); @@ -235,24 +235,24 @@ var Modules = (function (modules) { } return this.toString(format); }, - - + + /** * parses text to find just the time element of an ISO date/time string i.e. 13:30:45 * * @param {String} timeString * @param {String} format * @return {String} - */ + */ parseTime: function( timeString, format ) { this.clearTime(); var parts = []; - + // discover date separtor for auto profile // default is ':' if(timeString.indexOf(':') === -1) { this.autoProfile.tsep = ''; - } - + } + // finds timezone HH:MM:SS and HHMMSS ie 13:30:45, 133045 and 13:30:45.0135 parts = timeString.match( /(\d\d)?:?(\d\d)?:?(\d\d)?.?([0-9]+)?/ ); if(parts[1]) { @@ -269,30 +269,30 @@ var Modules = (function (modules) { } return this.toTimeString(format); }, - - + + /** * parses text to find just the time element of an ISO date/time string i.e. +08:00 * * @param {String} timeString * @param {String} format * @return {String} - */ + */ parseTimeZone: function( timeString, format ) { this.clearTimeZone(); var parts = []; - + if(timeString.toLowerCase() === 'z'){ this.z = true; // set case for z this.autoProfile.tzZulu = (timeString === 'z')? 'z' : 'Z'; }else{ - + // discover timezone separtor for auto profile // default is ':' if(timeString.indexOf(':') === -1) { this.autoProfile.tzsep = ''; - } - + } + // finds timezone +HH:MM and +HHMM ie +13:30 and +1330 parts = timeString.match( /([\-\+]{1})?(\d\d)?:?(\d\d)?/ ); if(parts[1]) { @@ -303,29 +303,29 @@ var Modules = (function (modules) { } if(parts[3]) { this.tzM = parts[3]; - } - - + } + + } - this.tzZulu = 'z'; + this.tzZulu = 'z'; return this.toTimeString( format ); }, - - + + /** * returns ISO date/time string in W3C Note, RFC 3339, HTML5, or auto profile * * @param {String} format * @return {String} - */ + */ toString: function( format ) { var output = ''; - + if(format){ this.format = format; } this.setFormatSep(); - + if(this.dY > -1) { output = this.dY; if(this.dM > 0 && this.dM < 13) { @@ -343,26 +343,26 @@ var Modules = (function (modules) { } else if(this.tH > -1) { output += this.toTimeString( format ); } - + return output; }, - - + + /** * returns just the time string element of an ISO date/time * in W3C Note, RFC 3339, HTML5, or auto profile * * @param {String} format * @return {String} - */ + */ toTimeString: function( format ) { var out = ''; - + if(format){ this.format = format; } this.setFormatSep(); - + // time can only be created with a full date if(this.tH) { if(this.tH > -1 && this.tH < 25) { @@ -376,10 +376,10 @@ var Modules = (function (modules) { } } } - - - - // time zone offset + + + + // time zone offset if(this.z) { out += this.tzZulu; } else { @@ -394,12 +394,12 @@ var Modules = (function (modules) { } return out; }, - - + + /** * set the current profile to W3C Note, RFC 3339, HTML5, or auto profile * - */ + */ setFormatSep: function() { switch( this.format.toLowerCase() ) { case 'rfc3339': @@ -432,48 +432,48 @@ var Modules = (function (modules) { this.tzZulu = this.autoProfile.tzZulu; } }, - - + + /** * does current data contain a full date i.e. 2015-03-23 * * @return {Boolean} - */ + */ hasFullDate: function() { return(this.dY !== -1 && this.dM !== -1 && this.dD !== -1); }, - - + + /** * does current data contain a minimum date which is just a year number i.e. 2015 * * @return {Boolean} - */ + */ hasDate: function() { return(this.dY !== -1); }, - - + + /** * does current data contain a minimum time which is just a hour number i.e. 13 * * @return {Boolean} - */ + */ hasTime: function() { return(this.tH !== -1); }, - + /** * does current data contain a minimum timezone i.e. -1 || +1 || z * * @return {Boolean} - */ + */ hasTimeZone: function() { return(this.tzH !== -1); } - + }; - + modules.ISODate.prototype.constructor = modules.ISODate; return modules; diff --git a/toolkit/components/microformats/test/lib/maps/h-adr.js b/toolkit/components/microformats/test/lib/maps/h-adr.js index 942f625b04..aa3a695c53 100644 --- a/toolkit/components/microformats/test/lib/maps/h-adr.js +++ b/toolkit/components/microformats/test/lib/maps/h-adr.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-adr'] = { diff --git a/toolkit/components/microformats/test/lib/maps/h-card.js b/toolkit/components/microformats/test/lib/maps/h-card.js index 89d47d0f9d..124750a376 100644 --- a/toolkit/components/microformats/test/lib/maps/h-card.js +++ b/toolkit/components/microformats/test/lib/maps/h-card.js @@ -1,9 +1,9 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-card'] = { @@ -32,7 +32,7 @@ var Modules = (function (modules) { 'map': 'u-email' }, 'geo': { - 'map': 'p-geo', + 'map': 'p-geo', 'uf': ['h-geo'] }, 'key': { @@ -82,4 +82,4 @@ var Modules = (function (modules) { return modules; } (Modules || {})); - + diff --git a/toolkit/components/microformats/test/lib/maps/h-entry.js b/toolkit/components/microformats/test/lib/maps/h-entry.js index feb45c351a..b82c4c2d9c 100644 --- a/toolkit/components/microformats/test/lib/maps/h-entry.js +++ b/toolkit/components/microformats/test/lib/maps/h-entry.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-entry'] = { @@ -26,7 +26,7 @@ var Modules = (function (modules) { 'updated': { 'map': 'dt-updated' }, - 'author': { + 'author': { 'uf': ['h-card'] }, 'category': { @@ -34,7 +34,7 @@ var Modules = (function (modules) { 'relAlt': ['tag'] }, 'geo': { - 'map': 'p-geo', + 'map': 'p-geo', 'uf': ['h-geo'] }, 'latitude': {}, @@ -47,6 +47,6 @@ var Modules = (function (modules) { }; return modules; - + } (Modules || {})); diff --git a/toolkit/components/microformats/test/lib/maps/h-event.js b/toolkit/components/microformats/test/lib/maps/h-event.js index 8956dcf8cd..6599d45495 100644 --- a/toolkit/components/microformats/test/lib/maps/h-event.js +++ b/toolkit/components/microformats/test/lib/maps/h-event.js @@ -1,13 +1,13 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; - modules.maps['h-event'] = { + modules.maps['h-event'] = { root: 'vevent', name: 'h-event', properties: { @@ -53,7 +53,7 @@ var Modules = (function (modules) { 'map': 'u-attach' }, 'status': {}, - 'rdate': {}, + 'rdate': {}, 'rrule': {} } }; diff --git a/toolkit/components/microformats/test/lib/maps/h-feed.js b/toolkit/components/microformats/test/lib/maps/h-feed.js index cc3e5697ad..f680228567 100644 --- a/toolkit/components/microformats/test/lib/maps/h-feed.js +++ b/toolkit/components/microformats/test/lib/maps/h-feed.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-feed'] = { @@ -18,7 +18,7 @@ var Modules = (function (modules) { 'summary': { 'map': 'p-summary' }, - 'author': { + 'author': { 'uf': ['h-card'] }, 'url': { diff --git a/toolkit/components/microformats/test/lib/maps/h-geo.js b/toolkit/components/microformats/test/lib/maps/h-geo.js index 261eadc72f..fabb86f074 100644 --- a/toolkit/components/microformats/test/lib/maps/h-geo.js +++ b/toolkit/components/microformats/test/lib/maps/h-geo.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-geo'] = { diff --git a/toolkit/components/microformats/test/lib/maps/h-item.js b/toolkit/components/microformats/test/lib/maps/h-item.js index 56182751ba..471a8454e3 100644 --- a/toolkit/components/microformats/test/lib/maps/h-item.js +++ b/toolkit/components/microformats/test/lib/maps/h-item.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-item'] = { @@ -27,4 +27,4 @@ var Modules = (function (modules) { return modules; } (Modules || {})); - + diff --git a/toolkit/components/microformats/test/lib/maps/h-listing.js b/toolkit/components/microformats/test/lib/maps/h-listing.js index 674ac9c046..94783d9ee4 100644 --- a/toolkit/components/microformats/test/lib/maps/h-listing.js +++ b/toolkit/components/microformats/test/lib/maps/h-listing.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-listing'] = { diff --git a/toolkit/components/microformats/test/lib/maps/h-news.js b/toolkit/components/microformats/test/lib/maps/h-news.js index 1a48148aa9..362a5a5709 100644 --- a/toolkit/components/microformats/test/lib/maps/h-news.js +++ b/toolkit/components/microformats/test/lib/maps/h-news.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-news'] = { @@ -29,7 +29,7 @@ var Modules = (function (modules) { 'map': 'u-item-license' }, 'principles': { - 'map': 'u-principles', + 'map': 'u-principles', 'relAlt': ['principles'] } } diff --git a/toolkit/components/microformats/test/lib/maps/h-org.js b/toolkit/components/microformats/test/lib/maps/h-org.js index 8ac64f711a..d1b4e82450 100644 --- a/toolkit/components/microformats/test/lib/maps/h-org.js +++ b/toolkit/components/microformats/test/lib/maps/h-org.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-org'] = { diff --git a/toolkit/components/microformats/test/lib/maps/h-product.js b/toolkit/components/microformats/test/lib/maps/h-product.js index b3001f83b7..18f8eb51a7 100644 --- a/toolkit/components/microformats/test/lib/maps/h-product.js +++ b/toolkit/components/microformats/test/lib/maps/h-product.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-product'] = { diff --git a/toolkit/components/microformats/test/lib/maps/h-recipe.js b/toolkit/components/microformats/test/lib/maps/h-recipe.js index 9f30db1d89..e3901ea3e0 100644 --- a/toolkit/components/microformats/test/lib/maps/h-recipe.js +++ b/toolkit/components/microformats/test/lib/maps/h-recipe.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-recipe'] = { diff --git a/toolkit/components/microformats/test/lib/maps/h-resume.js b/toolkit/components/microformats/test/lib/maps/h-resume.js index d096dee21b..d6a46cc880 100644 --- a/toolkit/components/microformats/test/lib/maps/h-resume.js +++ b/toolkit/components/microformats/test/lib/maps/h-resume.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-resume'] = { diff --git a/toolkit/components/microformats/test/lib/maps/h-review-aggregate.js b/toolkit/components/microformats/test/lib/maps/h-review-aggregate.js index e7ef091a60..4b6027cbf7 100644 --- a/toolkit/components/microformats/test/lib/maps/h-review-aggregate.js +++ b/toolkit/components/microformats/test/lib/maps/h-review-aggregate.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-review-aggregate'] = { @@ -21,7 +21,7 @@ var Modules = (function (modules) { 'rating': {}, 'average': {}, 'best': {}, - 'worst': {}, + 'worst': {}, 'count': {}, 'votes': {}, 'category': { diff --git a/toolkit/components/microformats/test/lib/maps/h-review.js b/toolkit/components/microformats/test/lib/maps/h-review.js index 92f1cbc47a..83f4c24bc3 100644 --- a/toolkit/components/microformats/test/lib/maps/h-review.js +++ b/toolkit/components/microformats/test/lib/maps/h-review.js @@ -1,10 +1,10 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.maps = (modules.maps)? modules.maps : {}; modules.maps['h-review'] = { diff --git a/toolkit/components/microformats/test/lib/maps/rel.js b/toolkit/components/microformats/test/lib/maps/rel.js index 427e740dbd..8accf80090 100644 --- a/toolkit/components/microformats/test/lib/maps/rel.js +++ b/toolkit/components/microformats/test/lib/maps/rel.js @@ -1,32 +1,32 @@ /* Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. - MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt + MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.rels = { // xfn - 'friend': [ 'yes','external'], - 'acquaintance': [ 'yes','external'], - 'contact': [ 'yes','external'], - 'met': [ 'yes','external'], - 'co-worker': [ 'yes','external'], - 'colleague': [ 'yes','external'], - 'co-resident': [ 'yes','external'], - 'neighbor': [ 'yes','external'], - 'child': [ 'yes','external'], - 'parent': [ 'yes','external'], - 'sibling': [ 'yes','external'], - 'spouse': [ 'yes','external'], - 'kin': [ 'yes','external'], - 'muse': [ 'yes','external'], - 'crush': [ 'yes','external'], - 'date': [ 'yes','external'], - 'sweetheart': [ 'yes','external'], - 'me': [ 'yes','external'], - - // other rel=* + 'friend': [ 'yes','external'], + 'acquaintance': [ 'yes','external'], + 'contact': [ 'yes','external'], + 'met': [ 'yes','external'], + 'co-worker': [ 'yes','external'], + 'colleague': [ 'yes','external'], + 'co-resident': [ 'yes','external'], + 'neighbor': [ 'yes','external'], + 'child': [ 'yes','external'], + 'parent': [ 'yes','external'], + 'sibling': [ 'yes','external'], + 'spouse': [ 'yes','external'], + 'kin': [ 'yes','external'], + 'muse': [ 'yes','external'], + 'crush': [ 'yes','external'], + 'date': [ 'yes','external'], + 'sweetheart': [ 'yes','external'], + 'me': [ 'yes','external'], + + // other rel=* 'license': [ 'yes','yes'], 'nofollow': [ 'no','external'], 'tag': [ 'no','yes'], @@ -39,9 +39,9 @@ var Modules = (function (modules) { 'pronunciation': [ 'no','external'], 'payment': [ 'no','external'], 'principles': [ 'no','external'] - + }; - + return modules; } (Modules || {})); diff --git a/toolkit/components/microformats/test/lib/parser-implied.js b/toolkit/components/microformats/test/lib/parser-implied.js index cf6e2db620..7f67a2ca1c 100644 --- a/toolkit/components/microformats/test/lib/parser-implied.js +++ b/toolkit/components/microformats/test/lib/parser-implied.js @@ -1,19 +1,19 @@ /*! Parser implied All the functions that deal with microformats implied rules - + Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt Dependencies dates.js, domutils.js, html.js, isodate,js, text.js, utilities.js, url.js */ var Modules = (function (modules) { - + // check parser module is loaded if(modules.Parser){ - + /** - * applies "implied rules" microformat output structure i.e. feed-title, name, photo, url and date + * applies "implied rules" microformat output structure i.e. feed-title, name, photo, url and date * * @param {DOM Node} node * @param {Object} uf (microformat output structure) @@ -23,40 +23,40 @@ var Modules = (function (modules) { */ modules.Parser.prototype.impliedRules = function(node, uf, parentClasses) { var typeVersion = (uf.typeVersion)? uf.typeVersion: 'v2'; - + // TEMP: override to allow v1 implied properties while spec changes if(this.options.impliedPropertiesByVersion === false){ typeVersion = 'v2'; } - + if(node && uf && uf.properties) { - uf = this.impliedBackwardComp( node, uf, parentClasses ); + uf = this.impliedBackwardComp( node, uf, parentClasses ); if(typeVersion === 'v2'){ uf = this.impliedhFeedTitle( uf ); - uf = this.impliedName( node, uf ); - uf = this.impliedPhoto( node, uf ); + uf = this.impliedName( node, uf ); + uf = this.impliedPhoto( node, uf ); uf = this.impliedUrl( node, uf ); } uf = this.impliedValue( node, uf, parentClasses ); uf = this.impliedDate( uf ); - + // TEMP: flagged while spec changes are put forward if(this.options.parseLatLonGeo === true){ uf = this.impliedGeo( uf ); - } + } } return uf; }; - - + + /** * apply implied name rule * * @param {DOM Node} node * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedName = function(node, uf) { // implied name rule /* @@ -74,7 +74,7 @@ var Modules = (function (modules) { */ var name, value; - + if(!uf.properties.name) { value = this.getImpliedProperty(node, ['img', 'area', 'abbr'], this.getNameAttr); var textFormat = this.options.textFormat; @@ -88,27 +88,27 @@ var Modules = (function (modules) { uf.properties.name = name; } } - + return uf; }; - - + + /** * apply implied photo rule * * @param {DOM Node} node * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedPhoto = function(node, uf) { // implied photo rule /* img.h-x[src] Jane Doe object.h-x[data] Jane Doe - .h-x>img[src]:only-of-type:not[.h-*]
Jane Doe
- .h-x>object[data]:only-of-type:not[.h-*]
Jane Doe
- .h-x>:only-child>img[src]:only-of-type:not[.h-*]
Jane Doe
- .h-x>:only-child>object[data]:only-of-type:not[.h-*]
Jane Doe
+ .h-x>img[src]:only-of-type:not[.h-*]
Jane Doe
+ .h-x>object[data]:only-of-type:not[.h-*]
Jane Doe
+ .h-x>:only-child>img[src]:only-of-type:not[.h-*]
Jane Doe
+ .h-x>:only-child>object[data]:only-of-type:not[.h-*]
Jane Doe
*/ var value; if(!uf.properties.photo) { @@ -120,24 +120,24 @@ var Modules = (function (modules) { } uf.properties.photo = [modules.utils.trim(value)]; } - } + } return uf; }; - - + + /** * apply implied URL rule * * @param {DOM Node} node * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedUrl = function(node, uf) { // implied URL rule /* a.h-x[href] Glenn area.h-x[href] Glenn - .h-x>a[href]:only-of-type:not[.h-*] + .h-x>a[href]:only-of-type:not[.h-*] .h-x>area[href]:only-of-type:not[.h-*]
Glenn

...

*/ var value; @@ -150,18 +150,18 @@ var Modules = (function (modules) { } uf.properties.url = [modules.utils.trim(value)]; } - } + } return uf; }; - - + + /** * apply implied date rule - if there is a time only property try to concat it with any date property * * @param {DOM Node} node * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedDate = function(uf) { // implied date rule // http://microformats.org/wiki/value-class-pattern#microformats2_parsers @@ -176,8 +176,8 @@ var Modules = (function (modules) { delete uf.dates; return uf; }; - - + + /** * get an implied property value from pre-defined tag/attriubte combinations * @@ -188,10 +188,10 @@ var Modules = (function (modules) { */ modules.Parser.prototype.getImpliedProperty = function(node, tagList, getAttrFunction) { // i.e. img.h-card - var value = getAttrFunction(node), + var value = getAttrFunction(node), descendant, child; - + if(!value) { // i.e. .h-card>img:only-of-type:not(.h-card) descendant = modules.domUtils.getSingleDescendantOfType( node, tagList); @@ -209,17 +209,17 @@ var Modules = (function (modules) { } } } - + return value; }; - - + + /** * get an implied name value from a node * * @param {DOM Node} node * @return {String || null} - */ + */ modules.Parser.prototype.getNameAttr = function(node) { var value = modules.domUtils.getAttrValFromTagList(node, ['img','area'], 'alt'); if(!value) { @@ -227,14 +227,14 @@ var Modules = (function (modules) { } return value; }; - - + + /** * get an implied photo value from a node * * @param {DOM Node} node * @return {String || null} - */ + */ modules.Parser.prototype.getPhotoAttr = function(node) { var value = modules.domUtils.getAttrValFromTagList(node, ['img'], 'src'); if(!value && modules.domUtils.hasAttributeValue(node, 'class', 'include') === false) { @@ -242,62 +242,62 @@ var Modules = (function (modules) { } return value; }; - - + + /** * get an implied photo value from a node * * @param {DOM Node} node * @return {String || null} - */ + */ modules.Parser.prototype.getURLAttr = function(node) { var value = null; if(modules.domUtils.hasAttributeValue(node, 'class', 'include') === false){ - + value = modules.domUtils.getAttrValFromTagList(node, ['a'], 'href'); if(!value) { value = modules.domUtils.getAttrValFromTagList(node, ['area'], 'href'); } - + } return value; }; - - + + /** - * + * * * @param {DOM Node} node * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedValue = function(node, uf, parentClasses){ - + // intersection of implied name and implied value rules - if(uf.properties.name) { + if(uf.properties.name) { if(uf.value && parentClasses.root.length > 0 && parentClasses.properties.length === 1){ uf = this.getAltValue(uf, parentClasses.properties[0][0], 'p-name', uf.properties.name[0]); } } - + // intersection of implied URL and implied value rules if(uf.properties.url) { if(parentClasses && parentClasses.root.length === 1 && parentClasses.properties.length === 1){ uf = this.getAltValue(uf, parentClasses.properties[0][0], 'u-url', uf.properties.url[0]); } - } - + } + // apply alt value if(uf.altValue !== null){ uf.value = uf.altValue.value; } delete uf.altValue; - - + + return uf; }; - - + + /** * get alt value based on rules about parent property prefix * @@ -306,7 +306,7 @@ var Modules = (function (modules) { * @param {String} propertyName * @param {String} value * @return {Object} - */ + */ modules.Parser.prototype.getAltValue = function(uf, parentPropertyName, propertyName, value){ if(uf.value && !uf.altValue){ // first p-name of the h-* child @@ -324,14 +324,14 @@ var Modules = (function (modules) { } return uf; }; - - + + /** * if a h-feed does not have a title use the title tag of a page * * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedhFeedTitle = function( uf ){ if(uf.type && uf.type.indexOf('h-feed') > -1){ // has no name property @@ -345,80 +345,80 @@ var Modules = (function (modules) { } return uf; }; - - - + + + /** * implied Geo from pattern * * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedGeo = function( uf ){ var geoPair, parts, longitude, latitude, valid = true; - + if(uf.type && uf.type.indexOf('h-geo') > -1){ - + // has no latitude or longitude property if(uf.properties.latitude === undefined || uf.properties.longitude === undefined ){ geoPair = (uf.properties.name)? uf.properties.name[0] : null; geoPair = (!geoPair && uf.properties.value)? uf.properties.value : geoPair; - + if(geoPair){ // allow for the use of a ';' as in microformats and also ',' as in Geo URL geoPair = geoPair.replace(';',','); - + // has sep char if(geoPair.indexOf(',') > -1 ){ parts = geoPair.split(','); - + // only correct if we have two or more parts if(parts.length > 1){ - // latitude no value outside the range -90 or 90 + // latitude no value outside the range -90 or 90 latitude = parseFloat( parts[0] ); if(modules.utils.isNumber(latitude) && latitude > 90 || latitude < -90){ valid = false; } - + // longitude no value outside the range -180 to 180 longitude = parseFloat( parts[1] ); if(modules.utils.isNumber(longitude) && longitude > 180 || longitude < -180){ valid = false; } - + if(valid){ uf.properties.latitude = [latitude]; uf.properties.longitude = [longitude]; } } - + } } } } return uf; }; - - + + /** * if a backwards compat built structure has no properties add name through this.impliedName * * @param {Object} uf * @return {Object} - */ + */ modules.Parser.prototype.impliedBackwardComp = function(node, uf, parentClasses){ - + // look for pattern in parent classes like "p-geo h-geo" // these are structures built from backwards compat parsing of geo if(parentClasses.root.length === 1 && parentClasses.properties.length === 1) { if(parentClasses.root[0].replace('h-','') === this.removePropPrefix(parentClasses.properties[0][0])) { - + // if microformat has no properties apply the impliedName rule to get value from containing node // this will get value from html such as Brighton if( modules.utils.hasProperties(uf.properties) === false ){ @@ -426,12 +426,12 @@ var Modules = (function (modules) { } } } - + return uf; }; - - - + + + } return modules; diff --git a/toolkit/components/microformats/test/lib/parser-includes.js b/toolkit/components/microformats/test/lib/parser-includes.js index 957a5cb99e..f0967710d0 100644 --- a/toolkit/components/microformats/test/lib/parser-includes.js +++ b/toolkit/components/microformats/test/lib/parser-includes.js @@ -1,7 +1,7 @@ /*! Parser includes All the functions that deal with microformats v1 include rules - + Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt Dependencies dates.js, domutils.js, html.js, isodate,js, text.js, utilities.js @@ -9,23 +9,23 @@ var Modules = (function (modules) { - + // check parser module is loaded if(modules.Parser){ - - + + /** * appends clones of include Nodes into the DOM structure * * @param {DOM node} rootNode - */ + */ modules.Parser.prototype.addIncludes = function(rootNode) { this.addAttributeIncludes(rootNode, 'itemref'); this.addAttributeIncludes(rootNode, 'headers'); this.addClassIncludes(rootNode); }; - - + + /** * appends clones of include Nodes into the DOM structure for attribute based includes * @@ -39,7 +39,7 @@ var Modules = (function (modules) { x, z, y; - + arr = modules.domUtils.getNodesByAttribute(rootNode, attributeName); x = 0; i = arr.length; @@ -56,8 +56,8 @@ var Modules = (function (modules) { x++; } }; - - + + /** * appends clones of include Nodes into the DOM structure for class based includes * @@ -68,7 +68,7 @@ var Modules = (function (modules) { arr, x = 0, i; - + arr = modules.domUtils.getNodesByAttributeValue(rootNode, 'class', 'include'); i = arr.length; while(x < i) { @@ -80,8 +80,8 @@ var Modules = (function (modules) { x++; } }; - - + + /** * appends a clone of an include into another Node using Id * @@ -91,7 +91,7 @@ var Modules = (function (modules) { modules.Parser.prototype.apppendInclude = function(node, id){ var include, clone; - + id = modules.utils.trim(id.replace('#', '')); include = modules.domUtils.getElementById(this.document, id); if(include) { @@ -100,18 +100,18 @@ var Modules = (function (modules) { modules.domUtils.appendChild(node, clone); } }; - - + + /** - * adds an attribute marker to all the child microformat roots + * adds an attribute marker to all the child microformat roots * * @param {DOM node} rootNode - */ + */ modules.Parser.prototype.markIncludeChildren = function(rootNode) { var arr, x, i; - + // loop the array and add the attribute arr = this.findRootNodes(rootNode); x = 0; @@ -123,17 +123,17 @@ var Modules = (function (modules) { x++; } }; - - + + /** - * removes all appended include clones from DOM + * removes all appended include clones from DOM * * @param {DOM node} rootNode - */ + */ modules.Parser.prototype.removeIncludes = function(rootNode){ var arr, i; - + // remove all the items that were added as includes arr = modules.domUtils.getNodesByAttribute(rootNode, 'data-include'); i = arr.length; @@ -141,8 +141,8 @@ var Modules = (function (modules) { modules.domUtils.removeChild(rootNode,arr[i]); } }; - - + + } return modules; diff --git a/toolkit/components/microformats/test/lib/parser-rels.js b/toolkit/components/microformats/test/lib/parser-rels.js index 7670c1b94c..63ef674469 100644 --- a/toolkit/components/microformats/test/lib/parser-rels.js +++ b/toolkit/components/microformats/test/lib/parser-rels.js @@ -1,7 +1,7 @@ /*! Parser rels All the functions that deal with microformats v2 rel structures - + Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt Dependencies dates.js, domutils.js, html.js, isodate,js, text.js, utilities.js, url.js @@ -9,10 +9,10 @@ var Modules = (function (modules) { - + // check parser module is loaded if(modules.Parser){ - + /** * finds rel=* structures * @@ -34,36 +34,36 @@ var Modules = (function (modules) { item, value, arr; - + arr = modules.domUtils.getNodesByAttribute(rootNode, 'rel'); x = 0; i = arr.length; while(x < i) { relList = modules.domUtils.getAttribute(arr[x], 'rel'); - + if(relList) { items = relList.split(' '); - - + + // add rels z = 0; y = items.length; while(z < y) { item = modules.utils.trim(items[z]); - + // get rel value value = modules.domUtils.getAttrValFromTagList(arr[x], ['a', 'area'], 'href'); if(!value) { value = modules.domUtils.getAttrValFromTagList(arr[x], ['link'], 'href'); } - + // create the key if(!out.rels[item]) { out.rels[item] = []; } - + if(typeof this.options.baseUrl === 'string' && typeof value === 'string') { - + var resolved = modules.url.resolve(value, this.options.baseUrl); // do not add duplicate rels - based on resolved URLs if(out.rels[item].indexOf(resolved) === -1){ @@ -72,8 +72,8 @@ var Modules = (function (modules) { } z++; } - - + + var url = null; if(modules.domUtils.hasAttribute(arr[x], 'href')){ url = modules.domUtils.getAttribute(arr[x], 'href'); @@ -81,8 +81,8 @@ var Modules = (function (modules) { url = modules.url.resolve(url, this.options.baseUrl ); } } - - + + // add to rel-urls var relUrl = this.getRelProperties(arr[x]); relUrl.rels = items; @@ -90,15 +90,15 @@ var Modules = (function (modules) { if(url && out['rel-urls'][url] === undefined){ out['rel-urls'][url] = relUrl; } - - + + } x++; } return out; }; - - + + /** * gets the properties of a rel=* * @@ -107,7 +107,7 @@ var Modules = (function (modules) { */ modules.Parser.prototype.getRelProperties = function(node){ var obj = {}; - + if(modules.domUtils.hasAttribute(node, 'media')){ obj.media = modules.domUtils.getAttribute(node, 'media'); } @@ -122,12 +122,12 @@ var Modules = (function (modules) { } if(modules.utils.trim(this.getPValue(node, false)) !== ''){ obj.text = this.getPValue(node, false); - } - + } + return obj; }; - - + + /** * finds any alt rel=* mappings for a given node/microformat * @@ -139,7 +139,7 @@ var Modules = (function (modules) { var out, map, i; - + map = this.getMapping(ufName); if(map) { for(var key in map.properties) { @@ -147,8 +147,8 @@ var Modules = (function (modules) { var prop = map.properties[key], propName = (prop.map) ? prop.map : 'p-' + key, relCount = 0; - - // is property an alt rel=* mapping + + // is property an alt rel=* mapping if(prop.relAlt && modules.domUtils.hasAttribute(node, 'rel')) { i = prop.relAlt.length; while(i--) { @@ -165,8 +165,8 @@ var Modules = (function (modules) { } return out; }; - - + + /** * returns whether a node or its children has rel=* microformat * @@ -176,8 +176,8 @@ var Modules = (function (modules) { modules.Parser.prototype.hasRel = function(node) { return (this.countRels(node) > 0); }; - - + + /** * returns the number of rel=* microformats * @@ -190,9 +190,9 @@ var Modules = (function (modules) { } return 0; }; - - - + + + } return modules; diff --git a/toolkit/components/microformats/test/lib/text.js b/toolkit/components/microformats/test/lib/text.js index 8b7ea1b5a2..fe94dae0a3 100644 --- a/toolkit/components/microformats/test/lib/text.js +++ b/toolkit/components/microformats/test/lib/text.js @@ -1,9 +1,9 @@ /* text - Extracts text string from DOM nodes. Was created to extract text in a whitespace-normalized form. - It works like a none-CSS aware version of IE's innerText function. DO NOT replace this module + Extracts text string from DOM nodes. Was created to extract text in a whitespace-normalized form. + It works like a none-CSS aware version of IE's innerText function. DO NOT replace this module with functions such as textContent as it will reduce the quality of data provided to the API user. - + Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt Dependencies utilities.js, domutils.js @@ -11,26 +11,26 @@ var Modules = (function (modules) { - - + + modules.text = { - + // normalised or whitespace or whitespacetrimmed - textFormat: 'whitespacetrimmed', - + textFormat: 'whitespacetrimmed', + // block level tags, used to add line returns blockLevelTags: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'hr', 'pre', 'table', - 'address', 'article', 'aside', 'blockquote', 'caption', 'col', 'colgroup', 'dd', 'div', - 'dt', 'dir', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'header', 'hgroup', 'hr', - 'li', 'map', 'menu', 'nav', 'optgroup', 'option', 'section', 'tbody', 'testarea', + 'address', 'article', 'aside', 'blockquote', 'caption', 'col', 'colgroup', 'dd', 'div', + 'dt', 'dir', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'header', 'hgroup', 'hr', + 'li', 'map', 'menu', 'nav', 'optgroup', 'option', 'section', 'tbody', 'testarea', 'tfoot', 'th', 'thead', 'tr', 'td', 'ul', 'ol', 'dl', 'details'], - // tags to exclude + // tags to exclude excludeTags: ['noframe', 'noscript', 'template', 'script', 'style', 'frames', 'frameset'], - - + + /** - * parses the text from the DOM Node + * parses the text from the DOM Node * * @param {DOM Node} node * @param {String} textFormat @@ -50,54 +50,54 @@ var Modules = (function (modules) { return this.formatText( doc, modules.domUtils.textContent(node), this.textFormat ); } }, - - + + /** - * parses the text from a html string + * parses the text from a html string * * @param {DOM Document} doc * @param {String} text * @param {String} textFormat * @return {String} - */ + */ parseText: function( doc, text, textFormat ){ var node = modules.domUtils.createNodeWithText( 'div', text ); return this.parse( doc, node, textFormat ); }, - - + + /** * parses the text from a html string - only for whitespace or whitespacetrimmed formats * * @param {String} text * @param {String} textFormat * @return {String} - */ + */ formatText: function( doc, text, textFormat ){ this.textFormat = (textFormat)? textFormat : this.textFormat; if(text){ var out = '', regex = /(<([^>]+)>)/ig; - - out = text.replace(regex, ''); - if(this.textFormat === 'whitespacetrimmed') { + + out = text.replace(regex, ''); + if(this.textFormat === 'whitespacetrimmed') { out = modules.utils.trimWhitespace( out ); } - + //return entities.decode( out, 2 ); return modules.domUtils.decodeEntities( doc, out ); }else{ - return ''; + return ''; } }, - - + + /** - * normalises whitespace in given text + * normalises whitespace in given text * * @param {String} text * @return {String} - */ + */ normalise: function( doc, text ){ text = text.replace( / /g, ' ') ; // exchanges html entity for space into space char text = modules.utils.collapseWhiteSpace( text ); // removes linefeeds, tabs and addtional spaces @@ -105,27 +105,27 @@ var Modules = (function (modules) { text = text.replace( '–', '-' ); // correct dash decoding return modules.utils.trim( text ); }, - - + + /** * walks DOM tree parsing the text from DOM Nodes * * @param {DOM Node} node * @return {String} - */ + */ walkTreeForText: function( node ) { var out = '', j = 0; - + if(node.tagName && this.excludeTags.indexOf( node.tagName.toLowerCase() ) > -1){ return out; } - + // if node is a text node get its text if(node.nodeType && node.nodeType === 3){ - out += modules.domUtils.getElementText( node ); + out += modules.domUtils.getElementText( node ); } - + // get the text of the child nodes if(node.childNodes && node.childNodes.length > 0){ for (j = 0; j < node.childNodes.length; j++) { @@ -135,17 +135,17 @@ var Modules = (function (modules) { } } } - + // if it's a block level tag add an additional space at the end if(node.tagName && this.blockLevelTags.indexOf( node.tagName.toLowerCase() ) !== -1){ out += ' '; - } - + } + return (out === '')? undefined : out ; } - + }; - + return modules; } (Modules || {})); diff --git a/toolkit/components/microformats/test/lib/utilities.js b/toolkit/components/microformats/test/lib/utilities.js index 3fd0de51a2..c547148113 100644 --- a/toolkit/components/microformats/test/lib/utilities.js +++ b/toolkit/components/microformats/test/lib/utilities.js @@ -1,14 +1,14 @@ /* Utilities - + Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt */ var Modules = (function (modules) { - + modules.utils = { - + /** * is the object a string * @@ -18,7 +18,7 @@ var Modules = (function (modules) { isString: function( obj ) { return typeof( obj ) === 'string'; }, - + /** * is the object a number * @@ -28,8 +28,8 @@ var Modules = (function (modules) { isNumber: function( obj ) { return !isNaN(parseFloat( obj )) && isFinite( obj ); }, - - + + /** * is the object an array * @@ -39,8 +39,8 @@ var Modules = (function (modules) { isArray: function( obj ) { return obj && !( obj.propertyIsEnumerable( 'length' ) ) && typeof obj === 'object' && typeof obj.length === 'number'; }, - - + + /** * is the object a function * @@ -50,8 +50,8 @@ var Modules = (function (modules) { isFunction: function(obj) { return !!(obj && obj.constructor && obj.call && obj.apply); }, - - + + /** * does the text start with a test string * @@ -62,8 +62,8 @@ var Modules = (function (modules) { startWith: function( text, test ) { return(text.indexOf(test) === 0); }, - - + + /** * removes spaces at front and back of text * @@ -77,8 +77,8 @@ var Modules = (function (modules) { return ''; } }, - - + + /** * replaces a character in text * @@ -89,13 +89,13 @@ var Modules = (function (modules) { */ replaceCharAt: function( text, index, character ) { if(text && text.length > index){ - return text.substr(0, index) + character + text.substr(index+character.length); + return text.substr(0, index) + character + text.substr(index+character.length); }else{ return text; } }, - - + + /** * removes whitespace, tabs and returns from start and end of text * @@ -106,7 +106,7 @@ var Modules = (function (modules) { if(text && text.length){ var i = text.length, x = 0; - + // turn all whitespace chars at end into spaces while (i--) { if(this.isOnlyWhiteSpace(text[i])){ @@ -115,7 +115,7 @@ var Modules = (function (modules) { break; } } - + // turn all whitespace chars at start into spaces i = text.length; while (x < i) { @@ -129,8 +129,8 @@ var Modules = (function (modules) { } return this.trim(text); }, - - + + /** * does text only contain whitespace characters * @@ -140,8 +140,8 @@ var Modules = (function (modules) { isOnlyWhiteSpace: function( text ){ return !(/[^\t\n\r ]/.test( text )); }, - - + + /** * removes whitespace from text (leaves a single space) * @@ -151,14 +151,14 @@ var Modules = (function (modules) { collapseWhiteSpace: function( text ){ return text.replace(/[\t\n\r ]+/g, ' '); }, - - + + /** * does an object have any of its own properties * * @param {Object} obj * @return {Boolean} - */ + */ hasProperties: function( obj ) { var key; for(key in obj) { @@ -168,15 +168,15 @@ var Modules = (function (modules) { } return false; }, - - + + /** * a sort function - to sort objects in an array by a given property * * @param {String} property * @param {Boolean} reverse * @return {Int} - */ + */ sortObjects: function(property, reverse) { reverse = (reverse) ? -1 : 1; return function (a, b) { @@ -191,9 +191,9 @@ var Modules = (function (modules) { return 0; }; } - + }; - + return modules; } (Modules || {})); diff --git a/toolkit/components/microformats/test/module-tests/dates-test.js b/toolkit/components/microformats/test/module-tests/dates-test.js index 88a3b3e3e7..e5e034190e 100644 --- a/toolkit/components/microformats/test/module-tests/dates-test.js +++ b/toolkit/components/microformats/test/module-tests/dates-test.js @@ -4,13 +4,13 @@ Unit test for dates assert = chai.assert; -// Tests the private Modules.dates object -// Modules.dates is unit tested as it has an interface access by other modules +// Tests the private Modules.dates object +// Modules.dates is unit tested as it has an interface access by other modules describe('Modules.dates', function() { - - + + it('hasAM', function(){ assert.isTrue( Modules.dates.hasAM( '5am' ) ); assert.isTrue( Modules.dates.hasAM( '5AM' ) ); @@ -19,8 +19,8 @@ describe('Modules.dates', function() { assert.isTrue( Modules.dates.hasAM( '5:20 a.m.' ) ); assert.isFalse( Modules.dates.hasAM( '5pm' ) ); }); - - + + it('hasPM', function(){ assert.isTrue( Modules.dates.hasPM( '5pm' ) ); assert.isTrue( Modules.dates.hasPM( '5PM' ) ); @@ -29,8 +29,8 @@ describe('Modules.dates', function() { assert.isTrue( Modules.dates.hasPM( '5:20 p.m.' ) ); assert.isFalse( Modules.dates.hasPM( '5am' ) ); }); - - + + it('removeAMPM', function(){ assert.equal( Modules.dates.removeAMPM( '5pm' ), '5' ); assert.equal( Modules.dates.removeAMPM( '5 pm' ), '5 ' ); @@ -39,8 +39,8 @@ describe('Modules.dates', function() { assert.equal( Modules.dates.removeAMPM( '5a.m.' ), '5' ); assert.equal( Modules.dates.removeAMPM( '5' ), '5' ); }); - - + + it('isDuration', function(){ assert.isTrue( Modules.dates.isDuration( 'PY17M' ) ); assert.isTrue( Modules.dates.isDuration( 'PW12' ) ); @@ -50,8 +50,8 @@ describe('Modules.dates', function() { assert.isFalse( Modules.dates.isDuration( '2015-01-23 13:45' ) ); assert.isFalse( Modules.dates.isDuration( '20150123T1345' ) ); }); - - + + it('isTime', function(){ assert.isTrue( Modules.dates.isTime( '8:43' ) ); assert.isTrue( Modules.dates.isTime( '08:43' ) ); @@ -67,10 +67,10 @@ describe('Modules.dates', function() { assert.isFalse( Modules.dates.isTime( '2015-01-23 13:45' ) ); assert.isFalse( Modules.dates.isTime( '20150123T1345' ) ); assert.isFalse( Modules.dates.isTime( 'abc' ) ); - assert.isFalse( Modules.dates.isTime( '12345' ) ); + assert.isFalse( Modules.dates.isTime( '12345' ) ); }); - - + + it('parseAmPmTime', function(){ assert.equal( Modules.dates.parseAmPmTime( '5am' ), '05' ); assert.equal( Modules.dates.parseAmPmTime( '12pm' ), '12' ); @@ -82,8 +82,8 @@ describe('Modules.dates', function() { assert.equal( Modules.dates.parseAmPmTime( '05:34:00' ), '05:34:00' ); assert.equal( Modules.dates.parseAmPmTime( '1:52:04pm' ), '13:52:04' ); }); - - + + it('dateTimeUnion', function(){ assert.equal( Modules.dates.dateTimeUnion( '2015-01-23', '05:34:00', 'HTML5' ).toString('HTML5'), '2015-01-23 05:34:00' ); assert.equal( Modules.dates.dateTimeUnion( '2015-01-23', '05:34', 'HTML5' ).toString('HTML5'), '2015-01-23 05:34' ); @@ -93,8 +93,8 @@ describe('Modules.dates', function() { assert.equal( Modules.dates.dateTimeUnion( '2015-01-23', '', 'HTML5' ).toString('HTML5'), '2015-01-23' ); assert.equal( Modules.dates.dateTimeUnion( '', '', 'HTML5' ).toString('HTML5'), '' ); }); - - + + it('concatFragments', function(){ assert.equal( Modules.dates.concatFragments( ['2015-01-23', '05:34:00'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34:00' ); assert.equal( Modules.dates.concatFragments( ['05:34:00', '2015-01-23'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34:00' ); @@ -103,11 +103,11 @@ describe('Modules.dates', function() { assert.equal( Modules.dates.concatFragments( ['2015-01-23', '05:34', '-01'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34-01' ); assert.equal( Modules.dates.concatFragments( ['2015-01-23', '05:34', '-01:00'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34-01:00' ); assert.equal( Modules.dates.concatFragments( ['2015-01-23', '05:34-01:00'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34-01:00' ); - + }); - - - + + + }); diff --git a/toolkit/components/microformats/test/module-tests/domutils-test.js b/toolkit/components/microformats/test/module-tests/domutils-test.js index 5012696909..5d3f036a9f 100644 --- a/toolkit/components/microformats/test/module-tests/domutils-test.js +++ b/toolkit/components/microformats/test/module-tests/domutils-test.js @@ -5,85 +5,85 @@ Unit test for domutils assert = chai.assert; -// Tests the private Modules.domUtils object -// Modules.domUtils is unit tested as it has an interface access by other modules +// Tests the private Modules.domUtils object +// Modules.domUtils is unit tested as it has an interface access by other modules describe('Modules.domutils', function() { - + it('ownerDocument', function(){ - var node = document.createElement('div'); + var node = document.createElement('div'); assert.equal( Modules.domUtils.ownerDocument( node ).nodeType, 9); }); - - + + it('innerHTML', function(){ var html = 'Glenn Jones', node = document.createElement('div'); - + node.innerHTML = html; assert.equal( Modules.domUtils.innerHTML( node ), html ); }); - - + + it('hasAttribute', function(){ var node = document.createElement('a'); - + node.href = 'http://glennjones.net'; assert.isTrue( Modules.domUtils.hasAttribute( node, 'href' ) ); assert.isFalse( Modules.domUtils.hasAttribute( node, 'class' ) ); }); - - + + it('hasAttributeValue', function(){ var node = document.createElement('a'); - + node.href = 'http://glennjones.net'; assert.isTrue( Modules.domUtils.hasAttributeValue( node, 'href', 'http://glennjones.net' ) ); assert.isFalse( Modules.domUtils.hasAttributeValue( node, 'href', 'http://example.net' ) ); assert.isFalse( Modules.domUtils.hasAttributeValue( node, 'class', 'test' ) ); }); - - + + it('getAttribute', function(){ var node = document.createElement('a'); - + node.href = 'http://glennjones.net'; assert.equal( Modules.domUtils.getAttribute( node, 'href' ), 'http://glennjones.net' ); }); - - + + it('setAttribute', function(){ var node = document.createElement('a'); - + Modules.domUtils.setAttribute(node, 'href', 'http://glennjones.net') assert.equal( Modules.domUtils.getAttribute( node, 'href' ), 'http://glennjones.net' ); }); - - + + it('removeAttribute', function(){ var node = document.createElement('a'); - + node.href = 'http://glennjones.net'; Modules.domUtils.removeAttribute(node, 'href') assert.isFalse( Modules.domUtils.hasAttribute( node, 'href' ) ); }); - + it('getAttributeList', function(){ var node = document.createElement('a'); - + node.rel = 'next'; assert.deepEqual( Modules.domUtils.getAttributeList( node, 'rel'), ['next'] ); node.rel = 'next bookmark'; assert.deepEqual( Modules.domUtils.getAttributeList( node, 'rel'), ['next','bookmark'] ); }); - - + + it('hasAttributeValue', function(){ var node = document.createElement('a'); - + node.href = 'http://glennjones.net'; node.rel = 'next bookmark'; assert.isTrue( Modules.domUtils.hasAttributeValue( node, 'href', 'http://glennjones.net' ) ); @@ -92,115 +92,115 @@ describe('Modules.domutils', function() { assert.isTrue( Modules.domUtils.hasAttributeValue( node, 'rel', 'bookmark' ) ); assert.isFalse( Modules.domUtils.hasAttributeValue( node, 'rel', 'previous' ) ); }); - - + + it('getNodesByAttribute', function(){ var node = document.createElement('ul'); node.innerHTML = '
  • one
  • two
  • three
  • '; - + assert.equal( Modules.domUtils.getNodesByAttribute( node, 'class' ).length, 2 ); assert.equal( Modules.domUtils.getNodesByAttribute( node, 'href' ).length, 0 ); }); - - + + it('getNodesByAttributeValue', function(){ var node = document.createElement('ul'); node.innerHTML = '
  • one
  • two
  • three
  • four
  • '; - + assert.equal( Modules.domUtils.getNodesByAttributeValue( node, 'class', 'h-card' ).length, 2 ); assert.equal( Modules.domUtils.getNodesByAttributeValue( node, 'class', 'p-name' ).length, 1 ); assert.equal( Modules.domUtils.getNodesByAttributeValue( node, 'class', 'u-url' ).length, 0 ); }); - + it('getAttrValFromTagList', function(){ var node = document.createElement('a'); - + node.href = 'http://glennjones.net'; - + assert.equal( Modules.domUtils.getAttrValFromTagList( node, ['a','area'], 'href' ), 'http://glennjones.net' ); assert.equal( Modules.domUtils.getAttrValFromTagList( node, ['a','area'], 'class' ), null ); assert.equal( Modules.domUtils.getAttrValFromTagList( node, ['p'], 'href' ), null ); }); - - + + it('getSingleDescendant', function(){ var html = 'Glenn Jones', node = document.createElement('div'); - + node.innerHTML = html, - - // one instance of a element + + // one instance of a element assert.equal( Modules.domUtils.getSingleDescendant( node ).outerHTML, html ); - - // two instances of a element + + // two instances of a element node.appendChild(document.createElement('a')); assert.equal( Modules.domUtils.getSingleDescendant( node ), null ); - + }); - + it('getSingleDescendantOfType', function(){ var html = 'Glenn Jones', node = document.createElement('div'); - + node.innerHTML = html, - - // one instance of a element + + // one instance of a element assert.equal( Modules.domUtils.getSingleDescendantOfType( node, ['a', 'link']).outerHTML, html ); assert.equal( Modules.domUtils.getSingleDescendantOfType( node, ['img','area']), null ); - + node.appendChild(document.createElement('p')); assert.equal( Modules.domUtils.getSingleDescendantOfType( node, ['a', 'link']).outerHTML, html ); - - // two instances of a element + + // two instances of a element node.appendChild(document.createElement('a')); assert.equal( Modules.domUtils.getSingleDescendantOfType( node, ['a', 'link']), null ); - + }); - - + + it('appendChild', function(){ var node = document.createElement('div'), child = document.createElement('a'); - - Modules.domUtils.appendChild( node, child ); + + Modules.domUtils.appendChild( node, child ); assert.equal( node.innerHTML, '' ); }); - - + + it('removeChild', function(){ var node = document.createElement('div'), child = document.createElement('a'); - - node.appendChild(child) - - assert.equal( node.innerHTML, '' ); - Modules.domUtils.removeChild( child ); + + node.appendChild(child) + + assert.equal( node.innerHTML, '' ); + Modules.domUtils.removeChild( child ); assert.equal( node.innerHTML, '' ); }); - - + + it('clone', function(){ var node = document.createElement('div'); - + node.innerHTML = 'text content'; assert.equal( Modules.domUtils.clone( node ).outerHTML, '
    text content
    ' ); }); - + it('getElementText', function(){ assert.equal( Modules.domUtils.getElementText( {} ), '' ); }); - - + + it('getNodePath', function(){ var node = document.createElement('ul'); node.innerHTML = '
    • one
    • two
    • three
    • four
    '; - var child = node.querySelector('.p-name'); - + var child = node.querySelector('.p-name'); + assert.deepEqual( Modules.domUtils.getNodePath( child ), [0,0,3] ); }); - - + + }); diff --git a/toolkit/components/microformats/test/module-tests/html-test.js b/toolkit/components/microformats/test/module-tests/html-test.js index 8ba77c7899..cd06c7b7f7 100644 --- a/toolkit/components/microformats/test/module-tests/html-test.js +++ b/toolkit/components/microformats/test/module-tests/html-test.js @@ -4,47 +4,47 @@ Unit test for html assert = chai.assert; -// Tests the private Modules.html object -// Modules.html is unit tested as it has an interface access by other modules +// Tests the private Modules.html object +// Modules.html is unit tested as it has an interface access by other modules describe('Modules.html', function() { - - + + it('parse', function(){ var html = 'Glenn Jones', bloghtml = '
    1. This be the title

      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo non sapien dapibus blandit nec et leo. Ut ut malesuada tellus.

    ', node = document.createElement('div'); - + node.innerHTML = html; assert.equal(Modules.html.parse( node ), html ); - + // make sure excludes 'data-include' marked items var child = document.createElement('p'); child.setAttribute('data-include', 'true'); node.appendChild(child); assert.equal( Modules.html.parse( node ), html ); - + node = document.createElement('div'); node.innerHTML = bloghtml; assert.equal( Modules.html.parse( node ), bloghtml ); - + node = document.createElement('div'); assert.equal( Modules.html.parse( node ), '' ); - + child = document.createElement('br'); node.appendChild(child); assert.equal( Modules.html.parse( node ), '
    ' ); - + node = document.createComment('test comment'); assert.equal( Modules.html.parse( node ), '' ); - + }); - - - - - - + + + + + + }); diff --git a/toolkit/components/microformats/test/module-tests/isodate-test.js b/toolkit/components/microformats/test/module-tests/isodate-test.js index a87a183e91..5f081f81cc 100644 --- a/toolkit/components/microformats/test/module-tests/isodate-test.js +++ b/toolkit/components/microformats/test/module-tests/isodate-test.js @@ -5,14 +5,14 @@ Unit test for dates assert = chai.assert; -// Tests private Modules.ISODate object -// Modules.ISODate is unit tested as it has an interface access by other modules +// Tests private Modules.ISODate object +// Modules.ISODate is unit tested as it has an interface access by other modules describe('Modules.ISODates', function() { - - + + it('constructor', function(){ assert.equal( new Modules.ISODate().toString('auto'), '' ); assert.equal( new Modules.ISODate('2015-01-23T05:34:00', 'html5').toString('html5'), '2015-01-23 05:34:00' ); @@ -20,30 +20,30 @@ describe('Modules.ISODates', function() { assert.equal( new Modules.ISODate('2015-01-23T05:34:00', 'html5').toString('rfc3339'), '20150123T053400' ); assert.equal( new Modules.ISODate('2015-01-23T05:34:00', 'auto').toString('auto'), '2015-01-23T05:34:00' ); }); - - + + it('parse', function(){ assert.equal( new Modules.ISODate().parse('2015-01-23T05:34:00', 'html5').toString('html5'), '2015-01-23 05:34:00' ); assert.equal( new Modules.ISODate().parse('2015-01-23T05:34:00', 'auto').toString('auto'), '2015-01-23T05:34:00' ); assert.equal( new Modules.ISODate().parse('2015-01-23t05:34:00', 'auto').toString('auto'), '2015-01-23t05:34:00' ); - + assert.equal( new Modules.ISODate().parse('2015-01-23t05:34:00Z', 'auto').toString('auto'), '2015-01-23t05:34:00Z' ); assert.equal( new Modules.ISODate().parse('2015-01-23t05:34:00z', 'auto').toString('auto'), '2015-01-23t05:34:00z' ); assert.equal( new Modules.ISODate().parse('2015-01-23 05:34:00Z', 'auto').toString('auto'), '2015-01-23 05:34:00Z' ); assert.equal( new Modules.ISODate().parse('2015-01-23 05:34', 'auto').toString('auto'), '2015-01-23 05:34' ); assert.equal( new Modules.ISODate().parse('2015-01-23 05', 'auto').toString('auto'), '2015-01-23 05' ); - + assert.equal( new Modules.ISODate().parse('2015-01-23 05:34+01:00', 'auto').toString('auto'), '2015-01-23 05:34+01:00' ); assert.equal( new Modules.ISODate().parse('2015-01-23 05:34-01:00', 'auto').toString('auto'), '2015-01-23 05:34-01:00' ); assert.equal( new Modules.ISODate().parse('2015-01-23 05:34-01', 'auto').toString('auto'), '2015-01-23 05:34-01' ); - - + + assert.equal( new Modules.ISODate().parse('2015-01-23', 'auto').toString('auto'), '2015-01-23' ); // TODO support for importing rfc3339 profile dates // assert.equal( new Modules.ISODate().parse('20150123t0534', 'auto').toString('auto'), '2015-01-23 05:34' ); }); - - + + it('parseDate', function(){ assert.equal( new Modules.ISODate().parseDate('2015-01-23T05:34:00', 'html5'), '2015-01-23' ); assert.equal( new Modules.ISODate().parseDate('2015-01-23', 'auto'), '2015-01-23' ); @@ -51,95 +51,95 @@ describe('Modules.ISODates', function() { assert.equal( new Modules.ISODate().parseDate('2015', 'auto'), '2015' ); assert.equal( new Modules.ISODate().parseDate('2015-134', 'auto'), '2015-134' ); }); - - + + it('parseTime', function(){ assert.equal( new Modules.ISODate().parseTime('05:34:00.1267', 'html5'), '05:34:00.1267' ); assert.equal( new Modules.ISODate().parseTime('05:34:00', 'html5'), '05:34:00' ); assert.equal( new Modules.ISODate().parseTime('05:34', 'html5'), '05:34' ); assert.equal( new Modules.ISODate().parseTime('05', 'html5'), '05' ); }); - + it('parseTimeZone', function(){ var date = new Modules.ISODate(); date.parseTime('14:00'); assert.equal( date.parseTimeZone('-01:00', 'auto'), '14:00-01:00' ); - + date.clear(); date.parseTime('14:00'); assert.equal( date.parseTimeZone('-01', 'auto'), '14:00-01' ); - + date.clear(); date.parseTime('14:00'); assert.equal( date.parseTimeZone('+01:00', 'auto').toString('auto'), '14:00+01:00' ); - + date.clear(); date.parseTime('15:00'); assert.equal( date.parseTimeZone('Z', 'auto').toString('auto'), '15:00Z' ); - + date.clear(); date.parseTime('16:00'); assert.equal( date.parseTimeZone('z', 'auto'), '16:00z' ); - + }); - - - + + + it('toString', function(){ - var date = new Modules.ISODate(); + var date = new Modules.ISODate(); date.parseTime('05:34:00.1267'); - + assert.equal( date.toString('html5'), '05:34:00.1267' ); }); - - + + it('toTimeString', function(){ - var date = new Modules.ISODate(); + var date = new Modules.ISODate(); date.parseTime('05:34:00.1267'); - + assert.equal( date.toTimeString('html5'), '05:34:00.1267' ); }); - - + + it('hasFullDate', function(){ var dateEmpty = new Modules.ISODate(), date = new Modules.ISODate('2015-01-23T05:34:00'); - - assert.isFalse( dateEmpty.hasFullDate() ); - assert.isTrue( date.hasFullDate() ); + + assert.isFalse( dateEmpty.hasFullDate() ); + assert.isTrue( date.hasFullDate() ); }); - - + + it('hasDate', function(){ var dateEmpty = new Modules.ISODate(), date = new Modules.ISODate('2015-01-23'); - - assert.isFalse( dateEmpty.hasDate() ); - assert.isTrue( date.hasDate() ); + + assert.isFalse( dateEmpty.hasDate() ); + assert.isTrue( date.hasDate() ); }); - - + + it('hasTime', function(){ var dateEmpty = new Modules.ISODate(), date = new Modules.ISODate(); - + date.parseTime('12:34'); - - assert.isFalse( dateEmpty.hasTime() ); - assert.isTrue( date.hasTime() ); + + assert.isFalse( dateEmpty.hasTime() ); + assert.isTrue( date.hasTime() ); }); - - + + it('hasTimeZone', function(){ var dateEmpty = new Modules.ISODate(), date = new Modules.ISODate(); - + date.parseTime('12:34'), date.parseTimeZone('-01:00'); - - assert.isFalse( dateEmpty.hasTimeZone() ); - assert.isTrue( date.hasTimeZone() ); + + assert.isFalse( dateEmpty.hasTimeZone() ); + assert.isTrue( date.hasTimeZone() ); }); - - + + }); diff --git a/toolkit/components/microformats/test/module-tests/text-test.js b/toolkit/components/microformats/test/module-tests/text-test.js index 216931424b..f1f2e775cf 100644 --- a/toolkit/components/microformats/test/module-tests/text-test.js +++ b/toolkit/components/microformats/test/module-tests/text-test.js @@ -4,53 +4,53 @@ Unit test for text assert = chai.assert; -// Tests the private Modules.text object -// Modules.text is unit tested as it has an interface access by other modules +// Tests the private Modules.text object +// Modules.text is unit tested as it has an interface access by other modules describe('Modules.text', function() { - - + + it('parse', function(){ var html = '\n Glenn\n Jones \n \n', node = document.createElement('div'); - + node.innerHTML = html; assert.equal( Modules.text.parse( document, node, 'whitespacetrimmed' ), 'Glenn\n Jones' ); assert.equal( Modules.text.parse( document, node, 'whitespace' ), '\n Glenn\n Jones \n \n' ); assert.equal( Modules.text.parse( document, node, 'normalised' ), 'Glenn Jones' ); - + // exclude tags node.innerHTML = 'text'; assert.equal( Modules.text.parse( document, node, 'normalised' ), 'text' ); - - // block level + + // block level node.innerHTML = '

    test

    text'; //assert.equal( Modules.text.parse( document, node, 'normalised' ), 'test text' ); - + // node with no text data node = document.createComment('test comment'); assert.equal( Modules.text.parse( document, node, 'normalised' ), '' ); - + }); - - + + it('parseText', function(){ var text = '\n Glenn\n Jones \n \n'; - + // create DOM context first Modules.domUtils.getDOMContext( {} ); - + assert.equal( Modules.text.parseText( document, text, 'whitespacetrimmed' ), 'Glenn\n Jones' ); assert.equal( Modules.text.parseText( document, text, 'whitespace' ), '\n Glenn\n Jones \n \n' ); assert.equal( Modules.text.parseText( document, text, 'normalised' ), 'Glenn Jones' ); }); - - - it('formatText', function(){ + + + it('formatText', function(){ assert.equal( Modules.text.formatText( document, null, 'whitespacetrimmed' ), '' ); }); - - + + }); diff --git a/toolkit/components/microformats/test/module-tests/url-test.js b/toolkit/components/microformats/test/module-tests/url-test.js index b3f46df0b9..788e8fdb51 100644 --- a/toolkit/components/microformats/test/module-tests/url-test.js +++ b/toolkit/components/microformats/test/module-tests/url-test.js @@ -5,21 +5,21 @@ Unit test for url assert = chai.assert; -// Tests the private Modules.url object -// Modules.url is unit tested as it has an interface access by other modules +// Tests the private Modules.url object +// Modules.url is unit tested as it has an interface access by other modules describe('Modules.url', function() { - + it('resolve', function(){ assert.equal( Modules.url.resolve( 'docs/index.html', 'http://example.org' ), 'http://example.org/docs/index.html' ); assert.equal( Modules.url.resolve( '../index.html', 'http://example.org/docs/' ), 'http://example.org/index.html' ); assert.equal( Modules.url.resolve( '/', 'http://example.org/' ), 'http://example.org/' ); assert.equal( Modules.url.resolve( 'http://glennjones.net/', 'http://example.org/' ), 'http://glennjones.net/' ); - + assert.equal( Modules.url.resolve( undefined, 'http://example.org/' ), '' ); assert.equal( Modules.url.resolve( undefined, undefined ), '' ); assert.equal( Modules.url.resolve( 'http://glennjones.net/', undefined ), 'http://glennjones.net/' ); }); - + }); diff --git a/toolkit/components/microformats/test/module-tests/utilities-test.js b/toolkit/components/microformats/test/module-tests/utilities-test.js index 634fa46bdc..b37236a6bc 100644 --- a/toolkit/components/microformats/test/module-tests/utilities-test.js +++ b/toolkit/components/microformats/test/module-tests/utilities-test.js @@ -4,14 +4,14 @@ Unit test for utilities assert = chai.assert; -// Tests the private Modules.utils object -// Modules.utils is unit tested as it has an interface access by other modules +// Tests the private Modules.utils object +// Modules.utils is unit tested as it has an interface access by other modules describe('Modules.utilities', function() { - - - it('isString', function(){ + + + it('isString', function(){ assert.isTrue( Modules.utils.isString( 'abc' ) ); assert.isFalse( Modules.utils.isString( 123 ) ); assert.isFalse( Modules.utils.isString( 1.23 ) ); @@ -19,21 +19,21 @@ describe('Modules.utilities', function() { assert.isFalse( Modules.utils.isString( ['abc'] ) ); assert.isFalse( Modules.utils.isString( true ) ); }); - - + + it('isArray', function(){ assert.isTrue( Modules.utils.isArray( ['abc'] ) ); assert.isFalse( Modules.utils.isArray( 123 ) ); - assert.isFalse( Modules.utils.isArray( 1.23 ) ); + assert.isFalse( Modules.utils.isArray( 1.23 ) ); assert.isFalse( Modules.utils.isArray( 'abc' ) ); assert.isFalse( Modules.utils.isArray( {'abc': 'abc'} ) ); assert.isFalse( Modules.utils.isArray( true ) ); }); - - + + it('isNumber', function(){ assert.isTrue( Modules.utils.isNumber( 123 ) ); - assert.isTrue( Modules.utils.isNumber( 1.23 ) ); + assert.isTrue( Modules.utils.isNumber( 1.23 ) ); assert.isFalse( Modules.utils.isNumber( 'abc' ) ); assert.isFalse( Modules.utils.isNumber( {'abc': 'abc'} ) ); assert.isFalse( Modules.utils.isNumber( ['abc'] ) ); @@ -46,48 +46,48 @@ describe('Modules.utilities', function() { assert.isFalse( Modules.utils.startWith( 'p-name', 'name' ) ); assert.isFalse( Modules.utils.startWith( 'p-name', 'u-' ) ); }); - - + + it('trim', function(){ assert.equal( Modules.utils.trim( ' Glenn Jones ' ), 'Glenn Jones' ); assert.equal( Modules.utils.trim( 'Glenn Jones' ), 'Glenn Jones' ); assert.equal( Modules.utils.trim( undefined ), '' ); }); - - + + it('replaceCharAt', function(){ assert.equal( Modules.utils.replaceCharAt( 'Glenn Jones', 5, '-' ), 'Glenn-Jones' ); assert.equal( Modules.utils.replaceCharAt( 'Glenn Jones', 50, '-' ), 'Glenn Jones' ); - }); - - + }); + + it('isOnlyWhiteSpace', function(){ assert.isTrue( Modules.utils.isOnlyWhiteSpace( ' ') ); assert.isTrue( Modules.utils.isOnlyWhiteSpace( ' \n\r') ); assert.isFalse( Modules.utils.isOnlyWhiteSpace( ' text\n\r') ); }); - - + + it('collapseWhiteSpace', function(){ assert.equal( Modules.utils.collapseWhiteSpace( ' '), ' ' ); assert.equal( Modules.utils.collapseWhiteSpace( ' \n\r'), ' ' ); assert.equal( Modules.utils.collapseWhiteSpace( ' text\n\r'), ' text ' ); - }); - - + }); + + it('hasProperties', function(){ assert.isTrue( Modules.utils.hasProperties( {name: 'glennjones'} ) ); assert.isFalse( Modules.utils.hasProperties( {} ) ); }); - - + + it('sortObjects', function(){ var arr = [{'name': 'one'},{'name': 'two'},{'name': 'three'},{'name': 'three'}]; - + assert.deepEqual( arr.sort( Modules.utils.sortObjects( 'name', true ) ), [{"name":"two"},{"name":"three"},{'name': 'three'},{"name":"one"}] ); assert.deepEqual( arr.sort( Modules.utils.sortObjects( 'name', false ) ), [{"name":"one"},{"name":"three"},{'name': 'three'},{"name":"two"}] ); }); - - - + + + }); diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js index bf8efc17ae..cf6ca9ea1a 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js +++ b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-mixed/h-card/mixedpropertries The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js index 92eedbef22..414d3db1bc 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js +++ b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-mixed/h-card/tworoots The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js index eff3ff018a..c606a19b3c 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js +++ b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-mixed/h-entry/mixedroots The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js index 6a07cc994f..c521cd576c 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js +++ b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-mixed/h-resume/mixedroots The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js index 37108f6ccd..cd380fd778 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/adr/simpleproperties The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js index a674ff95c7..7ff9576c0d 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/geo/abbrpattern The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js index e0e2d2ff7d..a14f05e9f1 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/geo/hidden The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js index d14ece14be..fe495fd91b 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/geo/simpleproperties The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js index 0daf716a75..ad35d3b4d1 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/geo/valuetitleclass The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js index 994dd69f50..27b1c383a6 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcalendar/ampm The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js index edd59954eb..6ea1788a4c 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcalendar/attendees The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js index 3f7c7be9c1..852a4da20e 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcalendar/combining The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js index 42483afae7..f4d60aee22 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcalendar/concatenate The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js index 8c89de2dae..81b7c55453 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcalendar/time The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js index bdf9556012..3c7e8368f5 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcard/email The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js index 432e3a104f..ffe52ed549 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcard/format The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js index 76c7fb1dd1..175eed3992 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcard/hyperlinkedphoto The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js index 7716dacf5c..22a067982e 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcard/justahyperlink The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js index 8e6355c52b..365f708f9f 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcard/justaname The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js index d39fd924cd..102233a793 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcard/multiple The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js index 18ab81aa93..613a94c75b 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcard/name The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js index e3ea7c2e72..eabfdd4c68 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hcard/single The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js index 33361bb54c..9aff8844f2 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hentry/summarycontent The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js index 12a7871e63..32779966e5 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hfeed/simple The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js index 0256234182..90bae1a01b 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hnews/all The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js index 0dab869251..cb686e5cfe 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hnews/minimum The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js index cdbf6717e8..a3b2452bc1 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hproduct/aggregate The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js index 905d7cab9c..3c6a2c265c 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hproduct/simpleproperties The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js index c75e3f5755..ea3ef2d73e 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hresume/affiliation The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js index 582f50f2b6..e511adf821 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hresume/contact The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js index 7c1354881c..876af45717 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hresume/education The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js index 77be113df0..d52021f387 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hresume/skill The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js index f6bedd484c..d5672b1dad 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hresume/work The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js index 2194e5a66e..012f12bc0c 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hreview-aggregate/hcard The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js index f2663b2844..50c9c2e217 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hreview-aggregate/justahyperlink The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js index 448d9ea577..f9ddd42ce0 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hreview-aggregate/vevent The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js index 8d3d9e1fb4..fda082906b 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hreview/item The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js index ced7278584..addadf2b87 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/hreview/vcard The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js index 12fc2fac7e..f72c401cbe 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/includes/hcarditemref The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js index c070c0122a..c37612ce28 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/includes/heventitemref The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js index 246eccdd42..dbda015aa7 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/includes/hyperlink The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js index 1d7d2849a3..0f0328102a 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/includes/object The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js index e52a312e14..bac4c97b22 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v1/includes/table The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js index befd63d9d7..77f5712a66 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-adr/geo The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js index f69a393efd..1c0192fcd5 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-adr/geourl The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js index 3092843639..a6231cca9f 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-adr/justaname The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js index ba33a40fc6..bbf6017f80 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-adr/simpleproperties The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js index 2ffac8d303..9795141ce6 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-as-note/note The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js index 5f3eb584bb..bf456cd3be 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/baseurl The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js index 8d50f1e075..ae61d554ee 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/childimplied The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js index 52f5471e3a..9af48c7ed3 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/extendeddescription The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js index 2d0ae63b86..c9536f005c 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/hcard The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js index 61e35b912a..5e19b9bd17 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/horghcard The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js index cbc8435647..281fcd1989 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/hyperlinkedphoto The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js index 1156f08f82..b28ddc55ef 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/impliedname The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js index 3ee065bfc0..5933bf6ba8 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/impliedphoto The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js index 9fc9bdab3f..6d9beb9782 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/impliedurl The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js index 6c833535bc..9a4dad6408 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/justahyperlink The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js index b1be8a43d3..44f0ea6149 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/justaname The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js index 22ac59a545..3cf83a8f40 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/nested The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js index ad5a55b803..6920e1c77e 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/p-property The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js index 367460f122..b9a43d116e 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-card/relativeurls The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js index 227abad64a..7420916162 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-entry/impliedvalue-nested The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js index 26a4617eac..db514587da 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-entry/justahyperlink The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js index ffed9c0e41..2f729d58d7 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-entry/justaname The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js index 360a93c510..87a6aa29c6 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-entry/summarycontent The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js index c04ae59bd1..61de69001b 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-entry/u-property The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js index 58565f60fc..d4c29053c2 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-entry/urlincontent The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js index 474d6a4511..4900a99798 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-event/ampm The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js index cbc4488d73..00f9e6fc89 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-event/attendees The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js index 2012291211..10265a0dd2 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-event/combining The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js index a892800163..e1721e55d7 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-event/concatenate The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js index 49d04ddaf3..80e274cd04 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-event/dates The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js index 73da54ab81..535edfa81d 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-event/dt-property The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js index 1f647c34b7..63ad22d348 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-event/justahyperlink The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js index 6cce97852d..729210ecb2 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-event/justaname The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js index e99c337d2c..6aaad1aa7b 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-event/time The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js index 032c4bc076..bd99cc41f5 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-feed/implied-title The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js index 8e92d7bff2..dd48e6436f 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-feed/simple The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js index f58d56569e..04ef6e1770 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-geo/abbrpattern The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js index 701e22d6f4..4d35840cb1 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-geo/altitude The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js index cad6aa198f..4a03bf907e 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-geo/hidden The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js index 548342b6d0..df294dcd3f 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-geo/justaname The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js index 33bbc507fe..0b45f48a96 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-geo/simpleproperties The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js index 92ab8e673c..75c3baa821 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-geo/valuetitleclass The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js index f333ffa7c2..b49695ae9d 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-news/all The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js index 9bedc5086e..935e96e08a 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-news/minimum The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js index 93213a954e..6283dc69ba 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-org/hyperlink The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js index effb37456e..c42b4d2b13 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-org/simple The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js index 77b8ccb049..238b40f959 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-org/simpleproperties The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js index 28e8964406..a125cb1eb0 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-product/aggregate The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js index 98963f782a..cc68b8c138 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-product/justahyperlink The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js index 9f72d47610..bc55a5bb17 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-product/justaname The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js index 329b6d0cf4..163758419f 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-product/simpleproperties The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js index dec7493bf3..c951d75126 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-recipe/all The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js index 638d64d659..21032b21b2 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-recipe/minimum The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js index 15faa25077..85adb3f637 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-resume/affiliation The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js index 6932557ac7..876a59970a 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-resume/contact The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js index 1842351ae3..8b6af4089d 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-resume/education The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js index ec3005ddb6..3ca5cad3a2 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-resume/justaname The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js index caa90f67b9..843bc4a1c4 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-resume/skill The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js index 99ff87ce2b..f0aafed193 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-resume/work The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js index 4bb6a3b1c2..cb265acf40 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-review-aggregate/hevent The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js index c51e9763b1..040227e701 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-review-aggregate/justahyperlink The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js index 603f818365..4eba92bd34 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-review-aggregate/simpleproperties The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js index 28ae0505cb..ac81fbd414 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-review/hyperlink The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js index 1d97f65ce3..4a0af98895 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-review/implieditem The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js index a189eec956..d0ba277701 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-review/item The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js index 6def0709cb..dade08f1fa 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-review/justaname The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js index 92741873b0..903570f3c6 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-review/photo The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js index db6a743008..5d46e48d80 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/h-review/vcard The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js index 72af915e01..e4a893ad7c 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/rel/duplicate-rels The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js index 944e1599b9..dead1f480b 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/rel/license The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js index 19089178f9..8987399994 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/rel/nofollow The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js index 88d0857bc7..c85daee03b 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/rel/rel-urls The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js index 1fdc423a89..e4896e9818 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/rel/varying-text-duplicate-rels The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js index ecdd9e66e6..cbd6327e7b 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/rel/xfn-all The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js index 0aeee29190..4db25660e7 100644 --- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js +++ b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js @@ -1,5 +1,5 @@ /* -Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 +Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24 Mocha integration test from: microformats-v2/rel/xfn-elsewhere The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST) */ diff --git a/toolkit/components/microformats/test/static/javascript/DOMParser.js b/toolkit/components/microformats/test/static/javascript/DOMParser.js index caffb8fb45..fa26bcdfd9 100644 --- a/toolkit/components/microformats/test/static/javascript/DOMParser.js +++ b/toolkit/components/microformats/test/static/javascript/DOMParser.js @@ -53,7 +53,7 @@ // Mess with DOMParser.prototype (less than optimal...) if one of the above worked // Assume can write to the prototype, if not, make this a stand alone function - if (DOMParser.prototype && (htmlElInnerHTML || textXML)) { + if (DOMParser.prototype && (htmlElInnerHTML || textXML)) { DOMParser_proto = DOMParser.prototype; real_parseFromString = DOMParser_proto.parseFromString; @@ -76,7 +76,7 @@ // Make sure markup is wrapped in HTML tags // Should probably allow for a DOCTYPE if (!(/^$/i.test(markup))) { - markup = '' + markup + '<\/html>'; + markup = '' + markup + '<\/html>'; } doc = (new DOMParser).parseFromString(markup, 'text/xml'); doc_el = doc.documentElement; diff --git a/toolkit/components/microformats/test/static/javascript/beautify.js b/toolkit/components/microformats/test/static/javascript/beautify.js index 68cc89eb70..55d06cb08b 100644 --- a/toolkit/components/microformats/test/static/javascript/beautify.js +++ b/toolkit/components/microformats/test/static/javascript/beautify.js @@ -3,10 +3,10 @@ JS Beautifier --------------- - Written by Einars "elfz" Lielmanis, + Written by Einars "elfz" Lielmanis, http://elfz.laacz.lv/beautify/ - Originally converted to javascript by Vital, + Originally converted to javascript by Vital, http://my.opera.com/Vital/blog/2007/11/21/javascript-beautify-on-javascript-translated @@ -411,7 +411,7 @@ function js_beautify(js_source_text, indent_size, indent_character) } return [c, 'TK_WORD']; } - + if (c == '(' || c == '[') { return [c, 'TK_START_EXPR']; } diff --git a/toolkit/components/microformats/test/static/javascript/chai.js b/toolkit/components/microformats/test/static/javascript/chai.js index 53bffed34d..b93c6f6e00 100644 --- a/toolkit/components/microformats/test/static/javascript/chai.js +++ b/toolkit/components/microformats/test/static/javascript/chai.js @@ -3155,7 +3155,7 @@ module.exports = function (chai, util) { * ### .ifError(object) * * Asserts if value is not a false value, and throws if it is a true value. - * This is added to allow for chai to be a drop-in replacement for Node's + * This is added to allow for chai to be a drop-in replacement for Node's * assert class. * * var err = new Error('I am a custom error'); @@ -3828,7 +3828,7 @@ var getPathInfo = require('./getPathInfo'); module.exports = function(path, obj) { var info = getPathInfo(path, obj); return info.value; -}; +}; },{"./getPathInfo":16}],18:[function(require,module,exports){ /*! @@ -3896,7 +3896,7 @@ var type = require('type-detect'); * hasProperty('str', obj); // true * hasProperty('constructor', obj); // true * hasProperty('bar', obj); // false - * + * * hasProperty('length', obj.str); // true * hasProperty(1, obj.str); // true * hasProperty(5, obj.str); // false diff --git a/toolkit/components/microformats/test/static/javascript/count.js b/toolkit/components/microformats/test/static/javascript/count.js index 52876bb7a9..3dcf56974a 100644 --- a/toolkit/components/microformats/test/static/javascript/count.js +++ b/toolkit/components/microformats/test/static/javascript/count.js @@ -1,5 +1,5 @@ /*! - parse + parse Used by http://localhost:3000/ Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt @@ -8,28 +8,28 @@ window.onload = function() { var form; - form= document.getElementById('mf-form'); - + form= document.getElementById('mf-form'); + form.onsubmit = function(e){ e.preventDefault(); - + var html, doc, node, options, mfJSON, parserJSONElt; - + // get data from html html = document.getElementById('html').value; parserJSONElt = document.querySelector('#parser-json pre code') - + // createHTMLDocument is not well support below ie9 doc = document.implementation.createHTMLDocument("New Document"); node = document.createElement('div'); node.innerHTML = html; - doc.body.appendChild(node); - + doc.body.appendChild(node); + options ={ 'node': node }; @@ -42,13 +42,13 @@ window.onload = function() { mfJSON = Microformats.count(options); } - + // format output parserJSONElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(mfJSON) ) ); - //prettyPrint(); - + //prettyPrint(); + } - + function htmlEscape(str) { return String(str) .replace(/&/g, '&') @@ -57,6 +57,6 @@ window.onload = function() { .replace(//g, '>'); } - - -}; + + +}; diff --git a/toolkit/components/microformats/test/static/javascript/parse.js b/toolkit/components/microformats/test/static/javascript/parse.js index 8ea6fb17aa..588e403eef 100644 --- a/toolkit/components/microformats/test/static/javascript/parse.js +++ b/toolkit/components/microformats/test/static/javascript/parse.js @@ -1,5 +1,5 @@ /*! - parse + parse Used by http://localhost:3000/ Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt @@ -8,18 +8,18 @@ window.onload = function() { var form; - form= document.getElementById('mf-form'); - + form= document.getElementById('mf-form'); + form.onsubmit = function(e){ e = (e)? e : window.event; - + if (e.preventDefault) { - e.preventDefault(); + e.preventDefault(); } else { - event.returnValue = false; + event.returnValue = false; } - + var html, baseUrl, filter, @@ -33,34 +33,34 @@ window.onload = function() { options, mfJSON, parserJSONElt; - + // get data from html html = document.getElementById('html').value; baseUrl = document.getElementById('baseurl').value; filters = document.getElementById('filters').value; - collapsewhitespace = document.getElementById('collapsewhitespace').checked; + collapsewhitespace = document.getElementById('collapsewhitespace').checked; //overlappingversions = document.getElementById('overlappingversions').checked; - //impliedPropertiesByVersion = document.getElementById('impliedPropertiesByVersion').checked; - parseLatLonGeo = document.getElementById('parseLatLonGeo').checked; + //impliedPropertiesByVersion = document.getElementById('impliedPropertiesByVersion').checked; + parseLatLonGeo = document.getElementById('parseLatLonGeo').checked; dateformatElt = document.getElementById("dateformat"); dateformat = dateformatElt.options[dateformatElt.selectedIndex].value; parserJSONElt = document.querySelector('#parser-json pre code') - - + + var dom = new DOMParser(); doc = dom.parseFromString( html, 'text/html' ); - + options ={ 'document': doc, 'node': doc, 'dateFormat': dateformat, 'parseLatLonGeo': false }; - + if(baseUrl.trim() !== ''){ options.baseUrl = baseUrl; } - + if(filters.trim() !== ''){ if(filters.indexOf(',') > -1){ options.filters = trimArrayItems(filters.split(',')); @@ -68,31 +68,31 @@ window.onload = function() { options.filters = [filters.trim()]; } } - + if(collapsewhitespace === true){ options.textFormat = 'normalised'; } - + /* if(overlappingversions === true){ options.overlappingVersions = false; } - + if(impliedPropertiesByVersion === true){ options.impliedPropertiesByVersion = true; } */ - + if(parseLatLonGeo === true){ options.parseLatLonGeo = true } - + if(options.baseUrl){ html = '' + html; } - - + + // parse direct into Modules to help debugging if(window.Modules){ var parser = new Modules.Parser(); @@ -101,15 +101,15 @@ window.onload = function() { mfJSON = Microformats.get(options); } - + // format output parserJSONElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(mfJSON) ) ); - //prettyPrint(); - + //prettyPrint(); + } - - -}; + + +}; diff --git a/toolkit/components/microformats/test/static/javascript/prettify.js b/toolkit/components/microformats/test/static/javascript/prettify.js index ea8715b2a7..b8a5e792e3 100644 --- a/toolkit/components/microformats/test/static/javascript/prettify.js +++ b/toolkit/components/microformats/test/static/javascript/prettify.js @@ -67,7 +67,7 @@ window['PR_SHOULD_USE_CONTINUATION'] = true; // We use things that coerce to strings to make them compact when minified // and to defeat aggressive optimizers that fold large string constants. var FLOW_CONTROL_KEYWORDS = ["break,continue,do,else,for,if,return,while"]; - var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," + + var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," + "double,enum,extern,float,goto,int,long,register,short,signed,sizeof," + "static,struct,switch,typedef,union,unsigned,void,volatile"]; var COMMON_KEYWORDS = [C_KEYWORDS,"catch,class,delete,false,import," + @@ -220,7 +220,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& */ function combinePrefixPatterns(regexs) { var capturedGroupIndex = 0; - + var needToFoldCase = false; var ignoreCase = false; for (var i = 0, n = regexs.length; i < n; ++i) { @@ -234,7 +234,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& break; } } - + var escapeCharToCodeUnit = { 'b': 8, 't': 9, @@ -243,7 +243,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& 'f': 0xc, 'r': 0xd }; - + function decodeEscape(charsetPart) { var cc0 = charsetPart.charCodeAt(0); if (cc0 !== 92 /* \\ */) { @@ -261,7 +261,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& return charsetPart.charCodeAt(1); } } - + function encodeEscape(charCode) { if (charCode < 0x20) { return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16); @@ -272,7 +272,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& } return ch; } - + function caseFoldCharset(charSet) { var charsetParts = charSet.substring(1, charSet.length - 1).match( new RegExp( @@ -315,7 +315,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& } } } - + // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]] // -> [[1, 12], [14, 14], [16, 17]] ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1] - a[1]); }); @@ -329,7 +329,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& consolidatedRanges.push(lastRange = range); } } - + var out = ['[']; if (inverse) { out.push('^'); } out.push.apply(out, groups); @@ -344,7 +344,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& out.push(']'); return out.join(''); } - + function allowAnywhereFoldCaseAndRenumberGroups(regex) { // Split into character sets, escape sequences, punctuation strings // like ('(', '(?:', ')', '^'), and runs of characters that do not @@ -363,12 +363,12 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& + ')', 'g')); var n = parts.length; - + // Maps captured group numbers to the number they will occupy in // the output or to -1 if that has not been determined, or to // undefined if they need not be capturing in the output. var capturedGroups = []; - + // Walk over and identify back references to build the capturedGroups // mapping. for (var i = 0, groupIndex = 0; i < n; ++i) { @@ -383,7 +383,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& } } } - + // Renumber groups and reduce capturing groups to non-capturing groups // where possible. for (i = 1; i < capturedGroups.length; ++i) { @@ -405,13 +405,13 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& } } } - + // Remove any prefix anchors so that the output will match anywhere. // ^^ really does mean an anchored match though. for (i = 0, groupIndex = 0; i < n; ++i) { if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; } } - + // Expand letters to groups to handle mixing of case-sensitive and // case-insensitive patterns if necessary. if (regex.ignoreCase && needToFoldCase) { @@ -431,10 +431,10 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& } } } - + return parts.join(''); } - + var rewritten = []; for (i = 0, n = regexs.length; i < n; ++i) { regex = regexs[i]; @@ -442,7 +442,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& rewritten.push( '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')'); } - + return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g'); } @@ -492,12 +492,12 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& */ function extractSourceSpans(node) { var nocode = /(?:^|\s)nocode(?:\s|$)/; - + var chunks = []; var length = 0; var spans = []; var k = 0; - + var whitespace; if (node.currentStyle) { whitespace = node.currentStyle.whiteSpace; @@ -506,7 +506,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& .getPropertyValue('white-space'); } var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3); - + function walk(node) { switch (node.nodeType) { case 1: // Element @@ -538,9 +538,9 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& break; } } - + walk(node); - + return { sourceCode: chunks.join('').replace(/\n$/, ''), spans: spans @@ -910,9 +910,9 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& function numberLines(node, opt_startLineNum) { var nocode = /(?:^|\s)nocode(?:\s|$)/; var lineBreak = /\r\n?|\n/; - + var document = node.ownerDocument; - + var whitespace; if (node.currentStyle) { whitespace = node.currentStyle.whiteSpace; @@ -923,7 +923,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& // If it's preformatted, then we need to split lines on line breaks // in addition to
    s. var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3); - + var li = document.createElement('LI'); while (node.firstChild) { li.appendChild(node.firstChild); @@ -931,7 +931,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& // An array of lines. We split below, so this is initialized to one // un-split line. var listItems = [li]; - + function walk(node) { switch (node.nodeType) { case 1: // Element @@ -971,7 +971,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& break; } } - + // Split a line after the given node. function breakAfter(lineEndNode) { // If there's nothing to the right, then we can skip ending the line @@ -981,7 +981,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& lineEndNode = lineEndNode.parentNode; if (!lineEndNode) { return; } } - + function breakLeftOf(limit, copy) { // Clone shallowly if this node needs to be on both sides of the break. var rightSide = copy ? limit.cloneNode(false) : limit; @@ -1003,9 +1003,9 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& } return rightSide; } - + var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0); - + // Walk the parent chain until we reach an unattached LI. for (var parent; // Check nodeType since IE invents document fragments. @@ -1015,19 +1015,19 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& // Put it on the list of lines for later processing. listItems.push(copiedListItem); } - + // Split lines while there are lines left to split. for (var i = 0; // Number of lines that have been split so far. i < listItems.length; // length updated by breakAfter calls. ++i) { walk(listItems[i]); } - + // Make sure numeric indices show correctly. if (opt_startLineNum === (opt_startLineNum|0)) { listItems[0].setAttribute('value', opt_startLineNum); } - + var ol = document.createElement('OL'); ol.className = 'linenums'; var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0; @@ -1042,7 +1042,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& } ol.appendChild(li); } - + node.appendChild(ol); } @@ -1062,23 +1062,23 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& function recombineTagsAndDecorations(job) { var isIE = /\bMSIE\b/.test(navigator.userAgent); var newlineRe = /\n/g; - + var source = job.sourceCode; var sourceLength = source.length; // Index into source after the last code-unit recombined. var sourceIndex = 0; - + var spans = job.spans; var nSpans = spans.length; // Index into spans after the last span which ends at or before sourceIndex. var spanIndex = 0; - + var decorations = job.decorations; var nDecorations = decorations.length; // Index into decorations after the last decoration which ends at or before // sourceIndex. var decorationIndex = 0; - + // Remove all zero-length decorations. decorations[nDecorations] = sourceLength; var decPos, i; @@ -1091,7 +1091,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& } } nDecorations = decPos; - + // Simplify decorations. for (i = decPos = 0; i < nDecorations;) { var startPos = decorations[i]; @@ -1105,19 +1105,19 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& decorations[decPos++] = startDec; i = end; } - + nDecorations = decorations.length = decPos; - + var decoration = null; while (spanIndex < nSpans) { var spanStart = spans[spanIndex]; var spanEnd = spans[spanIndex + 2] || sourceLength; - + var decStart = decorations[decorationIndex]; var decEnd = decorations[decorationIndex + 2] || sourceLength; - + end = Math.min(spanEnd, decEnd); - + var textNode = spans[spanIndex + 1]; var styledText; if (textNode.nodeType !== 1 // Don't muck with
    s or
  • s @@ -1143,9 +1143,9 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|& parentNode.insertBefore(textNode, span.nextSibling); } } - + sourceIndex = end; - + if (sourceIndex >= spanEnd) { spanIndex += 2; } diff --git a/toolkit/components/microformats/test/static/javascript/testrunner.js b/toolkit/components/microformats/test/static/javascript/testrunner.js index b60428dce2..5cdd99f2b7 100644 --- a/toolkit/components/microformats/test/static/javascript/testrunner.js +++ b/toolkit/components/microformats/test/static/javascript/testrunner.js @@ -1,5 +1,5 @@ /*! - testrunner + testrunner Used by http://localhost:3000/testrunner.html Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved. MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt @@ -14,11 +14,11 @@ var options = { window.onload = function() { var test = testData.data[0], versionElt = document.querySelector('#version'); - + versionElt.innerHTML = 'v' + testData.version; - + buildTest( test ); - buildList( testData ); + buildList( testData ); } @@ -41,26 +41,26 @@ function buildTest( test ){ jsonElt = document.querySelector('#test-json pre code'), parserElt = document.querySelector('#parser-json pre code'), diffElt = document.querySelector('#test-diff pre code'); - - nameElt.innerHTML = test.name; - htmlElt.innerHTML = htmlEscape( test.html ); - jsonElt.innerHTML = htmlEscape( test.json ); - + + nameElt.innerHTML = test.name; + htmlElt.innerHTML = htmlEscape( test.html ); + jsonElt.innerHTML = htmlEscape( test.json ); + var dom = new DOMParser(); - doc = dom.parseFromString( test.html, 'text/html' ); - + doc = dom.parseFromString( test.html, 'text/html' ); + options.node = doc; var mfJSON = Microformats.get( options ); parserElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(mfJSON) ) ); - + // diff json var diff = DeepDiff(JSON.parse(test.json), mfJSON); if(diff !== undefined){ - diffElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(diff) ) ); + diffElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(diff) ) ); }else{ - diffElt.innerHTML = ''; + diffElt.innerHTML = ''; } - + console.log(diff) if(diff !== undefined){ addClass(nameElt, 'failed'); @@ -71,9 +71,9 @@ function buildTest( test ){ removeClass(testDetailElt, 'test-failed'); addClass(testDetailElt, 'test-passed'); } - + testDetailElt.style.display = 'block'; - + //prettyPrint(); } @@ -82,13 +82,13 @@ function buildTest( test ){ function passTest( test ){ var dom = new DOMParser(), doc = dom.parseFromString( test.html, 'text/html' ); - + options.node = doc; var mfJSON = Microformats.get( options ); - + // diff json var diff = DeepDiff(JSON.parse(test.json), mfJSON); - return (diff === undefined); + return (diff === undefined); } @@ -98,24 +98,24 @@ function buildList( tests ){ var total = tests.data.length, passed = 0, testResultListElt = document.querySelector('.test-result-list'); - + tests.data.forEach(function(item){ var li = document.createElement('li'); li.innerHTML = item.name; testResultListElt.appendChild(li); - + if( passTest( item ) === false ){ //li.classList.add('failed') addClass(li, 'failed'); }else{ passed ++; } - + li.addEventListener('click', function(e){ e.preventDefault(); displayTest(e); }); - + }); updateCounts( { 'total': total, diff --git a/toolkit/components/microformats/tests/test_Microformats_geo.html b/toolkit/components/microformats/tests/test_Microformats_geo.html index 0fffaf31bb..7ec9a0fb5f 100644 --- a/toolkit/components/microformats/tests/test_Microformats_geo.html +++ b/toolkit/components/microformats/tests/test_Microformats_geo.html @@ -107,7 +107,7 @@ function test_geo() { is(Geo.latitude, 30.267991, "01-geo-abbr - latitude"); is(Geo.longitude, -97.739568, "01-geo-abbr - longitude"); - + Geo = new geo(document.getElementById("02-geo-vcard-01")); is(Geo.toString(), "John Doe", "02-geo-vcard-01"); diff --git a/toolkit/components/microformats/tests/test_Microformats_getters.html b/toolkit/components/microformats/tests/test_Microformats_getters.html index b12995ad11..bae0228e2b 100644 --- a/toolkit/components/microformats/tests/test_Microformats_getters.html +++ b/toolkit/components/microformats/tests/test_Microformats_getters.html @@ -45,7 +45,7 @@ mfs = Microformats.get("hCalendar", document.getElementById("secondnode")); - is(mfs[0].summary, "Pseudo Conference", + is(mfs[0].summary, "Pseudo Conference", "Make sure we get the proper hCalendar from the second level node"); is(mfs.length, 1, "And we should only get one hCalendar not two from this node."); } diff --git a/toolkit/components/microformats/tests/test_Microformats_hCard.html b/toolkit/components/microformats/tests/test_Microformats_hCard.html index 8b4ae9cacf..99d9c8558c 100644 --- a/toolkit/components/microformats/tests/test_Microformats_hCard.html +++ b/toolkit/components/microformats/tests/test_Microformats_hCard.html @@ -806,7 +806,7 @@ function test_hCard() { is(hcard.tel[0].type[0], "home", "21-tel.2 - type"); is(hcard.tel[0].value, "+1.415.555.1212", "21-tel.2 - tel"); - + hcard = new hCard(document.getElementById("21-tel.3")); is(hcard.tel[0].type[0], "home", "21-tel.3 - type (home)"); @@ -884,7 +884,7 @@ function test_hCard() { is(hcard.fn, "Paradise", "25-geo-abbr - fn"); is(hcard.geo.latitude, 30.267991, "25-geo-abbr - geo.latitude"); is(hcard.geo.longitude, -97.739568, "25-geo-abbr - geo.longitude"); - + hcard = new hCard(document.getElementById("26-ancestors")); is(hcard.fn, "John Doe", "26-ancestors - fn"); @@ -945,7 +945,7 @@ function test_hCard() { hcard = new hCard(document.getElementById("30-fn-org.2")); - + is(hcard.fn, "Dan Connolly", "30-fn-org.2 - fn"); is(hcard.n["given-name"][0], "Dan", "30-fn-org.2 - given-name"); is(hcard.n["family-name"][0], "Connolly", "30-fn-org.2 - family-name"); @@ -1030,21 +1030,21 @@ function test_hCard() { is(String(hcard.url), "http://example.com/", "33-area.2 - url"); is(hcard.email[0].value, "joe@example.com", "33-area.2 - email"); is(hcard.org[0]["organization-name"], "Joe Public", "33-area.2 - organization-name"); - + hcard = new hCard(document.getElementById("33-area.3")); is(hcard.fn, "Joe Public", "33-area.3 - fn"); is(String(hcard.url), "http://example.com/", "33-area.3 - url"); is(hcard.email[0].value, "joe@example.com", "33-area.3 - email"); is(hcard.org[0]["organization-name"], "Joe Public", "33-area.3 - organization-name"); - + hcard = new hCard(document.getElementById("33-area.4")); is(hcard.fn, "Joe Public", "33-area.4 - fn"); is(String(hcard.url), "http://example.com/", "33-area.4 - url"); is(hcard.email[0].value, "joe@example.com", "33-area.4 - email"); is(hcard.org[0]["organization-name"], "Joe Public", "33-area.4 - organization-name"); - + hcard = new hCard(document.getElementById("33-area.5")); is(hcard.fn, "Joe Public", "33-area.5 - fn"); diff --git a/toolkit/components/nsDefaultCLH.js b/toolkit/components/nsDefaultCLH.js index 56dd0962dc..fec3652f5c 100644 --- a/toolkit/components/nsDefaultCLH.js +++ b/toolkit/components/nsDefaultCLH.js @@ -74,7 +74,7 @@ nsDefaultCLH.prototype = { dump(out + "\n"); Components.utils.reportError(out); } - + if (cmdLine.handleFlag("silent", false)) { cmdLine.preventDefault = true; } @@ -101,7 +101,7 @@ nsDefaultCLH.prototype = { } catch (e) { } - // if the pref is missing, ignore the exception + // if the pref is missing, ignore the exception try { var chromeURI = prefs.getCharPref("toolkit.defaultChromeURI"); diff --git a/toolkit/components/osfile/NativeOSFileInternals.cpp b/toolkit/components/osfile/NativeOSFileInternals.cpp index 4738f68fe8..d2452619b3 100644 --- a/toolkit/components/osfile/NativeOSFileInternals.cpp +++ b/toolkit/components/osfile/NativeOSFileInternals.cpp @@ -228,7 +228,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AbstractResult) NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(AbstractResult) - NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mCachedResult) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mCachedResult) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AbstractResult) diff --git a/toolkit/components/perfmonitoring/PerformanceStats-content.js b/toolkit/components/perfmonitoring/PerformanceStats-content.js index 7683f63876..9a6a2d81dd 100644 --- a/toolkit/components/perfmonitoring/PerformanceStats-content.js +++ b/toolkit/components/perfmonitoring/PerformanceStats-content.js @@ -79,8 +79,9 @@ Services.cpmm.addMessageListener("performance-stats-service-release", function(m if (!isContent) { return; } + // Keep only the probes that do not appear in the payload - let probes = gMonitor.getProbeNames + let probes = gMonitor.probeNames .filter(x => msg.data.payload.indexOf(x) == -1); gMonitor = PerformanceStats.getMonitor(probes); }); diff --git a/toolkit/components/perfmonitoring/nsIPerformanceStats.idl b/toolkit/components/perfmonitoring/nsIPerformanceStats.idl index bb80552fec..2effd5403b 100644 --- a/toolkit/components/perfmonitoring/nsIPerformanceStats.idl +++ b/toolkit/components/perfmonitoring/nsIPerformanceStats.idl @@ -126,25 +126,69 @@ interface nsIPerformanceSnapshot: nsISupports { /** * A performance alert. */ -[scriptable, function, uuid(463c92d9-2e55-4f57-9b22-7badbbdfb2b7)] +[scriptable, builtinclass, uuid(a85706ab-d703-4687-8865-78cd771eab93)] interface nsIPerformanceAlert: nsISupports { - // Alert was caused by jank exceeding the threshold. - const unsigned long REASON_JANK = 0; + /** + * A slowdown was detected. + * + * See REASON_JANK_* for details on whether this slowdown was user-noticeable. + */ + const unsigned long REASON_SLOWDOWN = 1; /** - * The reason for the alert. + * This alert was triggered during a jank in animation. + * + * In the current implementation, we consider that there is a jank + * in animation if delivery of the vsync message to the main thread + * has been delayed too much (see + * nsIPerformanceStatsService.animationJankLevelThreshold). + * + * Note that this is a heuristic which may provide false positives, + * so clients of this API are expected to perform post-processing to + * filter out such false positives. + */ + const unsigned long REASON_JANK_IN_ANIMATION = 2; + + /** + * This alert was triggered during a jank in user input. + * + * In the current implementation, we consider that there is a jank + * in animation if a user input was received either immediately + * before executing the offending code (see + * nsIPerformanceStatsService.userInputDelayThreshold) or while + * executing the offending code. + * + * Note that this is a heuristic which may provide false positives, + * so clients of this API are expected to perform post-processing to + * filter out such false positives. + */ + const unsigned long REASON_JANK_IN_INPUT = 4; + + /** + * The reason for the alert, as a bitwise or of the various REASON_* + * constants. */ readonly attribute unsigned long reason; /** * Longest interval spent executing code in this group * since the latest alert, in microseconds. + * + * Note that the underlying algorithm is probabilistic and may + * provide false positives, so clients of this API are expected to + * perform post-processing to filter out such false positives. In + * particular, a high system load will increase the noise level on + * this measure. */ readonly attribute unsigned long long highestJank; /** * Longest interval spent executing CPOW in this group * since the latest alert, in microseconds. + * + * This measure is reliable and involves no heuristics. However, + * note that the duration of CPOWs is increased by high system + * loads. */ readonly attribute unsigned long long highestCPOW; }; @@ -193,7 +237,7 @@ interface nsIPerformanceObservable: nsISupports { }; -[scriptable, uuid(5675d1d9-638e-4af0-9392-b04aacfad79a)] +[scriptable, uuid(505bc42e-be38-4a53-baba-92cb33690cde)] interface nsIPerformanceStatsService : nsISupports { /** * `true` if we should monitor CPOW, `false` otherwise. @@ -223,6 +267,26 @@ interface nsIPerformanceStatsService : nsISupports { */ attribute unsigned long long jankAlertThreshold; + /** + * If a user is seeing an animation and we spend too long executing + * JS code while blocking refresh, this will be visible to the user. + * + * We assume that any jank during an animation and lasting more than + * 2^animationJankLevelThreshold ms will be visible. + */ + attribute short animationJankLevelThreshold; + + /** + * If a user performs an input (e.g. clicking, pressing a key, but + * *NOT* moving the mouse), and we spend too long executing JS code + * before displaying feedback, this will be visible to the user even + * if there is no ongoing animation. + * + * We assume that any jank during `userInputDelayThreshold` us after + * the user input will be visible. + */ + attribute unsigned long long userInputDelayThreshold; + /** * A buffering delay, in milliseconds, used by the service to * regroup performance alerts, before observers are actually diff --git a/toolkit/components/perfmonitoring/nsPerformanceStats.cpp b/toolkit/components/perfmonitoring/nsPerformanceStats.cpp index 187164e8a0..94c43e5c06 100644 --- a/toolkit/components/perfmonitoring/nsPerformanceStats.cpp +++ b/toolkit/components/perfmonitoring/nsPerformanceStats.cpp @@ -22,9 +22,11 @@ #include "nsIDOMWindow.h" #include "nsGlobalWindow.h" +#include "nsRefreshDriver.h" #include "mozilla/unused.h" #include "mozilla/ArrayUtils.h" +#include "mozilla/EventStateManager.h" #include "mozilla/Services.h" #include "mozilla/Telemetry.h" @@ -547,7 +549,6 @@ PerformanceAlert::GetReason(uint32_t* result) { *result = mReason; return NS_OK; } - /* ------------------------------------------------------ * * class PendingAlertsCollector @@ -570,6 +571,7 @@ public: nsresult Start(uint32_t timerDelayMS); nsresult Dispose(); + private: ~PendingAlertsCollector() {} @@ -577,6 +579,8 @@ private: bool mPending; nsCOMPtr mTimer; + + mozilla::Vector mJankLevels; }; NS_IMPL_ISUPPORTS(PendingAlertsCollector, nsITimerCallback); @@ -584,7 +588,7 @@ NS_IMPL_ISUPPORTS(PendingAlertsCollector, nsITimerCallback); NS_IMETHODIMP PendingAlertsCollector::Notify(nsITimer*) { mPending = false; - mService->NotifyJankObservers(); + mService->NotifyJankObservers(mJankLevels); return NS_OK; } @@ -605,6 +609,11 @@ PendingAlertsCollector::Start(uint32_t timerDelayMS) { } mPending = true; + { + mozilla::DebugOnly result = nsRefreshDriver::GetJankLevels(mJankLevels); + MOZ_ASSERT(result); + } + return NS_OK; } @@ -646,12 +655,15 @@ nsPerformanceStatsService::nsPerformanceStatsService() true, // isSystem nsPerformanceGroup::GroupScope::RUNTIME // scope )) + , mIsHandlingUserInput(false) , mProcessStayed(0) , mProcessMoved(0) , mProcessUpdateCounter(0) , mIsMonitoringPerCompartment(false) , mJankAlertThreshold(mozilla::MaxValue::value) // By default, no alerts , mJankAlertBufferingDelay(1000 /* ms */) + , mJankLevelVisibilityThreshold(/* 2 ^ */ 8 /* ms */) + , mMaxExpectedDurationOfInteractionUS(150 * 1000) { mPendingAlertsCollector = new PendingAlertsCollector(mRuntime, this); @@ -809,6 +821,15 @@ nsPerformanceStatsService::Observe(nsISupports *aSubject, const char *aTopic, return NS_OK; } +/*static*/ bool +nsPerformanceStatsService::IsHandlingUserInput() { + if (mozilla::EventStateManager::LatestUserInputStart().IsNull()) { + return false; + } + bool result = mozilla::TimeStamp::Now() - mozilla::EventStateManager::LatestUserInputStart() <= mozilla::TimeDuration::FromMicroseconds(mMaxExpectedDurationOfInteractionUS); + return result; +} + /* [implicit_jscontext] attribute bool isMonitoringCPOW; */ NS_IMETHODIMP nsPerformanceStatsService::GetIsMonitoringCPOW(JSContext* cx, bool *aIsStopwatchActive) @@ -1096,6 +1117,9 @@ bool nsPerformanceStatsService::StopwatchStart(uint64_t iteration) { mIteration = iteration; + mIsHandlingUserInput = IsHandlingUserInput(); + mUserInputCount = mozilla::EventStateManager::UserInputCount(); + nsresult rv = GetResources(&mUserTimeStart, &mSystemTimeStart); if (NS_FAILED(rv)) { return false; @@ -1135,12 +1159,13 @@ nsPerformanceStatsService::StopwatchCommit(uint64_t iteration, JSGroupVector& re MOZ_ASSERT(mTopGroup->isUsedInThisIteration()); const uint64_t totalRecentCycles = mTopGroup->recentCycles(iteration); + const bool isHandlingUserInput = mIsHandlingUserInput || mozilla::EventStateManager::UserInputCount() > mUserInputCount; // We should only reach this stage if `group` has had some activity. MOZ_ASSERT(mTopGroup->recentTicks(iteration) > 0); for (auto iter = recentGroups.begin(), end = recentGroups.end(); iter != end; ++iter) { RefPtr group = nsPerformanceGroup::Get(*iter); - CommitGroup(iteration, userTimeDelta, systemTimeDelta, totalRecentCycles, group); + CommitGroup(iteration, userTimeDelta, systemTimeDelta, totalRecentCycles, isHandlingUserInput, group); } // Make sure that `group` was treated along with the other items of `recentGroups`. @@ -1157,7 +1182,9 @@ nsPerformanceStatsService::StopwatchCommit(uint64_t iteration, JSGroupVector& re void nsPerformanceStatsService::CommitGroup(uint64_t iteration, uint64_t totalUserTimeDelta, uint64_t totalSystemTimeDelta, - uint64_t totalCyclesDelta, nsPerformanceGroup* group) { + uint64_t totalCyclesDelta, + bool isHandlingUserInput, + nsPerformanceGroup* group) { MOZ_ASSERT(group->isUsedInThisIteration()); @@ -1205,6 +1232,9 @@ nsPerformanceStatsService::CommitGroup(uint64_t iteration, group->RecordJank(totalTimeDelta); group->RecordCPOW(cpowTimeDelta); + if (isHandlingUserInput) { + group->RecordUserInput(); + } if (totalTimeDelta >= mJankAlertThreshold) { if (!group->HasPendingAlert()) { @@ -1297,7 +1327,7 @@ nsPerformanceStatsService::GetResources(uint64_t* userTime, } void -nsPerformanceStatsService::NotifyJankObservers() { +nsPerformanceStatsService::NotifyJankObservers(const mozilla::Vector& aPreviousJankLevels) { GroupVector alerts; mPendingAlerts.swap(alerts); if (!mPendingAlertsCollector) { @@ -1305,10 +1335,32 @@ nsPerformanceStatsService::NotifyJankObservers() { return; } + // Find out if we have noticed any user-noticeable delay in an + // animation recently (i.e. since the start of the execution of JS + // code that caused this collector to start). If so, we'll mark any + // alert as part of a user-noticeable jank. Note that this doesn't + // mean with any certainty that the alert is the only cause of jank, + // or even the main cause of jank. + mozilla::Vector latestJankLevels; + { + mozilla::DebugOnly result = nsRefreshDriver::GetJankLevels(latestJankLevels); + MOZ_ASSERT(result); + } + MOZ_ASSERT(latestJankLevels.length() == aPreviousJankLevels.length()); + + bool isJankInAnimation = false; + for (size_t i = mJankLevelVisibilityThreshold; i < latestJankLevels.length(); ++i) { + if (latestJankLevels[i] > aPreviousJankLevels[i]) { + isJankInAnimation = true; + break; + } + } + MOZ_ASSERT(!alerts.empty()); const bool hasUniversalAddonObservers = mUniversalTargets.mAddons->HasObservers(); const bool hasUniversalWindowObservers = mUniversalTargets.mWindows->HasObservers(); for (auto iter = alerts.begin(); iter < alerts.end(); ++iter) { + MOZ_ASSERT(iter); RefPtr group = *iter; group->SetHasPendingAlert(false); @@ -1319,19 +1371,24 @@ nsPerformanceStatsService::NotifyJankObservers() { group->ObservationTarget() }; + bool isJankInInput = group->HasRecentUserInput(); + RefPtr alert; for (nsPerformanceObservationTarget* target : targets) { if (!target) { continue; } if (!alert) { + const uint32_t reason = nsIPerformanceAlert::REASON_SLOWDOWN + | (isJankInAnimation ? nsIPerformanceAlert::REASON_JANK_IN_ANIMATION : 0) + | (isJankInInput ? nsIPerformanceAlert::REASON_JANK_IN_INPUT : 0); // Wait until we are sure we need to allocate before we allocate. - alert = new PerformanceAlert(nsIPerformanceAlert::REASON_JANK, group); + alert = new PerformanceAlert(reason, group); } target->NotifyJankObservers(details, alert); } - group->ResetHighest(); + group->ResetRecent(); } } @@ -1360,6 +1417,32 @@ nsPerformanceStatsService::GetObservableWindow(uint64_t windowId, return NS_OK; } +NS_IMETHODIMP +nsPerformanceStatsService::GetAnimationJankLevelThreshold(short* result) { + *result = mJankLevelVisibilityThreshold; + return NS_OK; +} + +NS_IMETHODIMP +nsPerformanceStatsService::SetAnimationJankLevelThreshold(short value) { + mJankLevelVisibilityThreshold = value; + return NS_OK; +} + +NS_IMETHODIMP +nsPerformanceStatsService::GetUserInputDelayThreshold(uint64_t* result) { + *result = mMaxExpectedDurationOfInteractionUS; + return NS_OK; +} + +NS_IMETHODIMP +nsPerformanceStatsService::SetUserInputDelayThreshold(uint64_t value) { + mMaxExpectedDurationOfInteractionUS = value; + return NS_OK; +} + + + nsPerformanceStatsService::UniversalTargets::UniversalTargets() : mAddons(new nsPerformanceObservationTarget()) , mWindows(new nsPerformanceObservationTarget()) @@ -1399,6 +1482,7 @@ nsPerformanceGroup::nsPerformanceGroup(nsPerformanceStatsService* service, , mScope(scope) , mHighestJank(0) , mHighestCPOW(0) + , mHasRecentUserInput(false) , mHasPendingAlert(false) { mozilla::Unused << mService->mGroups.PutEntry(this); @@ -1504,9 +1588,19 @@ nsPerformanceGroup::HighestRecentCPOW() { return mHighestCPOW; } -void -nsPerformanceGroup::ResetHighest() { - mHighestJank = 0; - mHighestCPOW = 0; +bool +nsPerformanceGroup::HasRecentUserInput() { + return mHasRecentUserInput; } +void +nsPerformanceGroup::RecordUserInput() { + mHasRecentUserInput = true; +} + +void +nsPerformanceGroup::ResetRecent() { + mHighestJank = 0; + mHighestCPOW = 0; + mHasRecentUserInput = false; +} diff --git a/toolkit/components/perfmonitoring/nsPerformanceStats.h b/toolkit/components/perfmonitoring/nsPerformanceStats.h index 52688b9c48..6584ec2fd6 100644 --- a/toolkit/components/perfmonitoring/nsPerformanceStats.h +++ b/toolkit/components/perfmonitoring/nsPerformanceStats.h @@ -274,6 +274,14 @@ protected: uint64_t mUserTimeStart; uint64_t mSystemTimeStart; + bool mIsHandlingUserInput; + + /** + * The number of user inputs since the start of the process. Used to + * determine whether the current iteration has triggered a + * (JS-implemented) user input. + */ + uint64_t mUserInputCount; /********************************************************** * @@ -339,10 +347,13 @@ protected: * calls to `StopwatchStart` and `StopwatchCommit`. * @param cycles The total number of cycles for this thread * between the calls to `StopwatchStart` and `StopwatchCommit`. + * @param isJankVisible If `true`, expect that the user will notice + * any slowdown. * @param group The group containing the data to commit. */ void CommitGroup(uint64_t iteration, uint64_t userTime, uint64_t systemTime, uint64_t cycles, + bool isJankVisible, nsPerformanceGroup* group); @@ -374,6 +385,23 @@ protected: bool mIsMonitoringPerCompartment; + /********************************************************** + * + * Determining whether jank is user-visible. + */ + + /** + * `true` if we believe that any slowdown can cause a noticeable + * delay in handling user-input. + * + * In the current implementation, we return `true` if the latest + * user input was less than MAX_DURATION_OF_INTERACTION_MS ago. This + * includes all inputs (mouse, keyboard, other devices), with the + * exception of mousemove. + */ + bool IsHandlingUserInput(); + + public: /********************************************************** * @@ -393,7 +421,7 @@ public: * Clear the set of pending alerts and dispatch the pending alerts * to observers. */ - void NotifyJankObservers(); + void NotifyJankObservers(const mozilla::Vector& previousJankLevels); private: /** @@ -444,6 +472,27 @@ private: * performance. */ uint32_t mJankAlertBufferingDelay; + + /** + * The threshold above which jank, as reported by the refresh drivers, + * is considered user-visible. + * + * A value of n means that any jank above 2^n ms will be considered + * user visible. + */ + short mJankLevelVisibilityThreshold; + + /** + * The number of microseconds during which we assume that a + * user-interaction can keep the code jank-critical. Any user + * interaction that lasts longer than this duration is expected to + * either have already caused jank or have caused a nested event + * loop. + * + * In either case, we consider that monitoring + * jank-during-interaction after this duration is useless. + */ + uint64_t mMaxExpectedDurationOfInteractionUS; }; @@ -712,9 +761,18 @@ public: uint64_t HighestRecentCPOW(); /** - * Reset highest recent CPOW/jank to 0. + * Record that this group has recently been involved in handling + * user input. Note that heuristics are involved here, so the + * result is not 100% accurate. */ - void ResetHighest(); + void RecordUserInput(); + bool HasRecentUserInput(); + + /** + * Reset recent values (recent highest CPOW and jank, involvement in + * user input). + */ + void ResetRecent(); private: /** * The target used by observers to register for watching slow @@ -736,6 +794,16 @@ private: */ uint64_t mHighestCPOW; + /** + * `true` if this group has been involved in handling user input, + * `false` otherwise. + * + * Note that we use heuristics to determine whether a group is + * involved in handling user input, so this value is not 100% + * accurate. + */ + bool mHasRecentUserInput; + /** * `true` if this group has caused a performance alert and this alert * hasn't been dispatched yet. diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_webpagePerformanceAlerts.js b/toolkit/components/perfmonitoring/tests/browser/browser_webpagePerformanceAlerts.js index 3780ca78be..aed730c579 100644 --- a/toolkit/components/perfmonitoring/tests/browser/browser_webpagePerformanceAlerts.js +++ b/toolkit/components/perfmonitoring/tests/browser/browser_webpagePerformanceAlerts.js @@ -54,7 +54,7 @@ add_task(function* test_open_window_then_watch_it() { yield BrowserTestUtils.browserLoaded(otherTab.linkedBrowser); info(`Check that burning CPU triggers the real listener, but not the fake listener`); let fakeListener = new WebpageListener(otherTab.linkedBrowser.outerWindowID, group => group.windowId == burner.windowId); // This listener should never be triggered. - let universalListener = new WebpageListener(0, alerts => + let universalListener = new WebpageListener(0, alerts => alerts.find(alert => alert.source.windowId == burner.windowId) ); diff --git a/toolkit/components/places/BookmarkHTMLUtils.jsm b/toolkit/components/places/BookmarkHTMLUtils.jsm index 889d20eb3e..4b63ac487c 100644 --- a/toolkit/components/places/BookmarkHTMLUtils.jsm +++ b/toolkit/components/places/BookmarkHTMLUtils.jsm @@ -297,7 +297,7 @@ function Frame(aFrameId) { * contains the URL of the previous bookmark created. This is used so that * when we encounter a
    , we know what bookmark to associate the text with. * This is cleared whenever we hit a

    , so that we know NOT to save this - * with a bookmark, but to keep it until + * with a bookmark, but to keep it until */ this.previousLink = null; // nsIURI @@ -354,7 +354,7 @@ BookmarkImporter.prototype = { switch (containerType) { case Container_Normal: // append a new folder - containerId = + containerId = PlacesUtils.bookmarks.createFolder(frame.containerId, containerTitle, PlacesUtils.bookmarks.DEFAULT_INDEX); @@ -780,14 +780,14 @@ BookmarkImporter.prototype = { frame.previousText = ""; // Set last-modified a 2nd time for all items with descriptions - // we need to set last-modified as the *last* step in processing + // we need to set last-modified as the *last* step in processing // any item type in the bookmarks.html file, so that we do - // not overwrite the imported value. for items without descriptions, - // setting this value after setting the item title is that + // not overwrite the imported value. for items without descriptions, + // setting this value after setting the item title is that // last point at which we can save this value before it gets reset. // for items with descriptions, it must set after that point. - // however, at the point at which we set the title, there's no way - // to determine if there will be a description following, + // however, at the point at which we set the title, there's no way + // to determine if there will be a description following, // so we need to set the last-modified-date at both places. let lastModified; diff --git a/toolkit/components/places/Bookmarks.jsm b/toolkit/components/places/Bookmarks.jsm index 96cefeddca..32c466501d 100644 --- a/toolkit/components/places/Bookmarks.jsm +++ b/toolkit/components/places/Bookmarks.jsm @@ -704,7 +704,7 @@ function* updateBookmark(info, item, newParent) { if (info.hasOwnProperty("url")) { // Ensure a page exists in moz_places for this URL. yield db.executeCached( - `INSERT OR IGNORE INTO moz_places (url, rev_host, hidden, frecency, guid) + `INSERT OR IGNORE INTO moz_places (url, rev_host, hidden, frecency, guid) VALUES (:url, :rev_host, 0, :frecency, GENERATE_GUID()) `, { url: info.url ? info.url.href : null, rev_host: PlacesUtils.getReversedHost(info.url), @@ -790,7 +790,7 @@ function* insertBookmark(item, parent) { if (item.type == Bookmarks.TYPE_BOOKMARK) { // Ensure a page exists in moz_places for this URL. yield db.executeCached( - `INSERT OR IGNORE INTO moz_places (url, rev_host, hidden, frecency, guid) + `INSERT OR IGNORE INTO moz_places (url, rev_host, hidden, frecency, guid) VALUES (:url, :rev_host, 0, :frecency, GENERATE_GUID()) `, { url: item.url.href, rev_host: PlacesUtils.getReversedHost(item.url), frecency: item.url.protocol == "place:" ? 0 : -1 }); diff --git a/toolkit/components/places/PlacesBackups.jsm b/toolkit/components/places/PlacesBackups.jsm index fcc1aa7467..a3aae68066 100644 --- a/toolkit/components/places/PlacesBackups.jsm +++ b/toolkit/components/places/PlacesBackups.jsm @@ -511,7 +511,7 @@ this.PlacesBackups = { * * index: the position in the parent * * dateAdded: microseconds from the epoch * * lastModified: microseconds from the epoch - * * type: type of the originating node as defined in PlacesUtils + * * type: type of the originating node as defined in PlacesUtils * The following properties exist only for a subset of bookmarks: * * annos: array of annotations * * uri: url diff --git a/toolkit/components/places/PlacesUtils.jsm b/toolkit/components/places/PlacesUtils.jsm index f7d50725f7..f3cabfcff6 100644 --- a/toolkit/components/places/PlacesUtils.jsm +++ b/toolkit/components/places/PlacesUtils.jsm @@ -1269,7 +1269,7 @@ this.PlacesUtils = { yield conn.executeCached(QUERY_STR, { url: spec }, aRow => { if (abort) throw StopIteration; - itemIds.push(aRow.getResultByIndex(0)); + itemIds.push(aRow.getResultByIndex(0)); }); if (!abort) aCallback(itemIds, aURI); @@ -2105,8 +2105,8 @@ BaseTransaction.prototype = { /** - * Transaction for performing several Places Transactions in a single batch. - * + * Transaction for performing several Places Transactions in a single batch. + * * @param aName * title of the aggregate transactions * @param aTransactions @@ -2214,7 +2214,7 @@ PlacesCreateFolderTransaction.prototype = { __proto__: BaseTransaction.prototype, doTransaction: function CFTXN_doTransaction() - { + { this.item.id = PlacesUtils.bookmarks.createFolder(this.item.parentId, this.item.title, this.item.index); @@ -2302,7 +2302,7 @@ PlacesCreateBookmarkTransaction.prototype = { } if (this.item.annotations && this.item.annotations.length > 0) PlacesUtils.setAnnotationsForItem(this.item.id, this.item.annotations); - + if (this.childTransactions && this.childTransactions.length > 0) { // Set the new item id into child transactions. for (let i = 0; i < this.childTransactions.length; ++i) { @@ -2753,7 +2753,7 @@ PlacesEditBookmarkURITransaction.prototype = { undoTransaction: function EBUTXN_undoTransaction() { PlacesUtils.bookmarks.changeBookmarkURI(this.item.id, this.item.uri); - // move tags from new URI to old URI + // move tags from new URI to old URI if (this.item.tags.length != 0) { // only untag the new URI if this is the only bookmark if (PlacesUtils.getBookmarksForURI(this.new.uri, {}).length == 0) @@ -2956,7 +2956,7 @@ PlacesEditBookmarkPostDataTransaction.prototype = { * @param aItemId * id of the item to edit * @param aNewDateAdded - * new date added for the item + * new date added for the item * * @return nsITransaction object */ @@ -2995,7 +2995,7 @@ PlacesEditItemDateAddedTransaction.prototype = { * @param aItemId * id of the item to edit * @param aNewLastModified - * new last modified date for the item + * new last modified date for the item * * @return nsITransaction object */ @@ -3043,7 +3043,7 @@ PlacesEditItemLastModifiedTransaction.prototype = { this.PlacesSortFolderByNameTransaction = function PlacesSortFolderByNameTransaction(aFolderId) { - this.item = new TransactionItemCache(); + this.item = new TransactionItemCache(); this.item.id = aFolderId; } @@ -3059,7 +3059,7 @@ PlacesSortFolderByNameTransaction.prototype = { let count = contents.childCount; // sort between separators - let newOrder = []; + let newOrder = []; let preSep = []; // temporary array for sorting each group of items let sortingMethod = function (a, b) { diff --git a/toolkit/components/places/nsTaggingService.js b/toolkit/components/places/nsTaggingService.js index b919b30e9b..4f650b3cfc 100644 --- a/toolkit/components/places/nsTaggingService.js +++ b/toolkit/components/places/nsTaggingService.js @@ -308,7 +308,7 @@ TaggingService.prototype = { return tags; }, - __tagFolders: null, + __tagFolders: null, get _tagFolders() { if (!this.__tagFolders) { this.__tagFolders = []; @@ -482,7 +482,7 @@ function TagAutoCompleteResult(searchString, searchResult, } TagAutoCompleteResult.prototype = { - + /** * The original search string */ @@ -593,7 +593,7 @@ function TagAutoCompleteSearch() { } TagAutoCompleteSearch.prototype = { - _stopped : false, + _stopped : false, /* * Search for a given string and notify a listener (either synchronously @@ -611,10 +611,10 @@ TagAutoCompleteSearch.prototype = { this._stopped = false; // only search on characters for the last tag - var index = Math.max(searchString.lastIndexOf(","), + var index = Math.max(searchString.lastIndexOf(","), searchString.lastIndexOf(";")); - var before = ''; - if (index != -1) { + var before = ''; + if (index != -1) { before = searchString.slice(0, index+1); searchString = searchString.slice(index+1); // skip past whitespace @@ -631,7 +631,7 @@ TagAutoCompleteSearch.prototype = { listener.onSearchResult(self, newResult); return; } - + var self = this; // generator: if yields true, not done function* doSearch() { @@ -646,7 +646,7 @@ TagAutoCompleteSearch.prototype = { results.push(before + searchResults[i]); comments.push(searchResults[i]); } - + ++i; /* TODO: bug 481451 @@ -677,7 +677,7 @@ TagAutoCompleteSearch.prototype = { listener.onSearchResult(self, newResult); yield false; } - + // chunk the search results via the generator var gen = doSearch(); while (gen.next().value); diff --git a/toolkit/components/places/tests/autocomplete/test_match_beginning.js b/toolkit/components/places/tests/autocomplete/test_match_beginning.js index 4e0ac0f71c..9bef80f237 100644 --- a/toolkit/components/places/tests/autocomplete/test_match_beginning.js +++ b/toolkit/components/places/tests/autocomplete/test_match_beginning.js @@ -33,7 +33,7 @@ let gTests = [ "x", [0]], ["3: Match at the beginning of urls", "y", [1]], - + // Tests after this one will match against word boundaries and anywhere ["4: Sanity check that matching anywhere finds more", "a", [0,1], diff --git a/toolkit/components/places/tests/bookmarks/test_384228.js b/toolkit/components/places/tests/bookmarks/test_384228.js index f4bcc63bc1..8b7c95a84c 100644 --- a/toolkit/components/places/tests/bookmarks/test_384228.js +++ b/toolkit/components/places/tests/bookmarks/test_384228.js @@ -16,7 +16,7 @@ try { var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService); } catch(ex) { do_throw("Could not get history service\n"); -} +} // get bookmarks root id var root = bmsvc.bookmarksMenuFolder; diff --git a/toolkit/components/places/tests/bookmarks/test_385829.js b/toolkit/components/places/tests/bookmarks/test_385829.js index 28b7be0546..383943285e 100644 --- a/toolkit/components/places/tests/bookmarks/test_385829.js +++ b/toolkit/components/places/tests/bookmarks/test_385829.js @@ -16,7 +16,7 @@ try { var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService); } catch(ex) { do_throw("Could not get history service\n"); -} +} // get bookmarks root id var root = bmsvc.bookmarksMenuFolder; diff --git a/toolkit/components/places/tests/bookmarks/test_388695.js b/toolkit/components/places/tests/bookmarks/test_388695.js index 323d6ea96a..d93ed5a1e6 100644 --- a/toolkit/components/places/tests/bookmarks/test_388695.js +++ b/toolkit/components/places/tests/bookmarks/test_388695.js @@ -35,7 +35,7 @@ function run_test() { } function phase2() { - gItemId2 = bmsvc.insertBookmark(gTestRoot, gURI, bmsvc.DEFAULT_INDEX, ""); + gItemId2 = bmsvc.insertBookmark(gTestRoot, gURI, bmsvc.DEFAULT_INDEX, ""); var b = bmsvc.getBookmarkIdsForURI(gURI); do_check_eq(b[0], gItemId2); do_check_eq(b[1], gItemId1); diff --git a/toolkit/components/places/tests/bookmarks/test_395101.js b/toolkit/components/places/tests/bookmarks/test_395101.js index 955fabc3f8..290ebf8525 100644 --- a/toolkit/components/places/tests/bookmarks/test_395101.js +++ b/toolkit/components/places/tests/bookmarks/test_395101.js @@ -16,7 +16,7 @@ try { var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService); } catch(ex) { do_throw("Could not get history service\n"); -} +} // Get tagging service try { diff --git a/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js b/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js index f4472ee712..5a1381de17 100644 --- a/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js +++ b/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js @@ -53,10 +53,10 @@ var test = { // create test folders each with a bookmark for (var i = 0; i < this._count; i++) { - var folderId = + var folderId = PlacesUtils.bookmarks.createFolder(this._testRootId, "folder" + i, DEFAULT_INDEX); this._folderIds.push(folderId) - + var bookmarkURI = uri("http://" + i); PlacesUtils.bookmarks.insertBookmark(folderId, bookmarkURI, DEFAULT_INDEX, "bookmark" + i); diff --git a/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js b/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js index 2feeeb5d5b..a62052d18a 100644 --- a/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js +++ b/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js @@ -52,7 +52,7 @@ var test = { EXCLUDE_FROM_BACKUP_ANNO, 1, 0, PlacesUtils.annotations.EXPIRE_NEVER); - // create a root to be exclude + // create a root to be exclude this._excludeRootTitle = "exclude root"; this._excludeRootId = PlacesUtils.bookmarks .createFolder(PlacesUtils.placesRootId, diff --git a/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js b/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js index 4644ea134c..593e9605af 100644 --- a/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js +++ b/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js @@ -24,7 +24,7 @@ var quotesTest = { _folderId: null, populate: function () { - this._folderId = + this._folderId = PlacesUtils.bookmarks.createFolder(PlacesUtils.toolbarFolderId, this._folderTitle, PlacesUtils.bookmarks.DEFAULT_INDEX); diff --git a/toolkit/components/places/tests/bookmarks/test_448584.js b/toolkit/components/places/tests/bookmarks/test_448584.js index 397cb84fb5..fa1f936f3f 100644 --- a/toolkit/components/places/tests/bookmarks/test_448584.js +++ b/toolkit/components/places/tests/bookmarks/test_448584.js @@ -32,7 +32,7 @@ var invalidURITest = { PlacesUtils.bookmarks.DEFAULT_INDEX, this._itemTitle); // this bookmark will go corrupt - this._itemId = + this._itemId = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.toolbarFolderId, PlacesUtils._uri(this._itemUrl), PlacesUtils.bookmarks.DEFAULT_INDEX, diff --git a/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js b/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js index 016df748ce..7037bd6a78 100644 --- a/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js +++ b/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js @@ -31,7 +31,7 @@ add_task(function() { // Get the hash of the generated backup let backupFiles = yield PlacesBackups.getBackupFiles(); do_check_eq(backupFiles.length, 1); - + let matches = OS.Path.basename(backupFiles[0]).match(PlacesBackups.filenamesRegex); do_check_eq(matches[1], PlacesBackups.toISODateString(new Date())); do_check_eq(matches[2], count); diff --git a/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js b/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js index f149be4a12..027f9d2dfe 100644 --- a/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js +++ b/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js @@ -5,7 +5,7 @@ /** * Checks that we don't encodeURI twice when creating bookmarks.html. */ - + function run_test() { run_next_test(); } diff --git a/toolkit/components/places/tests/bookmarks/test_bmindex.js b/toolkit/components/places/tests/bookmarks/test_bmindex.js index cdc2550d19..c764e43100 100644 --- a/toolkit/components/places/tests/bookmarks/test_bmindex.js +++ b/toolkit/components/places/tests/bookmarks/test_bmindex.js @@ -107,7 +107,7 @@ function run_test() { if (newIndex >= -1) do_throw("Moving an item to a valid index should not throw\n"); } - + } check_contiguous_indexes(bookmarks); diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_fetch.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_fetch.js index 6adc402d38..bbfb255887 100644 --- a/toolkit/components/places/tests/bookmarks/test_bookmarks_fetch.js +++ b/toolkit/components/places/tests/bookmarks/test_bookmarks_fetch.js @@ -177,7 +177,7 @@ add_task(function* fetch_separator() { Assert.ok(!("url" in bm2)); Assert.ok(!("title" in bm2)); - yield PlacesUtils.bookmarks.remove(bm1.guid); + yield PlacesUtils.bookmarks.remove(bm1.guid); }); add_task(function* fetch_byposition_nonexisting_parentGuid() { diff --git a/toolkit/components/places/tests/browser/browser_bug680727.js b/toolkit/components/places/tests/browser/browser_bug680727.js index 886a684317..112b20a5af 100644 --- a/toolkit/components/places/tests/browser/browser_bug680727.js +++ b/toolkit/components/places/tests/browser/browser_bug680727.js @@ -8,10 +8,10 @@ const kUniqueURI = Services.io.newURI("http://mochi.test:8888/#bug_680727", null, null); -var gAsyncHistory = +var gAsyncHistory = Cc["@mozilla.org/browser/history;1"].getService(Ci.mozIAsyncHistory); -let proxyPrefValue; +var proxyPrefValue; function test() { waitForExplicitFinish(); @@ -87,7 +87,7 @@ function reloadListener() { ok(!Services.io.offline, "Services.io.offline is false."); // This is not an error page. - is(gBrowser.contentDocument.documentURI, kUniqueURI.spec, + is(gBrowser.contentDocument.documentURI, kUniqueURI.spec, "Document URI is not the offline-error page, but the original URI."); // Check if global history remembers the successfully-requested URI. diff --git a/toolkit/components/places/tests/queries/test_415716.js b/toolkit/components/places/tests/queries/test_415716.js index ea02b07f7f..a505412140 100644 --- a/toolkit/components/places/tests/queries/test_415716.js +++ b/toolkit/components/places/tests/queries/test_415716.js @@ -75,7 +75,7 @@ add_task(function test_buildTestDatabase() * Annotation == "moz-test-places/testing123" && * TimeRange == "now() - 2d" && * minVisits == 2 && - * maxVisits == 10 + * maxVisits == 10 */ add_task(function test_execute() { diff --git a/toolkit/components/places/tests/queries/test_onlyBookmarked.js b/toolkit/components/places/tests/queries/test_onlyBookmarked.js index b9612360c0..4369a61206 100644 --- a/toolkit/components/places/tests/queries/test_onlyBookmarked.js +++ b/toolkit/components/places/tests/queries/test_onlyBookmarked.js @@ -59,7 +59,7 @@ add_task(function test_onlyBookmarked() var query = PlacesUtils.history.getNewQuery(); query.setFolders([PlacesUtils.toolbarFolderId], 1); query.onlyBookmarked = true; - + // query options var options = PlacesUtils.history.getNewQueryOptions(); options.queryType = options.QUERY_TYPE_HISTORY; @@ -68,7 +68,7 @@ add_task(function test_onlyBookmarked() var result = PlacesUtils.history.executeQuery(query, options); var root = result.root; root.containerOpen = true; - + // You can use this to compare the data in the array with the result set, // if the array's isInQuery: true items are sorted the same way as the result // set. @@ -79,7 +79,7 @@ add_task(function test_onlyBookmarked() /* ****************** Test live-update ********************/ - + var liveUpdateTestData = [ //Add a bookmark that should show up { isBookmark: true, @@ -97,7 +97,7 @@ add_task(function test_onlyBookmarked() title: "", isInQuery: false } ]; - + yield task_populateDB(liveUpdateTestData); // add to the db // add to the test data diff --git a/toolkit/components/places/tests/queries/test_transitions.js b/toolkit/components/places/tests/queries/test_transitions.js index 3c4d72a1ed..54fd1c61b9 100644 --- a/toolkit/components/places/tests/queries/test_transitions.js +++ b/toolkit/components/places/tests/queries/test_transitions.js @@ -80,7 +80,7 @@ var testData = [ }]; // sets of indices of testData array by transition type var testDataTyped = [0, 5, 7, 9]; -var testDataDownload = [1, 2, 4, 6, 10]; +var testDataDownload = [1, 2, 4, 6, 10]; var testDataBookmark = [3, 8, 11]; /** diff --git a/toolkit/components/places/tests/unit/test_331487.js b/toolkit/components/places/tests/unit/test_331487.js index 22ccd7d140..cbf30521e0 100644 --- a/toolkit/components/places/tests/unit/test_331487.js +++ b/toolkit/components/places/tests/unit/test_331487.js @@ -9,7 +9,7 @@ try { var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService); } catch(ex) { do_throw("Could not get history service\n"); -} +} var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"]. getService(Ci.nsINavBookmarksService); @@ -88,7 +88,7 @@ function run_test() { root.containerOpen = false; // XXX TODO - // test that if we have: more than one query, + // test that if we have: more than one query, // multiple folders, a begin time, an end time, a domain, a uri // or a search term, that we get the (correct) flat list results // (like we do when specified maxResults) diff --git a/toolkit/components/places/tests/unit/test_384370.js b/toolkit/components/places/tests/unit/test_384370.js index e796adbd50..e0f8204d6d 100644 --- a/toolkit/components/places/tests/unit/test_384370.js +++ b/toolkit/components/places/tests/unit/test_384370.js @@ -211,7 +211,7 @@ function testToolbarFolder() { // child count (add 2 for pre-existing items) do_check_eq(toolbar.childCount, bookmarkData.length + 2); - + // livemark var livemark = toolbar.getChild(1); // title diff --git a/toolkit/components/places/tests/unit/test_385397.js b/toolkit/components/places/tests/unit/test_385397.js index cb25135af3..499b4e60bc 100644 --- a/toolkit/components/places/tests/unit/test_385397.js +++ b/toolkit/components/places/tests/unit/test_385397.js @@ -80,7 +80,7 @@ add_task(function test_execute() root.containerOpen = true; cc = root.childCount; // 2 * TOTAL_SITES because we count the TYPED and LINK, but not EMBED or FRAMED - do_check_eq(cc, 2 * TOTAL_SITES); + do_check_eq(cc, 2 * TOTAL_SITES); for (let i=0; i < TOTAL_SITES; i++) { let index = i * 2; let node = root.getChild(index); diff --git a/toolkit/components/places/tests/unit/test_408221.js b/toolkit/components/places/tests/unit/test_408221.js index 235268cc22..1c1b671bff 100644 --- a/toolkit/components/places/tests/unit/test_408221.js +++ b/toolkit/components/places/tests/unit/test_408221.js @@ -10,31 +10,31 @@ function AutoCompleteInput(aSearches) { this.searches = aSearches; } AutoCompleteInput.prototype = { - constructor: AutoCompleteInput, + constructor: AutoCompleteInput, searches: null, - + minResultsForPopup: 0, timeout: 10, searchParam: "", textValue: "", - disableAutoComplete: false, + disableAutoComplete: false, completeDefaultIndex: false, - + get searchCount() { return this.searches.length; }, - + getSearchAt: function(aIndex) { return this.searches[aIndex]; }, - + onSearchBegin: function() {}, onSearchComplete: function() {}, - - popupOpen: false, - - popup: { + + popupOpen: false, + + popup: { setSelectedIndex: function(aIndex) {}, invalidate: function() {}, @@ -45,9 +45,9 @@ AutoCompleteInput.prototype = { return this; throw Components.results.NS_ERROR_NO_INTERFACE; - } + } }, - + // nsISupports implementation QueryInterface: function(iid) { if (iid.equals(Ci.nsISupports) || @@ -69,8 +69,8 @@ try { function ensure_tag_results(uris, searchTerm) { var controller = Components.classes["@mozilla.org/autocomplete/controller;1"]. - getService(Components.interfaces.nsIAutoCompleteController); - + getService(Components.interfaces.nsIAutoCompleteController); + // Make an AutoCompleteInput that uses our searches // and confirms results on search complete var input = new AutoCompleteInput(["history"]); @@ -88,7 +88,7 @@ function ensure_tag_results(uris, searchTerm) input.onSearchComplete = function() { do_check_eq(numSearchesStarted, 1); - do_check_eq(controller.searchStatus, + do_check_eq(controller.searchStatus, Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH); do_check_eq(controller.matchCount, uris.length); let vals = []; @@ -99,7 +99,7 @@ function ensure_tag_results(uris, searchTerm) } // Sort the results then check if we have the right items vals.sort().forEach((val, i) => do_check_eq(val, uris[i].spec)) - + if (current_test < (tests.length - 1)) { current_test++; tests[current_test](); @@ -117,9 +117,9 @@ var uri3 = uri("http://site.tld/3"); var uri4 = uri("http://site.tld/4"); var uri5 = uri("http://site.tld/5"); var uri6 = uri("http://site.tld/6"); - -var tests = [function() { ensure_tag_results([uri1, uri2, uri3], "foo"); }, - function() { ensure_tag_results([uri1, uri2, uri3], "Foo"); }, + +var tests = [function() { ensure_tag_results([uri1, uri2, uri3], "foo"); }, + function() { ensure_tag_results([uri1, uri2, uri3], "Foo"); }, function() { ensure_tag_results([uri1, uri2, uri3], "foO"); }, function() { ensure_tag_results([uri4, uri5, uri6], "bar mud"); }, function() { ensure_tag_results([uri4, uri5, uri6], "BAR MUD"); }, @@ -141,7 +141,7 @@ function tagURI(aURI, aTags) { tagssvc.tagURI(aURI, aTags); } -/** +/** * Test bug #408221 */ function run_test() { diff --git a/toolkit/components/places/tests/unit/test_413784.js b/toolkit/components/places/tests/unit/test_413784.js index 9efb5bae00..c26afd016a 100644 --- a/toolkit/components/places/tests/unit/test_413784.js +++ b/toolkit/components/places/tests/unit/test_413784.js @@ -29,7 +29,7 @@ function AutoCompleteInput(aSearches) { } AutoCompleteInput.prototype = { - constructor: AutoCompleteInput, + constructor: AutoCompleteInput, searches: null, @@ -37,7 +37,7 @@ AutoCompleteInput.prototype = { timeout: 10, searchParam: "", textValue: "", - disableAutoComplete: false, + disableAutoComplete: false, completeDefaultIndex: false, get searchCount() { diff --git a/toolkit/components/places/tests/unit/test_419792_node_tags_property.js b/toolkit/components/places/tests/unit/test_419792_node_tags_property.js index 0603afa7c6..4c726d6672 100644 --- a/toolkit/components/places/tests/unit/test_419792_node_tags_property.js +++ b/toolkit/components/places/tests/unit/test_419792_node_tags_property.js @@ -31,7 +31,7 @@ function run_test() { do_check_eq(node.itemId, bookmarkId); // confirm there's no tags via the .tags property - do_check_eq(node.tags, null); + do_check_eq(node.tags, null); // add a tag tagssvc.tagURI(bookmarkURI, ["foo"]); @@ -43,7 +43,7 @@ function run_test() { // remove the tags, confirming the property is cleared tagssvc.untagURI(bookmarkURI, null); - do_check_eq(node.tags, null); + do_check_eq(node.tags, null); toolbarNode.containerOpen = false; } diff --git a/toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js b/toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js index c0567c3f73..e0b6be64cd 100644 --- a/toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js +++ b/toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js @@ -16,13 +16,13 @@ function run_test() { const IDX = PlacesUtils.bookmarks.DEFAULT_INDEX; - var folderId = + var folderId = PlacesUtils.bookmarks.createFolder(PlacesUtils.toolbarFolderId, "", IDX); var queryId = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.toolbarFolderId, uri("place:folder=" + folderId), IDX, ""); - + var root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId, false, true).root; var oldCount = root.childCount; diff --git a/toolkit/components/places/tests/unit/test_PlacesUtils_lazyobservers.js b/toolkit/components/places/tests/unit/test_PlacesUtils_lazyobservers.js index 5398db5855..f0e9c5517a 100644 --- a/toolkit/components/places/tests/unit/test_PlacesUtils_lazyobservers.js +++ b/toolkit/components/places/tests/unit/test_PlacesUtils_lazyobservers.js @@ -3,7 +3,7 @@ function run_test() { do_test_pending(); - + const TEST_URI = NetUtil.newURI("http://moz.org/") let observer = { QueryInterface: XPCOMUtils.generateQI([ diff --git a/toolkit/components/places/tests/unit/test_adaptive_bug527311.js b/toolkit/components/places/tests/unit/test_adaptive_bug527311.js index dbf3214bbc..ab94a51f4b 100644 --- a/toolkit/components/places/tests/unit/test_adaptive_bug527311.js +++ b/toolkit/components/places/tests/unit/test_adaptive_bug527311.js @@ -128,7 +128,7 @@ function run_test() { do_test_pending(); // Add a bookmark to our url. - bs.insertBookmark(bs.unfiledBookmarksFolder, uri(TEST_URL), + bs.insertBookmark(bs.unfiledBookmarksFolder, uri(TEST_URL), bs.DEFAULT_INDEX, "test_book"); // We want to search only history. for (let type of SUGGEST_TYPES) { diff --git a/toolkit/components/places/tests/unit/test_async_history_api.js b/toolkit/components/places/tests/unit/test_async_history_api.js index 7389736569..34b6937169 100644 --- a/toolkit/components/places/tests/unit/test_async_history_api.js +++ b/toolkit/components/places/tests/unit/test_async_history_api.js @@ -108,7 +108,7 @@ VisitObserver.prototype = { { do_print("onVisit(" + aURI.spec + ", " + aVisitId + ", " + aTime + ", " + aSessionId + ", " + aReferringId + ", " + - aTransitionType + ", " + aGUID + ")"); + aTransitionType + ", " + aGUID + ")"); if (!this.uri.equals(aURI) || this.guid != aGUID) { return; } diff --git a/toolkit/components/places/tests/unit/test_bookmark_catobs.js b/toolkit/components/places/tests/unit/test_bookmark_catobs.js index 90e074ebf8..e2b589090f 100644 --- a/toolkit/components/places/tests/unit/test_bookmark_catobs.js +++ b/toolkit/components/places/tests/unit/test_bookmark_catobs.js @@ -23,7 +23,7 @@ add_task(function* test_observers() { let initialObservers = PlacesUtils.bookmarks.getObservers(); // Add a common observer, it should be invoked after the category observer. - let notificationsPromised = new Promise((resolve, reject) => { + let notificationsPromised = new Promise((resolve, reject) => { PlacesUtils.bookmarks.addObserver( { __proto__: NavBookmarkObserver.prototype, onItemAdded() { diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html_import_tags.js b/toolkit/components/places/tests/unit/test_bookmarks_html_import_tags.js new file mode 100644 index 0000000000..e4ba433a34 --- /dev/null +++ b/toolkit/components/places/tests/unit/test_bookmarks_html_import_tags.js @@ -0,0 +1,57 @@ +var bookmarkData = [ + { uri: uri("http://www.toastytech.com"), + title: "Nathan's Toasty Technology Page", + tags: ["technology", "personal", "retro"] }, + { uri: uri("http://www.reddit.com"), + title: "reddit: the front page of the internet", + tags: ["social media", "news", "humour"] }, + { uri: uri("http://www.4chan.org"), + title: "4chan", + tags: ["discussion", "imageboard", "anime"] } +]; + +/* + TEST SUMMARY + - Add bookmarks with tags + - Export tagged bookmarks as HTML file + - Delete bookmarks + - Import bookmarks from HTML file + - Check that all bookmarks are successfully imported with tags +*/ + +add_task(function* test_import_tags() { + // Removes bookmarks.html if the file already exists. + let HTMLFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.html"); + if ((yield OS.File.exists(HTMLFile))) + yield OS.File.remove(HTMLFile); + + // Adds bookmarks and tags to the database. + let bookmarkList = new Set(); + for (let { uri, title, tags } of bookmarkData) { + bookmarkList.add(yield PlacesUtils.bookmarks.insert({ + parentGuid: PlacesUtils.bookmarks.unfiledGuid, + url: uri, + title })); + PlacesUtils.tagging.tagURI(uri, tags); + } + + // Exports the bookmarks as a HTML file. + yield BookmarkHTMLUtils.exportToFile(HTMLFile); + + // Deletes bookmarks and tags from the database. + for (let bookmark of bookmarkList) { + yield PlacesUtils.bookmarks.remove(bookmark.guid); + } + + // Re-imports the bookmarks from the HTML file. + yield BookmarkHTMLUtils.importFromFile(HTMLFile, true); + + // Tests to ensure that the tags are still present for each bookmark URI. + for (let { uri, tags } of bookmarkData) { + do_print("Test tags for " + uri.spec + ": " + tags + "\n"); + let foundTags = PlacesUtils.tagging.getTagsForURI(uri); + Assert.equal(foundTags.length, tags.length); + Assert.ok(tags.every(tag => foundTags.includes(tag))); + } +}); + diff --git a/toolkit/components/places/tests/unit/test_frecency.js b/toolkit/components/places/tests/unit/test_frecency.js index b1c0d1ac17..6c6d5a7f3b 100644 --- a/toolkit/components/places/tests/unit/test_frecency.js +++ b/toolkit/components/places/tests/unit/test_frecency.js @@ -120,7 +120,7 @@ try { getService(Ci.nsINavBookmarksService); } catch(ex) { do_throw("Could not get history service\n"); -} +} function* task_setCountDate(aURI, aCount, aDate) { diff --git a/toolkit/components/places/tests/unit/test_history.js b/toolkit/components/places/tests/unit/test_history.js index 32f8d3980f..f006610ef8 100644 --- a/toolkit/components/places/tests/unit/test_history.js +++ b/toolkit/components/places/tests/unit/test_history.js @@ -124,7 +124,7 @@ add_task(function test_execute() result.root.containerOpen = true; do_check_eq(result.root.childCount, 2); result.root.containerOpen = false; - + // test annotation-based queries var annos = Cc["@mozilla.org/browser/annotation-service;1"]. getService(Ci.nsIAnnotationService); diff --git a/toolkit/components/places/tests/unit/test_history_autocomplete_tags.js b/toolkit/components/places/tests/unit/test_history_autocomplete_tags.js index 1d4ecbc992..e43b416dfc 100644 --- a/toolkit/components/places/tests/unit/test_history_autocomplete_tags.js +++ b/toolkit/components/places/tests/unit/test_history_autocomplete_tags.js @@ -10,31 +10,31 @@ function AutoCompleteInput(aSearches) { this.searches = aSearches; } AutoCompleteInput.prototype = { - constructor: AutoCompleteInput, + constructor: AutoCompleteInput, searches: null, - + minResultsForPopup: 0, timeout: 10, searchParam: "", textValue: "", - disableAutoComplete: false, + disableAutoComplete: false, completeDefaultIndex: false, - + get searchCount() { return this.searches.length; }, - + getSearchAt: function(aIndex) { return this.searches[aIndex]; }, - + onSearchBegin: function() {}, onSearchComplete: function() {}, - - popupOpen: false, - - popup: { + + popupOpen: false, + + popup: { setSelectedIndex: function(aIndex) {}, invalidate: function() {}, @@ -45,9 +45,9 @@ AutoCompleteInput.prototype = { return this; throw Components.results.NS_ERROR_NO_INTERFACE; - } + } }, - + // nsISupports implementation QueryInterface: function(iid) { if (iid.equals(Ci.nsISupports) || @@ -70,8 +70,8 @@ function ensure_tag_results(uris, searchTerm) { print("Searching for '" + searchTerm + "'"); var controller = Components.classes["@mozilla.org/autocomplete/controller;1"]. - getService(Components.interfaces.nsIAutoCompleteController); - + getService(Components.interfaces.nsIAutoCompleteController); + // Make an AutoCompleteInput that uses our searches // and confirms results on search complete var input = new AutoCompleteInput(["history"]); @@ -89,7 +89,7 @@ function ensure_tag_results(uris, searchTerm) input.onSearchComplete = function() { do_check_eq(numSearchesStarted, 1); - do_check_eq(controller.searchStatus, + do_check_eq(controller.searchStatus, uris.length ? Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH : Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH); @@ -102,7 +102,7 @@ function ensure_tag_results(uris, searchTerm) } // Sort the results then check if we have the right items vals.sort().forEach((val, i) => do_check_eq(val, uris[i].spec)) - + if (current_test < (tests.length - 1)) { current_test++; tests[current_test](); @@ -120,7 +120,7 @@ var uri3 = uri("http://site.tld/3/aaa"); var uri4 = uri("http://site.tld/4/bbb"); var uri5 = uri("http://site.tld/5/aaa"); var uri6 = uri("http://site.tld/6/bbb"); - + var tests = [ () => ensure_tag_results([uri1, uri4, uri6], "foo"), () => ensure_tag_results([uri1], "foo aaa"), @@ -164,7 +164,7 @@ function tagURI(aURI, aTags) { tagssvc.tagURI(aURI, aTags); } -/** +/** * Test history autocomplete */ function run_test() { diff --git a/toolkit/components/places/tests/unit/test_history_sidebar.js b/toolkit/components/places/tests/unit/test_history_sidebar.js index 2168ba7f6a..680aa8c48d 100644 --- a/toolkit/components/places/tests/unit/test_history_sidebar.js +++ b/toolkit/components/places/tests/unit/test_history_sidebar.js @@ -438,7 +438,7 @@ add_task(function test_history_sidebar() yield task_test_date_liveupdate(Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY); // The remaining views are - // RESULTS_AS_URI + SORT_BY_VISITCOUNT_DESCENDING + // RESULTS_AS_URI + SORT_BY_VISITCOUNT_DESCENDING // -> test_399266.js // RESULTS_AS_URI + SORT_BY_DATE_DESCENDING // -> test_385397.js diff --git a/toolkit/components/places/tests/unit/test_isvisited.js b/toolkit/components/places/tests/unit/test_isvisited.js index 26015a51de..77b900643e 100644 --- a/toolkit/components/places/tests/unit/test_isvisited.js +++ b/toolkit/components/places/tests/unit/test_isvisited.js @@ -13,12 +13,12 @@ add_task(function test_execute() { var referrer = uri("about:blank"); - // add a http:// uri + // add a http:// uri var uri1 = uri("http://mozilla.com"); yield PlacesTestUtils.addVisits({uri: uri1, referrer: referrer}); do_check_guid_for_uri(uri1); do_check_true(yield promiseIsURIVisited(uri1)); - + // add a https:// uri var uri2 = uri("https://etrade.com"); yield PlacesTestUtils.addVisits({uri: uri2, referrer: referrer}); diff --git a/toolkit/components/places/tests/unit/test_placeURIs.js b/toolkit/components/places/tests/unit/test_placeURIs.js index a5780e7de4..9f54aa4890 100644 --- a/toolkit/components/places/tests/unit/test_placeURIs.js +++ b/toolkit/components/places/tests/unit/test_placeURIs.js @@ -10,7 +10,7 @@ try { var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService); } catch(ex) { do_throw("Could not get history service\n"); -} +} // main function run_test() { diff --git a/toolkit/components/places/tests/unit/test_removeVisitsByTimeframe.js b/toolkit/components/places/tests/unit/test_removeVisitsByTimeframe.js index 1194d3b30a..7cc499558d 100644 --- a/toolkit/components/places/tests/unit/test_removeVisitsByTimeframe.js +++ b/toolkit/components/places/tests/unit/test_removeVisitsByTimeframe.js @@ -17,7 +17,7 @@ function* cleanup() { add_task(function* remove_visits_outside_unbookmarked_uri() { do_print("*** TEST: Remove some visits outside valid timeframe from an unbookmarked URI"); - + do_print("Add 10 visits for the URI from way in the past."); let visits = []; for (let i = 0; i < 10; i++) { diff --git a/toolkit/components/places/tests/unit/test_tag_autocomplete_search.js b/toolkit/components/places/tests/unit/test_tag_autocomplete_search.js index 48f363fd11..6fb467b8a4 100644 --- a/toolkit/components/places/tests/unit/test_tag_autocomplete_search.js +++ b/toolkit/components/places/tests/unit/test_tag_autocomplete_search.js @@ -10,31 +10,31 @@ function AutoCompleteInput(aSearches) { this.searches = aSearches; } AutoCompleteInput.prototype = { - constructor: AutoCompleteInput, + constructor: AutoCompleteInput, searches: null, - + minResultsForPopup: 0, timeout: 10, searchParam: "", textValue: "", - disableAutoComplete: false, + disableAutoComplete: false, completeDefaultIndex: false, - + get searchCount() { return this.searches.length; }, - + getSearchAt: function(aIndex) { return this.searches[aIndex]; }, - + onSearchBegin: function() {}, onSearchComplete: function() {}, - - popupOpen: false, - - popup: { + + popupOpen: false, + + popup: { setSelectedIndex: function(aIndex) {}, invalidate: function() {}, @@ -45,9 +45,9 @@ AutoCompleteInput.prototype = { return this; throw Components.results.NS_ERROR_NO_INTERFACE; - } + } }, - + // nsISupports implementation QueryInterface: function(iid) { if (iid.equals(Ci.nsISupports) || @@ -69,8 +69,8 @@ try { function ensure_tag_results(results, searchTerm) { var controller = Cc["@mozilla.org/autocomplete/controller;1"]. - getService(Ci.nsIAutoCompleteController); - + getService(Ci.nsIAutoCompleteController); + // Make an AutoCompleteInput that uses our searches // and confirms results on search complete var input = new AutoCompleteInput(["places-tag-autocomplete"]); @@ -86,10 +86,10 @@ function ensure_tag_results(results, searchTerm) input.onSearchComplete = function input_onSearchComplete() { do_check_eq(numSearchesStarted, 1); if (results.length) - do_check_eq(controller.searchStatus, + do_check_eq(controller.searchStatus, Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH); else - do_check_eq(controller.searchStatus, + do_check_eq(controller.searchStatus, Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH); do_check_eq(controller.matchCount, results.length); @@ -111,20 +111,20 @@ function ensure_tag_results(results, searchTerm) } var uri1 = uri("http://site.tld/1"); - + var tests = [ function test1() { ensure_tag_results(["bar", "Baz", "boo"], "b"); }, function test2() { ensure_tag_results(["bar", "Baz"], "ba"); }, function test3() { ensure_tag_results(["bar", "Baz"], "Ba"); }, function test4() { ensure_tag_results(["bar"], "bar"); }, - function test5() { ensure_tag_results(["Baz"], "Baz"); }, - function test6() { ensure_tag_results([], "barb"); }, + function test5() { ensure_tag_results(["Baz"], "Baz"); }, + function test6() { ensure_tag_results([], "barb"); }, function test7() { ensure_tag_results([], "foo"); }, function test8() { ensure_tag_results(["first tag, bar", "first tag, Baz"], "first tag, ba"); }, function test9() { ensure_tag_results(["first tag; bar", "first tag; Baz"], "first tag; ba"); } ]; -/** +/** * Test tag autocomplete */ function run_test() { diff --git a/toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js b/toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js index 27bc201046..ecebce94a6 100644 --- a/toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js +++ b/toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js @@ -148,7 +148,7 @@ function() { ]; /** - * Executes a query and checks number of uri nodes in the first container in + * Executes a query and checks number of uri nodes in the first container in * query's results. To correctly test a container ensure that the query will * return only your container in the first level. * diff --git a/toolkit/components/places/tests/unit/xpcshell.ini b/toolkit/components/places/tests/unit/xpcshell.ini index d0b08e5d41..d6e7ce9313 100644 --- a/toolkit/components/places/tests/unit/xpcshell.ini +++ b/toolkit/components/places/tests/unit/xpcshell.ini @@ -74,6 +74,7 @@ skip-if = os == "android" [test_bookmarks_json.js] [test_bookmarks_html.js] [test_bookmarks_html_corrupt.js] +[test_bookmarks_html_import_tags.js] [test_bookmarks_html_singleframe.js] [test_bookmarks_restore_notification.js] [test_bookmarks_setNullTitle.js] diff --git a/toolkit/components/printing/content/printPageSetup.js b/toolkit/components/printing/content/printPageSetup.js index da56a03158..8b530c0242 100644 --- a/toolkit/components/printing/content/printPageSetup.js +++ b/toolkit/components/printing/content/printPageSetup.js @@ -66,12 +66,12 @@ function initDialog() function isListOfPrinterFeaturesAvailable() { var has_printerfeatures = false; - + try { has_printerfeatures = gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".has_special_printerfeatures"); } catch(ex) { } - + return has_printerfeatures; } @@ -91,7 +91,7 @@ function setOrientation() var selection = gDialog.orientation.selectedItem; var style = "background-color:white;"; - if ((selection == gDialog.portrait && gPageWidth > gPageHeight) || + if ((selection == gDialog.portrait && gPageWidth > gPageHeight) || (selection == gDialog.landscape && gPageWidth < gPageHeight)) { // Swap width/height. var temp = gPageHeight; @@ -236,13 +236,13 @@ function setPrinterDefaultsForSelectedPrinter() if (gPrintSettings.printerName == "") { gPrintSettings.printerName = gPrintService.defaultPrinterName; } - - // First get any defaults from the printer + + // First get any defaults from the printer gPrintService.initPrintSettingsFromPrinter(gPrintSettings.printerName, gPrintSettings); // now augment them with any values from last time gPrintService.initPrintSettingsFromPrefs(gPrintSettings, true, gPrintSettingsInterface.kInitSaveAll); - + if (gDoDebug) { dump("pagesetup/setPrinterDefaultsForSelectedPrinter: printerName='"+gPrintSettings.printerName+"', orientation='"+gPrintSettings.orientation+"'\n"); } @@ -259,7 +259,7 @@ function loadDialog() try { gPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); - + gPrintService = Components.classes["@mozilla.org/gfx/printsettings-service;1"]; if (gPrintService) { gPrintService = gPrintService.getService(); diff --git a/toolkit/components/printing/content/printPreviewProgress.js b/toolkit/components/printing/content/printPreviewProgress.js index dc2b61f058..42b403e03c 100644 --- a/toolkit/components/printing/content/printPreviewProgress.js +++ b/toolkit/components/printing/content/printPreviewProgress.js @@ -8,7 +8,7 @@ var dialog; // the printProgress is a nsIPrintProgress object -var printProgress = null; +var printProgress = null; // random global variables... var targetFile; @@ -28,7 +28,7 @@ function ellipseString(aStr, doFront) if (doFront) return "..." + aStr.substr(aStr.length-fixedLen, fixedLen); - + return aStr.substr(0, fixedLen) + "..."; } @@ -40,7 +40,7 @@ var progressListener = { if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) window.close(); }, - + onProgressChange: function (aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) { if (!progressParams) @@ -70,7 +70,7 @@ var progressListener = { QueryInterface: function (iid) { if (iid.equals(Components.interfaces.nsIWebProgressListener) || iid.equals(Components.interfaces.nsISupportsWeakReference)) - return this; + return this; throw Components.results.NS_NOINTERFACE; } } @@ -107,7 +107,7 @@ function onLoad() { window.setTimeout(doneIniting, 100); } -function onUnload() +function onUnload() { if (!printProgress) return; @@ -136,19 +136,19 @@ function getString (stringId) { } // If the user presses cancel, tell the app launcher and close the dialog... -function onCancel () +function onCancel () { // Cancel app launcher. try { printProgress.processCanceledByUser = true; } catch(e) {return true;} - + // don't Close up dialog by returning false, the backend will close the dialog when everything will be aborted. return false; } -function doneIniting() +function doneIniting() { // called by function timeout in onLoad printProgress.doneIniting(); diff --git a/toolkit/components/printing/content/printProgress.js b/toolkit/components/printing/content/printProgress.js index 1e626599bc..22b5ffb225 100644 --- a/toolkit/components/printing/content/printProgress.js +++ b/toolkit/components/printing/content/printProgress.js @@ -8,7 +8,7 @@ var dialog; // the printProgress is a nsIPrintProgress object -var printProgress = null; +var printProgress = null; // random global variables... var targetFile; @@ -47,10 +47,10 @@ var progressListener = { // dialog.progress.setAttribute( "value", 0 ); dialog.progress.setAttribute( "mode", "undetermined" ); } - + if (aStateFlags & Components.interfaces.nsIWebProgressListener.STATE_STOP) { - // we are done printing + // we are done printing // Indicate completion in title area. var msg = getString( "printComplete" ); dialog.title.setAttribute("value", msg); @@ -68,10 +68,10 @@ var progressListener = { window.close(); } }, - + onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress) { - if (switchUI) + if (switchUI) { dialog.tempLabel.setAttribute("hidden", "true"); dialog.progress.setAttribute("hidden", "false"); @@ -102,14 +102,14 @@ var progressListener = { // Calculate percentage. var percent; - if ( aMaxTotalProgress > 0 ) + if ( aMaxTotalProgress > 0 ) { percent = Math.round( (aCurTotalProgress*100)/aMaxTotalProgress ); if ( percent > 100 ) percent = 100; - + dialog.progress.removeAttribute( "mode"); - + // Advance progress meter. dialog.progress.setAttribute( "value", percent ); @@ -117,8 +117,8 @@ var progressListener = { var percentPrint = getString( "progressText" ); percentPrint = replaceInsert( percentPrint, 1, percent ); dialog.progressText.setAttribute("value", percentPrint); - } - else + } + else { // Progress meter should be barber-pole in this case. dialog.progress.setAttribute( "mode", "undetermined" ); @@ -147,7 +147,7 @@ var progressListener = { { if (iid.equals(Components.interfaces.nsIWebProgressListener) || iid.equals(Components.interfaces.nsISupportsWeakReference)) return this; - + throw Components.results.NS_NOINTERFACE; } }; @@ -175,7 +175,7 @@ function getString( stringId ) { return dialog.strings[ stringId ]; } -function loadDialog() +function loadDialog() { } @@ -241,35 +241,35 @@ function onLoad() { window.setTimeout(doneIniting, 500); } -function onUnload() +function onUnload() { if (printProgress) { - try + try { printProgress.unregisterListener(progressListener); printProgress = null; } - + catch( exception ) {} } } // If the user presses cancel, tell the app launcher and close the dialog... -function onCancel () +function onCancel () { // Cancel app launcher. - try + try { printProgress.processCanceledByUser = true; } catch( exception ) {return true;} - + // don't Close up dialog by returning false, the backend will close the dialog when everything will be aborted. return false; } -function doneIniting() +function doneIniting() { printProgress.doneIniting(); } diff --git a/toolkit/components/printing/content/printUtils.js b/toolkit/components/printing/content/printUtils.js index 28e1d64c22..2f9f83907e 100644 --- a/toolkit/components/printing/content/printUtils.js +++ b/toolkit/components/printing/content/printUtils.js @@ -458,7 +458,7 @@ var PrintUtils = { if (!aPrintSettings.printerName) aPrintSettings.printerName = aPSSVC.defaultPrinterName; - // First get any defaults from the printer + // First get any defaults from the printer aPSSVC.initPrintSettingsFromPrinter(aPrintSettings.printerName, aPrintSettings); // now augment them with any values from last time aPSSVC.initPrintSettingsFromPrefs(aPrintSettings, true, aPrintSettings.kInitSaveAll); diff --git a/toolkit/components/printing/content/printdialog.js b/toolkit/components/printing/content/printdialog.js index 652aa0264a..83de337505 100644 --- a/toolkit/components/printing/content/printdialog.js +++ b/toolkit/components/printing/content/printdialog.js @@ -32,7 +32,7 @@ function initDialog() dialog.topageInput = document.getElementById("topageInput"); dialog.topageLabel = document.getElementById("topageLabel"); - dialog.numCopiesInput = document.getElementById("numCopiesInput"); + dialog.numCopiesInput = document.getElementById("numCopiesInput"); dialog.printframeGroup = document.getElementById("printframeGroup"); dialog.aslaidoutRadio = document.getElementById("aslaidoutRadio"); @@ -86,7 +86,7 @@ function getPrinterDescription(printerName) s = gPrefs.getCharPref("print.printer_" + printerName + ".printer_description") } catch(e) { } - + return s; } @@ -108,9 +108,9 @@ listElement.prototype = } }, - appendPrinterNames: - function (aDataObject) - { + appendPrinterNames: + function (aDataObject) + { if ((null == aDataObject) || !aDataObject.hasMore()) { // disable dialog this.listElement.setAttribute("value", ""); @@ -126,14 +126,14 @@ listElement.prototype = } else { // build popup menu from printer names - var list = document.getElementById("printerList"); + var list = document.getElementById("printerList"); do { printerNameStr = aDataObject.getNext(); list.appendItem(printerNameStr, printerNameStr, getPrinterDescription(printerNameStr)); } while (aDataObject.hasMore()); this.listElement.removeAttribute("disabled"); } - } + } }; //--------------------------------------------------- @@ -163,15 +163,15 @@ function getPrinters() function setPrinterDefaultsForSelectedPrinter() { gPrintSettings.printerName = dialog.printerList.value; - + dialog.descText.value = getPrinterDescription(gPrintSettings.printerName); - - // First get any defaults from the printer + + // First get any defaults from the printer printService.initPrintSettingsFromPrinter(gPrintSettings.printerName, gPrintSettings); - + // now augment them with any values from last time printService.initPrintSettingsFromPrefs(gPrintSettings, true, gPrintSetInterface.kInitSaveAll); - + if (doDebug) { dump("setPrinterDefaultsForSelectedPrinter: printerName='"+gPrintSettings.printerName+"', paperName='"+gPrintSettings.paperName+"'\n"); } @@ -371,7 +371,7 @@ function onAccept() saveToPrefs = gPrefs.getBoolPref("print.save_print_settings"); if (saveToPrefs && printService != null) { - var flags = gPrintSetInterface.kInitSavePaperSize | + var flags = gPrintSetInterface.kInitSavePaperSize | gPrintSetInterface.kInitSaveEdges | gPrintSetInterface.kInitSaveInColor | gPrintSetInterface.kInitSaveShrinkToFit | diff --git a/toolkit/components/printing/content/printjoboptions.js b/toolkit/components/printing/content/printjoboptions.js index 041d1c4224..bf7629fb56 100644 --- a/toolkit/components/printing/content/printjoboptions.js +++ b/toolkit/components/printing/content/printjoboptions.js @@ -36,12 +36,12 @@ function checkDouble(element, maxVal) function isListOfPrinterFeaturesAvailable() { var has_printerfeatures = false; - + try { has_printerfeatures = gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".has_special_printerfeatures"); } catch(ex) { } - + return has_printerfeatures; } @@ -66,7 +66,7 @@ function initDialog() dialog.jobTitleLabel = document.getElementById("jobTitleLabel"); dialog.jobTitleGroup = document.getElementById("jobTitleGroup"); dialog.jobTitleInput = document.getElementById("jobTitleInput"); - + dialog.colorGroup = document.getElementById("colorGroup"); dialog.colorRadioGroup = document.getElementById("colorRadioGroup"); dialog.colorRadio = document.getElementById("colorRadio"); @@ -100,33 +100,33 @@ paperListElement.prototype = this.paperListElement.removeChild(this.paperListElement.firstChild); }, - appendPaperNames: - function (aDataObject) - { - var popupNode = document.createElement("menupopup"); + appendPaperNames: + function (aDataObject) + { + var popupNode = document.createElement("menupopup"); for (var i=0;iExtra content<\/body>"; function runtest(e) diff --git a/toolkit/components/satchel/test/test_form_autocomplete.html b/toolkit/components/satchel/test/test_form_autocomplete.html index 91d25a76b2..53a8a3975e 100644 --- a/toolkit/components/satchel/test/test_form_autocomplete.html +++ b/toolkit/components/satchel/test/test_form_autocomplete.html @@ -218,7 +218,7 @@ SpecialPowers.addAutoCompletePopupEventListener(window, "popupshown", popupShown * This is a bit hacky, as many operations happen asynchronously. * Various mechanisms call runTests as a result of operations: * - set expectingPopup to true, and the next test will occur when the autocomplete popup is shown - * - call waitForMenuChange(x) to run the next test when the autocomplete popup to have x items in it + * - call waitForMenuChange(x) to run the next test when the autocomplete popup to have x items in it * - addEntry calls runs the test when an entry has been added * - some tests scroll the window. This is because the form fill controller happens to scroll * the field into view near the end of the search, and there isn't any other good notification diff --git a/toolkit/components/satchel/test/test_form_autocomplete_with_list.html b/toolkit/components/satchel/test/test_form_autocomplete_with_list.html index 0c1c2039f9..3c2f207cbc 100644 --- a/toolkit/components/satchel/test/test_form_autocomplete_with_list.html +++ b/toolkit/components/satchel/test/test_form_autocomplete_with_list.html @@ -103,7 +103,7 @@ SpecialPowers.addAutoCompletePopupEventListener(window, "popupshown", popupShown * This is a bit hacky, as many operations happen asynchronously. * Various mechanisms call runTests as a result of operations: * - set expectingPopup to true, and the next test will occur when the autocomplete popup is shown -* - call waitForMenuChange(x) to run the next test when the autocomplete popup to have x items in it +* - call waitForMenuChange(x) to run the next test when the autocomplete popup to have x items in it */ function runTest() { testNum++; @@ -172,7 +172,7 @@ function runTest() { restoreForm(); doKey("down"); break; - + case 6: //Delete the first entry (of 3) doKey("down"); diff --git a/toolkit/components/social/WorkerAPI.jsm b/toolkit/components/social/WorkerAPI.jsm index 343fb3e9af..aef2ca48e4 100644 --- a/toolkit/components/social/WorkerAPI.jsm +++ b/toolkit/components/social/WorkerAPI.jsm @@ -145,7 +145,7 @@ WorkerAPI.prototype = { // action was provided. null, listener, - type); + type); }, } } diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryLateWrites.js b/toolkit/components/telemetry/tests/unit/test_TelemetryLateWrites.js index 3fe77a3608..20f61b4b99 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryLateWrites.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryLateWrites.js @@ -1,5 +1,5 @@ /* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ + http://creativecommons.org/publicdomain/zero/1.0/ */ /* A testcase to make sure reading late writes stacks works. */ diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryLockCount.js b/toolkit/components/telemetry/tests/unit/test_TelemetryLockCount.js index cca8f6c461..75f9f1b233 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryLockCount.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryLockCount.js @@ -1,5 +1,5 @@ /* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ + http://creativecommons.org/publicdomain/zero/1.0/ */ /* A testcase to make sure reading the failed profile lock count works. */ diff --git a/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js b/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js index a157f3cee5..f5f9930979 100644 --- a/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js +++ b/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js @@ -178,7 +178,7 @@ function test_getHistogramById() { Telemetry.getHistogramById("nonexistent"); do_throw("This can't happen"); } catch (e) { - + } var h = Telemetry.getHistogramById("CYCLE_COLLECTOR"); var s = h.snapshot(); diff --git a/toolkit/components/thumbnails/PageThumbUtils.jsm b/toolkit/components/thumbnails/PageThumbUtils.jsm index 43b488af1e..bef475f930 100644 --- a/toolkit/components/thumbnails/PageThumbUtils.jsm +++ b/toolkit/components/thumbnails/PageThumbUtils.jsm @@ -14,6 +14,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Promise.jsm", this); +Cu.import("resource://gre/modules/AppConstants.jsm"); this.PageThumbUtils = { // The default background color for page thumbnails. @@ -27,38 +28,186 @@ this.PageThumbUtils = { * * @param aWindow (optional) The document of this window will be used to * create the canvas. If not given, the hidden window will be used. + * @param aWidth (optional) width of the canvas to create + * @param aHeight (optional) height of the canvas to create * @return The newly created canvas. */ - createCanvas: function (aWindow) { + createCanvas: function (aWindow, aWidth = 0, aHeight = 0) { let doc = (aWindow || Services.appShell.hiddenDOMWindow).document; let canvas = doc.createElementNS(this.HTML_NAMESPACE, "canvas"); canvas.mozOpaque = true; canvas.mozImageSmoothingEnabled = true; - let [thumbnailWidth, thumbnailHeight] = this.getThumbnailSize(); - canvas.width = thumbnailWidth; - canvas.height = thumbnailHeight; + let [thumbnailWidth, thumbnailHeight] = this.getThumbnailSize(aWindow); + canvas.width = aWidth ? aWidth : thumbnailWidth; + canvas.height = aHeight ? aHeight : thumbnailHeight; return canvas; }, /** - * Calculates a preferred initial thumbnail size based on current desktop - * dimensions. The resulting dims will generally be about 1/3 the - * size of the desktop. (jimm: why??) + * Calculates a preferred initial thumbnail size based based on newtab.css + * sizes or a preference for other applications. The sizes should be the same + * as set for the tile sizes in newtab. * + * @param aWindow (optional) aWindow that is used to calculate the scaling size. * @return The calculated thumbnail size or a default if unable to calculate. */ - getThumbnailSize: function () { + getThumbnailSize: function (aWindow = null) { if (!this._thumbnailWidth || !this._thumbnailHeight) { let screenManager = Cc["@mozilla.org/gfx/screenmanager;1"] .getService(Ci.nsIScreenManager); - let left = {}, top = {}, width = {}, height = {}; - screenManager.primaryScreen.GetRectDisplayPix(left, top, width, height); - this._thumbnailWidth = Math.round(width.value / 3); - this._thumbnailHeight = Math.round(height.value / 3); + let left = {}, top = {}, screenWidth = {}, screenHeight = {}; + screenManager.primaryScreen.GetRectDisplayPix(left, top, screenWidth, screenHeight); + + /*** + * The system default scale might be different than + * what is reported by the window. For example, + * retina displays have 1:1 system scales, but 2:1 window + * scale as 1 pixel system wide == 2 device pixels. + * To get the best image quality, query both and take the highest one. + */ + let systemScale = screenManager.systemDefaultScale; + let windowScale = aWindow ? aWindow.devicePixelRatio : systemScale; + let scale = Math.max(systemScale, windowScale); + + /*** + * On retina displays, we can sometimes go down this path + * without a window object. In those cases, force 2x scaling + * as the system scale doesn't represent the 2x scaling + * on OS X. + */ + if (AppConstants.platform == "macosx" && !aWindow) { + scale = 2; + } + + /*** + * THESE VALUES ARE DEFINED IN newtab.css and hard coded. + * If you change these values from the prefs, + * ALSO CHANGE THEM IN newtab.css + */ + let prefWidth = Services.prefs.getIntPref("toolkit.pageThumbs.minWidth"); + let prefHeight = Services.prefs.getIntPref("toolkit.pageThumbs.minHeight"); + let divisor = Services.prefs.getIntPref("toolkit.pageThumbs.screenSizeDivisor"); + + prefWidth *= scale; + prefHeight *= scale; + + this._thumbnailWidth = Math.max(Math.round(screenWidth.value / divisor), prefWidth);; + this._thumbnailHeight = Math.max(Math.round(screenHeight.value / divisor), prefHeight); } + return [this._thumbnailWidth, this._thumbnailHeight]; }, + /*** + * Given a browser window, return the size of the content + * minus the scroll bars. + */ + getContentSize: function(aWindow) { + let utils = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindowUtils); + // aWindow may be a cpow, add exposed props security values. + let sbWidth = {}, sbHeight = {}; + + try { + utils.getScrollbarSize(false, sbWidth, sbHeight); + } catch (e) { + // This might fail if the window does not have a presShell. + Cu.reportError("Unable to get scrollbar size in determineCropSize."); + sbWidth.value = sbHeight.value = 0; + } + + // Even in RTL mode, scrollbars are always on the right. + // So there's no need to determine a left offset. + let width = aWindow.innerWidth - sbWidth.value; + let height = aWindow.innerHeight - sbHeight.value; + + return [width, height]; + }, + + /*** + * Given a browser window, this creates a snapshot of the content + * and returns a canvas with the resulting snapshot of the content + * at the thumbnail size. It has to do this through a two step process: + * + * 1) Render the content at the window size to a canvas that is 2x the thumbnail size + * 2) Downscale the canvas from (1) down to the thumbnail size + * + * This is because the thumbnail size is too small to render at directly, + * causing pages to believe the browser is a small resolution. Also, + * at that resolution, graphical artifacts / text become very jagged. + * It's actually better to the eye to have small blurry text than sharp + * jagged pixels to represent text. + * + * @params aWindow - the window to create a snapshot of. + * @params aDestCanvas (optional) a destination canvas to draw the final snapshot to. + * @return Canvas with a scaled thumbnail of the window. + */ + createSnapshotThumbnail: function(aWindow, aDestCanvas = null) { + if (Cu.isCrossProcessWrapper(aWindow)) { + throw new Error('Do not pass cpows here.'); + } + + let [contentWidth, contentHeight] = this.getContentSize(aWindow); + let [thumbnailWidth, thumbnailHeight] = this.getThumbnailSize(aWindow); + let intermediateWidth = thumbnailWidth * 2; + let intermediateHeight = thumbnailHeight * 2; + let skipDownscale = false; + let snapshotCanvas = undefined; + + // Our intermediate thumbnail is bigger than content, + // which can happen on hiDPI devices like a retina macbook pro. + // In those cases, just render at the final size. + if ((intermediateWidth >= contentWidth) || + (intermediateHeight >= contentHeight)) { + intermediateWidth = thumbnailWidth; + intermediateHeight = thumbnailHeight; + skipDownscale = true; + snapshotCanvas = aDestCanvas; + } + + // If we've been given a large preallocated canvas, so + // just render once into the destination canvas. + if (aDestCanvas && + ((aDestCanvas.width >= intermediateWidth) || + (aDestCanvas.height >= intermediateHeight))) { + intermediateWidth = aDestCanvas.width; + intermediateHeight = aDestCanvas.height; + skipDownscale = true; + snapshotCanvas = aDestCanvas; + } + + if (!snapshotCanvas) { + snapshotCanvas = this.createCanvas(aWindow, intermediateWidth, intermediateHeight); + } + + // This is step 1. + // Also by default, canvas does not draw the scrollbars, so no need to + // remove the scrollbar sizes. + let scale = Math.min(Math.max(intermediateWidth / contentWidth, + intermediateHeight / contentHeight), 1); + + let snapshotCtx = snapshotCanvas.getContext("2d"); + snapshotCtx.save(); + snapshotCtx.scale(scale, scale); + snapshotCtx.drawWindow(aWindow, 0, 0, contentWidth, contentHeight, + PageThumbUtils.THUMBNAIL_BG_COLOR, + snapshotCtx.DRAWWINDOW_DO_NOT_FLUSH); + snapshotCtx.restore(); + if (skipDownscale) { + return snapshotCanvas; + } + + // Part 2: Assumes that the snapshot is 2x the thumbnail size + let finalCanvas = aDestCanvas || this.createCanvas(aWindow, thumbnailWidth, thumbnailHeight); + + let finalCtx = finalCanvas.getContext("2d"); + finalCtx.save(); + finalCtx.scale(0.5, 0.5); + finalCtx.drawImage(snapshotCanvas, 0, 0); + finalCtx.restore(); + return finalCanvas; + }, + /** * Determine a good thumbnail crop size and scale for a given content * window. diff --git a/toolkit/components/thumbnails/PageThumbs.jsm b/toolkit/components/thumbnails/PageThumbs.jsm index 68b998adfb..171e2ab022 100644 --- a/toolkit/components/thumbnails/PageThumbs.jsm +++ b/toolkit/components/thumbnails/PageThumbs.jsm @@ -184,7 +184,7 @@ this.PageThumbs = { let deferred = Promise.defer(); - let canvas = this.createCanvas(); + let canvas = this.createCanvas(aBrowser.contentWindow); this.captureToCanvas(aBrowser, canvas, () => { canvas.toBlob(blob => { deferred.resolve(blob, this.contentType); @@ -223,7 +223,7 @@ this.PageThumbs = { * transitory as it is based on current navigation state and the type of * content being displayed. * - * @param aBrowser The target browser + * @param aBrowser The target browser * @param aCallback(aResult) A callback invoked once security checks have * completed. aResult is a boolean indicating the combined result of the * security checks performed. @@ -266,24 +266,7 @@ this.PageThumbs = { return; } - // Generate in-process content thumbnail - let [width, height, scale] = - PageThumbUtils.determineCropSize(aBrowser.contentWindow, aCanvas); - let ctx = aCanvas.getContext("2d"); - - // Scale the canvas accordingly. - ctx.save(); - ctx.scale(scale, scale); - - try { - // Draw the window contents to the canvas. - ctx.drawWindow(aBrowser.contentWindow, 0, 0, width, height, - PageThumbUtils.THUMBNAIL_BG_COLOR, - ctx.DRAWWINDOW_DO_NOT_FLUSH); - } catch (e) { - // We couldn't draw to the canvas for some reason. - } - ctx.restore(); + aCanvas = PageThumbUtils.createSnapshotThumbnail(aBrowser.contentWindow, aCanvas); if (aCallback) { aCallback(aCanvas); diff --git a/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js b/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js index 1272dc0498..31f323c855 100644 --- a/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js +++ b/toolkit/components/thumbnails/content/backgroundPageThumbsContent.js @@ -129,20 +129,10 @@ const backgroundPageThumbsContent = { let canvasDrawDate = new Date(); - let canvas = PageThumbUtils.createCanvas(content); - let [sw, sh, scale] = PageThumbUtils.determineCropSize(content, canvas); - - let ctx = canvas.getContext("2d"); - ctx.save(); - ctx.scale(scale, scale); - ctx.drawWindow(content, 0, 0, sw, sh, - PageThumbUtils.THUMBNAIL_BG_COLOR, - ctx.DRAWWINDOW_DO_NOT_FLUSH); - ctx.restore(); - + let finalCanvas = PageThumbUtils.createSnapshotThumbnail(content); capture.canvasDrawTime = new Date() - canvasDrawDate; - canvas.toBlob(blob => { + finalCanvas.toBlob(blob => { capture.imageBlob = new Blob([blob]); // Load about:blank to finish the capture and wait for onStateChange. this._loadAboutBlank(); diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bug727765.js b/toolkit/components/thumbnails/test/browser_thumbnails_bug727765.js index 40ed12e824..a6b14bbff0 100644 --- a/toolkit/components/thumbnails/test/browser_thumbnails_bug727765.js +++ b/toolkit/components/thumbnails/test/browser_thumbnails_bug727765.js @@ -4,6 +4,13 @@ const URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/" + "test/background_red_scroll.html"; +function isRedThumbnailFuzz(r, g, b, expectedR, expectedB, expectedG, aFuzz) +{ + return (Math.abs(r - expectedR) <= aFuzz) && + (Math.abs(r - expectedR) <= aFuzz) && + (Math.abs(r - expectedR) <= aFuzz); +} + // Test for black borders caused by scrollbars. function* runTests() { // Create a tab with a page with a red background and scrollbars. @@ -14,7 +21,9 @@ function* runTests() { yield whenFileExists(URL); yield retrieveImageDataForURL(URL, function (aData) { let [r, g, b] = [].slice.call(aData, -4); - is("" + [r,g,b], "255,0,0", "we have a red thumbnail"); + let fuzz = 2; // Windows 8 x64 blends with the scrollbar a bit. + var message = "Expected red thumbnail rgb(255, 0, 0), got " + r + "," + g + "," + b; + ok(isRedThumbnailFuzz(r, g, b, 255, 0, 0, fuzz), message); next(); }); } diff --git a/toolkit/components/timermanager/nsUpdateTimerManager.js b/toolkit/components/timermanager/nsUpdateTimerManager.js index 2f6041a795..a3aea556af 100644 --- a/toolkit/components/timermanager/nsUpdateTimerManager.js +++ b/toolkit/components/timermanager/nsUpdateTimerManager.js @@ -252,7 +252,7 @@ TimerManager.prototype = { if (skippedFirings) timer.delay = this._timerMinimumDelay; else - timer.delay = Math.max(nextDelay * 1000, this._timerMinimumDelay); + timer.delay = Math.max(nextDelay * 1000, this._timerMinimumDelay); this.lastTimerReset = Date.now(); } else { this._cancelTimer(); @@ -272,7 +272,7 @@ TimerManager.prototype = { Ci.nsITimer.TYPE_REPEATING_SLACK); this.lastTimerReset = Date.now(); } else { - if (Date.now() + interval < this.lastTimerReset + this._timer.delay) + if (Date.now() + interval < this.lastTimerReset + this._timer.delay) this._timer.delay = Math.max(this.lastTimerReset + interval - Date.now(), 0); } }, diff --git a/toolkit/components/viewconfig/content/config.js b/toolkit/components/viewconfig/content/config.js index fade53e318..bceb9afa70 100644 --- a/toolkit/components/viewconfig/content/config.js +++ b/toolkit/components/viewconfig/content/config.js @@ -45,11 +45,11 @@ var view = { getCellText : function(index, col) { if (!(index in gPrefView)) return ""; - + var value = gPrefView[index][col.id]; switch (col.id) { - case "lockCol": + case "lockCol": return gLockStrs[value]; case "typeCol": return gTypeStrs[value]; @@ -361,7 +361,7 @@ function ShowPrefs() } gSortFunction = gSortFunctions[gSortedColumn]; gPrefArray.sort(gSortFunction); - + gPrefBranch.addObserver("", gPrefListener, false); var configTree = document.getElementById("configTree"); @@ -441,7 +441,7 @@ function prefColSortFunction(x, y) { if (x.prefCol > y.prefCol) return gSortDirection; - if (x.prefCol < y.prefCol) + if (x.prefCol < y.prefCol) return -gSortDirection; return 0; } @@ -455,7 +455,7 @@ function lockColSortFunction(x, y) function typeColSortFunction(x, y) { - if (x.typeCol != y.typeCol) + if (x.typeCol != y.typeCol) return gSortDirection * (y.typeCol - x.typeCol); return prefColSortFunction(x, y); } @@ -464,16 +464,16 @@ function valueColSortFunction(x, y) { if (x.valueCol > y.valueCol) return gSortDirection; - if (x.valueCol < y.valueCol) + if (x.valueCol < y.valueCol) return -gSortDirection; return prefColSortFunction(x, y); } const gSortFunctions = { - prefCol: prefColSortFunction, - lockCol: lockColSortFunction, - typeCol: typeColSortFunction, + prefCol: prefColSortFunction, + lockCol: lockColSortFunction, + typeCol: typeColSortFunction, valueCol: valueColSortFunction }; diff --git a/toolkit/content/browser-child.js b/toolkit/content/browser-child.js index bdf403c897..148fa1ea1e 100644 --- a/toolkit/content/browser-child.js +++ b/toolkit/content/browser-child.js @@ -444,26 +444,12 @@ addMessageListener("UpdateCharacterSet", function (aMessage) { * Remote thumbnail request handler for PageThumbs thumbnails. */ addMessageListener("Browser:Thumbnail:Request", function (aMessage) { - let thumbnail = content.document.createElementNS(PageThumbUtils.HTML_NAMESPACE, - "canvas"); - thumbnail.mozOpaque = true; - thumbnail.mozImageSmoothingEnabled = true; + let snapshotWidth = aMessage.data.canvasWidth; + let snapshotHeight = aMessage.data.canvasHeight; + let canvas = PageThumbUtils.createCanvas(content, snapshotWidth, snapshotHeight); + let snapshot = PageThumbUtils.createSnapshotThumbnail(content, canvas); - thumbnail.width = aMessage.data.canvasWidth; - thumbnail.height = aMessage.data.canvasHeight; - - let [width, height, scale] = - PageThumbUtils.determineCropSize(content, thumbnail); - - let ctx = thumbnail.getContext("2d"); - ctx.save(); - ctx.scale(scale, scale); - ctx.drawWindow(content, 0, 0, width, height, - aMessage.data.background, - ctx.DRAWWINDOW_DO_NOT_FLUSH); - ctx.restore(); - - thumbnail.toBlob(function (aBlob) { + snapshot.toBlob(function (aBlob) { sendAsyncMessage("Browser:Thumbnail:Response", { thumbnail: aBlob, id: aMessage.data.id diff --git a/toolkit/content/findUtils.js b/toolkit/content/findUtils.js index 723a90f758..397a98f6cb 100644 --- a/toolkit/content/findUtils.js +++ b/toolkit/content/findUtils.js @@ -37,7 +37,7 @@ nsFindInstData.prototype = var findInFrames = findInst.QueryInterface(Components.interfaces.nsIWebBrowserFindInFrames); findInFrames.rootSearchFrame = this.rootSearchWindow; findInFrames.currentSearchFrame = this.currentSearchWindow; - + // always search in frames for now. We could add a checkbox to the dialog for this. findInst.searchFrames = true; }, @@ -98,7 +98,7 @@ function findAgainInPage(findInstData, reverse) } // Reset to normal value, otherwise setting can get changed in find dialog - findInst.findBackwards = findService.findBackwards; + findInst.findBackwards = findService.findBackwards; } } diff --git a/toolkit/content/finddialog.js b/toolkit/content/finddialog.js index 4a99c6aad9..e2e10ca6ad 100644 --- a/toolkit/content/finddialog.js +++ b/toolkit/content/finddialog.js @@ -38,7 +38,7 @@ function fillDialog() // get the find service, which stores global find state var findService = Components.classes["@mozilla.org/find/find_service;1"] .getService(Components.interfaces.nsIFindService); - + // Set initial dialog field contents. Use the gFindInst attributes first, // this is necessary for window.find() dialog.findKey.value = gFindInst.searchString ? gFindInst.searchString : findService.searchString; @@ -69,15 +69,15 @@ function onLoad() initDialogObject(); // get the find instance - var arg0 = window.arguments[0]; + var arg0 = window.arguments[0]; // If the dialog was opened from window.find(), // arg0 will be an instance of nsIWebBrowserFind if (arg0 instanceof Components.interfaces.nsIWebBrowserFind) { gFindInst = arg0; - } else { - gFindInstData = arg0; - gFindInst = gFindInstData.webBrowserFind; - } + } else { + gFindInstData = arg0; + gFindInst = gFindInstData.webBrowserFind; + } fillDialog(); doEnabling(); @@ -95,7 +95,7 @@ function onUnload() function onAccept() { if (gFindInstData && gFindInst != gFindInstData.webBrowserFind) { - gFindInstData.init(); + gFindInstData.init(); gFindInst = gFindInstData.webBrowserFind; } @@ -108,7 +108,7 @@ function onAccept() gFindInst.matchCase = dialog.caseSensitive.checked; gFindInst.wrapFind = dialog.wrap.checked; gFindInst.findBackwards = dialog.up.selected; - + // Search. var result = gFindInst.findNext(); @@ -120,7 +120,7 @@ function onAccept() dialog.bundle.getString("notFoundWarning")); dialog.findKey.select(); dialog.findKey.focus(); - } + } return false; } diff --git a/toolkit/content/globalOverlay.js b/toolkit/content/globalOverlay.js index 1ccfcb5579..f178bc1559 100644 --- a/toolkit/content/globalOverlay.js +++ b/toolkit/content/globalOverlay.js @@ -41,13 +41,13 @@ function canQuitApplication(aData) var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); if (!os) return true; - + try { var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"] .createInstance(Components.interfaces.nsISupportsPRBool); os.notifyObservers(cancelQuit, "quit-application-requested", aData || null); - - // Something aborted the quit process. + + // Something aborted the quit process. if (cancelQuit.data) return false; } diff --git a/toolkit/content/nsDragAndDrop.js b/toolkit/content/nsDragAndDrop.js index 40e96f9d1a..d76a5a8a87 100644 --- a/toolkit/content/nsDragAndDrop.js +++ b/toolkit/content/nsDragAndDrop.js @@ -15,26 +15,26 @@ //////////////////////////////////////////////////////////////////////// -/** +/** * nsTransferable - a wrapper for nsITransferable that simplifies * javascript clipboard and drag&drop. for use in * these situations you should use the nsClipboard * and nsDragAndDrop wrappers for more convenience - **/ - + **/ + var nsTransferable = { /** * nsITransferable set (TransferData aTransferData) ; * * Creates a transferable with data for a list of supported types ("flavours") - * + * * @param TransferData aTransferData - * a javascript object in the format described above - **/ + * a javascript object in the format described above + **/ set: function (aTransferDataSet) { var trans = this.createTransferable(); - for (var i = 0; i < aTransferDataSet.dataList.length; ++i) + for (var i = 0; i < aTransferDataSet.dataList.length; ++i) { var currData = aTransferDataSet.dataList[i]; var currFlavour = currData.flavour.contentType; @@ -49,7 +49,7 @@ var nsTransferable = { supports.data = currData.supports; length = supports.data.length; } - else + else { // non-string data. supports = currData.supports; @@ -59,9 +59,9 @@ var nsTransferable = { } return trans; }, - + /** - * TransferData/TransferDataSet get (FlavourSet aFlavourSet, + * TransferData/TransferDataSet get (FlavourSet aFlavourSet, * Function aRetrievalFunc, Boolean aAnyFlag) ; * * Retrieves data from the transferable provided in aRetrievalFunc, formatted @@ -79,13 +79,13 @@ var nsTransferable = { **/ get: function (aFlavourSet, aRetrievalFunc, aAnyFlag) { - if (!aRetrievalFunc) + if (!aRetrievalFunc) throw "No data retrieval handler provided!"; - + var supportsArray = aRetrievalFunc(aFlavourSet); var dataArray = []; var count = supportsArray.Count(); - + // Iterate over the number of items returned from aRetrievalFunc. For // clipboard operations, this is 1, for drag and drop (where multiple // items may have been dragged) this could be >1. @@ -94,19 +94,19 @@ var nsTransferable = { var trans = supportsArray.GetElementAt(i); if (!trans) continue; trans = trans.QueryInterface(Components.interfaces.nsITransferable); - + var data = { }; var length = { }; - + var currData = null; if (aAnyFlag) - { + { var flavour = { }; trans.getAnyTransferData(flavour, data, length); if (data && flavour) { var selectedFlavour = aFlavourSet.flavourTable[flavour.value]; - if (selectedFlavour) + if (selectedFlavour) dataArray[i] = FlavourToXfer(data.value, length.value, selectedFlavour); } } @@ -121,11 +121,11 @@ var nsTransferable = { return new TransferDataSet(dataArray); }, - /** + /** * nsITransferable createTransferable (void) ; * * Creates and returns a transferable object. - **/ + **/ createTransferable: function () { const kXferableContractID = "@mozilla.org/widget/transferable;1"; @@ -134,17 +134,17 @@ var nsTransferable = { trans.init(null); return trans; } -}; +}; -/** +/** * A FlavourSet is a simple type that represents a collection of Flavour objects. * FlavourSet is constructed from an array of Flavours, and stores this list as * an array and a hashtable. The rationale for the dual storage is as follows: - * - * Array: Ordering is important when adding data flavours to a transferable. - * Flavours added first are deemed to be 'preferred' by the client. + * + * Array: Ordering is important when adding data flavours to a transferable. + * Flavours added first are deemed to be 'preferred' by the client. * Hash: Convenient lookup of flavour data using the content type (MIME type) - * of data as a key. + * of data as a key. */ function FlavourSet(aFlavourList) { @@ -152,7 +152,7 @@ function FlavourSet(aFlavourList) this.flavourTable = { }; this._XferID = "FlavourSet"; - + for (var i = 0; i < this.flavours.length; ++i) this.flavourTable[this.flavours[i].contentType] = this.flavours[i]; } @@ -166,13 +166,13 @@ FlavourSet.prototype = { } }; -/** - * A Flavour is a simple type that represents a data type that can be handled. +/** + * A Flavour is a simple type that represents a data type that can be handled. * It takes a content type (MIME type) which is used when storing data on the * system clipboard/drag and drop, and an IIDKey (string interface name * which is used to QI data to an appropriate form. The default interface is * assumed to be wide-string. - */ + */ function Flavour(aContentType, aDataIIDKey) { this.contentType = aContentType; @@ -194,9 +194,9 @@ TransferDataBase.prototype = { } }; -/** +/** * TransferDataSet is a list (array) of TransferData objects, which represents - * data dragged from one or more elements. + * data dragged from one or more elements. */ function TransferDataSet(aTransferDataList) { @@ -206,9 +206,9 @@ function TransferDataSet(aTransferDataList) } TransferDataSet.prototype = TransferDataBase.prototype; -/** +/** * TransferData is a list (array) of FlavourData for all the applicable content - * types associated with a drag from a single item. + * types associated with a drag from a single item. */ function TransferData(aFlavourDataList) { @@ -218,29 +218,29 @@ function TransferData(aFlavourDataList) } TransferData.prototype = { __proto__: TransferDataBase.prototype, - + addDataForFlavour: function (aFlavourString, aData, aLength, aDataIIDKey) { - this.dataList.push(new FlavourData(aData, aLength, + this.dataList.push(new FlavourData(aData, aLength, new Flavour(aFlavourString, aDataIIDKey))); } }; -/** - * FlavourData is a type that represents data retrieved from the system +/** + * FlavourData is a type that represents data retrieved from the system * clipboard or drag and drop. It is constructed internally by the Transferable * using the raw (nsISupports) data from the clipboard, the length of the data, * and an object of type Flavour representing the type. Clients implementing * IDragDropObserver receive an object of this type in their implementation of - * onDrop. They access the 'data' property to retrieve data, which is either data - * QI'ed to a usable form, or unicode string. + * onDrop. They access the 'data' property to retrieve data, which is either data + * QI'ed to a usable form, or unicode string. */ -function FlavourData(aData, aLength, aFlavour) +function FlavourData(aData, aLength, aFlavour) { this.supports = aData; this.contentLength = aLength; this.flavour = aFlavour || null; - + this._XferID = "FlavourData"; } @@ -249,21 +249,21 @@ FlavourData.prototype = { { if (this.flavour && this.flavour.dataIIDKey != "nsISupportsString") - return this.supports.QueryInterface(Components.interfaces[this.flavour.dataIIDKey]); + return this.supports.QueryInterface(Components.interfaces[this.flavour.dataIIDKey]); var supports = this.supports; if (supports instanceof Components.interfaces.nsISupportsString) return supports.data.substring(0, this.contentLength/2); - + return supports; } } -/** - * Create a TransferData object with a single FlavourData entry. Used when - * unwrapping data of a specific flavour from the drag service. +/** + * Create a TransferData object with a single FlavourData entry. Used when + * unwrapping data of a specific flavour from the drag service. */ -function FlavourToXfer(aData, aLength, aFlavour) +function FlavourToXfer(aData, aLength, aFlavour) { return new TransferData([new FlavourData(aData, aLength, aFlavour)]); } @@ -286,42 +286,42 @@ var transferUtils = { .QueryInterface(Components.interfaces.nsIFileProtocolHandler); return fileHandler.getURLSpecFromFile(aData); } - return null; + return null; } } /** * nsDragAndDrop - a convenience wrapper for nsTransferable, nsITransferable - * and nsIDragService/nsIDragSession. + * and nsIDragService/nsIDragSession. * * Use: map the handler functions to the 'ondraggesture', 'ondragover' and - * 'ondragdrop' event handlers on your XML element, e.g. - * - * - * You need to create an observer js object with the following member - * functions: - * Object onDragStart (event) // called when drag initiated, - * // returns flavour list with data - * // to stuff into transferable - * void onDragOver (Object flavour) // called when element is dragged - * // over, so that it can perform + * 'ondragdrop' event handlers on your XML element, e.g. + * + * + * You need to create an observer js object with the following member + * functions: + * Object onDragStart (event) // called when drag initiated, + * // returns flavour list with data + * // to stuff into transferable + * void onDragOver (Object flavour) // called when element is dragged + * // over, so that it can perform * // any drag-over feedback for provided - * // flavour - * void onDrop (Object data) // formatted data object dropped. - * Object getSupportedFlavours () // returns a flavour list so that + * // flavour + * void onDrop (Object data) // formatted data object dropped. + * Object getSupportedFlavours () // returns a flavour list so that * // nsTransferable can determine - * // whether or not to accept drop. - **/ + * // whether or not to accept drop. + **/ var nsDragAndDrop = { - + _mDS: null, get mDragService() { - if (!this._mDS) + if (!this._mDS) { const kDSContractID = "@mozilla.org/widget/dragservice;1"; const kDSIID = Components.interfaces.nsIDragService; @@ -340,7 +340,7 @@ var nsDragAndDrop = { * @param Object aDragDropObserver * javascript object of format described above that specifies * the way in which the element responds to drag events. - **/ + **/ startDrag: function (aEvent, aDragDropObserver) { if (!("onDragStart" in aDragDropObserver)) @@ -350,11 +350,11 @@ var nsDragAndDrop = { var dragAction = { action: kDSIID.DRAGDROP_ACTION_COPY + kDSIID.DRAGDROP_ACTION_MOVE + kDSIID.DRAGDROP_ACTION_LINK }; var transferData = { data: null }; - try + try { aDragDropObserver.onDragStart(aEvent, transferData, dragAction); } - catch (e) + catch (e) { return; // not a draggable item, bail! } @@ -365,10 +365,10 @@ var nsDragAndDrop = { var dt = aEvent.dataTransfer; var count = 0; do { - var tds = transferData._XferID == "TransferData" - ? transferData + var tds = transferData._XferID == "TransferData" + ? transferData : transferData.dataList[count] - for (var i = 0; i < tds.dataList.length; ++i) + for (var i = 0; i < tds.dataList.length; ++i) { var currData = tds.dataList[i]; var currFlavour = currData.flavour.contentType; @@ -380,7 +380,7 @@ var nsDragAndDrop = { count++; } - while (transferData._XferID == "TransferDataSet" && + while (transferData._XferID == "TransferDataSet" && count < transferData.dataList.length); dt.effectAllowed = "all"; @@ -391,7 +391,7 @@ var nsDragAndDrop = { aEvent.stopPropagation(); }, - /** + /** * void dragOver (DOMEvent aEvent, Object aDragDropObserver) ; * * called when a drag passes over this element @@ -403,8 +403,8 @@ var nsDragAndDrop = { * the way in which the element responds to drag events. **/ dragOver: function (aEvent, aDragDropObserver) - { - if (!("onDragOver" in aDragDropObserver)) + { + if (!("onDragOver" in aDragDropObserver)) return; if (!this.checkCanDrop(aEvent, aDragDropObserver)) return; @@ -413,8 +413,8 @@ var nsDragAndDrop = { { if (this.mDragSession.isDataFlavorSupported(flavour)) { - aDragDropObserver.onDragOver(aEvent, - flavourSet.flavourTable[flavour], + aDragDropObserver.onDragOver(aEvent, + flavourSet.flavourTable[flavour], this.mDragSession); aEvent.stopPropagation(); aEvent.preventDefault(); @@ -425,7 +425,7 @@ var nsDragAndDrop = { mDragSession: null, - /** + /** * void drop (DOMEvent aEvent, Object aDragDropObserver) ; * * called when the user drops on the element @@ -441,7 +441,7 @@ var nsDragAndDrop = { if (!("onDrop" in aDragDropObserver)) return; if (!this.checkCanDrop(aEvent, aDragDropObserver)) - return; + return; var flavourSet = aDragDropObserver.getSupportedFlavours(); @@ -478,7 +478,7 @@ var nsDragAndDrop = { aEvent.stopPropagation(); }, - /** + /** * void dragExit (DOMEvent aEvent, Object aDragDropObserver) ; * * called when a drag leaves this element @@ -495,9 +495,9 @@ var nsDragAndDrop = { return; if ("onDragExit" in aDragDropObserver) aDragDropObserver.onDragExit(aEvent, this.mDragSession); - }, - - /** + }, + + /** * void dragEnter (DOMEvent aEvent, Object aDragDropObserver) ; * * called when a drag enters in this element @@ -514,9 +514,9 @@ var nsDragAndDrop = { return; if ("onDragEnter" in aDragDropObserver) aDragDropObserver.onDragEnter(aEvent, this.mDragSession); - }, + }, - /** + /** * Boolean checkCanDrop (DOMEvent aEvent, Object aDragDropObserver) ; * * Sets the canDrop attribute for the drag session. @@ -530,9 +530,9 @@ var nsDragAndDrop = { **/ checkCanDrop: function (aEvent, aDragDropObserver) { - if (!this.mDragSession) + if (!this.mDragSession) this.mDragSession = this.mDragService.getCurrentSession(); - if (!this.mDragSession) + if (!this.mDragSession) return false; this.mDragSession.canDrop = this.mDragSession.sourceNode != aEvent.target; if ("canDrop" in aDragDropObserver) diff --git a/toolkit/content/tests/browser/browser.ini b/toolkit/content/tests/browser/browser.ini index f419ce1c28..ca7894c420 100644 --- a/toolkit/content/tests/browser/browser.ini +++ b/toolkit/content/tests/browser/browser.ini @@ -4,11 +4,9 @@ support-files = file_contentTitle.html audio.ogg [browser_autoscroll_disabled.js] -skip-if = e10s # Bug ?????? - test touches content (getElementById on the content document) [browser_browserDrop.js] skip-if = buildapp == 'mulet' || e10s # Relies on drop to be handled in the parent process [browser_bug295977_autoscroll_overflow.js] -skip-if = e10s # Bug 921935 - focusmanager issues with e10s [browser_bug594509.js] skip-if = e10s # Bug ?????? - intermittent crash of child process reported when run under e10s [browser_bug982298.js] @@ -27,7 +25,6 @@ skip-if = e10s # Bug ?????? - test directly manipulates content (TypeError: doc. support-files = empty.png [browser_keyevents_during_autoscrolling.js] -skip-if = e10s # Bug 921935 - focusmanager issues with e10s [browser_save_resend_postdata.js] support-files = common/mockTransfer.js diff --git a/toolkit/content/tests/browser/browser_autoscroll_disabled.js b/toolkit/content/tests/browser/browser_autoscroll_disabled.js index 507026b092..07c6174abd 100644 --- a/toolkit/content/tests/browser/browser_autoscroll_disabled.js +++ b/toolkit/content/tests/browser/browser_autoscroll_disabled.js @@ -1,75 +1,67 @@ -function test() +add_task(function* () { const kPrefName_AutoScroll = "general.autoScroll"; Services.prefs.setBoolPref(kPrefName_AutoScroll, false); - var doc; - - function startLoad(dataUri) { - gBrowser.selectedBrowser.addEventListener("pageshow", onLoad, false); - gBrowser.loadURI(dataUri); - } - - function onLoad() { - gBrowser.selectedBrowser.removeEventListener("pageshow", onLoad, false); - waitForFocus(onFocus, content); - } - - function onFocus() { - doc = gBrowser.contentDocument; - runChecks(); - } - - function endTest() { - // restore the changed prefs - if (Services.prefs.prefHasUserValue(kPrefName_AutoScroll)) - Services.prefs.clearUserPref(kPrefName_AutoScroll); - - // waitForFocus() fixes a failure in the next test if the latter runs too soon. - waitForFocus(finish); - } - - waitForExplicitFinish(); - let dataUri = 'data:text/html,
    \ \ '; - startLoad(dataUri); - function runChecks() { - var elem = doc.getElementById('i'); - // Skip the first callback as it's the same callback that the browser - // uses to kick off the scrolling. - var skipFrames = 1; - var checkScroll = function () { - if (skipFrames--) { - window.requestAnimationFrame(checkScroll); - return; + let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); + gBrowser.loadURI(dataUri); + yield loadedPromise; + + yield BrowserTestUtils.synthesizeMouse("#i", 50, 50, { button: 1 }, + gBrowser.selectedBrowser); + + yield ContentTask.spawn(gBrowser.selectedBrowser, { }, function* () { + var iframe = content.document.getElementById("iframe"); + + if (iframe) { + var e = new iframe.contentWindow.PageTransitionEvent("pagehide", + { bubbles: true, + cancelable: true, + persisted: false }); + iframe.contentDocument.dispatchEvent(e); + iframe.contentDocument.documentElement.dispatchEvent(e); + } + }); + + yield BrowserTestUtils.synthesizeMouse("#i", 100, 100, + { type: "mousemove", clickCount: "0" }, + gBrowser.selectedBrowser); + + // If scrolling didn't work, we wouldn't do any redraws and thus time out, so + // request and force redraws to get the chance to check for scrolling at all. + yield new Promise(resolve => window.requestAnimationFrame(resolve)); + + let msg = yield ContentTask.spawn(gBrowser.selectedBrowser, { }, function* () { + // Skip the first animation frame callback as it's the same callback that + // the browser uses to kick off the scrolling. + return new Promise(resolve => { + function checkScroll() { + let msg = ""; + let elem = content.document.getElementById('i'); + if (elem.scrollTop != 0) { + msg += "element should not have scrolled vertically"; + } + if (elem.scrollLeft != 0) { + msg += "element should not have scrolled horizontally"; + } + + resolve(msg); } - ok(elem.scrollTop == 0, "element should not have scrolled vertically"); - ok(elem.scrollLeft == 0, "element should not have scrolled horizontally"); - endTest(); - }; - EventUtils.synthesizeMouse(elem, 50, 50, { button: 1 }, - gBrowser.contentWindow); + content.requestAnimationFrame(checkScroll); + }); + }); - var iframe = gBrowser.contentDocument.getElementById("iframe"); - var e = new iframe.contentWindow.PageTransitionEvent("pagehide", - { bubbles: true, - cancelable: true, - persisted: false }); - iframe.contentDocument.dispatchEvent(e); - iframe.contentDocument.documentElement.dispatchEvent(e); + ok(!msg, "element scroll " + msg); - EventUtils.synthesizeMouse(elem, 100, 100, - { type: "mousemove", clickCount: "0" }, - gBrowser.contentWindow); - /* - * if scrolling didn’t work, we wouldn’t do any redraws and thus time out. - * so request and force redraws to get the chance to check for scrolling at - * all. - */ - window.requestAnimationFrame(checkScroll); - } -} + // restore the changed prefs + if (Services.prefs.prefHasUserValue(kPrefName_AutoScroll)) + Services.prefs.clearUserPref(kPrefName_AutoScroll); + + // wait for focus to fix a failure in the next test if the latter runs too soon. + yield SimpleTest.promiseFocus(); +}); diff --git a/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js b/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js index 1685a976f9..e6a9e7f32e 100644 --- a/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js +++ b/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js @@ -1,7 +1,11 @@ -function test() +requestLongerTimeout(2); +add_task(function* () { - const kPrefName_AutoScroll = "general.autoScroll"; - Services.prefs.setBoolPref(kPrefName_AutoScroll, true); + function pushPref(name, value) { + return new Promise(resolve => SpecialPowers.pushPrefEnv({"set": [[name, value]]}, resolve)); + } + + yield pushPref("general.autoScroll", true); const expectScrollNone = 0; const expectScrollVert = 1; @@ -78,24 +82,52 @@ function test() {elem: 's', expected: expectScrollNone, testwindow: true, middlemousepastepref: true} ]; - var doc; - - function nextTest() { - var test = allTests.shift(); - if (!test) { - endTest(); - return; - } - + for (let test of allTests) { if (test.dataUri) { - startLoad(test.dataUri); - return; + let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); + gBrowser.loadURI(test.dataUri); + yield loadedPromise; + continue; + } + + let prefsChanged = (test.middlemousepastepref == false || test.middlemousepastepref == true); + if (prefsChanged) { + yield pushPref("middlemouse.paste", test.middlemousepastepref); } - var elem = doc.getElementById(test.elem); + yield BrowserTestUtils.synthesizeMouse("#" + test.elem, 50, 80, { button: 1 }, + gBrowser.selectedBrowser); + // This ensures bug 605127 is fixed: pagehide in an unrelated document + // should not cancel the autoscroll. + yield ContentTask.spawn(gBrowser.selectedBrowser, { }, function* () { + var iframe = content.document.getElementById("iframe"); + + if (iframe) { + var e = new iframe.contentWindow.PageTransitionEvent("pagehide", + { bubbles: true, + cancelable: true, + persisted: false }); + iframe.contentDocument.dispatchEvent(e); + iframe.contentDocument.documentElement.dispatchEvent(e); + } + }); + + is(document.activeElement, gBrowser.selectedBrowser, "Browser still focused after autoscroll started"); + + yield BrowserTestUtils.synthesizeMouse("#" + test.elem, 100, 100, + { type: "mousemove", clickCount: "0" }, + gBrowser.selectedBrowser); + + if (prefsChanged) { + yield new Promise(resolve => SpecialPowers.popPrefEnv(resolve)); + } + + // Start checking for the scroll. let firstTimestamp = undefined; - function checkScroll(timestamp) { + let timeCompensation; + do { + let timestamp = yield new Promise(resolve => window.requestAnimationFrame(resolve)); if (firstTimestamp === undefined) { firstTimestamp = timestamp; } @@ -104,7 +136,7 @@ function test() // ClickEventHandler.autoscrollLoop, except here it's cumulative across // all frames after the first one instead of being based only on the // current frame. - let timeCompensation = (timestamp - firstTimestamp) / 20; + timeCompensation = (timestamp - firstTimestamp) / 20; info("timestamp=" + timestamp + " firstTimestamp=" + firstTimestamp + " timeCompensation=" + timeCompensation); @@ -116,101 +148,62 @@ function test() // more likely that the accumulated scroll in autoscrollLoop will be >= 1, // although it also depends on acceleration, which here in this test // should be > 1 due to how it synthesizes mouse events below. - if (timeCompensation < 5) { - window.requestAnimationFrame(checkScroll); - return; - } + } while (timeCompensation < 5); - // Close the autoscroll popup by synthesizing Esc. - EventUtils.synthesizeKey("VK_ESCAPE", {}, gBrowser.contentWindow); - var scrollVert = test.expected & expectScrollVert; - var scrollHori = test.expected & expectScrollHori; + // Close the autoscroll popup by synthesizing Esc. + EventUtils.synthesizeKey("VK_ESCAPE", {}); + let scrollVert = test.expected & expectScrollVert; + let scrollHori = test.expected & expectScrollHori; - if (test.testwindow) { - ok((scrollVert && gBrowser.contentWindow.scrollY > 0) || - (!scrollVert && gBrowser.contentWindow.scrollY == 0), - 'Window for '+test.elem+' should'+(scrollVert ? '' : ' not')+' have scrolled vertically'); - ok((scrollHori && gBrowser.contentWindow.scrollX > 0) || - (!scrollHori && gBrowser.contentWindow.scrollX == 0), - 'Window for '+test.elem+' should'+(scrollHori ? '' : ' not')+' have scrolled horizontally'); - } else { - ok((scrollVert && elem.scrollTop > 0) || - (!scrollVert && elem.scrollTop == 0), - test.elem+' should'+(scrollVert ? '' : ' not')+' have scrolled vertically'); - ok((scrollHori && elem.scrollLeft > 0) || - (!scrollHori && elem.scrollLeft == 0), - test.elem+' should'+(scrollHori ? '' : ' not')+' have scrolled horizontally'); - } + let checkScroll = yield ContentTask.spawn(gBrowser.selectedBrowser, + { scrollVert : scrollVert, + scrollHori: scrollHori, + elemid : test.elem, + checkWindow: test.testwindow }, + function* (args) { + let msg = ""; + if (args.checkWindow) { + if (!((args.scrollVert && content.scrollY > 0) || + (!args.scrollVert && content.scrollY == 0))) { + msg += "Failed: "; + } + msg += 'Window for ' + args.elemid + ' should' + (args.scrollVert ? '' : ' not') + ' have scrolled vertically\n'; - // Before continuing the test, we need to ensure that the IPC - // message that stops autoscrolling has had time to arrive. - executeSoon(nextTest); - }; + if (!((args.scrollHori && content.scrollX > 0) || + (!args.scrollHori && content.scrollX == 0))) { + msg += "Failed: "; + } + msg += ' Window for ' + args.elemid + ' should' + (args.scrollHori ? '' : ' not') + ' have scrolled horizontally\n'; + } else { + let elem = content.document.getElementById(args.elemid); + if (!((args.scrollVert && elem.scrollTop > 0) || + (!args.scrollVert && elem.scrollTop == 0))) { + msg += "Failed: "; + } + msg += ' ' + args.elemid + ' should' + (args.scrollVert ? '' : ' not') + ' have scrolled vertically\n'; + if (!((args.scrollHori && elem.scrollLeft > 0) || + (!args.scrollHori && elem.scrollLeft == 0))) { + msg += "Failed: "; + } + msg += args.elemid + ' should' + (args.scrollHori ? '' : ' not') + ' have scrolled horizontally'; + } - if (test.middlemousepastepref == false || test.middlemousepastepref == true) - Services.prefs.setBoolPref("middlemouse.paste", test.middlemousepastepref); + return msg; + } + ); - EventUtils.synthesizeMouse(elem, 50, 50, { button: 1 }, - gBrowser.contentWindow); + ok(checkScroll.indexOf("Failed") == -1, checkScroll) - // This ensures bug 605127 is fixed: pagehide in an unrelated document - // should not cancel the autoscroll. - var iframe = gBrowser.contentDocument.getElementById("iframe"); - - if (iframe) { - var e = new iframe.contentWindow.PageTransitionEvent("pagehide", - { bubbles: true, - cancelable: true, - persisted: false }); - iframe.contentDocument.dispatchEvent(e); - iframe.contentDocument.documentElement.dispatchEvent(e); - } - - EventUtils.synthesizeMouse(elem, 100, 100, - { type: "mousemove", clickCount: "0" }, - gBrowser.contentWindow); - - if (Services.prefs.prefHasUserValue("middlemouse.paste")) - Services.prefs.clearUserPref("middlemouse.paste"); - - // Start checking for the scroll. - window.requestAnimationFrame(checkScroll); + // Before continuing the test, we need to ensure that the IPC + // message that stops autoscrolling has had time to arrive. + yield new Promise(resolve => executeSoon(resolve)); } - waitForExplicitFinish(); - - nextTest(); - - function startLoad(dataUri) { - gBrowser.selectedBrowser.addEventListener("pageshow", onLoad, false); - gBrowser.loadURI(dataUri); + // remove 2 tabs that were opened by middle-click on links + while (gBrowser.visibleTabs.length > 1) { + gBrowser.removeTab(gBrowser.visibleTabs[gBrowser.visibleTabs.length - 1]); } - function onLoad() { - gBrowser.selectedBrowser.removeEventListener("pageshow", onLoad, false); - waitForFocus(onFocus, content); - } - - function onFocus() { - doc = gBrowser.contentDocument; - nextTest(); - } - - function endTest() { - registerCleanupFunction(function() { - // restore the changed prefs - if (Services.prefs.prefHasUserValue(kPrefName_AutoScroll)) - Services.prefs.clearUserPref(kPrefName_AutoScroll); - if (Services.prefs.prefHasUserValue("middlemouse.paste")) - Services.prefs.clearUserPref("middlemouse.paste"); - - // remove 2 tabs that were opened by middle-click on links - while (gBrowser.visibleTabs.length > 1) { - gBrowser.removeTab(gBrowser.visibleTabs[gBrowser.visibleTabs.length - 1]); - } - }); - - // waitForFocus() fixes a failure in the next test if the latter runs too soon. - waitForFocus(finish); - } -} + // wait for focus to fix a failure in the next test if the latter runs too soon. + yield SimpleTest.promiseFocus(); +}); diff --git a/toolkit/content/tests/browser/browser_bug982298.js b/toolkit/content/tests/browser/browser_bug982298.js index 4b4887ef94..409ce85f48 100644 --- a/toolkit/content/tests/browser/browser_bug982298.js +++ b/toolkit/content/tests/browser/browser_bug982298.js @@ -19,7 +19,7 @@ function test() { waitForExplicitFinish(); - tab = gBrowser.addTab("data:text/html;base64," + + tab = gBrowser.addTab("data:text/html;base64," + btoa(scrollHtml)); browser = gBrowser.getBrowserForTab(tab); gBrowser.selectedTab = tab; diff --git a/toolkit/content/tests/browser/browser_f7_caret_browsing.js b/toolkit/content/tests/browser/browser_f7_caret_browsing.js index 8c8773c725..694cef8a00 100644 --- a/toolkit/content/tests/browser/browser_f7_caret_browsing.js +++ b/toolkit/content/tests/browser/browser_f7_caret_browsing.js @@ -265,7 +265,7 @@ add_task(function* toggleCheckboxWantCaretBrowsing() { syncToggleCaretNoDialog(false); syncToggleCaretNoDialog(true); syncToggleCaretNoDialog(false); - + Services.prefs.setBoolPref(kPrefShortcutEnabled, true); Services.prefs.setBoolPref(kPrefWarnOnEnable, true); Services.prefs.setBoolPref(kPrefCaretBrowsingOn, false); diff --git a/toolkit/content/tests/browser/browser_keyevents_during_autoscrolling.js b/toolkit/content/tests/browser/browser_keyevents_during_autoscrolling.js index da92833f15..3fce471141 100644 --- a/toolkit/content/tests/browser/browser_keyevents_during_autoscrolling.js +++ b/toolkit/content/tests/browser/browser_keyevents_during_autoscrolling.js @@ -1,4 +1,4 @@ -function test() +add_task(function * () { const kPrefName_AutoScroll = "general.autoScroll"; Services.prefs.setBoolPref(kPrefName_AutoScroll, true); @@ -21,7 +21,7 @@ function test() { key = aChar; dispatchedKeyEvents = kNoKeyEvents; - EventUtils.sendChar(key, gBrowser.contentWindow); + EventUtils.sendChar(key); is(dispatchedKeyEvents, expectedKeyEvents, "unexpected key events were dispatched or not dispatched: " + key); } @@ -33,17 +33,17 @@ function test() { key = aKey; dispatchedKeyEvents = kNoKeyEvents; - EventUtils.sendKey(key, gBrowser.contentWindow); + EventUtils.sendKey(key); is(dispatchedKeyEvents, expectedKeyEvents, "unexpected key events were dispatched or not dispatched: " + key); } function onKey(aEvent) { - if (aEvent.target != root && aEvent.target != root.ownerDocument.body) { - ok(false, "unknown target: " + aEvent.target.tagName); - return; - } +// if (aEvent.target != root && aEvent.target != root.ownerDocument.body) { +// ok(false, "unknown target: " + aEvent.target.tagName); +// return; +// } var keyFlag; switch (aEvent.type) { @@ -64,67 +64,57 @@ function test() is(keyFlag, expectedKeyEvents & keyFlag, aEvent.type + " fired: " + key); } - waitForExplicitFinish(); - gBrowser.selectedBrowser.addEventListener("pageshow", onLoad, false); var dataUri = 'data:text/html,'; + + let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser); gBrowser.loadURI(dataUri); + yield loadedPromise; - function onLoad() { - gBrowser.selectedBrowser.removeEventListener("pageshow", onLoad, false); - waitForFocus(onFocus, content); - } + yield SimpleTest.promiseFocus(gBrowser.selectedBrowser); - function onFocus() { - var doc = gBrowser.contentDocument; + window.addEventListener("keydown", onKey, false); + window.addEventListener("keypress", onKey, false); + window.addEventListener("keyup", onKey, false); - root = doc.documentElement; - root.addEventListener("keydown", onKey, true); - root.addEventListener("keypress", onKey, true); - root.addEventListener("keyup", onKey, true); + // Test whether the key events are handled correctly under normal condition + expectedKeyEvents = kAllKeyEvents; + sendChar("A"); - // Test whether the key events are handled correctly under normal condition - expectedKeyEvents = kAllKeyEvents; - sendChar("A"); + // Start autoscrolling by middle button click on the page + let shownPromise = BrowserTestUtils.waitForEvent(window, "popupshown", false, + event => event.originalTarget.className == "autoscroller"); + yield BrowserTestUtils.synthesizeMouseAtPoint(10, 10, { button: 1 }, + gBrowser.selectedBrowser); + yield shownPromise; - // Start autoscrolling by middle button lick on the page - EventUtils.synthesizeMouse(root, 10, 10, { button: 1 }, - gBrowser.contentWindow); + // Most key events should be eaten by the browser. + expectedKeyEvents = kNoKeyEvents; + sendChar("A"); + sendKey("DOWN"); + sendKey("RETURN"); + sendKey("RETURN"); + sendKey("HOME"); + sendKey("END"); + sendKey("TAB"); + sendKey("RETURN"); - // Before continuing the test, we need to ensure that the IPC - // message that starts autoscrolling has had time to arrive. - executeSoon(continueTest); - } + // Finish autoscrolling by ESC key. Note that only keydown and keypress + // events are eaten because keyup event is fired *after* the autoscrolling + // is finished. + expectedKeyEvents = kKeyUpEvent; + sendKey("ESCAPE"); - function continueTest() { - // Most key events should be eaten by the browser. - expectedKeyEvents = kNoKeyEvents; - sendChar("A"); - sendKey("DOWN"); - sendKey("RETURN"); - sendKey("RETURN"); - sendKey("HOME"); - sendKey("END"); - sendKey("TAB"); - sendKey("RETURN"); + // Test whether the key events are handled correctly under normal condition + expectedKeyEvents = kAllKeyEvents; + sendChar("A"); - // Finish autoscrolling by ESC key. Note that only keydown and keypress - // events are eaten because keyup event is fired *after* the autoscrolling - // is finished. - expectedKeyEvents = kKeyUpEvent; - sendKey("ESCAPE"); + window.removeEventListener("keydown", onKey, false); + window.removeEventListener("keypress", onKey, false); + window.removeEventListener("keyup", onKey, false); - // Test whether the key events are handled correctly under normal condition - expectedKeyEvents = kAllKeyEvents; - sendChar("A"); + // restore the changed prefs + if (Services.prefs.prefHasUserValue(kPrefName_AutoScroll)) + Services.prefs.clearUserPref(kPrefName_AutoScroll); - root.removeEventListener("keydown", onKey, true); - root.removeEventListener("keypress", onKey, true); - root.removeEventListener("keyup", onKey, true); - - // restore the changed prefs - if (Services.prefs.prefHasUserValue(kPrefName_AutoScroll)) - Services.prefs.clearUserPref(kPrefName_AutoScroll); - - finish(); - } -} + finish(); +}); diff --git a/toolkit/content/tests/chrome/RegisterUnregisterChrome.js b/toolkit/content/tests/chrome/RegisterUnregisterChrome.js index b5eef91e5d..384747216d 100644 --- a/toolkit/content/tests/chrome/RegisterUnregisterChrome.js +++ b/toolkit/content/tests/chrome/RegisterUnregisterChrome.js @@ -58,7 +58,7 @@ function copyDirToTempProfile(path, subdirname) { if (subdirname === undefined) { subdirname = "mochikit-tmp"; } - + let tmpdir = gDirSvc.get("ProfD", Ci.nsIFile); tmpdir.append(subdirname); tmpdir.createUnique(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); @@ -98,7 +98,7 @@ function chromeURIToFile(chromeURI) return convertChromeURI(chromeURI). QueryInterface(Ci.nsIFileURL).file; -} +} // Register a chrome manifest temporarily and return a function which un-does // the registrarion when no longer needed. @@ -154,7 +154,7 @@ function registerManifestTemporarily(manifestURI) function registerManifestPermanently(manifestURI) { var chromepath = chromeURIToFile(manifestURI); - + Components.manager.QueryInterface(Ci.nsIComponentRegistrar). autoRegister(chromepath); return chromepath; diff --git a/toolkit/content/tests/chrome/popup_trigger.js b/toolkit/content/tests/chrome/popup_trigger.js index c9c430e2c7..c532a40833 100644 --- a/toolkit/content/tests/chrome/popup_trigger.js +++ b/toolkit/content/tests/chrome/popup_trigger.js @@ -495,7 +495,7 @@ var popupTests = [ var childframe = document.getElementById("childframe"); if (childframe) { for (var t = 0; t < 2; t++) { - var child = childframe.contentDocument; + var child = childframe.contentDocument; var evt = child.createEvent("Event"); evt.initEvent("click", true, true); child.documentElement.dispatchEvent(evt); diff --git a/toolkit/content/tests/chrome/xul_selectcontrol.js b/toolkit/content/tests/chrome/xul_selectcontrol.js index 2751365c72..d6518c1503 100644 --- a/toolkit/content/tests/chrome/xul_selectcontrol.js +++ b/toolkit/content/tests/chrome/xul_selectcontrol.js @@ -283,7 +283,7 @@ function test_nsIDOMXULSelectControlElement_UI(element, testprefix) synthesizeMouseExpectEvent(seconditem, 2, 2, {}, element, "select", testid + "mouse select 2"); test_nsIDOMXULSelectControlElement_States(element, testid + "mouse select 2", 2, seconditem, 1, "second"); - + // make sure the element is focused so keyboard navigation will apply element.selectedIndex = 1; element.focus(); @@ -345,7 +345,7 @@ function test_nsIDOMXULSelectControlElement_UI(element, testprefix) // now test whether a disabled item works. element.selectedIndex = 0; seconditem.disabled = true; - + var dontSelectDisabled = (behaviourContains(element.localName, "dont-select-disabled")); // 'mouse select' - check if clicking an item selects it diff --git a/toolkit/content/tests/unit/test_contentAreaUtils.js b/toolkit/content/tests/unit/test_contentAreaUtils.js index 76638cc772..9312329fef 100644 --- a/toolkit/content/tests/unit/test_contentAreaUtils.js +++ b/toolkit/content/tests/unit/test_contentAreaUtils.js @@ -44,7 +44,7 @@ function test_urlSecurityCheck() { urlSecurityCheck(CHROME_URI, nullPrincipal, DISALLOW_INHERIT_PRINCIPAL); } - catch(ex) { + catch(ex) { shouldThrow = false; } if (shouldThrow) diff --git a/toolkit/content/tests/widgets/popup_shared.js b/toolkit/content/tests/widgets/popup_shared.js index ec91d88ba4..2b64f43a14 100644 --- a/toolkit/content/tests/widgets/popup_shared.js +++ b/toolkit/content/tests/widgets/popup_shared.js @@ -186,7 +186,7 @@ function checkResult() document.getElementById(test.autohide).hidePopup(); return; } - + goNextStep(); } diff --git a/toolkit/content/tests/widgets/tree_shared.js b/toolkit/content/tests/widgets/tree_shared.js index c0869c91d8..7fbfd67e4f 100644 --- a/toolkit/content/tests/widgets/tree_shared.js +++ b/toolkit/content/tests/widgets/tree_shared.js @@ -43,7 +43,7 @@ function testtag_tree(treeid, treerowinfoid, seltype, columnstype, testid) is(tree.selType, seltype == "multiple" ? "" : seltype, testid + " seltype"); // note: the functions below should be in this order due to changes made in later tests - + // select the first column in cell selection mode so that the selection // functions can be tested if (seltype == "cell") @@ -74,8 +74,8 @@ function testtag_tree(treeid, treerowinfoid, seltype, columnstype, testid) var ecolumn = tree.columns[0]; ok(!tree.startEditing(1, ecolumn), "non-editable trees shouldn't start editing"); is(tree.editingRow, -1, testid + " failed startEditing shouldn't set editingRow"); - is(tree.editingColumn, null, testid + " failed startEditing shouldn't set editingColumn"); - + is(tree.editingColumn, null, testid + " failed startEditing shouldn't set editingColumn"); + tree.editable = true; ok(tree.startEditing(1, ecolumn), "startEditing should have returned true"); @@ -372,7 +372,7 @@ function testtag_tree_TreeSelection_UI(tree, testid, multiple) selection.select(3); synthesizeKeyExpectEvent("VK_DOWN", {}, tree, "!select", "key down with scroll"); is(tree.treeBoxObject.getFirstVisibleRow(), 1, testid + "key down with scroll"); - + // accel key and cursor movement adjust currentIndex but should not change // the selection. In single selection mode, the selection will not change, // but instead will just scroll up or down a line @@ -722,7 +722,7 @@ function testtag_tree_TreeSelection_UI_cell(tree, testid, rowInfo) } tree.focus(); - + // selection is set, so it should move when the left and right cursor keys are pressed tree.treeBoxObject.scrollToRow(0); selection.select(1); diff --git a/toolkit/content/widgets/button.xml b/toolkit/content/widgets/button.xml index 57f9521677..01420ced72 100644 --- a/toolkit/content/widgets/button.xml +++ b/toolkit/content/widgets/button.xml @@ -53,11 +53,11 @@ this.setAttribute("checked", "true"); else this.removeAttribute("checked"); - + return val; ]]> - + - + @@ -102,12 +102,12 @@ this.init(); - + binding must contain an element with anonid=\"button\""; - + var menubuttonParent = this; - btn.addEventListener("mouseover", function() { + btn.addEventListener("mouseover", function() { if (!this.disabled) menubuttonParent.buttonover = true; }, true); @@ -280,15 +280,15 @@ ]]> - + - + - + false @@ -361,7 +361,7 @@ - + @@ -371,5 +371,5 @@ - + diff --git a/toolkit/content/widgets/colorpicker.xml b/toolkit/content/widgets/colorpicker.xml index 121abe4734..0babeb79f2 100644 --- a/toolkit/content/widgets/colorpicker.xml +++ b/toolkit/content/widgets/colorpicker.xml @@ -13,7 +13,7 @@ - + @@ -106,7 +106,7 @@