From b6f6aa65fbf062c2566566f8b158765eb348dbbf Mon Sep 17 00:00:00 2001 From: Roy Tam Date: Sat, 30 May 2020 11:02:53 +0800 Subject: [PATCH] import changes from `dev' branch of rmottola/Arctic-Fox: - Bug 1165518 - Part 2: Replace prlog.h with Logging.h. rs=froydnj (342dfd711) - Bug 1085567 - Fixup synth events within pointer lock implementation for e10s. r=billm (45c50a0e6) - Bug 1128238 - Ajust NPP_SetWindow and synth native event coords to account for the chrome offset of remote tabs. Prior to this the content process always assumed the tab was the window origin. r=aklotz (202ffc006) - Bug 1128934 - Avoid calling GetClientBounds from BasicComposior. r=roc, karlt (5e98232bd) - Bug 1149041 - Make nsIWidget::SizeConstraints use LayoutDeviceIntSize instead of unit-less nsIntSize. r=roc (d0b345926) - shuffle around (fcdc51510) - Bug 1142852 P1 Fix NS_NewNonOwningRunnableMethodWithArgs() so that it compiles. r=froydnj (394d2b200) - Bug 1142852 P2 Make Cache Action use non-threadsafe ref-counting. r=ehsan (0b2b91d86) - Bug 1146349 - Allow NS_NewRunnableMethodWithArgs to take up to 8 arguments. r=froydnj (7207e74d0) - Bug 1146349 - Make the native event synthesization functions in DOMWindowUtils async. r=smaug (e43579a1d) - Bug 949614 - Use === for SimpleTest.is; r=Waldo (9f54faca4) - Bug 1146349 - Update some widget tests to deal with async native key event synthesization. r=smaug,masayuki (f1e82df79) - Bug 920013 - Rewrite test_cocoa_focus.html to use SpecialPowers. r=smichaud (8708d6a71) - Bug 1146349 - Update DOM mochitests to deal with async native event synthesization. r=smaug (a4eceb9f6) - Bug 1146349 - Update browser-chrome mochitests to deal with async native event synthesization. r=Gijs (c864ad939) - Bug 1146349 - Wire up native event synthesization in child processes. r=smaug (e8574457e) - Bug 1146349 - Mark SynthesizedEventObserver::Observe() as override (9063f04b5) - Bug 1149613 - Remove unneded field. r=botond (9aa7155e2) - Bug 1153613 - [e10s], ensure the buffer for the drag image is large enough for SourceSurfaceRawData::GuaranteePersistance() to succeed, r=mattwoodrow (aa885dae7) - remove spurious file (ff199d3ae) - Bug 1043013 - Generalize nsIntRegion into a BaseIntRegion template. r=jrmuizel (9d3e02820) - Bug 1043013 - Introduce IntRegionTyped. r=jrmuizel (f73902921) - Bug 1043013 - Use strongly-typed regions in HitTestingTreeNode. r=kats (7b8c8ae44) - Bug 913443 - Remove mention of the word ThebesLayer in a comment. r=roc (e9706e025) - Bug 913443 - Remove some #ifdefs. r=roc (da76f831b) - Bug 913443 - Break up CreateOrRecyclePaintedLayer into more parts. r=roc (dd94560fe) - Bug 913443 - Extract layer hint calculation. r=roc (5c7806a95) - Bug 913443 - Break CreateOrRecyclePaintedLayer up even more. r=roc (9e5edab17) - Bug 913443 - Remove unused aItemVisibleRect argument. r=roc (f3d1a5195) - Bug 913443 - Move IsWidgetLayerManager() check out of UpdateCommonClipCount. r=roc (3be7b19a6) - Bug 913443 - Change the order of these calls. r=roc (c7bc59fee) - Bug 913443 - Add a display item buffer for PaintedLayerData so that we can assign items without needing to know the actual Layer. r=roc (674df6aa8) - Bug 913443 - Delay PaintedLayer recycling until PopPaintedLayerData() r=roc (9d6de961a) - Bug 913443 - When determining the layer to recycle, only consider layers that have display items in common with the layer we need. r=roc (3327c31c5) - Bug 913443 - Recycle PaintedLayers as soon as possible. r=roc (37ef6d530) - Bug 913443 - Remove duplicated argument variables. r=roc (19c5af270) - Bug 1141408 - Don't include the display item's memory address in the profile label. r=BenWa (5bb1d73c1) - Bug 1141281 - Don't put empty Info: lines into the layers dump. r=BenWa (85f4b28be) - Bug 1035611 - Part 1: Updated Matrix4x4::ProjectRectBounds to properly handle infinite values when untransformed rects cross the w=0 plane. r=mattwoodrow (f47ed4383) - Bug 1035611 - Part 2: Test to ensure that transformed rects crossing the w=0 plane are clipped correctly. r=mattwoodrow (5701b435f) - Bug 1141089 - Add some release assertions to gather more data. r=roc (805c2994d) - Bug 1141595 - Make scroll info display item hoisting work after bug 913443. r=tn (1efcaf164) - Bug 1144307 - Destroy scroll info layer items when we're done with them. r=tn (3ffd3b1f2) - Bug 1148855 - Mark some ContainerState methods as const. r=roc (791585baf) - Bug 1144820 - Use rvalue reference in AddProfileTimelineMarker. r=smaug (12316b65f) - Bug 1148855 - Set overflow:hidden on scrollbar tracks so that layerization knows that the scrollbar thumb won't leave the scrollbar. r=roc (082ec87bf) - Bug 1148855 - Intermediate state that unifies APZ and non-APZ layerization behavior somewhat. (3da45ab96) - Bug 1148855 - Rework how display items are assigned to PaintedLayers and make it work the same way with and without APZ. r=roc (7258f9c90) - Bug 913443 - Add some tests. r=roc (9977682da) - Bug 1039926 - Add a test for not invalidating stuff inside mask layers. (1f8aef65e) - Bug 1148855 - Add some tests. r=roc (2ba1f7f18) - Bug 1148855 - Tweak reftest fuzziness. (a600be7d5) - Bug 1151306 - Add a missing check during background color pulling. r=roc (b3a6c886b) - Bug 1150774 (Part 1) - Add helpers to simplify using typed units in ConfigureLayer. r=botond (baecb2c2e) - Bug 1150774 (Part 2) - Use the correct units in nsDisplayImageContainer::ConfigureLayer and related code. r=botond (a79beb1fb) - Bug 1141089 - Initialize DisplayItemData with a non-null mLayer, so that mLayer is non-null throughout the object's whole lifetime. r=roc (7c2f9eb09) - Bug 1141089 - Remove unused DisplayItemData copy constructor. r=roc (ba5c46c45) - Bug 1141089 - Add a few more MOZ_RELEASE_ASSERT(mLayer) checks, just for fun. r=roc (50a8f2db7) - Bug 1141089 - Use const nsTArray* in all the places where we don't change the array's contents. r=roc (cd07a5bbd) - Bug 1141089 - Turn these two assertions into release assertions. r=roc (71daf5ef3) - Bug 1141089 - Check that we're unsetting sDestroyedFrame correctly. r=roc (6c7da67e7) - Bug 1143522 - Convert Layer::mClipRect to ParentLayerIntRect. r=botond (ddab1c0ff) - Bug 1144951. Warn if the result of ConvertAppUnits is unused. r=mats (e1d79c6ca) - Bug 1144951. Rename ConvertAppUnits to ScaleToOtherAppUnits. r=mats (675c918c3) - Bug 1149035 - Make nsXULPopupManager::PopupResized take a LayoutDeviceIntSize param instead of a unit-less nsIntSize. r=roc (eb9529af7) - missing bit of Bug 1156110 - Make nsView::mWindow an nsCOMPtr; r=roc (972255b4f) - Bug 1147706 - Warn if we don't use the result of const methods on BaseRect and its subclasses. r=tn (9e91deada) - Bug 1152838 - Fix BaseRect::InflateToMultiple and move it to nsIntRect. r=mattwoodrow, r=jrmuizel (5a942df29) - Bug 1125055 - Sync decode layerized images if necessary. r=roc,tn (1379db5c7) - Bug 1145167 - make imgIContainer::type getter infallible; r=seth (7b7091b89) - Bug 1148213 - Implement image locking for VectorImage. r=dholbert (240e14cb3) - Bug 1143653 - Crash in CompositorD3D9 rather than TextureD3D9 if device reset fails, after a few attemps. r=jrmuizel (76607ddc3) - Bug 1147894 - Only use non-null compositors with TextureHost::SetCompositor. r=sotaro (605bf34f6) - Bug 1146912 - Finish replacing TextureHost::GetTextureSource by BindTextureSource. r=sotaro (cf3763879) - Bug 1132854 - Remove useless ThebesIntSize conversion helper. r=Bas (78cdfee14) - Bug 1068881 - Inflate the dest rect to at least one device pixel when computing the optimal image size for drawing. r=roc (3d5644913) --- accessible/tests/mochitest/common.js | 4 +- .../tests/mochitest/events/test_text_alg.html | 4 +- .../tests/mochitest/events/test_tree.xul | 2 +- accessible/tests/mochitest/states.js | 2 +- .../mochitest/table/test_sels_listbox.xul | 6 +- browser/base/content/test/newtab/head.js | 767 +++ caps/tests/mochitest/test_disableScript.xul | 2 +- docshell/base/nsDocShell.cpp | 4 +- docshell/base/nsDocShell.h | 2 +- docshell/test/navigation/test_bug430723.html | 6 +- dom/apps/tests/test_import_export.html | 2 +- dom/apps/tests/test_packaged_app_install.html | 24 +- dom/apps/tests/test_packaged_app_update.html | 4 +- dom/base/Console.cpp | 2 +- dom/base/ThirdPartyUtil.cpp | 2 +- dom/base/nsContentPolicy.cpp | 2 +- dom/base/nsContentSink.h | 2 +- dom/base/nsDOMDataChannel.cpp | 2 +- dom/base/nsDOMWindowUtils.cpp | 66 +- dom/base/nsDocument.cpp | 2 +- dom/base/nsGlobalWindow.cpp | 2 +- dom/base/nsJSEnvironment.cpp | 2 +- dom/base/nsNodeInfoManager.cpp | 2 +- dom/base/nsObjectLoadingContent.cpp | 2 +- dom/base/nsScriptLoader.cpp | 2 +- dom/base/test/csp/test_csp_report.html | 2 +- dom/base/test/file_bug426646-1.html | 4 +- dom/base/test/file_bug426646-2.html | 2 +- dom/base/test/fileutils.js | 2 +- dom/base/test/test_CrossSiteXHR.html | 2 +- dom/base/test/test_XHRSendData.html | 4 +- dom/base/test/test_audioWindowUtils.html | 8 +- dom/base/test/test_bug346485.html | 31 +- dom/base/test/test_bug461555.html | 2 +- dom/base/test/test_bug622088.html | 12 +- dom/base/test/test_domrequesthelper.xul | 10 +- dom/base/test/test_url.html | 2 +- dom/base/test/test_url_empty_port.html | 6 +- .../mochitest/browserElement_PromptCheck.js | 2 +- .../mochitest/browserElement_PromptConfirm.js | 14 +- .../browserElement_ReloadPostRequest.js | 2 +- .../priority/test_ForegroundLRU.html | 4 +- dom/cache/Action.h | 3 +- dom/cache/Manager.cpp | 10 +- dom/camera/CameraCommon.h | 2 +- dom/canvas/CanvasRenderingContext2D.cpp | 4 +- dom/contacts/tests/test_contacts_basics.html | 4 +- dom/contacts/tests/test_contacts_basics2.html | 2 +- dom/events/ContentEventHandler.cpp | 2 +- dom/events/EventListenerManager.cpp | 2 +- dom/events/EventStateManager.cpp | 8 +- dom/events/IMEStateManager.cpp | 2 +- dom/events/test/test_bug689564.html | 2 +- dom/events/test/test_dragstart.html | 6 +- dom/events/test/test_messageEvent.html | 2 +- dom/html/nsHTMLContentSink.cpp | 2 +- dom/html/test/forms/test_change_event.html | 4 +- dom/html/test/forms/test_input_event.html | 4 +- .../forms/test_input_number_key_events.html | 20 +- .../test/forms/test_input_number_l10n.html | 8 +- .../forms/test_input_number_mouse_events.html | 36 +- .../forms/test_input_range_key_events.html | 16 +- ...st_input_range_mouse_and_touch_events.html | 10 +- .../test/forms/test_label_input_controls.html | 8 +- dom/html/test/forms/test_meter_element.html | 6 +- dom/html/test/forms/test_output_element.html | 4 +- .../test/forms/test_progress_element.html | 6 +- dom/html/test/forms/test_step_attribute.html | 72 +- .../forms/test_valueasdate_attribute.html | 12 +- .../forms/test_valueasnumber_attribute.html | 8 +- dom/html/test/test_bug1045270.html | 2 +- dom/html/test/test_bug332893-1.html | 4 +- dom/html/test/test_bug332893-3.html | 4 +- dom/html/test/test_bug332893-4.html | 2 +- dom/html/test/test_bug332893-5.html | 2 +- dom/html/test/test_bug332893-6.html | 2 +- dom/html/test/test_bug332893-7.html | 2 +- dom/html/test/test_bug405242.html | 2 +- dom/html/test/test_bug536891.html | 2 +- dom/html/test/test_bug536895.html | 2 +- dom/html/test/test_bug551846.html | 16 +- dom/html/test/test_bug596350.html | 20 +- dom/html/test/test_documentAll.html | 9 +- dom/indexedDB/IndexedDatabaseManager.cpp | 2 +- dom/indexedDB/ProfilerHelpers.h | 2 +- dom/indexedDB/test/helpers.js | 2 +- dom/indexedDB/test/test_persistenceType.html | 2 +- .../unit/test_deleteDatabase_interactions.js | 2 +- dom/indexedDB/test/unit/test_keys.js | 2 +- dom/indexedDB/test/unit/test_multientry.js | 8 +- .../test/unit/test_persistenceType.js | 2 +- .../test/unit/test_remove_objectStore.js | 2 +- .../test/unit/test_setVersion_abort.js | 1 - .../test/unit/test_setVersion_events.js | 4 +- dom/interfaces/base/nsIDOMWindowUtils.idl | 42 +- dom/ipc/PBrowser.ipdl | 45 + dom/ipc/ProcessPriorityManager.cpp | 2 +- dom/ipc/TabChild.cpp | 8 + dom/ipc/TabChild.h | 2 + dom/ipc/TabParent.cpp | 186 +- dom/ipc/TabParent.h | 37 +- dom/media/AudioStream.cpp | 2 +- dom/media/Latency.cpp | 2 +- dom/media/Latency.h | 2 +- dom/media/MediaCache.cpp | 2 +- dom/media/MediaDecoderStateMachine.cpp | 3 +- dom/media/MediaManager.h | 2 +- dom/media/MediaPromise.h | 2 +- dom/media/MediaShutdownManager.cpp | 2 +- dom/media/MediaStreamGraph.cpp | 2 +- dom/media/StateMirroring.h | 2 +- dom/media/StreamBuffer.cpp | 2 +- dom/media/TrackUnionStream.cpp | 2 +- dom/media/VideoSegment.cpp | 2 +- dom/media/directshow/AudioSinkFilter.cpp | 2 +- dom/media/directshow/AudioSinkInputPin.cpp | 2 +- dom/media/directshow/DirectShowUtils.h | 2 +- dom/media/directshow/SampleSink.cpp | 2 +- dom/media/directshow/SourceFilter.cpp | 2 +- dom/media/encoder/MediaEncoder.cpp | 2 +- dom/media/encoder/TrackEncoder.cpp | 2 +- dom/media/fmp4/MP4Decoder.cpp | 2 +- dom/media/gmp/GMPAudioDecoderParent.cpp | 2 +- dom/media/gmp/GMPContentParent.cpp | 2 +- dom/media/gmp/GMPParent.cpp | 2 +- dom/media/gmp/GMPService.cpp | 2 +- dom/media/gmp/GMPServiceParent.cpp | 2 +- dom/media/gmp/GMPVideoDecoderParent.cpp | 2 +- dom/media/gmp/GMPVideoEncoderParent.cpp | 2 +- dom/media/imagecapture/ImageCapture.h | 2 +- dom/media/mediasource/ContainerParser.cpp | 2 +- dom/media/mediasource/MediaSource.cpp | 2 +- dom/media/mediasource/MediaSourceDecoder.cpp | 2 +- dom/media/mediasource/MediaSourceReader.cpp | 2 +- dom/media/mediasource/MediaSourceResource.h | 2 +- dom/media/mediasource/MediaSourceUtils.cpp | 2 +- dom/media/mediasource/ResourceQueue.cpp | 2 +- dom/media/mediasource/SourceBuffer.cpp | 2 +- dom/media/mediasource/SourceBufferDecoder.cpp | 2 +- dom/media/mediasource/SourceBufferList.cpp | 2 +- .../mediasource/SourceBufferResource.cpp | 2 +- dom/media/mediasource/SourceBufferResource.h | 2 +- dom/media/mediasource/TrackBuffer.cpp | 2 +- dom/media/omx/I420ColorConverterHelper.cpp | 2 +- dom/media/omx/OmxDecoder.cpp | 2 +- dom/media/platforms/apple/AppleATDecoder.cpp | 2 +- .../platforms/apple/AppleDecoderModule.cpp | 2 +- dom/media/platforms/apple/AppleVDADecoder.cpp | 2 +- dom/media/platforms/apple/AppleVTDecoder.cpp | 2 +- dom/media/platforms/ffmpeg/FFmpegLog.cpp | 2 +- .../gonk/GonkAudioDecoderManager.cpp | 2 +- .../platforms/gonk/GonkMediaDataDecoder.cpp | 2 +- .../gonk/GonkVideoDecoderManager.cpp | 2 +- dom/media/platforms/wmf/MFTDecoder.cpp | 2 +- .../platforms/wmf/WMFAudioMFTManager.cpp | 2 +- .../platforms/wmf/WMFMediaDataDecoder.cpp | 2 +- .../platforms/wmf/WMFVideoMFTManager.cpp | 2 +- dom/media/systemservices/LoadManager.cpp | 2 +- dom/media/systemservices/LoadMonitor.cpp | 2 +- dom/media/systemservices/MediaChild.cpp | 2 +- dom/media/systemservices/MediaParent.cpp | 2 +- dom/media/systemservices/OpenSLESProvider.cpp | 2 +- dom/media/test/test_audio2.html | 2 +- dom/media/test/test_preload_attribute.html | 8 +- dom/media/test/test_texttrackcue.html | 2 +- dom/media/tests/mochitest/dataChannel.js | 4 +- dom/media/webspeech/synth/SpeechSynthesis.cpp | 2 +- dom/media/wmf/WMFUtils.cpp | 2 +- dom/plugins/base/nsNPAPIPluginInstance.cpp | 2 +- dom/plugins/base/nsPluginInstanceOwner.cpp | 4 +- dom/plugins/base/nsPluginLogging.h | 2 +- dom/plugins/ipc/PluginMessageUtils.h | 2 +- dom/plugins/test/mochitest/cocoa_focus.html | 49 +- .../test/mochitest/cocoa_window_focus.html | 6 +- .../test/mochitest/test_cocoa_focus.html | 1 + .../mochitest/test_cocoa_window_focus.html | 1 + .../mochitest/test_npruntime_identifiers.html | 8 +- .../mochitest/test_propertyAndMethod.html | 2 +- dom/security/nsCSPContext.cpp | 2 +- dom/security/nsCSPService.cpp | 2 +- dom/security/nsCSPUtils.h | 2 +- dom/security/nsMixedContentBlocker.cpp | 2 +- dom/settings/tests/test_settings_basics.html | 8 +- .../tests/test_settings_onsettingchange.html | 8 +- dom/svg/test/test_scientific.html | 16 +- dom/tests/mochitest/bugs/test_bug346659.html | 10 +- dom/tests/mochitest/bugs/test_bug437361.html | 2 +- dom/tests/mochitest/bugs/test_bug504862.html | 2 +- dom/tests/mochitest/bugs/test_bug531176.html | 4 +- dom/tests/mochitest/bugs/test_bug581072.html | 2 +- dom/tests/mochitest/bugs/test_bug593174.html | 8 +- dom/tests/mochitest/bugs/test_bug862540.html | 2 +- .../mochitest/bugs/test_onerror_message.html | 8 +- .../chrome/test_sandbox_bindings.xul | 5 +- ...torageBasePrivateBrowsing_perwindowpb.html | 4 +- .../localstorage/test_lowDeviceStorage.html | 4 +- .../mochitest/webapps/test_install_app.xul | 4 +- .../mochitest/webapps/test_launch_paths.xul | 4 +- dom/workers/test/test_suspend.html | 4 +- dom/xml/nsXMLContentSink.cpp | 2 +- dom/xslt/base/txLog.h | 2 +- dom/xul/XULDocument.cpp | 2 +- dom/xul/nsXULCommandDispatcher.cpp | 2 +- dom/xul/nsXULContentSink.cpp | 2 +- dom/xul/nsXULElement.cpp | 2 +- dom/xul/templates/nsContentTestNode.cpp | 2 +- dom/xul/templates/nsInstantiationNode.cpp | 2 +- .../templates/nsRDFConInstanceTestNode.cpp | 2 +- dom/xul/templates/nsRDFConMemberTestNode.cpp | 2 +- dom/xul/templates/nsRDFPropertyTestNode.cpp | 2 +- dom/xul/templates/nsRuleNetwork.cpp | 2 +- dom/xul/templates/nsXULContentUtils.cpp | 2 +- dom/xul/templates/nsXULTemplateBuilder.cpp | 2 +- dom/xul/templates/nsXULTemplateBuilder.h | 2 +- .../nsXULTemplateQueryProcessorRDF.h | 2 +- .../tests/chrome/test_sortservice.xul | 22 +- editor/libeditor/tests/test_bug1100966.html | 4 +- extensions/auth/nsAuth.h | 2 +- extensions/auth/nsHttpNegotiateAuth.cpp | 2 +- gfx/2d/BaseRect.h | 24 +- gfx/2d/Logging.h | 2 +- gfx/2d/Matrix.cpp | 77 +- gfx/2d/Matrix.h | 2 +- gfx/2d/NumericTools.h | 37 + gfx/2d/Rect.h | 6 + gfx/2d/moz.build | 1 + gfx/gl/GLTextureImage.cpp | 19 +- gfx/gl/TextureImageEGL.cpp | 6 +- gfx/layers/ImageLayers.cpp | 2 +- gfx/layers/LayerMetricsWrapper.h | 6 +- gfx/layers/LayerTreeInvalidation.cpp | 7 +- gfx/layers/Layers.cpp | 32 +- gfx/layers/Layers.h | 29 +- gfx/layers/LayersLogging.h | 20 + gfx/layers/LayersTypes.h | 2 +- gfx/layers/ReadbackProcessor.cpp | 6 +- gfx/layers/TextureDIB.cpp | 7 +- gfx/layers/TextureDIB.h | 2 +- gfx/layers/apz/src/APZCTreeManager.cpp | 20 +- gfx/layers/apz/src/APZCTreeManager.h | 2 - gfx/layers/apz/src/HitTestingTreeNode.cpp | 2 +- gfx/layers/apz/src/HitTestingTreeNode.h | 4 +- gfx/layers/basic/BasicCompositor.cpp | 11 +- gfx/layers/basic/BasicContainerLayer.cpp | 2 +- gfx/layers/basic/BasicLayerManager.cpp | 10 +- .../basic/MacIOSurfaceTextureHostBasic.h | 5 +- gfx/layers/basic/X11BasicCompositor.cpp | 4 +- .../composite/AsyncCompositionManager.cpp | 21 +- gfx/layers/composite/CanvasLayerComposite.cpp | 2 +- gfx/layers/composite/CompositableHost.cpp | 7 +- .../composite/LayerManagerComposite.cpp | 16 +- gfx/layers/composite/LayerManagerComposite.h | 14 +- .../composite/PaintedLayerComposite.cpp | 2 +- gfx/layers/composite/TextureHost.cpp | 15 +- gfx/layers/composite/TextureHost.h | 33 +- gfx/layers/composite/TiledContentHost.cpp | 2 + gfx/layers/composite/X11TextureHost.h | 5 +- gfx/layers/d3d11/TextureD3D11.cpp | 17 +- gfx/layers/d3d11/TextureD3D11.h | 4 +- gfx/layers/d3d9/CompositorD3D9.cpp | 18 +- gfx/layers/d3d9/CompositorD3D9.h | 3 + gfx/layers/d3d9/DeviceManagerD3D9.cpp | 4 +- gfx/layers/d3d9/TextureD3D9.cpp | 34 +- gfx/layers/d3d9/TextureD3D9.h | 6 +- gfx/layers/ipc/LayerTransactionParent.cpp | 2 +- gfx/layers/ipc/LayersMessages.ipdlh | 3 +- gfx/layers/ipc/ShadowLayerUtilsX11.cpp | 4 +- gfx/layers/ipc/ShadowLayers.cpp | 2 +- gfx/layers/opengl/GrallocTextureHost.cpp | 9 +- gfx/layers/opengl/GrallocTextureHost.h | 2 - .../opengl/MacIOSurfaceTextureHostOGL.h | 5 +- gfx/layers/opengl/TextureHostOGL.cpp | 6 + gfx/layers/opengl/TextureHostOGL.h | 10 +- gfx/src/RegionTyped.h | 54 + gfx/src/moz.build | 4 + gfx/src/nsPoint.h | 11 +- gfx/src/nsRect.h | 79 +- gfx/src/nsRegion.cpp | 21 +- gfx/src/nsRegion.h | 295 +- gfx/src/nsSize.h | 11 +- .../gtest/TestAsyncPanZoomController.cpp | 3 +- gfx/tests/gtest/TestTextures.cpp | 2 +- gfx/thebes/gfx2DGlue.h | 5 - gfx/thebes/gfxAndroidPlatform.cpp | 3 +- gfx/thebes/gfxFT2Fonts.cpp | 2 +- gfx/thebes/gfxFcPlatformFontList.cpp | 2 +- gfx/thebes/gfxFont.cpp | 2 +- gfx/thebes/gfxFontEntry.cpp | 2 +- gfx/thebes/gfxFontUtils.cpp | 2 +- gfx/thebes/gfxGDIFontList.cpp | 2 +- gfx/thebes/gfxMacPlatformFontList.mm | 2 +- gfx/thebes/gfxPlatform.cpp | 2 +- gfx/thebes/gfxPlatform.h | 2 +- gfx/thebes/gfxPlatformFontList.cpp | 2 +- gfx/thebes/gfxPlatformGtk.cpp | 6 +- gfx/thebes/gfxPlatformMac.cpp | 3 +- gfx/thebes/gfxUserFontSet.cpp | 2 +- gfx/thebes/gfxWindowsPlatform.cpp | 8 +- hal/HalLog.h | 2 +- image/ClippedImage.cpp | 9 +- image/ClippedImage.h | 5 +- image/Decoder.cpp | 2 +- image/DynamicImage.cpp | 14 +- image/FrameAnimator.cpp | 4 +- image/FrozenImage.cpp | 9 +- image/FrozenImage.h | 5 +- image/ImageLogging.h | 2 +- image/ImageWrapper.cpp | 13 +- image/OrientedImage.cpp | 10 +- image/OrientedImage.h | 5 +- image/RasterImage.cpp | 104 +- image/RasterImage.h | 15 +- image/VectorImage.cpp | 103 +- image/VectorImage.h | 6 + image/imgFrame.cpp | 6 +- image/imgIContainer.idl | 22 +- ipc/chromium/src/base/logging.h | 2 +- ipc/glue/IPCMessageUtils.h | 8 + js/xpconnect/loader/mozJSComponentLoader.cpp | 2 +- js/xpconnect/src/XPCLog.cpp | 2 +- js/xpconnect/src/XPCLog.h | 2 +- js/xpconnect/tests/chrome/test_bug571849.xul | 11 +- .../chrome/test_localstorage_with_nsEp.xul | 4 +- .../tests/mochitest/test_bug691059.html | 10 +- layout/base/FrameLayerBuilder.cpp | 1937 ++++-- layout/base/FrameLayerBuilder.h | 14 +- layout/base/SelectionCarets.cpp | 2 +- layout/base/TouchCaret.cpp | 2 +- layout/base/UnitTransforms.h | 10 + layout/base/Units.h | 11 + layout/base/nsCSSRendering.cpp | 8 +- layout/base/nsDisplayList.cpp | 51 +- layout/base/nsDisplayList.h | 10 +- layout/base/nsDocumentViewer.cpp | 2 +- layout/base/nsLayoutUtils.cpp | 29 +- layout/base/nsPresShell.cpp | 10 +- layout/base/nsRefreshDriver.cpp | 2 +- layout/base/tests/chrome/test_bug533845.xul | 2 +- layout/base/tests/test_bug435293-skew.html | 2 +- layout/generic/nsContainerFrame.cpp | 12 +- layout/generic/nsFlexContainerFrame.cpp | 2 +- layout/generic/nsFrame.cpp | 6 +- layout/generic/nsFrame.h | 2 +- layout/generic/nsImageFrame.cpp | 69 +- layout/generic/nsImageFrame.h | 5 +- layout/generic/nsPageFrame.cpp | 2 +- layout/generic/nsPluginFrame.cpp | 51 +- layout/generic/nsPluginFrame.h | 8 + layout/generic/nsSimplePageSequenceFrame.cpp | 2 +- layout/generic/nsSubDocumentFrame.cpp | 4 +- layout/printing/nsPrintData.cpp | 2 +- layout/printing/nsPrintEngine.cpp | 2 +- .../invalidation/layer-splitting-1.html | 63 + .../invalidation/layer-splitting-2.html | 63 + .../invalidation/layer-splitting-3.html | 91 + .../invalidation/layer-splitting-4.html | 82 + .../invalidation/layer-splitting-5.html | 105 + .../invalidation/layer-splitting-6.html | 113 + .../invalidation/layer-splitting-7.html | 68 + layout/reftests/invalidation/masklayer-1.html | 55 + layout/reftests/invalidation/masklayer-2.html | 59 + .../paintedlayer-recycling-1.html | 75 + .../paintedlayer-recycling-2.html | 67 + .../paintedlayer-recycling-3.html | 71 + .../paintedlayer-recycling-4.html | 70 + .../paintedlayer-recycling-5.html | 77 + .../paintedlayer-recycling-6.html | 78 + .../paintedlayer-recycling-7.html | 82 + layout/reftests/invalidation/reftest.list | 16 + layout/reftests/layers/pull-background-1.html | 82 + layout/reftests/layers/pull-background-2.html | 88 + layout/reftests/layers/pull-background-3.html | 101 + layout/reftests/layers/pull-background-4.html | 107 + layout/reftests/layers/pull-background-5.html | 92 + layout/reftests/layers/pull-background-6.html | 86 + .../pull-background-animated-position-1.html | 105 + .../pull-background-animated-position-2.html | 120 + .../pull-background-animated-position-3.html | 105 + .../pull-background-animated-position-4.html | 94 + .../pull-background-animated-position-5.html | 105 + .../layers/pull-background-displayport-1.html | 84 + .../layers/pull-background-displayport-2.html | 90 + .../layers/pull-background-displayport-3.html | 104 + .../layers/pull-background-displayport-4.html | 110 + .../layers/pull-background-displayport-5.html | 94 + .../layers/pull-background-displayport-6.html | 84 + layout/reftests/layers/reftest.list | 17 + layout/reftests/svg/reftest.list | 2 +- .../reftests/transform-3d/1035611-1-ref.html | 29 + layout/reftests/transform-3d/1035611-1.html | 38 + layout/reftests/transform-3d/reftest.list | 2 + layout/style/FontFaceSet.cpp | 2 +- layout/style/Loader.cpp | 2 +- layout/style/nsFontFaceLoader.cpp | 2 +- .../test/chrome/test_moz_document_rules.html | 2 +- .../test/test_animations_omta_start.html | 2 +- layout/style/test/test_cascade.html | 2 +- .../test_flexbox_flex_grow_and_shrink.html | 44 +- layout/style/test/test_namespace_rule.html | 4 +- .../style/test/test_of_type_selectors.xhtml | 2 +- layout/style/test/test_selectors.html | 12 +- .../test_selectors_on_anonymous_content.html | 2 +- .../style/test/test_transitions_events.html | 2 +- .../style/test/test_unclosed_parentheses.html | 6 +- layout/xul/nsImageBoxFrame.cpp | 38 +- layout/xul/nsImageBoxFrame.h | 8 +- layout/xul/nsMenuPopupFrame.cpp | 4 +- layout/xul/nsXULPopupManager.cpp | 6 +- layout/xul/nsXULPopupManager.h | 7 +- layout/xul/test/test_bug703150.xul | 2 +- layout/xul/test/test_stack.xul | 6 +- media/libstagefright/binding/MoofParser.cpp | 2 +- media/mtransport/logging.h | 2 +- modules/libjar/nsJAR.h | 2 +- modules/libjar/nsJARChannel.h | 2 +- modules/libjar/nsZipArchive.cpp | 2 +- modules/libpref/prefapi.cpp | 2 +- netwerk/base/BackgroundFileSaver.cpp | 2 +- netwerk/base/Predictor.cpp | 2 +- netwerk/base/nsAsyncRedirectVerifyHelper.cpp | 2 +- netwerk/base/nsAsyncStreamCopier.cpp | 2 +- netwerk/base/nsAutodialWin.cpp | 2 +- netwerk/base/nsChannelClassifier.cpp | 2 +- netwerk/base/nsDirectoryIndexStream.cpp | 2 +- netwerk/base/nsInputStreamPump.cpp | 2 +- netwerk/base/nsLoadGroup.cpp | 2 +- netwerk/base/nsPACMan.h | 2 +- netwerk/base/nsProtocolProxyService.cpp | 2 +- netwerk/base/nsRequestObserverProxy.cpp | 2 +- netwerk/base/nsSocketTransportService2.h | 2 +- netwerk/base/nsStandardURL.cpp | 2 +- netwerk/cache/nsCache.h | 2 +- netwerk/cache2/CacheLog.h | 2 +- netwerk/cookie/nsCookieService.cpp | 2 +- netwerk/dns/GetAddrInfo.cpp | 2 +- netwerk/dns/nsHostResolver.cpp | 2 +- .../protocol/ftp/nsFtpConnectionThread.cpp | 2 +- .../protocol/ftp/nsFtpControlConnection.cpp | 2 +- netwerk/protocol/ftp/nsFtpProtocolHandler.cpp | 2 +- .../rtsp/controller/RtspController.cpp | 2 +- .../rtsp/controller/RtspControllerChild.cpp | 2 +- .../rtsp/controller/RtspControllerParent.cpp | 2 +- .../protocol/rtsp/controller/RtspMetaData.cpp | 2 +- .../rtsp/rtsp/RTSPConnectionHandler.h | 2 +- netwerk/protocol/rtsp/rtsp/RtspPrlog.h | 2 +- netwerk/protocol/websocket/WebSocketLog.h | 2 +- netwerk/protocol/wyciwyg/nsWyciwyg.h | 2 +- netwerk/sctp/datachannel/DataChannelLog.h | 2 +- .../converters/nsFTPDirListingConv.cpp | 2 +- .../linux/nsNotifyAddrListener_Linux.cpp | 2 +- netwerk/system/win32/nsNotifyAddrListener.cpp | 2 +- netwerk/test/TestBlockingSocket.cpp | 2 +- netwerk/test/TestIOThreads.cpp | 2 +- netwerk/test/TestProtocols.cpp | 2 +- netwerk/test/TestServ.cpp | 2 +- netwerk/test/TestSocketTransport.cpp | 2 +- netwerk/test/TestStreamChannel.cpp | 2 +- netwerk/test/TestStreamLoader.cpp | 2 +- netwerk/test/TestStreamPump.cpp | 2 +- netwerk/test/TestStreamTransport.cpp | 2 +- netwerk/test/TestUpload.cpp | 2 +- netwerk/wifi/nsWifiAccessPoint.cpp | 2 +- netwerk/wifi/nsWifiMonitor.h | 2 +- parser/html/nsHtml5NamedCharacters.cpp | 2 +- parser/html/nsHtml5NamedCharacters.h | 2 +- parser/html/nsHtml5NamedCharactersAccel.h | 2 +- rdf/base/nsCompositeDataSource.cpp | 2 +- rdf/base/nsContainerEnumerator.cpp | 2 +- rdf/base/nsInMemoryDataSource.cpp | 2 +- rdf/base/nsRDFContentSink.cpp | 2 +- rdf/base/nsRDFService.cpp | 2 +- rdf/base/nsRDFXMLDataSource.cpp | 2 +- rdf/util/nsRDFResource.cpp | 2 +- security/apps/AppSignatureVerification.cpp | 2 +- security/manager/boot/src/CertBlocklist.cpp | 2 +- .../boot/src/PublicKeyPinningService.cpp | 2 +- .../src/RootCertificateTelemetryUtils.cpp | 2 +- .../manager/boot/src/nsEntropyCollector.cpp | 2 +- .../boot/src/nsSecureBrowserUIImpl.cpp | 2 +- .../boot/src/nsSecurityHeaderParser.cpp | 2 +- .../boot/src/nsSiteSecurityService.cpp | 2 +- .../manager/ssl/src/PSMContentListener.cpp | 2 +- security/manager/ssl/src/nsCertTree.cpp | 2 +- security/manager/ssl/src/nsNSSIOLayer.cpp | 2 +- security/manager/ssl/src/nsNTLMAuthModule.cpp | 2 +- storage/src/VacuumManager.cpp | 2 +- storage/src/mozStorageAsyncStatement.cpp | 2 +- storage/src/mozStorageConnection.cpp | 2 +- storage/src/mozStoragePrivateHelpers.cpp | 2 +- storage/src/mozStorageStatement.cpp | 2 +- testing/mochitest/chrome/test_sample.xul | 2 +- .../tests/Harness_sanity/test_sanity.html | 15 +- .../tests/test_MochiKit-Async.html | 6 +- .../mochitest/tests/SimpleTest/EventUtils.js | 21 +- .../mochitest/tests/SimpleTest/SimpleTest.js | 20 +- .../filewatcher/NativeFileWatcherWin.cpp | 2 +- .../microformats/tests/test_Microformats.html | 10 +- .../tests/test_Microformats_geo.html | 12 +- .../tests/test_Microformats_hCalendar.html | 8 +- .../tests/test_Microformats_hCard.html | 110 +- .../tests/test_Microformats_negative.html | 2 +- .../passwordmgr/test/test_prompt_async.html | 4 +- .../tests/chrome/findbar_events_window.xul | 2 +- .../content/tests/chrome/findbar_window.xul | 12 +- .../content/tests/chrome/test_datepicker.xul | 2 +- toolkit/content/tests/chrome/test_deck.xul | 10 +- .../tests/chrome/test_progressmeter.xul | 4 +- .../tests/chrome/test_textbox_number.xul | 26 +- .../content/tests/chrome/xul_selectcontrol.js | 2 +- .../test_audiocontrols_dimensions.html | 2 +- toolkit/content/xul.css | 8 + toolkit/xre/nsAppRunner.cpp | 2 +- toolkit/xre/nsUpdateDriver.cpp | 2 +- uriloader/base/nsDocLoader.cpp | 2 +- uriloader/base/nsURILoader.h | 2 +- .../exthandler/nsExternalHelperAppService.h | 2 +- .../prefetch/OfflineCacheUpdateChild.cpp | 2 +- uriloader/prefetch/OfflineCacheUpdateGlue.cpp | 2 +- uriloader/prefetch/nsOfflineCacheUpdate.cpp | 2 +- .../prefetch/nsOfflineCacheUpdateService.cpp | 2 +- uriloader/prefetch/nsPrefetchService.cpp | 2 +- view/nsView.cpp | 25 +- view/nsViewManager.cpp | 4 +- widget/PuppetWidget.cpp | 108 + widget/PuppetWidget.h | 35 +- widget/cocoa/NativeKeyBindings.mm | 2 +- widget/cocoa/TextInputHandler.mm | 2 +- widget/cocoa/nsChildView.h | 11 +- widget/cocoa/nsChildView.mm | 11 +- widget/cocoa/nsClipboard.mm | 2 +- widget/cocoa/nsCocoaWindow.h | 3 +- widget/cocoa/nsCocoaWindow.mm | 6 +- widget/cocoa/nsDragService.mm | 2 +- widget/gonk/nsWindow.cpp | 5 +- widget/gonk/nsWindow.h | 3 +- widget/gtk/nsAppShell.cpp | 2 +- widget/gtk/nsDeviceContextSpecG.cpp | 2 +- widget/gtk/nsDragService.cpp | 2 +- widget/gtk/nsGtkIMModule.cpp | 2 +- widget/gtk/nsGtkKeyUtils.cpp | 2 +- widget/gtk/nsIdleServiceGTK.cpp | 2 +- widget/gtk/nsWindow.cpp | 21 +- widget/gtk/nsWindow.h | 14 +- widget/nsBaseWidget.cpp | 33 +- widget/nsBaseWidget.h | 40 +- widget/nsDragServiceProxy.cpp | 14 +- widget/nsIWidget.h | 163 +- widget/nsIdleService.cpp | 2 +- widget/qt/nsAppShell.cpp | 2 +- widget/qt/nsDeviceContextSpecQt.cpp | 2 +- widget/qt/nsWindow.h | 2 +- widget/tests/TestAppShellSteadyState.cpp | 2 +- widget/tests/test_bug428405.xul | 19 +- widget/tests/test_key_event_counts.xul | 29 +- widget/tests/test_keycodes.xul | 5255 +++++++++-------- .../tests/test_native_key_bindings_mac.html | 39 +- widget/tests/test_plugin_input_event.html | 26 +- widget/windows/KeyboardLayout.cpp | 2 +- widget/windows/WinMouseScrollHandler.cpp | 2 +- widget/windows/WinUtils.cpp | 2 +- widget/windows/nsDeviceContextSpecWin.cpp | 2 +- widget/windows/nsIMM32Handler.cpp | 2 +- widget/windows/nsSound.cpp | 2 +- widget/windows/nsTextStore.cpp | 2 +- widget/windows/nsWindow.cpp | 16 +- widget/windows/nsWindow.h | 14 +- widget/windows/nsWindowBase.cpp | 10 +- widget/windows/nsWindowBase.h | 5 +- widget/xremoteclient/XRemoteClient.cpp | 2 +- xpcom/base/nsDebugImpl.cpp | 2 +- xpcom/build/nsXULAppAPI.h | 2 +- xpcom/build/perfprobe.h | 2 +- xpcom/components/nsComponentManager.cpp | 2 +- xpcom/components/nsNativeModuleLoader.cpp | 2 +- xpcom/ds/TimeStamp_windows.cpp | 2 +- xpcom/ds/nsExpirationTracker.h | 2 +- xpcom/ds/nsObserverService.cpp | 2 +- xpcom/ds/nsStaticAtom.h | 2 +- xpcom/glue/BlockingResourceBase.h | 2 +- xpcom/glue/nsStringAPI.h | 2 +- xpcom/glue/nsTextFormatter.cpp | 2 +- xpcom/glue/nsThreadUtils.h | 121 +- xpcom/io/nsInputStreamTee.cpp | 2 +- xpcom/io/nsPipe3.cpp | 2 +- xpcom/io/nsStorageStream.cpp | 2 +- xpcom/string/nsSubstring.cpp | 2 +- xpcom/threads/nsEventQueue.cpp | 2 +- xpcom/threads/nsThread.cpp | 2 +- xpcom/threads/nsThreadPool.cpp | 2 +- xpcom/threads/nsTimerImpl.h | 2 +- 590 files changed, 10629 insertions(+), 4926 deletions(-) create mode 100644 browser/base/content/test/newtab/head.js create mode 100644 gfx/2d/NumericTools.h create mode 100644 gfx/src/RegionTyped.h create mode 100644 layout/reftests/invalidation/layer-splitting-1.html create mode 100644 layout/reftests/invalidation/layer-splitting-2.html create mode 100644 layout/reftests/invalidation/layer-splitting-3.html create mode 100644 layout/reftests/invalidation/layer-splitting-4.html create mode 100644 layout/reftests/invalidation/layer-splitting-5.html create mode 100644 layout/reftests/invalidation/layer-splitting-6.html create mode 100644 layout/reftests/invalidation/layer-splitting-7.html create mode 100644 layout/reftests/invalidation/masklayer-1.html create mode 100644 layout/reftests/invalidation/masklayer-2.html create mode 100644 layout/reftests/invalidation/paintedlayer-recycling-1.html create mode 100644 layout/reftests/invalidation/paintedlayer-recycling-2.html create mode 100644 layout/reftests/invalidation/paintedlayer-recycling-3.html create mode 100644 layout/reftests/invalidation/paintedlayer-recycling-4.html create mode 100644 layout/reftests/invalidation/paintedlayer-recycling-5.html create mode 100644 layout/reftests/invalidation/paintedlayer-recycling-6.html create mode 100644 layout/reftests/invalidation/paintedlayer-recycling-7.html create mode 100644 layout/reftests/layers/pull-background-1.html create mode 100644 layout/reftests/layers/pull-background-2.html create mode 100644 layout/reftests/layers/pull-background-3.html create mode 100644 layout/reftests/layers/pull-background-4.html create mode 100644 layout/reftests/layers/pull-background-5.html create mode 100644 layout/reftests/layers/pull-background-6.html create mode 100644 layout/reftests/layers/pull-background-animated-position-1.html create mode 100644 layout/reftests/layers/pull-background-animated-position-2.html create mode 100644 layout/reftests/layers/pull-background-animated-position-3.html create mode 100644 layout/reftests/layers/pull-background-animated-position-4.html create mode 100644 layout/reftests/layers/pull-background-animated-position-5.html create mode 100644 layout/reftests/layers/pull-background-displayport-1.html create mode 100644 layout/reftests/layers/pull-background-displayport-2.html create mode 100644 layout/reftests/layers/pull-background-displayport-3.html create mode 100644 layout/reftests/layers/pull-background-displayport-4.html create mode 100644 layout/reftests/layers/pull-background-displayport-5.html create mode 100644 layout/reftests/layers/pull-background-displayport-6.html create mode 100644 layout/reftests/transform-3d/1035611-1-ref.html create mode 100644 layout/reftests/transform-3d/1035611-1.html diff --git a/accessible/tests/mochitest/common.js b/accessible/tests/mochitest/common.js index a91b2c93ec..ebc4498564 100644 --- a/accessible/tests/mochitest/common.js +++ b/accessible/tests/mochitest/common.js @@ -424,9 +424,9 @@ function testAccessibleTree(aAccOrElmOrID, aAccTree, aFlags) for (var offset in accTree[prop]) { if (prevOffset !=- 1) { var attrs = accTree[prop][prevOffset]; - testTextAttrs(acc, prevOffset, attrs, { }, prevOffset, offset, true); + testTextAttrs(acc, prevOffset, attrs, { }, prevOffset, +offset, true); } - prevOffset = offset; + prevOffset = +offset; } if (prevOffset != -1) { diff --git a/accessible/tests/mochitest/events/test_text_alg.html b/accessible/tests/mochitest/events/test_text_alg.html index ac77650f6d..97428fb3b0 100644 --- a/accessible/tests/mochitest/events/test_text_alg.html +++ b/accessible/tests/mochitest/events/test_text_alg.html @@ -20,8 +20,8 @@ //////////////////////////////////////////////////////////////////////////// // Invokers - const kRemoval = 0; - const kInsertion = 1; + const kRemoval = false; + const kInsertion = true; const kUnexpected = true; function changeText(aContainerID, aValue, aEventList) diff --git a/accessible/tests/mochitest/events/test_tree.xul b/accessible/tests/mochitest/events/test_tree.xul index f342f325d9..797e7bf97d 100644 --- a/accessible/tests/mochitest/events/test_tree.xul +++ b/accessible/tests/mochitest/events/test_tree.xul @@ -82,7 +82,7 @@ try { var endCol = propBag.getPropertyAsInt32("endcolumn"); } catch (e if e.name == 'NS_ERROR_NOT_AVAILABLE') { - startCol = null; + endCol = null; } is(endCol, aEndCol, "Wrong 'endcolumn' of 'treeInvalidated' event on " + aMsg); diff --git a/accessible/tests/mochitest/states.js b/accessible/tests/mochitest/states.js index 5816addb2c..73ec126e38 100644 --- a/accessible/tests/mochitest/states.js +++ b/accessible/tests/mochitest/states.js @@ -52,7 +52,7 @@ const EXT_STATE_SUPPORTS_AUTOCOMPLETION = nsIAccessibleStates.EXT_STATE_SUPPORTS_AUTOCOMPLETION; const EXT_STATE_VERTICAL = nsIAccessibleStates.EXT_STATE_VERTICAL; -const kOrdinalState = 0; +const kOrdinalState = false; const kExtraState = 1; //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/tests/mochitest/table/test_sels_listbox.xul b/accessible/tests/mochitest/table/test_sels_listbox.xul index 5084fb9586..83697e8d0d 100644 --- a/accessible/tests/mochitest/table/test_sels_listbox.xul +++ b/accessible/tests/mochitest/table/test_sels_listbox.xul @@ -77,7 +77,7 @@ aId + ": wrong number of selected columns"); if (!aSelIndexesArray) { - is(selCols.value, null, + is(selCols.value, undefined, aId + ": no columns should be selected"); } else { for (var i = 0; i < selCols.length; i++) { @@ -116,7 +116,7 @@ aId + ": wrong number of selected rows"); if (!aSelIndexesArray) { - is(selCols.value, null, + is(selCols.value, undefined, aId + ": no row should be selected"); } else { for (var i = 0; i < selCols.length; i++) { @@ -159,7 +159,7 @@ aId + ": wrong number of selected cells"); if (!aSelIndexesArray) { - is(selCols.value, null, + is(selCols.value, undefined, aId + ": no cells should be selected"); } else { for (var i = 0; i < selCols.length; i++) { diff --git a/browser/base/content/test/newtab/head.js b/browser/base/content/test/newtab/head.js new file mode 100644 index 0000000000..a959d1c54e --- /dev/null +++ b/browser/base/content/test/newtab/head.js @@ -0,0 +1,767 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +const PREF_NEWTAB_ENABLED = "browser.newtabpage.enabled"; +const PREF_NEWTAB_DIRECTORYSOURCE = "browser.newtabpage.directory.source"; + +Services.prefs.setBoolPref(PREF_NEWTAB_ENABLED, true); + +let tmp = {}; +Cu.import("resource://gre/modules/Promise.jsm", tmp); +Cu.import("resource://gre/modules/NewTabUtils.jsm", tmp); +Cu.import("resource:///modules/DirectoryLinksProvider.jsm", tmp); +Cu.import("resource://testing-common/PlacesTestUtils.jsm", tmp); +Cc["@mozilla.org/moz/jssubscript-loader;1"] + .getService(Ci.mozIJSSubScriptLoader) + .loadSubScript("chrome://browser/content/sanitize.js", tmp); +Cu.import("resource://gre/modules/Timer.jsm", tmp); +let {Promise, NewTabUtils, Sanitizer, clearTimeout, setTimeout, DirectoryLinksProvider, PlacesTestUtils} = tmp; + +let uri = Services.io.newURI("about:newtab", null, null); +let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(uri); + +let isMac = ("nsILocalFileMac" in Ci); +let isLinux = ("@mozilla.org/gnome-gconf-service;1" in Cc); +let isWindows = ("@mozilla.org/windows-registry-key;1" in Cc); +let gWindow = window; + +// Default to dummy/empty directory links +let gDirectorySource = 'data:application/json,{"test":1}'; +let gOrigDirectorySource; + +// The tests assume all 3 rows and all 3 columns of sites are shown, but the +// window may be too small to actually show everything. Resize it if necessary. +let requiredSize = {}; +requiredSize.innerHeight = + 40 + 32 + // undo container + bottom margin + 44 + 32 + // search bar + bottom margin + (3 * (180 + 32)) + // 3 rows * (tile height + title and bottom margin) + 100; // breathing room +requiredSize.innerWidth = + (3 * (290 + 20)) + // 3 cols * (tile width + side margins) + 100; // breathing room + +let oldSize = {}; +Object.keys(requiredSize).forEach(prop => { + info([prop, gBrowser.contentWindow[prop], requiredSize[prop]]); + if (gBrowser.contentWindow[prop] < requiredSize[prop]) { + oldSize[prop] = gBrowser.contentWindow[prop]; + info("Changing browser " + prop + " from " + oldSize[prop] + " to " + + requiredSize[prop]); + gBrowser.contentWindow[prop] = requiredSize[prop]; + } +}); + +let screenHeight = {}; +let screenWidth = {}; +Cc["@mozilla.org/gfx/screenmanager;1"]. + getService(Ci.nsIScreenManager). + primaryScreen. + GetAvailRectDisplayPix({}, {}, screenWidth, screenHeight); +screenHeight = screenHeight.value; +screenWidth = screenWidth.value; + +if (screenHeight < gBrowser.contentWindow.outerHeight) { + info("Warning: Browser outer height is now " + + gBrowser.contentWindow.outerHeight + ", which is larger than the " + + "available screen height, " + screenHeight + + ". That may cause problems."); +} + +if (screenWidth < gBrowser.contentWindow.outerWidth) { + info("Warning: Browser outer width is now " + + gBrowser.contentWindow.outerWidth + ", which is larger than the " + + "available screen width, " + screenWidth + + ". That may cause problems."); +} + +registerCleanupFunction(function () { + while (gWindow.gBrowser.tabs.length > 1) + gWindow.gBrowser.removeTab(gWindow.gBrowser.tabs[1]); + + Object.keys(oldSize).forEach(prop => { + if (oldSize[prop]) { + gBrowser.contentWindow[prop] = oldSize[prop]; + } + }); + + // Stop any update timers to prevent unexpected updates in later tests + let timer = NewTabUtils.allPages._scheduleUpdateTimeout; + if (timer) { + clearTimeout(timer); + delete NewTabUtils.allPages._scheduleUpdateTimeout; + } + + Services.prefs.clearUserPref(PREF_NEWTAB_ENABLED); + Services.prefs.setCharPref(PREF_NEWTAB_DIRECTORYSOURCE, gOrigDirectorySource); + + return watchLinksChangeOnce(); +}); + +/** + * Resolves promise when directory links are downloaded and written to disk + */ +function watchLinksChangeOnce() { + let deferred = Promise.defer(); + let observer = { + onManyLinksChanged: () => { + DirectoryLinksProvider.removeObserver(observer); + deferred.resolve(); + } + }; + observer.onDownloadFail = observer.onManyLinksChanged; + DirectoryLinksProvider.addObserver(observer); + return deferred.promise; +}; + +/** + * Provide the default test function to start our test runner. + */ +function test() { + waitForExplicitFinish(); + // start TestRunner.run() after directory links is downloaded and written to disk + watchLinksChangeOnce().then(() => { + // Wait for hidden page to update with the desired links + whenPagesUpdated(() => TestRunner.run(), true); + }); + + // Save the original directory source (which is set globally for tests) + gOrigDirectorySource = Services.prefs.getCharPref(PREF_NEWTAB_DIRECTORYSOURCE); + Services.prefs.setCharPref(PREF_NEWTAB_DIRECTORYSOURCE, gDirectorySource); +} + +/** + * The test runner that controls the execution flow of our tests. + */ +let TestRunner = { + /** + * Starts the test runner. + */ + run: function () { + this._iter = runTests(); + this.next(); + }, + + /** + * Runs the next available test or finishes if there's no test left. + */ + next: function () { + try { + TestRunner._iter.next(); + } catch (e if e instanceof StopIteration) { + TestRunner.finish(); + } + }, + + /** + * Finishes all tests and cleans up. + */ + finish: function () { + function cleanupAndFinish() { + PlacesTestUtils.clearHistory().then(() => { + whenPagesUpdated(finish); + NewTabUtils.restore(); + }); + } + + let callbacks = NewTabUtils.links._populateCallbacks; + let numCallbacks = callbacks.length; + + if (numCallbacks) + callbacks.splice(0, numCallbacks, cleanupAndFinish); + else + cleanupAndFinish(); + } +}; + +/** + * Returns the selected tab's content window. + * @return The content window. + */ +function getContentWindow() { + return gWindow.gBrowser.selectedBrowser.contentWindow; +} + +/** + * Returns the selected tab's content document. + * @return The content document. + */ +function getContentDocument() { + return gWindow.gBrowser.selectedBrowser.contentDocument; +} + +/** + * Returns the newtab grid of the selected tab. + * @return The newtab grid. + */ +function getGrid() { + return getContentWindow().gGrid; +} + +/** + * Returns the cell at the given index of the selected tab's newtab grid. + * @param aIndex The cell index. + * @return The newtab cell. + */ +function getCell(aIndex) { + return getGrid().cells[aIndex]; +} + +/** + * Allows to provide a list of links that is used to construct the grid. + * @param aLinksPattern the pattern (see below) + * + * Example: setLinks("-1,0,1,2,3") + * Result: [{url: "http://example.com/", title: "site#-1"}, + * {url: "http://example0.com/", title: "site#0"}, + * {url: "http://example1.com/", title: "site#1"}, + * {url: "http://example2.com/", title: "site#2"}, + * {url: "http://example3.com/", title: "site#3"}] + */ +function setLinks(aLinks, aCallback = TestRunner.next) { + let links = aLinks; + + if (typeof links == "string") { + links = aLinks.split(/\s*,\s*/).map(function (id) { + return {url: "http://example" + (id != "-1" ? id : "") + ".com/", + title: "site#" + id}; + }); + } + + // Call populateCache() once to make sure that all link fetching that is + // currently in progress has ended. We clear the history, fill it with the + // given entries and call populateCache() now again to make sure the cache + // has the desired contents. + NewTabUtils.links.populateCache(function () { + PlacesTestUtils.clearHistory().then(() => { + fillHistory(links, function () { + NewTabUtils.links.populateCache(function () { + NewTabUtils.allPages.update(); + aCallback(); + }, true); + }); + }); + }); +} + +function fillHistory(aLinks, aCallback = TestRunner.next) { + let numLinks = aLinks.length; + if (!numLinks) { + if (aCallback) + executeSoon(aCallback); + return; + } + + let transitionLink = Ci.nsINavHistoryService.TRANSITION_LINK; + + // Important: To avoid test failures due to clock jitter on Windows XP, call + // Date.now() once here, not each time through the loop. + let now = Date.now() * 1000; + + for (let i = 0; i < aLinks.length; i++) { + let link = aLinks[i]; + let place = { + uri: makeURI(link.url), + title: link.title, + // Links are secondarily sorted by visit date descending, so decrease the + // visit date as we progress through the array so that links appear in the + // grid in the order they're present in the array. + visits: [{visitDate: now - i, transitionType: transitionLink}] + }; + + PlacesUtils.asyncHistory.updatePlaces(place, { + handleError: function () ok(false, "couldn't add visit to history"), + handleResult: function () {}, + handleCompletion: function () { + if (--numLinks == 0 && aCallback) + aCallback(); + } + }); + } +} + +/** + * Allows to specify the list of pinned links (that have a fixed position in + * the grid. + * @param aLinksPattern the pattern (see below) + * + * Example: setPinnedLinks("3,,1") + * Result: 'http://example3.com/' is pinned in the first cell. 'http://example1.com/' is + * pinned in the third cell. + */ +function setPinnedLinks(aLinks) { + let links = aLinks; + + if (typeof links == "string") { + links = aLinks.split(/\s*,\s*/).map(function (id) { + if (id) + return {url: "http://example" + (id != "-1" ? id : "") + ".com/", + title: "site#" + id, + type: "history"}; + }); + } + + let string = Cc["@mozilla.org/supports-string;1"] + .createInstance(Ci.nsISupportsString); + string.data = JSON.stringify(links); + Services.prefs.setComplexValue("browser.newtabpage.pinned", + Ci.nsISupportsString, string); + + NewTabUtils.pinnedLinks.resetCache(); + NewTabUtils.allPages.update(); +} + +/** + * Restore the grid state. + */ +function restore() { + whenPagesUpdated(); + NewTabUtils.restore(); +} + +/** + * Wait until a given condition becomes true. + */ +function waitForCondition(aConditionFn, aMaxTries=50, aCheckInterval=100) { + return new Promise((resolve, reject) => { + let tries = 0; + + function tryNow() { + tries++; + + if (aConditionFn()) { + resolve(); + } else if (tries < aMaxTries) { + tryAgain(); + } else { + reject("Condition timed out: " + aConditionFn.toSource()); + } + } + + function tryAgain() { + setTimeout(tryNow, aCheckInterval); + } + + tryAgain(); + }); +} + +/** + * Creates a new tab containing 'about:newtab'. + */ +function addNewTabPageTab() { + addNewTabPageTabPromise().then(TestRunner.next); +} + +function addNewTabPageTabPromise() { + let deferred = Promise.defer(); + + let tab = gWindow.gBrowser.selectedTab = gWindow.gBrowser.addTab("about:newtab"); + let browser = tab.linkedBrowser; + + function whenNewTabLoaded() { + if (NewTabUtils.allPages.enabled) { + // Continue when the link cache has been populated. + NewTabUtils.links.populateCache(function () { + deferred.resolve(whenSearchInitDone()); + }); + } else { + deferred.resolve(); + } + } + + // Wait for the new tab page to be loaded. + waitForBrowserLoad(browser, function () { + // Wait for the document to become visible in case it was preloaded. + waitForCondition(() => !browser.contentDocument.hidden).then(whenNewTabLoaded); + }); + + return deferred.promise; +} + +function waitForBrowserLoad(browser, callback = TestRunner.next) { + if (browser.contentDocument.readyState == "complete") { + executeSoon(callback); + return; + } + + browser.addEventListener("load", function onLoad() { + browser.removeEventListener("load", onLoad, true); + executeSoon(callback); + }, true); +} + +/** + * Compares the current grid arrangement with the given pattern. + * @param the pattern (see below) + * @param the array of sites to compare with (optional) + * + * Example: checkGrid("3p,2,,1p") + * Result: We expect the first cell to contain the pinned site 'http://example3.com/'. + * The second cell contains 'http://example2.com/'. The third cell is empty. + * The fourth cell contains the pinned site 'http://example4.com/'. + */ +function checkGrid(aSitesPattern, aSites) { + let length = aSitesPattern.split(",").length; + let sites = (aSites || getGrid().sites).slice(0, length); + let current = sites.map(function (aSite) { + if (!aSite) + return ""; + + let pinned = aSite.isPinned(); + let hasPinnedAttr = aSite.node.hasAttribute("pinned"); + + if (pinned != hasPinnedAttr) + ok(false, "invalid state (site.isPinned() != site[pinned])"); + + return aSite.url.replace(/^http:\/\/example(\d+)\.com\/$/, "$1") + (pinned ? "p" : ""); + }); + + is(current, aSitesPattern, "grid status = " + aSitesPattern); +} + +/** + * Blocks a site from the grid. + * @param aIndex The cell index. + */ +function blockCell(aIndex) { + whenPagesUpdated(); + getCell(aIndex).site.block(); +} + +/** + * Pins a site on a given position. + * @param aIndex The cell index. + * @param aPinIndex The index the defines where the site should be pinned. + */ +function pinCell(aIndex, aPinIndex) { + getCell(aIndex).site.pin(aPinIndex); +} + +/** + * Unpins the given cell's site. + * @param aIndex The cell index. + */ +function unpinCell(aIndex) { + whenPagesUpdated(); + getCell(aIndex).site.unpin(); +} + +/** + * Simulates a drag and drop operation. + * @param aSourceIndex The cell index containing the dragged site. + * @param aDestIndex The cell index of the drop target. + */ +function simulateDrop(aSourceIndex, aDestIndex) { + let src = getCell(aSourceIndex).site.node; + let dest = getCell(aDestIndex).node; + + // Drop 'src' onto 'dest' and continue testing when all newtab + // pages have been updated (i.e. the drop operation is completed). + startAndCompleteDragOperation(src, dest, whenPagesUpdated); +} + +/** + * Simulates a drag and drop operation. Instead of rearranging a site that is + * is already contained in the newtab grid, this is used to simulate dragging + * an external link onto the grid e.g. the text from the URL bar. + * @param aDestIndex The cell index of the drop target. + */ +function simulateExternalDrop(aDestIndex) { + let dest = getCell(aDestIndex).node; + + // Create an iframe that contains the external link we'll drag. + createExternalDropIframe().then(iframe => { + let link = iframe.contentDocument.getElementById("link"); + + // Drop 'link' onto 'dest'. + startAndCompleteDragOperation(link, dest, () => { + // Wait until the drop operation is complete + // and all newtab pages have been updated. + whenPagesUpdated(() => { + // Clean up and remove the iframe. + iframe.remove(); + // Continue testing. + TestRunner.next(); + }); + }); + }); +} + +/** + * Starts and complete a drag-and-drop operation. + * @param aSource The node that is being dragged. + * @param aDest The node we're dragging aSource onto. + * @param aCallback The function that is called when we're done. + */ +function startAndCompleteDragOperation(aSource, aDest, aCallback) { + // The implementation of this function varies by platform because each + // platform has particular quirks that we need to deal with + + if (isMac) { + // On OS X once the drag starts, Cocoa manages the drag session and + // gives us a limited amount of time to complete the drag operation. In + // some cases as soon as the first mouse-move event is received (the one + // that starts the drag session), Cocoa becomes blind to subsequent mouse + // events and completes the drag session all by itself. Therefore it is + // important that the first mouse-move we send is already positioned at + // the destination. + synthesizeNativeMouseLDown(aSource); + synthesizeNativeMouseDrag(aDest); + // In some tests, aSource and aDest are at the same position, so to ensure + // a drag session is created (instead of it just turning into a click) we + // move the mouse 10 pixels away and then back. + synthesizeNativeMouseDrag(aDest, 10); + synthesizeNativeMouseDrag(aDest); + // Finally, release the drag and have it run the callback when done. + synthesizeNativeMouseLUp(aDest).then(aCallback, Cu.reportError); + } else if (isWindows) { + // on Windows once the drag is initiated, Windows doesn't spin our + // message loop at all, so with async event synthesization the async + // messages never get processed while a drag is in progress. So if + // we did a mousedown followed by a mousemove, we would never be able + // to successfully dispatch the mouseup. Instead, we just skip the move + // entirely, so and just generate the up at the destination. This way + // Windows does the drag and also terminates it right away. Note that + // this only works for tests where aSource and aDest are sufficiently + // far to trigger a drag, otherwise it may just end up doing a click. + synthesizeNativeMouseLDown(aSource); + synthesizeNativeMouseLUp(aDest).then(aCallback, Cu.reportError); + } else if (isLinux) { + // Start by pressing the left mouse button. + synthesizeNativeMouseLDown(aSource); + + // Move the mouse in 5px steps until the drag operation starts. + // Note that we need to do this with pauses in between otherwise the + // synthesized events get coalesced somewhere in the guts of GTK. In order + // to successfully initiate a drag session in the case where aSource and + // aDest are at the same position, we synthesize a bunch of drags until + // we know the drag session has started, and then move to the destination. + let offset = 0; + let interval = setInterval(() => { + synthesizeNativeMouseDrag(aSource, offset += 5); + }, 10); + + // When the drag operation has started we'll move + // the dragged element to its target position. + aSource.addEventListener("dragstart", function onDragStart() { + aSource.removeEventListener("dragstart", onDragStart); + clearInterval(interval); + + // Place the cursor above the drag target. + synthesizeNativeMouseMove(aDest); + }); + + // As soon as the dragged element hovers the target, we'll drop it. + // Note that we need to actually wait for the dragenter event here, because + // the mousemove synthesization is "more async" than the mouseup + // synthesization - they use different gdk APIs. If we don't wait, the + // up could get processed before the moves, dropping the item in the + // wrong position. + aDest.addEventListener("dragenter", function onDragEnter() { + aDest.removeEventListener("dragenter", onDragEnter); + + // Finish the drop operation. + synthesizeNativeMouseLUp(aDest).then(aCallback, Cu.reportError); + }); + } else { + throw "Unsupported platform"; + } +} + +/** + * Helper function that creates a temporary iframe in the about:newtab + * document. This will contain a link we can drag to the test the dropping + * of links from external documents. + */ +function createExternalDropIframe() { + const url = "data:text/html;charset=utf-8," + + "link"; + + let deferred = Promise.defer(); + let doc = getContentDocument(); + let iframe = doc.createElement("iframe"); + iframe.setAttribute("src", url); + iframe.style.width = "50px"; + iframe.style.height = "50px"; + iframe.style.position = "absolute"; + iframe.style.zIndex = 50; + + let margin = doc.getElementById("newtab-margin-top"); + margin.appendChild(iframe); + + iframe.addEventListener("load", function onLoad() { + iframe.removeEventListener("load", onLoad); + executeSoon(() => deferred.resolve(iframe)); + }); + + return deferred.promise; +} + +/** + * Fires a synthetic 'mousedown' event on the current about:newtab page. + * @param aElement The element used to determine the cursor position. + */ +function synthesizeNativeMouseLDown(aElement) { + if (isLinux) { + let win = aElement.ownerDocument.defaultView; + EventUtils.synthesizeMouseAtCenter(aElement, {type: "mousedown"}, win); + } else { + let msg = isWindows ? 2 : 1; + synthesizeNativeMouseEvent(aElement, msg); + } +} + +/** + * Fires a synthetic 'mouseup' event on the current about:newtab page. + * @param aElement The element used to determine the cursor position. + */ +function synthesizeNativeMouseLUp(aElement) { + let msg = isWindows ? 4 : (isMac ? 2 : 7); + return synthesizeNativeMouseEvent(aElement, msg); +} + +/** + * Fires a synthetic mouse drag event on the current about:newtab page. + * @param aElement The element used to determine the cursor position. + * @param aOffsetX The left offset that is added to the position. + */ +function synthesizeNativeMouseDrag(aElement, aOffsetX) { + let msg = isMac ? 6 : 1; + synthesizeNativeMouseEvent(aElement, msg, aOffsetX); +} + +/** + * Fires a synthetic 'mousemove' event on the current about:newtab page. + * @param aElement The element used to determine the cursor position. + */ +function synthesizeNativeMouseMove(aElement) { + let msg = isMac ? 5 : 1; + synthesizeNativeMouseEvent(aElement, msg); +} + +/** + * Fires a synthetic mouse event on the current about:newtab page. + * @param aElement The element used to determine the cursor position. + * @param aOffsetX The left offset that is added to the position (optional). + * @param aOffsetY The top offset that is added to the position (optional). + */ +function synthesizeNativeMouseEvent(aElement, aMsg, aOffsetX = 0, aOffsetY = 0) { + return new Promise((resolve, reject) => { + let rect = aElement.getBoundingClientRect(); + let win = aElement.ownerDocument.defaultView; + let x = aOffsetX + win.mozInnerScreenX + rect.left + rect.width / 2; + let y = aOffsetY + win.mozInnerScreenY + rect.top + rect.height / 2; + + let utils = win.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindowUtils); + + let scale = utils.screenPixelsPerCSSPixel; + let observer = { + observe: function(aSubject, aTopic, aData) { + if (aTopic == "mouseevent") { + resolve(); + } + } + }; + utils.sendNativeMouseEvent(x * scale, y * scale, aMsg, 0, null, observer); + }); +} + +/** + * Sends a custom drag event to a given DOM element. + * @param aEventType The drag event's type. + * @param aTarget The DOM element that the event is dispatched to. + * @param aData The event's drag data (optional). + */ +function sendDragEvent(aEventType, aTarget, aData) { + let event = createDragEvent(aEventType, aData); + let ifaceReq = getContentWindow().QueryInterface(Ci.nsIInterfaceRequestor); + let windowUtils = ifaceReq.getInterface(Ci.nsIDOMWindowUtils); + windowUtils.dispatchDOMEventViaPresShell(aTarget, event, true); +} + +/** + * Creates a custom drag event. + * @param aEventType The drag event's type. + * @param aData The event's drag data (optional). + * @return The drag event. + */ +function createDragEvent(aEventType, aData) { + let dataTransfer = new (getContentWindow()).DataTransfer("dragstart", false); + dataTransfer.mozSetDataAt("text/x-moz-url", aData, 0); + let event = getContentDocument().createEvent("DragEvents"); + event.initDragEvent(aEventType, true, true, getContentWindow(), 0, 0, 0, 0, 0, + false, false, false, false, 0, null, dataTransfer); + + return event; +} + +/** + * Resumes testing when all pages have been updated. + * @param aCallback Called when done. If not specified, TestRunner.next is used. + */ +function whenPagesUpdated(aCallback = TestRunner.next) { + let page = { + observe: _ => _, + + update() { + NewTabUtils.allPages.unregister(this); + executeSoon(aCallback); + } + }; + + NewTabUtils.allPages.register(page); + registerCleanupFunction(function () { + NewTabUtils.allPages.unregister(page); + }); +} + +/** + * Waits for the response to the page's initial search state request. + */ +function whenSearchInitDone() { + let deferred = Promise.defer(); + if (getContentWindow().gSearch._initialStateReceived) { + return Promise.resolve(); + } + let eventName = "ContentSearchService"; + getContentWindow().addEventListener(eventName, function onEvent(event) { + if (event.detail.type == "State") { + getContentWindow().removeEventListener(eventName, onEvent); + deferred.resolve(); + } + }); + return deferred.promise; +} + +/** + * Changes the newtab customization option and waits for the panel to open and close + * + * @param {string} aTheme + * Can be any of("blank"|"classic"|"enhanced") + */ +function customizeNewTabPage(aTheme) { + let document = getContentDocument(); + let panel = document.getElementById("newtab-customize-panel"); + let customizeButton = document.getElementById("newtab-customize-button"); + + // Attache onShown the listener on panel + panel.addEventListener("popupshown", function onShown() { + panel.removeEventListener("popupshown", onShown); + + // Get the element for the specific option and click on it, + // then trigger an escape to close the panel + document.getElementById("newtab-customize-" + aTheme).click(); + executeSoon(() => { panel.hidePopup(); }); + }); + + // Attache the listener for panel closing, this will resolve the promise + panel.addEventListener("popuphidden", function onHidden() { + panel.removeEventListener("popuphidden", onHidden); + executeSoon(TestRunner.next); + }); + + // Click on the customize button to display the panel + customizeButton.click(); +} diff --git a/caps/tests/mochitest/test_disableScript.xul b/caps/tests/mochitest/test_disableScript.xul index fe9dc11047..cef5f401a2 100644 --- a/caps/tests/mochitest/test_disableScript.xul +++ b/caps/tests/mochitest/test_disableScript.xul @@ -77,7 +77,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840488 // We need to append 'name' to avoid running afoul of recursive frame detection. let frameURI = uri + "?name=" + name; navigateFrame(ifr, frameURI).then(function() { - is(ifr.contentWindow.location, frameURI, "Successful load"); + is(String(ifr.contentWindow.location), frameURI, "Successful load"); is(!!ifr.contentWindow.wrappedJSObject.gFiredOnload, expectOnload, "onload should only fire when scripts are enabled"); deferred.resolve(); diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index cec73f91eb..a26a30452a 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -151,7 +151,7 @@ #include "nsIJARChannel.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsISelectionDisplay.h" @@ -3125,7 +3125,7 @@ nsDocShell::AddProfileTimelineMarker(const char* aName, } void -nsDocShell::AddProfileTimelineMarker(UniquePtr& aMarker) +nsDocShell::AddProfileTimelineMarker(UniquePtr&& aMarker) { if (mProfileTimelineRecording) { mProfileTimelineMarkers.AppendElement(aMarker.release()); diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index aed769919e..18a084e9f7 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -276,7 +276,7 @@ public: // See nsIDocShell::recordProfileTimelineMarkers void AddProfileTimelineMarker(const char* aName, TracingMetadata aMetaData); - void AddProfileTimelineMarker(mozilla::UniquePtr& aMarker); + void AddProfileTimelineMarker(mozilla::UniquePtr&& aMarker); // Global counter for how many docShells are currently recording profile // timeline markers diff --git a/docshell/test/navigation/test_bug430723.html b/docshell/test/navigation/test_bug430723.html index 55dd9f13c6..eb53e0d220 100644 --- a/docshell/test/navigation/test_bug430723.html +++ b/docshell/test/navigation/test_bug430723.html @@ -59,7 +59,7 @@ var nextTest =function() { } var step1 =function() { - window.is(testWindow.location, gTallRedBoxURI, "Ensure red page loaded."); + window.is(String(testWindow.location), gTallRedBoxURI, "Ensure red page loaded."); // Navigate down and up. is(testWindow.document.body.scrollTop, 0, @@ -87,7 +87,7 @@ var step1 =function() { var step2 =function() { - window.is(testWindow.location, gTallBlueBoxURI, "Ensure blue page loaded."); + window.is(String(testWindow.location), gTallBlueBoxURI, "Ensure blue page loaded."); // Scroll around a bit. is(testWindow.document.body.scrollTop, 0, @@ -111,7 +111,7 @@ var step2 =function() { } var step3 =function() { - window.is(testWindow.location, gTallRedBoxURI, + window.is(String(testWindow.location), gTallRedBoxURI, "Ensure red page restored from history."); // Check we can still scroll with the keys. diff --git a/dom/apps/tests/test_import_export.html b/dom/apps/tests/test_import_export.html index 524eda9462..f7b08fd02b 100644 --- a/dom/apps/tests/test_import_export.html +++ b/dom/apps/tests/test_import_export.html @@ -229,7 +229,7 @@ function runTest() { size: 0, readyToApplyDownload: false }; - PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, 2, expected, + PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, "2", expected, true, false, continueTest); }; }; diff --git a/dom/apps/tests/test_packaged_app_install.html b/dom/apps/tests/test_packaged_app_install.html index 6f3d791821..4cbff025b9 100644 --- a/dom/apps/tests/test_packaged_app_install.html +++ b/dom/apps/tests/test_packaged_app_install.html @@ -58,24 +58,6 @@ function checkUninstallApp(aApp) { }; } -function checkInstalledApp(aMiniManifestURL, - aVersion, - aExpectedApp, - aLaunchable, - aCb) { - var req = navigator.mozApps.checkInstalled(aMiniManifestURL); - req.onsuccess = function(evt) { - ok(req.result, "The app is installed"); - - if (!req.result) { - PackagedTestHelper.finish(); - } - - PackagedTestHelper.checkAppState(evt.application, aVersion, aExpectedApp, - aLaunchable, false, aCb); - }; -} - var gIconData = "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A\x00\x00\x00\x0D\x49\x48\x44\x52" + "\x00\x00\x00\x0F\x00\x00\x00\x0F\x08\x03\x00\x00\x00\x0C\x08\x65" + @@ -240,7 +222,7 @@ var steps = [ size: 0, readyToApplyDownload: false }; - PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, 2, expected, + PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, "2", expected, true, false, PackagedTestHelper.next); }; }; @@ -327,7 +309,7 @@ var steps = [ size: 0, readyToApplyDownload: alreadyCanceled }; - PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, 3, expected, + PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, "3", expected, true, false, function() {}); }; @@ -345,7 +327,7 @@ var steps = [ size: 0, readyToApplyDownload: false }; - PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, 3, expected, + PackagedTestHelper.checkAppState(PackagedTestHelper.gApp, "3", expected, true, false, PackagedTestHelper.next); } diff --git a/dom/apps/tests/test_packaged_app_update.html b/dom/apps/tests/test_packaged_app_update.html index 858c7f8d6b..8dc18c56c3 100644 --- a/dom/apps/tests/test_packaged_app_update.html +++ b/dom/apps/tests/test_packaged_app_update.html @@ -172,7 +172,7 @@ var steps = [ }; PackagedTestHelper.gApp.ondownloadsuccess = checkLastAppState.bind(undefined, miniManifestURL, false, false, - 2, PackagedTestHelper.next); + "2", PackagedTestHelper.next); }; var request = navigator.mozApps.installPackage(miniManifestURL); @@ -231,7 +231,7 @@ var steps = [ }, function() { info("== TEST == Update packaged app"); - updateApp(true, 2, 3); + updateApp(true, "2", "3"); }, function() { info("== TEST == Check that saved permissions were kept"); diff --git a/dom/base/Console.cpp b/dom/base/Console.cpp index 89502d9301..c0f3630ca5 100644 --- a/dom/base/Console.cpp +++ b/dom/base/Console.cpp @@ -1057,7 +1057,7 @@ Console::Method(JSContext* aCx, MethodName aMethodName, MakeUnique(docShell, aMethodName == MethodTime ? TRACING_INTERVAL_START : TRACING_INTERVAL_END, key); - docShell->AddProfileTimelineMarker(marker); + docShell->AddProfileTimelineMarker(Move(marker)); } } } diff --git a/dom/base/ThirdPartyUtil.cpp b/dom/base/ThirdPartyUtil.cpp index f52834f005..034f791114 100644 --- a/dom/base/ThirdPartyUtil.cpp +++ b/dom/base/ThirdPartyUtil.cpp @@ -15,7 +15,7 @@ #include "nsIScriptObjectPrincipal.h" #include "nsIURI.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" NS_IMPL_ISUPPORTS(ThirdPartyUtil, mozIThirdPartyUtil) diff --git a/dom/base/nsContentPolicy.cpp b/dom/base/nsContentPolicy.cpp index eeaa154602..6b61b14d15 100644 --- a/dom/base/nsContentPolicy.cpp +++ b/dom/base/nsContentPolicy.cpp @@ -8,7 +8,7 @@ * Implementation of the "@mozilla.org/layout/content-policy;1" contract. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsISupports.h" #include "nsXPCOM.h" diff --git a/dom/base/nsContentSink.h b/dom/base/nsContentSink.h index d56b174288..327990e0eb 100644 --- a/dom/base/nsContentSink.h +++ b/dom/base/nsContentSink.h @@ -23,7 +23,7 @@ #include "nsITimer.h" #include "nsStubDocumentObserver.h" #include "nsIContentSink.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsCycleCollectionParticipant.h" #include "nsThreadUtils.h" diff --git a/dom/base/nsDOMDataChannel.cpp b/dom/base/nsDOMDataChannel.cpp index 4159b579db..c3fb62f58c 100644 --- a/dom/base/nsDOMDataChannel.cpp +++ b/dom/base/nsDOMDataChannel.cpp @@ -7,7 +7,7 @@ #include "nsDOMDataChannel.h" #include "base/basictypes.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* GetDataChannelLog(); #undef LOG diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 239c4c1707..78b5d2273c 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -1301,7 +1301,8 @@ nsDOMWindowUtils::SendNativeKeyEvent(int32_t aNativeKeyboardLayout, int32_t aNativeKeyCode, int32_t aModifiers, const nsAString& aCharacters, - const nsAString& aUnmodifiedCharacters) + const nsAString& aUnmodifiedCharacters, + nsIObserver* aObserver) { MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome()); @@ -1310,8 +1311,11 @@ nsDOMWindowUtils::SendNativeKeyEvent(int32_t aNativeKeyboardLayout, if (!widget) return NS_ERROR_FAILURE; - return widget->SynthesizeNativeKeyEvent(aNativeKeyboardLayout, aNativeKeyCode, - aModifiers, aCharacters, aUnmodifiedCharacters); + NS_DispatchToMainThread(NS_NewRunnableMethodWithArgs + + (widget, &nsIWidget::SynthesizeNativeKeyEvent, aNativeKeyboardLayout, + aNativeKeyCode, aModifiers, aCharacters, aUnmodifiedCharacters, aObserver)); + return NS_OK; } NS_IMETHODIMP @@ -1319,7 +1323,8 @@ nsDOMWindowUtils::SendNativeMouseEvent(int32_t aScreenX, int32_t aScreenY, int32_t aNativeMessage, int32_t aModifierFlags, - nsIDOMElement* aElement) + nsIDOMElement* aElement, + nsIObserver* aObserver) { MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome()); @@ -1328,8 +1333,12 @@ nsDOMWindowUtils::SendNativeMouseEvent(int32_t aScreenX, if (!widget) return NS_ERROR_FAILURE; - return widget->SynthesizeNativeMouseEvent(LayoutDeviceIntPoint(aScreenX, aScreenY), - aNativeMessage, aModifierFlags); + NS_DispatchToMainThread(NS_NewRunnableMethodWithArgs + + (widget, &nsIWidget::SynthesizeNativeMouseEvent, + LayoutDeviceIntPoint(aScreenX, aScreenY), aNativeMessage, aModifierFlags, + aObserver)); + return NS_OK; } NS_IMETHODIMP @@ -1341,7 +1350,8 @@ nsDOMWindowUtils::SendNativeMouseScrollEvent(int32_t aScreenX, double aDeltaZ, uint32_t aModifierFlags, uint32_t aAdditionalFlags, - nsIDOMElement* aElement) + nsIDOMElement* aElement, + nsIObserver* aObserver) { MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome()); @@ -1351,12 +1361,12 @@ nsDOMWindowUtils::SendNativeMouseScrollEvent(int32_t aScreenX, return NS_ERROR_FAILURE; } - return widget->SynthesizeNativeMouseScrollEvent(LayoutDeviceIntPoint(aScreenX, - aScreenY), - aNativeMessage, - aDeltaX, aDeltaY, aDeltaZ, - aModifierFlags, - aAdditionalFlags); + NS_DispatchToMainThread(NS_NewRunnableMethodWithArgs + + (widget, &nsIWidget::SynthesizeNativeMouseScrollEvent, + LayoutDeviceIntPoint(aScreenX, aScreenY), aNativeMessage, aDeltaX, aDeltaY, + aDeltaZ, aModifierFlags, aAdditionalFlags, aObserver)); + return NS_OK; } NS_IMETHODIMP @@ -1365,7 +1375,8 @@ nsDOMWindowUtils::SendNativeTouchPoint(uint32_t aPointerId, int32_t aScreenX, int32_t aScreenY, double aPressure, - uint32_t aOrientation) + uint32_t aOrientation, + nsIObserver* aObserver) { MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome()); @@ -1378,16 +1389,19 @@ nsDOMWindowUtils::SendNativeTouchPoint(uint32_t aPointerId, return NS_ERROR_INVALID_ARG; } - return widget->SynthesizeNativeTouchPoint(aPointerId, - (nsIWidget::TouchPointerState)aTouchState, - nsIntPoint(aScreenX, aScreenY), - aPressure, aOrientation); + NS_DispatchToMainThread(NS_NewRunnableMethodWithArgs + + (widget, &nsIWidget::SynthesizeNativeTouchPoint, aPointerId, + (nsIWidget::TouchPointerState)aTouchState, nsIntPoint(aScreenX, aScreenY), + aPressure, aOrientation, aObserver)); + return NS_OK; } NS_IMETHODIMP nsDOMWindowUtils::SendNativeTouchTap(int32_t aScreenX, int32_t aScreenY, - bool aLongTap) + bool aLongTap, + nsIObserver* aObserver) { MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome()); @@ -1395,11 +1409,16 @@ nsDOMWindowUtils::SendNativeTouchTap(int32_t aScreenX, if (!widget) { return NS_ERROR_FAILURE; } - return widget->SynthesizeNativeTouchTap(nsIntPoint(aScreenX, aScreenY), aLongTap); + + NS_DispatchToMainThread(NS_NewRunnableMethodWithArgs + + (widget, &nsIWidget::SynthesizeNativeTouchTap, + nsIntPoint(aScreenX, aScreenY), aLongTap, aObserver)); + return NS_OK; } NS_IMETHODIMP -nsDOMWindowUtils::ClearNativeTouchSequence() +nsDOMWindowUtils::ClearNativeTouchSequence(nsIObserver* aObserver) { MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome()); @@ -1407,7 +1426,10 @@ nsDOMWindowUtils::ClearNativeTouchSequence() if (!widget) { return NS_ERROR_FAILURE; } - return widget->ClearNativeTouchSequence(); + + NS_DispatchToMainThread(NS_NewRunnableMethodWithArgs + (widget, &nsIWidget::ClearNativeTouchSequence, aObserver)); + return NS_OK; } NS_IMETHODIMP diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index f2cddaf15d..105ea094f6 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -18,7 +18,7 @@ #include "mozilla/Likely.h" #include -#include "prlog.h" +#include "mozilla/Logging.h" #include "plstr.h" #include "prprf.h" diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 8d97fe5e4e..295c847a6d 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -176,7 +176,7 @@ #include "nsFrameLoader.h" #include "nsISupportsPrimitives.h" #include "nsXPCOMCID.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prenv.h" #include "prprf.h" diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index a0b110b614..237f41eb0b 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -77,7 +77,7 @@ #endif #include "AccessCheck.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prthread.h" #include "mozilla/Preferences.h" diff --git a/dom/base/nsNodeInfoManager.cpp b/dom/base/nsNodeInfoManager.cpp index 324e9a22f4..0c6d7d48e6 100644 --- a/dom/base/nsNodeInfoManager.cpp +++ b/dom/base/nsNodeInfoManager.cpp @@ -33,7 +33,7 @@ using namespace mozilla; using mozilla::dom::NodeInfo; -#include "prlog.h" +#include "mozilla/Logging.h" static PRLogModuleInfo* gNodeInfoManagerLeakPRLog; diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp index b870bb9bee..0a0fe4b1e6 100644 --- a/dom/base/nsObjectLoadingContent.cpp +++ b/dom/base/nsObjectLoadingContent.cpp @@ -44,7 +44,7 @@ // Util headers #include "prenv.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsAutoPtr.h" #include "nsCURILoader.h" diff --git a/dom/base/nsScriptLoader.cpp b/dom/base/nsScriptLoader.cpp index fb7a94419e..0fdb6d4c47 100644 --- a/dom/base/nsScriptLoader.cpp +++ b/dom/base/nsScriptLoader.cpp @@ -40,7 +40,7 @@ #include "nsThreadUtils.h" #include "nsDocShellCID.h" #include "nsIContentSecurityPolicy.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsCRT.h" #include "nsContentCreatorFunctions.h" #include "nsCORSListenerProxy.h" diff --git a/dom/base/test/csp/test_csp_report.html b/dom/base/test/csp/test_csp_report.html index bb3acaee5f..72805d4c75 100644 --- a/dom/base/test/csp/test_csp_report.html +++ b/dom/base/test/csp/test_csp_report.html @@ -60,7 +60,7 @@ window.checkResults = function(reportObj) { is(cspReport["script-sample"], "\n var foo = \"propEscFoo\";\n var bar...", "Incorrect script-sample"); - is(cspReport["line-number"], "7", "Incorrect line-number"); + is(cspReport["line-number"], 7, "Incorrect line-number"); } // This is used to watch requests go out so we can see if the report is diff --git a/dom/base/test/file_bug426646-1.html b/dom/base/test/file_bug426646-1.html index dbb589d008..db07734412 100644 --- a/dom/base/test/file_bug426646-1.html +++ b/dom/base/test/file_bug426646-1.html @@ -25,8 +25,8 @@ function doe3() { } function doe4() { - opener.is(window.frames[0].location, url1, "History.go(-1) didn't work?"); - opener.is(window.frames[1].location, "about:blank", + opener.is(String(window.frames[0].location), url1, "History.go(-1) didn't work?"); + opener.is(String(window.frames[1].location), "about:blank", "History.go(-1) didn't work?"); close(); } diff --git a/dom/base/test/file_bug426646-2.html b/dom/base/test/file_bug426646-2.html index e149a2280a..1f8fae950c 100644 --- a/dom/base/test/file_bug426646-2.html +++ b/dom/base/test/file_bug426646-2.html @@ -55,7 +55,7 @@ function doe4() { } function doe5() { - opener.is(win0.location, url1, "History.go(-1) didn't work?"); + opener.is(String(win0.location), url1, "History.go(-1) didn't work?"); close(); } diff --git a/dom/base/test/fileutils.js b/dom/base/test/fileutils.js index cf2476528d..ecfc801b86 100644 --- a/dom/base/test/fileutils.js +++ b/dom/base/test/fileutils.js @@ -55,7 +55,7 @@ function testFile(file, contents, test) { file.type ? file.type : null, "request content-type in XMLHttpRequest send of " + test); is(event.target.getResponseHeader("Result-Content-Length"), - file.size, + String(file.size), "request content-length in XMLHttpRequest send of " + test); }; xhr.addEventListener("load", diff --git a/dom/base/test/test_CrossSiteXHR.html b/dom/base/test/test_CrossSiteXHR.html index c9e6386189..d80d078f98 100644 --- a/dom/base/test/test_CrossSiteXHR.html +++ b/dom/base/test/test_CrossSiteXHR.html @@ -694,7 +694,7 @@ function runTest() { is(res.responseHeaders[header], null, "|xhr.getResponseHeader()|wrong response header (" + header + ") in test for " + test.toSource()); - is(res.allResponseHeaders[header], null, + is(res.allResponseHeaders[header], undefined, "|xhr.getAllResponseHeaderss()|wrong response header (" + header + ") in test for " + test.toSource()); } diff --git a/dom/base/test/test_XHRSendData.html b/dom/base/test/test_XHRSendData.html index b65dfb5a4e..fce8d56982 100644 --- a/dom/base/test/test_XHRSendData.html +++ b/dom/base/test/test_XHRSendData.html @@ -232,7 +232,9 @@ try { } if (test.resContentLength) { - is(xhr.getResponseHeader("Result-Content-Length"), test.resContentLength, "Wrong Content-Length sent"); + is(xhr.getResponseHeader("Result-Content-Length"), + String(test.resContentLength), + "Wrong Content-Length sent"); } if (test.resType == "arraybuffer") { diff --git a/dom/base/test/test_audioWindowUtils.html b/dom/base/test/test_audioWindowUtils.html index 4018ce6aef..45fc358755 100644 --- a/dom/base/test/test_audioWindowUtils.html +++ b/dom/base/test/test_audioWindowUtils.html @@ -23,10 +23,10 @@ function runTest() { is(utils.audioVolume, 1.0, "By default utils.audioVolume is 1.0"); utils.audioVolume = 0.4; - is(utils.audioVolume.toFixed(2), 0.4, "utils.audioVolume is ok"); + is(utils.audioVolume.toFixed(2), "0.40", "utils.audioVolume is ok"); utils.audioMuted = true; is(utils.audioMuted, true, "utils.audioMuted is true"); - is(utils.audioVolume.toFixed(2), 0.4, "utils.audioVolume is ok"); + is(utils.audioVolume.toFixed(2), "0.40", "utils.audioVolume is ok"); utils.audioMuted = false; utils.audioVolume = 2.0; @@ -60,10 +60,10 @@ function runTest() { is(utils.audioVolume, 1.0, "By default utils.audioVolume is 1.0"); utils.audioVolume = 0.4; - is(utils.audioVolume.toFixed(2), 0.4, "utils.audioVolume is ok"); + is(utils.audioVolume.toFixed(2), "0.40", "utils.audioVolume is ok"); utils.audioMuted = true; is(utils.audioMuted, true, "utils.audioMuted is true"); - is(utils.audioVolume.toFixed(2), 0.4, "utils.audioVolume is ok"); + is(utils.audioVolume.toFixed(2), "0.40", "utils.audioVolume is ok"); utils.audioMuted = false; utils.audioVolume = 2.0; diff --git a/dom/base/test/test_bug346485.html b/dom/base/test/test_bug346485.html index 688c5f0e24..b0543ced20 100644 --- a/dom/base/test/test_bug346485.html +++ b/dom/base/test/test_bug346485.html @@ -25,9 +25,17 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=346485 * This test is testing DOMSettableTokenList used by the output element. */ +function checkHtmlFor(htmlFor, list, msg) { + var length = htmlFor.length; + is(length, list.length, htmlFor + ": incorrect htmlFor length (" + msg + ")"); + for (var i = 0; i < length; ++i) { + is(htmlFor[i], list[i], htmlFor + ": wrong element at " + i + " (" + msg + ")"); + } +} + var o = document.getElementById('o'); -is(o.htmlFor, 'a b', +is(String(o.htmlFor), 'a b', "htmlFor IDL attribute should reflect for content attribute"); is(o.htmlFor.value, 'a b', @@ -42,32 +50,25 @@ is(o.htmlFor.item(0), 'a', "First item is 'a' token'"); is(o.htmlFor.item(42), null, "Out-of-range should return null"); o.htmlFor.add('c'); -is(o.htmlFor, 'a b c', "'c' token should have been added"); -is(o.htmlFor.length, 3, "Size should be '3'"); +checkHtmlFor(o.htmlFor, ['a', 'b', 'c'], "'c' token should have been added"); o.htmlFor.add('a'); -is(o.htmlFor, 'a b c', "Nothing should have changed"); -is(o.htmlFor.length, 3, "Size should be '3'"); +checkHtmlFor(o.htmlFor, ['a', 'b', 'c'], "Nothing should have changed"); o.htmlFor.remove('a'); -is(o.htmlFor, 'b c', "'a' token should have been removed"); -is(o.htmlFor.length, 2, "Size should be '2'"); +checkHtmlFor(o.htmlFor, ['b', 'c'], "'a' token should have been removed"); o.htmlFor.remove('d'); -is(o.htmlFor, 'b c', "Nothing should have been removed"); -is(o.htmlFor.length, 2, "Size should be '2'"); +checkHtmlFor(o.htmlFor, ['b', 'c'], "Nothing should have been removed"); o.htmlFor.toggle('a'); -is(o.htmlFor, 'b c a', "'a' token should have been added"); -is(o.htmlFor.length, 3, "Size should be '3'"); +checkHtmlFor(o.htmlFor, ['b', 'c', 'a'], "'a' token should have been added"); o.htmlFor.toggle('b'); -is(o.htmlFor, 'c a', "Nothing should have changed"); -is(o.htmlFor.length, 2, "Size should be '2'"); +checkHtmlFor(o.htmlFor, ['c', 'a'], "Nothing should have changed"); o.htmlFor.value = "foo bar"; -is(o.htmlFor, 'foo bar', "The underlying string should have changed"); -is(o.htmlFor.length, 2, "Size should be '2'"); +checkHtmlFor(o.htmlFor, ['foo', 'bar'], "The underlying string should have changed"); ok(o.htmlFor.contains('foo'), "It should contain 'foo'"); diff --git a/dom/base/test/test_bug461555.html b/dom/base/test/test_bug461555.html index 5902f79745..b91ca98326 100644 --- a/dom/base/test/test_bug461555.html +++ b/dom/base/test/test_bug461555.html @@ -26,7 +26,7 @@ function done() { nodes = document.getElementsByTagName('span'); is(nodes.length, 3, "wrong length"); for (i = 0; i < nodes.length; ++i) { - is(nodes[i].textContent, i+1, "wrong order"); + is(nodes[i].textContent, String(i + 1), "wrong order"); } SimpleTest.finish(); } diff --git a/dom/base/test/test_bug622088.html b/dom/base/test/test_bug622088.html index f8be69f5d3..134bb898d3 100644 --- a/dom/base/test/test_bug622088.html +++ b/dom/base/test/test_bug622088.html @@ -30,13 +30,13 @@ function innerLoaded(inner) { // Here, we're being called through inner's onload handler, so our referrer // should be inner's URL. var referrer = inner.doXHR(); - is (referrer, inner.document.location, 'Expected inner frame location'); + is (referrer, String(inner.document.location), 'Expected inner frame location'); // Now change the location of the inner frame. This should be reflected in // the XHR's referrer. inner.history.pushState('', '', Math.random()); referrer = inner.doXHR(); - is (referrer, inner.document.location, 'Expected inner frame location after pushstate'); + is (referrer, String(inner.document.location), 'Expected inner frame location after pushstate'); innerFinishedLoading = true; } @@ -50,11 +50,11 @@ function callXHR() { if (innerFinishedLoading && dataWindowFinishedLoading) { var inner = document.getElementById('iframe').contentWindow; var referrer = inner.doXHR(); - is (referrer, inner.document.location, + is (referrer, String(inner.document.location), 'Expected inner frame location when called from outer frame.'); var referrer = inner.doXHR(new XMLHttpRequest()); - is (referrer, document.location, + is (referrer, String(document.location), "Expected outer frame location when called with outer's XHR object."); // Now do a request within the inner window using an XMLHttpRequest @@ -62,7 +62,7 @@ function callXHR() { // data: URI. var dataWindow = document.getElementById('dataWindow').contentWindow; var referrer = inner.doXHR(dataWindow.getXHRObject()); - is (referrer, document.location, + is (referrer, String(document.location), "Expected outer frame location when called with data's XHR object."); // Now do that test again, but after having changed the outer window's URI. @@ -71,7 +71,7 @@ function callXHR() { history.replaceState('', '', Math.random()); var referrer = inner.doXHR(dataWindow.getXHRObject()); - todo_is (referrer, document.location, + todo_is (referrer, String(document.location), "Expected outer frame location when called with data's XHR object " + "after replaceState."); diff --git a/dom/base/test/test_domrequesthelper.xul b/dom/base/test/test_domrequesthelper.xul index 6a1420a104..708c55b7f8 100644 --- a/dom/base/test/test_domrequesthelper.xul +++ b/dom/base/test/test_domrequesthelper.xul @@ -43,9 +43,9 @@ * Init & destroy. */ function initDOMRequestHelperTest(aMessages) { - is(dummy._requests, undefined, "Request is undefined"); + is_loosely(dummy._requests, undefined, "Request is undefined"); is(dummy._messages, undefined, "Messages is undefined"); - is(dummy._window, undefined, "Window is undefined"); + is_loosely(dummy._window, undefined, "Window is undefined"); dummy.initDOMRequestHelper(window, aMessages); @@ -59,9 +59,9 @@ function destroyDOMRequestHelperTest() { dummy.destroyDOMRequestHelper(); - is(dummy._requests, undefined, "Request is undefined"); + is_loosely(dummy._requests, undefined, "Request is undefined"); is(dummy._messages, undefined, "Messages is undefined"); - is(dummy._window, undefined, "Window is undefined"); + is_loosely(dummy._window, undefined, "Window is undefined"); } /** @@ -388,7 +388,7 @@ is(req, req_, "Got correct request"); dummy.removeRequest(id); req = dummy.getRequest(id); - is(req, null, "No request"); + is(req, undefined, "No request"); next(); }, function() { diff --git a/dom/base/test/test_url.html b/dom/base/test/test_url.html index 43d3ca81fa..f8784ef356 100644 --- a/dom/base/test/test_url.html +++ b/dom/base/test/test_url.html @@ -310,7 +310,7 @@ url = new URL("http://localhost/"); url.host = "[2001::1]:30"; is(url.hostname, "[2001::1]", "IPv6 hostname"); - is(url.port, 30, "Port"); + is(url.port, "30", "Port"); is(url.host, "[2001::1]:30", "IPv6 host"); url = new URL("http://localhost/"); diff --git a/dom/base/test/test_url_empty_port.html b/dom/base/test/test_url_empty_port.html index 2e0d8c0577..2a164c1d62 100644 --- a/dom/base/test/test_url_empty_port.html +++ b/dom/base/test/test_url_empty_port.html @@ -24,14 +24,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=930450 diff --git a/dom/html/test/test_bug332893-3.html b/dom/html/test/test_bug332893-3.html index 7cb9a4572a..372319c224 100644 --- a/dom/html/test/test_bug332893-3.html +++ b/dom/html/test/test_bug332893-3.html @@ -45,11 +45,11 @@ var form1 = document.getElementById("form1"); var form2 = document.getElementById("form2"); - is(form1.elements.length, "2", "Form 1 has the correct length"); + is(form1.elements.length, 2, "Form 1 has the correct length"); is(form1.elements[0].value, "12", "Form 1 element 1 is correct"); is(form1.elements[1].value, "10", "Form 1 element 2 is correct"); - is(form2.elements.length, "3", "Form 2 has the correct length"); + is(form2.elements.length, 3, "Form 2 has the correct length"); is(form2.elements[0].value, "11", "Form 2 element 1 is correct"); is(form2.elements[1].value, "21", "Form 2 element 2 is correct"); is(form2.elements[2].value, "22", "Form 2 element 2 is correct"); diff --git a/dom/html/test/test_bug332893-4.html b/dom/html/test/test_bug332893-4.html index d8a5719097..abbc60ca63 100644 --- a/dom/html/test/test_bug332893-4.html +++ b/dom/html/test/test_bug332893-4.html @@ -16,7 +16,7 @@ var form1 = document.getElementById("form1"); form1.insertBefore(input2, input1); - is(form1.elements["input"].length, "3", "Form 1 'input' has the correct length"); + is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length"); is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct"); is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct"); is(form1.elements["input"][2].value, "3", "Form 1 element 3 is correct"); diff --git a/dom/html/test/test_bug332893-5.html b/dom/html/test/test_bug332893-5.html index 85166a7785..6898f9157e 100644 --- a/dom/html/test/test_bug332893-5.html +++ b/dom/html/test/test_bug332893-5.html @@ -16,7 +16,7 @@ var form1 = document.getElementById("form1"); form1.insertBefore(input2, input1); - is(form1.elements["input"].length, "3", "Form 1 'input' has the correct length"); + is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length"); is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct"); is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct"); is(form1.elements["input"][2].value, "3", "Form 1 element 3 is correct"); diff --git a/dom/html/test/test_bug332893-6.html b/dom/html/test/test_bug332893-6.html index e02a1c3f79..c5e6fe3765 100644 --- a/dom/html/test/test_bug332893-6.html +++ b/dom/html/test/test_bug332893-6.html @@ -16,7 +16,7 @@ var form1 = document.getElementById("form1"); form1.insertBefore(input2, input1); - is(form1.elements["input"].length, "3", "Form 1 'input' has the correct length"); + is(form1.elements["input"].length, 3, "Form 1 'input' has the correct length"); is(form1.elements["input"][0].value, "2", "Form 1 element 1 is correct"); is(form1.elements["input"][1].value, "1", "Form 1 element 2 is correct"); diff --git a/dom/html/test/test_bug332893-7.html b/dom/html/test/test_bug332893-7.html index 6322923c03..7939b34ae3 100644 --- a/dom/html/test/test_bug332893-7.html +++ b/dom/html/test/test_bug332893-7.html @@ -41,7 +41,7 @@ form1.insertBefore(input8, input4); form1.insertBefore(input9, input2); - is(form1.elements["input"].length, "10", "Form 1 'input' has the correct length"); + is(form1.elements["input"].length, 10, "Form 1 'input' has the correct length"); is(form1.elements["input"][0].value, "9", "Form 1 element 1 is correct"); is(form1.elements["input"][1].value, "2", "Form 1 element 2 is correct"); is(form1.elements["input"][2].value, "1", "Form 1 element 3 is correct"); diff --git a/dom/html/test/test_bug405242.html b/dom/html/test/test_bug405242.html index e91efdc052..9ca3c11568 100644 --- a/dom/html/test/test_bug405242.html +++ b/dom/html/test/test_bug405242.html @@ -28,7 +28,7 @@ sel.options.remove(0); sel.options.remove(1000); sel.options.remove(-1); is(sel.length, 1, "Unexpected option collection length"); -is(sel[0].value, 10, "Unexpected remained option"); +is(sel[0].value, "10", "Unexpected remained option"); diff --git a/dom/html/test/test_bug536891.html b/dom/html/test/test_bug536891.html index 98858de0ec..13fcf44201 100644 --- a/dom/html/test/test_bug536891.html +++ b/dom/html/test/test_bug536891.html @@ -28,7 +28,7 @@ function checkNegativeMaxLength(element) element.setAttribute('maxLength', -15); is(element.maxLength, -1, "negative maxLength is not processed correctly when set dynamically"); - is(element.getAttribute('maxLength'), -15, "maxLength attribute doesn't return the correct value"); + is(element.getAttribute('maxLength'), "-15", "maxLength attribute doesn't return the correct value"); element.setAttribute('maxLength', 0); is(element.maxLength, 0, "negative maxLength is not processed correctly"); diff --git a/dom/html/test/test_bug536895.html b/dom/html/test/test_bug536895.html index c82971ddb5..7ff5bedb10 100644 --- a/dom/html/test/test_bug536895.html +++ b/dom/html/test/test_bug536895.html @@ -40,7 +40,7 @@ function checkNegativeMaxLengthException(element) } ok(caught, "Setting negative maxLength from the DOM should throw an exception"); - is(element.getAttribute('maxLength'), -10, "When the exception is raised, the maxLength attribute shouldn't change"); + is(element.getAttribute('maxLength'), "-10", "When the exception is raised, the maxLength attribute shouldn't change"); } /* TODO: correct behavior may be checked for email, telephone, url and search input types */ diff --git a/dom/html/test/test_bug551846.html b/dom/html/test/test_bug551846.html index 95d922031b..e528e5a16f 100644 --- a/dom/html/test/test_bug551846.html +++ b/dom/html/test/test_bug551846.html @@ -32,25 +32,25 @@ function checkSizeReflection(element, defaultValue) element.setAttribute('size', -15); is(element.size, defaultValue, "The reflecting IDL attribute should return the default value when content attribute value is invalid"); - is(element.getAttribute('size'), -15, + is(element.getAttribute('size'), "-15", "The content attribute should containt the previously set value"); element.setAttribute('size', 0); is(element.size, 0, "0 should be considered as a valid value"); - is(element.getAttribute('size'), 0, + is(element.getAttribute('size'), "0", "The content attribute should containt the previously set value"); element.setAttribute('size', 2147483647); /* PR_INT32_MAX */ is(element.size, 2147483647, "PR_INT32_MAX should be considered as a valid value"); - is(element.getAttribute('size'), 2147483647, + is(element.getAttribute('size'), "2147483647", "The content attribute should containt the previously set value"); element.setAttribute('size', -2147483648); /* PR_INT32_MIN */ is(element.size, defaultValue, "The reflecting IDL attribute should return the default value when content attribute value is invalid"); - is(element.getAttribute('size'), -2147483648, + is(element.getAttribute('size'), "-2147483648", "The content attribute should containt the previously set value"); element.setAttribute('size', 'non-numerical-value'); @@ -62,13 +62,13 @@ function checkSizeReflection(element, defaultValue) element.setAttribute('size', 4294967294); /* PR_INT32_MAX * 2 */ is(element.size, defaultValue, "Value greater than PR_INT32_MAX should be considered as invalid"); - is(element.getAttribute('size'), 4294967294, + is(element.getAttribute('size'), "4294967294", "The content attribute should containt the previously set value"); element.setAttribute('size', -4294967296); /* PR_INT32_MIN * 2 */ is(element.size, defaultValue, "The reflecting IDL attribute should return the default value when content attribute value is invalid"); - is(element.getAttribute('size'), -4294967296, + is(element.getAttribute('size'), "-4294967296", "The content attribute should containt the previously set value"); element.size = defaultValue + 1; @@ -135,7 +135,7 @@ function checkSizeWhenChangeMultiple(element, aDefaultNonMultiple, aDefaultMulti s.multiple = true; is(s.size, aDefaultMultiple, "Size IDL attribute should be 4"); - is(s.getAttribute('size'), -1, "Size content attribute should be -1"); + is(s.getAttribute('size'), "-1", "Size content attribute should be -1"); s.setAttribute('size', -2); is(s.size, aDefaultMultiple, "Size IDL attribute should be 4"); @@ -143,7 +143,7 @@ function checkSizeWhenChangeMultiple(element, aDefaultNonMultiple, aDefaultMulti s.multiple = false; is(s.size, aDefaultNonMultiple, "Size IDL attribute should be 1"); - is(s.getAttribute('size'), -2, "Size content attribute should be -2"); + is(s.getAttribute('size'), "-2", "Size content attribute should be -2"); } var s = document.getElementById('s'); diff --git a/dom/html/test/test_bug596350.html b/dom/html/test/test_bug596350.html index 15ea5dde83..a92484ef7a 100644 --- a/dom/html/test/test_bug596350.html +++ b/dom/html/test/test_bug596350.html @@ -26,18 +26,18 @@ addLoadEvent(runTests); var testData = [ // Object 0 - [ 0, null, "-1" ], - [ 0, "1", "1" ], - [ 0, "-1", "-1" ], - [ 0, "0", "0" ], - [ 0, "foo", "-1" ], + [ 0, null, -1 ], + [ 0, "1", 1 ], + [ 0, "-1", -1 ], + [ 0, "0", 0 ], + [ 0, "foo", -1 ], // Object 1 - [ 1, null, "-1" ], - [ 1, "1", "1" ], + [ 1, null, -1 ], + [ 1, "1", 1 ], // Object 2 - [ 2, null, "0" ], - [ 2, "1", "1" ], - [ 2, "-1", "-1" ], + [ 2, null, 0 ], + [ 2, "1", 1 ], + [ 2, "-1", -1 ], ]; var objects = document.getElementsByTagName("object"); diff --git a/dom/html/test/test_documentAll.html b/dom/html/test/test_documentAll.html index c563401a73..ec877acec1 100644 --- a/dom/html/test/test_documentAll.html +++ b/dom/html/test/test_documentAll.html @@ -31,7 +31,8 @@ p = document.getElementById("content"); // Test that several elements with the same id or name behave correctly function testNumSame() { - is(document.all.id0, null, "no ids"); + is(document.all.id0, undefined, "no ids"); + is(document.all.namedItem("id0"), null, "no ids"); is(document.all.id1, p.children[0], "one id"); is(document.all.id2[0], p.children[1], "two ids"); is(document.all.id2[1], p.children[2], "two ids"); @@ -79,7 +80,8 @@ id3list = document.all.id3; rC(child[3]); is(id3list.length, 1, "now one length"); rC(child[5]); -is(document.all.id3, null, "now none"); +is(document.all.id3, undefined, "now none"); +is(document.all.namedItem("id3"), null, "now none (namedItem)"); is(id3list.length, 0, "now none length"); // Give an element both a name and id and check that it appears in two lists @@ -135,7 +137,8 @@ elementNames.forEach(function (name) { hasName.shift(); } else { - is(document.all[nameval], null, "shouldn't have name"); + is(document.all[nameval], undefined, "shouldn't have name"); + is(document.all.namedItem(nameval), null, "shouldn't have name (namedItem)"); } }); is(hasName.length, 0, "found all names"); diff --git a/dom/indexedDB/IndexedDatabaseManager.cpp b/dom/indexedDB/IndexedDatabaseManager.cpp index 3082d68bf9..5ea78e1f48 100644 --- a/dom/indexedDB/IndexedDatabaseManager.cpp +++ b/dom/indexedDB/IndexedDatabaseManager.cpp @@ -35,7 +35,7 @@ #include "nsContentUtils.h" #include "nsGlobalWindow.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "IDBEvents.h" #include "IDBFactory.h" diff --git a/dom/indexedDB/ProfilerHelpers.h b/dom/indexedDB/ProfilerHelpers.h index 384d2999e3..a4c48abde3 100644 --- a/dom/indexedDB/ProfilerHelpers.h +++ b/dom/indexedDB/ProfilerHelpers.h @@ -27,7 +27,7 @@ #include "nsID.h" #include "nsIDOMEvent.h" #include "nsString.h" -#include "prlog.h" +#include "mozilla/Logging.h" // Include this last to avoid path problems on Windows. #include "ActorsChild.h" diff --git a/dom/indexedDB/test/helpers.js b/dom/indexedDB/test/helpers.js index a34e2f6d88..f6637ad0c7 100644 --- a/dom/indexedDB/test/helpers.js +++ b/dom/indexedDB/test/helpers.js @@ -332,7 +332,7 @@ function workerScript() { return "undefined"; } - if (o === null) { + if (_thing_ === null) { return "null"; } diff --git a/dom/indexedDB/test/test_persistenceType.html b/dom/indexedDB/test/test_persistenceType.html index 27aa767ec2..cc44ffb777 100644 --- a/dom/indexedDB/test/test_persistenceType.html +++ b/dom/indexedDB/test/test_persistenceType.html @@ -71,7 +71,7 @@ request.onsuccess = grabEventAndContinueHandler; event = yield undefined; - is(event.target.result, null, "Got no data"); + is(event.target.result, undefined, "Got no data"); request = objectStore.add(data.value, data.key); request.onsuccess = grabEventAndContinueHandler; diff --git a/dom/indexedDB/test/unit/test_deleteDatabase_interactions.js b/dom/indexedDB/test/unit/test_deleteDatabase_interactions.js index 90058e11a8..87f6a6d208 100644 --- a/dom/indexedDB/test/unit/test_deleteDatabase_interactions.js +++ b/dom/indexedDB/test/unit/test_deleteDatabase_interactions.js @@ -49,7 +49,7 @@ function testSteps() event = yield undefined; is(event.type, "success", "expect a success event"); is(event.target, request, "event has right target"); - is(event.target.result, null, "event should have no result"); + is(event.target.result, undefined, "event should have no result"); openRequest.onsuccess = grabEventAndContinueHandler; diff --git a/dom/indexedDB/test/unit/test_keys.js b/dom/indexedDB/test/unit/test_keys.js index c16e3857dc..00072748e0 100644 --- a/dom/indexedDB/test/unit/test_keys.js +++ b/dom/indexedDB/test/unit/test_keys.js @@ -202,7 +202,7 @@ function testSteps() cursor.continue(); } event = yield undefined; - is(event.target.result, undefined, "no more results expected"); + is(event.target.result, null, "no more results expected"); var nan = 0/0; var invalidKeys = [ diff --git a/dom/indexedDB/test/unit/test_multientry.js b/dom/indexedDB/test/unit/test_multientry.js index dc95acf942..c1479498ea 100644 --- a/dom/indexedDB/test/unit/test_multientry.js +++ b/dom/indexedDB/test/unit/test_multientry.js @@ -90,7 +90,7 @@ function testSteps() req.result.continue(); } e = yield undefined; - is(req.result, undefined, "exhausted indexes"); + ok(req.result == null, "exhausted indexes"); let tempIndex = store.createIndex("temp index", "x", { multiEntry: true }); req = tempIndex.openKeyCursor(); @@ -102,7 +102,7 @@ function testSteps() req.result.continue(); } e = yield undefined; - is(req.result, undefined, "exhausted temp index"); + ok(req.result == null, "exhausted temp index"); store.deleteIndex("temp index"); } @@ -186,7 +186,7 @@ function testSteps() req.result.continue(); } e = yield undefined; - is(req.result, undefined, "exhausted indexes"); + ok(req.result == null, "exhausted indexes"); let tempIndex = store.createIndex("temp index", "x", { multiEntry: true, unique: true }); req = tempIndex.openKeyCursor(); @@ -198,7 +198,7 @@ function testSteps() req.result.continue(); } e = yield undefined; - is(req.result, undefined, "exhausted temp index"); + ok(req.result == null, "exhausted temp index"); store.deleteIndex("temp index"); } diff --git a/dom/indexedDB/test/unit/test_persistenceType.js b/dom/indexedDB/test/unit/test_persistenceType.js index 2347beda99..0f5dd72a2d 100644 --- a/dom/indexedDB/test/unit/test_persistenceType.js +++ b/dom/indexedDB/test/unit/test_persistenceType.js @@ -51,7 +51,7 @@ function testSteps() request.onsuccess = grabEventAndContinueHandler; event = yield undefined; - is(event.target.result, null, "Got no data"); + is(event.target.result, undefined, "Got no data"); request = objectStore.add(data.value, data.key); request.onsuccess = grabEventAndContinueHandler; diff --git a/dom/indexedDB/test/unit/test_remove_objectStore.js b/dom/indexedDB/test/unit/test_remove_objectStore.js index 7d41088109..fae29261a8 100644 --- a/dom/indexedDB/test/unit/test_remove_objectStore.js +++ b/dom/indexedDB/test/unit/test_remove_objectStore.js @@ -73,7 +73,7 @@ function testSteps() request = objectStore.openCursor(); request.onerror = errorHandler; request.onsuccess = function(event) { - is(event.target.result, undefined, "ObjectStore shouldn't have any items"); + is(event.target.result, null, "ObjectStore shouldn't have any items"); testGenerator.send(event); } event = yield undefined; diff --git a/dom/indexedDB/test/unit/test_setVersion_abort.js b/dom/indexedDB/test/unit/test_setVersion_abort.js index b7edbc3915..262c103464 100644 --- a/dom/indexedDB/test/unit/test_setVersion_abort.js +++ b/dom/indexedDB/test/unit/test_setVersion_abort.js @@ -46,7 +46,6 @@ function testSteps() event = yield undefined; is(event.type, "abort", "Got transaction abort event"); is(event.target, transaction, "Right target"); - is(event.target.transaction, null, "No transaction"); is(db.version, 0, "Correct version"); is(db.objectStoreNames.length, 0, "Correct objectStoreNames length"); diff --git a/dom/indexedDB/test/unit/test_setVersion_events.js b/dom/indexedDB/test/unit/test_setVersion_events.js index 6e2e7271ff..1bd757dc88 100644 --- a/dom/indexedDB/test/unit/test_setVersion_events.js +++ b/dom/indexedDB/test/unit/test_setVersion_events.js @@ -35,7 +35,7 @@ function testSteps() db1.addEventListener("versionchange", function(event) { ok(true, "Got version change event"); ok(event instanceof IDBVersionChangeEvent, "Event is of the right type"); - is(event.target.source, null, "Correct source"); + is("source" in event.target, false, "Correct source"); is(event.target, db1, "Correct target"); is(event.target.version, 1, "Correct db version"); is(event.oldVersion, 1, "Correct event oldVersion"); @@ -70,7 +70,7 @@ function testSteps() db2.addEventListener("versionchange", function(event) { ok(true, "Got version change event"); ok(event instanceof IDBVersionChangeEvent, "Event is of the right type"); - is(event.target.source, null, "Correct source"); + is("source" in event.target, false, "Correct source"); is(event.target, db2, "Correct target"); is(event.target.version, 2, "Correct db version"); is(event.oldVersion, 2, "Correct event oldVersion"); diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl index de847b219c..1bd103ec6c 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl @@ -49,6 +49,7 @@ interface nsIRunnable; interface nsITranslationNodeList; interface nsIJSRAIIHelper; interface nsIContentPermissionRequest; +interface nsIObserver; [scriptable, uuid(dde97573-f4cf-45ce-bbb0-5af4e5f77440)] interface nsIDOMWindowUtils : nsISupports { @@ -571,12 +572,17 @@ interface nsIDOMWindowUtils : nsISupports { * Will throw a DOM security error if called without chrome privileges. * * When you use this for tests, use the constants defined in NativeKeyCodes.js + * + * NOTE: The synthesized native event will be fired asynchronously, and upon + * completion the observer, if provided, will be notified with a "keyevent" + * topic. */ void sendNativeKeyEvent(in long aNativeKeyboardLayout, in long aNativeKeyCode, in long aModifierFlags, in AString aCharacters, - in AString aUnmodifiedCharacters); + in AString aUnmodifiedCharacters, + [optional] in nsIObserver aObserver); /** * See nsIWidget::SynthesizeNativeMouseEvent @@ -584,12 +590,17 @@ interface nsIDOMWindowUtils : nsISupports { * Will be called on the widget that contains aElement. * Cannot be accessed from unprivileged context (not content-accessible) * Will throw a DOM security error if called without chrome privileges. + * + * NOTE: The synthesized native event will be fired asynchronously, and upon + * completion the observer, if provided, will be notified with a "mouseevent" + * topic. */ void sendNativeMouseEvent(in long aScreenX, in long aScreenY, in long aNativeMessage, in long aModifierFlags, - in nsIDOMElement aElement); + in nsIDOMElement aElement, + [optional] in nsIObserver aObserver); /** * The values for sendNativeMouseScrollEvent's aAdditionalFlags. @@ -620,7 +631,9 @@ interface nsIDOMWindowUtils : nsISupports { * Cannot be accessed from unprivileged context (not content-accessible) * Will throw a DOM security error if called without chrome privileges. * - * NOTE: The synthesized native event may be fired asynchronously. + * NOTE: The synthesized native event will be fired asynchronously, and upon + * completion the observer, if provided, will be notified with a + * "mousescrollevent" topic. * * @param aNativeMessage * On Windows: WM_MOUSEWHEEL (0x020A), WM_MOUSEHWHEEL(0x020E), @@ -634,7 +647,8 @@ interface nsIDOMWindowUtils : nsISupports { in double aDeltaZ, in unsigned long aModifierFlags, in unsigned long aAdditionalFlags, - in nsIDOMElement aElement); + in nsIDOMElement aElement, + [optional] in nsIObserver aObserver); /** * Touch states for sendNativeTouchPoint. These values match @@ -665,6 +679,10 @@ interface nsIDOMWindowUtils : nsISupports { * Widget support: Windows 8.0+, Winrt/Win32. Gonk supports CONTACT, REMOVE, * and CANCEL but no HOVER. Other widgets will throw. * + * NOTE: The synthesized native event will be fired asynchronously, and upon + * completion the observer, if provided, will be notified with a "touchpoint" + * topic. + * * @param aPointerId The touch point id to create or update. * @param aTouchState one or more of the touch states listed above * @param aScreenX, aScreenY screen coords of this event @@ -677,7 +695,8 @@ interface nsIDOMWindowUtils : nsISupports { in long aScreenX, in long aScreenY, in double aPressure, - in unsigned long aOrientation); + in unsigned long aOrientation, + [optional] in nsIObserver aObserver); /** * Simulates native touch based taps on the input digitizer. Events @@ -694,13 +713,18 @@ interface nsIDOMWindowUtils : nsISupports { * Widget support: Windows 8.0+, Winrt/Win32. Other widgets will * throw. * + * NOTE: The synthesized native event will be fired asynchronously, and upon + * completion the observer, if provided, will be notified, with a "touchtap" + * topic. + * * @param aScreenX, aScreenY screen coords of this event * @param aLongTap true if the tap should be long, false for a short * tap. */ void sendNativeTouchTap(in long aScreenX, in long aScreenY, - in boolean aLongTap); + in boolean aLongTap, + [optional] in nsIObserver aObserver); /** * Cancel any existing touch points or long tap delays. Calling this is safe @@ -708,8 +732,12 @@ interface nsIDOMWindowUtils : nsISupports { * this when tests shut down to reset the digitizer driver. Not doing so can * leave the digitizer in an undetermined state which can screw up subsequent * tests and native input. + * + * NOTE: The synthesized native event will be fired asynchronously, and upon + * completion the observer, if provided, will be notified with a "cleartouch" + * topic. */ - void clearNativeTouchSequence(); + void clearNativeTouchSequence([optional] in nsIObserver aObserver); /** * See nsIWidget::ActivateNativeMenuItemAt diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index ff3a5b6700..9e2bab9064 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -27,6 +27,7 @@ using class mozilla::gfx::Matrix from "mozilla/gfx/Matrix.h"; using struct gfxSize from "gfxPoint.h"; using CSSRect from "Units.h"; using LayoutDeviceIntRect from "Units.h"; +using mozilla::LayoutDeviceIntPoint from "Units.h"; using ScreenIntSize from "Units.h"; using struct mozilla::layers::FrameMetrics from "FrameMetrics.h"; using struct mozilla::layers::ScrollableLayerGuid from "FrameMetrics.h"; @@ -58,6 +59,7 @@ using mozilla::Modifiers from "mozilla/EventForwards.h"; using mozilla::layers::GeckoContentController::APZStateChange from "mozilla/layers/GeckoContentController.h"; using mozilla::WritingMode from "mozilla/WritingModes.h"; using mozilla::layers::TouchBehaviorFlags from "mozilla/layers/APZUtils.h"; +using nsIWidget::TouchPointerState from "nsIWidget.h"; namespace mozilla { namespace dom { @@ -333,6 +335,14 @@ parent: sync IsParentWindowMainWidgetVisible() returns (bool visible); + /** + * Returns the offset of this tab from the top level window + * origin in device pixels. + * + * aPoint offset values in device pixels. + */ + sync GetTabOffset() returns (LayoutDeviceIntPoint aPoint); + /** * Gets the DPI of the screen corresponding to this browser. */ @@ -474,6 +484,41 @@ parent: sync RequestNativeKeyBindings(WidgetKeyboardEvent event) returns (MaybeNativeKeyBinding bindings); + SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout, + int32_t aNativeKeyCode, + uint32_t aModifierFlags, + nsString aCharacters, + nsString aUnmodifiedCharacters, + uint64_t aObserverId); + SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint, + uint32_t aNativeMessage, + uint32_t aModifierFlags, + uint64_t aObserverId); + SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint, + uint64_t aObserverId); + SynthesizeNativeMouseScrollEvent(LayoutDeviceIntPoint aPoint, + uint32_t aNativeMessage, + double aDeltaX, + double aDeltaY, + double aDeltaZ, + uint32_t aModifierFlags, + uint32_t aAdditionalFlags, + uint64_t aObserverId); + SynthesizeNativeTouchPoint(uint32_t aPointerId, + TouchPointerState aPointerState, + nsIntPoint aPointerScreenPoint, + double aPointerPressure, + uint32_t aPointerOrientation, + uint64_t aObserverId); + SynthesizeNativeTouchTap(nsIntPoint aPointerScreenPoint, + bool aLongTap, + uint64_t aObserverId); + ClearNativeTouchSequence(uint64_t aObserverId); +child: + NativeSynthesisResponse(uint64_t aObserverId, nsCString aResponse); + +parent: + /** * Child informs the parent that the graphics objects are ready for * compositing. This is sent when all pending changes have been diff --git a/dom/ipc/ProcessPriorityManager.cpp b/dom/ipc/ProcessPriorityManager.cpp index 154c022595..4cf51bc52b 100644 --- a/dom/ipc/ProcessPriorityManager.cpp +++ b/dom/ipc/ProcessPriorityManager.cpp @@ -15,7 +15,7 @@ #include "mozilla/Services.h" #include "mozilla/unused.h" #include "AudioChannelService.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsPrintfCString.h" #include "nsXULAppAPI.h" #include "nsIFrameLoader.h" diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index f3c7548cbc..dda38bd66a 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -2463,6 +2463,14 @@ TabChild::RequestNativeKeyBindings(AutoCacheNativeKeyCommands* aAutoCache, } } +bool +TabChild::RecvNativeSynthesisResponse(const uint64_t& aObserverId, + const nsCString& aResponse) +{ + mozilla::widget::AutoObserverNotifier::NotifySavedObserver(aObserverId, aResponse.get()); + return true; +} + bool TabChild::RecvRealKeyEvent(const WidgetKeyboardEvent& event, const MaybeNativeKeyBinding& aBindings) diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index 2e64abc7a9..ae2b921a80 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -374,6 +374,8 @@ public: const bool& aPreventDefault) override; virtual bool RecvMouseScrollTestEvent(const FrameMetrics::ViewID& aScrollId, const nsString& aEvent) override; + virtual bool RecvNativeSynthesisResponse(const uint64_t& aObserverId, + const nsCString& aResponse) override; virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event) override; virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event) override; virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture) override; diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 76196a4bee..2b4faa8211 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -1233,7 +1233,7 @@ TabParent::SendRealDragEvent(WidgetDragEvent& event, uint32_t aDragAction, CSSPoint TabParent::AdjustTapToChildWidget(const CSSPoint& aPoint) { - return aPoint + (LayoutDevicePoint(mChildProcessOffsetAtTouchStart) * GetLayoutDeviceToCSSScale()); + return aPoint + (LayoutDevicePoint(GetChildProcessOffset()) * GetLayoutDeviceToCSSScale()); } bool TabParent::SendHandleSingleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid) @@ -1373,6 +1373,177 @@ TabParent::RecvRequestNativeKeyBindings(const WidgetKeyboardEvent& aEvent, return true; } +class SynthesizedEventObserver : public nsIObserver +{ + NS_DECL_ISUPPORTS + +public: + SynthesizedEventObserver(TabParent* aTabParent, const uint64_t& aObserverId) + : mTabParent(aTabParent) + , mObserverId(aObserverId) + { + MOZ_ASSERT(mTabParent); + } + + NS_IMETHODIMP Observe(nsISupports* aSubject, + const char* aTopic, + const char16_t* aData) override + { + if (!mTabParent) { + // We already sent the notification + return NS_OK; + } + + if (!mTabParent->SendNativeSynthesisResponse(mObserverId, nsCString(aTopic))) { + NS_WARNING("Unable to send native event synthesization response!"); + } + // Null out tabparent to indicate we already sent the response + mTabParent = nullptr; + return NS_OK; + } + +private: + virtual ~SynthesizedEventObserver() { } + + nsRefPtr mTabParent; + uint64_t mObserverId; +}; + +NS_IMPL_ISUPPORTS(SynthesizedEventObserver, nsIObserver) + +class MOZ_STACK_CLASS AutoSynthesizedEventResponder +{ +public: + AutoSynthesizedEventResponder(TabParent* aTabParent, + const uint64_t& aObserverId, + const char* aTopic) + : mObserver(new SynthesizedEventObserver(aTabParent, aObserverId)) + , mTopic(aTopic) + { } + + ~AutoSynthesizedEventResponder() + { + // This may be a no-op if the observer already sent a response. + mObserver->Observe(nullptr, mTopic, nullptr); + } + + nsIObserver* GetObserver() + { + return mObserver; + } + +private: + nsCOMPtr mObserver; + const char* mTopic; +}; + +bool +TabParent::RecvSynthesizeNativeKeyEvent(const int32_t& aNativeKeyboardLayout, + const int32_t& aNativeKeyCode, + const uint32_t& aModifierFlags, + const nsString& aCharacters, + const nsString& aUnmodifiedCharacters, + const uint64_t& aObserverId) +{ + AutoSynthesizedEventResponder responder(this, aObserverId, "keyevent"); + nsCOMPtr widget = GetWidget(); + if (widget) { + widget->SynthesizeNativeKeyEvent(aNativeKeyboardLayout, aNativeKeyCode, + aModifierFlags, aCharacters, aUnmodifiedCharacters, + responder.GetObserver()); + } + return true; +} + +bool +TabParent::RecvSynthesizeNativeMouseEvent(const LayoutDeviceIntPoint& aPoint, + const uint32_t& aNativeMessage, + const uint32_t& aModifierFlags, + const uint64_t& aObserverId) +{ + AutoSynthesizedEventResponder responder(this, aObserverId, "mouseevent"); + nsCOMPtr widget = GetWidget(); + if (widget) { + widget->SynthesizeNativeMouseEvent(aPoint, aNativeMessage, aModifierFlags, + responder.GetObserver()); + } + return true; +} + +bool +TabParent::RecvSynthesizeNativeMouseMove(const LayoutDeviceIntPoint& aPoint, + const uint64_t& aObserverId) +{ + AutoSynthesizedEventResponder responder(this, aObserverId, "mousemove"); + nsCOMPtr widget = GetWidget(); + if (widget) { + widget->SynthesizeNativeMouseMove(aPoint, responder.GetObserver()); + } + return true; +} + +bool +TabParent::RecvSynthesizeNativeMouseScrollEvent(const LayoutDeviceIntPoint& aPoint, + const uint32_t& aNativeMessage, + const double& aDeltaX, + const double& aDeltaY, + const double& aDeltaZ, + const uint32_t& aModifierFlags, + const uint32_t& aAdditionalFlags, + const uint64_t& aObserverId) +{ + AutoSynthesizedEventResponder responder(this, aObserverId, "mousescrollevent"); + nsCOMPtr widget = GetWidget(); + if (widget) { + widget->SynthesizeNativeMouseScrollEvent(aPoint, aNativeMessage, + aDeltaX, aDeltaY, aDeltaZ, aModifierFlags, aAdditionalFlags, + responder.GetObserver()); + } + return true; +} + +bool +TabParent::RecvSynthesizeNativeTouchPoint(const uint32_t& aPointerId, + const TouchPointerState& aPointerState, + const nsIntPoint& aPointerScreenPoint, + const double& aPointerPressure, + const uint32_t& aPointerOrientation, + const uint64_t& aObserverId) +{ + AutoSynthesizedEventResponder responder(this, aObserverId, "touchpoint"); + nsCOMPtr widget = GetWidget(); + if (widget) { + widget->SynthesizeNativeTouchPoint(aPointerId, aPointerState, aPointerScreenPoint, + aPointerPressure, aPointerOrientation, responder.GetObserver()); + } + return true; +} + +bool +TabParent::RecvSynthesizeNativeTouchTap(const nsIntPoint& aPointerScreenPoint, + const bool& aLongTap, + const uint64_t& aObserverId) +{ + AutoSynthesizedEventResponder responder(this, aObserverId, "touchtap"); + nsCOMPtr widget = GetWidget(); + if (widget) { + widget->SynthesizeNativeTouchTap(aPointerScreenPoint, aLongTap, + responder.GetObserver()); + } + return true; +} + +bool +TabParent::RecvClearNativeTouchSequence(const uint64_t& aObserverId) +{ + AutoSynthesizedEventResponder responder(this, aObserverId, "cleartouch"); + nsCOMPtr widget = GetWidget(); + if (widget) { + widget->ClearNativeTouchSequence(responder.GetObserver()); + } + return true; +} + bool TabParent::SendRealKeyEvent(WidgetKeyboardEvent& event) { if (mIsDestroyed) { @@ -1409,9 +1580,6 @@ bool TabParent::SendRealTouchEvent(WidgetTouchEvent& event) if (mIsDestroyed) { return false; } - if (event.message == NS_TOUCH_START) { - mChildProcessOffsetAtTouchStart = GetChildProcessOffset(); - } // PresShell::HandleEventInternal adds touches on touch end/cancel. This // confuses remote content and the panning and zooming logic into thinking @@ -1813,6 +1981,13 @@ TabParent::RecvEnableDisableCommands(const nsString& aAction, return true; } +bool +TabParent::RecvGetTabOffset(LayoutDeviceIntPoint* aPoint) +{ + *aPoint = GetChildProcessOffset(); + return true; +} + NS_IMETHODIMP TabParent::GetChildProcessOffset(int32_t* aOutCssX, int32_t* aOutCssY) { @@ -2990,7 +3165,8 @@ TabParent::RecvInvokeDragSession(nsTArray&& aTransfers, } } - if (aVisualDnDData.IsEmpty()) { + if (aVisualDnDData.IsEmpty() || + (aVisualDnDData.Length() < aHeight * aStride)) { mDnDVisualization = nullptr; } else { mDnDVisualization = diff --git a/dom/ipc/TabParent.h b/dom/ipc/TabParent.h index 08e1cdc7d9..4747701e4a 100644 --- a/dom/ipc/TabParent.h +++ b/dom/ipc/TabParent.h @@ -208,6 +208,7 @@ public: virtual bool RecvIsParentWindowMainWidgetVisible(bool* aIsVisible) override; virtual bool RecvShowTooltip(const uint32_t& aX, const uint32_t& aY, const nsString& aTooltip) override; virtual bool RecvHideTooltip() override; + virtual bool RecvGetTabOffset(LayoutDeviceIntPoint* aPoint) override; virtual bool RecvGetDPI(float* aValue) override; virtual bool RecvGetDefaultScale(double* aValue) override; virtual bool RecvGetWidgetNativeData(WindowsHandle* aValue) override; @@ -272,6 +273,37 @@ public: virtual bool RecvRequestNativeKeyBindings(const mozilla::WidgetKeyboardEvent& aEvent, MaybeNativeKeyBinding* aBindings) override; + virtual bool RecvSynthesizeNativeKeyEvent(const int32_t& aNativeKeyboardLayout, + const int32_t& aNativeKeyCode, + const uint32_t& aModifierFlags, + const nsString& aCharacters, + const nsString& aUnmodifiedCharacters, + const uint64_t& aObserverId) override; + virtual bool RecvSynthesizeNativeMouseEvent(const LayoutDeviceIntPoint& aPoint, + const uint32_t& aNativeMessage, + const uint32_t& aModifierFlags, + const uint64_t& aObserverId) override; + virtual bool RecvSynthesizeNativeMouseMove(const LayoutDeviceIntPoint& aPoint, + const uint64_t& aObserverId) override; + virtual bool RecvSynthesizeNativeMouseScrollEvent(const LayoutDeviceIntPoint& aPoint, + const uint32_t& aNativeMessage, + const double& aDeltaX, + const double& aDeltaY, + const double& aDeltaZ, + const uint32_t& aModifierFlags, + const uint32_t& aAdditionalFlags, + const uint64_t& aObserverId) override; + virtual bool RecvSynthesizeNativeTouchPoint(const uint32_t& aPointerId, + const TouchPointerState& aPointerState, + const nsIntPoint& aPointerScreenPoint, + const double& aPointerPressure, + const uint32_t& aPointerOrientation, + const uint64_t& aObserverId) override; + virtual bool RecvSynthesizeNativeTouchTap(const nsIntPoint& aPointerScreenPoint, + const bool& aLongTap, + const uint64_t& aObserverId) override; + virtual bool RecvClearNativeTouchSequence(const uint64_t& aObserverId) override; + void SendMouseEvent(const nsAString& aType, float aX, float aY, int32_t aButton, int32_t aClickCount, int32_t aModifiers, bool aIgnoreRootScrollFrame); @@ -476,11 +508,6 @@ private: // be null. void ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid, uint64_t* aOutInputBlockId); - // The offset for the child process which is sampled at touch start. This - // means that the touch events are relative to where the frame was at the - // start of the touch. We need to look for a better solution to this - // problem see bug 872911. - LayoutDeviceIntPoint mChildProcessOffsetAtTouchStart; // When true, we've initiated normal shutdown and notified our // managing PContent. bool mMarkedDestroying; diff --git a/dom/media/AudioStream.cpp b/dom/media/AudioStream.cpp index 6ce2568c39..7e14af0d83 100644 --- a/dom/media/AudioStream.cpp +++ b/dom/media/AudioStream.cpp @@ -6,7 +6,7 @@ #include #include #include -#include "prlog.h" +#include "mozilla/Logging.h" #include "prdtoa.h" #include "AudioStream.h" #include "VideoUtils.h" diff --git a/dom/media/Latency.cpp b/dom/media/Latency.cpp index 5fa0bb4eaf..94367a5d7e 100644 --- a/dom/media/Latency.cpp +++ b/dom/media/Latency.cpp @@ -6,7 +6,7 @@ #include "Latency.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include #include diff --git a/dom/media/Latency.h b/dom/media/Latency.h index 56645da7da..e7a83d78b8 100644 --- a/dom/media/Latency.h +++ b/dom/media/Latency.h @@ -8,7 +8,7 @@ #define MOZILLA_LATENCY_H #include "mozilla/TimeStamp.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsCOMPtr.h" #include "nsIThread.h" #include "mozilla/Monitor.h" diff --git a/dom/media/MediaCache.cpp b/dom/media/MediaCache.cpp index 06cd1e112c..5b430ad261 100644 --- a/dom/media/MediaCache.cpp +++ b/dom/media/MediaCache.cpp @@ -11,7 +11,7 @@ #include "nsContentUtils.h" #include "nsThreadUtils.h" #include "MediaResource.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/Preferences.h" #include "FileBlockCache.h" #include "nsAnonymousTemporaryFile.h" diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index e059136056..fbe9730867 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -2843,8 +2843,7 @@ void MediaDecoderStateMachine::RenderVideoFrame(VideoData* aData, } else { mCorruptFrames.insert(0); } - container->SetCurrentFrame(ThebesIntSize(aData->mDisplay), aData->mImage, - aTarget); + container->SetCurrentFrame(aData->mDisplay, aData->mImage, aTarget); MOZ_ASSERT(container->GetFrameDelay() >= 0 || IsRealTime()); } } diff --git a/dom/media/MediaManager.h b/dom/media/MediaManager.h index 32a8437310..dd9d255500 100644 --- a/dom/media/MediaManager.h +++ b/dom/media/MediaManager.h @@ -27,7 +27,7 @@ #include "mozilla/dom/MediaStreamBinding.h" #include "mozilla/dom/MediaStreamTrackBinding.h" #include "mozilla/dom/MediaStreamError.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "DOMMediaStream.h" #ifdef MOZ_WEBRTC diff --git a/dom/media/MediaPromise.h b/dom/media/MediaPromise.h index b59cf360d1..73a25a6846 100644 --- a/dom/media/MediaPromise.h +++ b/dom/media/MediaPromise.h @@ -7,7 +7,7 @@ #if !defined(MediaPromise_h_) #define MediaPromise_h_ -#include "prlog.h" +#include "mozilla/Logging.h" #include "AbstractThread.h" diff --git a/dom/media/MediaShutdownManager.cpp b/dom/media/MediaShutdownManager.cpp index 101a21825a..6dd461cdca 100644 --- a/dom/media/MediaShutdownManager.cpp +++ b/dom/media/MediaShutdownManager.cpp @@ -9,7 +9,7 @@ #include "mozilla/StaticPtr.h" #include "MediaDecoder.h" #include "SharedThreadPool.h" -#include "prlog.h" +#include "mozilla/Logging.h" namespace mozilla { diff --git a/dom/media/MediaStreamGraph.cpp b/dom/media/MediaStreamGraph.cpp index a07f11dd64..d4b70adb52 100644 --- a/dom/media/MediaStreamGraph.cpp +++ b/dom/media/MediaStreamGraph.cpp @@ -16,7 +16,7 @@ #include "nsServiceManagerUtils.h" #include "nsWidgetsCID.h" #include "prerror.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/Attributes.h" #include "TrackUnionStream.h" #include "ImageContainer.h" diff --git a/dom/media/StateMirroring.h b/dom/media/StateMirroring.h index f12ad18945..dddd0c1bfe 100644 --- a/dom/media/StateMirroring.h +++ b/dom/media/StateMirroring.h @@ -16,7 +16,7 @@ #include "mozilla/UniquePtr.h" #include "mozilla/unused.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsISupportsImpl.h" /* diff --git a/dom/media/StreamBuffer.cpp b/dom/media/StreamBuffer.cpp index 88ac15372a..07d5aaa6d3 100644 --- a/dom/media/StreamBuffer.cpp +++ b/dom/media/StreamBuffer.cpp @@ -4,7 +4,7 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "StreamBuffer.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include namespace mozilla { diff --git a/dom/media/TrackUnionStream.cpp b/dom/media/TrackUnionStream.cpp index 90f4748f52..9f12bbb2a2 100644 --- a/dom/media/TrackUnionStream.cpp +++ b/dom/media/TrackUnionStream.cpp @@ -16,7 +16,7 @@ #include "nsServiceManagerUtils.h" #include "nsWidgetsCID.h" #include "prerror.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/Attributes.h" #include "TrackUnionStream.h" #include "ImageContainer.h" diff --git a/dom/media/VideoSegment.cpp b/dom/media/VideoSegment.cpp index c00e28a05f..4671963164 100644 --- a/dom/media/VideoSegment.cpp +++ b/dom/media/VideoSegment.cpp @@ -97,7 +97,7 @@ VideoSegment::AppendFrame(already_AddRefed&& aImage, bool aForceBlack) { VideoChunk* chunk = AppendChunk(aDuration); - VideoFrame frame(aImage, ThebesIntSize(aIntrinsicSize)); + VideoFrame frame(aImage, aIntrinsicSize); frame.SetForceBlack(aForceBlack); chunk->mFrame.TakeFrom(&frame); } diff --git a/dom/media/directshow/AudioSinkFilter.cpp b/dom/media/directshow/AudioSinkFilter.cpp index 3701a280a5..861b2606cc 100644 --- a/dom/media/directshow/AudioSinkFilter.cpp +++ b/dom/media/directshow/AudioSinkFilter.cpp @@ -8,7 +8,7 @@ #include "AudioSinkFilter.h" #include "AudioSinkInputPin.h" #include "VideoUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include diff --git a/dom/media/directshow/AudioSinkInputPin.cpp b/dom/media/directshow/AudioSinkInputPin.cpp index a7ad8854e3..847fa0ef75 100644 --- a/dom/media/directshow/AudioSinkInputPin.cpp +++ b/dom/media/directshow/AudioSinkInputPin.cpp @@ -7,7 +7,7 @@ #include "AudioSinkInputPin.h" #include "AudioSinkFilter.h" #include "SampleSink.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include diff --git a/dom/media/directshow/DirectShowUtils.h b/dom/media/directshow/DirectShowUtils.h index 8ff97df613..d54b43cec5 100644 --- a/dom/media/directshow/DirectShowUtils.h +++ b/dom/media/directshow/DirectShowUtils.h @@ -17,7 +17,7 @@ #undef GetPrevSibling #include "DShowTools.h" -#include "prlog.h" +#include "mozilla/Logging.h" namespace mozilla { diff --git a/dom/media/directshow/SampleSink.cpp b/dom/media/directshow/SampleSink.cpp index 30a36f6de7..56f3965776 100644 --- a/dom/media/directshow/SampleSink.cpp +++ b/dom/media/directshow/SampleSink.cpp @@ -8,7 +8,7 @@ #include "AudioSinkFilter.h" #include "AudioSinkInputPin.h" #include "VideoUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" using namespace mozilla::media; diff --git a/dom/media/directshow/SourceFilter.cpp b/dom/media/directshow/SourceFilter.cpp index 7dbad49cb4..bd48511bb4 100644 --- a/dom/media/directshow/SourceFilter.cpp +++ b/dom/media/directshow/SourceFilter.cpp @@ -9,7 +9,7 @@ #include "mozilla/RefPtr.h" #include "DirectShowUtils.h" #include "MP3FrameParser.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include using namespace mozilla::media; diff --git a/dom/media/encoder/MediaEncoder.cpp b/dom/media/encoder/MediaEncoder.cpp index 24fe809ec7..1f641af6f0 100644 --- a/dom/media/encoder/MediaEncoder.cpp +++ b/dom/media/encoder/MediaEncoder.cpp @@ -6,7 +6,7 @@ #include "MediaDecoder.h" #include "nsIPrincipal.h" #include "nsMimeTypes.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/Preferences.h" #include "mozilla/StaticPtr.h" diff --git a/dom/media/encoder/TrackEncoder.cpp b/dom/media/encoder/TrackEncoder.cpp index 93e0bac75b..b7b28e925b 100644 --- a/dom/media/encoder/TrackEncoder.cpp +++ b/dom/media/encoder/TrackEncoder.cpp @@ -5,7 +5,7 @@ #include "TrackEncoder.h" #include "AudioChannelFormat.h" #include "MediaStreamGraph.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "VideoUtils.h" #undef LOG diff --git a/dom/media/fmp4/MP4Decoder.cpp b/dom/media/fmp4/MP4Decoder.cpp index 0bc8c060ee..afe880145f 100644 --- a/dom/media/fmp4/MP4Decoder.cpp +++ b/dom/media/fmp4/MP4Decoder.cpp @@ -13,7 +13,7 @@ #include "nsCharSeparatedTokenizer.h" #include "nsContentTypeParser.h" #include "VideoUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #ifdef XP_WIN #include "mozilla/WindowsVersion.h" diff --git a/dom/media/gmp/GMPAudioDecoderParent.cpp b/dom/media/gmp/GMPAudioDecoderParent.cpp index 26170ae65b..eb923dd55a 100644 --- a/dom/media/gmp/GMPAudioDecoderParent.cpp +++ b/dom/media/gmp/GMPAudioDecoderParent.cpp @@ -9,7 +9,7 @@ #include "mozilla/unused.h" #include "GMPMessageUtils.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" namespace mozilla { diff --git a/dom/media/gmp/GMPContentParent.cpp b/dom/media/gmp/GMPContentParent.cpp index ef8d38826e..f89b005aa6 100644 --- a/dom/media/gmp/GMPContentParent.cpp +++ b/dom/media/gmp/GMPContentParent.cpp @@ -11,7 +11,7 @@ #include "GMPVideoDecoderParent.h" #include "GMPVideoEncoderParent.h" #include "mozIGeckoMediaPluginService.h" -#include "prlog.h" +#include "mozilla/Logging.h" namespace mozilla { diff --git a/dom/media/gmp/GMPParent.cpp b/dom/media/gmp/GMPParent.cpp index 7613764005..147b1e6722 100644 --- a/dom/media/gmp/GMPParent.cpp +++ b/dom/media/gmp/GMPParent.cpp @@ -4,7 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "GMPParent.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsComponentManagerUtils.h" #include "nsComponentManagerUtils.h" #include "nsIInputStream.h" diff --git a/dom/media/gmp/GMPService.cpp b/dom/media/gmp/GMPService.cpp index 0063e0c926..6d2ee655b2 100644 --- a/dom/media/gmp/GMPService.cpp +++ b/dom/media/gmp/GMPService.cpp @@ -6,7 +6,7 @@ #include "GMPServiceParent.h" #include "GMPServiceChild.h" #include "prio.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "GMPParent.h" #include "GMPVideoDecoderParent.h" #include "nsIObserverService.h" diff --git a/dom/media/gmp/GMPServiceParent.cpp b/dom/media/gmp/GMPServiceParent.cpp index 20af56e60f..c9491acb12 100644 --- a/dom/media/gmp/GMPServiceParent.cpp +++ b/dom/media/gmp/GMPServiceParent.cpp @@ -5,7 +5,7 @@ #include "GMPService.h" #include "prio.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "GMPParent.h" #include "GMPVideoDecoderParent.h" #include "nsIObserverService.h" diff --git a/dom/media/gmp/GMPVideoDecoderParent.cpp b/dom/media/gmp/GMPVideoDecoderParent.cpp index 852a835f18..ebad7f0828 100644 --- a/dom/media/gmp/GMPVideoDecoderParent.cpp +++ b/dom/media/gmp/GMPVideoDecoderParent.cpp @@ -4,7 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "GMPVideoDecoderParent.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/unused.h" #include "nsAutoRef.h" #include "nsThreadUtils.h" diff --git a/dom/media/gmp/GMPVideoEncoderParent.cpp b/dom/media/gmp/GMPVideoEncoderParent.cpp index 46d5f7cb9e..416bedefbe 100644 --- a/dom/media/gmp/GMPVideoEncoderParent.cpp +++ b/dom/media/gmp/GMPVideoEncoderParent.cpp @@ -4,7 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "GMPVideoEncoderParent.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "GMPVideoi420FrameImpl.h" #include "GMPVideoEncodedFrameImpl.h" #include "mozilla/unused.h" diff --git a/dom/media/imagecapture/ImageCapture.h b/dom/media/imagecapture/ImageCapture.h index 0761634e5d..8a2f25fe27 100644 --- a/dom/media/imagecapture/ImageCapture.h +++ b/dom/media/imagecapture/ImageCapture.h @@ -9,7 +9,7 @@ #include "mozilla/DOMEventTargetHelper.h" #include "mozilla/dom/ImageCaptureBinding.h" -#include "prlog.h" +#include "mozilla/Logging.h" namespace mozilla { diff --git a/dom/media/mediasource/ContainerParser.cpp b/dom/media/mediasource/ContainerParser.cpp index 342dd47ad0..7f7ba2704f 100644 --- a/dom/media/mediasource/ContainerParser.cpp +++ b/dom/media/mediasource/ContainerParser.cpp @@ -9,7 +9,7 @@ #include "WebMBufferedParser.h" #include "mozilla/Endian.h" #include "mp4_demuxer/MoofParser.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "MediaData.h" #ifdef MOZ_FMP4 #include "MP4Stream.h" diff --git a/dom/media/mediasource/MediaSource.cpp b/dom/media/mediasource/MediaSource.cpp index 732d89cc21..8856e63075 100644 --- a/dom/media/mediasource/MediaSource.cpp +++ b/dom/media/mediasource/MediaSource.cpp @@ -25,7 +25,7 @@ #include "nsPIDOMWindow.h" #include "nsString.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsServiceManagerUtils.h" struct JSContext; diff --git a/dom/media/mediasource/MediaSourceDecoder.cpp b/dom/media/mediasource/MediaSourceDecoder.cpp index 4d77cd6f51..f306415931 100644 --- a/dom/media/mediasource/MediaSourceDecoder.cpp +++ b/dom/media/mediasource/MediaSourceDecoder.cpp @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "MediaSourceDecoder.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/dom/HTMLMediaElement.h" #include "MediaDecoderStateMachine.h" #include "MediaSource.h" diff --git a/dom/media/mediasource/MediaSourceReader.cpp b/dom/media/mediasource/MediaSourceReader.cpp index 4a7fceb840..f37f5ffa6c 100644 --- a/dom/media/mediasource/MediaSourceReader.cpp +++ b/dom/media/mediasource/MediaSourceReader.cpp @@ -6,7 +6,7 @@ #include "MediaSourceReader.h" #include -#include "prlog.h" +#include "mozilla/Logging.h" #include "DecoderTraits.h" #include "MediaDecoderOwner.h" #include "MediaFormatReader.h" diff --git a/dom/media/mediasource/MediaSourceResource.h b/dom/media/mediasource/MediaSourceResource.h index b918c9ed7f..529e58de72 100644 --- a/dom/media/mediasource/MediaSourceResource.h +++ b/dom/media/mediasource/MediaSourceResource.h @@ -9,7 +9,7 @@ #include "MediaResource.h" #include "mozilla/Monitor.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* GetMediaSourceLog(); diff --git a/dom/media/mediasource/MediaSourceUtils.cpp b/dom/media/mediasource/MediaSourceUtils.cpp index ec88728aba..49cb39a185 100644 --- a/dom/media/mediasource/MediaSourceUtils.cpp +++ b/dom/media/mediasource/MediaSourceUtils.cpp @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "MediaSourceUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsPrintfCString.h" namespace mozilla { diff --git a/dom/media/mediasource/ResourceQueue.cpp b/dom/media/mediasource/ResourceQueue.cpp index c560bf7d53..a245ba7a85 100644 --- a/dom/media/mediasource/ResourceQueue.cpp +++ b/dom/media/mediasource/ResourceQueue.cpp @@ -6,7 +6,7 @@ #include "nsDeque.h" #include "MediaData.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* GetSourceBufferResourceLog(); diff --git a/dom/media/mediasource/SourceBuffer.cpp b/dom/media/mediasource/SourceBuffer.cpp index ee4e028b24..ccd760f688 100644 --- a/dom/media/mediasource/SourceBuffer.cpp +++ b/dom/media/mediasource/SourceBuffer.cpp @@ -19,7 +19,7 @@ #include "nsIEventTarget.h" #include "nsIRunnable.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include #include "TimeUnits.h" diff --git a/dom/media/mediasource/SourceBufferDecoder.cpp b/dom/media/mediasource/SourceBufferDecoder.cpp index 9f6927ac91..d9edcf0b55 100644 --- a/dom/media/mediasource/SourceBufferDecoder.cpp +++ b/dom/media/mediasource/SourceBufferDecoder.cpp @@ -6,7 +6,7 @@ #include "MediaSourceUtils.h" #include "SourceBufferDecoder.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "AbstractMediaDecoder.h" #include "MediaDecoderReader.h" diff --git a/dom/media/mediasource/SourceBufferList.cpp b/dom/media/mediasource/SourceBufferList.cpp index 245cc0cc8c..0b18a4f20c 100644 --- a/dom/media/mediasource/SourceBufferList.cpp +++ b/dom/media/mediasource/SourceBufferList.cpp @@ -14,7 +14,7 @@ #include "nsIRunnable.h" #include "nsString.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* GetMediaSourceLog(); extern PRLogModuleInfo* GetMediaSourceAPILog(); diff --git a/dom/media/mediasource/SourceBufferResource.cpp b/dom/media/mediasource/SourceBufferResource.cpp index 8fc5437a22..87e67ecfe1 100644 --- a/dom/media/mediasource/SourceBufferResource.cpp +++ b/dom/media/mediasource/SourceBufferResource.cpp @@ -10,7 +10,7 @@ #include "nsISeekableStream.h" #include "nsISupports.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "MediaData.h" PRLogModuleInfo* GetSourceBufferResourceLog() diff --git a/dom/media/mediasource/SourceBufferResource.h b/dom/media/mediasource/SourceBufferResource.h index 2d19635b6c..0fe4575575 100644 --- a/dom/media/mediasource/SourceBufferResource.h +++ b/dom/media/mediasource/SourceBufferResource.h @@ -18,7 +18,7 @@ #include "nsString.h" #include "nsTArray.h" #include "nscore.h" -#include "prlog.h" +#include "mozilla/Logging.h" #define UNIMPLEMENTED() { /* Logging this is too spammy to do by default */ } diff --git a/dom/media/mediasource/TrackBuffer.cpp b/dom/media/mediasource/TrackBuffer.cpp index b2f9b979fa..67a26459b0 100644 --- a/dom/media/mediasource/TrackBuffer.cpp +++ b/dom/media/mediasource/TrackBuffer.cpp @@ -20,7 +20,7 @@ #include "nsError.h" #include "nsIRunnable.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* GetMediaSourceLog(); diff --git a/dom/media/omx/I420ColorConverterHelper.cpp b/dom/media/omx/I420ColorConverterHelper.cpp index 08c3b58c53..2ea6bef8ca 100644 --- a/dom/media/omx/I420ColorConverterHelper.cpp +++ b/dom/media/omx/I420ColorConverterHelper.cpp @@ -8,7 +8,7 @@ #include -#include "prlog.h" +#include "mozilla/Logging.h" PRLogModuleInfo *gI420ColorConverterHelperLog; #define LOG(msg...) PR_LOG(gI420ColorConverterHelperLog, PR_LOG_WARNING, (msg)) diff --git a/dom/media/omx/OmxDecoder.cpp b/dom/media/omx/OmxDecoder.cpp index 5c76500134..a97f7e6747 100644 --- a/dom/media/omx/OmxDecoder.cpp +++ b/dom/media/omx/OmxDecoder.cpp @@ -26,7 +26,7 @@ #include "mozilla/Monitor.h" #include "nsMimeTypes.h" #include "MPAPI.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "GonkNativeWindow.h" #include "GonkNativeWindowClient.h" diff --git a/dom/media/platforms/apple/AppleATDecoder.cpp b/dom/media/platforms/apple/AppleATDecoder.cpp index ff3c99619a..44a0b33a63 100644 --- a/dom/media/platforms/apple/AppleATDecoder.cpp +++ b/dom/media/platforms/apple/AppleATDecoder.cpp @@ -10,7 +10,7 @@ #include "mp4_demuxer/Adts.h" #include "MediaInfo.h" #include "AppleATDecoder.h" -#include "prlog.h" +#include "mozilla/Logging.h" PRLogModuleInfo* GetAppleMediaLog(); #define LOG(...) PR_LOG(GetAppleMediaLog(), PR_LOG_DEBUG, (__VA_ARGS__)) diff --git a/dom/media/platforms/apple/AppleDecoderModule.cpp b/dom/media/platforms/apple/AppleDecoderModule.cpp index ee829cddb4..e54e190cfa 100644 --- a/dom/media/platforms/apple/AppleDecoderModule.cpp +++ b/dom/media/platforms/apple/AppleDecoderModule.cpp @@ -13,7 +13,7 @@ #include "AppleVTLinker.h" #include "mozilla/Preferences.h" #include "mozilla/DebugOnly.h" -#include "prlog.h" +#include "mozilla/Logging.h" PRLogModuleInfo* GetAppleMediaLog() { static PRLogModuleInfo* log = nullptr; diff --git a/dom/media/platforms/apple/AppleVDADecoder.cpp b/dom/media/platforms/apple/AppleVDADecoder.cpp index 57764c2963..277f9be313 100644 --- a/dom/media/platforms/apple/AppleVDADecoder.cpp +++ b/dom/media/platforms/apple/AppleVDADecoder.cpp @@ -18,7 +18,7 @@ #include "nsAutoPtr.h" #include "nsCocoaFeatures.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "VideoUtils.h" #include diff --git a/dom/media/platforms/apple/AppleVTDecoder.cpp b/dom/media/platforms/apple/AppleVTDecoder.cpp index 6340f6b1f2..0e408c5d03 100644 --- a/dom/media/platforms/apple/AppleVTDecoder.cpp +++ b/dom/media/platforms/apple/AppleVTDecoder.cpp @@ -16,7 +16,7 @@ #include "mozilla/ArrayUtils.h" #include "nsAutoPtr.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "VideoUtils.h" PRLogModuleInfo* GetAppleMediaLog(); diff --git a/dom/media/platforms/ffmpeg/FFmpegLog.cpp b/dom/media/platforms/ffmpeg/FFmpegLog.cpp index 6053a53f13..1686be8433 100644 --- a/dom/media/platforms/ffmpeg/FFmpegLog.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegLog.cpp @@ -4,7 +4,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" PRLogModuleInfo* GetFFmpegDecoderLog() { diff --git a/dom/media/platforms/gonk/GonkAudioDecoderManager.cpp b/dom/media/platforms/gonk/GonkAudioDecoderManager.cpp index b3c516043e..2b4197fb20 100644 --- a/dom/media/platforms/gonk/GonkAudioDecoderManager.cpp +++ b/dom/media/platforms/gonk/GonkAudioDecoderManager.cpp @@ -12,7 +12,7 @@ #include "mp4_demuxer/Adts.h" #include "VideoUtils.h" #include "nsTArray.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "stagefright/MediaBuffer.h" #include "stagefright/MetaData.h" #include "stagefright/MediaErrors.h" diff --git a/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp b/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp index 82d48b118a..fcc3e9303b 100644 --- a/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp +++ b/dom/media/platforms/gonk/GonkMediaDataDecoder.cpp @@ -9,7 +9,7 @@ #include "MediaCodecProxy.h" #include "MediaData.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include #define GMDD_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkMediaDataDecoder", __VA_ARGS__) diff --git a/dom/media/platforms/gonk/GonkVideoDecoderManager.cpp b/dom/media/platforms/gonk/GonkVideoDecoderManager.cpp index 8df60e47ca..99436252a1 100644 --- a/dom/media/platforms/gonk/GonkVideoDecoderManager.cpp +++ b/dom/media/platforms/gonk/GonkVideoDecoderManager.cpp @@ -13,7 +13,7 @@ #include "VideoUtils.h" #include "nsThreadUtils.h" #include "Layers.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "stagefright/MediaBuffer.h" #include "stagefright/MetaData.h" #include "stagefright/MediaErrors.h" diff --git a/dom/media/platforms/wmf/MFTDecoder.cpp b/dom/media/platforms/wmf/MFTDecoder.cpp index 012d50629d..cb56d9b293 100644 --- a/dom/media/platforms/wmf/MFTDecoder.cpp +++ b/dom/media/platforms/wmf/MFTDecoder.cpp @@ -7,7 +7,7 @@ #include "MFTDecoder.h" #include "nsThreadUtils.h" #include "WMFUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" PRLogModuleInfo* GetDemuxerLog(); #define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__)) diff --git a/dom/media/platforms/wmf/WMFAudioMFTManager.cpp b/dom/media/platforms/wmf/WMFAudioMFTManager.cpp index 4b3b43a8a0..ba4a02e870 100644 --- a/dom/media/platforms/wmf/WMFAudioMFTManager.cpp +++ b/dom/media/platforms/wmf/WMFAudioMFTManager.cpp @@ -10,7 +10,7 @@ #include "WMFUtils.h" #include "nsTArray.h" -#include "prlog.h" +#include "mozilla/Logging.h" PRLogModuleInfo* GetDemuxerLog(); #define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__)) diff --git a/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp b/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp index 76889a3ddb..90bf35a9f9 100644 --- a/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp +++ b/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp @@ -9,7 +9,7 @@ #include "WMFUtils.h" #include "nsTArray.h" -#include "prlog.h" +#include "mozilla/Logging.h" PRLogModuleInfo* GetDemuxerLog(); #define LOG(...) PR_LOG(GetDemuxerLog(), PR_LOG_DEBUG, (__VA_ARGS__)) diff --git a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp index a5eba0b649..9ee77aaee8 100644 --- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp +++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp @@ -15,7 +15,7 @@ #include "Layers.h" #include "mozilla/layers/LayersTypes.h" #include "MediaInfo.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "gfx2DGlue.h" #include "gfxWindowsPlatform.h" #include "IMFYCbCrImage.h" diff --git a/dom/media/systemservices/LoadManager.cpp b/dom/media/systemservices/LoadManager.cpp index acf336848f..636ed96588 100644 --- a/dom/media/systemservices/LoadManager.cpp +++ b/dom/media/systemservices/LoadManager.cpp @@ -6,7 +6,7 @@ #include "LoadManager.h" #include "LoadMonitor.h" #include "nsString.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prtime.h" #include "prinrval.h" #include "prsystem.h" diff --git a/dom/media/systemservices/LoadMonitor.cpp b/dom/media/systemservices/LoadMonitor.cpp index 97becfef81..f9fb724093 100644 --- a/dom/media/systemservices/LoadMonitor.cpp +++ b/dom/media/systemservices/LoadMonitor.cpp @@ -6,7 +6,7 @@ #include "LoadMonitor.h" #include "LoadManager.h" #include "nsString.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prtime.h" #include "prinrval.h" #include "prsystem.h" diff --git a/dom/media/systemservices/MediaChild.cpp b/dom/media/systemservices/MediaChild.cpp index 9b06a602be..3e38d56774 100644 --- a/dom/media/systemservices/MediaChild.cpp +++ b/dom/media/systemservices/MediaChild.cpp @@ -10,7 +10,7 @@ #include "mozilla/ipc/PBackgroundChild.h" #include "nsGlobalWindow.h" #include "mozilla/MediaManager.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsQueryObject.h" #undef LOG diff --git a/dom/media/systemservices/MediaParent.cpp b/dom/media/systemservices/MediaParent.cpp index 5239233afb..8fd22b3f79 100644 --- a/dom/media/systemservices/MediaParent.cpp +++ b/dom/media/systemservices/MediaParent.cpp @@ -17,7 +17,7 @@ #include "nsILineInputStream.h" #include "nsAppDirectoryServiceDefs.h" #include "nsISupportsImpl.h" -#include "prlog.h" +#include "mozilla/Logging.h" #undef LOG PRLogModuleInfo *gMediaParentLog; diff --git a/dom/media/systemservices/OpenSLESProvider.cpp b/dom/media/systemservices/OpenSLESProvider.cpp index 8f6ad459a3..e18e95abfb 100644 --- a/dom/media/systemservices/OpenSLESProvider.cpp +++ b/dom/media/systemservices/OpenSLESProvider.cpp @@ -4,7 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "OpenSLESProvider.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsDebug.h" #include diff --git a/dom/media/test/test_audio2.html b/dom/media/test/test_audio2.html index e365ec4e06..ae01261899 100644 --- a/dom/media/test/test_audio2.html +++ b/dom/media/test/test_audio2.html @@ -21,7 +21,7 @@ function startTest(test, token) { manager.started(token); var a1 = new Audio(test.name); is(a1.getAttribute("preload"), "auto", "Preload automatically set to auto"); - is(a1.src.match("/[^/]+$"), "/" + test.name, "src OK"); + ok(a1.src.endsWith("/" + test.name), "src OK"); manager.finished(token); } diff --git a/dom/media/test/test_preload_attribute.html b/dom/media/test/test_preload_attribute.html index 9ce0e29a13..685ad969c0 100644 --- a/dom/media/test/test_preload_attribute.html +++ b/dom/media/test/test_preload_attribute.html @@ -24,10 +24,10 @@ var v1 = document.getElementById('v1'); var a1 = document.getElementById('a1'); var v2 = document.getElementById('v2'); var a2 = document.getElementById('a2'); -is(v1.getAttribute("preload"), undefined, "video preload via getAttribute should be undefined by default"); -is(a1.getAttribute("preload"), undefined, "video preload via getAttribute should be undefined by default"); -is(v1.preload, "", "v1.preload should be undefined by default"); -is(a1.preload, "", "a1.preload should be undefined by default"); +is(v1.getAttribute("preload"), null, "video preload via getAttribute should be null by default"); +is(a1.getAttribute("preload"), null, "video preload via getAttribute should be null by default"); +is(v1.preload, "", "v1.preload should be empty by default"); +is(a1.preload, "", "a1.preload should be empty by default"); is(v2.preload, "auto", "v2.preload should be auto"); is(a2.preload, "auto", "a2.preload should be auto"); diff --git a/dom/media/test/test_texttrackcue.html b/dom/media/test/test_texttrackcue.html index 508237c644..22ac8f1633 100644 --- a/dom/media/test/test_texttrackcue.html +++ b/dom/media/test/test_texttrackcue.html @@ -187,7 +187,7 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.regions.enabled", true]]}, // Check that we can create and add new VTTCues var vttCue = new VTTCue(3.999, 4, "foo"); - is(vttCue.track, undefined, "Cue's track should be undefined."); + is(vttCue.track, null, "Cue's track should be null."); trackElement.track.addCue(vttCue); is(cue.track, trackElement.track, "Cue's track should be defined."); is(cueList.length, 7, "Cue list length should now be 7."); diff --git a/dom/media/tests/mochitest/dataChannel.js b/dom/media/tests/mochitest/dataChannel.js index e31f4b3739..6b5bfc68fb 100644 --- a/dom/media/tests/mochitest/dataChannel.js +++ b/dom/media/tests/mochitest/dataChannel.js @@ -52,8 +52,8 @@ var commandsCheckDataChannel = [ }, function SEND_BLOB(test) { - var contents = ["At vero eos et accusam et justo duo dolores et ea rebum."]; - var blob = new Blob(contents, { "type" : "text/plain" }); + var contents = "At vero eos et accusam et justo duo dolores et ea rebum."; + var blob = new Blob([contents], { "type" : "text/plain" }); return test.send(blob).then(result => { ok(result.data instanceof Blob, "Received data is of instance Blob"); diff --git a/dom/media/webspeech/synth/SpeechSynthesis.cpp b/dom/media/webspeech/synth/SpeechSynthesis.cpp index e363def169..bf0e8ff11e 100644 --- a/dom/media/webspeech/synth/SpeechSynthesis.cpp +++ b/dom/media/webspeech/synth/SpeechSynthesis.cpp @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsSpeechTask.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/Element.h" diff --git a/dom/media/wmf/WMFUtils.cpp b/dom/media/wmf/WMFUtils.cpp index 04d2f500b3..aeedeb5be1 100644 --- a/dom/media/wmf/WMFUtils.cpp +++ b/dom/media/wmf/WMFUtils.cpp @@ -9,7 +9,7 @@ #include "mozilla/ArrayUtils.h" #include "mozilla/RefPtr.h" #include "mozilla/WindowsVersion.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsThreadUtils.h" #include "nsWindowsHelpers.h" #include "mozilla/CheckedInt.h" diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp index 24fa898ef6..ff2ecd3cc1 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.cpp +++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp @@ -10,7 +10,7 @@ #include "base/basictypes.h" #endif -#include "prlog.h" +#include "mozilla/Logging.h" #include "prmem.h" #include "nscore.h" #include "prenv.h" diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index d60af0bfb2..d30efffcbe 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -1316,7 +1316,7 @@ GetOffsetRootContent(nsIFrame* aFrame) int32_t newAPD = f ? f->PresContext()->AppUnitsPerDevPixel() : 0; if (!f || newAPD != currAPD) { // Convert docOffset to the right APD and add it to offset. - offset += docOffset.ConvertAppUnits(currAPD, apd); + offset += docOffset.ScaleToOtherAppUnits(currAPD, apd); docOffset.x = docOffset.y = 0; } currAPD = newAPD; @@ -1324,7 +1324,7 @@ GetOffsetRootContent(nsIFrame* aFrame) } } - offset += docOffset.ConvertAppUnits(currAPD, apd); + offset += docOffset.ScaleToOtherAppUnits(currAPD, apd); return offset; } diff --git a/dom/plugins/base/nsPluginLogging.h b/dom/plugins/base/nsPluginLogging.h index 80260b07f1..93a59eee94 100644 --- a/dom/plugins/base/nsPluginLogging.h +++ b/dom/plugins/base/nsPluginLogging.h @@ -8,7 +8,7 @@ #ifndef nsPluginLogging_h__ #define nsPluginLogging_h__ -#include "prlog.h" +#include "mozilla/Logging.h" #ifdef PR_LOGGING diff --git a/dom/plugins/ipc/PluginMessageUtils.h b/dom/plugins/ipc/PluginMessageUtils.h index 5d0cd35181..ec5b6d80ee 100644 --- a/dom/plugins/ipc/PluginMessageUtils.h +++ b/dom/plugins/ipc/PluginMessageUtils.h @@ -20,7 +20,7 @@ #include "nsAutoPtr.h" #include "nsString.h" #include "nsTArray.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsHashKeys.h" #ifdef XP_MACOSX #include "PluginInterposeOSX.h" diff --git a/dom/plugins/test/mochitest/cocoa_focus.html b/dom/plugins/test/mochitest/cocoa_focus.html index 53deac6e20..ca35fd7a1f 100644 --- a/dom/plugins/test/mochitest/cocoa_focus.html +++ b/dom/plugins/test/mochitest/cocoa_focus.html @@ -14,8 +14,19 @@ window.opener.SimpleTest.ok(aValue, aMessage); } - function runTests() { - netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + function synthesizeNativeMouseEvent(aX, aY, aNativeMsg, aModifiers, aElement, aCallback) { + var observer = { + observe: function(aSubject, aTopic, aData) { + if (aCallback && aTopic == "mouseevent") { + aCallback(aData); + } + } + }; + SpecialPowers.DOMWindowUtils.sendNativeMouseEvent(aX, aY, aNativeMsg, aModifiers, aElement, observer); + return true; + } + + function* runTests() { var utils = SpecialPowers.DOMWindowUtils; var scale = utils.screenPixelsPerCSSPixel; @@ -35,7 +46,6 @@ if (plugin1.getEventModel() != 1) { window.opener.todo(false, "Skipping this test when not testing the Cocoa event model"); - window.opener.testsFinished(); return; } @@ -56,8 +66,8 @@ is(initialStateUnknown, true, "Initial state should be unknown, assumed false."); // Give the plugin focus (the window is already focused). - utils.sendNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseDown, 0, plugin1); - utils.sendNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseUp, 0, plugin1); + yield synthesizeNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseDown, 0, plugin1, continueTest); + yield synthesizeNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseUp, 0, plugin1, continueTest); expectedEventCount++; is(plugin1.getFocusState(), true, "(1) Plugin should have focus."); @@ -67,7 +77,7 @@ // change plugin focus. // Blur the window. - window.blur(); + SpecialPowers.focus(opener); is(plugin1.getFocusState(), true, "(2) Plugin should still have focus."); is(plugin1.getFocusEventCount(), expectedEventCount, "Focus event count should be " + expectedEventCount); @@ -79,8 +89,8 @@ is(plugin1.getFocusEventCount(), expectedEventCount, "Focus event count should be " + expectedEventCount); // Take focus from the plugin. - utils.sendNativeMouseEvent(plugin2X * scale, plugin2Y * scale, NSLeftMouseDown, 0, plugin2); - utils.sendNativeMouseEvent(plugin2X * scale, plugin2Y * scale, NSLeftMouseUp, 0, plugin2); + yield synthesizeNativeMouseEvent(plugin2X * scale, plugin2Y * scale, NSLeftMouseDown, 0, plugin2, continueTest); + yield synthesizeNativeMouseEvent(plugin2X * scale, plugin2Y * scale, NSLeftMouseUp, 0, plugin2, continueTest); expectedEventCount++; is(plugin1.getFocusState(), false, "(4) Plugin should not have focus."); @@ -90,12 +100,12 @@ // changes that took place while the window was inactive. // Give the plugin focus (the window is already focused). - utils.sendNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseDown, 0, plugin1); - utils.sendNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseUp, 0, plugin1); + yield synthesizeNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseDown, 0, plugin1, continueTest); + yield synthesizeNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseUp, 0, plugin1, continueTest); expectedEventCount++; // Blur the window. - window.blur(); + SpecialPowers.focus(opener); // Take focus from the plugin while the window is blurred. plugin2.focus(); @@ -104,17 +114,28 @@ is(plugin1.getFocusEventCount(), expectedEventCount, "Focus event count should be " + expectedEventCount); // Focus the window. - window.focus(); + SpecialPowers.focus(window); expectedEventCount++; is(plugin1.getFocusState(), false, "(6) Plugin should not have focus."); is(plugin1.getFocusEventCount(), expectedEventCount, "Focus event count should be " + expectedEventCount); + } - window.opener.testsFinished(); + var gTestContinuation = null; + function continueTest() { + if (!gTestContinuation) { + gTestContinuation = runTests(); + } + var ret = gTestContinuation.next(); + if (ret.done) { + window.opener.testsFinished(); + } else { + is(ret.value, true, "Mouse event successfully synthesized"); + } } // Onload hander doesn't work for these tests -- no events arrive at the plugin. - window.opener.SimpleTest.waitForFocus(runTests, window); + window.opener.SimpleTest.waitForFocus(continueTest, window); diff --git a/dom/plugins/test/mochitest/cocoa_window_focus.html b/dom/plugins/test/mochitest/cocoa_window_focus.html index a71aa24ed5..8305b19a4b 100644 --- a/dom/plugins/test/mochitest/cocoa_window_focus.html +++ b/dom/plugins/test/mochitest/cocoa_window_focus.html @@ -53,9 +53,7 @@ ok(false, "Plugin does not know its initial top-level window activation state!"); } - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - var fm = SpecialPowers.Cc["@mozilla.org/focus-manager;1"]. - getService(SpecialPowers.Ci.nsIFocusManager); + var fm = SpecialPowers.Services.focus; waitForFocus(function() { // Make sure the plugin handled the focus event before checking. @@ -69,7 +67,6 @@ is(plugin2.getTopLevelWindowActivationEventCount(), expectedEventCount, "Window focus event count should be " + expectedEventCount); // Bring our window back to the front and make sure plugins were properly notified. - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); fm.focusedWindow = window; waitForFocus(function() { @@ -91,7 +88,6 @@ // Send our window to the back and make sure plugins were properly notified. // Calling window.blur() is not allowed. - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); fm.focusedWindow = window.opener; } diff --git a/dom/plugins/test/mochitest/test_cocoa_focus.html b/dom/plugins/test/mochitest/test_cocoa_focus.html index c1f5313201..66de558bbc 100644 --- a/dom/plugins/test/mochitest/test_cocoa_focus.html +++ b/dom/plugins/test/mochitest/test_cocoa_focus.html @@ -3,6 +3,7 @@ NPCocoaEventFocusChanged Tests + diff --git a/dom/plugins/test/mochitest/test_cocoa_window_focus.html b/dom/plugins/test/mochitest/test_cocoa_window_focus.html index dc728bd815..c94f25a6f1 100644 --- a/dom/plugins/test/mochitest/test_cocoa_window_focus.html +++ b/dom/plugins/test/mochitest/test_cocoa_window_focus.html @@ -3,6 +3,7 @@ NPCocoaEventWindowFocusChanged Tests + diff --git a/dom/plugins/test/mochitest/test_npruntime_identifiers.html b/dom/plugins/test/mochitest/test_npruntime_identifiers.html index cba0355440..33b5d41b81 100644 --- a/dom/plugins/test/mochitest/test_npruntime_identifiers.html +++ b/dom/plugins/test/mochitest/test_npruntime_identifiers.html @@ -33,7 +33,13 @@ is(reflector[prop], prop, "Property " + prop); } - for (i = -10; i < 10; ++i) { + for (i = -10; i < 0; ++i) { + is(reflector[i], String(i), "Property " + i); + prop = "prop" + i; + is(reflector[prop], prop, "Property " + prop); + } + + for (i = 0; i < 10; ++i) { is(reflector[i], i, "Property " + i); prop = "prop" + i; is(reflector[prop], prop, "Property " + prop); diff --git a/dom/plugins/test/mochitest/test_propertyAndMethod.html b/dom/plugins/test/mochitest/test_propertyAndMethod.html index db08715a64..226f1a2960 100644 --- a/dom/plugins/test/mochitest/test_propertyAndMethod.html +++ b/dom/plugins/test/mochitest/test_propertyAndMethod.html @@ -34,7 +34,7 @@ ok(isNaN(plugin.propertyAndMethod + 0), "Shouldn't be set yet!"); plugin.propertyAndMethod = 5; - is(plugin.propertyAndMethod, 5, "Should be set to 5!"); + is(+plugin.propertyAndMethod, 5, "Should be set to 5!"); delete pluginProto.propertyAndMethod; ok(isNaN(plugin.propertyAndMethod + 0), "Shouldn't be set any more!"); diff --git a/dom/security/nsCSPContext.cpp b/dom/security/nsCSPContext.cpp index c810ab15fa..ef13e914c9 100644 --- a/dom/security/nsCSPContext.cpp +++ b/dom/security/nsCSPContext.cpp @@ -34,7 +34,7 @@ #include "nsSupportsPrimitives.h" #include "nsThreadUtils.h" #include "nsString.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/dom/CSPReportBinding.h" #include "mozilla/net/ReferrerPolicy.h" #include "nsINetworkInterceptController.h" diff --git a/dom/security/nsCSPService.cpp b/dom/security/nsCSPService.cpp index dffe056ec9..9c54fb8161 100644 --- a/dom/security/nsCSPService.cpp +++ b/dom/security/nsCSPService.cpp @@ -3,7 +3,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsString.h" #include "nsCOMPtr.h" #include "nsIURI.h" diff --git a/dom/security/nsCSPUtils.h b/dom/security/nsCSPUtils.h index 505674d85a..bb3e31c0bb 100644 --- a/dom/security/nsCSPUtils.h +++ b/dom/security/nsCSPUtils.h @@ -13,7 +13,7 @@ #include "nsString.h" #include "nsTArray.h" #include "nsUnicharUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" /* =============== Logging =================== */ diff --git a/dom/security/nsMixedContentBlocker.cpp b/dom/security/nsMixedContentBlocker.cpp index c76a4d8201..24619eb18f 100644 --- a/dom/security/nsMixedContentBlocker.cpp +++ b/dom/security/nsMixedContentBlocker.cpp @@ -32,7 +32,7 @@ #include "nsAsyncRedirectVerifyHelper.h" #include "mozilla/LoadInfo.h" -#include "prlog.h" +#include "mozilla/Logging.h" using namespace mozilla; diff --git a/dom/settings/tests/test_settings_basics.html b/dom/settings/tests/test_settings_basics.html index d9fce69644..c8e67842fc 100644 --- a/dom/settings/tests/test_settings_basics.html +++ b/dom/settings/tests/test_settings_basics.html @@ -70,23 +70,23 @@ function equals(o1, o2) { function observer1(setting) { is(setting.settingName, "screen.brightness", "Same settingName"); - is(setting.settingValue, "0.7", "Same settingvalue"); + is(setting.settingValue, 0.7, "Same settingvalue"); }; function observer2(setting) { is(setting.settingName, "screen.brightness", "Same settingName"); - is(setting.settingValue, "0.7", "Same settingvalue"); + is(setting.settingValue, 0.7, "Same settingvalue"); }; function observerWithNext(setting) { is(setting.settingName, "screen.brightness", "Same settingName"); - is(setting.settingValue, "0.7", "Same settingvalue"); + is(setting.settingValue, 0.7, "Same settingvalue"); next(); }; function onsettingschangeWithNext(event) { is(event.settingName, "screen.brightness", "Same settingName"); - is(event.settingValue, "0.7", "Same settingvalue"); + is(event.settingValue, 0.7, "Same settingvalue"); next(); }; diff --git a/dom/settings/tests/test_settings_onsettingchange.html b/dom/settings/tests/test_settings_onsettingchange.html index da00103d7c..86030cced2 100644 --- a/dom/settings/tests/test_settings_onsettingchange.html +++ b/dom/settings/tests/test_settings_onsettingchange.html @@ -38,13 +38,13 @@ function onFailure() { function observer1(setting) { dump("observer 1 called!\n"); is(setting.settingName, "screen.brightness", "Same settingName"); - is(setting.settingValue, "0.7", "Same settingvalue"); + is(setting.settingValue, 0.7, "Same settingvalue"); }; function observer2(setting) { dump("observer 2 called!\n"); is(setting.settingName, "screen.brightness", "Same settingName"); - is(setting.settingValue, "0.7", "Same settingvalue"); + is(setting.settingValue, 0.7, "Same settingvalue"); }; var calls = 0; @@ -56,14 +56,14 @@ function observerOnlyCalledOnce(setting) { function observerWithNext(setting) { dump("observer with next called!\n"); is(setting.settingName, "screen.brightness", "Same settingName"); - is(setting.settingValue, "0.7", "Same settingvalue"); + is(setting.settingValue, 0.7, "Same settingvalue"); next(); }; function onsettingschangeWithNext(event) { dump("onsettingschangewithnext called!\n"); is(event.settingName, "screen.brightness", "Same settingName"); - is(event.settingValue, "0.7", "Same settingvalue"); + is(event.settingValue, 0.7, "Same settingvalue"); next(); }; diff --git a/dom/svg/test/test_scientific.html b/dom/svg/test/test_scientific.html index 54a6866163..482738514c 100644 --- a/dom/svg/test/test_scientific.html +++ b/dom/svg/test/test_scientific.html @@ -28,30 +28,30 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=302971 // ordinary rect.setAttribute("stroke-width", "5"); - is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 5, "Ordinary"); + is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "5", "Ordinary"); // valid exponential notation rect.setAttribute("stroke-width", "4E1"); - is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 40, "Exponent"); + is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "40", "Exponent"); rect.setAttribute("stroke-width", "6e1"); - is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 60, "Lower-case Exponent"); + is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "60", "Lower-case Exponent"); rect.setAttribute("stroke-width", "2E+1"); - is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 20, "Positive Exponent"); + is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "20", "Positive Exponent"); rect.setAttribute("stroke-width", "100E-1"); - is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 10, "Negative Exponent"); + is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "10", "Negative Exponent"); rect.setAttribute("stroke-width", "0.7E1"); - is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 7, "Floating Point with Exponent"); + is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "7", "Floating Point with Exponent"); rect.setAttribute("stroke-width", "50.0E-1"); - is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 5, "Floating Point with Negative Exponent"); + is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "5", "Floating Point with Negative Exponent"); rect.setAttribute("stroke-width", "0.8E+1"); - is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), 8, "Floating Point with Positive Exponent"); + is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "8", "Floating Point with Positive Exponent"); rect.setAttribute("stroke-width", "4E1px"); is(doc.defaultView.getComputedStyle(rect, '').getPropertyValue("stroke-width"), "40px", "Units"); diff --git a/dom/tests/mochitest/bugs/test_bug346659.html b/dom/tests/mochitest/bugs/test_bug346659.html index f953c3de88..f1029299a2 100644 --- a/dom/tests/mochitest/bugs/test_bug346659.html +++ b/dom/tests/mochitest/bugs/test_bug346659.html @@ -92,16 +92,16 @@ function messageReceiver(evt) { switch (testNumber) { case 1: - is(testResult, 1, "Props on new window should be preserved when loading"); + is(testResult, "1", "Props on new window should be preserved when loading"); break; case 2: - is(testResult, 2, "Props on new window should be preserved when writing"); + is(testResult, "2", "Props on new window should be preserved when writing"); break; case 3: - is(testResult, 3, "Props on window opened from new window should be preserved when loading"); + is(testResult, "3", "Props on window opened from new window should be preserved when loading"); break; case 4: - is(testResult, 4, "Props on window opened from new window should be preserved when writing"); + is(testResult, "4", "Props on window opened from new window should be preserved when writing"); break; case 5: is(testResult, "undefined", "Props on new window's child should go away when loading"); @@ -110,7 +110,7 @@ function messageReceiver(evt) { is(testResult, "undefined", "Props on new window's child should go away when writing"); break; case 7: - is(testResult, 7, "Props on different-domain window opened from different-domain new window can stay"); + is(testResult, "7", "Props on different-domain window opened from different-domain new window can stay"); break; case 9: is(testResult, "undefined", "Props on different-domain new window's child should go away when loading"); diff --git a/dom/tests/mochitest/bugs/test_bug437361.html b/dom/tests/mochitest/bugs/test_bug437361.html index 6bac1296af..e6d00e1b3f 100644 --- a/dom/tests/mochitest/bugs/test_bug437361.html +++ b/dom/tests/mochitest/bugs/test_bug437361.html @@ -16,7 +16,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=437361 is(true, SpecialPowers.getBoolPref("dom.disable_open_during_load"), "mozprefs sanity check"); var rv = window.showModalDialog( // should be blocked without exception "data:text/html,"); - is(rv, undefined, "Modal dialog opened unexpectedly."); + is(rv, null, "Modal dialog opened unexpectedly."); } function testModalDialogAllowed() { diff --git a/dom/tests/mochitest/bugs/test_bug504862.html b/dom/tests/mochitest/bugs/test_bug504862.html index 5c6d0b84e6..680edf6ce9 100644 --- a/dom/tests/mochitest/bugs/test_bug504862.html +++ b/dom/tests/mochitest/bugs/test_bug504862.html @@ -30,7 +30,7 @@ function runTest() { result = window.showModalDialog("http://test1.example.com/tests/dom/tests/mochitest/bugs/file_bug504862.html", "my args"); - is(result, null, "Able to see return value from cross origin dialog."); + is(result, undefined, "Able to see return value from cross origin dialog."); SimpleTest.finish(); } diff --git a/dom/tests/mochitest/bugs/test_bug531176.html b/dom/tests/mochitest/bugs/test_bug531176.html index 63ca296ac7..2525d5b63f 100644 --- a/dom/tests/mochitest/bugs/test_bug531176.html +++ b/dom/tests/mochitest/bugs/test_bug531176.html @@ -22,7 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=531176 var errorCount = 0; function errorHandler(msg, filename, linenr) { is(msg, "SyntaxError: expected expression, got ';'", "Wrong error!"); - is(filename, window.location, "Wrong filename!"); + is(filename, String(window.location), "Wrong filename!"); is(linenr, 1, "Wrong linenr!"); ++errorCount; } @@ -35,7 +35,7 @@ is(errorCount, 1, "Error handler should have been called! (1)"); function recursiveHandler(msg, filename, linenr) { is(msg, "SyntaxError: expected expression, got ';'", "Wrong error!"); - is(filename, window.location, "Wrong filename!"); + is(filename, String(window.location), "Wrong filename!"); is(linenr, 1, "Wrong linenr!"); ++errorCount; document.body.setAttribute("onclick", "var z=;"); diff --git a/dom/tests/mochitest/bugs/test_bug581072.html b/dom/tests/mochitest/bugs/test_bug581072.html index 12588dd5d6..9590a6e633 100644 --- a/dom/tests/mochitest/bugs/test_bug581072.html +++ b/dom/tests/mochitest/bugs/test_bug581072.html @@ -21,7 +21,7 @@ SimpleTest.waitForExplicitFinish(); SimpleTest.requestFlakyTimeout("untriaged"); /** Test for Bug 581072 **/ -var longTimerFired = 0; +var longTimerFired = false; // Set up a one-hour timeout setTimeout(function() { longTimerFired = true; }, 3600000); diff --git a/dom/tests/mochitest/bugs/test_bug593174.html b/dom/tests/mochitest/bugs/test_bug593174.html index c3241c588e..370d40b79c 100644 --- a/dom/tests/mochitest/bugs/test_bug593174.html +++ b/dom/tests/mochitest/bugs/test_bug593174.html @@ -42,7 +42,7 @@ function iframeLoaded(identifier) { } else if (loadCount == 2) { // Test 1: Check that this page is the referer. - is(iframeCw.document.referrer, document.location, 'outer iframe referrer'); + is(iframeCw.document.referrer, String(document.location), 'outer iframe referrer'); // Test 2: file_bug593174_2.html itself contains an iframe, whose src is a // data: uri. Call into that inner iframe and have it set its @@ -53,7 +53,7 @@ function iframeLoaded(identifier) { iframeCw.navigateInnerIframe(); } else if (loadCount == 3) { - is(iframeCw.getInnerIframeReferrer(), iframeCw.location, 'inner iframe referrer'); + is(iframeCw.getInnerIframeReferrer(), String(iframeCw.location), 'inner iframe referrer'); // Now do the test again, this time with a popup. popup = window.open('file_bug593174_1.html'); @@ -66,11 +66,11 @@ function iframeLoaded(identifier) { popup.location = 'file_bug593174_2.html'; } else if (loadCount == 5) { - is(popup.document.referrer, document.location, 'popup referrer after replaceState'); + is(popup.document.referrer, String(document.location), 'popup referrer after replaceState'); popup.navigateInnerIframe(); } else if (loadCount == 6) { - is(popup.getInnerIframeReferrer(), popup.location, 'popup/inner iframe referrer'); + is(popup.getInnerIframeReferrer(), String(popup.location), 'popup/inner iframe referrer'); popup.close(); history.replaceState('', '', kOriginalLocation); SimpleTest.finish(); diff --git a/dom/tests/mochitest/bugs/test_bug862540.html b/dom/tests/mochitest/bugs/test_bug862540.html index 1be98430b9..d86683669c 100644 --- a/dom/tests/mochitest/bugs/test_bug862540.html +++ b/dom/tests/mochitest/bugs/test_bug862540.html @@ -12,7 +12,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=862540 /** Test for Bug 862540 **/ window.status = 5; - is(window.status, 5, "Should be able to get 5"); + is(window.status, "5", "Should be able to get 5"); window.status = { toString: function() { return "foo"; } }; ok(window.status === "foo", "Should be coercing window.status to string"); diff --git a/dom/tests/mochitest/bugs/test_onerror_message.html b/dom/tests/mochitest/bugs/test_onerror_message.html index e4266592bb..677100f585 100644 --- a/dom/tests/mochitest/bugs/test_onerror_message.html +++ b/dom/tests/mochitest/bugs/test_onerror_message.html @@ -22,16 +22,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=743049 /** Test for Bug 743049 **/ var expected = [ -{ name: "Error", message: "foo", filename: location, lineNumber: 45 }, +{ name: "Error", message: "foo", filename: String(location), lineNumber: 45 }, { name: "Error", message: "foo", filename: "bar", lineNumber: 123 }, { name: "", message: "uncaught exception: [object Object]" }, { name: "DuckError", message: "foo", filename: "bar", lineNumber: 123 }, { name: "", message: "uncaught exception: [object Object]" }, { name: "", message: "foo", filename: "baz", lineNumber: 123 }, { name: "", message: "uncaught exception: [object Object]" }, -{ name: "InvalidStateError", message: "An attempt was made to use an object that is not, or is no longer, usable", filename: location, lineNumber: 62 }, -{ name: "ReferenceError", message: "xxx is not defined", filename: location, lineNumber: 64 }, -{ name: "ReferenceError", message: "xxx is not defined", filename: location, lineNumber: 66 } +{ name: "InvalidStateError", message: "An attempt was made to use an object that is not, or is no longer, usable", filename: String(location), lineNumber: 62 }, +{ name: "ReferenceError", message: "xxx is not defined", filename: String(location), lineNumber: 64 }, +{ name: "ReferenceError", message: "xxx is not defined", filename: String(location), lineNumber: 66 } ]; var counter = 0; diff --git a/dom/tests/mochitest/chrome/test_sandbox_bindings.xul b/dom/tests/mochitest/chrome/test_sandbox_bindings.xul index 300ff312ae..4d472a31bf 100644 --- a/dom/tests/mochitest/chrome/test_sandbox_bindings.xul +++ b/dom/tests/mochitest/chrome/test_sandbox_bindings.xul @@ -34,7 +34,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=741267 try { var css = Components.utils.evalInSandbox("CSSStyleDeclaration", sandbox); - is(css.prototype, "[object CSSStyleDeclarationPrototype]", "'CSSStyleDeclaration.prototype' in a sandbox should return the CSSStyleDeclaration interface prototype object"); + is(String(css.prototype), "[object CSSStyleDeclarationPrototype]", + "'CSSStyleDeclaration.prototype' in a sandbox should return the CSSStyleDeclaration interface prototype object"); } catch (e) { ok(false, "'CSSStyleDeclaration' shouldn't throw in a sandbox"); } @@ -84,7 +85,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=741267 } try { var xhr = Components.utils.evalInSandbox("XMLHttpRequest", sandbox); - is(xhr, XMLHttpRequest + "", "'XMLHttpRequest' in a sandbox should return the XMLHttpRequest interface object"); + is(String(xhr), String(XMLHttpRequest), "'XMLHttpRequest' in a sandbox should return the XMLHttpRequest interface object"); ok(isXrayWrapper(xhr.prototype), "Getting the prototype property on an Xray wrapper of an interface object should return an Xray wrapper"); isnot(Object.getOwnPropertyDescriptor(xhr, "UNSENT"), undefined, "We should claim to have an UNSENT constant"); diff --git a/dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html b/dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html index cffe49936a..b342dc0027 100644 --- a/dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html +++ b/dom/tests/mochitest/localstorage/test_localStorageBasePrivateBrowsing_perwindowpb.html @@ -79,8 +79,8 @@ function doTest() { privateWin.content.localStorage.removeItem("empty"); is(privateWin.content.localStorage.length, 0, "The storage has no keys"); is(privateWin.content.localStorage.getItem("empty"), null, "empty item is null (getItem())"); - is(privateWin.content.localStorage["empty"], null, "empty item is undefined (array access)"); - is(privateWin.content.localStorage.empty, null, "empty item is undefined (property access)"); + is(privateWin.content.localStorage["empty"], undefined, "empty item is undefined (array access)"); + is(privateWin.content.localStorage.empty, undefined, "empty item is undefined (property access)"); is(typeof privateWin.content.localStorage.getItem("empty"), "object", "getItem('empty') is object"); is(typeof privateWin.content.localStorage["empty"], "undefined", "['empty'] is undefined"); is(typeof privateWin.content.localStorage.empty, "undefined", "empty is undefined"); diff --git a/dom/tests/mochitest/localstorage/test_lowDeviceStorage.html b/dom/tests/mochitest/localstorage/test_lowDeviceStorage.html index 077460373c..0465871500 100644 --- a/dom/tests/mochitest/localstorage/test_lowDeviceStorage.html +++ b/dom/tests/mochitest/localstorage/test_lowDeviceStorage.html @@ -40,7 +40,7 @@ function startTest() { // Removes the stored item. localStorage.removeItem("item"); - is(localStorage.getItem("item"), undefined, + is(localStorage.getItem("item"), null, "getItem() after removing the item"); // Fails storing a new item. @@ -50,7 +50,7 @@ function startTest() { } catch(e) { ok(true, "Got an expected exception " + e); } finally { - is(localStorage.getItem("newItem"), undefined, + is(localStorage.getItem("newItem"), null, "setItem while device storage is low"); } diff --git a/dom/tests/mochitest/webapps/test_install_app.xul b/dom/tests/mochitest/webapps/test_install_app.xul index cd04692b4b..54b424ddf4 100644 --- a/dom/tests/mochitest/webapps/test_install_app.xul +++ b/dom/tests/mochitest/webapps/test_install_app.xul @@ -55,8 +55,8 @@ function install(next) { ok(app.installTime <= Date.now() + fuzzySpan, "install time is before install success"); is(app.manifestURL, url, "manifest URL"); is(app.manifest.name, "Basic App", "manifest.name"); - is(app.manifest.installs_allowed_from, "*", - "manifest.installs_allowed_from"); + is(app.manifest.installs_allowed_from.length, 1, "allowed-from length must be 1"); + is(app.manifest.installs_allowed_from[0], "*", "allowed from anywhere"); next(); } diff --git a/dom/tests/mochitest/webapps/test_launch_paths.xul b/dom/tests/mochitest/webapps/test_launch_paths.xul index 6cce556c74..f16acacaaa 100644 --- a/dom/tests/mochitest/webapps/test_launch_paths.xul +++ b/dom/tests/mochitest/webapps/test_launch_paths.xul @@ -55,8 +55,8 @@ function install(next) { ok(app.installTime <= Date.now() + fuzzySpan, "install time is before install success"); is(app.manifestURL, url, "manifest URL"); is(app.manifest.name, "Basic App with Launch Paths", "manifest.name"); - is(app.manifest.installs_allowed_from, "*", - "manifest.installs_allowed_from"); + is(app.manifest.installs_allowed_from.length, 1, "allowed-from length must be 1"); + is(app.manifest.installs_allowed_from[0], "*", "allowed from anywhere"); next(); } diff --git a/dom/workers/test/test_suspend.html b/dom/workers/test/test_suspend.html index b6e2a78038..31a033b027 100644 --- a/dom/workers/test/test_suspend.html +++ b/dom/workers/test/test_suspend.html @@ -58,7 +58,7 @@ if (finished) { return; } - is(iframe.location, "about:blank", "Wrong url!"); + is(String(iframe.location), "about:blank", "Wrong url!"); is(suspended, true, "Not suspended?"); is(resumed, false, "Already resumed?!"); is(lastCount, oldMessageCount, "Received a message while suspended!"); @@ -81,7 +81,7 @@ if (finished) { return; } - is(iframe.location, "about:blank", "Wrong url!"); + is(String(iframe.location), "about:blank", "Wrong url!"); is(suspended, false, "Already suspended?"); is(resumed, false, "Already resumed?"); setCachePref(false); diff --git a/dom/xml/nsXMLContentSink.cpp b/dom/xml/nsXMLContentSink.cpp index fa782e9e60..e80d12da77 100644 --- a/dom/xml/nsXMLContentSink.cpp +++ b/dom/xml/nsXMLContentSink.cpp @@ -30,7 +30,7 @@ #include "nsIScriptSecurityManager.h" #include "nsIContentViewer.h" #include "prtime.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prmem.h" #include "nsRect.h" #include "nsIWebNavigation.h" diff --git a/dom/xslt/base/txLog.h b/dom/xslt/base/txLog.h index 3b3d9c3b70..142d781b4c 100644 --- a/dom/xslt/base/txLog.h +++ b/dom/xslt/base/txLog.h @@ -6,7 +6,7 @@ #ifndef txLog_h__ #define txLog_h__ -#include "prlog.h" +#include "mozilla/Logging.h" #ifdef PR_LOGGING class txLog diff --git a/dom/xul/XULDocument.cpp b/dom/xul/XULDocument.cpp index 07066952ea..d1d0a0ba7c 100644 --- a/dom/xul/XULDocument.cpp +++ b/dom/xul/XULDocument.cpp @@ -50,7 +50,7 @@ #include "nsPIWindowRoot.h" #include "nsXULCommandDispatcher.h" #include "nsXULElement.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "rdf.h" #include "nsIFrame.h" #include "nsXBLService.h" diff --git a/dom/xul/nsXULCommandDispatcher.cpp b/dom/xul/nsXULCommandDispatcher.cpp index 1ad2f8a4d6..c94469624b 100644 --- a/dom/xul/nsXULCommandDispatcher.cpp +++ b/dom/xul/nsXULCommandDispatcher.cpp @@ -25,7 +25,7 @@ #include "nsPIWindowRoot.h" #include "nsRDFCID.h" #include "nsXULCommandDispatcher.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsContentUtils.h" #include "nsReadableUtils.h" #include "nsCRT.h" diff --git a/dom/xul/nsXULContentSink.cpp b/dom/xul/nsXULContentSink.cpp index e99e31d1b7..94523c0920 100644 --- a/dom/xul/nsXULContentSink.cpp +++ b/dom/xul/nsXULContentSink.cpp @@ -41,7 +41,7 @@ #include "nsXPIDLString.h" #include "nsReadableUtils.h" #include "nsXULElement.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prmem.h" #include "nsCRT.h" diff --git a/dom/xul/nsXULElement.cpp b/dom/xul/nsXULElement.cpp index 21ba105c38..668f81a9a5 100644 --- a/dom/xul/nsXULElement.cpp +++ b/dom/xul/nsXULElement.cpp @@ -86,7 +86,7 @@ #include "nsXULContentUtils.h" #include "nsNodeUtils.h" #include "nsFrameLoader.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "rdf.h" #include "nsIControllers.h" #include "nsAttrValueOrString.h" diff --git a/dom/xul/templates/nsContentTestNode.cpp b/dom/xul/templates/nsContentTestNode.cpp index 48dd05b436..1609f62492 100644 --- a/dom/xul/templates/nsContentTestNode.cpp +++ b/dom/xul/templates/nsContentTestNode.cpp @@ -12,7 +12,7 @@ #include "nsIXULTemplateBuilder.h" #include "nsXULTemplateQueryProcessorRDF.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* gXULTemplateLog; nsContentTestNode::nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor, diff --git a/dom/xul/templates/nsInstantiationNode.cpp b/dom/xul/templates/nsInstantiationNode.cpp index d8ece24b8a..cac5d18f7e 100644 --- a/dom/xul/templates/nsInstantiationNode.cpp +++ b/dom/xul/templates/nsInstantiationNode.cpp @@ -7,7 +7,7 @@ #include "nsTemplateRule.h" #include "nsXULTemplateQueryProcessorRDF.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* gXULTemplateLog; nsInstantiationNode::nsInstantiationNode(nsXULTemplateQueryProcessorRDF* aProcessor, diff --git a/dom/xul/templates/nsRDFConInstanceTestNode.cpp b/dom/xul/templates/nsRDFConInstanceTestNode.cpp index 1a1a6b4349..c8f1eb1e0f 100644 --- a/dom/xul/templates/nsRDFConInstanceTestNode.cpp +++ b/dom/xul/templates/nsRDFConInstanceTestNode.cpp @@ -11,7 +11,7 @@ #include "nsRDFConInstanceTestNode.h" #include "nsResourceSet.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsXULContentUtils.h" extern PRLogModuleInfo* gXULTemplateLog; diff --git a/dom/xul/templates/nsRDFConMemberTestNode.cpp b/dom/xul/templates/nsRDFConMemberTestNode.cpp index 87c54d6a9b..a2f074449e 100644 --- a/dom/xul/templates/nsRDFConMemberTestNode.cpp +++ b/dom/xul/templates/nsRDFConMemberTestNode.cpp @@ -12,7 +12,7 @@ #include "nsString.h" #include "nsXULContentUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* gXULTemplateLog; nsRDFConMemberTestNode::nsRDFConMemberTestNode(TestNode* aParent, diff --git a/dom/xul/templates/nsRDFPropertyTestNode.cpp b/dom/xul/templates/nsRDFPropertyTestNode.cpp index 186cdd759a..3a68afb462 100644 --- a/dom/xul/templates/nsRDFPropertyTestNode.cpp +++ b/dom/xul/templates/nsRDFPropertyTestNode.cpp @@ -7,7 +7,7 @@ #include "nsString.h" #include "nsXULContentUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* gXULTemplateLog; #include "nsIRDFLiteral.h" diff --git a/dom/xul/templates/nsRuleNetwork.cpp b/dom/xul/templates/nsRuleNetwork.cpp index 735edfd4ec..80331026d3 100644 --- a/dom/xul/templates/nsRuleNetwork.cpp +++ b/dom/xul/templates/nsRuleNetwork.cpp @@ -20,7 +20,7 @@ #include "nsCOMPtr.h" #include "plhash.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* gXULTemplateLog; #include "nsString.h" diff --git a/dom/xul/templates/nsXULContentUtils.cpp b/dom/xul/templates/nsXULContentUtils.cpp index d9fd5d21de..415397ed12 100644 --- a/dom/xul/templates/nsXULContentUtils.cpp +++ b/dom/xul/templates/nsXULContentUtils.cpp @@ -45,7 +45,7 @@ #include "nsString.h" #include "nsXPIDLString.h" #include "nsGkAtoms.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prtime.h" #include "rdf.h" #include "nsContentUtils.h" diff --git a/dom/xul/templates/nsXULTemplateBuilder.cpp b/dom/xul/templates/nsXULTemplateBuilder.cpp index 5b0083f22a..33d7043f67 100644 --- a/dom/xul/templates/nsXULTemplateBuilder.cpp +++ b/dom/xul/templates/nsXULTemplateBuilder.cpp @@ -55,7 +55,7 @@ #include "nsGkAtoms.h" #include "nsXULElement.h" #include "jsapi.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "rdf.h" #include "pldhash.h" #include "plhash.h" diff --git a/dom/xul/templates/nsXULTemplateBuilder.h b/dom/xul/templates/nsXULTemplateBuilder.h index 7eead461b9..8a2eb05bb2 100644 --- a/dom/xul/templates/nsXULTemplateBuilder.h +++ b/dom/xul/templates/nsXULTemplateBuilder.h @@ -25,7 +25,7 @@ #include "nsIXULTemplateQueryProcessor.h" #include "nsCycleCollectionParticipant.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* gXULTemplateLog; class nsIContent; diff --git a/dom/xul/templates/nsXULTemplateQueryProcessorRDF.h b/dom/xul/templates/nsXULTemplateQueryProcessorRDF.h index edb422944a..535d27db81 100644 --- a/dom/xul/templates/nsXULTemplateQueryProcessorRDF.h +++ b/dom/xul/templates/nsXULTemplateQueryProcessorRDF.h @@ -28,7 +28,7 @@ #include "nsCycleCollectionParticipant.h" #include "mozilla/Attributes.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* gXULTemplateLog; class nsIContent; diff --git a/dom/xul/templates/tests/chrome/test_sortservice.xul b/dom/xul/templates/tests/chrome/test_sortservice.xul index 4c09794693..af1de3f0ef 100644 --- a/dom/xul/templates/tests/chrome/test_sortservice.xul +++ b/dom/xul/templates/tests/chrome/test_sortservice.xul @@ -14,17 +14,17 @@ (x, aRect.x); @@ -134,7 +134,7 @@ struct BaseRect { // this and aRect2. // Thus, empty input rectangles are ignored. // If both rectangles are empty, returns this. - Sub Union(const Sub& aRect) const + MOZ_WARN_UNUSED_RESULT Sub Union(const Sub& aRect) const { if (IsEmpty()) { return aRect; @@ -147,7 +147,7 @@ struct BaseRect { // Returns the smallest rectangle that contains both the points (including // edges) of both aRect1 and aRect2. // Thus, empty input rectangles are allowed to affect the result. - Sub UnionEdges(const Sub& aRect) const + MOZ_WARN_UNUSED_RESULT Sub UnionEdges(const Sub& aRect) const { Sub result; result.x = std::min(x, aRect.x); @@ -226,20 +226,6 @@ struct BaseRect { } void Inflate(const SizeT& aSize) { Inflate(aSize.width, aSize.height); } - void InflateToMultiple(const SizeT& aMultiple) - { - T xMost = XMost(); - T yMost = YMost(); - - x = static_cast(floor(x / aMultiple.width)) * aMultiple.width; - y = static_cast(floor(y / aMultiple.height)) * aMultiple.height; - xMost = static_cast(ceil(x / aMultiple.width)) * aMultiple.width; - yMost = static_cast(ceil(y / aMultiple.height)) * aMultiple.height; - - width = xMost - x; - height = yMost - y; - } - void Deflate(T aD) { Deflate(aD, aD); } void Deflate(T aDx, T aDy) { @@ -537,7 +523,7 @@ struct BaseRect { * Clamp aPoint to this rectangle. It is allowed to end up on any * edge of the rectangle. */ - Point ClampPoint(const Point& aPoint) const + MOZ_WARN_UNUSED_RESULT Point ClampPoint(const Point& aPoint) const { return Point(std::max(x, std::min(XMost(), aPoint.x)), std::max(y, std::min(YMost(), aPoint.y))); @@ -548,7 +534,7 @@ struct BaseRect { * this rect after it is forced inside the bounds of aRect. It will attempt to * retain the size but will shrink the dimensions that don't fit. */ - Sub ForceInside(const Sub& aRect) const + MOZ_WARN_UNUSED_RESULT Sub ForceInside(const Sub& aRect) const { Sub rect(std::max(aRect.x, x), std::max(aRect.y, y), diff --git a/gfx/2d/Logging.h b/gfx/2d/Logging.h index e2706db8d3..25962f5079 100644 --- a/gfx/2d/Logging.h +++ b/gfx/2d/Logging.h @@ -12,7 +12,7 @@ #include #ifdef MOZ_LOGGING -#include +#include "mozilla/Logging.h" #endif #if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID) diff --git a/gfx/2d/Matrix.cpp b/gfx/2d/Matrix.cpp index f01f40e258..881d3f78c1 100644 --- a/gfx/2d/Matrix.cpp +++ b/gfx/2d/Matrix.cpp @@ -124,25 +124,47 @@ Matrix4x4::TransformBounds(const Rect& aRect) const Point4D ComputePerspectivePlaneIntercept(const Point4D& aFirst, const Point4D& aSecond) { - // FIXME: See bug 1035611 - // Since we can't easily deal with points as w=0 (since we divide by w), we - // approximate this by finding a point with w just greater than 0. Unfortunately - // this is a tradeoff between accuracy and floating point precision. + // This function will always return a point with a w value of 0. + // The X, Y, and Z components will point towards an infinite vanishing + // point. - // We want to interpolate aFirst and aSecond to find a point as close to - // the positive side of the w=0 plane as possible. + // We want to interpolate aFirst and aSecond to find the point intersecting + // with the w=0 plane. // Since we know what we want the w component to be, we can rearrange the // interpolation equation and solve for t. - float w = 0.00001f; - float t = (w - aFirst.w) / (aSecond.w - aFirst.w); + float t = -aFirst.w / (aSecond.w - aFirst.w); // Use t to find the remainder of the components return aFirst + (aSecond - aFirst) * t; } -Rect Matrix4x4::ProjectRectBounds(const Rect& aRect) const +Rect Matrix4x4::ProjectRectBounds(const Rect& aRect, const Rect &aClip) const { + // This function must never return std::numeric_limits::max() or any + // other arbitrary large value in place of inifinity. This often occurs when + // aRect is an inversed projection matrix or when aRect is transformed to be + // partly behind and in front of the camera (w=0 plane in homogenous + // coordinates) - See Bug 1035611 + + // Some call-sites will call RoundGfxRectToAppRect which clips both the + // extents and dimensions of the rect to be bounded by nscoord_MAX. + // If we return a Rect that, when converted to nscoords, has a width or height + // greater than nscoord_MAX, RoundGfxRectToAppRect will clip the overflow + // off both the min and max end of the rect after clipping the extents of the + // rect, resulting in a translation of the rect towards the infinite end. + + // The bounds returned by ProjectRectBounds are expected to be clipped only on + // the edges beyond the bounds of the coordinate system; otherwise, the + // clipped bounding box would be smaller than the correct one and result + // bugs such as incorrect culling (eg. Bug 1073056) + + // To address this without requiring all code to work in homogenous + // coordinates or interpret infinite values correctly, a specialized + // clipping function is integrated into ProjectRectBounds. + + // Callers should pass an aClip value that represents the extents to clip + // the result to, in the same coordinate system as aRect. Point4D points[4]; points[0] = ProjectPoint(aRect.TopLeft()); @@ -155,33 +177,38 @@ Rect Matrix4x4::ProjectRectBounds(const Rect& aRect) const Float max_x = -std::numeric_limits::max(); Float max_y = -std::numeric_limits::max(); - bool foundPoint = false; for (int i=0; i<4; i++) { // Only use points that exist above the w=0 plane if (points[i].HasPositiveWCoord()) { - foundPoint = true; - Point point2d = points[i].As2DPoint(); - min_x = min(point2d.x, min_x); - max_x = max(point2d.x, max_x); - min_y = min(point2d.y, min_y); - max_y = max(point2d.y, max_y); + Point point2d = aClip.ClampPoint(points[i].As2DPoint()); + min_x = std::min(point2d.x, min_x); + max_x = std::max(point2d.x, max_x); + min_y = std::min(point2d.y, min_y); + max_y = std::max(point2d.y, max_y); } int next = (i == 3) ? 0 : i + 1; if (points[i].HasPositiveWCoord() != points[next].HasPositiveWCoord()) { - // If the line between two points crosses the w=0 plane, then interpolate a point - // as close to the w=0 plane as possible and use that instead. + // If the line between two points crosses the w=0 plane, then interpolate + // to find the point of intersection with the w=0 plane and use that + // instead. Point4D intercept = ComputePerspectivePlaneIntercept(points[i], points[next]); - - Point point2d = intercept.As2DPoint(); - min_x = min(point2d.x, min_x); - max_x = max(point2d.x, max_x); - min_y = min(point2d.y, min_y); - max_y = max(point2d.y, max_y); + // Since intercept.w will always be 0 here, we interpret x,y,z as a + // direction towards an infinite vanishing point. + if (intercept.x < 0.0f) { + min_x = aClip.x; + } else if (intercept.x > 0.0f) { + max_x = aClip.XMost(); + } + if (intercept.y < 0.0f) { + min_y = aClip.y; + } else if (intercept.y > 0.0f) { + max_y = aClip.YMost(); + } } } - if (!foundPoint) { + if (max_x <= min_x || max_y <= min_y) { return Rect(0, 0, 0, 0); } diff --git a/gfx/2d/Matrix.h b/gfx/2d/Matrix.h index 780245ff29..a78f7708fb 100644 --- a/gfx/2d/Matrix.h +++ b/gfx/2d/Matrix.h @@ -478,7 +478,7 @@ public: return *this * Point4D(aPoint.x, aPoint.y, z, 1); } - Rect ProjectRectBounds(const Rect& aRect) const; + Rect ProjectRectBounds(const Rect& aRect, const Rect &aClip) const; static Matrix4x4 From2D(const Matrix &aMatrix) { Matrix4x4 matrix; diff --git a/gfx/2d/NumericTools.h b/gfx/2d/NumericTools.h new file mode 100644 index 0000000000..a1004e17bc --- /dev/null +++ b/gfx/2d/NumericTools.h @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * 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/. */ + +#ifndef MOZILLA_GFX_NUMERICTOOLS_H_ +#define MOZILLA_GFX_NUMERICTOOLS_H_ + +// Returns the largest multiple of aMultiplied that's <= x. +// Same as int32_t(floor(double(x) / aMultiplier)) * aMultiplier, +// but faster. +static int32_t +RoundDownToMultiple(int32_t x, int32_t aMultiplier) +{ + // We don't use float division + floor because that's hard for the compiler + // to optimize. + int mod = x % aMultiplier; + if (x > 0) { + return x - mod; + } + return mod ? x - aMultiplier - mod : x; +} + +// Returns the smallest multiple of aMultiplied that's >= x. +// Same as int32_t(ceil(double(x) / aMultiplier)) * aMultiplier, +// but faster. +static int32_t +RoundUpToMultiple(int32_t x, int32_t aMultiplier) +{ + int mod = x % aMultiplier; + if (x > 0) { + return mod ? x + aMultiplier - mod : x; + } + return x - mod; +} + +#endif /* MOZILLA_GFX_NUMERICTOOLS_H_ */ diff --git a/gfx/2d/Rect.h b/gfx/2d/Rect.h index d72798a350..f8eba74e92 100644 --- a/gfx/2d/Rect.h +++ b/gfx/2d/Rect.h @@ -99,6 +99,12 @@ struct IntRectTyped : yMost += this->height; return !xMost.isValid() || !yMost.isValid(); } + + // This is here only to keep IPDL-generated code happy. DO NOT USE. + bool operator==(const IntRectTyped& aRect) const + { + return IntRectTyped::IsEqualEdges(aRect); + } }; typedef IntRectTyped IntRect; diff --git a/gfx/2d/moz.build b/gfx/2d/moz.build index 3ed8e88e82..17197c0e1b 100644 --- a/gfx/2d/moz.build +++ b/gfx/2d/moz.build @@ -26,6 +26,7 @@ EXPORTS.mozilla.gfx += [ 'Helpers.h', 'Logging.h', 'Matrix.h', + 'NumericTools.h', 'PathHelpers.h', 'PatternHelpers.h', 'Point.h', diff --git a/gfx/gl/GLTextureImage.cpp b/gfx/gl/GLTextureImage.cpp index 38dd6d4141..0bce892163 100644 --- a/gfx/gl/GLTextureImage.cpp +++ b/gfx/gl/GLTextureImage.cpp @@ -120,13 +120,13 @@ BasicTextureImage::BeginUpdate(nsIntRegion& aRegion) if (CanUploadSubTextures(mGLContext)) { GetUpdateRegion(aRegion); } else { - aRegion = nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize)); + aRegion = nsIntRect(nsIntPoint(0, 0), mSize); } mUpdateRegion = aRegion; nsIntRect rgnSize = mUpdateRegion.GetBounds(); - if (!nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize)).Contains(rgnSize)) { + if (!nsIntRect(nsIntPoint(0, 0), mSize).Contains(rgnSize)) { NS_ERROR("update outside of image"); return nullptr; } @@ -146,8 +146,9 @@ BasicTextureImage::GetUpdateRegion(nsIntRegion& aForRegion) // if the texture hasn't been initialized yet, or something important // changed, we need to recreate our backing surface and force the // client to paint everything - if (mTextureState != Valid) - aForRegion = nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize)); + if (mTextureState != Valid) { + aForRegion = nsIntRect(nsIntPoint(0, 0), mSize); + } } void @@ -399,7 +400,7 @@ TiledTextureImage::GetUpdateRegion(nsIntRegion& aForRegion) // if the texture hasn't been initialized yet, or something important // changed, we need to recreate our backing surface and force the // client to paint everything - aForRegion = nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize)); + aForRegion = nsIntRect(nsIntPoint(0, 0), mSize); return; } @@ -411,7 +412,7 @@ TiledTextureImage::GetUpdateRegion(nsIntRegion& aForRegion) int xPos = (i % mColumns) * mTileSize; int yPos = (i / mColumns) * mTileSize; nsIntRect imageRect = nsIntRect(nsIntPoint(xPos,yPos), - ThebesIntSize(mImages[i]->GetSize())); + mImages[i]->GetSize()); if (aForRegion.Intersects(imageRect)) { // Make a copy of the region @@ -445,7 +446,7 @@ TiledTextureImage::BeginUpdate(nsIntRegion& aRegion) // if the texture hasn't been initialized yet, or something important // changed, we need to recreate our backing surface and force the // client to paint everything - aRegion = nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize)); + aRegion = nsIntRect(nsIntPoint(0, 0), mSize); } nsIntRect bounds = aRegion.GetBounds(); @@ -455,7 +456,7 @@ TiledTextureImage::BeginUpdate(nsIntRegion& aRegion) int yPos = (i / mColumns) * mTileSize; nsIntRegion imageRegion = nsIntRegion(nsIntRect(nsIntPoint(xPos,yPos), - ThebesIntSize(mImages[i]->GetSize()))); + mImages[i]->GetSize())); // a single Image can handle this update request if (imageRegion.Contains(aRegion)) { @@ -510,7 +511,7 @@ TiledTextureImage::EndUpdate() int xPos = (i % mColumns) * mTileSize; int yPos = (i / mColumns) * mTileSize; nsIntRect imageRect = nsIntRect(nsIntPoint(xPos,yPos), - ThebesIntSize(mImages[i]->GetSize())); + mImages[i]->GetSize()); nsIntRegion subregion; subregion.And(mUpdateRegion, imageRect); diff --git a/gfx/gl/TextureImageEGL.cpp b/gfx/gl/TextureImageEGL.cpp index 5f7ee068cd..fec61f467e 100644 --- a/gfx/gl/TextureImageEGL.cpp +++ b/gfx/gl/TextureImageEGL.cpp @@ -102,7 +102,7 @@ TextureImageEGL::GetUpdateRegion(nsIntRegion& aForRegion) if (mTextureState != Valid) { // if the texture hasn't been initialized yet, force the // client to paint everything - aForRegion = nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize)); + aForRegion = nsIntRect(nsIntPoint(0, 0), mSize); } // We can only draw a rectangle, not subregions due to @@ -122,7 +122,7 @@ TextureImageEGL::BeginUpdate(nsIntRegion& aRegion) mUpdateRect = aRegion.GetBounds(); //printf_stderr("BeginUpdate with updateRect [%d %d %d %d]\n", mUpdateRect.x, mUpdateRect.y, mUpdateRect.width, mUpdateRect.height); - if (!nsIntRect(nsIntPoint(0, 0), gfx::ThebesIntSize(mSize)).Contains(mUpdateRect)) { + if (!nsIntRect(nsIntPoint(0, 0), mSize).Contains(mUpdateRect)) { NS_ERROR("update outside of image"); return nullptr; } @@ -166,7 +166,7 @@ TextureImageEGL::EndUpdate() if (mTextureState != Valid) { NS_ASSERTION(mUpdateRect.x == 0 && mUpdateRect.y == 0 && - mUpdateRect.Size() == gfx::ThebesIntSize(mSize), + mUpdateRect.Size() == mSize, "Bad initial update on non-created texture!"); mGLContext->fTexImage2D(LOCAL_GL_TEXTURE_2D, diff --git a/gfx/layers/ImageLayers.cpp b/gfx/layers/ImageLayers.cpp index 8214916bbe..0b46aa8b3a 100644 --- a/gfx/layers/ImageLayers.cpp +++ b/gfx/layers/ImageLayers.cpp @@ -33,7 +33,7 @@ void ImageLayer::ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSu // Snap image edges to pixel boundaries gfxRect sourceRect(0, 0, 0, 0); if (mContainer) { - sourceRect.SizeTo(gfx::ThebesIntSize(mContainer->GetCurrentSize())); + sourceRect.SizeTo(mContainer->GetCurrentSize()); } // Snap our local transform first, and snap the inherited transform as well. // This makes our snapping equivalent to what would happen if our content diff --git a/gfx/layers/LayerMetricsWrapper.h b/gfx/layers/LayerMetricsWrapper.h index fa2f12ee06..5c39f3b05d 100644 --- a/gfx/layers/LayerMetricsWrapper.h +++ b/gfx/layers/LayerMetricsWrapper.h @@ -331,15 +331,17 @@ public: return region; } - const nsIntRect* GetClipRect() const + const Maybe& GetClipRect() const { MOZ_ASSERT(IsValid()); + static const Maybe sNoClipRect = Nothing(); + if (AtBottomLayer()) { return mLayer->GetClipRect(); } - return nullptr; + return sNoClipRect; } EventRegionsOverride GetEventRegionsOverride() const diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index 836f8661f1..56a8f08bf0 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -8,6 +8,7 @@ #include "ImageContainer.h" // for ImageContainer #include "ImageLayers.h" // for ImageLayer, etc #include "Layers.h" // for Layer, ContainerLayer, etc +#include "Units.h" // for ParentLayerIntRect #include "gfxColor.h" // for gfxRGBA #include "GraphicsFilter.h" // for GraphicsFilter #include "gfxRect.h" // for gfxRect @@ -140,7 +141,7 @@ struct LayerPropertiesBase : public LayerProperties mLayer->GetPostXScale() != mPostXScale || mLayer->GetPostYScale() != mPostYScale; Layer* otherMask = mLayer->GetMaskLayer(); - const nsIntRect* otherClip = mLayer->GetClipRect(); + const Maybe& otherClip = mLayer->GetClipRect(); nsIntRegion result; if ((mMaskLayer ? mMaskLayer->mLayer : nullptr) != otherMask || (mUseClipRect != !!otherClip) || @@ -166,7 +167,7 @@ struct LayerPropertiesBase : public LayerProperties if (!mClipRect.IsEqualInterior(*otherClip)) { aGeometryChanged = true; nsIntRegion tmp; - tmp.Xor(mClipRect, *otherClip); + tmp.Xor(ParentLayerIntRect::ToUntyped(mClipRect), ParentLayerIntRect::ToUntyped(*otherClip)); AddRegion(result, tmp); } } @@ -199,7 +200,7 @@ struct LayerPropertiesBase : public LayerProperties float mPostXScale; float mPostYScale; float mOpacity; - nsIntRect mClipRect; + ParentLayerIntRect mClipRect; bool mUseClipRect; }; diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 1a2bd36257..daa5dc5cac 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -14,6 +14,7 @@ #include "LayerSorter.h" // for SortLayersBy3DZOrder #include "LayersLogging.h" // for AppendToString #include "ReadbackLayer.h" // for ReadbackLayer +#include "UnitTransforms.h" // for ViewAs #include "gfxPlatform.h" // for gfxPlatform #include "gfxPrefs.h" #include "gfxUtils.h" // for gfxUtils, etc @@ -201,7 +202,6 @@ Layer::Layer(LayerManager* aManager, void* aImplData) : mMixBlendMode(CompositionOp::OP_OVER), mForceIsolatedGroup(false), mContentFlags(0), - mUseClipRect(false), mUseTileSourceRect(false), mIsFixedPosition(false), mMargins(0, 0, 0, 0), @@ -546,7 +546,7 @@ Layer::CanUseOpaqueSurface() // NB: eventually these methods will be defined unconditionally, and // can be moved into Layers.h -const nsIntRect* +const Maybe& Layer::GetEffectiveClipRect() { if (LayerComposite* shadow = AsLayerComposite()) { @@ -672,7 +672,9 @@ Layer::CalculateScissorRect(const RenderTargetIntRect& aCurrentScissorRect) return currentClip; } - const RenderTargetIntRect clipRect = RenderTargetPixel::FromUntyped(*GetEffectiveClipRect()); + const RenderTargetIntRect clipRect = + ViewAs(*GetEffectiveClipRect(), + PixelCastJustification::RenderTargetIsParentLayerForRoot); if (clipRect.IsEmpty()) { // We might have a non-translation transform in the container so we can't // use the code path below. @@ -693,7 +695,7 @@ Layer::CalculateScissorRect(const RenderTargetIntRect& aCurrentScissorRect) if (!gfxUtils::GfxRectToIntRect(trScissor, &tmp)) { return RenderTargetIntRect(currentClip.TopLeft(), RenderTargetIntSize(0, 0)); } - scissor = RenderTargetPixel::FromUntyped(tmp); + scissor = ViewAs(tmp); // Find the nearest ancestor with an intermediate surface do { @@ -876,7 +878,7 @@ Layer::GetVisibleRegionRelativeToRootLayer(nsIntRegion& aResult, // If the parent layer clips its lower layers, clip the visible region // we're accumulating. if (layer->GetEffectiveClipRect()) { - aResult.AndWith(*layer->GetEffectiveClipRect()); + aResult.AndWith(ParentLayerIntRect::ToUntyped(*layer->GetEffectiveClipRect())); } // Now we need to walk across the list of siblings for this parent layer, @@ -1091,7 +1093,7 @@ ContainerLayer::HasMultipleChildren() { uint32_t count = 0; for (Layer* child = GetFirstChild(); child; child = child->GetNextSibling()) { - const nsIntRect *clipRect = child->GetEffectiveClipRect(); + const Maybe& clipRect = child->GetEffectiveClipRect(); if (clipRect && clipRect->IsEmpty()) continue; if (child->GetVisibleRegion().IsEmpty()) @@ -1158,7 +1160,7 @@ ContainerLayer::DefaultComputeEffectiveTransforms(const Matrix4x4& aTransformToS gfx::ThebesMatrix(contTransform).HasNonIntegerTranslation()) { #endif for (Layer* child = GetFirstChild(); child; child = child->GetNextSibling()) { - const nsIntRect *clipRect = child->GetEffectiveClipRect(); + const Maybe& clipRect = child->GetEffectiveClipRect(); /* We can't (easily) forward our transform to children with a non-empty clip * rect since it would need to be adjusted for the transform. See * the calculations performed by CalculateScissorRect above. @@ -1557,8 +1559,8 @@ Layer::PrintInfo(std::stringstream& aStream, const char* aPrefix) layers::PrintInfo(aStream, AsLayerComposite()); - if (mUseClipRect) { - AppendToString(aStream, mClipRect, " [clip=", "]"); + if (mClipRect) { + AppendToString(aStream, *mClipRect, " [clip=", "]"); } if (1.0 != mPostXScale || 1.0 != mPostYScale) { aStream << nsPrintfCString(" [postScale=%g, %g]", mPostXScale, mPostYScale).get(); @@ -1642,8 +1644,10 @@ DumpTransform(layerscope::LayersPacket::Layer::Matrix* aLayerMatrix, const Matri } // The static helper function sets the nsIntRect into the packet +template static void -DumpRect(layerscope::LayersPacket::Layer::Rect* aLayerRect, const nsIntRect& aRect) +DumpRect(layerscope::LayersPacket::Layer::Rect* aLayerRect, + const BaseRect& aRect) { aLayerRect->set_x(aRect.x); aLayerRect->set_y(aRect.y); @@ -1674,7 +1678,7 @@ Layer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent) // Shadow if (LayerComposite* lc = AsLayerComposite()) { LayersPacket::Layer::Shadow* s = layer->mutable_shadow(); - if (const nsIntRect* clipRect = lc->GetShadowClipRect()) { + if (const Maybe& clipRect = lc->GetShadowClipRect()) { DumpRect(s->mutable_clip(), *clipRect); } if (!lc->GetShadowTransform().IsIdentity()) { @@ -1685,8 +1689,8 @@ Layer::DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent) } } // Clip - if (mUseClipRect) { - DumpRect(layer->mutable_clip(), mClipRect); + if (mClipRect) { + DumpRect(layer->mutable_clip(), *mClipRect); } // Transform if (!mTransform.IsIdentity()) { @@ -2039,7 +2043,7 @@ PrintInfo(std::stringstream& aStream, LayerComposite* aLayerComposite) if (!aLayerComposite) { return; } - if (const nsIntRect* clipRect = aLayerComposite->GetShadowClipRect()) { + if (const Maybe& clipRect = aLayerComposite->GetShadowClipRect()) { AppendToString(aStream, *clipRect, " [shadow-clip=", "]"); } if (!aLayerComposite->GetShadowTransform().IsIdentity()) { diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index c9fc09cf27..c418f124d6 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -10,7 +10,7 @@ #include // for FILE #include // for int32_t, int64_t #include "FrameMetrics.h" // for FrameMetrics -#include "Units.h" // for LayerMargin, LayerPoint +#include "Units.h" // for LayerMargin, LayerPoint, ParentLayerIntRect #include "gfxContext.h" // for GraphicsOperator #include "gfxTypes.h" #include "gfxColor.h" // for gfxRGBA @@ -21,6 +21,7 @@ #include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2, etc #include "mozilla/DebugOnly.h" // for DebugOnly #include "mozilla/EventForwards.h" // for nsPaintEvent +#include "mozilla/Maybe.h" // for Maybe #include "mozilla/RefPtr.h" // for already_AddRefed #include "mozilla/StyleAnimationValue.h" // for StyleAnimationValue, etc #include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration @@ -43,7 +44,7 @@ #include "nsTArray.h" // for nsTArray #include "nsTArrayForwardDeclare.h" // for InfallibleTArray #include "nscore.h" // for nsACString, nsAString -#include "prlog.h" // for PRLogModuleInfo +#include "mozilla/Logging.h" // for PRLogModuleInfo #include "nsIWidget.h" // For plugin window configuration information structs #include "gfxVR.h" @@ -990,20 +991,20 @@ public: * in device pixels. * If aRect is null no clipping will be performed. */ - void SetClipRect(const nsIntRect* aRect) + void SetClipRect(const Maybe& aRect) { - if (mUseClipRect) { + if (mClipRect) { if (!aRect) { MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ClipRect was %d,%d,%d,%d is ", this, - mClipRect.x, mClipRect.y, mClipRect.width, mClipRect.height)); - mUseClipRect = false; + mClipRect->x, mClipRect->y, mClipRect->width, mClipRect->height)); + mClipRect.reset(); Mutated(); } else { - if (!aRect->IsEqualEdges(mClipRect)) { + if (!aRect->IsEqualEdges(*mClipRect)) { MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ClipRect was %d,%d,%d,%d is %d,%d,%d,%d", this, - mClipRect.x, mClipRect.y, mClipRect.width, mClipRect.height, + mClipRect->x, mClipRect->y, mClipRect->width, mClipRect->height, aRect->x, aRect->y, aRect->width, aRect->height)); - mClipRect = *aRect; + mClipRect = aRect; Mutated(); } } @@ -1011,8 +1012,7 @@ public: if (aRect) { MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ClipRect was is %d,%d,%d,%d", this, aRect->x, aRect->y, aRect->width, aRect->height)); - mUseClipRect = true; - mClipRect = *aRect; + mClipRect = aRect; Mutated(); } } @@ -1224,7 +1224,7 @@ public: // These getters can be used anytime. float GetOpacity() { return mOpacity; } gfx::CompositionOp GetMixBlendMode() const { return mMixBlendMode; } - const nsIntRect* GetClipRect() { return mUseClipRect ? &mClipRect : nullptr; } + const Maybe& GetClipRect() const { return mClipRect; } uint32_t GetContentFlags() { return mContentFlags; } const nsIntRect& GetLayerBounds() const { return mLayerBounds; } const nsIntRegion& GetVisibleRegion() const { return mVisibleRegion; } @@ -1412,7 +1412,7 @@ public: // These getters can be used anytime. They return the effective // values that should be used when drawing this layer to screen, // accounting for this layer possibly being a shadow. - const nsIntRect* GetEffectiveClipRect(); + const Maybe& GetEffectiveClipRect(); const nsIntRegion& GetEffectiveVisibleRegion(); /** @@ -1694,12 +1694,11 @@ protected: float mOpacity; gfx::CompositionOp mMixBlendMode; bool mForceIsolatedGroup; - nsIntRect mClipRect; + Maybe mClipRect; nsIntRect mTileSourceRect; nsIntRegion mInvalidRegion; nsTArray > mApzcs; uint32_t mContentFlags; - bool mUseClipRect; bool mUseTileSourceRect; bool mIsFixedPosition; LayerPoint mAnchor; diff --git a/gfx/layers/LayersLogging.h b/gfx/layers/LayersLogging.h index 640f19ec92..241b1a2100 100644 --- a/gfx/layers/LayersLogging.h +++ b/gfx/layers/LayersLogging.h @@ -108,6 +108,26 @@ void AppendToString(std::stringstream& aStream, const nsIntRegion& r, const char* pfx="", const char* sfx=""); +template +void +AppendToString(std::stringstream& aStream, const mozilla::gfx::IntRegionTyped& r, + const char* pfx="", const char* sfx="") +{ + typedef mozilla::gfx::IntRegionTyped RegionType; + + aStream << pfx; + + typename RegionType::RectIterator it(r); + aStream << "< "; + while (const typename RegionType::RectType* sr = it.Next()) { + AppendToString(aStream, *sr); + aStream << "; "; + } + aStream << ">"; + + aStream << sfx; +} + void AppendToString(std::stringstream& aStream, const EventRegions& e, const char* pfx="", const char* sfx=""); diff --git a/gfx/layers/LayersTypes.h b/gfx/layers/LayersTypes.h index 627e72a86f..ac99855992 100644 --- a/gfx/layers/LayersTypes.h +++ b/gfx/layers/LayersTypes.h @@ -16,7 +16,7 @@ #include #endif #include // FILE -#include "prlog.h" // for PR_LOG +#include "mozilla/Logging.h" // for PR_LOG #ifndef MOZ_LAYERS_HAVE_LOG # define MOZ_LAYERS_HAVE_LOG #endif diff --git a/gfx/layers/ReadbackProcessor.cpp b/gfx/layers/ReadbackProcessor.cpp index 22d0e328d1..a95741d4cf 100644 --- a/gfx/layers/ReadbackProcessor.cpp +++ b/gfx/layers/ReadbackProcessor.cpp @@ -7,6 +7,8 @@ #include // for int32_t #include "Layers.h" // for Layer, PaintedLayer, etc #include "ReadbackLayer.h" // for ReadbackLayer, ReadbackSink +#include "UnitTransforms.h" // for ViewAs +#include "Units.h" // for ParentLayerIntRect #include "gfxColor.h" // for gfxRGBA #include "gfxContext.h" // for gfxContext #include "gfxUtils.h" @@ -76,8 +78,8 @@ FindBackgroundLayer(ReadbackLayer* aLayer, nsIntPoint* aOffset) return nullptr; // cliprects are post-transform - const nsIntRect* clipRect = l->GetEffectiveClipRect(); - if (clipRect && !clipRect->Contains(nsIntRect(transformOffset, aLayer->GetSize()))) + const Maybe& clipRect = l->GetEffectiveClipRect(); + if (clipRect && !clipRect->Contains(ViewAs(nsIntRect(transformOffset, aLayer->GetSize())))) return nullptr; Layer::LayerType type = l->GetType(); diff --git a/gfx/layers/TextureDIB.cpp b/gfx/layers/TextureDIB.cpp index a6740a407e..e35966a1bc 100644 --- a/gfx/layers/TextureDIB.cpp +++ b/gfx/layers/TextureDIB.cpp @@ -131,14 +131,15 @@ DIBTextureHost::DIBTextureHost(TextureFlags aFlags, gfxPlatform::GetPlatform()->OptimalFormatForContent(mSurface->GetContentType())); } -TextureSource* -DIBTextureHost::GetTextureSources() +bool +DIBTextureHost::BindTextureSource(CompositableTextureSourceRef& aTexture) { if (!mTextureSource) { Updated(); } - return mTextureSource; + aTexture = mTextureSource; + return !!aTexture; } void diff --git a/gfx/layers/TextureDIB.h b/gfx/layers/TextureDIB.h index 28c93e4328..c594f753f8 100644 --- a/gfx/layers/TextureDIB.h +++ b/gfx/layers/TextureDIB.h @@ -72,7 +72,7 @@ public: DIBTextureHost(TextureFlags aFlags, const SurfaceDescriptorDIB& aDescriptor); - virtual TextureSource* GetTextureSources() override; + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override; virtual void DeallocateDeviceData() override; diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index eddbd9faba..3b07956517 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -29,6 +29,7 @@ #include "gfxPrefs.h" // for gfxPrefs #include "OverscrollHandoffState.h" // for OverscrollHandoffState #include "LayersLogging.h" // for Stringify +#include "Units.h" // for ParentlayerPixel #define ENABLE_APZCTM_LOGGING 0 // #define ENABLE_APZCTM_LOGGING 1 @@ -196,20 +197,19 @@ APZCTreeManager::UpdateHitTestingTree(CompositorParent* aCompositor, // Compute the clip region to be used for a layer with an APZC. This function // is only called for layers which actually have scrollable metrics and an APZC. -static nsIntRegion +static ParentLayerIntRegion ComputeClipRegion(GeckoContentController* aController, const LayerMetricsWrapper& aLayer) { - nsIntRegion clipRegion; + ParentLayerIntRegion clipRegion; if (aLayer.GetClipRect()) { - clipRegion = nsIntRegion(*aLayer.GetClipRect()); + clipRegion = *aLayer.GetClipRect(); } else { // if there is no clip on this layer (which should only happen for the // root scrollable layer in a process, or for some of the LayerMetrics // expansions of a multi-metrics layer), fall back to using the comp // bounds which should be equivalent. - clipRegion = nsIntRegion(ParentLayerIntRect::ToUntyped( - RoundedToInt(aLayer.Metrics().mCompositionBounds))); + clipRegion = RoundedToInt(aLayer.Metrics().mCompositionBounds); } // Optionally, the GeckoContentController can provide a touch-sensitive @@ -229,10 +229,10 @@ ComputeClipRegion(GeckoContentController* aController, // Not sure what rounding option is the most correct here, but if we ever // figure it out we can change this. For now I'm rounding in to minimize // the chances of getting a complex region. - nsIntRect extraClip = ParentLayerIntRect::ToUntyped(RoundedIn( + ParentLayerIntRegion extraClip = RoundedIn( touchSensitiveRegion * aLayer.Metrics().GetDevPixelsPerCSSPixel() - * parentCumulativeResolution)); + * parentCumulativeResolution); clipRegion.AndWith(extraClip); } @@ -335,7 +335,7 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer, node = RecycleOrCreateNode(aState, nullptr); AttachNodeToTree(node, aParent, aNextSibling); node->SetHitTestData(GetEventRegions(aLayer), aLayer.GetTransform(), - aLayer.GetClipRect() ? Some(nsIntRegion(*aLayer.GetClipRect())) : Nothing(), + aLayer.GetClipRect() ? Some(ParentLayerIntRegion(*aLayer.GetClipRect())) : Nothing(), GetEventRegionsOverride(aParent, aLayer)); return node; } @@ -431,7 +431,7 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer, // or not, depending on whether it went through the newApzc branch above. MOZ_ASSERT(node->IsPrimaryHolder() && node->GetApzc() && node->GetApzc()->Matches(guid)); - nsIntRegion clipRegion = ComputeClipRegion(state->mController, aLayer); + ParentLayerIntRegion clipRegion = ComputeClipRegion(state->mController, aLayer); node->SetHitTestData(GetEventRegions(aLayer), aLayer.GetTransform(), Some(clipRegion), GetEventRegionsOverride(aParent, aLayer)); apzc->SetAncestorTransform(aAncestorTransform); @@ -486,7 +486,7 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer, // ancestor be the same. MOZ_ASSERT(aAncestorTransform == apzc->GetAncestorTransform()); - nsIntRegion clipRegion = ComputeClipRegion(state->mController, aLayer); + ParentLayerIntRegion clipRegion = ComputeClipRegion(state->mController, aLayer); node->SetHitTestData(GetEventRegions(aLayer), aLayer.GetTransform(), Some(clipRegion), GetEventRegionsOverride(aParent, aLayer)); } diff --git a/gfx/layers/apz/src/APZCTreeManager.h b/gfx/layers/apz/src/APZCTreeManager.h index 14fc255548..2b68154502 100644 --- a/gfx/layers/apz/src/APZCTreeManager.h +++ b/gfx/layers/apz/src/APZCTreeManager.h @@ -23,8 +23,6 @@ #include "mozilla/gfx/Logging.h" // for gfx::TreeLog #include "mozilla/layers/APZUtils.h" // for HitTestResult -class nsIntRegion; - namespace mozilla { class InputData; class MultiTouchInput; diff --git a/gfx/layers/apz/src/HitTestingTreeNode.cpp b/gfx/layers/apz/src/HitTestingTreeNode.cpp index 94f0c502cd..47ad0c3ab4 100644 --- a/gfx/layers/apz/src/HitTestingTreeNode.cpp +++ b/gfx/layers/apz/src/HitTestingTreeNode.cpp @@ -156,7 +156,7 @@ HitTestingTreeNode::IsPrimaryHolder() const void HitTestingTreeNode::SetHitTestData(const EventRegions& aRegions, const gfx::Matrix4x4& aTransform, - const Maybe& aClipRegion, + const Maybe& aClipRegion, const EventRegionsOverride& aOverride) { mEventRegions = aRegions; diff --git a/gfx/layers/apz/src/HitTestingTreeNode.h b/gfx/layers/apz/src/HitTestingTreeNode.h index d4499113a5..12c9accb77 100644 --- a/gfx/layers/apz/src/HitTestingTreeNode.h +++ b/gfx/layers/apz/src/HitTestingTreeNode.h @@ -81,7 +81,7 @@ public: void SetHitTestData(const EventRegions& aRegions, const gfx::Matrix4x4& aTransform, - const Maybe& aClipRegion, + const Maybe& aClipRegion, const EventRegionsOverride& aOverride); bool IsOutsideClip(const ParentLayerPoint& aPoint) const; /* Convert aPoint into the LayerPixel space for the layer corresponding to @@ -124,7 +124,7 @@ private: * of the touch-sensitive region provided by the GeckoContentController, or * because we may use the composition bounds of the layer if the clip is not * present. This value is in L's ParentLayerPixels. */ - Maybe mClipRegion; + Maybe mClipRegion; /* Indicates whether or not the event regions on this node need to be * overridden in a certain way. */ diff --git a/gfx/layers/basic/BasicCompositor.cpp b/gfx/layers/basic/BasicCompositor.cpp index 868488e8f1..bd2316a53b 100644 --- a/gfx/layers/basic/BasicCompositor.cpp +++ b/gfx/layers/basic/BasicCompositor.cpp @@ -486,18 +486,13 @@ BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion, gfx::Rect *aClipRectOut /* = nullptr */, gfx::Rect *aRenderBoundsOut /* = nullptr */) { - nsIntRect intRect; - mWidget->GetClientBounds(intRect); - mWidgetSize = gfx::ToIntSize(intRect.Size()); - - // The result of GetClientBounds is shifted over by the size of the window - // manager styling. We want to ignore that. - intRect.MoveTo(0, 0); + mWidgetSize = mWidget->GetClientSize(); + IntRect intRect = gfx::IntRect(IntPoint(), mWidgetSize); Rect rect = Rect(0, 0, intRect.width, intRect.height); // Sometimes the invalid region is larger than we want to draw. nsIntRegion invalidRegionSafe; - invalidRegionSafe.And(aInvalidRegion, intRect); + invalidRegionSafe.And(aInvalidRegion, gfx::ThebesIntRect(intRect)); nsIntRect invalidRect = invalidRegionSafe.GetBounds(); mInvalidRect = IntRect(invalidRect.x, invalidRect.y, invalidRect.width, invalidRect.height); diff --git a/gfx/layers/basic/BasicContainerLayer.cpp b/gfx/layers/basic/BasicContainerLayer.cpp index 663e5dc7e2..58c8d6da2c 100644 --- a/gfx/layers/basic/BasicContainerLayer.cpp +++ b/gfx/layers/basic/BasicContainerLayer.cpp @@ -102,7 +102,7 @@ BasicContainerLayer::ChildrenPartitionVisibleRegion(const nsIntRect& aInRect) childRegion.MoveBy(int32_t(childTransform._31), int32_t(childTransform._32)); childRegion.And(childRegion, rect); if (l->GetClipRect()) { - childRegion.And(childRegion, *l->GetClipRect() + offset); + childRegion.And(childRegion, ParentLayerIntRect::ToUntyped(*l->GetClipRect()) + offset); } nsIntRegion intersection; intersection.And(covered, childRegion); diff --git a/gfx/layers/basic/BasicLayerManager.cpp b/gfx/layers/basic/BasicLayerManager.cpp index 0b591d50c0..1b22d7190e 100644 --- a/gfx/layers/basic/BasicLayerManager.cpp +++ b/gfx/layers/basic/BasicLayerManager.cpp @@ -324,9 +324,9 @@ MarkLayersHidden(Layer* aLayer, const nsIntRect& aClipRect, } { - const nsIntRect* clipRect = aLayer->GetEffectiveClipRect(); + const Maybe& clipRect = aLayer->GetEffectiveClipRect(); if (clipRect) { - nsIntRect cr = *clipRect; + nsIntRect cr = ParentLayerIntRect::ToUntyped(*clipRect); // clipRect is in the container's coordinate system. Get it into the // global coordinate system. if (aLayer->GetParent()) { @@ -404,9 +404,9 @@ ApplyDoubleBuffering(Layer* aLayer, const nsIntRect& aVisibleRect) nsIntRect newVisibleRect(aVisibleRect); { - const nsIntRect* clipRect = aLayer->GetEffectiveClipRect(); + const Maybe& clipRect = aLayer->GetEffectiveClipRect(); if (clipRect) { - nsIntRect cr = *clipRect; + nsIntRect cr = ParentLayerIntRect::ToUntyped(*clipRect); // clipRect is in the container's coordinate system. Get it into the // global coordinate system. if (aLayer->GetParent()) { @@ -865,7 +865,7 @@ BasicLayerManager::PaintLayer(gfxContext* aTarget, RenderTraceScope trace("BasicLayerManager::PaintLayer", "707070"); - const nsIntRect* clipRect = aLayer->GetEffectiveClipRect(); + const Maybe& clipRect = aLayer->GetEffectiveClipRect(); BasicContainerLayer* container = static_cast(aLayer->AsContainerLayer()); bool needsGroup = container && container->UseIntermediateSurface(); diff --git a/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h b/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h index 9010710b81..19a8a70780 100644 --- a/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h +++ b/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h @@ -64,9 +64,10 @@ public: virtual gfx::SurfaceFormat GetFormat() const override; - virtual TextureSource* GetTextureSources() override + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override { - return mTextureSource; + aTexture = mTextureSource; + return !!aTexture; } virtual already_AddRefed GetAsSurface() override diff --git a/gfx/layers/basic/X11BasicCompositor.cpp b/gfx/layers/basic/X11BasicCompositor.cpp index c063a65c9f..cdf6c17187 100644 --- a/gfx/layers/basic/X11BasicCompositor.cpp +++ b/gfx/layers/basic/X11BasicCompositor.cpp @@ -35,12 +35,12 @@ X11DataTextureSourceBasic::Update(gfx::DataSourceSurface* aSurface, if (xrenderFormat) { surf = gfxXlibSurface::Create(screen, xrenderFormat, - ThebesIntSize(aSurface->GetSize())); + aSurface->GetSize()); } if (!surf) { NS_WARNING("Couldn't create native surface, fallback to image surface"); - surf = new gfxImageSurface(ThebesIntSize(aSurface->GetSize()), imageFormat); + surf = new gfxImageSurface(aSurface->GetSize(), imageFormat); } mBufferDrawTarget = gfxPlatform::GetPlatform()-> diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index 3c1ed281d0..6b63b8f6e9 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -140,12 +140,10 @@ static void TransformClipRect(Layer* aLayer, const Matrix4x4& aTransform) { - const nsIntRect* clipRect = aLayer->AsLayerComposite()->GetShadowClipRect(); + const Maybe& clipRect = aLayer->AsLayerComposite()->GetShadowClipRect(); if (clipRect) { - LayerIntRect transformed = TransformTo( - aTransform, LayerIntRect::FromUntyped(*clipRect)); - nsIntRect shadowClip = LayerIntRect::ToUntyped(transformed); - aLayer->AsLayerComposite()->SetShadowClipRect(&shadowClip); + ParentLayerIntRect transformed = TransformTo(aTransform, *clipRect); + aLayer->AsLayerComposite()->SetShadowClipRect(Some(transformed)); } } @@ -559,8 +557,8 @@ AdjustForClip(const Matrix4x4& asyncTransform, Layer* aLayer) // then applying it to container as-is will produce incorrect results. To // avoid this, translate the layer so that the clip rect starts at the origin, // apply the tree transform, and translate back. - if (const nsIntRect* shadowClipRect = aLayer->AsLayerComposite()->GetShadowClipRect()) { - if (shadowClipRect->TopLeft() != nsIntPoint()) { // avoid a gratuitous change of basis + if (const Maybe& shadowClipRect = aLayer->AsLayerComposite()->GetShadowClipRect()) { + if (shadowClipRect->TopLeft() != ParentLayerIntPoint()) { // avoid a gratuitous change of basis result.ChangeBasis(shadowClipRect->x, shadowClipRect->y, 0); } } @@ -583,7 +581,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer) Matrix4x4 combinedAsyncTransform; bool hasAsyncTransform = false; LayerMargin fixedLayerMargins(0, 0, 0, 0); - Maybe clipRect = ToMaybe(aLayer->AsLayerComposite()->GetShadowClipRect()); + Maybe clipRect = aLayer->AsLayerComposite()->GetShadowClipRect(); for (uint32_t i = 0; i < aLayer->GetFrameMetricsCount(); i++) { AsyncPanZoomController* controller = aLayer->GetAsyncPanZoomController(i); @@ -633,15 +631,14 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer) // bounds at that level. ParentLayerRect transformed = TransformTo( (Matrix4x4(asyncTransformWithoutOverscroll) * overscrollTransform), - ParentLayerRect(ViewAs(*clipRect))); - clipRect = Some(ParentLayerIntRect::ToUntyped( - RoundedOut(transformed.Intersect(metrics.mCompositionBounds)))); + ParentLayerRect(*clipRect)); + clipRect = Some(RoundedOut(transformed.Intersect(metrics.mCompositionBounds))); } } if (hasAsyncTransform) { if (clipRect) { - aLayer->AsLayerComposite()->SetShadowClipRect(clipRect.ptr()); + aLayer->AsLayerComposite()->SetShadowClipRect(clipRect); } // Apply the APZ transform on top of GetLocalTransform() here (rather than // GetTransform()) in case the OMTA code in SampleAnimations already set a diff --git a/gfx/layers/composite/CanvasLayerComposite.cpp b/gfx/layers/composite/CanvasLayerComposite.cpp index ace16ab673..0f6e90638f 100644 --- a/gfx/layers/composite/CanvasLayerComposite.cpp +++ b/gfx/layers/composite/CanvasLayerComposite.cpp @@ -66,7 +66,7 @@ CanvasLayerComposite::SetLayerManager(LayerManagerComposite* aManager) { LayerComposite::SetLayerManager(aManager); mManager = aManager; - if (mImageHost) { + if (mImageHost && mCompositor) { mImageHost->SetCompositor(mCompositor); } } diff --git a/gfx/layers/composite/CompositableHost.cpp b/gfx/layers/composite/CompositableHost.cpp index b1a218bcc4..7689d1b74a 100644 --- a/gfx/layers/composite/CompositableHost.cpp +++ b/gfx/layers/composite/CompositableHost.cpp @@ -119,8 +119,10 @@ CompositableHost::UseComponentAlphaTextures(TextureHost* aTextureOnBlack, TextureHost* aTextureOnWhite) { MOZ_ASSERT(aTextureOnBlack && aTextureOnWhite); - aTextureOnBlack->SetCompositor(GetCompositor()); - aTextureOnWhite->SetCompositor(GetCompositor()); + if (GetCompositor()) { + aTextureOnBlack->SetCompositor(GetCompositor()); + aTextureOnWhite->SetCompositor(GetCompositor()); + } } void @@ -130,6 +132,7 @@ CompositableHost::RemoveTextureHost(TextureHost* aTexture) void CompositableHost::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); mCompositor = aCompositor; } diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index c98fe5daa9..e73f512183 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -21,6 +21,7 @@ #include "PaintedLayerComposite.h" // for PaintedLayerComposite #include "TiledLayerBuffer.h" // for TiledLayerComposer #include "Units.h" // for ScreenIntRect +#include "UnitTransforms.h" // for ViewAs #include "gfx2DGlue.h" // for ToMatrix4x4 #include "gfxPrefs.h" // for gfxPrefs #ifdef XP_MACOSX @@ -234,9 +235,9 @@ LayerManagerComposite::ApplyOcclusionCulling(Layer* aLayer, nsIntRegion& aOpaque localOpaque.Or(localOpaque, composite->GetFullyRenderedRegion()); } localOpaque.MoveBy(transform2d._31, transform2d._32); - const nsIntRect* clip = aLayer->GetEffectiveClipRect(); + const Maybe& clip = aLayer->GetEffectiveClipRect(); if (clip) { - localOpaque.And(localOpaque, *clip); + localOpaque.And(localOpaque, ParentLayerIntRect::ToUntyped(*clip)); } aOpaqueRegion.Or(aOpaqueRegion, localOpaque); } @@ -694,7 +695,7 @@ LayerManagerComposite::Render() mInvalidRegion.SetEmpty(); } - nsIntRect clipRect; + ParentLayerIntRect clipRect; Rect bounds(mRenderBounds.x, mRenderBounds.y, mRenderBounds.width, mRenderBounds.height); Rect actualBounds; @@ -707,7 +708,7 @@ LayerManagerComposite::Render() } else { gfx::Rect rect; mCompositor->BeginFrame(invalid, nullptr, bounds, &rect, &actualBounds); - clipRect = nsIntRect(rect.x, rect.y, rect.width, rect.height); + clipRect = ParentLayerIntRect(rect.x, rect.y, rect.width, rect.height); } if (actualBounds.IsEmpty()) { @@ -729,8 +730,8 @@ LayerManagerComposite::Render() } // Render our layers. - RootLayer()->Prepare(RenderTargetPixel::FromUntyped(clipRect)); - RootLayer()->RenderLayer(clipRect); + RootLayer()->Prepare(ViewAs(clipRect, PixelCastJustification::RenderTargetIsParentLayerForRoot)); + RootLayer()->RenderLayer(ParentLayerIntRect::ToUntyped(clipRect)); if (!mRegionToClear.IsEmpty()) { nsIntRegionRectIterator iter(mRegionToClear); @@ -742,7 +743,7 @@ LayerManagerComposite::Render() if (mTwoPassTmpTarget) { MOZ_ASSERT(haveLayerEffects); - PopGroupForLayerEffects(previousTarget, clipRect, + PopGroupForLayerEffects(previousTarget, ParentLayerIntRect::ToUntyped(clipRect), grayscaleVal, invertVal, contrastVal); } @@ -1096,7 +1097,6 @@ LayerComposite::LayerComposite(LayerManagerComposite *aManager) : mCompositeManager(aManager) , mCompositor(aManager->GetCompositor()) , mShadowOpacity(1.0) - , mUseShadowClipRect(false) , mShadowTransformSetByAnimation(false) , mDestroyed(false) , mLayerComposited(false) diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index e91a0d5d69..3ace89817c 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -9,6 +9,7 @@ #include // for int32_t, uint32_t #include "GLDefs.h" // for GLenum #include "Layers.h" +#include "Units.h" // for ParentLayerIntRect #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc #include "mozilla/Attributes.h" // for override #include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed @@ -18,6 +19,7 @@ #include "mozilla/gfx/Types.h" // for SurfaceFormat #include "mozilla/layers/CompositorTypes.h" #include "mozilla/layers/LayersTypes.h" // for LayersBackend, etc +#include "mozilla/Maybe.h" // for Maybe #include "mozilla/RefPtr.h" #include "mozilla/UniquePtr.h" #include "nsAString.h" @@ -403,12 +405,9 @@ public: mShadowOpacity = aOpacity; } - void SetShadowClipRect(const nsIntRect* aRect) + void SetShadowClipRect(const Maybe& aRect) { - mUseShadowClipRect = aRect != nullptr; - if (aRect) { - mShadowClipRect = *aRect; - } + mShadowClipRect = aRect; } void SetShadowTransform(const gfx::Matrix4x4& aMatrix) @@ -432,7 +431,7 @@ public: // These getters can be used anytime. float GetShadowOpacity() { return mShadowOpacity; } - const nsIntRect* GetShadowClipRect() { return mUseShadowClipRect ? &mShadowClipRect : nullptr; } + const Maybe& GetShadowClipRect() { return mShadowClipRect; } const nsIntRegion& GetShadowVisibleRegion() { return mShadowVisibleRegion; } const gfx::Matrix4x4& GetShadowTransform() { return mShadowTransform; } bool GetShadowTransformSetByAnimation() { return mShadowTransformSetByAnimation; } @@ -449,11 +448,10 @@ public: protected: gfx::Matrix4x4 mShadowTransform; nsIntRegion mShadowVisibleRegion; - nsIntRect mShadowClipRect; + Maybe mShadowClipRect; LayerManagerComposite* mCompositeManager; RefPtr mCompositor; float mShadowOpacity; - bool mUseShadowClipRect; bool mShadowTransformSetByAnimation; bool mDestroyed; bool mLayerComposited; diff --git a/gfx/layers/composite/PaintedLayerComposite.cpp b/gfx/layers/composite/PaintedLayerComposite.cpp index 6a09982df8..e7da2232aa 100644 --- a/gfx/layers/composite/PaintedLayerComposite.cpp +++ b/gfx/layers/composite/PaintedLayerComposite.cpp @@ -89,7 +89,7 @@ PaintedLayerComposite::SetLayerManager(LayerManagerComposite* aManager) { LayerComposite::SetLayerManager(aManager); mManager = aManager; - if (mBuffer) { + if (mBuffer && mCompositor) { mBuffer->SetCompositor(mCompositor); } } diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp index a9eb9ea23c..f10a10cf35 100644 --- a/gfx/layers/composite/TextureHost.cpp +++ b/gfx/layers/composite/TextureHost.cpp @@ -147,13 +147,6 @@ TextureHost::GetIPDLActor() return mActor; } -bool -TextureHost::BindTextureSource(CompositableTextureSourceRef& texture) -{ - texture = GetTextureSources(); - return !!texture; -} - FenceHandle TextureHost::GetAndResetReleaseFenceHandle() { @@ -408,6 +401,7 @@ BufferTextureHost::Updated(const nsIntRegion* aRegion) void BufferTextureHost::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); if (mCompositor == aCompositor) { return; } @@ -448,12 +442,13 @@ BufferTextureHost::Unlock() mLocked = false; } -TextureSource* -BufferTextureHost::GetTextureSources() +bool +BufferTextureHost::BindTextureSource(CompositableTextureSourceRef& aTexture) { MOZ_ASSERT(mLocked); MOZ_ASSERT(mFirstSource); - return mFirstSource; + aTexture = mFirstSource; + return !!aTexture; } gfx::SurfaceFormat diff --git a/gfx/layers/composite/TextureHost.h b/gfx/layers/composite/TextureHost.h index 8c39083c30..0b3dbf707a 100644 --- a/gfx/layers/composite/TextureHost.h +++ b/gfx/layers/composite/TextureHost.h @@ -202,19 +202,6 @@ public: return *this; } - CompositableTextureRef& operator=(const already_AddRefed& aOther) - { - RefPtr temp = aOther; - if (temp) { - temp->AddCompositableRef(); - } - if (mRef) { - mRef->ReleaseCompositableRef(); - } - mRef = temp; - return *this; - } - CompositableTextureRef& operator=(T* aOther) { if (aOther) { @@ -376,15 +363,6 @@ public: */ virtual gfx::SurfaceFormat GetFormat() const = 0; - /** - * Return a list of TextureSources for use with a Compositor. - * - * This can trigger texture uploads, so do not call it inside transactions - * so as to not upload textures while the main thread is blocked. - * Must not be called while this TextureHost is not sucessfully Locked. - */ - virtual TextureSource* GetTextureSources() = 0; - /** * Called during the transaction. The TextureSource may or may not be composited. * @@ -397,7 +375,7 @@ public: * * Note that this is called only withing lock/unlock. */ - virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture); + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) = 0; /** * Called when another TextureHost will take over. @@ -584,7 +562,7 @@ public: virtual void Unlock() override; - virtual TextureSource* GetTextureSources() override; + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override; virtual void DeallocateDeviceData() override; @@ -592,7 +570,7 @@ public: /** * Return the format that is exposed to the compositor when calling - * GetTextureSources. + * BindTextureSource. * * If the shared format is YCbCr and the compositor does not support it, * GetFormat will be RGB32 (even though mFormat is SurfaceFormat::YUV). @@ -721,10 +699,11 @@ public: virtual bool Lock() override; virtual void Unlock() override; - virtual TextureSource* GetTextureSources() override { + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override { MOZ_ASSERT(mIsLocked); MOZ_ASSERT(mTexSource); - return mTexSource; + aTexture = mTexSource; + return !!aTexture; } virtual gfx::SurfaceFormat GetFormat() const override; diff --git a/gfx/layers/composite/TiledContentHost.cpp b/gfx/layers/composite/TiledContentHost.cpp index cfff0f4f93..74cfd6e166 100644 --- a/gfx/layers/composite/TiledContentHost.cpp +++ b/gfx/layers/composite/TiledContentHost.cpp @@ -212,6 +212,7 @@ TiledLayerBufferComposite::ValidateTile(TileHost aTile, void TiledLayerBufferComposite::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); if (!IsValid()) { return; } @@ -391,6 +392,7 @@ TiledContentHost::Composite(EffectChain& aEffectChain, const gfx::Rect& aClipRect, const nsIntRegion* aVisibleRegion /* = nullptr */) { + MOZ_ASSERT(mCompositor); if (mPendingUpload) { mTiledBuffer.SetCompositor(mCompositor); mTiledBuffer.Upload(); diff --git a/gfx/layers/composite/X11TextureHost.h b/gfx/layers/composite/X11TextureHost.h index 37a177517e..2cb89dde2a 100644 --- a/gfx/layers/composite/X11TextureHost.h +++ b/gfx/layers/composite/X11TextureHost.h @@ -30,9 +30,10 @@ public: virtual gfx::IntSize GetSize() const override; - virtual TextureSource* GetTextureSources() override + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override { - return mTextureSource; + aTexture = mTextureSource; + return !!aTexture; } virtual already_AddRefed GetAsSurface() override diff --git a/gfx/layers/d3d11/TextureD3D11.cpp b/gfx/layers/d3d11/TextureD3D11.cpp index 56d783ec87..3e2f2871af 100644 --- a/gfx/layers/d3d11/TextureD3D11.cpp +++ b/gfx/layers/d3d11/TextureD3D11.cpp @@ -649,6 +649,7 @@ DXGITextureHostD3D11::GetDevice() void DXGITextureHostD3D11::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); mCompositor = static_cast(aCompositor); } @@ -680,13 +681,14 @@ DXGITextureHostD3D11::Unlock() mIsLocked = false; } -TextureSource* -DXGITextureHostD3D11::GetTextureSources() +bool +DXGITextureHostD3D11::BindTextureSource(CompositableTextureSourceRef& aTexture) { MOZ_ASSERT(mIsLocked); // If Lock was successful we must have a valid TextureSource. MOZ_ASSERT(mTextureSource); - return mTextureSource.get(); + aTexture = mTextureSource; + return !!aTexture; } DXGIYCbCrTextureHostD3D11::DXGIYCbCrTextureHostD3D11(TextureFlags aFlags, @@ -743,6 +745,7 @@ DXGIYCbCrTextureHostD3D11::GetDevice() void DXGIYCbCrTextureHostD3D11::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); mCompositor = static_cast(aCompositor); } @@ -782,13 +785,14 @@ DXGIYCbCrTextureHostD3D11::Unlock() mIsLocked = false; } -TextureSource* -DXGIYCbCrTextureHostD3D11::GetTextureSources() +bool +DXGIYCbCrTextureHostD3D11::BindTextureSource(CompositableTextureSourceRef& aTexture) { MOZ_ASSERT(mIsLocked); // If Lock was successful we must have a valid TextureSource. MOZ_ASSERT(mTextureSources[0] && mTextureSources[1] && mTextureSources[2]); - return mTextureSources[0].get(); + aTexture = mTextureSources[0].get(); + return !!aTexture; } bool @@ -934,6 +938,7 @@ DataTextureSourceD3D11::GetTileRect() void DataTextureSourceD3D11::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); CompositorD3D11* d3dCompositor = static_cast(aCompositor); if (mCompositor && mCompositor != d3dCompositor) { Reset(); diff --git a/gfx/layers/d3d11/TextureD3D11.h b/gfx/layers/d3d11/TextureD3D11.h index eb8bae4aa0..18faf913d6 100644 --- a/gfx/layers/d3d11/TextureD3D11.h +++ b/gfx/layers/d3d11/TextureD3D11.h @@ -298,7 +298,7 @@ public: DXGITextureHostD3D11(TextureFlags aFlags, const SurfaceDescriptorD3D10& aDescriptor); - virtual TextureSource* GetTextureSources() override; + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override; virtual void DeallocateDeviceData() override {} @@ -337,7 +337,7 @@ public: DXGIYCbCrTextureHostD3D11(TextureFlags aFlags, const SurfaceDescriptorDXGIYCbCr& aDescriptor); - virtual TextureSource* GetTextureSources() override; + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override; virtual void DeallocateDeviceData() override{} diff --git a/gfx/layers/d3d9/CompositorD3D9.cpp b/gfx/layers/d3d9/CompositorD3D9.cpp index a242c43bac..ce78c7b161 100644 --- a/gfx/layers/d3d9/CompositorD3D9.cpp +++ b/gfx/layers/d3d9/CompositorD3D9.cpp @@ -27,6 +27,7 @@ CompositorD3D9::CompositorD3D9(PCompositorParent* aParent, nsIWidget *aWidget) : Compositor(aParent) , mWidget(aWidget) , mDeviceResetCount(0) + , mFailedResetAttemps(0) { Compositor::SetBackend(LayersBackend::LAYERS_D3D9); } @@ -556,6 +557,7 @@ CompositorD3D9::EnsureSwapChain() // We have a swap chain, lets initialise it DeviceManagerState state = mSwapChain->PrepareForRendering(); if (state == DeviceOK) { + mFailedResetAttemps = 0; return true; } // Swap chain could not be initialised, handle the failure @@ -583,10 +585,10 @@ CompositorD3D9::Ready() if (EnsureSwapChain()) { // We don't need to call VerifyReadyForRendering because that is // called by mSwapChain->PrepareForRendering() via EnsureSwapChain(). - CheckResetCount(); return true; } + FailedToResetDevice(); return false; } @@ -596,6 +598,7 @@ CompositorD3D9::Ready() mDeviceManager = gfxWindowsPlatform::GetPlatform()->GetD3D9DeviceManager(); if (!mDeviceManager) { + FailedToResetDevice(); mParent->SendInvalidateAll(); return false; } @@ -606,6 +609,19 @@ CompositorD3D9::Ready() return false; } +void +CompositorD3D9::FailedToResetDevice() { + mFailedResetAttemps += 1; + auto withoutAssertion = CriticalLog::DefaultOptions(false); + gfxCriticalError(withoutAssertion) << "[D3D9] Failed to re-create a D3D9 device, attempt " + << mFailedResetAttemps; + // 10 is a totally arbitrary number that we may want to increase or decrease + // depending on how things behave in the wild. + if (mFailedResetAttemps > 10) { + MOZ_CRASH("Unable to get a working D3D9 Compositor"); + } +} + void CompositorD3D9::BeginFrame(const nsIntRegion& aInvalidRegion, const Rect *aClipRectIn, diff --git a/gfx/layers/d3d9/CompositorD3D9.h b/gfx/layers/d3d9/CompositorD3D9.h index e73645575a..404b760075 100644 --- a/gfx/layers/d3d9/CompositorD3D9.h +++ b/gfx/layers/d3d9/CompositorD3D9.h @@ -146,6 +146,8 @@ private: */ void CheckResetCount(); + void FailedToResetDevice(); + void ReportFailure(const nsACString &aMsg, HRESULT aCode); virtual gfx::IntSize GetWidgetSize() const override @@ -168,6 +170,7 @@ private: nsIntSize mSize; uint32_t mDeviceResetCount; + uint32_t mFailedResetAttemps; }; } diff --git a/gfx/layers/d3d9/DeviceManagerD3D9.cpp b/gfx/layers/d3d9/DeviceManagerD3D9.cpp index c870a9b6d3..8b22d40b6e 100644 --- a/gfx/layers/d3d9/DeviceManagerD3D9.cpp +++ b/gfx/layers/d3d9/DeviceManagerD3D9.cpp @@ -301,8 +301,8 @@ DeviceManagerD3D9::Init() &pp, getter_AddRefs(mDevice)); - if (FAILED(hr)) { - gfxCriticalError() << "[D3D9] Failed to create the device"; + if (FAILED(hr) || !mDevice) { + gfxCriticalError() << "[D3D9] Failed to create the device, code: " << hexa(hr); return false; } } diff --git a/gfx/layers/d3d9/TextureD3D9.cpp b/gfx/layers/d3d9/TextureD3D9.cpp index b917669b8c..d12d598227 100644 --- a/gfx/layers/d3d9/TextureD3D9.cpp +++ b/gfx/layers/d3d9/TextureD3D9.cpp @@ -518,6 +518,7 @@ DataTextureSourceD3D9::Update(gfxWindowsSurface* aSurface) void DataTextureSourceD3D9::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); CompositorD3D9* d3dCompositor = static_cast(aCompositor); if (mCompositor && mCompositor != d3dCompositor) { Reset(); @@ -712,7 +713,7 @@ CairoTextureClientD3D9::BorrowDrawTarget() gfxCriticalError() << "Failed to lock rect borrowing the target in D3D9 " << hexa(hr); return nullptr; } - mSurface = new gfxImageSurface((uint8_t*)rect.pBits, ThebesIntSize(mSize), + mSurface = new gfxImageSurface((uint8_t*)rect.pBits, mSize, rect.Pitch, SurfaceFormatToImageFormat(mFormat)); mLockRect = true; } @@ -857,6 +858,10 @@ DataTextureSourceD3D9::UpdateFromTexture(IDirect3DTexture9* aTexture, } DeviceManagerD3D9* dm = gfxWindowsPlatform::GetPlatform()->GetD3D9DeviceManager(); + if (!dm || !dm->device()) { + return false; + } + if (!mTexture) { mTexture = dm->CreateTexture(mSize, SurfaceFormatToD3D9Format(mFormat), D3DPOOL_DEFAULT, this); @@ -921,7 +926,9 @@ TextureHostD3D9::Updated(const nsIntRegion* aRegion) nullptr, mFlags); } - mTextureSource->UpdateFromTexture(mTexture, aRegion); + if (!mTextureSource->UpdateFromTexture(mTexture, aRegion)) { + gfxCriticalError() << "[D3D9] DataTextureSourceD3D9::UpdateFromTexture failed"; + } } IDirect3DDevice9* @@ -939,12 +946,13 @@ TextureHostD3D9::SetCompositor(Compositor* aCompositor) } } -TextureSource* -TextureHostD3D9::GetTextureSources() +bool +TextureHostD3D9::BindTextureSource(CompositableTextureSourceRef& aTexture) { MOZ_ASSERT(mIsLocked); MOZ_ASSERT(mTextureSource); - return mTextureSource; + aTexture = mTextureSource; + return !!aTexture; } bool @@ -1015,12 +1023,13 @@ DXGITextureHostD3D9::OpenSharedHandle() return; } -TextureSource* -DXGITextureHostD3D9::GetTextureSources() +bool +DXGITextureHostD3D9::BindTextureSource(CompositableTextureSourceRef& aTexture) { MOZ_ASSERT(mIsLocked); MOZ_ASSERT(mTextureSource); - return mTextureSource; + aTexture = mTextureSource; + return !!aTexture; } bool @@ -1049,6 +1058,7 @@ DXGITextureHostD3D9::Unlock() void DXGITextureHostD3D9::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); mCompositor = static_cast(aCompositor); } @@ -1080,6 +1090,7 @@ DXGIYCbCrTextureHostD3D9::GetDevice() void DXGIYCbCrTextureHostD3D9::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); mCompositor = static_cast(aCompositor); } @@ -1131,13 +1142,14 @@ DXGIYCbCrTextureHostD3D9::Unlock() mIsLocked = false; } -TextureSource* -DXGIYCbCrTextureHostD3D9::GetTextureSources() +bool +DXGIYCbCrTextureHostD3D9::BindTextureSource(CompositableTextureSourceRef& aTexture) { MOZ_ASSERT(mIsLocked); // If Lock was successful we must have a valid TextureSource. MOZ_ASSERT(mTextureSources[0] && mTextureSources[1] && mTextureSources[2]); - return mTextureSources[0].get(); + aTexture = mTextureSources[0].get(); + return !!aTexture; } } diff --git a/gfx/layers/d3d9/TextureD3D9.h b/gfx/layers/d3d9/TextureD3D9.h index d9a01dec9b..96f3180ee7 100644 --- a/gfx/layers/d3d9/TextureD3D9.h +++ b/gfx/layers/d3d9/TextureD3D9.h @@ -296,7 +296,7 @@ public: TextureHostD3D9(TextureFlags aFlags, const SurfaceDescriptorD3D9& aDescriptor); - virtual TextureSource* GetTextureSources() override; + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override; virtual void DeallocateDeviceData() override; @@ -337,7 +337,7 @@ public: DXGITextureHostD3D9(TextureFlags aFlags, const SurfaceDescriptorD3D10& aDescriptor); - virtual TextureSource* GetTextureSources() override; + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override; virtual void DeallocateDeviceData() override; @@ -374,7 +374,7 @@ public: DXGIYCbCrTextureHostD3D9(TextureFlags aFlags, const SurfaceDescriptorDXGIYCbCr& aDescriptor); - virtual TextureSource* GetTextureSources() override; + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override; virtual void DeallocateDeviceData() override {} diff --git a/gfx/layers/ipc/LayerTransactionParent.cpp b/gfx/layers/ipc/LayerTransactionParent.cpp index 2115f68a2f..b7e3273b07 100644 --- a/gfx/layers/ipc/LayerTransactionParent.cpp +++ b/gfx/layers/ipc/LayerTransactionParent.cpp @@ -327,7 +327,7 @@ LayerTransactionParent::RecvUpdate(InfallibleTArray&& cset, layer->SetEventRegions(common.eventRegions()); layer->SetContentFlags(common.contentFlags()); layer->SetOpacity(common.opacity()); - layer->SetClipRect(common.useClipRect() ? &common.clipRect() : nullptr); + layer->SetClipRect(common.useClipRect() ? Some(common.clipRect()) : Nothing()); layer->SetBaseTransform(common.transform().value()); layer->SetPostScale(common.postXScale(), common.postYScale()); layer->SetIsFixedPosition(common.isFixedPosition()); diff --git a/gfx/layers/ipc/LayersMessages.ipdlh b/gfx/layers/ipc/LayersMessages.ipdlh index ec59d7a015..b844acfbd8 100644 --- a/gfx/layers/ipc/LayersMessages.ipdlh +++ b/gfx/layers/ipc/LayersMessages.ipdlh @@ -33,6 +33,7 @@ using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h using mozilla::LayerMargin from "Units.h"; using mozilla::LayerPoint from "Units.h"; using mozilla::LayerRect from "Units.h"; +using mozilla::ParentLayerIntRect from "Units.h"; using mozilla::layers::ScaleMode from "mozilla/layers/LayersTypes.h"; using mozilla::layers::EventRegions from "mozilla/layers/LayersTypes.h"; using mozilla::layers::EventRegionsOverride from "mozilla/layers/LayersTypes.h"; @@ -204,7 +205,7 @@ struct CommonLayerAttributes { uint32_t contentFlags; float opacity; bool useClipRect; - nsIntRect clipRect; + ParentLayerIntRect clipRect; bool isFixedPosition; LayerPoint fixedPositionAnchor; LayerMargin fixedPositionMargin; diff --git a/gfx/layers/ipc/ShadowLayerUtilsX11.cpp b/gfx/layers/ipc/ShadowLayerUtilsX11.cpp index 8fa9a53f0a..ec2701f3c5 100644 --- a/gfx/layers/ipc/ShadowLayerUtilsX11.cpp +++ b/gfx/layers/ipc/ShadowLayerUtilsX11.cpp @@ -90,7 +90,7 @@ SurfaceDescriptorX11::OpenForeign() const nsRefPtr surf; XRenderPictFormat* pictFormat = GetXRenderPictFormatFromId(display, mFormat); if (pictFormat) { - surf = new gfxXlibSurface(screen, mId, pictFormat, gfx::ThebesIntSize(mSize)); + surf = new gfxXlibSurface(screen, mId, pictFormat, mSize); } else { Visual* visual; int depth; @@ -98,7 +98,7 @@ SurfaceDescriptorX11::OpenForeign() const if (!visual) return nullptr; - surf = new gfxXlibSurface(display, mId, visual, gfx::ThebesIntSize(mSize)); + surf = new gfxXlibSurface(display, mId, visual, mSize); } return surf->CairoStatus() ? nullptr : surf.forget(); } diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index 5acce0a7ad..c7fbeb0e62 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -602,7 +602,7 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray* aReplies, common.opacity() = mutant->GetOpacity(); common.useClipRect() = !!mutant->GetClipRect(); common.clipRect() = (common.useClipRect() ? - *mutant->GetClipRect() : nsIntRect()); + *mutant->GetClipRect() : ParentLayerIntRect()); common.isFixedPosition() = mutant->GetIsFixedPosition(); common.fixedPositionAnchor() = mutant->GetFixedPositionAnchor(); common.fixedPositionMargin() = mutant->GetFixedPositionMargins(); diff --git a/gfx/layers/opengl/GrallocTextureHost.cpp b/gfx/layers/opengl/GrallocTextureHost.cpp index 8565b6287b..712e5363ca 100644 --- a/gfx/layers/opengl/GrallocTextureHost.cpp +++ b/gfx/layers/opengl/GrallocTextureHost.cpp @@ -127,6 +127,7 @@ GrallocTextureHostOGL::~GrallocTextureHostOGL() void GrallocTextureHostOGL::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); mCompositor = static_cast(aCompositor); if (mGLTextureSource) { mGLTextureSource->SetCompositor(mCompositor); @@ -219,7 +220,7 @@ GrallocTextureHostOGL::GetRenderState() flags |= LayerRenderStateFlags::FORMAT_RB_SWAP; } return LayerRenderState(graphicBuffer, - gfx::ThebesIntSize(mDescriptorSize), + mDescriptorSize, flags, this); } @@ -243,12 +244,6 @@ GrallocTextureHostOGL::GetAsSurface() { return surf.forget(); } -TextureSource* -GrallocTextureHostOGL::GetTextureSources() -{ - return nullptr; -} - void GrallocTextureHostOGL::UnbindTextureSource() { diff --git a/gfx/layers/opengl/GrallocTextureHost.h b/gfx/layers/opengl/GrallocTextureHost.h index 4bd2994aca..ff74f08404 100644 --- a/gfx/layers/opengl/GrallocTextureHost.h +++ b/gfx/layers/opengl/GrallocTextureHost.h @@ -53,8 +53,6 @@ public: virtual void UnbindTextureSource() override; - virtual TextureSource* GetTextureSources() override; - #if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17 virtual TextureHostOGL* AsHostOGL() override { diff --git a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h index cbb978122f..14fa2ff15f 100644 --- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h +++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h @@ -74,9 +74,10 @@ public: virtual gfx::SurfaceFormat GetFormat() const override; - virtual TextureSource* GetTextureSources() override + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override { - return mTextureSource; + aTexture = mTextureSource; + return !!aTexture; } virtual already_AddRefed GetAsSurface() override diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp index 4d1794f4fc..49fb8d0275 100644 --- a/gfx/layers/opengl/TextureHostOGL.cpp +++ b/gfx/layers/opengl/TextureHostOGL.cpp @@ -309,6 +309,7 @@ TextureImageTextureSourceOGL::CopyTo(const nsIntRect& aSourceRect, void TextureImageTextureSourceOGL::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); CompositorOGL* glCompositor = static_cast(aCompositor); if (!glCompositor || (mCompositor != glCompositor)) { @@ -414,6 +415,7 @@ GLTextureSource::BindTexture(GLenum aTextureUnit, gfx::Filter aFilter) void GLTextureSource::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); mCompositor = static_cast(aCompositor); } @@ -472,6 +474,7 @@ SurfaceTextureSource::BindTexture(GLenum aTextureUnit, gfx::Filter aFilter) void SurfaceTextureSource::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); if (mCompositor != aCompositor) { DeallocateDeviceData(); } @@ -553,6 +556,7 @@ SurfaceTextureHost::Unlock() void SurfaceTextureHost::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); CompositorOGL* glCompositor = static_cast(aCompositor); mCompositor = glCompositor; if (mTextureSource) { @@ -613,6 +617,7 @@ EGLImageTextureSource::BindTexture(GLenum aTextureUnit, gfx::Filter aFilter) void EGLImageTextureSource::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); mCompositor = static_cast(aCompositor); } @@ -694,6 +699,7 @@ EGLImageTextureHost::Unlock() void EGLImageTextureHost::SetCompositor(Compositor* aCompositor) { + MOZ_ASSERT(aCompositor); CompositorOGL* glCompositor = static_cast(aCompositor); mCompositor = glCompositor; if (mTextureSource) { diff --git a/gfx/layers/opengl/TextureHostOGL.h b/gfx/layers/opengl/TextureHostOGL.h index e0baed0b4f..7137d099de 100644 --- a/gfx/layers/opengl/TextureHostOGL.h +++ b/gfx/layers/opengl/TextureHostOGL.h @@ -399,9 +399,10 @@ public: virtual gfx::SurfaceFormat GetFormat() const override; - virtual TextureSource* GetTextureSources() override + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override { - return mTextureSource; + aTexture = mTextureSource; + return !!aTexture; } virtual already_AddRefed GetAsSurface() override @@ -491,9 +492,10 @@ public: virtual gfx::SurfaceFormat GetFormat() const override; - virtual TextureSource* GetTextureSources() override + virtual bool BindTextureSource(CompositableTextureSourceRef& aTexture) override { - return mTextureSource; + aTexture = mTextureSource; + return !!aTexture; } virtual already_AddRefed GetAsSurface() override diff --git a/gfx/src/RegionTyped.h b/gfx/src/RegionTyped.h new file mode 100644 index 0000000000..7547511762 --- /dev/null +++ b/gfx/src/RegionTyped.h @@ -0,0 +1,54 @@ +/* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* 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/. */ + +#ifndef mozilla_RegionTyped_h +#define mozilla_RegionTyped_h + +#include "nsRegion.h" +#include "mozilla/gfx/Rect.h" + +namespace mozilla { + +namespace gfx { + +template +class IntRegionTyped : + public BaseIntRegion, IntRectTyped, IntPointTyped, IntMarginTyped> +{ + typedef BaseIntRegion, IntRectTyped, IntPointTyped, IntMarginTyped> Super; +public: + // Forward constructors. + IntRegionTyped() {} + MOZ_IMPLICIT IntRegionTyped(const IntRectTyped& aRect) : Super(aRect) {} + IntRegionTyped(const IntRegionTyped& aRegion) : Super(aRegion) {} + IntRegionTyped(IntRegionTyped&& aRegion) : Super(mozilla::Move(aRegion)) {} + + // Assignment operators need to be forwarded as well, otherwise the compiler + // will declare deleted ones. + IntRegionTyped& operator=(const IntRegionTyped& aRegion) + { + return Super::operator=(aRegion); + } + IntRegionTyped& operator=(IntRegionTyped&& aRegion) + { + return Super::operator=(mozilla::Move(aRegion)); + } + + static IntRegionTyped FromUntyped(const nsIntRegion& aRegion) + { + return IntRegionTyped(aRegion.Impl()); + } +private: + // This is deliberately private, so calling code uses FromUntyped(). + explicit IntRegionTyped(const nsRegion& aRegion) : Super(aRegion) {} +}; + +} + +} + + + +#endif /* mozilla_RegionTyped_h */ diff --git a/gfx/src/moz.build b/gfx/src/moz.build index a5cf9ecb75..fbdad40f78 100644 --- a/gfx/src/moz.build +++ b/gfx/src/moz.build @@ -39,6 +39,10 @@ EXPORTS.mozilla += [ 'AppUnits.h', ] +EXPORTS.mozilla.gfx += [ + 'RegionTyped.h', +] + if CONFIG['MOZ_X11']: EXPORTS.mozilla += ['X11Util.h'] SOURCES += [ diff --git a/gfx/src/nsPoint.h b/gfx/src/nsPoint.h index 042daa8bf9..4a621d4ced 100644 --- a/gfx/src/nsPoint.h +++ b/gfx/src/nsPoint.h @@ -26,8 +26,13 @@ struct nsPoint : public mozilla::gfx::BasePoint { nscoord aAppUnitsPerPixel) const; inline nsIntPoint ToNearestPixels(nscoord aAppUnitsPerPixel) const; - // Converts this point from aFromAPP, an appunits per pixel ratio, to aToAPP. - inline nsPoint ConvertAppUnits(int32_t aFromAPP, int32_t aToAPP) const; + /** + * Return this point scaled to a different appunits per pixel (APP) ratio. + * @param aFromAPP the APP to scale from + * @param aToAPP the APP to scale to + */ + MOZ_WARN_UNUSED_RESULT inline nsPoint + ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const; }; // nsIntPoint represents a point in one of the types of pixels. @@ -60,7 +65,7 @@ nsPoint::ToNearestPixels(nscoord aAppUnitsPerPixel) const } inline nsPoint -nsPoint::ConvertAppUnits(int32_t aFromAPP, int32_t aToAPP) const +nsPoint::ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const { if (aFromAPP != aToAPP) { nsPoint point; diff --git a/gfx/src/nsRect.h b/gfx/src/nsRect.h index 3ed6ece9b9..e424cefd1d 100644 --- a/gfx/src/nsRect.h +++ b/gfx/src/nsRect.h @@ -14,6 +14,7 @@ #include "gfxCore.h" // for NS_GFX #include "mozilla/Likely.h" // for MOZ_UNLIKELY #include "mozilla/gfx/BaseRect.h" // for BaseRect +#include "mozilla/gfx/NumericTools.h" // for RoundUpToMultiple, RoundDownToMultiple #include "nsCoord.h" // for nscoord, etc #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc #include "nsPoint.h" // for nsIntPoint, nsPoint @@ -59,7 +60,7 @@ struct NS_GFX nsRect : // overflowing nscoord values in the 'width' and 'height' fields by // clamping the width and height values to nscoord_MAX if necessary. - nsRect SaturatingUnion(const nsRect& aRect) const + MOZ_WARN_UNUSED_RESULT nsRect SaturatingUnion(const nsRect& aRect) const { if (IsEmpty()) { return aRect; @@ -70,7 +71,7 @@ struct NS_GFX nsRect : } } - nsRect SaturatingUnionEdges(const nsRect& aRect) const + MOZ_WARN_UNUSED_RESULT nsRect SaturatingUnionEdges(const nsRect& aRect) const { #ifdef NS_COORD_IS_FLOAT return UnionEdges(aRect); @@ -107,7 +108,7 @@ struct NS_GFX nsRect : #ifndef NS_COORD_IS_FLOAT // Make all nsRect Union methods be saturating. - nsRect UnionEdges(const nsRect& aRect) const + MOZ_WARN_UNUSED_RESULT nsRect UnionEdges(const nsRect& aRect) const { return SaturatingUnionEdges(aRect); } @@ -115,7 +116,7 @@ struct NS_GFX nsRect : { *this = aRect1.UnionEdges(aRect2); } - nsRect Union(const nsRect& aRect) const + MOZ_WARN_UNUSED_RESULT nsRect Union(const nsRect& aRect) const { return SaturatingUnion(aRect); } @@ -134,25 +135,42 @@ struct NS_GFX nsRect : *this = aRect1.SaturatingUnionEdges(aRect2); } - // Converts this rect from aFromAPP, an appunits per pixel ratio, to aToAPP. - // In the RoundOut version we make the rect the smallest rect containing the - // unrounded result. In the RoundIn version we make the rect the largest rect - // contained in the unrounded result. - // Note: this can turn an empty rectangle into a non-empty rectangle - inline nsRect ConvertAppUnitsRoundOut(int32_t aFromAPP, int32_t aToAPP) const; - inline nsRect ConvertAppUnitsRoundIn(int32_t aFromAPP, int32_t aToAPP) const; + /** + * Return this rect scaled to a different appunits per pixel (APP) ratio. + * In the RoundOut version we make the rect the smallest rect containing the + * unrounded result. In the RoundIn version we make the rect the largest rect + * contained in the unrounded result. + * @param aFromAPP the APP to scale from + * @param aToAPP the APP to scale to + * @note this can turn an empty rectangle into a non-empty rectangle + */ + MOZ_WARN_UNUSED_RESULT inline nsRect + ScaleToOtherAppUnitsRoundOut(int32_t aFromAPP, int32_t aToAPP) const; + MOZ_WARN_UNUSED_RESULT inline nsRect + ScaleToOtherAppUnitsRoundIn(int32_t aFromAPP, int32_t aToAPP) const; + + MOZ_WARN_UNUSED_RESULT inline nsIntRect + ScaleToNearestPixels(float aXScale, float aYScale, + nscoord aAppUnitsPerPixel) const; + + MOZ_WARN_UNUSED_RESULT inline nsIntRect + ToNearestPixels(nscoord aAppUnitsPerPixel) const; - inline nsIntRect ScaleToNearestPixels(float aXScale, float aYScale, - nscoord aAppUnitsPerPixel) const; - inline nsIntRect ToNearestPixels(nscoord aAppUnitsPerPixel) const; // Note: this can turn an empty rectangle into a non-empty rectangle - inline nsIntRect ScaleToOutsidePixels(float aXScale, float aYScale, - nscoord aAppUnitsPerPixel) const; + MOZ_WARN_UNUSED_RESULT inline nsIntRect + ScaleToOutsidePixels(float aXScale, float aYScale, + nscoord aAppUnitsPerPixel) const; + // Note: this can turn an empty rectangle into a non-empty rectangle - inline nsIntRect ToOutsidePixels(nscoord aAppUnitsPerPixel) const; - inline nsIntRect ScaleToInsidePixels(float aXScale, float aYScale, - nscoord aAppUnitsPerPixel) const; - inline nsIntRect ToInsidePixels(nscoord aAppUnitsPerPixel) const; + MOZ_WARN_UNUSED_RESULT inline nsIntRect + ToOutsidePixels(nscoord aAppUnitsPerPixel) const; + + MOZ_WARN_UNUSED_RESULT inline nsIntRect + ScaleToInsidePixels(float aXScale, float aYScale, + nscoord aAppUnitsPerPixel) const; + + MOZ_WARN_UNUSED_RESULT inline nsIntRect + ToInsidePixels(nscoord aAppUnitsPerPixel) const; // This is here only to keep IPDL-generated code happy. DO NOT USE. bool operator==(const nsRect& aRect) const @@ -180,7 +198,8 @@ struct NS_GFX nsIntRect : { } - inline nsRect ToAppUnits(nscoord aAppUnitsPerPixel) const; + MOZ_WARN_UNUSED_RESULT inline nsRect + ToAppUnits(nscoord aAppUnitsPerPixel) const; // Returns a special nsIntRect that's used in some places to signify // "all available space". @@ -189,6 +208,20 @@ struct NS_GFX nsIntRect : return r; } + void InflateToMultiple(const nsIntSize& aTileSize) + { + int32_t xMost = XMost(); + int32_t yMost = YMost(); + + x = RoundDownToMultiple(x, aTileSize.width); + y = RoundDownToMultiple(y, aTileSize.height); + xMost = RoundUpToMultiple(xMost, aTileSize.width); + yMost = RoundUpToMultiple(yMost, aTileSize.height); + + width = xMost - x; + height = yMost - y; + } + // This is here only to keep IPDL-generated code happy. DO NOT USE. bool operator==(const nsIntRect& aRect) const { @@ -201,7 +234,7 @@ struct NS_GFX nsIntRect : */ inline nsRect -nsRect::ConvertAppUnitsRoundOut(int32_t aFromAPP, int32_t aToAPP) const +nsRect::ScaleToOtherAppUnitsRoundOut(int32_t aFromAPP, int32_t aToAPP) const { if (aFromAPP == aToAPP) { return *this; @@ -219,7 +252,7 @@ nsRect::ConvertAppUnitsRoundOut(int32_t aFromAPP, int32_t aToAPP) const } inline nsRect -nsRect::ConvertAppUnitsRoundIn(int32_t aFromAPP, int32_t aToAPP) const +nsRect::ScaleToOtherAppUnitsRoundIn(int32_t aFromAPP, int32_t aToAPP) const { if (aFromAPP == aToAPP) { return *this; diff --git a/gfx/src/nsRegion.cpp b/gfx/src/nsRegion.cpp index b9c18b871b..1d02285ca2 100644 --- a/gfx/src/nsRegion.cpp +++ b/gfx/src/nsRegion.cpp @@ -639,7 +639,7 @@ nsRegion& nsRegion::Transform (const gfx3DMatrix &aTransform) } -nsRegion nsRegion::ConvertAppUnitsRoundOut (int32_t aFromAPP, int32_t aToAPP) const +nsRegion nsRegion::ScaleToOtherAppUnitsRoundOut (int32_t aFromAPP, int32_t aToAPP) const { if (aFromAPP == aToAPP) { return *this; @@ -650,7 +650,7 @@ nsRegion nsRegion::ConvertAppUnitsRoundOut (int32_t aFromAPP, int32_t aToAPP) co pixman_box32_t *boxes = pixman_region32_rectangles(®ion.mImpl, &n); for (int i=0; iToAppUnits(aAppUnitsPerPixel); - result.Or(result, appRect); - } - return result; -} diff --git a/gfx/src/nsRegion.h b/gfx/src/nsRegion.h index 0ed92aa4f4..632398d62e 100644 --- a/gfx/src/nsRegion.h +++ b/gfx/src/nsRegion.h @@ -285,11 +285,18 @@ public: } const nsRect GetBounds () const { return BoxToRect(mImpl.extents); } uint64_t Area () const; - // Converts this region from aFromAPP, an appunits per pixel ratio, to - // aToAPP. This applies nsRect::ConvertAppUnitsRoundOut/In to each rect of - // the region. - nsRegion ConvertAppUnitsRoundOut (int32_t aFromAPP, int32_t aToAPP) const; - nsRegion ConvertAppUnitsRoundIn (int32_t aFromAPP, int32_t aToAPP) const; + + /** + * Return this region scaled to a different appunits per pixel (APP) ratio. + * This applies nsRect::ScaleToOtherAppUnitsRoundOut/In to each rect of the region. + * @param aFromAPP the APP to scale from + * @param aToAPP the APP to scale to + * @note this can turn an empty region into a non-empty region + */ + MOZ_WARN_UNUSED_RESULT nsRegion + ScaleToOtherAppUnitsRoundOut (int32_t aFromAPP, int32_t aToAPP) const; + MOZ_WARN_UNUSED_RESULT nsRegion + ScaleToOtherAppUnitsRoundIn (int32_t aFromAPP, int32_t aToAPP) const; nsRegion& ScaleRoundOut(float aXScale, float aYScale); nsRegion& ScaleInverseRoundOut(float aXScale, float aYScale); nsRegion& Transform (const gfx3DMatrix &aTransform); @@ -456,154 +463,161 @@ public: } }; +namespace mozilla { +namespace gfx { + /** - * nsIntRegions use int32_t coordinates and nsIntRects. + * BaseIntRegions use int32_t coordinates. */ -class NS_GFX nsIntRegion +template +class NS_GFX BaseIntRegion { - friend class nsIntRegionRectIterator; - friend class nsRegion; + friend class ::nsRegion; public: - nsIntRegion () {} - MOZ_IMPLICIT nsIntRegion (const nsIntRect& aRect) : mImpl (ToRect(aRect)) {} - nsIntRegion (const nsIntRegion& aRegion) : mImpl (aRegion.mImpl) {} - nsIntRegion (nsIntRegion&& aRegion) : mImpl (mozilla::Move(aRegion.mImpl)) {} - nsIntRegion& operator = (const nsIntRect& aRect) { mImpl = ToRect (aRect); return *this; } - nsIntRegion& operator = (const nsIntRegion& aRegion) { mImpl = aRegion.mImpl; return *this; } - nsIntRegion& operator = (nsIntRegion&& aRegion) { mImpl = mozilla::Move(aRegion.mImpl); return *this; } + typedef Rect RectType; + typedef Point PointType; + typedef Margin MarginType; - bool operator==(const nsIntRegion& aRgn) const + BaseIntRegion () {} + MOZ_IMPLICIT BaseIntRegion (const Rect& aRect) : mImpl (ToRect(aRect)) {} + BaseIntRegion (const BaseIntRegion& aRegion) : mImpl (aRegion.mImpl) {} + BaseIntRegion (BaseIntRegion&& aRegion) : mImpl (mozilla::Move(aRegion.mImpl)) {} + Derived& operator = (const Rect& aRect) { mImpl = ToRect (aRect); return This(); } + Derived& operator = (const Derived& aRegion) { mImpl = aRegion.mImpl; return This(); } + Derived& operator = (Derived&& aRegion) { mImpl = mozilla::Move(aRegion.mImpl); return This(); } + + bool operator==(const Derived& aRgn) const { return IsEqual(aRgn); } - bool operator!=(const nsIntRegion& aRgn) const + bool operator!=(const Derived& aRgn) const { return !(*this == aRgn); } - friend std::ostream& operator<<(std::ostream& stream, const nsIntRegion& m) { + friend std::ostream& operator<<(std::ostream& stream, const Derived& m) { return stream << m.mImpl; } - void Swap(nsIntRegion* aOther) + void Swap(Derived* aOther) { mImpl.Swap(&aOther->mImpl); } - void AndWith(const nsIntRegion& aOther) + void AndWith(const Derived& aOther) { - And(*this, aOther); + And(This(), aOther); } - void AndWith(const nsIntRect& aOther) + void AndWith(const Rect& aOther) { - And(*this, aOther); + And(This(), aOther); } - nsIntRegion& And (const nsIntRegion& aRgn1, const nsIntRegion& aRgn2) + Derived& And (const Derived& aRgn1, const Derived& aRgn2) { mImpl.And (aRgn1.mImpl, aRgn2.mImpl); - return *this; + return This(); } - nsIntRegion& And (const nsIntRegion& aRegion, const nsIntRect& aRect) + Derived& And (const Derived& aRegion, const Rect& aRect) { mImpl.And (aRegion.mImpl, ToRect (aRect)); - return *this; + return This(); } - nsIntRegion& And (const nsIntRect& aRect, const nsIntRegion& aRegion) + Derived& And (const Rect& aRect, const Derived& aRegion) { return And (aRegion, aRect); } - nsIntRegion& And (const nsIntRect& aRect1, const nsIntRect& aRect2) + Derived& And (const Rect& aRect1, const Rect& aRect2) { - nsIntRect TmpRect; + Rect TmpRect; TmpRect.IntersectRect (aRect1, aRect2); mImpl = ToRect (TmpRect); - return *this; + return This(); } - nsIntRegion& OrWith(const nsIntRegion& aOther) + Derived& OrWith(const Derived& aOther) { - return Or(*this, aOther); + return Or(This(), aOther); } - nsIntRegion& OrWith(const nsIntRect& aOther) + Derived& OrWith(const Rect& aOther) { - return Or(*this, aOther); + return Or(This(), aOther); } - nsIntRegion& Or (const nsIntRegion& aRgn1, const nsIntRegion& aRgn2) + Derived& Or (const Derived& aRgn1, const Derived& aRgn2) { mImpl.Or (aRgn1.mImpl, aRgn2.mImpl); - return *this; + return This(); } - nsIntRegion& Or (const nsIntRegion& aRegion, const nsIntRect& aRect) + Derived& Or (const Derived& aRegion, const Rect& aRect) { mImpl.Or (aRegion.mImpl, ToRect (aRect)); - return *this; + return This(); } - nsIntRegion& Or (const nsIntRect& aRect, const nsIntRegion& aRegion) + Derived& Or (const Rect& aRect, const Derived& aRegion) { return Or (aRegion, aRect); } - nsIntRegion& Or (const nsIntRect& aRect1, const nsIntRect& aRect2) + Derived& Or (const Rect& aRect1, const Rect& aRect2) { mImpl = ToRect (aRect1); - return Or (*this, aRect2); + return Or (This(), aRect2); } - nsIntRegion& XorWith(const nsIntRegion& aOther) + Derived& XorWith(const Derived& aOther) { - return Xor(*this, aOther); + return Xor(This(), aOther); } - nsIntRegion& XorWith(const nsIntRect& aOther) + Derived& XorWith(const Rect& aOther) { - return Xor(*this, aOther); + return Xor(This(), aOther); } - nsIntRegion& Xor (const nsIntRegion& aRgn1, const nsIntRegion& aRgn2) + Derived& Xor (const Derived& aRgn1, const Derived& aRgn2) { mImpl.Xor (aRgn1.mImpl, aRgn2.mImpl); - return *this; + return This(); } - nsIntRegion& Xor (const nsIntRegion& aRegion, const nsIntRect& aRect) + Derived& Xor (const Derived& aRegion, const Rect& aRect) { mImpl.Xor (aRegion.mImpl, ToRect (aRect)); - return *this; + return This(); } - nsIntRegion& Xor (const nsIntRect& aRect, const nsIntRegion& aRegion) + Derived& Xor (const Rect& aRect, const Derived& aRegion) { return Xor (aRegion, aRect); } - nsIntRegion& Xor (const nsIntRect& aRect1, const nsIntRect& aRect2) + Derived& Xor (const Rect& aRect1, const Rect& aRect2) { mImpl = ToRect (aRect1); - return Xor (*this, aRect2); + return Xor (This(), aRect2); } - nsIntRegion& SubOut(const nsIntRegion& aOther) + Derived& SubOut(const Derived& aOther) { - return Sub(*this, aOther); + return Sub(This(), aOther); } - nsIntRegion& SubOut(const nsIntRect& aOther) + Derived& SubOut(const Rect& aOther) { - return Sub(*this, aOther); + return Sub(This(), aOther); } - nsIntRegion& Sub (const nsIntRegion& aRgn1, const nsIntRegion& aRgn2) + Derived& Sub (const Derived& aRgn1, const Derived& aRgn2) { mImpl.Sub (aRgn1.mImpl, aRgn2.mImpl); - return *this; + return This(); } - nsIntRegion& Sub (const nsIntRegion& aRegion, const nsIntRect& aRect) + Derived& Sub (const Derived& aRegion, const Rect& aRect) { mImpl.Sub (aRegion.mImpl, ToRect (aRect)); - return *this; + return This(); } - nsIntRegion& Sub (const nsIntRect& aRect, const nsIntRegion& aRegion) + Derived& Sub (const Rect& aRect, const Derived& aRegion) { - return Sub (nsIntRegion (aRect), aRegion); + return Sub (Derived (aRect), aRegion); } - nsIntRegion& Sub (const nsIntRect& aRect1, const nsIntRect& aRect2) + Derived& Sub (const Rect& aRect1, const Rect& aRect2) { mImpl = ToRect (aRect1); - return Sub (*this, aRect2); + return Sub (This(), aRect2); } /** @@ -615,52 +629,52 @@ public: { return mImpl.Contains(aX, aY); } - bool Contains (const nsIntRect& aRect) const + bool Contains (const Rect& aRect) const { return mImpl.Contains (ToRect (aRect)); } - bool Contains (const nsIntRegion& aRgn) const + bool Contains (const Derived& aRgn) const { return mImpl.Contains (aRgn.mImpl); } - bool Intersects (const nsIntRect& aRect) const + bool Intersects (const Rect& aRect) const { return mImpl.Intersects (ToRect (aRect)); } void MoveBy (int32_t aXOffset, int32_t aYOffset) { - MoveBy (nsIntPoint (aXOffset, aYOffset)); + MoveBy (Point (aXOffset, aYOffset)); } - void MoveBy (nsIntPoint aPt) + void MoveBy (Point aPt) { mImpl.MoveBy (aPt.x, aPt.y); } - nsIntRegion MovedBy(int32_t aXOffset, int32_t aYOffset) const + Derived MovedBy(int32_t aXOffset, int32_t aYOffset) const { - return MovedBy(nsIntPoint(aXOffset, aYOffset)); + return MovedBy(Point(aXOffset, aYOffset)); } - nsIntRegion MovedBy(const nsIntPoint& aPt) const + Derived MovedBy(const Point& aPt) const { - nsIntRegion copy(*this); + Derived copy(This()); copy.MoveBy(aPt); return copy; } - nsIntRegion Intersect(const nsIntRegion& aOther) const + Derived Intersect(const Derived& aOther) const { - nsIntRegion intersection; - intersection.And(*this, aOther); + Derived intersection; + intersection.And(This(), aOther); return intersection; } - void Inflate(const nsIntMargin& aMargin) + void Inflate(const Margin& aMargin) { mImpl.Inflate(nsMargin(aMargin.top, aMargin.right, aMargin.bottom, aMargin.left)); } - nsIntRegion Inflated(const nsIntMargin& aMargin) const + Derived Inflated(const Margin& aMargin) const { - nsIntRegion copy(*this); + Derived copy(This()); copy.Inflate(aMargin); return copy; } @@ -672,29 +686,39 @@ public: bool IsEmpty () const { return mImpl.IsEmpty (); } bool IsComplex () const { return mImpl.IsComplex (); } - bool IsEqual (const nsIntRegion& aRegion) const + bool IsEqual (const Derived& aRegion) const { return mImpl.IsEqual (aRegion.mImpl); } uint32_t GetNumRects () const { return mImpl.GetNumRects (); } - nsIntRect GetBounds () const { return FromRect (mImpl.GetBounds ()); } + Rect GetBounds () const { return FromRect (mImpl.GetBounds ()); } uint64_t Area () const { return mImpl.Area(); } - nsRegion ToAppUnits (nscoord aAppUnitsPerPixel) const; - nsIntRect GetLargestRectangle (const nsIntRect& aContainingRect = nsIntRect()) const + nsRegion ToAppUnits (nscoord aAppUnitsPerPixel) const + { + nsRegion result; + RectIterator rgnIter(*this); + const Rect* currentRect; + while ((currentRect = rgnIter.Next())) { + nsRect appRect = currentRect->ToAppUnits(aAppUnitsPerPixel); + result.Or(result, appRect); + } + return result; + } + Rect GetLargestRectangle (const Rect& aContainingRect = Rect()) const { return FromRect (mImpl.GetLargestRectangle( ToRect(aContainingRect) )); } - nsIntRegion& ScaleRoundOut (float aXScale, float aYScale) + Derived& ScaleRoundOut (float aXScale, float aYScale) { mImpl.ScaleRoundOut(aXScale, aYScale); - return *this; + return This(); } - nsIntRegion& Transform (const gfx3DMatrix &aTransform) + Derived& Transform (const gfx3DMatrix &aTransform) { mImpl.Transform(aTransform); - return *this; + return This(); } /** @@ -729,48 +753,89 @@ public: nsCString ToString() const { return mImpl.ToString(); } + class NS_GFX RectIterator + { + nsRegionRectIterator mImpl; + Rect mTmp; + + public: + explicit RectIterator (const BaseIntRegion& aRegion) : mImpl (aRegion.mImpl) {} + + const Rect* Next () + { + const nsRect* r = mImpl.Next(); + if (!r) + return nullptr; + mTmp = FromRect (*r); + return &mTmp; + } + + const Rect* Prev () + { + const nsRect* r = mImpl.Prev(); + if (!r) + return nullptr; + mTmp = FromRect (*r); + return &mTmp; + } + + void Reset () + { + mImpl.Reset (); + } + }; + +protected: + // Expose enough to derived classes from them to define conversions + // between different types of BaseIntRegions. + explicit BaseIntRegion(const nsRegion& aImpl) : mImpl(aImpl) {} + const nsRegion& Impl() const { return mImpl; } private: nsRegion mImpl; - static nsRect ToRect(const nsIntRect& aRect) + static nsRect ToRect(const Rect& aRect) { return nsRect (aRect.x, aRect.y, aRect.width, aRect.height); } - static nsIntRect FromRect(const nsRect& aRect) + static Rect FromRect(const nsRect& aRect) { - return nsIntRect (aRect.x, aRect.y, aRect.width, aRect.height); + return Rect (aRect.x, aRect.y, aRect.width, aRect.height); + } + + Derived& This() + { + return *static_cast(this); + } + const Derived& This() const + { + return *static_cast(this); } }; -class NS_GFX nsIntRegionRectIterator +} // namespace mozilla::gfx +} // namespace mozilla + +class NS_GFX nsIntRegion : public mozilla::gfx::BaseIntRegion { - nsRegionRectIterator mImpl; - nsIntRect mTmp; - public: - explicit nsIntRegionRectIterator (const nsIntRegion& aRegion) : mImpl (aRegion.mImpl) {} + // Forward constructors. + nsIntRegion() {} + MOZ_IMPLICIT nsIntRegion(const nsIntRect& aRect) : BaseIntRegion(aRect) {} + nsIntRegion(const nsIntRegion& aRegion) : BaseIntRegion(aRegion) {} + nsIntRegion(nsIntRegion&& aRegion) : BaseIntRegion(mozilla::Move(aRegion)) {} - const nsIntRect* Next () + // Assignment operators need to be forwarded as well, otherwise the compiler + // will declare deleted ones. + nsIntRegion& operator=(const nsIntRegion& aRegion) { - const nsRect* r = mImpl.Next(); - if (!r) - return nullptr; - mTmp = nsIntRegion::FromRect (*r); - return &mTmp; + return BaseIntRegion::operator=(aRegion); } - - const nsIntRect* Prev () + nsIntRegion& operator=(nsIntRegion&& aRegion) { - const nsRect* r = mImpl.Prev(); - if (!r) - return nullptr; - mTmp = nsIntRegion::FromRect (*r); - return &mTmp; - } - - void Reset () - { - mImpl.Reset (); + return BaseIntRegion::operator=(mozilla::Move(aRegion)); } }; + +typedef nsIntRegion::RectIterator nsIntRegionRectIterator; + #endif diff --git a/gfx/src/nsSize.h b/gfx/src/nsSize.h index 7d6d5c1c3b..5c06e8af4e 100644 --- a/gfx/src/nsSize.h +++ b/gfx/src/nsSize.h @@ -26,8 +26,13 @@ struct nsSize : public mozilla::gfx::BaseSize { nscoord aAppUnitsPerPixel) const; inline nsIntSize ToNearestPixels(nscoord aAppUnitsPerPixel) const; - // Converts this size from aFromAPP, an appunits per pixel ratio, to aToAPP. - inline nsSize ConvertAppUnits(int32_t aFromAPP, int32_t aToAPP) const; + /** + * Return this size scaled to a different appunits per pixel (APP) ratio. + * @param aFromAPP the APP to scale from + * @param aToAPP the APP to scale to + */ + MOZ_WARN_UNUSED_RESULT inline nsSize + ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const; }; inline nsIntSize @@ -46,7 +51,7 @@ nsSize::ToNearestPixels(nscoord aAppUnitsPerPixel) const } inline nsSize -nsSize::ConvertAppUnits(int32_t aFromAPP, int32_t aToAPP) const { +nsSize::ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const { if (aFromAPP != aToAPP) { nsSize size; size.width = NSToCoordRound(NSCoordScale(width, aFromAPP, aToAPP)); diff --git a/gfx/tests/gtest/TestAsyncPanZoomController.cpp b/gfx/tests/gtest/TestAsyncPanZoomController.cpp index 938ccb2378..20b63ba02c 100644 --- a/gfx/tests/gtest/TestAsyncPanZoomController.cpp +++ b/gfx/tests/gtest/TestAsyncPanZoomController.cpp @@ -19,6 +19,7 @@ #include "base/task.h" #include "Layers.h" #include "TestLayers.h" +#include "UnitTransforms.h" #include "gfxPrefs.h" using namespace mozilla; @@ -1693,7 +1694,7 @@ protected: metrics.SetScrollableRect(aScrollableRect); metrics.SetScrollOffset(CSSPoint(0, 0)); aLayer->SetFrameMetrics(metrics); - aLayer->SetClipRect(&layerBound); + aLayer->SetClipRect(Some(ViewAs(layerBound))); if (!aScrollableRect.IsEqualEdges(CSSRect(-1, -1, -1, -1))) { // The purpose of this is to roughly mimic what layout would do in the // case of a scrollable frame with the event regions and clip. This lets diff --git a/gfx/tests/gtest/TestTextures.cpp b/gfx/tests/gtest/TestTextures.cpp index 34e80b4d91..6d36ac2f49 100644 --- a/gfx/tests/gtest/TestTextures.cpp +++ b/gfx/tests/gtest/TestTextures.cpp @@ -189,7 +189,7 @@ void TestTextureClientSurface(TextureClient* texture, gfxImageSurface* surface) nsRefPtr hostSurface = new gfxImageSurface(hostDataSurface->GetData(), - ThebesIntSize(hostDataSurface->GetSize()), + hostDataSurface->GetSize(), hostDataSurface->Stride(), SurfaceFormatToImageFormat(hostDataSurface->GetFormat())); AssertSurfacesEqual(surface, hostSurface.get()); diff --git a/gfx/thebes/gfx2DGlue.h b/gfx/thebes/gfx2DGlue.h index 3bd1cb96ee..1a500017b9 100644 --- a/gfx/thebes/gfx2DGlue.h +++ b/gfx/thebes/gfx2DGlue.h @@ -157,11 +157,6 @@ inline gfxSize ThebesSize(const Size &aSize) return gfxSize(aSize.width, aSize.height); } -inline gfxIntSize ThebesIntSize(const IntSize &aSize) -{ - return gfxIntSize(aSize.width, aSize.height); -} - inline gfxRect ThebesRect(const Rect &aRect) { return gfxRect(aRect.x, aRect.y, aRect.width, aRect.height); diff --git a/gfx/thebes/gfxAndroidPlatform.cpp b/gfx/thebes/gfxAndroidPlatform.cpp index e9b47dfc98..6fbdaf6022 100644 --- a/gfx/thebes/gfxAndroidPlatform.cpp +++ b/gfx/thebes/gfxAndroidPlatform.cpp @@ -132,8 +132,7 @@ gfxAndroidPlatform::CreateOffscreenSurface(const IntSize& size, gfxContentType contentType) { nsRefPtr newSurface; - newSurface = new gfxImageSurface(ThebesIntSize(size), - OptimalFormatForContent(contentType)); + newSurface = new gfxImageSurface(size, OptimalFormatForContent(contentType)); return newSurface.forget(); } diff --git a/gfx/thebes/gfxFT2Fonts.cpp b/gfx/thebes/gfxFT2Fonts.cpp index 3d694069ec..0141b1505d 100644 --- a/gfx/thebes/gfxFT2Fonts.cpp +++ b/gfx/thebes/gfxFT2Fonts.cpp @@ -31,7 +31,7 @@ #include "nsCRT.h" #include "nsXULAppAPI.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prinit.h" #include "mozilla/MemoryReporting.h" diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp index 9de0cf0d4d..c9112c3494 100644 --- a/gfx/thebes/gfxFcPlatformFontList.cpp +++ b/gfx/thebes/gfxFcPlatformFontList.cpp @@ -3,7 +3,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "gfxFcPlatformFontList.h" #include "gfxFont.h" diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index d6d7e263e9..8eb6cc391a 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -10,7 +10,7 @@ #include "mozilla/gfx/2D.h" #include "mozilla/MathAlgorithms.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsExpirationTracker.h" #include "nsITimer.h" diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index 55dbf14a0d..b7c9ba2700 100644 --- a/gfx/thebes/gfxFontEntry.cpp +++ b/gfx/thebes/gfxFontEntry.cpp @@ -6,7 +6,7 @@ #include "mozilla/DebugOnly.h" #include "mozilla/MathAlgorithms.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsServiceManagerUtils.h" #include "nsExpirationTracker.h" diff --git a/gfx/thebes/gfxFontUtils.cpp b/gfx/thebes/gfxFontUtils.cpp index e00045b633..24c3458e85 100644 --- a/gfx/thebes/gfxFontUtils.cpp +++ b/gfx/thebes/gfxFontUtils.cpp @@ -23,7 +23,7 @@ #include "harfbuzz/hb.h" #include "plbase64.h" -#include "prlog.h" +#include "mozilla/Logging.h" #define LOG(log, args) PR_LOG(gfxPlatform::GetLog(log), \ PR_LOG_DEBUG, args) diff --git a/gfx/thebes/gfxGDIFontList.cpp b/gfx/thebes/gfxGDIFontList.cpp index f046734cbe..6f0ac90530 100644 --- a/gfx/thebes/gfxGDIFontList.cpp +++ b/gfx/thebes/gfxGDIFontList.cpp @@ -6,7 +6,7 @@ #include "mozilla/DebugOnly.h" #include -#include "prlog.h" +#include "mozilla/Logging.h" #include "gfxGDIFontList.h" #include "gfxWindowsPlatform.h" diff --git a/gfx/thebes/gfxMacPlatformFontList.mm b/gfx/thebes/gfxMacPlatformFontList.mm index c73d966c6e..982ae10334 100644 --- a/gfx/thebes/gfxMacPlatformFontList.mm +++ b/gfx/thebes/gfxMacPlatformFontList.mm @@ -38,7 +38,7 @@ * * ***** END LICENSE BLOCK ***** */ -#include "prlog.h" +#include "mozilla/Logging.h" #include diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 692327b0f7..4cee11a345 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -10,7 +10,7 @@ #include "mozilla/layers/SharedBufferManagerChild.h" #include "mozilla/layers/ISurfaceAllocator.h" // for GfxMemoryImageReporter -#include "prlog.h" +#include "mozilla/Logging.h" #include "prprf.h" #include "gfxPlatform.h" diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index 197684aa4c..9759cae77b 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -6,7 +6,7 @@ #ifndef GFX_PLATFORM_H #define GFX_PLATFORM_H -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/gfx/Types.h" #include "nsTArray.h" #include "nsString.h" diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index 4e694ad604..f48bc7a952 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -3,7 +3,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "gfxPlatformFontList.h" #include "gfxTextRun.h" diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp index 9145f0d49e..7a3722751f 100644 --- a/gfx/thebes/gfxPlatformGtk.cpp +++ b/gfx/thebes/gfxPlatformGtk.cpp @@ -110,12 +110,12 @@ gfxPlatformGtk::CreateOffscreenSurface(const IntSize& size, if (xrenderFormat) { newSurface = gfxXlibSurface::Create(screen, xrenderFormat, - ThebesIntSize(size)); + size); } } else { // We're not going to use XRender, so we don't need to // search for a render format - newSurface = new gfxImageSurface(ThebesIntSize(size), imageFormat); + newSurface = new gfxImageSurface(size, imageFormat); // The gfxImageSurface ctor zeroes this for us, no need to // waste time clearing again needsClear = false; @@ -127,7 +127,7 @@ gfxPlatformGtk::CreateOffscreenSurface(const IntSize& size, // We couldn't create a native surface for whatever reason; // e.g., no display, no RENDER, bad size, etc. // Fall back to image surface for the data. - newSurface = new gfxImageSurface(ThebesIntSize(size), imageFormat); + newSurface = new gfxImageSurface(size, imageFormat); } if (newSurface->CairoStatus()) { diff --git a/gfx/thebes/gfxPlatformMac.cpp b/gfx/thebes/gfxPlatformMac.cpp index 451307628a..80fe2bca8a 100644 --- a/gfx/thebes/gfxPlatformMac.cpp +++ b/gfx/thebes/gfxPlatformMac.cpp @@ -116,8 +116,7 @@ gfxPlatformMac::CreateOffscreenSurface(const IntSize& size, gfxContentType contentType) { nsRefPtr newSurface = - new gfxQuartzSurface(ThebesIntSize(size), - OptimalFormatForContent(contentType)); + new gfxQuartzSurface(size, OptimalFormatForContent(contentType)); return newSurface.forget(); } diff --git a/gfx/thebes/gfxUserFontSet.cpp b/gfx/thebes/gfxUserFontSet.cpp index a0234e5c9e..4946b7700b 100644 --- a/gfx/thebes/gfxUserFontSet.cpp +++ b/gfx/thebes/gfxUserFontSet.cpp @@ -3,7 +3,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "gfxUserFontSet.h" #include "gfxPlatform.h" diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 436edb7993..03542a5334 100644 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -760,18 +760,18 @@ gfxWindowsPlatform::CreateOffscreenSurface(const IntSize& size, #ifdef CAIRO_HAS_WIN32_SURFACE if (mRenderMode == RENDER_GDI) - surf = new gfxWindowsSurface(ThebesIntSize(size), + surf = new gfxWindowsSurface(size, OptimalFormatForContent(contentType)); #endif #ifdef CAIRO_HAS_D2D_SURFACE if (mRenderMode == RENDER_DIRECT2D) - surf = new gfxD2DSurface(ThebesIntSize(size), + surf = new gfxD2DSurface(size, OptimalFormatForContent(contentType)); #endif if (!surf || surf->CairoStatus()) { - surf = new gfxImageSurface(ThebesIntSize(size), + surf = new gfxImageSurface(size, OptimalFormatForContent(contentType)); } @@ -1565,7 +1565,7 @@ gfxWindowsPlatform::GetD3D9DeviceManager() CompositorParent::IsInCompositorThread())) { mDeviceManager = new DeviceManagerD3D9(); if (!mDeviceManager->Init()) { - NS_WARNING("Could not initialise device manager"); + gfxCriticalError() << "[D3D9] Could not Initialize the DeviceManagerD3D9"; mDeviceManager = nullptr; } } diff --git a/hal/HalLog.h b/hal/HalLog.h index 9910d296bf..4000a4e212 100644 --- a/hal/HalLog.h +++ b/hal/HalLog.h @@ -7,7 +7,7 @@ #ifndef mozilla_HalLog_h #define mozilla_HalLog_h -#include "prlog.h" +#include "mozilla/Logging.h" /* * HalLog.h contains internal macros and functions used for logging. diff --git a/image/ClippedImage.cpp b/image/ClippedImage.cpp index a1a9a8cf20..dbf256597b 100644 --- a/image/ClippedImage.cpp +++ b/image/ClippedImage.cpp @@ -267,8 +267,8 @@ ClippedImage::GetFrameInternal(const nsIntSize& aSize, return mCachedSurface->Surface(); } -NS_IMETHODIMP -ClippedImage::GetImageContainer(LayerManager* aManager, ImageContainer** _retval) +NS_IMETHODIMP_(already_AddRefed) +ClippedImage::GetImageContainer(LayerManager* aManager, uint32_t aFlags) { // XXX(seth): We currently don't have a way of clipping the result of // GetImageContainer. We work around this by always returning null, but if it @@ -277,11 +277,10 @@ ClippedImage::GetImageContainer(LayerManager* aManager, ImageContainer** _retval // that method for performance reasons. if (!ShouldClip()) { - return InnerImage()->GetImageContainer(aManager, _retval); + return InnerImage()->GetImageContainer(aManager, aFlags); } - *_retval = nullptr; - return NS_OK; + return nullptr; } static bool diff --git a/image/ClippedImage.h b/image/ClippedImage.h index 2165ba3c5d..149066ad1d 100644 --- a/image/ClippedImage.h +++ b/image/ClippedImage.h @@ -37,8 +37,9 @@ public: NS_IMETHOD GetIntrinsicRatio(nsSize* aRatio) override; NS_IMETHOD_(already_AddRefed) GetFrame(uint32_t aWhichFrame, uint32_t aFlags) override; - NS_IMETHOD GetImageContainer(layers::LayerManager* aManager, - layers::ImageContainer** _retval) override; + NS_IMETHOD_(already_AddRefed) + GetImageContainer(layers::LayerManager* aManager, + uint32_t aFlags) override; NS_IMETHOD_(DrawResult) Draw(gfxContext* aContext, const nsIntSize& aSize, const ImageRegion& aRegion, diff --git a/image/Decoder.cpp b/image/Decoder.cpp index 948da26a0f..864fa24c24 100644 --- a/image/Decoder.cpp +++ b/image/Decoder.cpp @@ -436,7 +436,7 @@ Decoder::EnsureFrame(uint32_t aFrameNum, MOZ_ASSERT(ref, "No ref to current frame?"); // Reinitialize the old frame. - nsIntSize oldSize = ThebesIntSize(aPreviousFrame->GetImageSize()); + nsIntSize oldSize = aPreviousFrame->GetImageSize(); bool nonPremult = aDecodeFlags & imgIContainer::FLAG_DECODE_NO_PREMULTIPLY_ALPHA; if (NS_FAILED(aPreviousFrame->ReinitForDecoder(oldSize, aFrameRect, aFormat, diff --git a/image/DynamicImage.cpp b/image/DynamicImage.cpp index 728deabc30..f7af03a2ff 100644 --- a/image/DynamicImage.cpp +++ b/image/DynamicImage.cpp @@ -162,12 +162,6 @@ DynamicImage::GetType(uint16_t* aType) return NS_OK; } -NS_IMETHODIMP_(uint16_t) -DynamicImage::GetType() -{ - return imgIContainer::TYPE_RASTER; -} - NS_IMETHODIMP DynamicImage::GetAnimated(bool* aAnimated) { @@ -205,12 +199,10 @@ DynamicImage::IsOpaque() return false; } -NS_IMETHODIMP -DynamicImage::GetImageContainer(LayerManager* aManager, - ImageContainer** _retval) +NS_IMETHODIMP_(already_AddRefed) +DynamicImage::GetImageContainer(LayerManager* aManager, uint32_t aFlags) { - *_retval = nullptr; - return NS_OK; + return nullptr; } NS_IMETHODIMP_(DrawResult) diff --git a/image/FrameAnimator.cpp b/image/FrameAnimator.cpp index bbf384ca2a..93c85aaef5 100644 --- a/image/FrameAnimator.cpp +++ b/image/FrameAnimator.cpp @@ -444,7 +444,7 @@ FrameAnimator::DoBlend(nsIntRect* aDirtyRect, // Create the Compositing Frame if (!mCompositingFrame) { nsRefPtr newFrame = new imgFrame; - nsresult rv = newFrame->InitForDecoder(ThebesIntSize(mSize), + nsresult rv = newFrame->InitForDecoder(mSize, SurfaceFormat::B8G8R8A8); if (NS_FAILED(rv)) { mCompositingFrame.reset(); @@ -584,7 +584,7 @@ FrameAnimator::DoBlend(nsIntRect* aDirtyRect, // overwrite. if (!mCompositingPrevFrame) { nsRefPtr newFrame = new imgFrame; - nsresult rv = newFrame->InitForDecoder(ThebesIntSize(mSize), + nsresult rv = newFrame->InitForDecoder(mSize, SurfaceFormat::B8G8R8A8); if (NS_FAILED(rv)) { mCompositingPrevFrame.reset(); diff --git a/image/FrozenImage.cpp b/image/FrozenImage.cpp index fc76f192a4..6b3974e171 100644 --- a/image/FrozenImage.cpp +++ b/image/FrozenImage.cpp @@ -44,18 +44,15 @@ FrozenImage::GetFrame(uint32_t aWhichFrame, return InnerImage()->GetFrame(FRAME_FIRST, aFlags); } -NS_IMETHODIMP -FrozenImage::GetImageContainer(layers::LayerManager* aManager, - layers::ImageContainer** _retval) +NS_IMETHODIMP_(already_AddRefed) +FrozenImage::GetImageContainer(layers::LayerManager* aManager, uint32_t aFlags) { // XXX(seth): GetImageContainer does not currently support anything but the // current frame. We work around this by always returning null, but if it ever // turns out that FrozenImage is widely used on codepaths that can actually // benefit from GetImageContainer, it would be a good idea to fix that method // for performance reasons. - - *_retval = nullptr; - return NS_OK; + return nullptr; } NS_IMETHODIMP_(DrawResult) diff --git a/image/FrozenImage.h b/image/FrozenImage.h index 48d08226c2..12391f2a59 100644 --- a/image/FrozenImage.h +++ b/image/FrozenImage.h @@ -37,8 +37,9 @@ public: NS_IMETHOD GetAnimated(bool* aAnimated) override; NS_IMETHOD_(already_AddRefed) GetFrame(uint32_t aWhichFrame, uint32_t aFlags) override; - NS_IMETHOD GetImageContainer(layers::LayerManager* aManager, - layers::ImageContainer** _retval) override; + NS_IMETHOD_(already_AddRefed) + GetImageContainer(layers::LayerManager* aManager, + uint32_t aFlags) override; NS_IMETHOD_(DrawResult) Draw(gfxContext* aContext, const nsIntSize& aSize, const ImageRegion& aRegion, diff --git a/image/ImageLogging.h b/image/ImageLogging.h index 069aca9faf..4173465d1f 100644 --- a/image/ImageLogging.h +++ b/image/ImageLogging.h @@ -7,7 +7,7 @@ #ifndef mozilla_image_ImageLogging_h #define mozilla_image_ImageLogging_h -#include "prlog.h" +#include "mozilla/Logging.h" #include "prinrval.h" #include "nsString.h" diff --git a/image/ImageWrapper.cpp b/image/ImageWrapper.cpp index 2aeb7249a6..b5678898f8 100644 --- a/image/ImageWrapper.cpp +++ b/image/ImageWrapper.cpp @@ -167,12 +167,6 @@ ImageWrapper::GetType(uint16_t* aType) return mInnerImage->GetType(aType); } -NS_IMETHODIMP_(uint16_t) -ImageWrapper::GetType() -{ - return mInnerImage->GetType(); -} - NS_IMETHODIMP ImageWrapper::GetAnimated(bool* aAnimated) { @@ -192,11 +186,10 @@ ImageWrapper::IsOpaque() return mInnerImage->IsOpaque(); } -NS_IMETHODIMP -ImageWrapper::GetImageContainer(LayerManager* aManager, - ImageContainer** _retval) +NS_IMETHODIMP_(already_AddRefed) +ImageWrapper::GetImageContainer(LayerManager* aManager, uint32_t aFlags) { - return mInnerImage->GetImageContainer(aManager, _retval); + return mInnerImage->GetImageContainer(aManager, aFlags); } NS_IMETHODIMP_(DrawResult) diff --git a/image/OrientedImage.cpp b/image/OrientedImage.cpp index 28b0ac835f..8ab1df20d2 100644 --- a/image/OrientedImage.cpp +++ b/image/OrientedImage.cpp @@ -122,9 +122,8 @@ OrientedImage::GetFrame(uint32_t aWhichFrame, return target->Snapshot(); } -NS_IMETHODIMP -OrientedImage::GetImageContainer(LayerManager* aManager, - ImageContainer** _retval) +NS_IMETHODIMP_(already_AddRefed) +OrientedImage::GetImageContainer(LayerManager* aManager, uint32_t aFlags) { // XXX(seth): We currently don't have a way of orienting the result of // GetImageContainer. We work around this by always returning null, but if it @@ -133,11 +132,10 @@ OrientedImage::GetImageContainer(LayerManager* aManager, // that method for performance reasons. if (mOrientation.IsIdentity()) { - return InnerImage()->GetImageContainer(aManager, _retval); + return InnerImage()->GetImageContainer(aManager, aFlags); } - *_retval = nullptr; - return NS_OK; + return nullptr; } struct MatrixBuilder diff --git a/image/OrientedImage.h b/image/OrientedImage.h index c6c19eea8b..27f8ebacbd 100644 --- a/image/OrientedImage.h +++ b/image/OrientedImage.h @@ -34,8 +34,9 @@ public: NS_IMETHOD GetIntrinsicRatio(nsSize* aRatio) override; NS_IMETHOD_(already_AddRefed) GetFrame(uint32_t aWhichFrame, uint32_t aFlags) override; - NS_IMETHOD GetImageContainer(layers::LayerManager* aManager, - layers::ImageContainer** _retval) override; + NS_IMETHOD_(already_AddRefed) + GetImageContainer(layers::LayerManager* aManager, + uint32_t aFlags) override; NS_IMETHOD_(DrawResult) Draw(gfxContext* aContext, const nsIntSize& aSize, const ImageRegion& aRegion, diff --git a/image/RasterImage.cpp b/image/RasterImage.cpp index 54cfd49e7f..d65a587449 100644 --- a/image/RasterImage.cpp +++ b/image/RasterImage.cpp @@ -260,6 +260,7 @@ RasterImage::RasterImage(ProgressTracker* aProgressTracker, mLockCount(0), mDecodeCount(0), mRequestedSampleSize(0), + mLastImageContainerDrawResult(DrawResult::NOT_READY), #ifdef DEBUG mFramesNotified(0), #endif @@ -464,18 +465,10 @@ RasterImage::GetType(uint16_t *aType) { NS_ENSURE_ARG_POINTER(aType); - *aType = GetType(); + *aType = imgIContainer::TYPE_RASTER; return NS_OK; } -//****************************************************************************** -/* [noscript, notxpcom] uint16_t GetType(); */ -NS_IMETHODIMP_(uint16_t) -RasterImage::GetType() -{ - return imgIContainer::TYPE_RASTER; -} - DrawableFrameRef RasterImage::LookupFrameInternal(uint32_t aFrameNum, const IntSize& aSize, @@ -540,7 +533,7 @@ RasterImage::LookupFrame(uint32_t aFrameNum, // The OS threw this frame away. We need to redecode if we can. MOZ_ASSERT(!mAnim, "Animated frames should be locked"); - Decode(Some(ThebesIntSize(requestedSize)), aFlags); + Decode(Some(requestedSize), aFlags); // If we can sync decode, we should already have the frame. if (aFlags & FLAG_SYNC_DECODE) { @@ -744,19 +737,21 @@ NS_IMETHODIMP_(already_AddRefed) RasterImage::GetFrame(uint32_t aWhichFrame, uint32_t aFlags) { - return GetFrameInternal(aWhichFrame, aFlags); + return GetFrameInternal(aWhichFrame, aFlags).second().forget(); } -already_AddRefed +Pair> RasterImage::GetFrameInternal(uint32_t aWhichFrame, uint32_t aFlags) { MOZ_ASSERT(aWhichFrame <= FRAME_MAX_VALUE); - if (aWhichFrame > FRAME_MAX_VALUE) - return nullptr; + if (aWhichFrame > FRAME_MAX_VALUE) { + return MakePair(DrawResult::BAD_ARGS, RefPtr()); + } - if (mError) - return nullptr; + if (mError) { + return MakePair(DrawResult::BAD_IMAGE, RefPtr()); + } // Get the frame. If it's not there, it's probably the caller's fault for // not waiting for the data to be loaded from the network or not passing @@ -765,7 +760,7 @@ RasterImage::GetFrameInternal(uint32_t aWhichFrame, uint32_t aFlags) LookupFrame(GetRequestedFrameIndex(aWhichFrame), mSize, aFlags); if (!frameRef) { // The OS threw this frame away and we couldn't redecode it. - return nullptr; + return MakePair(DrawResult::TEMPORARY_ERROR, RefPtr()); } // If this frame covers the entire image, we can just reuse its existing @@ -784,50 +779,57 @@ RasterImage::GetFrameInternal(uint32_t aWhichFrame, uint32_t aFlags) frameSurf = CopyFrame(aWhichFrame, aFlags); } - return frameSurf.forget(); + if (!frameRef->IsImageComplete()) { + return MakePair(DrawResult::INCOMPLETE, Move(frameSurf)); + } + + return MakePair(DrawResult::SUCCESS, Move(frameSurf)); } -already_AddRefed -RasterImage::GetCurrentImage(ImageContainer* aContainer) +Pair> +RasterImage::GetCurrentImage(ImageContainer* aContainer, uint32_t aFlags) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aContainer); - RefPtr surface = - GetFrameInternal(FRAME_CURRENT, FLAG_ASYNC_NOTIFY); - if (!surface) { + auto result = GetFrameInternal(FRAME_CURRENT, aFlags | FLAG_ASYNC_NOTIFY); + if (!result.second()) { // The OS threw out some or all of our buffer. We'll need to wait for the // redecode (which was automatically triggered by GetFrame) to complete. - return nullptr; + return MakePair(result.first(), nsRefPtr()); } CairoImage::Data cairoData; GetWidth(&cairoData.mSize.width); GetHeight(&cairoData.mSize.height); - cairoData.mSourceSurface = surface; + cairoData.mSourceSurface = result.second(); nsRefPtr image = aContainer->CreateImage(ImageFormat::CAIRO_SURFACE); - NS_ASSERTION(image, "Failed to create Image"); + MOZ_ASSERT(image); static_cast(image.get())->SetData(cairoData); - return image.forget(); + return MakePair(result.first(), Move(image)); } -NS_IMETHODIMP -RasterImage::GetImageContainer(LayerManager* aManager, ImageContainer **_retval) +NS_IMETHODIMP_(already_AddRefed) +RasterImage::GetImageContainer(LayerManager* aManager, uint32_t aFlags) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aManager); + MOZ_ASSERT((aFlags & ~(FLAG_SYNC_DECODE | + FLAG_SYNC_DECODE_IF_FAST | + FLAG_ASYNC_NOTIFY)) + == FLAG_NONE, + "Unsupported flag passed to GetImageContainer"); int32_t maxTextureSize = aManager->GetMaxTextureSize(); if (!mHasSize || mSize.width > maxTextureSize || mSize.height > maxTextureSize) { - *_retval = nullptr; - return NS_OK; + return nullptr; } if (IsUnlocked() && mProgressTracker) { @@ -835,28 +837,34 @@ RasterImage::GetImageContainer(LayerManager* aManager, ImageContainer **_retval) } nsRefPtr container = mImageContainer.get(); - if (container) { - container.forget(_retval); - return NS_OK; + + bool mustRedecode = + (aFlags & (FLAG_SYNC_DECODE | FLAG_SYNC_DECODE_IF_FAST)) && + mLastImageContainerDrawResult != DrawResult::SUCCESS && + mLastImageContainerDrawResult != DrawResult::BAD_IMAGE; + + if (container && !mustRedecode) { + return container.forget(); } // We need a new ImageContainer, so create one. container = LayerManager::CreateImageContainer(); - nsRefPtr image = GetCurrentImage(container); - if (!image) { - return NS_ERROR_NOT_AVAILABLE; + auto result = GetCurrentImage(container, aFlags); + if (!result.second()) { + // We couldn't get an Image. + return nullptr; } - // |image| holds a reference to a SourceSurface which in turn holds a lock on - // the current frame's VolatileBuffer, ensuring that it doesn't get freed as - // long as the layer system keeps this ImageContainer alive. - container->SetCurrentImageInTransaction(image); + // |result.second()| holds a reference to a SourceSurface which in turn holds + // a lock on the current frame's VolatileBuffer, ensuring that it doesn't get + // freed as long as the layer system keeps this ImageContainer alive. + container->SetCurrentImageInTransaction(result.second()); + mLastImageContainerDrawResult = result.first(); mImageContainer = container; - container.forget(_retval); - return NS_OK; + return container.forget(); } void @@ -869,12 +877,14 @@ RasterImage::UpdateImageContainer() return; } - nsRefPtr image = GetCurrentImage(container); - if (!image) { + auto result = GetCurrentImage(container, FLAG_NONE); + if (!result.second()) { + // We couldn't get an Image. return; } - container->SetCurrentImage(image); + mLastImageContainerDrawResult = result.first(); + container->SetCurrentImage(result.second()); } size_t @@ -1781,7 +1791,7 @@ RasterImage::DrawWithPreDownscaleIfNeeded(DrawableFrameRef&& aFrameRef, // adjust the drawing parameters accordingly. IntSize finalSize = frameRef->GetImageSize(); bool couldRedecodeForBetterFrame = false; - if (ThebesIntSize(finalSize) != aSize) { + if (finalSize != aSize) { gfx::Size scale(double(aSize.width) / finalSize.width, double(aSize.height) / finalSize.height); aContext->Multiply(gfxMatrix::Scaling(scale.width, scale.height)); diff --git a/image/RasterImage.h b/image/RasterImage.h index ec0bc0735a..5e91d05f67 100644 --- a/image/RasterImage.h +++ b/image/RasterImage.h @@ -30,6 +30,7 @@ #include "mozilla/Attributes.h" #include "mozilla/Maybe.h" #include "mozilla/MemoryReporting.h" +#include "mozilla/Pair.h" #include "mozilla/TimeStamp.h" #include "mozilla/WeakPtr.h" #include "mozilla/UniquePtr.h" @@ -296,8 +297,9 @@ private: already_AddRefed CopyFrame(uint32_t aWhichFrame, uint32_t aFlags); - already_AddRefed GetFrameInternal(uint32_t aWhichFrame, - uint32_t aFlags); + + Pair> + GetFrameInternal(uint32_t aWhichFrame, uint32_t aFlags); DrawableFrameRef LookupFrameInternal(uint32_t aFrameNum, const gfx::IntSize& aSize, @@ -313,8 +315,9 @@ private: size_t SizeOfDecodedWithComputedFallbackIfHeap(gfxMemoryLocation aLocation, MallocSizeOf aMallocSizeOf) const; - already_AddRefed - GetCurrentImage(layers::ImageContainer* aContainer); + Pair> + GetCurrentImage(layers::ImageContainer* aContainer, uint32_t aFlags); + void UpdateImageContainer(); // We would like to just check if we have a zero lock count, but we can't do @@ -383,6 +386,10 @@ private: // data // the layer system needs it. WeakPtr mImageContainer; + // If mImageContainer is non-null, this contains the DrawResult we obtained + // the last time we updated it. + DrawResult mLastImageContainerDrawResult; + #ifdef DEBUG uint32_t mFramesNotified; #endif diff --git a/image/VectorImage.cpp b/image/VectorImage.cpp index 8e9bdf9f8d..069e6f7f5e 100644 --- a/image/VectorImage.cpp +++ b/image/VectorImage.cpp @@ -326,6 +326,7 @@ NS_IMPL_ISUPPORTS(VectorImage, VectorImage::VectorImage(ProgressTracker* aProgressTracker, ImageURL* aURI /* = nullptr */) : ImageResource(aURI), // invoke superclass's constructor + mLockCount(0), mIsInitialized(false), mIsFullyLoaded(false), mIsDrawing(false), @@ -356,6 +357,14 @@ VectorImage::Init(const char* aMimeType, "Flags unexpectedly set before initialization"); MOZ_ASSERT(!strcmp(aMimeType, IMAGE_SVG_XML), "Unexpected mimetype"); + mDiscardable = !!(aFlags & INIT_FLAG_DISCARDABLE); + + // Lock this image's surfaces in the SurfaceCache if we're not discardable. + if (!mDiscardable) { + mLockCount++; + SurfaceCache::LockImage(ImageKey(this)); + } + mIsInitialized = true; return NS_OK; } @@ -600,18 +609,10 @@ VectorImage::GetType(uint16_t* aType) { NS_ENSURE_ARG_POINTER(aType); - *aType = GetType(); + *aType = imgIContainer::TYPE_VECTOR; return NS_OK; } -//****************************************************************************** -/* [noscript, notxpcom] uint16_t GetType(); */ -NS_IMETHODIMP_(uint16_t) -VectorImage::GetType() -{ - return imgIContainer::TYPE_VECTOR; -} - //****************************************************************************** /* readonly attribute boolean animated; */ NS_IMETHODIMP @@ -698,12 +699,10 @@ VectorImage::GetFrame(uint32_t aWhichFrame, //****************************************************************************** /* [noscript] ImageContainer getImageContainer(); */ -NS_IMETHODIMP -VectorImage::GetImageContainer(LayerManager* aManager, - layers::ImageContainer** _retval) +NS_IMETHODIMP_(already_AddRefed) +VectorImage::GetImageContainer(LayerManager* aManager, uint32_t aFlags) { - *_retval = nullptr; - return NS_OK; + return nullptr; } struct SVGDrawingParameters @@ -809,7 +808,7 @@ VectorImage::Draw(gfxContext* aContext, RefPtr surface = frameRef->GetSurface(); if (surface) { nsRefPtr svgDrawable = - new gfxSurfaceDrawable(surface, ThebesIntSize(frameRef->GetSize())); + new gfxSurfaceDrawable(surface, frameRef->GetSize()); Show(svgDrawable, params); return DrawResult::SUCCESS; } @@ -836,7 +835,7 @@ VectorImage::CreateSurfaceAndShow(const SVGDrawingParameters& aParams) aParams.flags); nsRefPtr svgDrawable = - new gfxCallbackDrawable(cb, ThebesIntSize(aParams.size)); + new gfxCallbackDrawable(cb, aParams.size); // We take an early exit without using the surface cache if too large, // because for vector images this can cause bad perf issues if large sizes @@ -867,11 +866,19 @@ VectorImage::CreateSurfaceAndShow(const SVGDrawingParameters& aParams) if (bypassCache) return Show(svgDrawable, aParams); + // We're about to rerasterize, which may mean that some of the previous + // surfaces we've rasterized aren't useful anymore. We can allow them to + // expire from the cache by unlocking them here, and then sending out an + // invalidation. If this image is locked, any surfaces that are still useful + // will become locked again when Draw touches them, and the remainder will + // eventually expire. + SurfaceCache::UnlockSurfaces(ImageKey(this)); + // Try to create an imgFrame, initializing the surface it contains by drawing // our gfxDrawable into it. (We use FILTER_NEAREST since we never scale here.) nsRefPtr frame = new imgFrame; nsresult rv = - frame->InitWithDrawable(svgDrawable, ThebesIntSize(aParams.size), + frame->InitWithDrawable(svgDrawable, aParams.size, SurfaceFormat::B8G8R8A8, GraphicsFilter::FILTER_NEAREST, aParams.flags); @@ -892,12 +899,17 @@ VectorImage::CreateSurfaceAndShow(const SVGDrawingParameters& aParams) VectorSurfaceKey(aParams.size, aParams.svgContext, aParams.animationTime), - Lifetime::Transient); + Lifetime::Persistent); // Draw. nsRefPtr drawable = - new gfxSurfaceDrawable(surface, ThebesIntSize(aParams.size)); + new gfxSurfaceDrawable(surface, aParams.size); Show(drawable, aParams); + + // Send out an invalidation so that surfaces that are still in use get + // re-locked. See the discussion of the UnlockSurfaces call above. + mProgressTracker->SyncNotifyProgress(FLAG_FRAME_COMPLETE, + nsIntRect::GetMaxSizedIntRect()); } @@ -906,7 +918,7 @@ VectorImage::Show(gfxDrawable* aDrawable, const SVGDrawingParameters& aParams) { MOZ_ASSERT(aDrawable, "Should have a gfxDrawable by now"); gfxUtils::DrawPixelSnapped(aParams.context, aDrawable, - ThebesIntSize(aParams.size), + aParams.size, aParams.region, SurfaceFormat::B8G8R8A8, aParams.filter, aParams.flags, aParams.opacity); @@ -954,7 +966,19 @@ VectorImage::RequestDecodeForSize(const nsIntSize& aSize, uint32_t aFlags) NS_IMETHODIMP VectorImage::LockImage() { - // This method is for image-discarding, which only applies to RasterImages. + MOZ_ASSERT(NS_IsMainThread()); + + if (mError) { + return NS_ERROR_FAILURE; + } + + mLockCount++; + + if (mLockCount == 1) { + // Lock this image's surfaces in the SurfaceCache. + SurfaceCache::LockImage(ImageKey(this)); + } + return NS_OK; } @@ -963,7 +987,24 @@ VectorImage::LockImage() NS_IMETHODIMP VectorImage::UnlockImage() { - // This method is for image-discarding, which only applies to RasterImages. + MOZ_ASSERT(NS_IsMainThread()); + + if (mError) { + return NS_ERROR_FAILURE; + } + + if (mLockCount == 0) { + MOZ_ASSERT_UNREACHABLE("Calling UnlockImage with a zero lock count"); + return NS_ERROR_ABORT; + } + + mLockCount--; + + if (mLockCount == 0) { + // Unlock this image's surfaces in the SurfaceCache. + SurfaceCache::UnlockImage(ImageKey(this)); + } + return NS_OK; } @@ -972,10 +1013,26 @@ VectorImage::UnlockImage() NS_IMETHODIMP VectorImage::RequestDiscard() { - SurfaceCache::RemoveImage(ImageKey(this)); + MOZ_ASSERT(NS_IsMainThread()); + + if (mDiscardable && mLockCount == 0) { + SurfaceCache::RemoveImage(ImageKey(this)); + mProgressTracker->OnDiscard(); + } + return NS_OK; } +void +VectorImage::OnSurfaceDiscarded() +{ + MOZ_ASSERT(mProgressTracker); + + nsCOMPtr runnable = + NS_NewRunnableMethod(mProgressTracker, &ProgressTracker::OnDiscard); + NS_DispatchToMainThread(runnable); +} + //****************************************************************************** /* void resetAnimation (); */ NS_IMETHODIMP diff --git a/image/VectorImage.h b/image/VectorImage.h index 6efd520078..083d77f2d4 100644 --- a/image/VectorImage.h +++ b/image/VectorImage.h @@ -51,6 +51,8 @@ public: nsresult aResult, bool aLastPart) override; + void OnSurfaceDiscarded() override; + /** * Callback for SVGRootRenderingObserver. * @@ -96,7 +98,11 @@ private: nsRefPtr mLoadEventListener; nsRefPtr mParseCompleteListener; + /// Count of locks on this image (roughly correlated to visible instances). + uint32_t mLockCount; + bool mIsInitialized; // Have we been initalized? + bool mDiscardable; // Are we discardable? bool mIsFullyLoaded; // Has the SVG document finished loading? bool mIsDrawing; // Are we currently drawing? bool mHaveAnimations; // Is our SVG content SMIL-animated? diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp index 7c605ce677..cdf8ec871a 100644 --- a/image/imgFrame.cpp +++ b/image/imgFrame.cpp @@ -373,7 +373,7 @@ imgFrame::InitWithDrawable(gfxDrawable* aDrawable, // Draw using the drawable the caller provided. nsIntRect imageRect(0, 0, mSize.width, mSize.height); nsRefPtr ctx = new gfxContext(target); - gfxUtils::DrawPixelSnapped(ctx, aDrawable, ThebesIntSize(mSize), + gfxUtils::DrawPixelSnapped(ctx, aDrawable, mSize, ImageRegion::Create(imageRect), mFormat, aFilter, aImageFlags); @@ -558,7 +558,7 @@ imgFrame::SurfaceForDrawing(bool aDoPadding, IntSize size(int32_t(aImageRect.Width()), int32_t(aImageRect.Height())); if (!aDoPadding && !aDoPartialDecode) { NS_ASSERTION(!mSinglePixel, "This should already have been handled"); - return SurfaceWithFormat(new gfxSurfaceDrawable(aSurface, ThebesIntSize(size)), mFormat); + return SurfaceWithFormat(new gfxSurfaceDrawable(aSurface, size), mFormat); } gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height); @@ -586,7 +586,7 @@ imgFrame::SurfaceForDrawing(bool aDoPadding, } RefPtr newsurf = target->Snapshot(); - return SurfaceWithFormat(new gfxSurfaceDrawable(newsurf, ThebesIntSize(size)), target->GetFormat()); + return SurfaceWithFormat(new gfxSurfaceDrawable(newsurf, size), target->GetFormat()); } // Not tiling, and we have a surface, so we can account for diff --git a/image/imgIContainer.idl b/image/imgIContainer.idl index 84c579d8cd..4e38789bc6 100644 --- a/image/imgIContainer.idl +++ b/image/imgIContainer.idl @@ -98,7 +98,7 @@ native nsIntRectByVal(nsIntRect); [ref] native nsIntSize(nsIntSize); native nsSize(nsSize); [ptr] native nsIFrame(nsIFrame); -[ptr] native ImageContainer(mozilla::layers::ImageContainer); +native TempRefImageContainer(already_AddRefed); [ref] native ImageRegion(mozilla::image::ImageRegion); [ptr] native LayerManager(mozilla::layers::LayerManager); native Orientation(mozilla::image::Orientation); @@ -116,7 +116,7 @@ native nsIntSizeByVal(nsIntSize); * * Internally, imgIContainer also manages animation of images. */ -[scriptable, builtinclass, uuid(9a43298b-bf49-44fc-9abe-9ff702f1bd25)] +[scriptable, builtinclass, uuid(e3261ae7-4749-4cf6-bf06-59946233366f)] interface imgIContainer : nsISupports { /** @@ -173,12 +173,7 @@ interface imgIContainer : nsISupports /** * The type of this image (one of the TYPE_* values above). */ - readonly attribute unsigned short type; - - /** - * Direct C++ accessor for 'type' attribute, for convenience. - */ - [noscript, notxpcom] uint16_t GetType(); + [infallible] readonly attribute unsigned short type; /** * Whether this image is animated. You can only be guaranteed that querying @@ -277,8 +272,17 @@ interface imgIContainer : nsISupports /** * Attempts to create an ImageContainer (and Image) containing the current * frame. Only valid for RASTER type images. + * + * @param aManager The LayerManager which will be used to create the + * ImageContainer. + * @param aFlags Decoding / drawing flags (in other words, FLAG_* flags). + * Currently only FLAG_SYNC_DECODE and FLAG_SYNC_DECODE_IF_FAST + * are supported. + * @return An ImageContainer for the current frame, or nullptr if one could + * not be created. */ - [noscript] ImageContainer getImageContainer(in LayerManager aManager); + [noscript, notxpcom] TempRefImageContainer getImageContainer(in LayerManager aManager, + in uint32_t aFlags); /** * Draw the requested frame of this image onto the context specified. diff --git a/ipc/chromium/src/base/logging.h b/ipc/chromium/src/base/logging.h index e36dce93ee..5a9c16655e 100644 --- a/ipc/chromium/src/base/logging.h +++ b/ipc/chromium/src/base/logging.h @@ -9,7 +9,7 @@ #include #include "base/basictypes.h" -#include "prlog.h" +#include "mozilla/Logging.h" #ifdef NO_CHROMIUM_LOGGING #include diff --git a/ipc/glue/IPCMessageUtils.h b/ipc/glue/IPCMessageUtils.h index 673d905c4d..2ab91a142b 100644 --- a/ipc/glue/IPCMessageUtils.h +++ b/ipc/glue/IPCMessageUtils.h @@ -22,6 +22,7 @@ #include #include "nsID.h" +#include "nsIWidget.h" #include "nsMemory.h" #include "nsString.h" #include "nsTArray.h" @@ -743,6 +744,13 @@ struct ParamTraits } }; +template <> +struct ParamTraits + : public BitFlagsEnumSerializer +{ +}; + } /* namespace IPC */ #endif /* __IPC_GLUE_IPCMESSAGEUTILS_H__ */ diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index 2d16462b70..7b9ccb2f15 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -8,7 +8,7 @@ #include -#include "prlog.h" +#include "mozilla/Logging.h" #ifdef ANDROID #include #endif diff --git a/js/xpconnect/src/XPCLog.cpp b/js/xpconnect/src/XPCLog.cpp index 6ca069a9cf..afbfe4c218 100644 --- a/js/xpconnect/src/XPCLog.cpp +++ b/js/xpconnect/src/XPCLog.cpp @@ -7,7 +7,7 @@ /* Debug Logging support. */ #include "XPCLog.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prprf.h" #include "mozilla/mozalloc.h" #include diff --git a/js/xpconnect/src/XPCLog.h b/js/xpconnect/src/XPCLog.h index 324fc465f5..9251c82ed9 100644 --- a/js/xpconnect/src/XPCLog.h +++ b/js/xpconnect/src/XPCLog.h @@ -9,7 +9,7 @@ #ifndef xpclog_h___ #define xpclog_h___ -#include "prlog.h" +#include "mozilla/Logging.h" /* * This uses prlog.h See prlog.h for environment settings for output. diff --git a/js/xpconnect/tests/chrome/test_bug571849.xul b/js/xpconnect/tests/chrome/test_bug571849.xul index 9dbf61e824..a5750b6d49 100644 --- a/js/xpconnect/tests/chrome/test_bug571849.xul +++ b/js/xpconnect/tests/chrome/test_bug571849.xul @@ -23,11 +23,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=500931 function go() { var ifr = document.getElementById('ifr'); var docnodes = ifr.contentDocument.body.childNodes; - var output; - for (let i in Iterator(docnodes)) - output = i; - is(output[0], "0", "enumerated the 0th element"); - ok(/Text/.test(output[1]), "the 0th element was a text node"); + var index, value; + for (let i in Iterator(docnodes)) { + index = i[0], value = i[1]; + } + is(index, 0, "enumerated the 0th element"); + ok(value instanceof Text, "the 0th element was a text node"); SimpleTest.finish(); } diff --git a/js/xpconnect/tests/chrome/test_localstorage_with_nsEp.xul b/js/xpconnect/tests/chrome/test_localstorage_with_nsEp.xul index 5d3dce85e4..ebebb3a16e 100644 --- a/js/xpconnect/tests/chrome/test_localstorage_with_nsEp.xul +++ b/js/xpconnect/tests/chrome/test_localstorage_with_nsEp.xul @@ -26,8 +26,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=980023 var iwin = document.getElementById('ifr').contentWindow; var sb = new Cu.Sandbox([iwin], {sandboxPrototype: iwin}); Cu.evalInSandbox("window.localStorage.test_localstorage_with_nsEp = 3",sb); - is(Cu.evalInSandbox("window.localStorage.test_localstorage_with_nsEp",sb), 3); - is(iwin.localStorage.test_localstorage_with_nsEp, 3); + is(Cu.evalInSandbox("window.localStorage.test_localstorage_with_nsEp",sb), "3"); + is(iwin.localStorage.test_localstorage_with_nsEp, "3"); iwin.localStorage.removeItem("test_localstorage_with_nsEp"); SimpleTest.finish(); } diff --git a/js/xpconnect/tests/mochitest/test_bug691059.html b/js/xpconnect/tests/mochitest/test_bug691059.html index 06ef73d826..830cf7b5d0 100644 --- a/js/xpconnect/tests/mochitest/test_bug691059.html +++ b/js/xpconnect/tests/mochitest/test_bug691059.html @@ -34,11 +34,13 @@ function testEventTarget(obj) { function testInterface(obj) { try { obj.prototype.onmouseenter = f; - is(obj.onmouseenter, null, - "prototype.onmouseenter should be settable, but the value should stay null"); + is("onmouseenter" in obj, false, + "setting .prototype.onmouseenter has no effect on the " + + "non-existent .onmouseenter"); obj.prototype.onmouseleave = f; - is(obj.onmouseleave, null, - "prototype.onmouseleave should be settable, but the value should stay null"); + is("onmouseleave" in obj, false, + "setting .prototype.onmouseleave has no effect on the " + + "non-existent .onmouseleave"); } catch(ex) { ok(false, ex); } diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 96aa3e2ea0..c2d349a107 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -7,32 +7,38 @@ #include "FrameLayerBuilder.h" -#include "mozilla/gfx/Matrix.h" -#include "nsDisplayList.h" -#include "nsPresContext.h" -#include "nsLayoutUtils.h" -#include "Layers.h" -#include "BasicLayers.h" -#include "gfxUtils.h" -#include "nsRenderingContext.h" -#include "MaskLayerImageCache.h" -#include "nsIScrollableFrame.h" -#include "nsPrintfCString.h" -#include "LayerTreeInvalidation.h" -#include "nsSVGIntegrationUtils.h" -#include "ImageContainer.h" -#include "ActiveLayerTracker.h" -#include "gfx2DGlue.h" #include "mozilla/LookAndFeel.h" -#include "nsDocShell.h" -#include "nsImageFrame.h" +#include "mozilla/Maybe.h" #include "mozilla/dom/ProfileTimelineMarkerBinding.h" +#include "mozilla/gfx/Matrix.h" +#include "ActiveLayerTracker.h" +#include "BasicLayers.h" +#include "ImageContainer.h" +#include "LayerTreeInvalidation.h" +#include "Layers.h" +#include "MaskLayerImageCache.h" +#include "UnitTransforms.h" +#include "Units.h" +#include "gfx2DGlue.h" +#include "gfxUtils.h" +#include "nsDisplayList.h" +#include "nsDocShell.h" +#include "nsIScrollableFrame.h" +#include "nsImageFrame.h" +#include "nsLayoutUtils.h" +#include "nsPresContext.h" +#include "nsPrintfCString.h" +#include "nsRenderingContext.h" +#include "nsSVGIntegrationUtils.h" -#include "GeckoProfiler.h" -#include "mozilla/gfx/Tools.h" +#include "mozilla/Move.h" +#include "mozilla/ReverseIterator.h" #include "mozilla/gfx/2D.h" -#include "gfxPrefs.h" +#include "mozilla/gfx/Tools.h" +#include "mozilla/unused.h" +#include "GeckoProfiler.h" #include "LayersLogging.h" +#include "gfxPrefs.h" #include @@ -41,45 +47,32 @@ using namespace mozilla::gfx; namespace mozilla { +class PaintedDisplayItemLayerUserData; + FrameLayerBuilder::DisplayItemData::DisplayItemData(LayerManagerData* aParent, uint32_t aKey, - nsIFrame* aFrame) + Layer* aLayer, nsIFrame* aFrame) : mParent(aParent) - , mLayer(nullptr) + , mLayer(aLayer) , mDisplayItemKey(aKey) , mItem(nullptr) , mUsed(true) , mIsInvalid(false) { + MOZ_RELEASE_ASSERT(mLayer); if (aFrame) { AddFrame(aFrame); } } -FrameLayerBuilder::DisplayItemData::DisplayItemData(DisplayItemData &toCopy) -{ - // This isn't actually a copy-constructor; notice that it steals toCopy's - // mGeometry pointer. Be careful. - mParent = toCopy.mParent; - mLayer = toCopy.mLayer; - mInactiveManager = toCopy.mInactiveManager; - mFrameList = toCopy.mFrameList; - mGeometry = toCopy.mGeometry; - mDisplayItemKey = toCopy.mDisplayItemKey; - mClip = toCopy.mClip; - mContainerLayerGeneration = toCopy.mContainerLayerGeneration; - mLayerState = toCopy.mLayerState; - mItem = toCopy.mItem; - mUsed = toCopy.mUsed; -} - void FrameLayerBuilder::DisplayItemData::AddFrame(nsIFrame* aFrame) { + MOZ_RELEASE_ASSERT(mLayer); mFrameList.AppendElement(aFrame); - nsTArray *array = - reinterpret_cast*>(aFrame->Properties().Get(FrameLayerBuilder::LayerManagerDataProperty())); + nsTArray* array = + static_cast*>(aFrame->Properties().Get(FrameLayerBuilder::LayerManagerDataProperty())); if (!array) { array = new nsTArray(); aFrame->Properties().Set(FrameLayerBuilder::LayerManagerDataProperty(), array); @@ -90,18 +83,20 @@ FrameLayerBuilder::DisplayItemData::AddFrame(nsIFrame* aFrame) void FrameLayerBuilder::DisplayItemData::RemoveFrame(nsIFrame* aFrame) { - DebugOnly result = mFrameList.RemoveElement(aFrame); - NS_ASSERTION(result, "Can't remove a frame that wasn't added!"); + MOZ_RELEASE_ASSERT(mLayer); + bool result = mFrameList.RemoveElement(aFrame); + MOZ_RELEASE_ASSERT(result, "Can't remove a frame that wasn't added!"); - nsTArray *array = - reinterpret_cast*>(aFrame->Properties().Get(FrameLayerBuilder::LayerManagerDataProperty())); - NS_ASSERTION(array, "Must be already stored on the frame!"); + nsTArray* array = + static_cast*>(aFrame->Properties().Get(FrameLayerBuilder::LayerManagerDataProperty())); + MOZ_RELEASE_ASSERT(array, "Must be already stored on the frame!"); array->RemoveElement(this); } void FrameLayerBuilder::DisplayItemData::EndUpdate() { + MOZ_RELEASE_ASSERT(mLayer); MOZ_ASSERT(!mItem); mIsInvalid = false; mUsed = false; @@ -110,6 +105,7 @@ FrameLayerBuilder::DisplayItemData::EndUpdate() void FrameLayerBuilder::DisplayItemData::EndUpdate(nsAutoPtr aGeometry) { + MOZ_RELEASE_ASSERT(mLayer); MOZ_ASSERT(mItem); mGeometry = aGeometry; @@ -125,6 +121,8 @@ FrameLayerBuilder::DisplayItemData::BeginUpdate(Layer* aLayer, LayerState aState uint32_t aContainerLayerGeneration, nsDisplayItem* aItem /* = nullptr */) { + MOZ_RELEASE_ASSERT(mLayer); + MOZ_RELEASE_ASSERT(aLayer); mLayer = aLayer; mOptLayer = nullptr; mInactiveManager = nullptr; @@ -166,6 +164,7 @@ FrameLayerBuilder::DisplayItemData::BeginUpdate(Layer* aLayer, LayerState aState static nsIFrame* sDestroyedFrame = nullptr; FrameLayerBuilder::DisplayItemData::~DisplayItemData() { + MOZ_RELEASE_ASSERT(mLayer); for (uint32_t i = 0; i < mFrameList.Length(); i++) { nsIFrame* frame = mFrameList[i]; if (frame == sDestroyedFrame) { @@ -242,54 +241,19 @@ static inline MaskLayerImageCache* GetMaskLayerImageCache() return gMaskLayerImageCache; } -/** - * A wrapper for nsIntRegion that can express infinite regions. - */ -struct PossiblyInfiniteRegion +struct AssignedDisplayItem { - PossiblyInfiniteRegion() : mIsInfinite(false) {} - MOZ_IMPLICIT PossiblyInfiniteRegion(const nsIntRegion& aRegion) - : mRegion(aRegion) - , mIsInfinite(false) - {} - MOZ_IMPLICIT PossiblyInfiniteRegion(const nsIntRect& aRect) - : mRegion(aRect) - , mIsInfinite(false) + AssignedDisplayItem(nsDisplayItem* aItem, + const DisplayItemClip& aClip, + LayerState aLayerState) + : mItem(aItem) + , mClip(aClip) + , mLayerState(aLayerState) {} - // Create an infinite region. - static PossiblyInfiniteRegion InfiniteRegion() - { - PossiblyInfiniteRegion r; - r.mIsInfinite = true; - return r; - } - - bool IsInfinite() const { return mIsInfinite; } - bool Intersects(const nsIntRegion& aRegion) const - { - if (IsInfinite()) { - return true; - } - return !mRegion.Intersect(aRegion).IsEmpty(); - } - - void AccumulateAndSimplifyOutward(const PossiblyInfiniteRegion& aRegion) - { - if (!IsInfinite()) { - if (aRegion.IsInfinite()) { - mIsInfinite = true; - mRegion.SetEmpty(); - } else { - mRegion.OrWith(aRegion.mRegion); - mRegion.SimplifyOutward(8); - } - } - } - -protected: - nsIntRegion mRegion; - bool mIsInfinite; + nsDisplayItem* mItem; + DisplayItemClip mClip; + LayerState mLayerState; }; /** @@ -305,7 +269,6 @@ class PaintedLayerData { public: PaintedLayerData() : mAnimatedGeometryRoot(nullptr), - mIsAsyncScrollable(false), mFixedPosFrameForLayerData(nullptr), mReferenceFrame(nullptr), mLayer(nullptr), @@ -347,7 +310,8 @@ public: nsDisplayItem* aItem, const nsIntRegion& aClippedOpaqueRegion, const nsIntRect& aVisibleRect, - const DisplayItemClip& aClip); + const DisplayItemClip& aClip, + LayerState aLayerState); const nsIFrame* GetAnimatedGeometryRoot() { return mAnimatedGeometryRoot; } /** @@ -373,21 +337,15 @@ public: */ already_AddRefed CanOptimizeImageLayer(nsDisplayListBuilder* aBuilder); + bool VisibleAboveRegionIntersects(const nsIntRect& aRect) const + { return mVisibleAboveRegion.Intersects(aRect); } bool VisibleAboveRegionIntersects(const nsIntRegion& aRegion) const - { - return mVisibleAboveRegion.Intersects(aRegion); - } + { return !mVisibleAboveRegion.Intersect(aRegion).IsEmpty(); } bool VisibleRegionIntersects(const nsIntRect& aRect) const - { - return IsSubjectToAsyncTransforms() || mVisibleRegion.Intersects(aRect); - } - - bool IsSubjectToAsyncTransforms() const - { - return mFixedPosFrameForLayerData != nullptr - || mIsAsyncScrollable; - } + { return mVisibleRegion.Intersects(aRect); } + bool VisibleRegionIntersects(const nsIntRegion& aRegion) const + { return !mVisibleRegion.Intersect(aRegion).IsEmpty(); } /** * The region of visible content in the layer, relative to the @@ -440,11 +398,9 @@ public: */ const nsIFrame* mAnimatedGeometryRoot; /** - * Whether or not this layer is async scrollable. If it is, that means display - * items above this layer should not end up in a layer below this one, as they - * might be obscured when they shouldn't be. + * The offset between mAnimatedGeometryRoot and the reference frame. */ - bool mIsAsyncScrollable; + nsPoint mAnimatedGeometryRootOffset; /** * If non-null, the frame from which we'll extract "fixed positioning" * metadata for this layer. This can be a position:fixed frame or a viewport @@ -534,12 +490,15 @@ public: nsIntRect mBounds; /** * The region of visible content above the layer and below the - * next PaintedLayerData currently in the stack, if any. Note that not - * all PaintedLayers for the container are in the PaintedLayerData stack. - * Same coordinate system as mVisibleRegion. + * next PaintedLayerData currently in the stack, if any. * This is a conservative approximation: it contains the true region. */ - PossiblyInfiniteRegion mVisibleAboveRegion; + nsIntRegion mVisibleAboveRegion; + /** + * All the display items that have been assigned to this painted layer. + * These items get added by Accumulate(). + */ + nsTArray mAssignedDisplayItems; }; @@ -568,6 +527,7 @@ struct NewLayerEntry { // This rect is in the layer's own coordinate space. The computed visible // region for the layer cannot extend beyond this rect. nsIntRect mLayerContentsVisibleRect; + nsTArray mScrollInfoItems; bool mHideAllLayersBelow; // When mOpaqueForAnimatedGeometryRootParent is true, the opaque region of // this layer is opaque in the same position even subject to the animation of @@ -584,6 +544,313 @@ struct NewLayerEntry { bool mPropagateComponentAlphaFlattening; }; +class PaintedLayerDataTree; + +/** + * This is tree node type for PaintedLayerDataTree. + * Each node corresponds to a different animated geometry root, and contains + * a stack of PaintedLayerDatas, in bottom-to-top order. + * There is at most one node per animated geometry root. The ancestor and + * descendant relations in PaintedLayerDataTree tree mirror those in the frame + * tree. + * Each node can have clip that describes the potential extents that items in + * this node can cover. If mHasClip is false, it means that the node's contents + * can move anywhere. + * Testing against the clip instead of the node's actual contents has the + * advantage that the node's contents can move or animate without affecting + * content in other nodes. So we don't need to re-layerize during animations + * (sync or async), and during async animations everything is guaranteed to + * look correct. + * The contents of a node's PaintedLayerData stack all share the node's + * animated geometry root. The child nodes are on top of the PaintedLayerData + * stack, in z-order, and the clip rects of the child nodes are allowed to + * intersect with the visible region or visible above region of their parent + * node's PaintedLayerDatas. + */ +class PaintedLayerDataNode { +public: + PaintedLayerDataNode(PaintedLayerDataTree& aTree, + PaintedLayerDataNode* aParent, + const nsIFrame* aAnimatedGeometryRoot); + ~PaintedLayerDataNode(); + + const nsIFrame* AnimatedGeometryRoot() const { return mAnimatedGeometryRoot; } + + /** + * Whether this node's contents can potentially intersect aRect. + * aRect is in our tree's ContainerState's coordinate space. + */ + bool Intersects(const nsIntRect& aRect) const + { return !mHasClip || mClipRect.Intersects(aRect); } + + /** + * Create a PaintedLayerDataNode for aAnimatedGeometryRoot, add it to our + * children, and return it. + */ + PaintedLayerDataNode* AddChildNodeFor(const nsIFrame* aAnimatedGeometryRoot); + + /** + * Find a PaintedLayerData in our mPaintedLayerDataStack that aItem can be + * added to. Creates a new PaintedLayerData by calling + * aNewPaintedLayerCallback if necessary. + */ + template + PaintedLayerData* FindPaintedLayerFor(const nsIntRect& aVisibleRect, + NewPaintedLayerCallbackType aNewPaintedLayerCallback); + + /** + * Find an opaque background color for aRegion. Pulls a color from the parent + * geometry root if appropriate, but only if that color is present underneath + * the whole clip of this node, so that this node's contents can animate or + * move (possibly async) without having to change the background color. + * @param aUnderIndex Searching will start in mPaintedLayerDataStack right + * below aUnderIndex. + */ + enum { ABOVE_TOP = -1 }; + nscolor FindOpaqueBackgroundColor(const nsIntRegion& aRegion, + int32_t aUnderIndex = ABOVE_TOP) const; + /** + * Same as FindOpaqueBackgroundColor, but only returns a color if absolutely + * nothing is in between, so that it can be used for a layer that can move + * anywhere inside our clip. + */ + nscolor FindOpaqueBackgroundColorCoveringEverything() const; + + /** + * Adds aRect to this node's top PaintedLayerData's mVisibleAboveRegion, + * or mVisibleAboveBackgroundRegion if mPaintedLayerDataStack is empty. + */ + void AddToVisibleAboveRegion(const nsIntRect& aRect); + /** + * Call this if all of our existing content can potentially be covered, so + * nothing can merge with it and all new content needs to create new items + * on top. This will finish all of our children and pop our whole + * mPaintedLayerDataStack. + */ + void SetAllDrawingAbove(); + + /** + * Finish this node: Finish all children, finish our PaintedLayer contents, + * and (if requested) adjust our parent's visible above region to include + * our clip. + */ + void Finish(bool aParentNeedsAccurateVisibleAboveRegion); + + /** + * Finish any children that intersect aRect. + */ + void FinishChildrenIntersecting(const nsIntRect& aRect); + + /** + * Finish all children. + */ + void FinishAllChildren() { FinishAllChildren(true); } + +protected: + /** + * Finish the topmost item in mPaintedLayerDataStack and pop it from the + * stack. + */ + void PopPaintedLayerData(); + /** + * Finish all items in mPaintedLayerDataStack and clear the stack. + */ + void PopAllPaintedLayerData(); + /** + * Finish all of our child nodes, but don't touch mPaintedLayerDataStack. + */ + void FinishAllChildren(bool aThisNodeNeedsAccurateVisibleAboveRegion); + /** + * Pass off opaque background color searching to our parent node, if we have + * one. + */ + nscolor FindOpaqueBackgroundColorInParentNode() const; + + PaintedLayerDataTree& mTree; + PaintedLayerDataNode* mParent; + const nsIFrame* mAnimatedGeometryRoot; + + /** + * Our contents: a PaintedLayerData stack and our child nodes. + */ + nsTArray mPaintedLayerDataStack; + + /** + * UniquePtr is used here in the sense of "unique ownership", i.e. there is + * only one owner. Not in the sense of "this is the only pointer to the + * node": There are two other, non-owning, pointers to our child nodes: The + * node's respective children point to their parent node with their mParent + * pointer, and the tree keeps a map of animated geometry root to node in its + * mNodes member. These outside pointers are the reason that mChildren isn't + * just an nsTArray (since the pointers would become + * invalid whenever the array expands its capacity). + */ + nsTArray> mChildren; + + /** + * The region that's covered between our "background" and the bottom of + * mPaintedLayerDataStack. This is used to indicate whether we can pull + * a background color from our parent node. If mVisibleAboveBackgroundRegion + * should be considered infinite, mAllDrawingAboveBackground will be true and + * the value of mVisibleAboveBackgroundRegion will be meaningless. + */ + nsIntRegion mVisibleAboveBackgroundRegion; + + /** + * Our clip, if we have any. If not, that means we can move anywhere, and + * mHasClip will be false and mClipRect will be meaningless. + */ + nsIntRect mClipRect; + bool mHasClip; + + /** + * Whether mVisibleAboveBackgroundRegion should be considered infinite. + */ + bool mAllDrawingAboveBackground; +}; + +class ContainerState; + +/** + * A tree of PaintedLayerDataNodes. At any point in time, the tree only + * contains nodes for animated geometry roots that new items can potentially + * merge into. Any time content is added on top that overlaps existing things + * in such a way that we no longer want to merge new items with some existing + * content, that existing content gets "finished". + * The public-facing methods of this class are FindPaintedLayerFor, + * AddingOwnLayer, and Finish. The other public methods are for + * PaintedLayerDataNode. + * The tree calls out to its containing ContainerState for some things. + * All coordinates / rects in the tree or the tree nodes are in the + * ContainerState's coordinate space, i.e. relative to the reference frame and + * in layer pixels. + * The clip rects of sibling nodes never overlap. This is ensured by finishing + * existing nodes before adding new ones, if this property were to be violated. + * The root tree node doesn't get finished until the ContainerState is + * finished. + * The tree's root node is always the root reference frame of the builder. We + * don't stop at the container state's mContainerAnimatedGeometryRoot because + * some of our contents can have animated geometry roots that are not + * descendants of the container's animated geometry root. Every animated + * geometry root we encounter for our contents needs to have a defined place in + * the tree. + */ +class PaintedLayerDataTree { +public: + PaintedLayerDataTree(ContainerState& aContainerState, + nscolor& aBackgroundColor) + : mContainerState(aContainerState) + , mContainerUniformBackgroundColor(aBackgroundColor) + {} + + ~PaintedLayerDataTree() + { + MOZ_ASSERT(!mRoot); + MOZ_ASSERT(mNodes.Count() == 0); + } + + /** + * Notify our contents that some non-PaintedLayer content has been added. + * *aRect needs to be a rectangle that doesn't move with respect to + * aAnimatedGeometryRoot and that contains the added item. + * If aRect is null, the extents will be considered infinite. + * If aOutUniformBackgroundColor is non-null, it will be set to an opaque + * color that can be pulled into the background of the added content, or + * transparent if that is not possible. + */ + void AddingOwnLayer(const nsIFrame* aAnimatedGeometryRoot, + const nsIntRect* aRect, + nscolor* aOutUniformBackgroundColor); + + /** + * Find a PaintedLayerData for aItem. This can either be an existing + * PaintedLayerData from inside a node in our tree, or a new one that gets + * created by a call out to aNewPaintedLayerCallback. + */ + template + PaintedLayerData* FindPaintedLayerFor(const nsIFrame* aAnimatedGeometryRoot, + const nsIntRect& aVisibleRect, + bool aShouldFixToViewport, + NewPaintedLayerCallbackType aNewPaintedLayerCallback); + + /** + * Finish everything. + */ + void Finish(); + + /** + * Get the parent animated geometry root of aAnimatedGeometryRoot. + * That's either aAnimatedGeometryRoot's animated geometry root, or, if + * that's aAnimatedGeometryRoot itself, then it's the animated geometry + * root for aAnimatedGeometryRoot's cross-doc parent frame. + */ + const nsIFrame* GetParentAnimatedGeometryRoot(const nsIFrame* aAnimatedGeometryRoot); + + /** + * Whether aAnimatedGeometryRoot has an intrinsic clip that doesn't move with + * respect to aAnimatedGeometryRoot's parent animated geometry root. + * If aAnimatedGeometryRoot is a scroll frame, this will be the scroll frame's + * scroll port, otherwise there is no clip. + * This method doesn't have much to do with PaintedLayerDataTree, but this is + * where we have easy access to a display list builder, which we use to get + * the clip rect result into the right coordinate space. + */ + bool IsClippedWithRespectToParentAnimatedGeometryRoot(const nsIFrame* aAnimatedGeometryRoot, + nsIntRect* aOutClip); + + /** + * Called by PaintedLayerDataNode when it is finished, so that we can drop + * our pointers to it. + */ + void NodeWasFinished(const nsIFrame* aAnimatedGeometryRoot); + + nsDisplayListBuilder* Builder() const; + ContainerState& ContState() const { return mContainerState; } + nscolor UniformBackgroundColor() const { return mContainerUniformBackgroundColor; } + +protected: + /** + * Finish all nodes that potentially intersect *aRect, where *aRect is a rect + * that doesn't move with respect to aAnimatedGeometryRoot. + * If aRect is null, *aRect will be considered infinite. + */ + void FinishPotentiallyIntersectingNodes(const nsIFrame* aAnimatedGeometryRoot, + const nsIntRect* aRect); + + /** + * Make sure that there is a node for aAnimatedGeometryRoot and all of its + * ancestor geometry roots. Return the node for aAnimatedGeometryRoot. + */ + PaintedLayerDataNode* EnsureNodeFor(const nsIFrame* aAnimatedGeometryRoot); + + /** + * Find an existing node in the tree for an ancestor of aAnimatedGeometryRoot. + * *aOutAncestorChild will be set to the last ancestor that was encountered + * in the search up from aAnimatedGeometryRoot; it will be a child animated + * geometry root of the result, if neither are null. + */ + PaintedLayerDataNode* + FindNodeForAncestorAnimatedGeometryRoot(const nsIFrame* aAnimatedGeometryRoot, + const nsIFrame** aOutAncestorChild); + + ContainerState& mContainerState; + UniquePtr mRoot; + + /** + * The uniform opaque color from behind this container layer, or + * NS_RGBA(0,0,0,0) if the background behind this container layer is not + * uniform and opaque. This color can be pulled into PaintedLayers that are + * directly above the background. + */ + nscolor mContainerUniformBackgroundColor; + + /** + * A hash map for quick access the node belonging to a particular animated + * geometry root. + */ + nsDataHashtable, PaintedLayerDataNode*> mNodes; +}; + /** * This is a helper object used to build up the layer children for * a ContainerLayer. @@ -606,8 +873,7 @@ public: mContainerLayer(aContainerLayer), mContainerBounds(aContainerBounds), mParameters(aParameters), - mNextFreeRecycledPaintedLayer(0), - mContainerUniformBackgroundColor(aBackgroundColor), + mPaintedLayerDataTree(*this, aBackgroundColor), mFlattenToSingleLayer(aFlattenToSingleLayer) { nsPresContext* presContext = aContainerFrame->PresContext(); @@ -615,9 +881,13 @@ public: mContainerReferenceFrame = const_cast(aContainerItem ? aContainerItem->ReferenceFrameForChildren() : mBuilder->FindReferenceFrameFor(mContainerFrame)); - mContainerAnimatedGeometryRoot = aContainerItem - ? nsLayoutUtils::GetAnimatedGeometryRootFor(aContainerItem, aBuilder, aManager) - : mContainerReferenceFrame; + bool isAtRoot = !aContainerItem || (aContainerItem->Frame() == mBuilder->RootReferenceFrame()); + MOZ_ASSERT_IF(isAtRoot, mContainerReferenceFrame == mBuilder->RootReferenceFrame()); + mContainerAnimatedGeometryRoot = isAtRoot + ? mContainerReferenceFrame + : nsLayoutUtils::GetAnimatedGeometryRootFor(aContainerItem, aBuilder, aManager); + MOZ_ASSERT(nsLayoutUtils::IsAncestorFrameCrossDoc(mBuilder->RootReferenceFrame(), + mContainerAnimatedGeometryRoot)); NS_ASSERTION(!aContainerItem || !aContainerItem->ShouldFixToViewport(aManager), "Container items never return true for ShouldFixToViewport"); mContainerFixedPosFrame = @@ -654,17 +924,17 @@ public: nscoord GetAppUnitsPerDevPixel() { return mAppUnitsPerDevPixel; } - nsIntRect ScaleToNearestPixels(const nsRect& aRect) + nsIntRect ScaleToNearestPixels(const nsRect& aRect) const { return aRect.ScaleToNearestPixels(mParameters.mXScale, mParameters.mYScale, mAppUnitsPerDevPixel); } - nsIntRegion ScaleRegionToNearestPixels(const nsRegion& aRegion) + nsIntRegion ScaleRegionToNearestPixels(const nsRegion& aRegion) const { return aRegion.ScaleToNearestPixels(mParameters.mXScale, mParameters.mYScale, mAppUnitsPerDevPixel); } - nsIntRect ScaleToOutsidePixels(const nsRect& aRect, bool aSnap = false) + nsIntRect ScaleToOutsidePixels(const nsRect& aRect, bool aSnap = false) const { if (aSnap && mSnappingEnabled) { return ScaleToNearestPixels(aRect); @@ -672,7 +942,7 @@ public: return aRect.ScaleToOutsidePixels(mParameters.mXScale, mParameters.mYScale, mAppUnitsPerDevPixel); } - nsIntRect ScaleToInsidePixels(const nsRect& aRect, bool aSnap = false) + nsIntRect ScaleToInsidePixels(const nsRect& aRect, bool aSnap = false) const { if (aSnap && mSnappingEnabled) { return ScaleToNearestPixels(aRect); @@ -681,7 +951,7 @@ public: mAppUnitsPerDevPixel); } - nsIntRegion ScaleRegionToInsidePixels(const nsRegion& aRegion, bool aSnap = false) + nsIntRegion ScaleRegionToInsidePixels(const nsRegion& aRegion, bool aSnap = false) const { if (aSnap && mSnappingEnabled) { return ScaleRegionToNearestPixels(aRegion); @@ -690,7 +960,7 @@ public: mAppUnitsPerDevPixel); } - nsIntRegion ScaleRegionToOutsidePixels(const nsRegion& aRegion, bool aSnap = false) + nsIntRegion ScaleRegionToOutsidePixels(const nsRegion& aRegion, bool aSnap = false) const { if (aSnap && mSnappingEnabled) { return ScaleRegionToNearestPixels(aRegion); @@ -700,6 +970,7 @@ public: } nsIFrame* GetContainerFrame() const { return mContainerFrame; } + nsDisplayListBuilder* Builder() const { return mBuilder; } /** * Sets aOuterVisibleRegion as aLayer's visible region. aOuterVisibleRegion @@ -711,23 +982,72 @@ public: const nsIntRegion& aOuterVisibleRegion, const nsIntRect* aLayerContentsVisibleRect = nullptr) const; - void AddHoistedItem(nsDisplayItem* aItem) + void AddHoistedItem(nsDisplayScrollInfoLayer* aItem) { - mHoistedItems.AppendToTop(aItem); + mHoistedItems.AppendElement(aItem); } + void AddHoistedItems(const nsTArray& aItems) + { + mHoistedItems.AppendElements(aItems); + } + + /** + * Try to determine whether the PaintedLayer aData has a single opaque color + * covering aRect. If successful, return that color, otherwise return + * NS_RGBA(0,0,0,0). + * If aRect turns out not to intersect any content in the layer, + * *aOutIntersectsLayer will be set to false. + */ + nscolor FindOpaqueBackgroundColorInLayer(const PaintedLayerData* aData, + const nsIntRect& aRect, + bool* aOutIntersectsLayer) const; + + /** + * Indicate that we are done adding items to the PaintedLayer represented by + * aData. Make sure that a real PaintedLayer exists for it, and set the final + * visible region and opaque-content. + */ + template + void FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueBackgroundColorCallbackType aFindOpaqueBackgroundColor); + protected: friend class PaintedLayerData; + LayerManager::PaintedLayerCreationHint + GetLayerCreationHint(const nsIFrame* aAnimatedGeometryRoot); + /** - * Grab the next recyclable PaintedLayer, or create one if there are no - * more recyclable PaintedLayers. Does any necessary invalidation of - * a recycled PaintedLayer, and sets up the transform on the PaintedLayer + * Creates a new PaintedLayer and sets up the transform on the PaintedLayer * to account for scrolling. */ - already_AddRefed CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoot, - const nsIFrame *aReferenceFrame, - const nsPoint& aTopLeft); + already_AddRefed CreatePaintedLayer(PaintedLayerData* aData); + + /** + * Find a PaintedLayer for recycling, recycle it and prepare it for use, or + * return null if no suitable layer was found. + */ + already_AddRefed AttemptToRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoot, + nsDisplayItem* aItem, + const nsPoint& aTopLeft); + /** + * Recycle aLayer and do any necessary invalidation. + */ + PaintedDisplayItemLayerUserData* RecyclePaintedLayer(PaintedLayer* aLayer, + const nsIFrame* aAnimatedGeometryRoot, + bool& didResetScrollPositionForLayerPixelAlignment); + + /** + * Perform the last step of CreatePaintedLayer / AttemptToRecyclePaintedLayer: + * Initialize aData, set up the layer's transform for scrolling, and + * invalidate the layer for layer pixel alignment changes if necessary. + */ + void PreparePaintedLayerForUse(PaintedLayer* aLayer, + PaintedDisplayItemLayerUserData* aData, + const nsIFrame* aAnimatedGeometryRoot, + const nsIFrame* aReferenceFrame, + const nsPoint& aTopLeft, + bool aDidResetScrollPositionForLayerPixelAlignment); /** * Grab the next recyclable ColorLayer, or create one if there are no * more recyclable ColorLayers. @@ -756,17 +1076,6 @@ protected: */ void InvalidateForLayerChange(nsDisplayItem* aItem, PaintedLayer* aNewLayer); - - /** - * Try to determine whether a layer with visible region aTargetVisibleRegion - * has a single opaque color behind it, over the entire bounds of its visible - * region. The target layer is assumed to be on top of all thebes layers in - * the thebes layer data stack that have a stack index < aUnderPaintedLayerIndex. - * If successful, return the color, otherwise return NS_RGBA(0,0,0,0). - * aTargetVisibleRegion is relative to the the container reference frame. - */ - nscolor FindOpaqueBackgroundColorFor(const nsIntRegion& aTargetVisibleRegion, - int32_t aUnderPaintedLayerIndex); /** * Find the fixed-pos frame, if any, containing (or equal to) * aAnimatedGeometryRoot. Only return a fixed-pos frame if its viewport @@ -823,48 +1132,23 @@ protected: bool* aOpaqueForAnimatedGeometryRootParent); /** - * Indicate that we are done adding items to the PaintedLayer at the top of - * mPaintedLayerDataStack. Set the final visible region and opaque-content - * flag, and pop it off the stack. + * Return a PaintedLayerData object that is initialized for a layer that + * aItem will be assigned to. + * @param aItem The item that is going to be added. + * @param aVisibleRect The visible rect of the item. + * @param aAnimatedGeometryRoot The item's animated geometry root. + * @param aTopLeft The offset between aAnimatedGeometryRoot and + * the reference frame. + * @param aShouldFixToViewport If true, aAnimatedGeometryRoot is the + * viewport and we will be adding fixed-pos + * metadata for this layer because the display + * item returned true from ShouldFixToViewport. */ - void PopPaintedLayerData(); - /** - * Check if any of the animated geometry roots from aAnimatedGeometryRoot up - * to and including mContainerAnimatedGeometryRoot are async scrollable. If - * so, return true. This is used to flag a particular PaintedLayer as being - * subject to async transforms. - */ - bool HasAsyncScrollableGeometryInContainer(const nsIFrame* aAnimatedGeometryRoot); - /** - * Find the PaintedLayer to which we should assign the next display item. - * We scan the PaintedLayerData stack to find the topmost PaintedLayer - * that is compatible with the display item (i.e., has the same - * active scrolled root), and that has no content from other layers above - * it and intersecting the aVisibleRect. - * Returns the layer, and also updates the PaintedLayerData. Will - * push a new PaintedLayerData onto the stack if no suitable existing - * layer is found. If we choose a PaintedLayer that's already on the - * PaintedLayerData stack, later elements on the stack will be popped off. - * @param aVisibleRect the area of the next display item that's visible - * @param aAnimatedGeometryRoot the active scrolled root for the next - * display item - * @param aOpaqueRect if non-null, a region of the display item that is opaque - * @param aSolidColor if non-null, indicates that every pixel in aVisibleRect - * will be painted with aSolidColor by the item - * @param aShouldFixToViewport if true, aAnimatedGeometryRoot is the viewport - * and we will be adding fixed-pos metadata for this layer because the - * display item returned true from ShouldFixToViewport. - */ - PaintedLayerData* FindPaintedLayerFor(nsDisplayItem* aItem, - const nsIntRect& aVisibleRect, - const nsIFrame* aAnimatedGeometryRoot, - const nsPoint& aTopLeft, - bool aShouldFixToViewport); - PaintedLayerData* GetTopPaintedLayerData() - { - return mPaintedLayerDataStack.IsEmpty() ? nullptr - : mPaintedLayerDataStack[mPaintedLayerDataStack.Length() - 1].get(); - } + PaintedLayerData NewPaintedLayerData(nsDisplayItem* aItem, + const nsIntRect& aVisibleRect, + const nsIFrame* aAnimatedGeometryRoot, + const nsPoint& aTopLeft, + bool aShouldFixToViewport); /* Build a mask layer to represent the clipping region. Will return null if * there is no clipping specified or a mask layer cannot be built. @@ -884,31 +1168,6 @@ protected: bool ChooseAnimatedGeometryRoot(const nsDisplayList& aList, const nsIFrame **aAnimatedGeometryRoot); - /** - * When adding a new layer above the topmost PaintedLayerData layer in our - * PaintedLayerDataStack, update the visible above region of the topmost - * PaintedLayerData item. - * @param aVisibleRect The visible rect of the newly-added display item - * @param aCanMoveFreely Whether the visible area of the item can change - * without new layer building. - * @param aClipRectIfAny A clip rect, if the layer is clipped, or nullptr. - */ - void UpdateVisibleAboveRegionForNewItem(const nsIntRect& aVisibleRect, - bool aCanMoveFreely, - const nsIntRect* aClipRectIfAny); - - /** - * When popping aData from the PaintedLayerDataStack, update the next - * PaintedLayerData item's visible above region to take the popped layer - * into account. - * @param aData The layer data that is getting popped from - * the stack. - * @param aNextPaintedLayerData The next lower item in the stack, or nullptr - * if there is none. - */ - void UpdateVisibleAboveRegionOnPop(PaintedLayerData* aData, - PaintedLayerData* aNextPaintedLayerData); - nsDisplayListBuilder* mBuilder; LayerManager* mManager; FrameLayerBuilder* mLayerBuilder; @@ -925,7 +1184,7 @@ protected: * we recycle one. */ nsIntRegion mInvalidPaintedContent; - nsAutoTArray,1> mPaintedLayerDataStack; + PaintedLayerDataTree mPaintedLayerDataTree; /** * We collect the list of children in here. During ProcessDisplayItems, * the layers in this array either have mContainerLayer as their parent, @@ -937,30 +1196,17 @@ protected: */ typedef nsAutoTArray AutoLayersArray; AutoLayersArray mNewChildLayers; - nsTArray > mRecycledPaintedLayers; + nsTHashtable> mPaintedLayersAvailableForRecycling; nsDataHashtable, nsRefPtr > mRecycledMaskImageLayers; - /** - * The visible region of all visible content in this container layer under - * first PaintedLayerData layer in the PaintedLayerDataStack. - */ - PossiblyInfiniteRegion mVisibleAboveBackgroundRegion; - uint32_t mNextFreeRecycledPaintedLayer; nscoord mAppUnitsPerDevPixel; - /** - * The uniform opaque color from behind this container layer, or - * NS_RGBA(0,0,0,0) if the background behind this container layer is not - * uniform and opaque. This color can be pulled into ThebesLayers that are - * directly above the background. - */ - nscolor mContainerUniformBackgroundColor; bool mSnappingEnabled; bool mFlattenToSingleLayer; /** * In some cases we need to hoist nsDisplayScrollInfoLayer items out from a * nested inactive container. This holds the items hoisted up from children. */ - nsDisplayList mHoistedItems; + nsTArray mHoistedItems; }; class PaintedDisplayItemLayerUserData : public LayerUserData @@ -1154,11 +1400,13 @@ FrameLayerBuilder::FlashPaint(gfxContext *aContext) FrameLayerBuilder::DisplayItemData* FrameLayerBuilder::GetDisplayItemData(nsIFrame* aFrame, uint32_t aKey) { - nsTArray *array = - reinterpret_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); + const nsTArray* array = + static_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); if (array) { for (uint32_t i = 0; i < array->Length(); i++) { DisplayItemData* item = array->ElementAt(i); + MOZ_RELEASE_ASSERT(item); + MOZ_RELEASE_ASSERT(item->mLayer); if (item->mDisplayItemKey == aKey && item->mLayer->Manager() == mRetainingManager) { return item; @@ -1265,6 +1513,7 @@ GetTranslationForPaintedLayer(PaintedLayer* aLayer) FrameLayerBuilder::RemoveFrameFromLayerManager(nsIFrame* aFrame, void* aPropertyValue) { + MOZ_RELEASE_ASSERT(!sDestroyedFrame); sDestroyedFrame = aFrame; nsTArray *array = reinterpret_cast*>(aPropertyValue); @@ -1448,8 +1697,8 @@ FrameLayerBuilder::DumpDisplayItemDataForFrame(nsRefPtrHashKey* FrameLayerBuilder::GetDisplayItemDataForManager(nsDisplayItem* aItem, LayerManager* aManager) { - nsTArray *array = - reinterpret_cast*>(aItem->Frame()->Properties().Get(LayerManagerDataProperty())); + const nsTArray* array = + static_cast*>(aItem->Frame()->Properties().Get(LayerManagerDataProperty())); if (array) { for (uint32_t i = 0; i < array->Length(); i++) { DisplayItemData* item = array->ElementAt(i); @@ -1465,8 +1714,8 @@ FrameLayerBuilder::GetDisplayItemDataForManager(nsDisplayItem* aItem, bool FrameLayerBuilder::HasRetainedDataFor(nsIFrame* aFrame, uint32_t aDisplayItemKey) { - nsTArray *array = - reinterpret_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); + const nsTArray* array = + static_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); if (array) { for (uint32_t i = 0; i < array->Length(); i++) { if (array->ElementAt(i)->mDisplayItemKey == aDisplayItemKey) { @@ -1480,8 +1729,8 @@ FrameLayerBuilder::HasRetainedDataFor(nsIFrame* aFrame, uint32_t aDisplayItemKey void FrameLayerBuilder::IterateRetainedDataFor(nsIFrame* aFrame, DisplayItemDataCallback aCallback) { - nsTArray *array = - reinterpret_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); + const nsTArray* array = + static_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); if (!array) { return; } @@ -1547,8 +1796,8 @@ FrameLayerBuilder::ClearCachedGeometry(nsDisplayItem* aItem) /* static */ Layer* FrameLayerBuilder::GetDebugOldLayerFor(nsIFrame* aFrame, uint32_t aDisplayItemKey) { - nsTArray *array = - reinterpret_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); + const nsTArray* array = + static_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); if (!array) { return nullptr; @@ -1567,8 +1816,8 @@ FrameLayerBuilder::GetDebugOldLayerFor(nsIFrame* aFrame, uint32_t aDisplayItemKe /* static */ Layer* FrameLayerBuilder::GetDebugSingleOldLayerForFrame(nsIFrame* aFrame) { - nsTArray* array = - reinterpret_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); + const nsTArray* array = + static_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); if (!array) { return nullptr; @@ -1704,117 +1953,149 @@ InvalidateEntirePaintedLayer(PaintedLayer* aLayer, const nsIFrame* aAnimatedGeom ResetScrollPositionForLayerPixelAlignment(aAnimatedGeometryRoot); } -already_AddRefed -ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoot, - const nsIFrame* aReferenceFrame, - const nsPoint& aTopLeft) +LayerManager::PaintedLayerCreationHint +ContainerState::GetLayerCreationHint(const nsIFrame* aAnimatedGeometryRoot) { - // We need a new painted layer - nsRefPtr layer; - PaintedDisplayItemLayerUserData* data; - bool layerRecycled = false; -#ifndef MOZ_WIDGET_ANDROID - bool didResetScrollPositionForLayerPixelAlignment = false; -#endif - // Check whether the layer will be scrollable. This is used as a hint to // influence whether tiled layers are used or not. - LayerManager::PaintedLayerCreationHint creationHint = LayerManager::NONE; - if (mParameters.mInLowPrecisionDisplayPort ) { - creationHint = LayerManager::SCROLLABLE; + if (mParameters.mInLowPrecisionDisplayPort) { + return LayerManager::SCROLLABLE; } nsIFrame* animatedGeometryRootParent = aAnimatedGeometryRoot->GetParent(); if (animatedGeometryRootParent && animatedGeometryRootParent->GetType() == nsGkAtoms::scrollFrame) { - creationHint = LayerManager::SCROLLABLE; + return LayerManager::SCROLLABLE; + } + return LayerManager::NONE; +} + +already_AddRefed +ContainerState::AttemptToRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoot, + nsDisplayItem* aItem, + const nsPoint& aTopLeft) +{ + Layer* oldLayer = mLayerBuilder->GetOldLayerFor(aItem); + if (!oldLayer || !oldLayer->AsPaintedLayer() || + !mPaintedLayersAvailableForRecycling.Contains(oldLayer->AsPaintedLayer())) { + return nullptr; } - if (mNextFreeRecycledPaintedLayer < mRecycledPaintedLayers.Length()) { - // Try to recycle a layer - layer = mRecycledPaintedLayers[mNextFreeRecycledPaintedLayer]; - ++mNextFreeRecycledPaintedLayer; + // Try to recycle a layer + nsRefPtr layer = oldLayer->AsPaintedLayer(); + mPaintedLayersAvailableForRecycling.RemoveEntry(layer); - // Check if the layer hint has changed and whether or not the layer should - // be recreated because of it. - if (mManager->IsOptimizedFor(layer->AsPaintedLayer(), creationHint)) { - layerRecycled = true; - - // Clear clip rect and mask layer so we don't accidentally stay clipped. - // We will reapply any necessary clipping. - layer->SetMaskLayer(nullptr); - layer->ClearExtraDumpInfo(); - - data = static_cast - (layer->GetUserData(&gPaintedDisplayItemLayerUserData)); - NS_ASSERTION(data, "Recycled PaintedLayers must have user data"); - - // This gets called on recycled PaintedLayers that are going to be in the - // final layer tree, so it's a convenient time to invalidate the - // content that changed where we don't know what PaintedLayer it belonged - // to, or if we need to invalidate the entire layer, we can do that. - // This needs to be done before we update the PaintedLayer to its new - // transform. See nsGfxScrollFrame::InvalidateInternal, where - // we ensure that mInvalidPaintedContent is updated according to the - // scroll position as of the most recent paint. - if (!FuzzyEqual(data->mXScale, mParameters.mXScale, 0.00001f) || - !FuzzyEqual(data->mYScale, mParameters.mYScale, 0.00001f) || - data->mAppUnitsPerDevPixel != mAppUnitsPerDevPixel) { -#ifdef MOZ_DUMP_PAINTING - if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) { - printf_stderr("Recycled layer %p changed scale\n", layer.get()); - } -#endif - InvalidateEntirePaintedLayer(layer, aAnimatedGeometryRoot, "recycled layer changed state"); -#ifndef MOZ_WIDGET_ANDROID - didResetScrollPositionForLayerPixelAlignment = true; -#endif - } - if (!data->mRegionToInvalidate.IsEmpty()) { -#ifdef MOZ_DUMP_PAINTING - if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) { - printf_stderr("Invalidating deleted frame content from layer %p\n", layer.get()); - } -#endif - layer->InvalidateRegion(data->mRegionToInvalidate); -#ifdef MOZ_DUMP_PAINTING - if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) { - nsAutoCString str; - AppendToString(str, data->mRegionToInvalidate); - printf_stderr("Invalidating layer %p: %s\n", layer.get(), str.get()); - } -#endif - data->mRegionToInvalidate.SetEmpty(); - } - - // We do not need to Invalidate these areas in the widget because we - // assume the caller of InvalidatePaintedLayerContents has ensured - // the area is invalidated in the widget. - } + // Check if the layer hint has changed and whether or not the layer should + // be recreated because of it. + if (!mManager->IsOptimizedFor(layer, GetLayerCreationHint(aAnimatedGeometryRoot))) { + return nullptr; } - if (!layerRecycled) { - // Create a new painted layer - layer = mManager->CreatePaintedLayerWithHint(creationHint); - if (!layer) - return nullptr; - // Mark this layer as being used for painting display items - data = new PaintedDisplayItemLayerUserData(); - layer->SetUserData(&gPaintedDisplayItemLayerUserData, data); - ResetScrollPositionForLayerPixelAlignment(aAnimatedGeometryRoot); -#ifndef MOZ_WIDGET_ANDROID + bool didResetScrollPositionForLayerPixelAlignment = false; + PaintedDisplayItemLayerUserData* data = + RecyclePaintedLayer(layer, aAnimatedGeometryRoot, + didResetScrollPositionForLayerPixelAlignment); + PreparePaintedLayerForUse(layer, data, aAnimatedGeometryRoot, aItem->ReferenceFrame(), + aTopLeft, + didResetScrollPositionForLayerPixelAlignment); + + return layer.forget(); +} + +already_AddRefed +ContainerState::CreatePaintedLayer(PaintedLayerData* aData) +{ + LayerManager::PaintedLayerCreationHint creationHint = + GetLayerCreationHint(aData->mAnimatedGeometryRoot); + + // Create a new painted layer + nsRefPtr layer = mManager->CreatePaintedLayerWithHint(creationHint); + if (!layer) { + return nullptr; + } + + // Mark this layer as being used for painting display items + PaintedDisplayItemLayerUserData* userData = new PaintedDisplayItemLayerUserData(); + layer->SetUserData(&gPaintedDisplayItemLayerUserData, userData); + ResetScrollPositionForLayerPixelAlignment(aData->mAnimatedGeometryRoot); + + PreparePaintedLayerForUse(layer, userData, aData->mAnimatedGeometryRoot, + aData->mReferenceFrame, + aData->mAnimatedGeometryRootOffset, true); + + return layer.forget(); +} + +PaintedDisplayItemLayerUserData* +ContainerState::RecyclePaintedLayer(PaintedLayer* aLayer, + const nsIFrame* aAnimatedGeometryRoot, + bool& didResetScrollPositionForLayerPixelAlignment) +{ + // Clear clip rect and mask layer so we don't accidentally stay clipped. + // We will reapply any necessary clipping. + aLayer->SetMaskLayer(nullptr); + aLayer->ClearExtraDumpInfo(); + + PaintedDisplayItemLayerUserData* data = + static_cast( + aLayer->GetUserData(&gPaintedDisplayItemLayerUserData)); + NS_ASSERTION(data, "Recycled PaintedLayers must have user data"); + + // This gets called on recycled PaintedLayers that are going to be in the + // final layer tree, so it's a convenient time to invalidate the + // content that changed where we don't know what PaintedLayer it belonged + // to, or if we need to invalidate the entire layer, we can do that. + // This needs to be done before we update the PaintedLayer to its new + // transform. See nsGfxScrollFrame::InvalidateInternal, where + // we ensure that mInvalidPaintedContent is updated according to the + // scroll position as of the most recent paint. + if (!FuzzyEqual(data->mXScale, mParameters.mXScale, 0.00001f) || + !FuzzyEqual(data->mYScale, mParameters.mYScale, 0.00001f) || + data->mAppUnitsPerDevPixel != mAppUnitsPerDevPixel) { +#ifdef MOZ_DUMP_PAINTING + if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) { + printf_stderr("Recycled layer %p changed scale\n", aLayer); + } +#endif + InvalidateEntirePaintedLayer(aLayer, aAnimatedGeometryRoot, "recycled layer changed state"); didResetScrollPositionForLayerPixelAlignment = true; -#endif } - data->mXScale = mParameters.mXScale; - data->mYScale = mParameters.mYScale; - data->mLastAnimatedGeometryRootOrigin = data->mAnimatedGeometryRootOrigin; - data->mAnimatedGeometryRootOrigin = aTopLeft; - data->mAppUnitsPerDevPixel = mAppUnitsPerDevPixel; - layer->SetAllowResidualTranslation(mParameters.AllowResidualTranslation()); + if (!data->mRegionToInvalidate.IsEmpty()) { +#ifdef MOZ_DUMP_PAINTING + if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) { + printf_stderr("Invalidating deleted frame content from layer %p\n", aLayer); + } +#endif + aLayer->InvalidateRegion(data->mRegionToInvalidate); +#ifdef MOZ_DUMP_PAINTING + if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) { + nsAutoCString str; + AppendToString(str, data->mRegionToInvalidate); + printf_stderr("Invalidating layer %p: %s\n", aLayer, str.get()); + } +#endif + data->mRegionToInvalidate.SetEmpty(); + } + return data; +} - mLayerBuilder->SavePreviousDataForLayer(layer, data->mMaskClipCount); +void +ContainerState::PreparePaintedLayerForUse(PaintedLayer* aLayer, + PaintedDisplayItemLayerUserData* aData, + const nsIFrame* aAnimatedGeometryRoot, + const nsIFrame* aReferenceFrame, + const nsPoint& aTopLeft, + bool didResetScrollPositionForLayerPixelAlignment) +{ + aData->mXScale = mParameters.mXScale; + aData->mYScale = mParameters.mYScale; + aData->mLastAnimatedGeometryRootOrigin = aData->mAnimatedGeometryRootOrigin; + aData->mAnimatedGeometryRootOrigin = aTopLeft; + aData->mAppUnitsPerDevPixel = mAppUnitsPerDevPixel; + aLayer->SetAllowResidualTranslation(mParameters.AllowResidualTranslation()); - // Set up transform so that 0,0 in the Painted layer corresponds to the + mLayerBuilder->SavePreviousDataForLayer(aLayer, aData->mMaskClipCount); + + // Set up transform so that 0,0 in the PaintedLayer corresponds to the // (pixel-snapped) top-left of the aAnimatedGeometryRoot. nsPoint offset = aAnimatedGeometryRoot->GetOffsetToCrossDoc(aReferenceFrame); nscoord appUnitsPerDevPixel = aAnimatedGeometryRoot->PresContext()->AppUnitsPerDevPixel(); @@ -1822,13 +2103,13 @@ ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoo NSAppUnitsToDoublePixels(offset.x, appUnitsPerDevPixel)*mParameters.mXScale, NSAppUnitsToDoublePixels(offset.y, appUnitsPerDevPixel)*mParameters.mYScale); // We call RoundToMatchResidual here so that the residual after rounding - // is close to data->mAnimatedGeometryRootPosition if possible. - nsIntPoint pixOffset(RoundToMatchResidual(scaledOffset.x, data->mAnimatedGeometryRootPosition.x), - RoundToMatchResidual(scaledOffset.y, data->mAnimatedGeometryRootPosition.y)); - data->mTranslation = pixOffset; + // is close to aData->mAnimatedGeometryRootPosition if possible. + nsIntPoint pixOffset(RoundToMatchResidual(scaledOffset.x, aData->mAnimatedGeometryRootPosition.x), + RoundToMatchResidual(scaledOffset.y, aData->mAnimatedGeometryRootPosition.y)); + aData->mTranslation = pixOffset; pixOffset += mParameters.mOffset; Matrix matrix = Matrix::Translation(pixOffset.x, pixOffset.y); - layer->SetBaseTransform(Matrix4x4::From2D(matrix)); + aLayer->SetBaseTransform(Matrix4x4::From2D(matrix)); // FIXME: Temporary workaround for bug 681192 and bug 724786. #ifndef MOZ_WIDGET_ANDROID @@ -1838,15 +2119,15 @@ ContainerState::CreateOrRecyclePaintedLayer(const nsIFrame* aAnimatedGeometryRoo // If it has changed, then we need to invalidate the entire layer since the // pixels in the layer buffer have the content at a (subpixel) offset // from what we need. - if (!animatedGeometryRootTopLeft.WithinEpsilonOf(data->mAnimatedGeometryRootPosition, SUBPIXEL_OFFSET_EPSILON)) { - data->mAnimatedGeometryRootPosition = animatedGeometryRootTopLeft; - InvalidateEntirePaintedLayer(layer, aAnimatedGeometryRoot, "subpixel offset"); + if (!animatedGeometryRootTopLeft.WithinEpsilonOf(aData->mAnimatedGeometryRootPosition, SUBPIXEL_OFFSET_EPSILON)) { + aData->mAnimatedGeometryRootPosition = animatedGeometryRootTopLeft; + InvalidateEntirePaintedLayer(aLayer, aAnimatedGeometryRoot, "subpixel offset"); } else if (didResetScrollPositionForLayerPixelAlignment) { - data->mAnimatedGeometryRootPosition = animatedGeometryRootTopLeft; + aData->mAnimatedGeometryRootPosition = animatedGeometryRootTopLeft; } +#else + unused << didResetScrollPositionForLayerPixelAlignment; #endif - - return layer.forget(); } #if defined(DEBUG) || defined(MOZ_DUMP_PAINTING) @@ -1891,7 +2172,9 @@ SetOuterVisibleRegion(Layer* aLayer, nsIntRegion* aOuterVisibleRegion, // for the layer, so it doesn't really matter what we do here Rect outerVisible(outerRect.x, outerRect.y, outerRect.width, outerRect.height); transform.Invert(); - gfxRect layerVisible = ThebesRect(transform.ProjectRectBounds(outerVisible)); + + Rect layerContentsVisible(-float(INT32_MAX) / 2, -float(INT32_MAX) / 2, + float(INT32_MAX), float(INT32_MAX)); if (aLayerContentsVisibleRect) { NS_ASSERTION(aLayerContentsVisibleRect->width >= 0 && aLayerContentsVisibleRect->height >= 0, @@ -1899,11 +2182,11 @@ SetOuterVisibleRegion(Layer* aLayer, nsIntRegion* aOuterVisibleRegion, // restrict to aLayerContentsVisibleRect before call GfxRectToIntRect, // in case layerVisible is extremely large (as it can be when // projecting through the inverse of a 3D transform) - gfxRect layerContentsVisible( + layerContentsVisible = Rect( aLayerContentsVisibleRect->x, aLayerContentsVisibleRect->y, aLayerContentsVisibleRect->width, aLayerContentsVisibleRect->height); - layerVisible.IntersectRect(layerVisible, layerContentsVisible); } + gfxRect layerVisible = ThebesRect(transform.ProjectRectBounds(outerVisible, layerContentsVisible)); layerVisible.RoundOut(); nsIntRect visRect; if (gfxUtils::GfxRectToIntRect(layerVisible, &visRect)) { @@ -1927,88 +2210,135 @@ ContainerState::SetOuterVisibleRegionForLayer(Layer* aLayer, } nscolor -ContainerState::FindOpaqueBackgroundColorFor(const nsIntRegion& aTargetVisibleRegion, - int32_t aUnderPaintedLayerIndex) +ContainerState::FindOpaqueBackgroundColorInLayer(const PaintedLayerData* aData, + const nsIntRect& aRect, + bool* aOutIntersectsLayer) const { - for (int32_t i = aUnderPaintedLayerIndex - 1; i >= 0; --i) { - PaintedLayerData* candidate = mPaintedLayerDataStack[i]; + *aOutIntersectsLayer = true; + + // Scan the candidate's display items. + nsIntRect deviceRect = aRect; + nsRect appUnitRect = deviceRect.ToAppUnits(mAppUnitsPerDevPixel); + appUnitRect.ScaleInverseRoundOut(mParameters.mXScale, mParameters.mYScale); + + for (auto& assignedItem : Reversed(aData->mAssignedDisplayItems)) { + nsDisplayItem* item = assignedItem.mItem; + bool snap; + nsRect bounds = item->GetBounds(mBuilder, &snap); + if (snap && mSnappingEnabled) { + nsIntRect snappedBounds = ScaleToNearestPixels(bounds); + if (!snappedBounds.Intersects(deviceRect)) + continue; + + if (!snappedBounds.Contains(deviceRect)) + return NS_RGBA(0,0,0,0); + + } else { + // The layer's visible rect is already (close enough to) pixel + // aligned, so no need to round out and in here. + if (!bounds.Intersects(appUnitRect)) + continue; + + if (!bounds.Contains(appUnitRect)) + return NS_RGBA(0,0,0,0); + } + + if (item->IsInvisibleInRect(appUnitRect)) { + continue; + } + + if (assignedItem.mClip.IsRectAffectedByClip(deviceRect, + mParameters.mXScale, + mParameters.mYScale, + mAppUnitsPerDevPixel)) { + return NS_RGBA(0,0,0,0); + } + + nscolor color; + if (item->IsUniform(mBuilder, &color) && NS_GET_A(color) == 255) + return color; + + return NS_RGBA(0,0,0,0); + } + + *aOutIntersectsLayer = false; + return NS_RGBA(0,0,0,0); +} + +nscolor +PaintedLayerDataNode::FindOpaqueBackgroundColor(const nsIntRegion& aTargetVisibleRegion, + int32_t aUnderIndex) const +{ + if (aUnderIndex == ABOVE_TOP) { + aUnderIndex = mPaintedLayerDataStack.Length(); + } + for (int32_t i = aUnderIndex - 1; i >= 0; --i) { + const PaintedLayerData* candidate = &mPaintedLayerDataStack[i]; if (candidate->VisibleAboveRegionIntersects(aTargetVisibleRegion)) { // Some non-PaintedLayer content between target and candidate; this is // hopeless return NS_RGBA(0,0,0,0); } - nsIntRegion intersection; - intersection.And(candidate->mVisibleRegion, aTargetVisibleRegion); - if (intersection.IsEmpty()) { + if (!candidate->VisibleRegionIntersects(aTargetVisibleRegion)) { // The layer doesn't intersect our target, ignore it and move on continue; } - // The candidate intersects our target. If any layer has a solid-color - // area behind our target, this must be it. Scan its display items. - nsIntRect deviceRect = aTargetVisibleRegion.GetBounds(); - nsRect appUnitRect = deviceRect.ToAppUnits(mAppUnitsPerDevPixel); - appUnitRect.ScaleInverseRoundOut(mParameters.mXScale, mParameters.mYScale); - - FrameLayerBuilder::PaintedLayerItemsEntry* entry = - mLayerBuilder->GetPaintedLayerItemsEntry(candidate->mLayer); - NS_ASSERTION(entry, "Must know about this layer!"); - for (int32_t j = entry->mItems.Length() - 1; j >= 0; --j) { - nsDisplayItem* item = entry->mItems[j].mItem; - bool snap; - nsRect bounds = item->GetBounds(mBuilder, &snap); - if (snap && mSnappingEnabled) { - nsIntRect snappedBounds = ScaleToNearestPixels(bounds); - if (!snappedBounds.Intersects(deviceRect)) - continue; - - if (!snappedBounds.Contains(deviceRect)) - return NS_RGBA(0,0,0,0); - - } else { - // The layer's visible rect is already (close enough to) pixel - // aligned, so no need to round out and in here. - if (!bounds.Intersects(appUnitRect)) - continue; - - if (!bounds.Contains(appUnitRect)) - return NS_RGBA(0,0,0,0); - } - - if (item->IsInvisibleInRect(appUnitRect)) { - continue; - } - - if (item->GetClip().IsRectAffectedByClip(deviceRect, - mParameters.mXScale, - mParameters.mYScale, - mAppUnitsPerDevPixel)) { - return NS_RGBA(0,0,0,0); - } - - nscolor color; - if (item->IsUniform(mBuilder, &color) && NS_GET_A(color) == 255) - return color; - - return NS_RGBA(0,0,0,0); + bool intersectsLayer = true; + nsIntRect rect = aTargetVisibleRegion.GetBounds(); + nscolor color = mTree.ContState().FindOpaqueBackgroundColorInLayer( + candidate, rect, &intersectsLayer); + if (!intersectsLayer) { + continue; } + return color; } - if (mVisibleAboveBackgroundRegion.Intersects(aTargetVisibleRegion)) { - // Some non-Thebes content is between container background and target. + if (mAllDrawingAboveBackground || + !mVisibleAboveBackgroundRegion.Intersect(aTargetVisibleRegion).IsEmpty()) { + // Some non-PaintedLayer content is between this node's background and target. return NS_RGBA(0,0,0,0); } - return mContainerUniformBackgroundColor; + return FindOpaqueBackgroundColorInParentNode(); +} + +nscolor +PaintedLayerDataNode::FindOpaqueBackgroundColorCoveringEverything() const +{ + if (!mPaintedLayerDataStack.IsEmpty() || + mAllDrawingAboveBackground || + !mVisibleAboveBackgroundRegion.IsEmpty()) { + return NS_RGBA(0,0,0,0); + } + return FindOpaqueBackgroundColorInParentNode(); +} + +nscolor +PaintedLayerDataNode::FindOpaqueBackgroundColorInParentNode() const +{ + if (mParent) { + if (mHasClip) { + // Check whether our parent node has uniform content behind our whole + // clip. + // There's one tricky case here: If our parent node is also a scrollable, + // and is currently scrolled in such a way that this inner one is + // clipped by it, then it's not really clear how we should determine + // whether we have a uniform background in the parent: There might be + // non-uniform content in the parts that our scroll port covers in the + // parent and that are currently outside the parent's clip. + // For now, we'll fail to pull a background color in that case. + return mParent->FindOpaqueBackgroundColor(mClipRect); + } + return mParent->FindOpaqueBackgroundColorCoveringEverything(); + } + // We are the root. + return mTree.UniformBackgroundColor(); } void PaintedLayerData::UpdateCommonClipCount( const DisplayItemClip& aCurrentClip) { - if (!mLayer->Manager()->IsWidgetLayerManager()) { - return; - } - if (mCommonClipCount >= 0) { mCommonClipCount = mItemClip.GetCommonRoundedRectCount(aCurrentClip, mCommonClipCount); } else { @@ -2027,6 +2357,326 @@ PaintedLayerData::CanOptimizeImageLayer(nsDisplayListBuilder* aBuilder) return mImage->GetContainer(mLayer->Manager(), aBuilder); } +PaintedLayerDataNode::PaintedLayerDataNode(PaintedLayerDataTree& aTree, + PaintedLayerDataNode* aParent, + const nsIFrame* aAnimatedGeometryRoot) + : mTree(aTree) + , mParent(aParent) + , mAnimatedGeometryRoot(aAnimatedGeometryRoot) + , mAllDrawingAboveBackground(false) +{ + MOZ_ASSERT(nsLayoutUtils::IsAncestorFrameCrossDoc(mTree.Builder()->RootReferenceFrame(), mAnimatedGeometryRoot)); + mHasClip = mTree.IsClippedWithRespectToParentAnimatedGeometryRoot(mAnimatedGeometryRoot, &mClipRect); +} + +PaintedLayerDataNode::~PaintedLayerDataNode() +{ + MOZ_ASSERT(mPaintedLayerDataStack.IsEmpty()); + MOZ_ASSERT(mChildren.IsEmpty()); +} + +PaintedLayerDataNode* +PaintedLayerDataNode::AddChildNodeFor(const nsIFrame* aAnimatedGeometryRoot) +{ + MOZ_ASSERT(mTree.GetParentAnimatedGeometryRoot(aAnimatedGeometryRoot) == mAnimatedGeometryRoot); + UniquePtr child = + MakeUnique(mTree, this, aAnimatedGeometryRoot); + mChildren.AppendElement(Move(child)); + return mChildren.LastElement().get(); +} + +template +PaintedLayerData* +PaintedLayerDataNode::FindPaintedLayerFor(const nsIntRect& aVisibleRect, + NewPaintedLayerCallbackType aNewPaintedLayerCallback) +{ + if (!mPaintedLayerDataStack.IsEmpty()) { + if (mPaintedLayerDataStack[0].mSingleItemFixedToViewport) { + MOZ_ASSERT(mPaintedLayerDataStack.Length() == 1); + SetAllDrawingAbove(); + MOZ_ASSERT(mPaintedLayerDataStack.IsEmpty()); + } else { + PaintedLayerData* lowestUsableLayer = nullptr; + for (auto& data : Reversed(mPaintedLayerDataStack)) { + if (data.VisibleAboveRegionIntersects(aVisibleRect)) { + break; + } + MOZ_ASSERT(!data.mSingleItemFixedToViewport); + lowestUsableLayer = &data; + if (data.VisibleRegionIntersects(aVisibleRect)) { + break; + } + } + if (lowestUsableLayer) { + return lowestUsableLayer; + } + } + } + return mPaintedLayerDataStack.AppendElement(aNewPaintedLayerCallback()); +} + +void +PaintedLayerDataNode::FinishChildrenIntersecting(const nsIntRect& aRect) +{ + for (int32_t i = mChildren.Length() - 1; i >= 0; i--) { + if (mChildren[i]->Intersects(aRect)) { + mChildren[i]->Finish(true); + mChildren.RemoveElementAt(i); + } + } +} + +void +PaintedLayerDataNode::FinishAllChildren(bool aThisNodeNeedsAccurateVisibleAboveRegion) +{ + for (int32_t i = mChildren.Length() - 1; i >= 0; i--) { + mChildren[i]->Finish(aThisNodeNeedsAccurateVisibleAboveRegion); + } + mChildren.Clear(); +} + +void +PaintedLayerDataNode::Finish(bool aParentNeedsAccurateVisibleAboveRegion) +{ + // Skip "visible above region" maintenance, because this node is going away. + FinishAllChildren(false); + + PopAllPaintedLayerData(); + + if (mParent && aParentNeedsAccurateVisibleAboveRegion) { + if (mHasClip) { + mParent->AddToVisibleAboveRegion(mClipRect); + } else { + mParent->SetAllDrawingAbove(); + } + } + mTree.NodeWasFinished(mAnimatedGeometryRoot); +} + +void +PaintedLayerDataNode::AddToVisibleAboveRegion(const nsIntRect& aRect) +{ + nsIntRegion& visibleAboveRegion = mPaintedLayerDataStack.IsEmpty() + ? mVisibleAboveBackgroundRegion + : mPaintedLayerDataStack.LastElement().mVisibleAboveRegion; + visibleAboveRegion.Or(visibleAboveRegion, aRect); + visibleAboveRegion.SimplifyOutward(8); +} + +void +PaintedLayerDataNode::SetAllDrawingAbove() +{ + PopAllPaintedLayerData(); + mAllDrawingAboveBackground = true; + mVisibleAboveBackgroundRegion.SetEmpty(); +} + +void +PaintedLayerDataNode::PopPaintedLayerData() +{ + MOZ_ASSERT(!mPaintedLayerDataStack.IsEmpty()); + size_t lastIndex = mPaintedLayerDataStack.Length() - 1; + PaintedLayerData& data = mPaintedLayerDataStack[lastIndex]; + mTree.ContState().FinishPaintedLayerData(data, [this, &data, lastIndex]() { + return this->FindOpaqueBackgroundColor(data.mVisibleRegion, lastIndex); + }); + mPaintedLayerDataStack.RemoveElementAt(lastIndex); +} + +void +PaintedLayerDataNode::PopAllPaintedLayerData() +{ + while (!mPaintedLayerDataStack.IsEmpty()) { + PopPaintedLayerData(); + } +} + +nsDisplayListBuilder* +PaintedLayerDataTree::Builder() const +{ + return mContainerState.Builder(); +} + +const nsIFrame* +PaintedLayerDataTree::GetParentAnimatedGeometryRoot(const nsIFrame* aAnimatedGeometryRoot) +{ + MOZ_ASSERT(aAnimatedGeometryRoot); + MOZ_ASSERT(nsLayoutUtils::IsAncestorFrameCrossDoc(Builder()->RootReferenceFrame(), aAnimatedGeometryRoot)); + + if (aAnimatedGeometryRoot == Builder()->RootReferenceFrame()) { + return nullptr; + } + + nsIFrame* agr = Builder()->FindAnimatedGeometryRootFor( + const_cast(aAnimatedGeometryRoot), Builder()->RootReferenceFrame()); + MOZ_ASSERT_IF(agr, nsLayoutUtils::IsAncestorFrameCrossDoc(Builder()->RootReferenceFrame(), agr)); + if (agr != aAnimatedGeometryRoot) { + return agr; + } + // aAnimatedGeometryRoot is its own animated geometry root. + // Find the animated geometry root for its cross-doc parent frame. + nsIFrame* parent = nsLayoutUtils::GetCrossDocParentFrame(aAnimatedGeometryRoot); + if (!parent) { + return nullptr; + } + return Builder()->FindAnimatedGeometryRootFor(parent, Builder()->RootReferenceFrame()); +} + +void +PaintedLayerDataTree::Finish() +{ + if (mRoot) { + mRoot->Finish(false); + } + MOZ_ASSERT(mNodes.Count() == 0); + mRoot = nullptr; +} + +void +PaintedLayerDataTree::NodeWasFinished(const nsIFrame* aAnimatedGeometryRoot) +{ + mNodes.Remove(aAnimatedGeometryRoot); +} + +void +PaintedLayerDataTree::AddingOwnLayer(const nsIFrame* aAnimatedGeometryRoot, + const nsIntRect* aRect, + nscolor* aOutUniformBackgroundColor) +{ + FinishPotentiallyIntersectingNodes(aAnimatedGeometryRoot, aRect); + PaintedLayerDataNode* node = EnsureNodeFor(aAnimatedGeometryRoot); + if (aRect) { + if (aOutUniformBackgroundColor) { + *aOutUniformBackgroundColor = node->FindOpaqueBackgroundColor(*aRect); + } + node->AddToVisibleAboveRegion(*aRect); + } else { + if (aOutUniformBackgroundColor) { + *aOutUniformBackgroundColor = node->FindOpaqueBackgroundColorCoveringEverything(); + } + node->SetAllDrawingAbove(); + } +} + +template +PaintedLayerData* +PaintedLayerDataTree::FindPaintedLayerFor(const nsIFrame* aAnimatedGeometryRoot, + const nsIntRect& aVisibleRect, + bool aShouldFixToViewport, + NewPaintedLayerCallbackType aNewPaintedLayerCallback) +{ + const nsIntRect* bounds = aShouldFixToViewport ? nullptr : &aVisibleRect; + FinishPotentiallyIntersectingNodes(aAnimatedGeometryRoot, bounds); + PaintedLayerDataNode* node = EnsureNodeFor(aAnimatedGeometryRoot); + if (aShouldFixToViewport) { + node->SetAllDrawingAbove(); + } + return node->FindPaintedLayerFor(aVisibleRect, aNewPaintedLayerCallback); +} + +void +PaintedLayerDataTree::FinishPotentiallyIntersectingNodes(const nsIFrame* aAnimatedGeometryRoot, + const nsIntRect* aRect) +{ + const nsIFrame* ancestorThatIsChildOfCommonAncestor = nullptr; + PaintedLayerDataNode* ancestorNode = + FindNodeForAncestorAnimatedGeometryRoot(aAnimatedGeometryRoot, + &ancestorThatIsChildOfCommonAncestor); + if (!ancestorNode) { + // None of our ancestors are in the tree. This should only happen if this + // is the very first item we're looking at. + MOZ_ASSERT(!mRoot); + return; + } + + if (ancestorNode->AnimatedGeometryRoot() == aAnimatedGeometryRoot) { + // aAnimatedGeometryRoot already has a node in the tree. + // This is the common case. + MOZ_ASSERT(!ancestorThatIsChildOfCommonAncestor); + if (aRect) { + ancestorNode->FinishChildrenIntersecting(*aRect); + } else { + ancestorNode->FinishAllChildren(); + } + return; + } + + // We have found an existing ancestor, but it's a proper ancestor of our + // animated geometry root. + // ancestorThatIsChildOfCommonAncestor is the last animated geometry root + // encountered on the way up from aAnimatedGeometryRoot to ancestorNode. + MOZ_ASSERT(ancestorThatIsChildOfCommonAncestor); + MOZ_ASSERT(nsLayoutUtils::IsAncestorFrameCrossDoc(ancestorThatIsChildOfCommonAncestor, aAnimatedGeometryRoot)); + MOZ_ASSERT(GetParentAnimatedGeometryRoot(ancestorThatIsChildOfCommonAncestor) == ancestorNode->AnimatedGeometryRoot()); + + // ancestorThatIsChildOfCommonAncestor is not in the tree yet! + MOZ_ASSERT(!mNodes.Get(ancestorThatIsChildOfCommonAncestor)); + + // We're about to add a node for ancestorThatIsChildOfCommonAncestor, so we + // finish all intersecting siblings. + nsIntRect clip; + if (IsClippedWithRespectToParentAnimatedGeometryRoot(ancestorThatIsChildOfCommonAncestor, &clip)) { + ancestorNode->FinishChildrenIntersecting(clip); + } else { + ancestorNode->FinishAllChildren(); + } +} + +PaintedLayerDataNode* +PaintedLayerDataTree::EnsureNodeFor(const nsIFrame* aAnimatedGeometryRoot) +{ + MOZ_ASSERT(aAnimatedGeometryRoot); + PaintedLayerDataNode* node = mNodes.Get(aAnimatedGeometryRoot); + if (node) { + return node; + } + + const nsIFrame* parentAnimatedGeometryRoot = GetParentAnimatedGeometryRoot(aAnimatedGeometryRoot); + if (!parentAnimatedGeometryRoot) { + MOZ_ASSERT(!mRoot); + MOZ_ASSERT(aAnimatedGeometryRoot == Builder()->RootReferenceFrame()); + mRoot = MakeUnique(*this, nullptr, aAnimatedGeometryRoot); + node = mRoot.get(); + } else { + PaintedLayerDataNode* parentNode = EnsureNodeFor(parentAnimatedGeometryRoot); + MOZ_ASSERT(parentNode); + node = parentNode->AddChildNodeFor(aAnimatedGeometryRoot); + } + MOZ_ASSERT(node); + mNodes.Put(aAnimatedGeometryRoot, node); + return node; +} + +bool +PaintedLayerDataTree::IsClippedWithRespectToParentAnimatedGeometryRoot(const nsIFrame* aAnimatedGeometryRoot, + nsIntRect* aOutClip) +{ + nsIScrollableFrame* scrollableFrame = nsLayoutUtils::GetScrollableFrameFor(aAnimatedGeometryRoot); + if (!scrollableFrame) { + return false; + } + nsIFrame* scrollFrame = do_QueryFrame(scrollableFrame); + nsRect scrollPort = scrollableFrame->GetScrollPortRect() + Builder()->ToReferenceFrame(scrollFrame); + *aOutClip = mContainerState.ScaleToNearestPixels(scrollPort); + return true; +} + +PaintedLayerDataNode* +PaintedLayerDataTree::FindNodeForAncestorAnimatedGeometryRoot(const nsIFrame* aAnimatedGeometryRoot, + const nsIFrame** aOutAncestorChild) +{ + if (!aAnimatedGeometryRoot) { + return nullptr; + } + PaintedLayerDataNode* node = mNodes.Get(aAnimatedGeometryRoot); + if (node) { + return node; + } + *aOutAncestorChild = aAnimatedGeometryRoot; + return FindNodeForAncestorAnimatedGeometryRoot( + GetParentAnimatedGeometryRoot(aAnimatedGeometryRoot), aOutAncestorChild); +} + const nsIFrame* ContainerState::FindFixedPosFrameForLayerData(const nsIFrame* aAnimatedGeometryRoot, bool aDisplayItemFixedToViewport) @@ -2131,15 +2781,37 @@ static int32_t FindIndexOfLayerIn(nsTArray& aArray, } #endif -void -ContainerState::PopPaintedLayerData() -{ - NS_ASSERTION(!mPaintedLayerDataStack.IsEmpty(), "Can't pop"); - int32_t lastIndex = mPaintedLayerDataStack.Length() - 1; - PaintedLayerData* data = mPaintedLayerDataStack[lastIndex]; +template +void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueBackgroundColorCallbackType aFindOpaqueBackgroundColor) +{ + PaintedLayerData* data = &aData; + + if (!data->mLayer) { + // No layer was recycled, so we create a new one. + nsRefPtr paintedLayer = CreatePaintedLayer(data); + data->mLayer = paintedLayer; + + NS_ASSERTION(FindIndexOfLayerIn(mNewChildLayers, paintedLayer) < 0, + "Layer already in list???"); + mNewChildLayers[data->mNewChildLayersIndex].mLayer = paintedLayer.forget(); + } + + MOZ_ASSERT(mHoistedItems.IsEmpty()); + + for (auto& item : data->mAssignedDisplayItems) { + MOZ_ASSERT(item.mItem->GetType() != nsDisplayItem::TYPE_LAYER_EVENT_REGIONS); + + InvalidateForLayerChange(item.mItem, data->mLayer); + mLayerBuilder->AddPaintedDisplayItem(data, item.mItem, item.mClip, + *this, item.mLayerState, + data->mAnimatedGeometryRootOffset); + } NewLayerEntry* newLayerEntry = &mNewChildLayers[data->mNewChildLayersIndex]; + newLayerEntry->mScrollInfoItems.SwapElements(mHoistedItems); + + nsRefPtr layer; nsRefPtr imageContainer = data->CanOptimizeImageLayer(mBuilder); @@ -2155,15 +2827,15 @@ ContainerState::PopPaintedLayerData() if (imageContainer) { nsRefPtr imageLayer = CreateOrRecycleImageLayer(data->mLayer); imageLayer->SetContainer(imageContainer); - data->mImage->ConfigureLayer(imageLayer, mParameters.mOffset); + data->mImage->ConfigureLayer(imageLayer, mParameters); imageLayer->SetPostScale(mParameters.mXScale, mParameters.mYScale); if (data->mItemClip.HasClip()) { - nsIntRect clip = ScaleToNearestPixels(data->mItemClip.GetClipRect()); - clip.MoveBy(mParameters.mOffset); - imageLayer->SetClipRect(&clip); + ParentLayerIntRect clip = ViewAs(ScaleToNearestPixels(data->mItemClip.GetClipRect())); + clip.MoveBy(ViewAs(mParameters.mOffset)); + imageLayer->SetClipRect(Some(clip)); } else { - imageLayer->SetClipRect(nullptr); + imageLayer->SetClipRect(Nothing()); } layer = imageLayer; mLayerBuilder->StoreOptimizedLayerForFrame(data->mImage, @@ -2180,7 +2852,7 @@ ContainerState::PopPaintedLayerData() nsIntRect visibleRect = data->mVisibleRegion.GetBounds(); visibleRect.MoveBy(-GetTranslationForPaintedLayer(data->mLayer)); colorLayer->SetBounds(visibleRect); - colorLayer->SetClipRect(nullptr); + colorLayer->SetClipRect(Nothing()); layer = colorLayer; FLB_LOG_PAINTED_LAYER_DECISION(data, " Selected color layer=%p\n", layer.get()); @@ -2199,15 +2871,15 @@ ContainerState::PopPaintedLayerData() // Hide the PaintedLayer. We leave it in the layer tree so that we // can find and recycle it later. - nsIntRect emptyRect; - data->mLayer->SetClipRect(&emptyRect); + ParentLayerIntRect emptyRect; + data->mLayer->SetClipRect(Some(emptyRect)); data->mLayer->SetVisibleRegion(nsIntRegion()); data->mLayer->InvalidateRegion(data->mLayer->GetValidRegion().GetBounds()); data->mLayer->SetEventRegions(EventRegions()); } else { layer = data->mLayer; imageContainer = nullptr; - layer->SetClipRect(nullptr); + layer->SetClipRect(Nothing()); FLB_LOG_PAINTED_LAYER_DECISION(data, " Selected painted layer=%p\n", layer.get()); } @@ -2225,10 +2897,12 @@ ContainerState::PopPaintedLayerData() layer->SetLayerBounds(layerBounds); #ifdef MOZ_DUMP_PAINTING - if (PaintedLayerData* containingPld = mLayerBuilder->GetContainingPaintedLayerData()) { - containingPld->mLayer->AddExtraDumpInfo(nsCString(data->mLog)); - } else { - layer->AddExtraDumpInfo(nsCString(data->mLog)); + if (!data->mLog.IsEmpty()) { + if (PaintedLayerData* containingPld = mLayerBuilder->GetContainingPaintedLayerData()) { + containingPld->mLayer->AddExtraDumpInfo(nsCString(data->mLog)); + } else { + layer->AddExtraDumpInfo(nsCString(data->mLog)); + } } #endif @@ -2241,7 +2915,7 @@ ContainerState::PopPaintedLayerData() if (layer == data->mLayer) { nscolor backgroundColor = NS_RGBA(0,0,0,0); if (!isOpaque) { - backgroundColor = FindOpaqueBackgroundColorFor(data->mVisibleRegion, lastIndex); + backgroundColor = aFindOpaqueBackgroundColor(); if (NS_GET_A(backgroundColor) == 255) { isOpaque = true; } @@ -2369,16 +3043,6 @@ ContainerState::PopPaintedLayerData() layer->SetEventRegions(regions); } - - // Since we're going to pop off the last PaintedLayerData, the - // mVisibleAboveRegion of the second-to-last item will need to include - // the regions of the last item. If we're emptying the PaintedLayerDataStack, - // we instead need to accumulate the regions into the container's - // mVisibleAboveBackgroundRegion. - UpdateVisibleAboveRegionOnPop(data, - lastIndex > 0 ? mPaintedLayerDataStack[lastIndex - 1].get() : nullptr); - - mPaintedLayerDataStack.RemoveElementAt(lastIndex); } static bool @@ -2405,7 +3069,8 @@ PaintedLayerData::Accumulate(ContainerState* aState, nsDisplayItem* aItem, const nsIntRegion& aClippedOpaqueRegion, const nsIntRect& aVisibleRect, - const DisplayItemClip& aClip) + const DisplayItemClip& aClip, + LayerState aLayerState) { FLB_LOG_PAINTED_LAYER_DECISION(this, "Accumulating dp=%s(%p), f=%p against pld=%p\n", aItem->Name(), aItem, aItem->Frame(), this); @@ -2426,6 +3091,8 @@ PaintedLayerData::Accumulate(ContainerState* aState, bool clipMatches = mItemClip == aClip; mItemClip = aClip; + mAssignedDisplayItems.AppendElement(AssignedDisplayItem(aItem, aClip, aLayerState)); + if (!mIsSolidColorInVisibleRegion && mOpaqueRegion.Contains(aVisibleRect) && mVisibleRegion.Contains(aVisibleRect) && !mImage) { // A very common case! Most pages have a PaintedLayer with the page @@ -2538,117 +3205,32 @@ PaintedLayerData::Accumulate(ContainerState* aState, } } -bool -ContainerState::HasAsyncScrollableGeometryInContainer(const nsIFrame* aAnimatedGeometryRoot) +PaintedLayerData +ContainerState::NewPaintedLayerData(nsDisplayItem* aItem, + const nsIntRect& aVisibleRect, + const nsIFrame* aAnimatedGeometryRoot, + const nsPoint& aTopLeft, + bool aShouldFixToViewport) { - const nsIFrame* f = aAnimatedGeometryRoot; - while (f) { - if (nsLayoutUtils::GetScrollableFrameFor(f) && - nsLayoutUtils::GetDisplayPort(f->GetContent(), nullptr)) { - return true; - } - if (f == mContainerAnimatedGeometryRoot) { - break; - } - nsIFrame* fParent = nsLayoutUtils::GetCrossDocParentFrame(f); - if (!fParent) { - break; - } - f = nsLayoutUtils::GetAnimatedGeometryRootForFrame( - this->mBuilder, fParent, mContainerAnimatedGeometryRoot); - } - return false; -} + PaintedLayerData data; + data.mAnimatedGeometryRoot = aAnimatedGeometryRoot; + data.mAnimatedGeometryRootOffset = aTopLeft; + data.mFixedPosFrameForLayerData = + FindFixedPosFrameForLayerData(aAnimatedGeometryRoot, aShouldFixToViewport); + data.mReferenceFrame = aItem->ReferenceFrame(); + data.mSingleItemFixedToViewport = aShouldFixToViewport; -PaintedLayerData* -ContainerState::FindPaintedLayerFor(nsDisplayItem* aItem, - const nsIntRect& aVisibleRect, - const nsIFrame* aAnimatedGeometryRoot, - const nsPoint& aTopLeft, - bool aShouldFixToViewport) -{ - int32_t i; - int32_t lowestUsableLayerWithScrolledRoot = -1; - int32_t topmostLayerWithScrolledRoot = -1; - for (i = mPaintedLayerDataStack.Length() - 1; i >= 0; --i) { - // Don't let should-fix-to-viewport items share a layer with any other items. - if (aShouldFixToViewport) { - ++i; - break; - } - PaintedLayerData* data = mPaintedLayerDataStack[i]; - // Give up if there is content visible above (in z-order) this layer that - // intersects aItem's visible region; aItem must be placed in a - // layer above this layer. - if (data->VisibleAboveRegionIntersects(aVisibleRect)) { - ++i; - break; - } - // If the animated scrolled roots are the same and we can share this layer - // with the item, note this as a usable layer. - if (data->mAnimatedGeometryRoot == aAnimatedGeometryRoot && - !data->mSingleItemFixedToViewport) { - lowestUsableLayerWithScrolledRoot = i; - if (topmostLayerWithScrolledRoot < 0) { - topmostLayerWithScrolledRoot = i; - } - } - // If the layer's visible region intersects the item, stop now since no - // lower layer will be usable. Do the same if the layer is subject to - // async transforms, since we don't know where it will really be drawn. - if (data->VisibleRegionIntersects(aVisibleRect)) - break; - } - if (topmostLayerWithScrolledRoot < 0) { - --i; - for (; i >= 0; --i) { - PaintedLayerData* data = mPaintedLayerDataStack[i]; - if (data->mAnimatedGeometryRoot == aAnimatedGeometryRoot) { - topmostLayerWithScrolledRoot = i; - break; - } - } - } + data.mNewChildLayersIndex = mNewChildLayers.Length(); + NewLayerEntry* newLayerEntry = mNewChildLayers.AppendElement(); + newLayerEntry->mAnimatedGeometryRoot = aAnimatedGeometryRoot; + newLayerEntry->mFixedPosFrameForLayerData = data.mFixedPosFrameForLayerData; + // newLayerEntry->mOpaqueRegion is filled in later from + // paintedLayerData->mOpaqueRegion, if necessary. - if (topmostLayerWithScrolledRoot >= 0) { - while (uint32_t(topmostLayerWithScrolledRoot + 1) < mPaintedLayerDataStack.Length()) { - PopPaintedLayerData(); - } - } + // Allocate another entry for this layer's optimization to ColorLayer/ImageLayer + mNewChildLayers.AppendElement(); - PaintedLayerData* paintedLayerData = nullptr; - if (lowestUsableLayerWithScrolledRoot < 0) { - nsRefPtr layer = - CreateOrRecyclePaintedLayer(aAnimatedGeometryRoot, aItem->ReferenceFrame(), aTopLeft); - - paintedLayerData = new PaintedLayerData(); - mPaintedLayerDataStack.AppendElement(paintedLayerData); - paintedLayerData->mLayer = layer; - paintedLayerData->mAnimatedGeometryRoot = aAnimatedGeometryRoot; - paintedLayerData->mFixedPosFrameForLayerData = - FindFixedPosFrameForLayerData(aAnimatedGeometryRoot, aShouldFixToViewport); - paintedLayerData->mIsAsyncScrollable = - HasAsyncScrollableGeometryInContainer(aAnimatedGeometryRoot); - paintedLayerData->mReferenceFrame = aItem->ReferenceFrame(); - paintedLayerData->mSingleItemFixedToViewport = aShouldFixToViewport; - - NS_ASSERTION(FindIndexOfLayerIn(mNewChildLayers, layer) < 0, - "Layer already in list???"); - paintedLayerData->mNewChildLayersIndex = mNewChildLayers.Length(); - NewLayerEntry* newLayerEntry = mNewChildLayers.AppendElement(); - newLayerEntry->mLayer = layer.forget(); - newLayerEntry->mAnimatedGeometryRoot = aAnimatedGeometryRoot; - newLayerEntry->mFixedPosFrameForLayerData = paintedLayerData->mFixedPosFrameForLayerData; - // newLayerEntry->mOpaqueRegion is filled in later from - // paintedLayerData->mOpaqueRegion, if necessary. - - // Allocate another entry for this layer's optimization to ColorLayer/ImageLayer - mNewChildLayers.AppendElement(); - } else { - paintedLayerData = mPaintedLayerDataStack[lowestUsableLayerWithScrolledRoot]; - } - - return paintedLayerData; + return data; } #ifdef MOZ_DUMP_PAINTING @@ -2828,51 +3410,6 @@ ContainerState::ComputeOpaqueRect(nsDisplayItem* aItem, return opaquePixels; } -void -ContainerState::UpdateVisibleAboveRegionForNewItem(const nsIntRect& aVisibleRect, - bool aCanMoveFreely, - const nsIntRect* aClipRectIfAny) -{ - PaintedLayerData* data = GetTopPaintedLayerData(); - PossiblyInfiniteRegion& visibleAboveRegion = data - ? data->mVisibleAboveRegion : mVisibleAboveBackgroundRegion; - - if (aCanMoveFreely) { - // Prerendered transform items can be updated without layer building - // (async animations or an empty transaction), so we need to put items - // that the transform item can potentially move under into a layer above - // this item. We do this by making the visible above region infinite. - // If we have a clip, the transform can't escape from the clip rect, and - // the clip rect can't change without new layer building. In that case we - // can add just the clip rect to the visible above region. - visibleAboveRegion.AccumulateAndSimplifyOutward( - aClipRectIfAny ? *aClipRectIfAny : PossiblyInfiniteRegion::InfiniteRegion()); - } else { - visibleAboveRegion.AccumulateAndSimplifyOutward(aVisibleRect); - } -} - -void -ContainerState::UpdateVisibleAboveRegionOnPop(PaintedLayerData* aData, - PaintedLayerData* aNextPaintedLayerData) -{ - PossiblyInfiniteRegion& visibleAboveRegion = aNextPaintedLayerData ? - aNextPaintedLayerData->mVisibleAboveRegion : mVisibleAboveBackgroundRegion; - - // If aData has a draw region and is subject to async transforms then the - // layer can potentially be moved arbitrarily on the compositor. So we - // should avoid moving display items from on top of the layer to below the - // layer, which we do by making the visibleAboveRegion infinite. Note that - // if the visible region is empty (such as when aData has only event-regions - // items) then we don't need to do this. - if (aData->IsSubjectToAsyncTransforms() && !aData->mVisibleRegion.IsEmpty()) { - visibleAboveRegion.AccumulateAndSimplifyOutward(PossiblyInfiniteRegion::InfiniteRegion()); - } else { - visibleAboveRegion.AccumulateAndSimplifyOutward(aData->mVisibleAboveRegion); - visibleAboveRegion.AccumulateAndSimplifyOutward(aData->mVisibleRegion); - } -} - /* * Iterate through the non-clip items in aList and its descendants. * For each item we compute the effective clip rect. Each item is assigned @@ -2949,8 +3486,9 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList) // drive main-thread sync scrolling. // Note: |item| is removed from aList and will be attached into the parent // list, so we don't delete it here. - static_cast(item)->MarkHoisted(); - mLayerBuilder->GetContainingContainerState()->AddHoistedItem(item); + nsDisplayScrollInfoLayer* scrollInfoItem = static_cast(item); + scrollInfoItem->MarkHoisted(); + mLayerBuilder->GetContainingContainerState()->AddHoistedItem(scrollInfoItem); continue; } @@ -2973,15 +3511,15 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList) nsIntRect itemDrawRect = ScaleToOutsidePixels(itemContent, snap); bool prerenderedTransform = itemType == nsDisplayItem::TYPE_TRANSFORM && static_cast(item)->ShouldPrerender(mBuilder); - nsIntRect clipRect; + ParentLayerIntRect clipRect; const DisplayItemClip& itemClip = item->GetClip(); if (itemClip.HasClip()) { itemContent.IntersectRect(itemContent, itemClip.GetClipRect()); - clipRect = ScaleToNearestPixels(itemClip.GetClipRect()); + clipRect = ViewAs(ScaleToNearestPixels(itemClip.GetClipRect())); if (!prerenderedTransform) { - itemDrawRect.IntersectRect(itemDrawRect, clipRect); + itemDrawRect.IntersectRect(itemDrawRect, ParentLayerIntRect::ToUntyped(clipRect)); } - clipRect.MoveBy(mParameters.mOffset); + clipRect.MoveBy(ViewAs(mParameters.mOffset)); } #ifdef DEBUG nsRect bounds = itemContent; @@ -3068,10 +3606,49 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList) bool mayDrawOutOfOrder = itemType == nsDisplayItem::TYPE_TRANSFORM && (item->Frame()->Preserves3D() || item->Frame()->Preserves3DChildren()); - // Pull up a uniform background color into the layer if possible. - mParameters.mBackgroundColor = (prerenderedTransform || mayDrawOutOfOrder) - ? NS_RGBA(0,0,0,0) - : FindOpaqueBackgroundColorFor(itemVisibleRect, mPaintedLayerDataStack.Length()); + // Let mPaintedLayerDataTree know about this item, so that + // FindPaintedLayerFor and FindOpaqueBackgroundColor are aware of this + // item, even though it's not in any PaintedLayerDataStack. + // Ideally we'd only need the "else" case here and have + // mPaintedLayerDataTree figure out the right clip from the animated + // geometry root that we give it, but it can't easily figure about + // overflow:hidden clips on ancestors just by looking at the frame. + // So we'll do a little hand holding and pass the clip instead of the + // visible rect for the two important cases. + nscolor uniformColor = NS_RGBA(0,0,0,0); + nscolor* uniformColorPtr = !mayDrawOutOfOrder ? &uniformColor : nullptr; + nsIntRect clipRectUntyped; + nsIntRect* clipPtr = itemClip.HasClip() ? &clipRectUntyped : nullptr; + if (clipPtr) { + clipRectUntyped = ParentLayerIntRect::ToUntyped(clipRect); + } + if (animatedGeometryRoot == item->Frame() && + animatedGeometryRoot != mBuilder->RootReferenceFrame()) { + // This is the case for scrollbar thumbs, for example. In that case the + // clip we care about is the overflow:hidden clip on the scrollbar. + const nsIFrame* clipAnimatedGeometryRoot = + mPaintedLayerDataTree.GetParentAnimatedGeometryRoot(animatedGeometryRoot); + mPaintedLayerDataTree.AddingOwnLayer(clipAnimatedGeometryRoot, + clipPtr, + uniformColorPtr); + } else if (prerenderedTransform) { + mPaintedLayerDataTree.AddingOwnLayer(animatedGeometryRoot, + clipPtr, + uniformColorPtr); + } else { + // Using itemVisibleRect here isn't perfect. itemVisibleRect can be + // larger or smaller than the potential bounds of item's contents in + // animatedGeometryRoot: It's too large if there's a clipped display + // port somewhere among item's contents (see bug 1147673), and it can + // be too small if the contents can move, because it only looks at the + // contents' current bounds and doesn't anticipate any animations. + // Time will tell whether this is good enough, or whether we need to do + // something more sophisticated here. + mPaintedLayerDataTree.AddingOwnLayer(animatedGeometryRoot, + &itemVisibleRect, uniformColorPtr); + } + + mParameters.mBackgroundColor = uniformColor; // Just use its layer. // Set layerContentsVisibleRect.width/height to -1 to indicate we @@ -3112,18 +3689,11 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList) "If we have rounded rects, we must have a clip rect"); // It has its own layer. Update that layer's clip and visible rects. if (itemClip.HasClip()) { - ownLayer->SetClipRect(&clipRect); + ownLayer->SetClipRect(Some(clipRect)); } else { - ownLayer->SetClipRect(nullptr); + ownLayer->SetClipRect(Nothing()); } - // Update the "visible above region" of the topmost PaintedLayerData item - // (or of the container's background) so that FindPaintedLayerFor and - // FindOpaqueBackgroundColorFor are aware of this item, even though it's - // not in the PaintedLayerDataStack. - UpdateVisibleAboveRegionForNewItem(itemVisibleRect, prerenderedTransform, - itemClip.HasClip() ? &clipRect : nullptr); - // rounded rectangle clipping using mask layers // (must be done after visible rect is set on layer) if (itemClip.IsRectClippedByRoundedCorner(itemContent)) { @@ -3190,8 +3760,11 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList) topLeft, nullptr); } else { PaintedLayerData* paintedLayerData = - FindPaintedLayerFor(item, itemVisibleRect, animatedGeometryRoot, topLeft, - shouldFixToViewport); + mPaintedLayerDataTree.FindPaintedLayerFor(animatedGeometryRoot, itemVisibleRect, + shouldFixToViewport, [&]() { + return NewPaintedLayerData(item, itemVisibleRect, animatedGeometryRoot, + topLeft, shouldFixToViewport); + }); if (itemType == nsDisplayItem::TYPE_LAYER_EVENT_REGIONS) { nsDisplayLayerEventRegions* eventRegions = @@ -3200,12 +3773,9 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList) } else { // check to see if the new item has rounded rect clips in common with // other items in the layer - paintedLayerData->UpdateCommonClipCount(itemClip); - - InvalidateForLayerChange(item, paintedLayerData->mLayer); - - mLayerBuilder->AddPaintedDisplayItem(paintedLayerData, item, itemClip, itemVisibleRect, - *this, layerState, topLeft); + if (mManager->IsWidgetLayerManager()) { + paintedLayerData->UpdateCommonClipCount(itemClip); + } nsIntRegion opaquePixels = ComputeOpaqueRect(item, animatedGeometryRoot, paintedLayerData->mFixedPosFrameForLayerData, itemClip, aList, @@ -3214,14 +3784,23 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList) MOZ_ASSERT(nsIntRegion(itemDrawRect).Contains(opaquePixels)); opaquePixels.AndWith(itemVisibleRect); paintedLayerData->Accumulate(this, item, opaquePixels, - itemVisibleRect, itemClip); + itemVisibleRect, itemClip, layerState); + + if (!paintedLayerData->mLayer) { + // Try to recycle the old layer of this display item. + nsRefPtr layer = + AttemptToRecyclePaintedLayer(animatedGeometryRoot, item, topLeft); + if (layer) { + paintedLayerData->mLayer = layer; + + NS_ASSERTION(FindIndexOfLayerIn(mNewChildLayers, layer) < 0, + "Layer already in list???"); + mNewChildLayers[paintedLayerData->mNewChildLayersIndex].mLayer = layer.forget(); + } + } } } - // Finish the hoisting process by taking the items from the child and adding - // them to the list here. - aList->AppendToBottom(&mHoistedItems); - if (itemSameCoordinateSystemChildren && itemSameCoordinateSystemChildren->NeedsTransparentSurface()) { aList->SetNeedsTransparentSurface(); @@ -3229,7 +3808,6 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList) } aList->AppendToTop(&savedItems); - MOZ_ASSERT(mHoistedItems.IsEmpty()); } void @@ -3373,7 +3951,6 @@ void FrameLayerBuilder::AddPaintedDisplayItem(PaintedLayerData* aLayerData, nsDisplayItem* aItem, const DisplayItemClip& aClip, - const nsIntRect& aItemVisibleRect, ContainerState& aContainerState, LayerState aLayerState, const nsPoint& aTopLeft) @@ -3507,7 +4084,7 @@ FrameLayerBuilder::StoreDataForFrame(nsDisplayItem* aItem, Layer* aLayer, LayerS (mRetainingManager->GetUserData(&gLayerManagerUserData)); nsRefPtr data = - new DisplayItemData(lmd, aItem->GetPerFrameKey()); + new DisplayItemData(lmd, aItem->GetPerFrameKey(), aLayer); data->BeginUpdate(aLayer, aState, mContainerLayerGeneration, aItem); @@ -3531,7 +4108,7 @@ FrameLayerBuilder::StoreDataForFrame(nsIFrame* aFrame, (mRetainingManager->GetUserData(&gLayerManagerUserData)); nsRefPtr data = - new DisplayItemData(lmd, aDisplayItemKey, aFrame); + new DisplayItemData(lmd, aDisplayItemKey, aLayer, aFrame); data->BeginUpdate(aLayer, aState, mContainerLayerGeneration); @@ -3610,7 +4187,7 @@ ContainerState::CollectOldLayers() "Mask layer in layer tree; could not be recycled."); if (layer->HasUserData(&gPaintedDisplayItemLayerUserData)) { NS_ASSERTION(layer->AsPaintedLayer(), "Wrong layer type"); - mRecycledPaintedLayers.AppendElement(static_cast(layer)); + mPaintedLayersAvailableForRecycling.PutEntry(static_cast(layer)); } if (Layer* maskLayer = layer->GetMaskLayer()) { @@ -3657,8 +4234,8 @@ ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry) } uint32_t baseLength = metricsArray.Length(); - nsIntRect tmpClipRect; - const nsIntRect* layerClip = aEntry->mLayer->GetClipRect(); + ParentLayerIntRect tmpClipRect; + const ParentLayerIntRect* layerClip = aEntry->mLayer->GetClipRect().ptrOr(nullptr); nsIFrame* fParent; for (const nsIFrame* f = aEntry->mAnimatedGeometryRoot; f != mContainerAnimatedGeometryRoot; @@ -3687,7 +4264,7 @@ ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry) scrollFrame->ComputeFrameMetrics(aEntry->mLayer, mContainerReferenceFrame, mParameters, &clipRect, &metricsArray); if (clipRect.width >= 0) { - nsIntRect pixClip = ScaleToNearestPixels(clipRect); + ParentLayerIntRect pixClip = ViewAs(ScaleToNearestPixels(clipRect)); if (layerClip) { tmpClipRect.IntersectRect(pixClip, *layerClip); } else { @@ -3699,7 +4276,7 @@ ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry) // both CSS and scroll clipping. } } - aEntry->mLayer->SetClipRect(layerClip); + aEntry->mLayer->SetClipRect(ToMaybe(layerClip)); // Watch out for FrameMetrics copies in profiles aEntry->mLayer->SetFrameMetrics(metricsArray); } @@ -3730,9 +4307,9 @@ ContainerState::PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer if (hideAll) { e->mVisibleRegion.SetEmpty(); } else if (!e->mLayer->IsScrollbarContainer()) { - const nsIntRect* clipRect = e->mLayer->GetClipRect(); + const Maybe& clipRect = e->mLayer->GetClipRect(); if (clipRect && opaqueRegionForContainer >= 0 && - opaqueRegions[opaqueRegionForContainer].mOpaqueRegion.Contains(*clipRect)) { + opaqueRegions[opaqueRegionForContainer].mOpaqueRegion.Contains(ParentLayerIntRect::ToUntyped(*clipRect))) { e->mVisibleRegion.SetEmpty(); } else if (data) { e->mVisibleRegion.Sub(e->mVisibleRegion, data->mOpaqueRegion); @@ -3765,9 +4342,9 @@ ContainerState::PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer } nsIntRegion clippedOpaque = e->mOpaqueRegion; - const nsIntRect* clipRect = e->mLayer->GetClipRect(); + const Maybe& clipRect = e->mLayer->GetClipRect(); if (clipRect) { - clippedOpaque.AndWith(*clipRect); + clippedOpaque.AndWith(ParentLayerIntRect::ToUntyped(*clipRect)); } data->mOpaqueRegion.Or(data->mOpaqueRegion, clippedOpaque); if (e->mHideAllLayersBelow) { @@ -3796,9 +4373,7 @@ ContainerState::Finish(uint32_t* aTextContentFlags, LayerManagerData* aData, const nsIntRect& aContainerPixelBounds, nsDisplayList* aChildItems, bool& aHasComponentAlphaChildren) { - while (!mPaintedLayerDataStack.IsEmpty()) { - PopPaintedLayerData(); - } + mPaintedLayerDataTree.Finish(); NS_ASSERTION(mContainerBounds.IsEqualInterior(mAccumulatedChildBounds), "Bounds computation mismatch"); @@ -3841,13 +4416,65 @@ ContainerState::Finish(uint32_t* aTextContentFlags, LayerManagerData* aData, // This is not currently a child of the container, so just add it // now. mContainerLayer->InsertAfter(layer, prevChild); - continue; + } else { + NS_ASSERTION(layer->GetParent() == mContainerLayer, + "Layer shouldn't be the child of some other container"); + if (layer->GetPrevSibling() != prevChild) { + mContainerLayer->RepositionChild(layer, prevChild); + } } - NS_ASSERTION(layer->GetParent() == mContainerLayer, - "Layer shouldn't be the child of some other container"); - if (layer->GetPrevSibling() != prevChild) { - mContainerLayer->RepositionChild(layer, prevChild); + ContainerState* containingContainerState = mLayerBuilder->GetContainingContainerState(); + if (containingContainerState) { + containingContainerState->AddHoistedItems(mNewChildLayers[i].mScrollInfoItems); + } else { + // Build layers for all mNewChildLayers[i].mScrollInfoItems and insert + // them after layer. + for (nsDisplayScrollInfoLayer* item : mNewChildLayers[i].mScrollInfoItems) { + LayerState layerState = item->GetLayerState(mBuilder, mManager, mParameters); + MOZ_ASSERT(layerState == LAYER_ACTIVE_EMPTY); + nsRefPtr scrollInfoLayer = item->BuildLayer(mBuilder, mManager, mParameters); + if (!scrollInfoLayer) { + item->~nsDisplayScrollInfoLayer(); + continue; + } + + mLayerBuilder->AddLayerDisplayItem(scrollInfoLayer, item, layerState, + nsPoint(), nullptr); + + const nsIFrame* animatedGeometryRoot = + nsLayoutUtils::GetAnimatedGeometryRootFor(item, mBuilder, mManager); + bool shouldFixToViewport = !animatedGeometryRoot->GetParent() && + item->ShouldFixToViewport(mManager); + const nsIFrame* fixedPosFrame = + FindFixedPosFrameForLayerData(animatedGeometryRoot, shouldFixToViewport); + + NewLayerEntry scrollInfoLayerEntry; + scrollInfoLayerEntry.mLayer = scrollInfoLayer; + scrollInfoLayerEntry.mAnimatedGeometryRoot = animatedGeometryRoot; + scrollInfoLayerEntry.mFixedPosFrameForLayerData = fixedPosFrame; + scrollInfoLayerEntry.mOpaqueForAnimatedGeometryRootParent = + item->IsDisplayPortOpaque(); + scrollInfoLayerEntry.mBaseFrameMetrics = + item->ComputeFrameMetrics(scrollInfoLayer, mParameters); + SetupScrollingMetadata(&scrollInfoLayerEntry); + + if (!scrollInfoLayer->GetParent()) { + // This is not currently a child of the container, so just add it + // now. + mContainerLayer->InsertAfter(scrollInfoLayer, layer); + } else { + NS_ASSERTION(scrollInfoLayer->GetParent() == mContainerLayer, + "scrollInfoLayer shouldn't be the child of some other container"); + if (scrollInfoLayer->GetPrevSibling() != layer) { + mContainerLayer->RepositionChild(scrollInfoLayer, layer); + } + } + + layer = scrollInfoLayer; + item->~nsDisplayScrollInfoLayer(); + } + mNewChildLayers[i].mScrollInfoItems.Clear(); } } @@ -4282,8 +4909,8 @@ FrameLayerBuilder::InvalidateAllLayers(LayerManager* aManager) /* static */ void FrameLayerBuilder::InvalidateAllLayersForFrame(nsIFrame *aFrame) { - nsTArray *array = - reinterpret_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); + const nsTArray* array = + static_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); if (array) { for (uint32_t i = 0; i < array->Length(); i++) { array->ElementAt(i)->mParent->mInvalidateAllLayers = true; @@ -4299,8 +4926,8 @@ FrameLayerBuilder::GetDedicatedLayer(nsIFrame* aFrame, uint32_t aDisplayItemKey) // in the normal widget manager, and as a different layer (or no layer) // in the secondary manager - nsTArray *array = - reinterpret_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); + const nsTArray* array = + static_cast*>(aFrame->Properties().Get(LayerManagerDataProperty())); if (array) { for (uint32_t i = 0; i < array->Length(); i++) { DisplayItemData *element = array->ElementAt(i); @@ -4355,8 +4982,8 @@ FrameLayerBuilder::GetPaintedLayerScaleForFrame(nsIFrame* aFrame) break; } - nsTArray *array = - reinterpret_cast*>(f->Properties().Get(LayerManagerDataProperty())); + const nsTArray* array = + static_cast*>(f->Properties().Get(LayerManagerDataProperty())); if (!array) { continue; } @@ -4495,9 +5122,11 @@ FrameLayerBuilder::PaintItems(nsTArray& aItems, continue; #ifdef MOZ_DUMP_PAINTING - PROFILER_LABEL_PRINTF("DisplayList", "Draw", js::ProfileEntry::Category::GRAPHICS, "%s %p", cdi->mItem->Name(), cdi->mItem); + PROFILER_LABEL_PRINTF("DisplayList", "Draw", + js::ProfileEntry::Category::GRAPHICS, "%s", cdi->mItem->Name()); #else - PROFILER_LABEL_PRINTF("DisplayList", "Draw", js::ProfileEntry::Category::GRAPHICS, "%p", cdi->mItem); + PROFILER_LABEL("DisplayList", "Draw", + js::ProfileEntry::Category::GRAPHICS); #endif // If the new desired clip state is different from the current state, @@ -4763,7 +5392,7 @@ FrameLayerBuilder::DrawPaintedLayer(PaintedLayer* aLayer, if (isRecording) { mozilla::UniquePtr marker = MakeUnique(docShell, aRegionToDraw); - docShell->AddProfileTimelineMarker(marker); + docShell->AddProfileTimelineMarker(Move(marker)); } } @@ -4803,7 +5432,7 @@ FrameLayerBuilder::GetMostRecentGeometry(nsDisplayItem* aItem) // Retrieve the array of DisplayItemData associated with our frame. FrameProperties properties = aItem->Frame()->Properties(); - auto dataArray = + const DataArray* dataArray = static_cast(properties.Get(LayerManagerDataProperty())); if (!dataArray) { return nullptr; diff --git a/layout/base/FrameLayerBuilder.h b/layout/base/FrameLayerBuilder.h index 54daf77961..705fa92577 100644 --- a/layout/base/FrameLayerBuilder.h +++ b/layout/base/FrameLayerBuilder.h @@ -86,17 +86,28 @@ struct ContainerLayerParameters { , mDisableSubpixelAntialiasingInDescendants(aParent.mDisableSubpixelAntialiasingInDescendants) , mInLowPrecisionDisplayPort(aParent.mInLowPrecisionDisplayPort) {} + float mXScale, mYScale; + + LayoutDeviceToLayerScale2D Scale() const { + return LayoutDeviceToLayerScale2D(mXScale, mYScale); + } + /** * If non-null, the rectangle in which BuildContainerLayerFor stores the * visible rect of the layer, in the coordinate system of the created layer. */ nsIntRect* mLayerContentsVisibleRect; + /** * An offset to apply to all child layers created. */ nsIntPoint mOffset; + LayerIntPoint Offset() const { + return LayerIntPoint::FromUntyped(mOffset); + } + nscolor mBackgroundColor; bool mInTransformedSubtree; bool mInActiveTransformedSubtree; @@ -330,7 +341,6 @@ public: void AddPaintedDisplayItem(PaintedLayerData* aLayer, nsDisplayItem* aItem, const DisplayItemClip& aClip, - const nsIntRect& aItemVisibleRect, ContainerState& aContainerState, LayerState aLayerState, const nsPoint& aTopLeft); @@ -436,8 +446,8 @@ public: private: DisplayItemData(LayerManagerData* aParent, uint32_t aKey, + Layer* aLayer, nsIFrame* aFrame = nullptr); - DisplayItemData(DisplayItemData &toCopy); /** * Removes any references to this object from frames diff --git a/layout/base/SelectionCarets.cpp b/layout/base/SelectionCarets.cpp index 8231cc9f05..8fbac6e392 100644 --- a/layout/base/SelectionCarets.cpp +++ b/layout/base/SelectionCarets.cpp @@ -4,7 +4,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "SelectionCarets.h" #include "gfxPrefs.h" diff --git a/layout/base/TouchCaret.cpp b/layout/base/TouchCaret.cpp index dfa3029c70..dbdd48c308 100644 --- a/layout/base/TouchCaret.cpp +++ b/layout/base/TouchCaret.cpp @@ -4,7 +4,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "TouchCaret.h" #include diff --git a/layout/base/UnitTransforms.h b/layout/base/UnitTransforms.h index 746fb0b4d3..62e1fe5705 100644 --- a/layout/base/UnitTransforms.h +++ b/layout/base/UnitTransforms.h @@ -22,6 +22,8 @@ namespace mozilla { enum class PixelCastJustification : uint8_t { // For the root layer, Screen Pixel = Parent Layer Pixel. ScreenIsParentLayerForRoot, + // For the root layer, Render Target Pixel = Parent Layer Pixel. + RenderTargetIsParentLayerForRoot, // For the root composition size we want to view it as layer pixels in any layer ParentLayerToLayerForRootComposition, // The Layer coordinate space for one layer is the ParentLayer coordinate @@ -54,6 +56,14 @@ template gfx::IntPointTyped ViewAs(const gfx::IntPointTyped& aPoint, PixelCastJustification) { return gfx::IntPointTyped(aPoint.x, aPoint.y); } +template +gfx::RectTyped ViewAs(const gfx::RectTyped& aRect, PixelCastJustification) { + return gfx::RectTyped(aRect.x, aRect.y, aRect.width, aRect.height); +} +template +gfx::IntRectTyped ViewAs(const gfx::IntRectTyped& aRect, PixelCastJustification) { + return gfx::IntRectTyped(aRect.x, aRect.y, aRect.width, aRect.height); +} template gfx::ScaleFactor ViewTargetAs( const gfx::ScaleFactor& aScaleFactor, diff --git a/layout/base/Units.h b/layout/base/Units.h index a5c91b0f47..6a61ced8df 100644 --- a/layout/base/Units.h +++ b/layout/base/Units.h @@ -10,6 +10,7 @@ #include "mozilla/gfx/Coord.h" #include "mozilla/gfx/Point.h" #include "mozilla/gfx/Rect.h" +#include "mozilla/gfx/RegionTyped.h" #include "mozilla/gfx/ScaleFactor.h" #include "mozilla/gfx/ScaleFactors2D.h" #include "nsRect.h" @@ -47,6 +48,7 @@ typedef gfx::RectTyped CSSRect; typedef gfx::IntRectTyped CSSIntRect; typedef gfx::MarginTyped CSSMargin; typedef gfx::IntMarginTyped CSSIntMargin; +typedef gfx::IntRegionTyped CSSIntRegion; typedef gfx::CoordTyped LayoutDeviceCoord; typedef gfx::IntCoordTyped LayoutDeviceIntCoord; @@ -58,6 +60,7 @@ typedef gfx::RectTyped LayoutDeviceRect; typedef gfx::IntRectTyped LayoutDeviceIntRect; typedef gfx::MarginTyped LayoutDeviceMargin; typedef gfx::IntMarginTyped LayoutDeviceIntMargin; +typedef gfx::IntRegionTyped LayoutDeviceIntRegion; typedef gfx::CoordTyped LayerCoord; typedef gfx::IntCoordTyped LayerIntCoord; @@ -69,6 +72,7 @@ typedef gfx::RectTyped LayerRect; typedef gfx::IntRectTyped LayerIntRect; typedef gfx::MarginTyped LayerMargin; typedef gfx::IntMarginTyped LayerIntMargin; +typedef gfx::IntRegionTyped LayerIntRegion; typedef gfx::PointTyped RenderTargetPoint; typedef gfx::IntPointTyped RenderTargetIntPoint; @@ -78,6 +82,7 @@ typedef gfx::RectTyped RenderTargetRect; typedef gfx::IntRectTyped RenderTargetIntRect; typedef gfx::MarginTyped RenderTargetMargin; typedef gfx::IntMarginTyped RenderTargetIntMargin; +typedef gfx::IntRegionTyped RenderTargetIntRegion; typedef gfx::CoordTyped ScreenCoord; typedef gfx::IntCoordTyped ScreenIntCoord; @@ -89,6 +94,7 @@ typedef gfx::RectTyped ScreenRect; typedef gfx::IntRectTyped ScreenIntRect; typedef gfx::MarginTyped ScreenMargin; typedef gfx::IntMarginTyped ScreenIntMargin; +typedef gfx::IntRegionTyped ScreenIntRegion; typedef gfx::CoordTyped ParentLayerCoord; typedef gfx::IntCoordTyped ParentLayerIntCoord; @@ -100,6 +106,7 @@ typedef gfx::RectTyped ParentLayerRect; typedef gfx::IntRectTyped ParentLayerIntRect; typedef gfx::MarginTyped ParentLayerMargin; typedef gfx::IntMarginTyped ParentLayerIntMargin; +typedef gfx::IntRegionTyped ParentLayerIntRegion; typedef gfx::ScaleFactor CSSToLayoutDeviceScale; typedef gfx::ScaleFactor CSSToLayerScale; @@ -292,6 +299,10 @@ struct LayerPixel { return nsIntRect(aRect.x, aRect.y, aRect.width, aRect.height); } + static nsIntPoint ToUntyped(const LayerIntPoint& aPoint) { + return nsIntPoint(aPoint.x, aPoint.y); + } + static gfx::IntRect ToUnknown(const LayerIntRect& aRect) { return gfx::IntRect(aRect.x, aRect.y, aRect.width, aRect.height); } diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index 2acee77bf4..061220d561 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -5277,13 +5277,11 @@ nsImageRenderer::IsAnimatedImage() already_AddRefed nsImageRenderer::GetContainer(LayerManager* aManager) { - if (mType != eStyleImageType_Image || !mImageContainer) + if (mType != eStyleImageType_Image || !mImageContainer) { return nullptr; + } - nsRefPtr container; - nsresult rv = mImageContainer->GetImageContainer(aManager, getter_AddRefs(container)); - NS_ENSURE_SUCCESS(rv, nullptr); - return container.forget(); + return mImageContainer->GetImageContainer(aManager, imgIContainer::FLAG_NONE); } #define MAX_BLUR_RADIUS 300 diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 8bcc932e3b..272fd5286d 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -828,8 +828,7 @@ nsDisplayScrollLayer::ComputeFrameMetrics(nsIFrame* aForFrame, // all the pres shells from here up to the root, as well as any css-driven // resolution. We don't need to compute it as it's already stored in the // container parameters. - metrics.SetCumulativeResolution(LayoutDeviceToLayerScale2D(aContainerParameters.mXScale, - aContainerParameters.mYScale)); + metrics.SetCumulativeResolution(aContainerParameters.Scale()); LayoutDeviceToScreenScale2D resolutionToScreen( presShell->GetCumulativeResolution() @@ -2494,7 +2493,8 @@ nsDisplayBackgroundImage::TryOptimizeToImageLayer(LayerManager* aManager, // layer pixel boundaries. This should be OK for now. int32_t appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel(); - mDestRect = nsLayoutUtils::RectToGfxRect(state.mDestArea, appUnitsPerDevPixel); + mDestRect = + LayoutDeviceRect::FromAppUnits(state.mDestArea, appUnitsPerDevPixel); mImageContainer = imageContainer; // Ok, we can turn this into a layer if needed. @@ -2550,13 +2550,11 @@ nsDisplayBackgroundImage::GetLayerState(nsDisplayListBuilder* aBuilder, mozilla::gfx::IntSize imageSize = mImageContainer->GetCurrentSize(); NS_ASSERTION(imageSize.width != 0 && imageSize.height != 0, "Invalid image size!"); - gfxRect destRect = mDestRect; - - destRect.width *= aParameters.mXScale; - destRect.height *= aParameters.mYScale; + const LayerRect destLayerRect = mDestRect * aParameters.Scale(); // Calculate the scaling factor for the frame. - gfxSize scale = gfxSize(destRect.width / imageSize.width, destRect.height / imageSize.height); + const gfxSize scale = gfxSize(destLayerRect.width / imageSize.width, + destLayerRect.height / imageSize.height); // If we are not scaling at all, no point in separating this into a layer. if (scale.width == 1.0f && scale.height == 1.0f) { @@ -2564,7 +2562,7 @@ nsDisplayBackgroundImage::GetLayerState(nsDisplayListBuilder* aBuilder, } // If the target size is pretty small, no point in using a layer. - if (destRect.width * destRect.height < 64 * 64) { + if (destLayerRect.width * destLayerRect.height < 64 * 64) { return LAYER_NONE; } } @@ -2585,12 +2583,13 @@ nsDisplayBackgroundImage::BuildLayer(nsDisplayListBuilder* aBuilder, return nullptr; } layer->SetContainer(mImageContainer); - ConfigureLayer(layer, aParameters.mOffset); + ConfigureLayer(layer, aParameters); return layer.forget(); } void -nsDisplayBackgroundImage::ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& aOffset) +nsDisplayBackgroundImage::ConfigureLayer(ImageLayer* aLayer, + const ContainerLayerParameters& aParameters) { aLayer->SetFilter(nsLayoutUtils::GetGraphicsFilterForFrame(mFrame)); @@ -2602,7 +2601,13 @@ nsDisplayBackgroundImage::ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& a nsDisplayBackgroundGeometry::UpdateDrawResult(this, DrawResult::SUCCESS); } - gfxPoint p = mDestRect.TopLeft() + aOffset; + // XXX(seth): Right now we ignore aParameters.Scale() and + // aParameters.Offset(), because FrameLayerBuilder already applies + // aParameters.Scale() via the layer's post-transform, and + // aParameters.Offset() is always zero. + MOZ_ASSERT(aParameters.Offset() == LayerIntPoint(0,0)); + + const LayoutDevicePoint p = mDestRect.TopLeft(); Matrix transform = Matrix::Translation(p.x, p.y); transform.PreScale(mDestRect.width / imageSize.width, mDestRect.height / imageSize.height); @@ -4885,7 +4890,7 @@ nsRect nsDisplayZoom::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) { nsRect bounds = nsDisplaySubDocument::GetBounds(aBuilder, aSnap); *aSnap = false; - return bounds.ConvertAppUnitsRoundOut(mAPD, mParentAPD); + return bounds.ScaleToOtherAppUnitsRoundOut(mAPD, mParentAPD); } void nsDisplayZoom::HitTest(nsDisplayListBuilder *aBuilder, @@ -4897,10 +4902,10 @@ void nsDisplayZoom::HitTest(nsDisplayListBuilder *aBuilder, // A 1x1 rect indicates we are just hit testing a point, so pass down a 1x1 // rect as well instead of possibly rounding the width or height to zero. if (aRect.width == 1 && aRect.height == 1) { - rect.MoveTo(aRect.TopLeft().ConvertAppUnits(mParentAPD, mAPD)); + rect.MoveTo(aRect.TopLeft().ScaleToOtherAppUnits(mParentAPD, mAPD)); rect.width = rect.height = 1; } else { - rect = aRect.ConvertAppUnitsRoundOut(mParentAPD, mAPD); + rect = aRect.ScaleToOtherAppUnitsRoundOut(mParentAPD, mAPD); } mList.HitTest(aBuilder, rect, aState, aOutFrames); } @@ -4912,11 +4917,11 @@ bool nsDisplayZoom::ComputeVisibility(nsDisplayListBuilder *aBuilder, nsRegion visibleRegion; // mVisibleRect has been clipped to GetClippedBounds visibleRegion.And(*aVisibleRegion, mVisibleRect); - visibleRegion = visibleRegion.ConvertAppUnitsRoundOut(mParentAPD, mAPD); + visibleRegion = visibleRegion.ScaleToOtherAppUnitsRoundOut(mParentAPD, mAPD); nsRegion originalVisibleRegion = visibleRegion; nsRect transformedVisibleRect = - mVisibleRect.ConvertAppUnitsRoundOut(mParentAPD, mAPD); + mVisibleRect.ScaleToOtherAppUnitsRoundOut(mParentAPD, mAPD); bool retval; // If we are to generate a scrollable layer we call // nsDisplaySubDocument::ComputeVisibility to make the necessary adjustments @@ -4935,7 +4940,7 @@ bool nsDisplayZoom::ComputeVisibility(nsDisplayListBuilder *aBuilder, // removed = originalVisibleRegion - visibleRegion removed.Sub(originalVisibleRegion, visibleRegion); // Convert removed region to parent appunits. - removed = removed.ConvertAppUnitsRoundIn(mAPD, mParentAPD); + removed = removed.ScaleToOtherAppUnitsRoundIn(mAPD, mParentAPD); // aVisibleRegion = aVisibleRegion - removed (modulo any simplifications // SubtractFromVisibleRegion does) aBuilder->SubtractFromVisibleRegion(aVisibleRegion, removed); @@ -5721,7 +5726,6 @@ void nsDisplayTransform::HitTest(nsDisplayListBuilder *aBuilder, NSAppUnitsToFloatPixels(aRect.width, factor), NSAppUnitsToFloatPixels(aRect.height, factor)); - Rect rect = matrix.ProjectRectBounds(originalRect); bool snap; nsRect childBounds = mStoredList.GetBounds(aBuilder, &snap); @@ -5729,7 +5733,8 @@ void nsDisplayTransform::HitTest(nsDisplayListBuilder *aBuilder, NSAppUnitsToFloatPixels(childBounds.y, factor), NSAppUnitsToFloatPixels(childBounds.width, factor), NSAppUnitsToFloatPixels(childBounds.height, factor)); - rect = rect.Intersect(childGfxBounds); + + Rect rect = matrix.ProjectRectBounds(originalRect, childGfxBounds); resultingRect = nsRect(NSFloatPixelsToAppUnits(float(rect.X()), factor), NSFloatPixelsToAppUnits(float(rect.Y()), factor), @@ -5969,8 +5974,7 @@ bool nsDisplayTransform::UntransformRect(const nsRect &aTransformedBounds, NSAppUnitsToFloatPixels(aChildBounds.width, factor), NSAppUnitsToFloatPixels(aChildBounds.height, factor)); - result = ToMatrix4x4(transform.Inverse()).ProjectRectBounds(result); - result = result.Intersect(childGfxBounds); + result = ToMatrix4x4(transform.Inverse()).ProjectRectBounds(result, childGfxBounds); *aOutRect = nsLayoutUtils::RoundGfxRectToAppRect(ThebesRect(result), factor); return true; } @@ -5997,8 +6001,7 @@ bool nsDisplayTransform::UntransformVisibleRect(nsDisplayListBuilder* aBuilder, NSAppUnitsToFloatPixels(childBounds.height, factor)); /* We want to untransform the matrix, so invert the transformation first! */ - result = ToMatrix4x4(matrix.Inverse()).ProjectRectBounds(result); - result = result.Intersect(childGfxBounds); + result = ToMatrix4x4(matrix.Inverse()).ProjectRectBounds(result, childGfxBounds); *aOutRect = nsLayoutUtils::RoundGfxRectToAppRect(ThebesRect(result), factor); diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index 059efcacca..25a18d587e 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -1959,6 +1959,8 @@ private: class nsDisplayImageContainer : public nsDisplayItem { public: + typedef mozilla::LayerIntPoint LayerIntPoint; + typedef mozilla::LayoutDeviceRect LayoutDeviceRect; typedef mozilla::layers::ImageContainer ImageContainer; typedef mozilla::layers::ImageLayer ImageLayer; @@ -1968,7 +1970,8 @@ public: virtual already_AddRefed GetContainer(LayerManager* aManager, nsDisplayListBuilder* aBuilder) = 0; - virtual void ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& aOffset) = 0; + virtual void ConfigureLayer(ImageLayer* aLayer, + const ContainerLayerParameters& aParameters) = 0; virtual bool SupportsOptimizingToImage() override { return true; } }; @@ -2316,7 +2319,8 @@ public: virtual already_AddRefed GetContainer(LayerManager* aManager, nsDisplayListBuilder *aBuilder) override; - virtual void ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& aOffset) override; + virtual void ConfigureLayer(ImageLayer* aLayer, + const ContainerLayerParameters& aParameters) override; static nsRegion GetInsideClipRegion(nsDisplayItem* aItem, nsPresContext* aPresContext, uint8_t aClip, const nsRect& aRect, bool* aSnap); @@ -2341,7 +2345,7 @@ protected: const nsStyleBackground* mBackgroundStyle; /* If this background can be a simple image layer, we store the format here. */ nsRefPtr mImageContainer; - gfxRect mDestRect; + LayoutDeviceRect mDestRect; /* Bounds of this display item */ nsRect mBounds; uint32_t mLayer; diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index f6b25b6525..79afc1b557 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -132,7 +132,7 @@ using namespace mozilla::dom; //----------------------------------------------------- // PR LOGGING -#include "prlog.h" +#include "mozilla/Logging.h" #ifdef NS_PRINTING static PRLogModuleInfo * diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index cb4ddbf304..4935689604 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -1976,7 +1976,7 @@ nsLayoutUtils::GetEventCoordinatesRelativeTo(nsIWidget* aWidget, // is in. int32_t rootAPD = rootFrame->PresContext()->AppUnitsPerDevPixel(); int32_t localAPD = aFrame->PresContext()->AppUnitsPerDevPixel(); - widgetToView = widgetToView.ConvertAppUnits(rootAPD, localAPD); + widgetToView = widgetToView.ScaleToOtherAppUnits(rootAPD, localAPD); /* If we encountered a transform, we can't do simple arithmetic to figure * out how to convert back to aFrame's coordinates and must use the CTM. @@ -2418,7 +2418,15 @@ nsLayoutUtils::TransformRect(nsIFrame* aFromFrame, nsIFrame* aToFrame, gfx::Rect(aRect.x * devPixelsPerAppUnitFromFrame, aRect.y * devPixelsPerAppUnitFromFrame, aRect.width * devPixelsPerAppUnitFromFrame, - aRect.height * devPixelsPerAppUnitFromFrame))); + aRect.height * devPixelsPerAppUnitFromFrame), + Rect(-std::numeric_limits::max() * 0.5f, + -std::numeric_limits::max() * 0.5f, + std::numeric_limits::max(), + std::numeric_limits::max())), + Rect(-std::numeric_limits::max() * devPixelsPerAppUnitFromFrame * 0.5f, + -std::numeric_limits::max() * devPixelsPerAppUnitFromFrame * 0.5f, + std::numeric_limits::max() * devPixelsPerAppUnitFromFrame, + std::numeric_limits::max() * devPixelsPerAppUnitFromFrame)); aRect.x = toDevPixels.x / devPixelsPerAppUnitToFrame; aRect.y = toDevPixels.y / devPixelsPerAppUnitToFrame; aRect.width = toDevPixels.width / devPixelsPerAppUnitToFrame; @@ -5847,18 +5855,25 @@ ComputeSnappedImageDrawingParameters(gfxContext* aCtx, fill = devPixelFill; } + // Apply the context's scale to the dest rect. gfxSize destScale = didSnap ? gfxSize(currentMatrix._11, currentMatrix._22) : currentMatrix.ScaleFactors(true); gfxSize appUnitScaledDest(dest.width * destScale.width, dest.height * destScale.height); gfxSize scaledDest = appUnitScaledDest / aAppUnitsPerDevPixel; + if (scaledDest.IsEmpty()) { + return SnappedImageDrawingParameters(); + } + + // Compute a snapped version of the scaled dest rect, which we'll use to + // determine the optimal image size to draw with. We need to be sure that + // this rect is at least one pixel in width and height, or we'll end up + // drawing nothing even if we have a nonempty fill. gfxSize snappedScaledDest = gfxSize(NSAppUnitsToIntPixels(appUnitScaledDest.width, aAppUnitsPerDevPixel), NSAppUnitsToIntPixels(appUnitScaledDest.height, aAppUnitsPerDevPixel)); - - if (scaledDest.IsEmpty() || snappedScaledDest.IsEmpty()) { - return SnappedImageDrawingParameters(); - } + snappedScaledDest.width = std::max(snappedScaledDest.width, 1.0); + snappedScaledDest.height = std::max(snappedScaledDest.height, 1.0); nsIntSize intImageSize = aImage->OptimalImageSizeForDest(snappedScaledDest, @@ -6782,7 +6797,7 @@ nsLayoutUtils::SurfaceFromElement(HTMLVideoElement* aElement, result.mCORSUsed = aElement->GetCORSMode() != CORS_NONE; result.mHasSize = true; - result.mSize = ThebesIntSize(size); + result.mSize = size; result.mPrincipal = principal.forget(); result.mIsWriteOnly = false; diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index dbdbedd00a..0c64042c7e 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -18,7 +18,7 @@ /* a presentation of a document, part 2 */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/ArrayUtils.h" #include "mozilla/CSSStyleSheet.h" @@ -3751,7 +3751,7 @@ PresShell::ScrollFrameRectIntoView(nsIFrame* aFrame, if (parent) { int32_t APD = container->PresContext()->AppUnitsPerDevPixel(); int32_t parentAPD = parent->PresContext()->AppUnitsPerDevPixel(); - rect = rect.ConvertAppUnitsRoundOut(APD, parentAPD); + rect = rect.ScaleToOtherAppUnitsRoundOut(APD, parentAPD); rect += extraOffset; } } @@ -5756,7 +5756,7 @@ PresShell::ProcessSynthMouseMoveEvent(bool aFromScroll) nsIFrame* frame = view->GetFrame(); NS_ASSERTION(frame, "floating views can't be anonymous"); viewAPD = frame->PresContext()->AppUnitsPerDevPixel(); - refpoint = mMouseLocation.ConvertAppUnits(APD, viewAPD); + refpoint = mMouseLocation.ScaleToOtherAppUnits(APD, viewAPD); refpoint -= view->GetOffsetTo(rootView); refpoint += view->ViewToWidgetOffset(); } @@ -5890,7 +5890,7 @@ PresShell::MarkImagesInSubtreeVisible(nsIFrame* aFrame, const nsRect& aRect) } else { rect.MoveBy(-aFrame->GetContentRectRelativeToSelf().TopLeft()); } - rect = rect.ConvertAppUnitsRoundOut( + rect = rect.ScaleToOtherAppUnitsRoundOut( aFrame->PresContext()->AppUnitsPerDevPixel(), presShell->GetPresContext()->AppUnitsPerDevPixel()); @@ -8698,7 +8698,7 @@ PresShell::GetCurrentItemAndPositionForElement(nsIDOMElement *aCurrentEl, nsIFrame* f = do_QueryFrame(scrollFrame); int32_t APD = presContext->AppUnitsPerDevPixel(); int32_t scrollAPD = f->PresContext()->AppUnitsPerDevPixel(); - scrollAmount = scrollAmount.ConvertAppUnits(scrollAPD, APD); + scrollAmount = scrollAmount.ScaleToOtherAppUnits(scrollAPD, APD); if (extra > scrollAmount.height) { extra = scrollAmount.height; } diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index cafe2f7544..2c48166d00 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -33,7 +33,7 @@ #include "nsLayoutUtils.h" #include "nsPresContext.h" #include "nsComponentManagerUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsAutoPtr.h" #include "nsIDocument.h" #include "jsapi.h" diff --git a/layout/base/tests/chrome/test_bug533845.xul b/layout/base/tests/chrome/test_bug533845.xul index d51a41e850..2cee7af051 100644 --- a/layout/base/tests/chrome/test_bug533845.xul +++ b/layout/base/tests/chrome/test_bug533845.xul @@ -36,7 +36,7 @@ function continueTest() { var y = rect.top + (rect.height/2); utils.sendMouseEvent("mousedown", x, y, 0, 1, 0); utils.sendMouseEvent("mouseup", x, y, 0, 1, 0); - is(ifrwindow.document.body.textContent, 1, "Should have got a click event!"); + is(ifrwindow.document.body.textContent, "1", "Should have got a click event!"); SimpleTest.finish(); } diff --git a/layout/base/tests/test_bug435293-skew.html b/layout/base/tests/test_bug435293-skew.html index ef74615d4c..287fdc085d 100644 --- a/layout/base/tests/test_bug435293-skew.html +++ b/layout/base/tests/test_bug435293-skew.html @@ -142,7 +142,7 @@ function runtests() { tformStyle = style.getPropertyValue("-moz-transform"); tformValues = tformStyle.substring(tformStyle.indexOf('(') + 1, tformStyle.indexOf(')')).split(','); - is(tformValues[0], 1, "Test8: Test skew with negative degrees-param 0 is 1"); + is((+tformValues[0]), 1, "Test8: Test skew with negative degrees-param 0 is 1"); ok(verifyRounded(tformValues[1], 3.73206), "Test8: Rounded param 1 is in bounds"); is((+tformValues[2]), -1, "Test8: param 2 is -1"); is((+tformValues[3]), 1, "Test8: param 3 is 1"); diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index 79281d1cb2..bff77dc22a 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -671,12 +671,12 @@ void nsContainerFrame::SetSizeConstraints(nsPresContext* aPresContext, const nsSize& aMinSize, const nsSize& aMaxSize) { - nsIntSize devMinSize(aPresContext->AppUnitsToDevPixels(aMinSize.width), - aPresContext->AppUnitsToDevPixels(aMinSize.height)); - nsIntSize devMaxSize(aMaxSize.width == NS_INTRINSICSIZE ? NS_MAXSIZE : - aPresContext->AppUnitsToDevPixels(aMaxSize.width), - aMaxSize.height == NS_INTRINSICSIZE ? NS_MAXSIZE : - aPresContext->AppUnitsToDevPixels(aMaxSize.height)); + LayoutDeviceIntSize devMinSize(aPresContext->AppUnitsToDevPixels(aMinSize.width), + aPresContext->AppUnitsToDevPixels(aMinSize.height)); + LayoutDeviceIntSize devMaxSize(aMaxSize.width == NS_INTRINSICSIZE ? NS_MAXSIZE : + aPresContext->AppUnitsToDevPixels(aMaxSize.width), + aMaxSize.height == NS_INTRINSICSIZE ? NS_MAXSIZE : + aPresContext->AppUnitsToDevPixels(aMaxSize.height)); // MinSize has a priority over MaxSize if (devMinSize.width > devMaxSize.width) diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index e517e97ffc..94f485d556 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -17,7 +17,7 @@ #include "nsPresContext.h" #include "nsRenderingContext.h" #include "nsStyleContext.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include #include "mozilla/LinkedList.h" #include "mozilla/FloatingPoint.h" diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 1d40eb6881..332e79f039 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -34,7 +34,7 @@ #include "nsPresContext.h" #include "nsStyleConsts.h" #include "nsIPresShell.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prprf.h" #include "nsFrameManager.h" #include "nsLayoutUtils.h" @@ -4778,7 +4778,7 @@ nsIFrame::GetOffsetToCrossDoc(const nsIFrame* aOther, const int32_t aAPD) const int32_t newAPD = f ? f->PresContext()->AppUnitsPerDevPixel() : 0; if (!f || newAPD != currAPD) { // Convert docOffset to the right APD and add it to offset. - offset += docOffset.ConvertAppUnits(currAPD, aAPD); + offset += docOffset.ScaleToOtherAppUnits(currAPD, aAPD); docOffset.x = docOffset.y = 0; } currAPD = newAPD; @@ -4786,7 +4786,7 @@ nsIFrame::GetOffsetToCrossDoc(const nsIFrame* aOther, const int32_t aAPD) const } } if (f == aOther) { - offset += docOffset.ConvertAppUnits(currAPD, aAPD); + offset += docOffset.ScaleToOtherAppUnits(currAPD, aAPD); } else { // Looks like aOther wasn't an ancestor of |this|. So now we have // the root-document-relative position of |this| in |offset|. Subtract the diff --git a/layout/generic/nsFrame.h b/layout/generic/nsFrame.h index 614faca3e3..34babc951a 100644 --- a/layout/generic/nsFrame.h +++ b/layout/generic/nsFrame.h @@ -12,7 +12,7 @@ #include "mozilla/EventForwards.h" #include "mozilla/Likely.h" #include "nsBox.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsIPresShell.h" #include "nsHTMLReflowState.h" diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 504759b1a6..b09049564b 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -1397,22 +1397,22 @@ already_AddRefed nsDisplayImage::GetContainer(LayerManager* aManager, nsDisplayListBuilder* aBuilder) { - nsRefPtr container; - mImage->GetImageContainer(aManager, getter_AddRefs(container)); - return container.forget(); + uint32_t flags = aBuilder->ShouldSyncDecodeImages() + ? imgIContainer::FLAG_SYNC_DECODE + : imgIContainer::FLAG_NONE; + + return mImage->GetImageContainer(aManager, flags); } -gfxRect +nsRect nsDisplayImage::GetDestRect() { - int32_t factor = mFrame->PresContext()->AppUnitsPerDevPixel(); - + // XXX(seth): This method will do something more interesting once the patch in + // bug 1150704 lands. bool snap; nsRect dest = GetBounds(&snap); - gfxRect destRect(dest.x, dest.y, dest.width, dest.height); - destRect.ScaleInverse(factor); - return destRect; + return dest; } LayerState @@ -1439,14 +1439,14 @@ nsDisplayImage::GetLayerState(nsDisplayListBuilder* aBuilder, NS_ASSERTION(imageWidth != 0 && imageHeight != 0, "Invalid image size!"); - gfxRect destRect = GetDestRect(); - - destRect.width *= aParameters.mXScale; - destRect.height *= aParameters.mYScale; + const int32_t factor = mFrame->PresContext()->AppUnitsPerDevPixel(); + const LayoutDeviceRect destRect = + LayoutDeviceRect::FromAppUnits(GetDestRect(), factor); + const LayerRect destLayerRect = destRect * aParameters.Scale(); // Calculate the scaling factor for the frame. - gfxSize scale = gfxSize(destRect.width / imageWidth, - destRect.height / imageHeight); + const gfxSize scale = gfxSize(destLayerRect.width / imageWidth, + destLayerRect.height / imageHeight); // If we are not scaling at all, no point in separating this into a layer. if (scale.width == 1.0f && scale.height == 1.0f) { @@ -1454,13 +1454,17 @@ nsDisplayImage::GetLayerState(nsDisplayListBuilder* aBuilder, } // If the target size is pretty small, no point in using a layer. - if (destRect.width * destRect.height < 64 * 64) { + if (destLayerRect.width * destLayerRect.height < 64 * 64) { return LAYER_NONE; } } - nsRefPtr container; - mImage->GetImageContainer(aManager, getter_AddRefs(container)); + uint32_t flags = aBuilder->ShouldSyncDecodeImages() + ? imgIContainer::FLAG_SYNC_DECODE + : imgIContainer::FLAG_NONE; + + nsRefPtr container = + mImage->GetImageContainer(aManager, flags); if (!container) { return LAYER_NONE; } @@ -1504,9 +1508,15 @@ nsDisplayImage::BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager, const ContainerLayerParameters& aParameters) { - nsRefPtr container; - nsresult rv = mImage->GetImageContainer(aManager, getter_AddRefs(container)); - NS_ENSURE_SUCCESS(rv, nullptr); + uint32_t flags = aBuilder->ShouldSyncDecodeImages() + ? imgIContainer::FLAG_SYNC_DECODE + : imgIContainer::FLAG_NONE; + + nsRefPtr container = + mImage->GetImageContainer(aManager, flags); + if (!container) { + return nullptr; + } nsRefPtr layer = static_cast (aManager->GetLayerBuilder()->GetLeafLayerFor(aBuilder, this)); @@ -1516,12 +1526,13 @@ nsDisplayImage::BuildLayer(nsDisplayListBuilder* aBuilder, return nullptr; } layer->SetContainer(container); - ConfigureLayer(layer, aParameters.mOffset); + ConfigureLayer(layer, aParameters); return layer.forget(); } void -nsDisplayImage::ConfigureLayer(ImageLayer *aLayer, const nsIntPoint& aOffset) +nsDisplayImage::ConfigureLayer(ImageLayer* aLayer, + const ContainerLayerParameters& aParameters) { aLayer->SetFilter(nsLayoutUtils::GetGraphicsFilterForFrame(mFrame)); @@ -1538,9 +1549,17 @@ nsDisplayImage::ConfigureLayer(ImageLayer *aLayer, const nsIntPoint& aOffset) DrawResult::SUCCESS); } - const gfxRect destRect = GetDestRect(); + const int32_t factor = mFrame->PresContext()->AppUnitsPerDevPixel(); + const LayoutDeviceRect destRect = + LayoutDeviceRect::FromAppUnits(GetDestRect(), factor); - gfxPoint p = destRect.TopLeft() + aOffset; + // XXX(seth): Right now we ignore aParameters.Scale() and + // aParameters.Offset(), because FrameLayerBuilder already applies + // aParameters.Scale() via the layer's post-transform, and + // aParameters.Offset() is always zero. + MOZ_ASSERT(aParameters.Offset() == LayerIntPoint(0,0)); + + const LayoutDevicePoint p = destRect.TopLeft(); Matrix transform = Matrix::Translation(p.x, p.y); transform.PreScale(destRect.Width() / imageWidth, destRect.Height() / imageHeight); diff --git a/layout/generic/nsImageFrame.h b/layout/generic/nsImageFrame.h index dbd49b4909..5c0ee6fe5c 100644 --- a/layout/generic/nsImageFrame.h +++ b/layout/generic/nsImageFrame.h @@ -401,7 +401,7 @@ public: virtual already_AddRefed GetContainer(LayerManager* aManager, nsDisplayListBuilder* aBuilder) override; - gfxRect GetDestRect(); + nsRect GetDestRect(); virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager, @@ -431,7 +431,8 @@ public: * Configure an ImageLayer for this display item. * Set the required filter and scaling transform. */ - virtual void ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& aOffset) override; + virtual void ConfigureLayer(ImageLayer* aLayer, + const ContainerLayerParameters& aParameters) override; NS_DISPLAY_DECL_NAME("Image", TYPE_IMAGE) private: diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index 609e073f27..5e2c287edf 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -21,7 +21,7 @@ #include "nsBidiUtils.h" #include "nsIPrintSettings.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo *GetLayoutPrintingLog(); #define PR_PL(_p1) PR_LOG(GetLayoutPrintingLog(), PR_LOG_DEBUG, _p1) diff --git a/layout/generic/nsPluginFrame.cpp b/layout/generic/nsPluginFrame.cpp index 3fd0e18ae6..84f665c791 100644 --- a/layout/generic/nsPluginFrame.cpp +++ b/layout/generic/nsPluginFrame.cpp @@ -65,7 +65,7 @@ #ifdef MOZ_LOGGING #define FORCE_PR_LOG 1 /* Allow logging in the release build */ #endif /* MOZ_LOGGING */ -#include "prlog.h" +#include "mozilla/Logging.h" #ifdef XP_MACOSX #include "gfxQuartzNativeDrawing.h" @@ -623,6 +623,12 @@ nsPluginFrame::CallSetWindow(bool aCheckIsHidden) nsRect bounds = GetContentRectRelativeToSelf() + GetOffsetToCrossDoc(rootFrame); nsIntRect intBounds = bounds.ToNearestPixels(appUnitsPerDevPixel); + // In e10s, this returns the offset to the top level window, in non-e10s + // it return 0,0. + LayoutDeviceIntPoint intOffset = GetRemoteTabChromeOffset(); + intBounds.x += intOffset.x; + intBounds.y += intOffset.y; + // window must be in "display pixels" double scaleFactor = 1.0; if (NS_FAILED(mInstanceOwner->GetContentsScaleFactor(&scaleFactor))) { @@ -751,7 +757,29 @@ nsPluginFrame::IsHidden(bool aCheckVisibilityStyle) const return false; } -nsIntPoint nsPluginFrame::GetWindowOriginInPixels(bool aWindowless) +mozilla::LayoutDeviceIntPoint +nsPluginFrame::GetRemoteTabChromeOffset() +{ + LayoutDeviceIntPoint offset; + if (XRE_GetProcessType() == GeckoProcessType_Content) { + nsCOMPtr window = do_QueryInterface(GetContent()->OwnerDoc()->GetWindow()); + if (window) { + nsCOMPtr topWindow = window->GetTop(); + if (topWindow) { + dom::TabChild* tc = dom::TabChild::GetFrom(topWindow); + if (tc) { + LayoutDeviceIntPoint chromeOffset; + tc->SendGetTabOffset(&chromeOffset); + offset -= chromeOffset; + } + } + } + } + return offset; +} + +nsIntPoint +nsPluginFrame::GetWindowOriginInPixels(bool aWindowless) { nsView * parentWithView; nsPoint origin(0,0); @@ -767,8 +795,19 @@ nsIntPoint nsPluginFrame::GetWindowOriginInPixels(bool aWindowless) } origin += GetContentRectRelativeToSelf().TopLeft(); - return nsIntPoint(PresContext()->AppUnitsToDevPixels(origin.x), - PresContext()->AppUnitsToDevPixels(origin.y)); + nsIntPoint pt(PresContext()->AppUnitsToDevPixels(origin.x), + PresContext()->AppUnitsToDevPixels(origin.y)); + + // If we're in the content process offsetToWidget is tied to the top level + // widget we can access in the child process, which is the tab. We need the + // offset all the way up to the top level native window here. (If this is + // non-e10s this routine will return 0,0.) + if (aWindowless) { + mozilla::LayoutDeviceIntPoint lpt = GetRemoteTabChromeOffset(); + pt += nsIntPoint(lpt.x, lpt.y); + } + + return pt; } void @@ -1433,11 +1472,11 @@ nsPluginFrame::BuildLayer(nsDisplayListBuilder* aBuilder, NS_ASSERTION(layer->GetType() == Layer::TYPE_READBACK, "Bad layer type"); ReadbackLayer* readback = static_cast(layer.get()); - if (readback->GetSize() != ThebesIntSize(size)) { + if (readback->GetSize() != size) { // This will destroy any old background sink and notify us that the // background is now unknown readback->SetSink(nullptr); - readback->SetSize(ThebesIntSize(size)); + readback->SetSize(size); if (mBackgroundSink) { // Maybe we still have a background sink associated with another diff --git a/layout/generic/nsPluginFrame.h b/layout/generic/nsPluginFrame.h index 5753a8c814..ce850d84d0 100644 --- a/layout/generic/nsPluginFrame.h +++ b/layout/generic/nsPluginFrame.h @@ -14,6 +14,7 @@ #include "nsRegion.h" #include "nsDisplayList.h" #include "nsIReflowCallback.h" +#include "Units.h" #ifdef XP_WIN #include // For HWND :( @@ -221,6 +222,13 @@ protected: bool IsPaintedByGoanna() const; nsIntPoint GetWindowOriginInPixels(bool aWindowless); + + /* + * If this frame is in a remote tab, return the tab offset to + * the origin of the chrome window. In non-e10s, this return 0,0. + * This api sends a sync ipc request so be careful about use. + */ + mozilla::LayoutDeviceIntPoint GetRemoteTabChromeOffset(); static void PaintPrintPlugin(nsIFrame* aFrame, nsRenderingContext* aRenderingContext, diff --git a/layout/generic/nsSimplePageSequenceFrame.cpp b/layout/generic/nsSimplePageSequenceFrame.cpp index d63fcbe27e..48e39c04af 100644 --- a/layout/generic/nsSimplePageSequenceFrame.cpp +++ b/layout/generic/nsSimplePageSequenceFrame.cpp @@ -41,7 +41,7 @@ static const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printsettings-se // -#include "prlog.h" +#include "mozilla/Logging.h" PRLogModuleInfo * GetLayoutPrintingLog() { diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index 8c8bf7c217..940ab66024 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -416,7 +416,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, // get the dirty rect relative to the root frame of the subdoc dirty = aDirtyRect + GetOffsetToCrossDoc(subdocRootFrame); // and convert into the appunits of the subdoc - dirty = dirty.ConvertAppUnitsRoundOut(parentAPD, subdocAPD); + dirty = dirty.ScaleToOtherAppUnitsRoundOut(parentAPD, subdocAPD); if (nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame()) { if (gfxPrefs::LayoutUseContainersForRootFrames()) { @@ -505,7 +505,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, nsRect bounds = GetContentRectRelativeToSelf() + aBuilder->ToReferenceFrame(this); if (subdocRootFrame) { - bounds = bounds.ConvertAppUnitsRoundOut(parentAPD, subdocAPD); + bounds = bounds.ScaleToOtherAppUnitsRoundOut(parentAPD, subdocAPD); } // If we are in print preview/page layout we want to paint the grey diff --git a/layout/printing/nsPrintData.cpp b/layout/printing/nsPrintData.cpp index 9853cdf98e..2c9ce46173 100644 --- a/layout/printing/nsPrintData.cpp +++ b/layout/printing/nsPrintData.cpp @@ -14,7 +14,7 @@ //----------------------------------------------------- // PR LOGGING -#include "prlog.h" +#include "mozilla/Logging.h" #define DUMP_LAYOUT_LEVEL 9 // this turns on the dumping of each doucment's layout info static PRLogModuleInfo * diff --git a/layout/printing/nsPrintEngine.cpp b/layout/printing/nsPrintEngine.cpp index 94efa2bd7f..2baa43151e 100644 --- a/layout/printing/nsPrintEngine.cpp +++ b/layout/printing/nsPrintEngine.cpp @@ -127,7 +127,7 @@ using namespace mozilla::dom; //----------------------------------------------------- // PR LOGGING -#include "prlog.h" +#include "mozilla/Logging.h" #ifdef DEBUG // PR_LOGGING is force to always be on (even in release builds) diff --git a/layout/reftests/invalidation/layer-splitting-1.html b/layout/reftests/invalidation/layer-splitting-1.html new file mode 100644 index 0000000000..a2b0c5e161 --- /dev/null +++ b/layout/reftests/invalidation/layer-splitting-1.html @@ -0,0 +1,63 @@ + + + +Moving the transform under the absolutely-positioned layer should cause that to invalidate + + + +
+ +
+ +
+ +
+ + diff --git a/layout/reftests/invalidation/layer-splitting-2.html b/layout/reftests/invalidation/layer-splitting-2.html new file mode 100644 index 0000000000..2b45d9250f --- /dev/null +++ b/layout/reftests/invalidation/layer-splitting-2.html @@ -0,0 +1,63 @@ + + + +Scrolling shouldn't invalidate the fixed layer + + + +
+ +
+ +
+ +
+ + diff --git a/layout/reftests/invalidation/layer-splitting-3.html b/layout/reftests/invalidation/layer-splitting-3.html new file mode 100644 index 0000000000..8cfb98c831 --- /dev/null +++ b/layout/reftests/invalidation/layer-splitting-3.html @@ -0,0 +1,91 @@ + + + +Scrolling shouldn't invalidate the fixed items + + + +
+ +
+ +
+ + +
+ +
+ +
+ +
+ +
+ + diff --git a/layout/reftests/invalidation/layer-splitting-4.html b/layout/reftests/invalidation/layer-splitting-4.html new file mode 100644 index 0000000000..53af2eb90b --- /dev/null +++ b/layout/reftests/invalidation/layer-splitting-4.html @@ -0,0 +1,82 @@ + + + +The two items in the scroll box should share a layer, despite all the other stuff that's going on around them + + + +
+
+
+ +
+ +
+
+
+
+
+
+ diff --git a/layout/reftests/invalidation/layer-splitting-5.html b/layout/reftests/invalidation/layer-splitting-5.html new file mode 100644 index 0000000000..9f98f58210 --- /dev/null +++ b/layout/reftests/invalidation/layer-splitting-5.html @@ -0,0 +1,105 @@ + + + +Things overlapping active scrollboxes should be in a layer on top of the scrolled contents. + + + +
+ +
+ +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/invalidation/layer-splitting-6.html b/layout/reftests/invalidation/layer-splitting-6.html new file mode 100644 index 0000000000..3b95289331 --- /dev/null +++ b/layout/reftests/invalidation/layer-splitting-6.html @@ -0,0 +1,113 @@ + + + +Things overlapping active scrollboxes should be in a layer on top of the scrolled contents, and that layer shouldn't pull up a background color through the scrollbox. + + + + +
+ +
+ +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/invalidation/layer-splitting-7.html b/layout/reftests/invalidation/layer-splitting-7.html new file mode 100644 index 0000000000..72a5528a6d --- /dev/null +++ b/layout/reftests/invalidation/layer-splitting-7.html @@ -0,0 +1,68 @@ + + + +Scrolling shouldn't invalidate the relatively-positioned layer + + + +
+ +
+ +
+ +
+ + diff --git a/layout/reftests/invalidation/masklayer-1.html b/layout/reftests/invalidation/masklayer-1.html new file mode 100644 index 0000000000..fd8d9cb43c --- /dev/null +++ b/layout/reftests/invalidation/masklayer-1.html @@ -0,0 +1,55 @@ + + + +Moving a layer in a box with a rounded clip shouldn't invalidate. + + + + + +
+
+
+ + diff --git a/layout/reftests/invalidation/masklayer-2.html b/layout/reftests/invalidation/masklayer-2.html new file mode 100644 index 0000000000..a2285524b2 --- /dev/null +++ b/layout/reftests/invalidation/masklayer-2.html @@ -0,0 +1,59 @@ + + + +Moving a layer in a box with a rounded clip shouldn't invalidate. + + + + + +
+
+
+
+
+ + diff --git a/layout/reftests/invalidation/paintedlayer-recycling-1.html b/layout/reftests/invalidation/paintedlayer-recycling-1.html new file mode 100644 index 0000000000..a5f3b68806 --- /dev/null +++ b/layout/reftests/invalidation/paintedlayer-recycling-1.html @@ -0,0 +1,75 @@ + + + +Switching the transform to animate shouldn't invalidate the fixed layer + + + +
+ +
+ +
+ +
+ +
+ +
+ + diff --git a/layout/reftests/invalidation/paintedlayer-recycling-2.html b/layout/reftests/invalidation/paintedlayer-recycling-2.html new file mode 100644 index 0000000000..45d7cc982d --- /dev/null +++ b/layout/reftests/invalidation/paintedlayer-recycling-2.html @@ -0,0 +1,67 @@ + + + +Starting to scroll the nested scrollbox shouldn't invalidate the fixed layer + + + +
+ +
+
+ +
+ +
+ + diff --git a/layout/reftests/invalidation/paintedlayer-recycling-3.html b/layout/reftests/invalidation/paintedlayer-recycling-3.html new file mode 100644 index 0000000000..445e1241e4 --- /dev/null +++ b/layout/reftests/invalidation/paintedlayer-recycling-3.html @@ -0,0 +1,71 @@ + + + +Adding a new display item to the bottom of an existing PaintedLayer shouldn't cause the other items in that layer to change layers + + + +
+ +
+ + + +
+ +
+ + diff --git a/layout/reftests/invalidation/paintedlayer-recycling-4.html b/layout/reftests/invalidation/paintedlayer-recycling-4.html new file mode 100644 index 0000000000..17913a96a6 --- /dev/null +++ b/layout/reftests/invalidation/paintedlayer-recycling-4.html @@ -0,0 +1,70 @@ + + + +Removing an existing display item from the bottom of an existing PaintedLayer shouldn't cause the other items in that layer to change layers + + + +
+ +
+ +
+ +
+ +
+ +
+ + diff --git a/layout/reftests/invalidation/paintedlayer-recycling-5.html b/layout/reftests/invalidation/paintedlayer-recycling-5.html new file mode 100644 index 0000000000..c4d53915bc --- /dev/null +++ b/layout/reftests/invalidation/paintedlayer-recycling-5.html @@ -0,0 +1,77 @@ + + + +Removing an existing display item that has its own PaintedLayer shouldn't cause invalidations in other PaintedLayers on top of it + + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + diff --git a/layout/reftests/invalidation/paintedlayer-recycling-6.html b/layout/reftests/invalidation/paintedlayer-recycling-6.html new file mode 100644 index 0000000000..7af1984aef --- /dev/null +++ b/layout/reftests/invalidation/paintedlayer-recycling-6.html @@ -0,0 +1,78 @@ + + + +Adding a new display item that has its own PaintedLayer shouldn't cause invalidations in other PaintedLayers on top of it + + + +
+ +
+ + + +
+ +
+ +
+ +
+ + diff --git a/layout/reftests/invalidation/paintedlayer-recycling-7.html b/layout/reftests/invalidation/paintedlayer-recycling-7.html new file mode 100644 index 0000000000..fed64813cd --- /dev/null +++ b/layout/reftests/invalidation/paintedlayer-recycling-7.html @@ -0,0 +1,82 @@ + + + +When a PaintedLayer is split up into two, the lower items should stay in their layer and the higher items should get a new one. + + + + + +
+ +
+ +
+ +
+ + + +
+ +
+ + diff --git a/layout/reftests/invalidation/reftest.list b/layout/reftests/invalidation/reftest.list index e9d658673d..cb8650542b 100644 --- a/layout/reftests/invalidation/reftest.list +++ b/layout/reftests/invalidation/reftest.list @@ -48,3 +48,19 @@ pref(layout.animated-image-layers.enabled,true) skip-if(Android||gtk2Widget) == != nudge-to-integer-invalidation.html about:blank != nudge-to-integer-invalidation.html?reverse about:blank != clipped-animated-transform-1.html about:blank +!= paintedlayer-recycling-1.html about:blank +!= paintedlayer-recycling-2.html about:blank +!= paintedlayer-recycling-3.html about:blank +!= paintedlayer-recycling-4.html about:blank +!= paintedlayer-recycling-5.html about:blank +!= paintedlayer-recycling-6.html about:blank +!= paintedlayer-recycling-7.html about:blank +!= masklayer-1.html about:blank +!= masklayer-2.html about:blank +!= layer-splitting-1.html about:blank +!= layer-splitting-2.html about:blank +!= layer-splitting-3.html about:blank +!= layer-splitting-4.html about:blank +!= layer-splitting-5.html about:blank +!= layer-splitting-6.html about:blank +!= layer-splitting-7.html about:blank diff --git a/layout/reftests/layers/pull-background-1.html b/layout/reftests/layers/pull-background-1.html new file mode 100644 index 0000000000..09e2f27c9f --- /dev/null +++ b/layout/reftests/layers/pull-background-1.html @@ -0,0 +1,82 @@ + + + +Scrollboxes with uniform backgrounds should pull that color into their contents + + + +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-2.html b/layout/reftests/layers/pull-background-2.html new file mode 100644 index 0000000000..75b625eb32 --- /dev/null +++ b/layout/reftests/layers/pull-background-2.html @@ -0,0 +1,88 @@ + + + +Scrollboxes with uniform backgrounds should pull that color into their contents, even through an opacity container layer + + + +
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-3.html b/layout/reftests/layers/pull-background-3.html new file mode 100644 index 0000000000..0596987ca4 --- /dev/null +++ b/layout/reftests/layers/pull-background-3.html @@ -0,0 +1,101 @@ + + + +Scrollboxes with non-uniform backgrounds should prevent their contents from pulling background colors, even if those contents start out above uniform backgrounds + + + +
+ +
+ +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ + diff --git a/layout/reftests/layers/pull-background-4.html b/layout/reftests/layers/pull-background-4.html new file mode 100644 index 0000000000..bf10f8ab6a --- /dev/null +++ b/layout/reftests/layers/pull-background-4.html @@ -0,0 +1,107 @@ + + + +Scrollboxes with non-uniform backgrounds should prevent their contents from pulling background colors, even if those contents start out above uniform backgrounds + + + + +
+ +
+ +
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ +
+ + diff --git a/layout/reftests/layers/pull-background-5.html b/layout/reftests/layers/pull-background-5.html new file mode 100644 index 0000000000..b91f81a7b7 --- /dev/null +++ b/layout/reftests/layers/pull-background-5.html @@ -0,0 +1,92 @@ + + + +Scrollboxes with uniform backgrounds should pull that color into their contents, even if these contents are wider than the uniform area behind the scrollbox + + + + +
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-6.html b/layout/reftests/layers/pull-background-6.html new file mode 100644 index 0000000000..49e919db58 --- /dev/null +++ b/layout/reftests/layers/pull-background-6.html @@ -0,0 +1,86 @@ + + + +Scrollboxes with uniform backgrounds should pull that color into their contents, even if these contents are wider than the uniform area behind the scrollbox + + + + +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-animated-position-1.html b/layout/reftests/layers/pull-background-animated-position-1.html new file mode 100644 index 0000000000..6271b22daa --- /dev/null +++ b/layout/reftests/layers/pull-background-animated-position-1.html @@ -0,0 +1,105 @@ + + + +Scrollboxes with uniform backgrounds should pull that color into their contents, even if those contents have an animated position + + + +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-animated-position-2.html b/layout/reftests/layers/pull-background-animated-position-2.html new file mode 100644 index 0000000000..8e7ea80c24 --- /dev/null +++ b/layout/reftests/layers/pull-background-animated-position-2.html @@ -0,0 +1,120 @@ + + + +Scrollboxes with non-uniform backgrounds should prevent their contents from pulling background colors, even if those contents start out above uniform backgrounds and have an animated position + + + +
+ +
+ +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-animated-position-3.html b/layout/reftests/layers/pull-background-animated-position-3.html new file mode 100644 index 0000000000..5cf9880902 --- /dev/null +++ b/layout/reftests/layers/pull-background-animated-position-3.html @@ -0,0 +1,105 @@ + + + +This test fails - Layerization should respect overflow:hidden clips around things with animated position + + + +
+ +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-animated-position-4.html b/layout/reftests/layers/pull-background-animated-position-4.html new file mode 100644 index 0000000000..45a35bb4ba --- /dev/null +++ b/layout/reftests/layers/pull-background-animated-position-4.html @@ -0,0 +1,94 @@ + + + +This test fails - layerization should respect overflow:hidden clips around things with animated position + + + +
+ +
+ +
+
+ +
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-animated-position-5.html b/layout/reftests/layers/pull-background-animated-position-5.html new file mode 100644 index 0000000000..2cc1a80158 --- /dev/null +++ b/layout/reftests/layers/pull-background-animated-position-5.html @@ -0,0 +1,105 @@ + + + +This test fails - Opacity containers should anticipate animations of the contents when deciding whether to pull a background color + + + +
+ +
+ +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-displayport-1.html b/layout/reftests/layers/pull-background-displayport-1.html new file mode 100644 index 0000000000..b3a5aa9f9c --- /dev/null +++ b/layout/reftests/layers/pull-background-displayport-1.html @@ -0,0 +1,84 @@ + + + +Scrollboxes with uniform backgrounds should pull that color into their contents, even if their contents have a visible region that extends beyond the scrollbox clip + + + +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-displayport-2.html b/layout/reftests/layers/pull-background-displayport-2.html new file mode 100644 index 0000000000..fb69775157 --- /dev/null +++ b/layout/reftests/layers/pull-background-displayport-2.html @@ -0,0 +1,90 @@ + + + +Scrollboxes with uniform backgrounds should pull that color into their contents, even if their contents have a visible region that extends beyond the scrollbox clip, even through an opacity container layer + + + +
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-displayport-3.html b/layout/reftests/layers/pull-background-displayport-3.html new file mode 100644 index 0000000000..2602cda3cf --- /dev/null +++ b/layout/reftests/layers/pull-background-displayport-3.html @@ -0,0 +1,104 @@ + + + +Scrollboxes with non-uniform backgrounds should prevent their contents from pulling background colors, even if those contents start out above uniform backgrounds + + + +
+ +
+ +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ + diff --git a/layout/reftests/layers/pull-background-displayport-4.html b/layout/reftests/layers/pull-background-displayport-4.html new file mode 100644 index 0000000000..a87b08da4d --- /dev/null +++ b/layout/reftests/layers/pull-background-displayport-4.html @@ -0,0 +1,110 @@ + + + +Scrollboxes with non-uniform backgrounds should prevent their contents from pulling background colors, even if those contents start out above uniform backgrounds + + + + +
+ +
+ +
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ +
+ + diff --git a/layout/reftests/layers/pull-background-displayport-5.html b/layout/reftests/layers/pull-background-displayport-5.html new file mode 100644 index 0000000000..6b865e7d64 --- /dev/null +++ b/layout/reftests/layers/pull-background-displayport-5.html @@ -0,0 +1,94 @@ + + + +Scrollboxes with uniform backgrounds should pull that color into their contents, even if these contents are wider than the uniform area behind the scrollbox + + + + +
+ +
+ +
+
+
+
+ +
+
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/pull-background-displayport-6.html b/layout/reftests/layers/pull-background-displayport-6.html new file mode 100644 index 0000000000..27f66d6ac4 --- /dev/null +++ b/layout/reftests/layers/pull-background-displayport-6.html @@ -0,0 +1,84 @@ + + + +Scrollboxes with uniform backgrounds should pull that color into their contents, even if these contents are wider than the uniform area behind the scrollbox + + + +
+ +
+ +
+
+
+ +
+
+
+ +
+ +
+ + + diff --git a/layout/reftests/layers/reftest.list b/layout/reftests/layers/reftest.list index 8897ae3859..7bdacac753 100644 --- a/layout/reftests/layers/reftest.list +++ b/layout/reftests/layers/reftest.list @@ -1,2 +1,19 @@ == move-to-background-1.html move-to-background-1-ref.html fuzzy-if(cocoaWidget,2,6) random-if(Android&&!browserIsRemote) == component-alpha-exit-1.html component-alpha-exit-1-ref.html # bug 760275 +!= pull-background-1.html about:blank +!= pull-background-2.html about:blank +!= pull-background-3.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515 +!= pull-background-4.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515 +skip-if(asyncPanZoom) != pull-background-5.html about:blank # Fails with event regions +!= pull-background-6.html about:blank +skip-if(asyncPanZoom) != pull-background-animated-position-1.html about:blank # Fails with event regions +!= pull-background-animated-position-2.html about:blank +fails != pull-background-animated-position-3.html about:blank # Fails because PaintedLayer item assignment doesn't recognize overflow:hidden clips +fails != pull-background-animated-position-4.html about:blank # Fails because PaintedLayer item assignment and background pulling don't recognize overflow:hidden clips +fails-if(!asyncPanZoom&&!Android) != pull-background-animated-position-5.html about:blank # Fails because ownLayer bounds don't anticipate changes of animated contents, but doesn't fail with event regions +skip-if(!asyncPanZoom) != pull-background-displayport-1.html about:blank +skip-if(!asyncPanZoom) != pull-background-displayport-2.html about:blank +skip-if(!asyncPanZoom) != pull-background-displayport-3.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515 +skip-if(!asyncPanZoom) != pull-background-displayport-4.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515 +fails skip-if(!asyncPanZoom) != pull-background-displayport-5.html about:blank # bug 1147673 +skip-if(!asyncPanZoom) != pull-background-displayport-6.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515 diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list index cf80bb5902..7fc08f1541 100644 --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -218,7 +218,7 @@ pref(layout.css.masking.enabled,true) fuzzy-if(d2d,1,6400) == mask-type-04.svg m == nested-viewBox-01.svg pass.svg == nesting-invalid-01.svg nesting-invalid-01-ref.svg fuzzy-if(d2d&&/^Windows\x20NT\x206\.1/.test(http.oscpu),1,168) fuzzy-if(azureQuartz,1,122) == non-scaling-stroke-01.svg non-scaling-stroke-01-ref.svg # bug 1074161 for Win7 and OSX 10.8 -fuzzy-if(Android||B2G,1,99) fuzzy-if(!contentSameGfxBackendAsCanvas,9,99) == non-scaling-stroke-02.svg non-scaling-stroke-02-ref.svg +fuzzy-if(!contentSameGfxBackendAsCanvas,9,99) fuzzy-if(Android||B2G,9,586) == non-scaling-stroke-02.svg non-scaling-stroke-02-ref.svg == non-scaling-stroke-03.svg non-scaling-stroke-03-ref.svg == objectBoundingBox-and-clipPath.svg pass.svg # Bug 588684 diff --git a/layout/reftests/transform-3d/1035611-1-ref.html b/layout/reftests/transform-3d/1035611-1-ref.html new file mode 100644 index 0000000000..4c79af3e43 --- /dev/null +++ b/layout/reftests/transform-3d/1035611-1-ref.html @@ -0,0 +1,29 @@ + + + + Testcase, bug 1035611 + + + + +
+
+
+ + + diff --git a/layout/reftests/transform-3d/1035611-1.html b/layout/reftests/transform-3d/1035611-1.html new file mode 100644 index 0000000000..2d7e787077 --- /dev/null +++ b/layout/reftests/transform-3d/1035611-1.html @@ -0,0 +1,38 @@ + + + + Testcase, bug 1035611 + + + + +
+
+
+
+
+ + + diff --git a/layout/reftests/transform-3d/reftest.list b/layout/reftests/transform-3d/reftest.list index cf074a583f..feaa2ba92c 100644 --- a/layout/reftests/transform-3d/reftest.list +++ b/layout/reftests/transform-3d/reftest.list @@ -55,3 +55,5 @@ fuzzy-if((gtk2Widget&&layersOMTC)||(winWidget&&!layersGPUAccelerated),1,86) == o pref(layout.css.will-change.enabled,true) == willchange-containing-block.html?willchange willchange-containing-block.html?ref pref(layout.css.will-change.enabled,true) != willchange-containing-block.html?willchange willchange-containing-block.html?noblock fuzzy-if(winWidget&&!layersGPUAccelerated,1,606) == scroll-perspective-1.html scroll-perspective-1-ref.html +# Bugs +fails-if(!layersGPUAccelerated) == 1035611-1.html 1035611-1-ref.html # Bug 1072898 for !layersGPUAccelerated failures diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp index e4b4e73f7d..7de4fb34e2 100644 --- a/layout/style/FontFaceSet.cpp +++ b/layout/style/FontFaceSet.cpp @@ -6,7 +6,7 @@ #include "FontFaceSet.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/css/Loader.h" #include "mozilla/dom/CSSFontFaceLoadEvent.h" diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index c5b58a212a..752c49fdd3 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -253,7 +253,7 @@ private: void FireLoadEvent(nsIThreadInternal* aThread); }; -#include "prlog.h" +#include "mozilla/Logging.h" static PRLogModuleInfo * GetLoaderLog() diff --git a/layout/style/nsFontFaceLoader.cpp b/layout/style/nsFontFaceLoader.cpp index 570c8d975a..cb1e93fe4f 100644 --- a/layout/style/nsFontFaceLoader.cpp +++ b/layout/style/nsFontFaceLoader.cpp @@ -6,7 +6,7 @@ /* code for loading in @font-face defined font data */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsFontFaceLoader.h" diff --git a/layout/style/test/chrome/test_moz_document_rules.html b/layout/style/test/chrome/test_moz_document_rules.html index 6f3248df2c..87fba40558 100644 --- a/layout/style/test/chrome/test_moz_document_rules.html +++ b/layout/style/test/chrome/test_moz_document_rules.html @@ -48,7 +48,7 @@ function run() var sheeturi = "data:text/css," + encodedRule; set_user_sheet(sheeturi); if (shouldapply) { - is(cs.zIndex, zIndex, + is(cs.zIndex, String(zIndex), "@-moz-document " + urltests + " should apply to this document"); } else { diff --git a/layout/style/test/test_animations_omta_start.html b/layout/style/test/test_animations_omta_start.html index 07b246c35f..32f7b97012 100644 --- a/layout/style/test/test_animations_omta_start.html +++ b/layout/style/test/test_animations_omta_start.html @@ -75,7 +75,7 @@ function testDelay() { gUtils.advanceTimeAndRefresh(10100); waitForAllPaints(function() { var opacity = gUtils.getOMTAStyle(target, "opacity"); - is(opacity, 0.5, + is(opacity, "0.5", "opacity is set on compositor thread after delayed start"); target.removeAttribute("style"); gUtils.restoreNormalRefresh(); diff --git a/layout/style/test/test_cascade.html b/layout/style/test/test_cascade.html index 109323ed0c..0a5d27a8b7 100644 --- a/layout/style/test/test_cascade.html +++ b/layout/style/test/test_cascade.html @@ -42,7 +42,7 @@ function do_test(sel1, imp1, sel2, imp2, winning) { sel1 + " { z-index: " + ind1 + (imp1 ? "!important" :"") + " } " + sel2 + " { z-index: " + ind2 + (imp2 ? "!important" :"") + " } "; var result = cs.zIndex; - is(result, (winning == 1) ? ind1 : ind2, + is(result, String((winning == 1) ? ind1 : ind2), "cascading of " + style_contents.data); } diff --git a/layout/style/test/test_flexbox_flex_grow_and_shrink.html b/layout/style/test/test_flexbox_flex_grow_and_shrink.html index 357d9f7382..ef6fd901d8 100644 --- a/layout/style/test/test_flexbox_flex_grow_and_shrink.html +++ b/layout/style/test/test_flexbox_flex_grow_and_shrink.html @@ -71,11 +71,11 @@ advance_clock(0); // flexGrowTwoToThree: 2.0 at 0%, 2.5 at 50%, 10 after animation is over var [ div, cs ] = new_div("animation: flexGrowTwoToThree linear 1s"); -is_approx(cs.flexGrow, 2, 0.01, "flexGrowTwoToThree at 0.0s"); +is_approx(+cs.flexGrow, 2, 0.01, "flexGrowTwoToThree at 0.0s"); advance_clock(500); -is_approx(cs.flexGrow, 2.5, 0.01, "flexGrowTwoToThree at 0.5s"); +is_approx(+cs.flexGrow, 2.5, 0.01, "flexGrowTwoToThree at 0.5s"); advance_clock(1000); -is(cs.flexGrow, 10, "flexGrowTwoToThree at 1.5s"); +is(cs.flexGrow, "10", "flexGrowTwoToThree at 1.5s"); done_div(); // flexShrinkTwoToThree: 2.0 at 0%, 2.5 at 50%, 20 after animation is over @@ -84,25 +84,25 @@ is_approx(cs.flexShrink, 2, 0.01, "flexShrinkTwoToThree at 0.0s"); advance_clock(500); is_approx(cs.flexShrink, 2.5, 0.01, "flexShrinkTwoToThree at 0.5s"); advance_clock(1000); -is(cs.flexShrink, 20, "flexShrinkTwoToThree at 1.5s"); +is(cs.flexShrink, "20", "flexShrinkTwoToThree at 1.5s"); done_div(); // flexGrowZeroToZero: 0 at 0%, 0 at 50%, 10 after animation is over [ div, cs ] = new_div("animation: flexGrowZeroToZero linear 1s"); -is(cs.flexGrow, 0, "flexGrowZeroToZero at 0.0s"); +is(cs.flexGrow, "0", "flexGrowZeroToZero at 0.0s"); advance_clock(500); -is(cs.flexGrow, 0, "flexGrowZeroToZero at 0.5s"); +is(cs.flexGrow, "0", "flexGrowZeroToZero at 0.5s"); advance_clock(1000); -is(cs.flexGrow, 10, "flexGrowZeroToZero at 1.5s"); +is(cs.flexGrow, "10", "flexGrowZeroToZero at 1.5s"); done_div(); // flexShrinkZeroToZero: 0 at 0%, 0 at 50%, 20 after animation is over [ div, cs ] = new_div("animation: flexShrinkZeroToZero linear 1s"); -is(cs.flexShrink, 0, "flexShrinkZeroToZero at 0.0s"); +is(cs.flexShrink, "0", "flexShrinkZeroToZero at 0.0s"); advance_clock(500); -is(cs.flexShrink, 0, "flexShrinkZeroToZero at 0.5s"); +is(cs.flexShrink, "0", "flexShrinkZeroToZero at 0.5s"); advance_clock(1000); -is(cs.flexShrink, 20, "flexShrinkZeroToZero at 1.5s"); +is(cs.flexShrink, "20", "flexShrinkZeroToZero at 1.5s"); done_div(); // ANIMATIONS THAT DIDN'T USED TO AFFECT COMPUTED STYLE, BUT NOW DO @@ -112,38 +112,38 @@ done_div(); // flexGrowZeroToOne: 0 at 0%, 0.5 at 50%, 10 after animation is over. [ div, cs ] = new_div("animation: flexGrowZeroToOne linear 1s"); -is(cs.flexGrow, 0, "flexGrowZeroToOne at 0.0s"); +is(cs.flexGrow, "0", "flexGrowZeroToOne at 0.0s"); advance_clock(500); -is(cs.flexGrow, 0.5, "flexGrowZeroToOne at 0.5s"); +is(cs.flexGrow, "0.5", "flexGrowZeroToOne at 0.5s"); advance_clock(1000); -is(cs.flexGrow, 10, "flexGrowZeroToOne at 1.5s"); +is(cs.flexGrow, "10", "flexGrowZeroToOne at 1.5s"); done_div(); // flexShrinkZeroToOne: 0 at 0%, 0.5 at 50%, 20 after animation is over. [ div, cs ] = new_div("animation: flexShrinkZeroToOne linear 1s"); -is(cs.flexShrink, 0, "flexShrinkZeroToOne at 0.0s"); +is(cs.flexShrink, "0", "flexShrinkZeroToOne at 0.0s"); advance_clock(500); -is(cs.flexShrink, 0.5, "flexShrinkZeroToOne at 0.5s"); +is(cs.flexShrink, "0.5", "flexShrinkZeroToOne at 0.5s"); advance_clock(1000); -is(cs.flexShrink, 20, "flexShrinkZeroToOne at 1.5s"); +is(cs.flexShrink, "20", "flexShrinkZeroToOne at 1.5s"); done_div(); // flexGrowOneToZero: 1 at 0%, 0.5 at 50%, 10 after animation is over. [ div, cs ] = new_div("animation: flexGrowOneToZero linear 1s"); -is(cs.flexGrow, 1, "flexGrowOneToZero at 0.0s"); +is(cs.flexGrow, "1", "flexGrowOneToZero at 0.0s"); advance_clock(500); -is(cs.flexGrow, 0.5, "flexGrowOneToZero at 0.5s"); +is(cs.flexGrow, "0.5", "flexGrowOneToZero at 0.5s"); advance_clock(1000); -is(cs.flexGrow, 10, "flexGrowOneToZero at 1.5s"); +is(cs.flexGrow, "10", "flexGrowOneToZero at 1.5s"); done_div(); // flexShrinkOneToZero: 1 at 0%, 0.5 at 50%, 20 after animation is over. [ div, cs ] = new_div("animation: flexShrinkOneToZero linear 1s"); -is(cs.flexShrink, 1, "flexShrinkOneToZero at 0.0s"); +is(cs.flexShrink, "1", "flexShrinkOneToZero at 0.0s"); advance_clock(500); -is(cs.flexShrink, 0.5, "flexShrinkOneToZero at 0.5s"); +is(cs.flexShrink, "0.5", "flexShrinkOneToZero at 0.5s"); advance_clock(1000); -is(cs.flexShrink, 20, "flexShrinkOneToZero at 1.5s"); +is(cs.flexShrink, "20", "flexShrinkOneToZero at 1.5s"); done_div(); SpecialPowers.DOMWindowUtils.restoreNormalRefresh(); diff --git a/layout/style/test/test_namespace_rule.html b/layout/style/test/test_namespace_rule.html index 8cbcd0ace6..2cf4c4fc5f 100644 --- a/layout/style/test/test_namespace_rule.html +++ b/layout/style/test/test_namespace_rule.html @@ -63,7 +63,7 @@ function run() { for (var i = 0; i < should_match.length; ++i) { var e = should_match[i]; - is(ifwin.getComputedStyle(e, "").zIndex, zi, + is(ifwin.getComputedStyle(e, "").zIndex, String(zi), "element in " + body_contents + " matched " + selector); } for (var i = 0; i < should_not_match.length; ++i) { @@ -83,7 +83,7 @@ function run() { namespaceRules + " " + ser1 + "{ z-index: " + zi + " }"; for (var i = 0; i < should_match.length; ++i) { var e = should_match[i]; - is(ifwin.getComputedStyle(e, "").zIndex, zi, + is(ifwin.getComputedStyle(e, "").zIndex, String(zi), "element in " + body_contents + " matched " + ser1 + " which is the reserialization of " + selector); } diff --git a/layout/style/test/test_of_type_selectors.xhtml b/layout/style/test/test_of_type_selectors.xhtml index a1ee315b3d..7ab286bdeb 100644 --- a/layout/style/test/test_of_type_selectors.xhtml +++ b/layout/style/test/test_of_type_selectors.xhtml @@ -59,7 +59,7 @@ function run() { var i; for (i in match_indices) { var e = elements[match_indices[i]]; - is(getComputedStyle(e, "").zIndex, zi, + is(getComputedStyle(e, "").zIndex, String(zi), "element " + match_indices[i] + " matched " + selector); } for (i in notmatch_indices) { diff --git a/layout/style/test/test_selectors.html b/layout/style/test/test_selectors.html index b0023fd766..f5b413b44e 100644 --- a/layout/style/test/test_selectors.html +++ b/layout/style/test/test_selectors.html @@ -74,7 +74,7 @@ function run() { for (var i = 0; i < should_match.length; ++i) { var e = should_match[i]; - is(ifwin.getComputedStyle(e, "").zIndex, zi, + is(ifwin.getComputedStyle(e, "").zIndex, String(zi), "element in " + body_contents + " matched " + selector); } for (var i = 0; i < should_not_match.length; ++i) { @@ -92,7 +92,7 @@ function run() { style_text.data = namespaces + ser1 + "{ z-index: " + zi + " }"; for (var i = 0; i < should_match.length; ++i) { var e = should_match[i]; - is(ifwin.getComputedStyle(e, "").zIndex, zi, + is(ifwin.getComputedStyle(e, "").zIndex, String(zi), "element in " + body_contents + " matched " + ser1 + " which is the reserialization of " + selector); } @@ -150,7 +150,7 @@ function run() { for (var i = 0; i < should_match.length; ++i) { var e = should_match[i]; - is(clonewin.getComputedStyle(e, "").zIndex, zi, + is(clonewin.getComputedStyle(e, "").zIndex, String(zi), "element in " + body_contents + " matched clone of " + selector); } @@ -193,7 +193,7 @@ function run() { var ser1 = style_elem.sheet.cssRules[0].selectorText; zi = ++gCounter; style_text.data = ser1 + "{ z-index: " + zi + " }"; - is(ifwin.getComputedStyle(should_match, "").zIndex, zi, + is(ifwin.getComputedStyle(should_match, "").zIndex, String(zi), "serialization " + ser1 + " of selector p, " + selector + " was parsed"); var ser2 = style_elem.sheet.cssRules[0].selectorText; @@ -224,7 +224,7 @@ function run() { links[0].parentNode.removeChild(links[0]); should_match = clonedoc.getElementsByTagName("p")[0]; - is(clonewin.getComputedStyle(should_match, "").zIndex, zi, + is(clonewin.getComputedStyle(should_match, "").zIndex, String(zi), "selector " + selector + " was cloned correctly"); var ser3 = links[0].sheet.cssRules[1].selectorText; is(ser3, ser1, @@ -269,7 +269,7 @@ function run() { var should_match = ifdoc.getElementsByTagName("div")[0]; is(ifwin.getComputedStyle(should_not_match, "").zIndex, "auto", "selector " + selector + " was a parser error"); - is(ifwin.getComputedStyle(should_match, "").zIndex, zi2, + is(ifwin.getComputedStyle(should_match, "").zIndex, String(zi2), "selector " + selector + " error was recovered from"); ifdoc.body.innerHTML = ""; style_text.data = ""; diff --git a/layout/style/test/test_selectors_on_anonymous_content.html b/layout/style/test/test_selectors_on_anonymous_content.html index ca2186d39d..a4975f6b85 100644 --- a/layout/style/test/test_selectors_on_anonymous_content.html +++ b/layout/style/test/test_selectors_on_anonymous_content.html @@ -50,7 +50,7 @@ function run() { for (var i = 0; i < should_match.length; ++i) { var e = should_match[i]; - is(SpecialPowers.wrap(window).getComputedStyle(e, "").zIndex, zi, + is(SpecialPowers.wrap(window).getComputedStyle(e, "").zIndex, String(zi), "element matched " + selector); } for (var i = 0; i < should_not_match.length; ++i) { diff --git a/layout/style/test/test_transitions_events.html b/layout/style/test/test_transitions_events.html index 2b99ec1787..05b781effd 100644 --- a/layout/style/test/test_transitions_events.html +++ b/layout/style/test/test_transitions_events.html @@ -317,7 +317,7 @@ var e = new TransitionEvent("transitionend", is(e.bubbles, true); is(e.cancelable, true); is(e.propertyName, "some-unknown-prop"); -is(e.elapsedTime, "0.5"); +is(e.elapsedTime, 0.5); is(e.pseudoElement, "pseudo"); is(e.isTrusted, false) diff --git a/layout/style/test/test_unclosed_parentheses.html b/layout/style/test/test_unclosed_parentheses.html index 425ae23476..d2daae944b 100644 --- a/layout/style/test/test_unclosed_parentheses.html +++ b/layout/style/test/test_unclosed_parentheses.html @@ -256,7 +256,7 @@ for (var i = 0; i < semirules.length; ++i) { textNode.data = sheet; is(cs.color, "rgb(0, 128, 0)", "color for rule '" + semirules[i] + "'"); - is(cs.zIndex, i+1, + is(cs.zIndex, String(i + 1), "z-index for rule '" + semirules[i] + "'"); } @@ -267,7 +267,7 @@ for (var i = 0; i < declarations.length; ++i) { textNode.data = sheet; is(cs.color, "rgb(0, 128, 0)", "color for declaration '" + declarations[i] + "'"); - is(cs.zIndex, i+1, + is(cs.zIndex, String(i + 1), "z-index for declaration '" + declarations[i] + "'"); } @@ -279,7 +279,7 @@ for (var i = 0; i < selectors.length; ++i) { textNode.data = sheet; is(cs.color, "rgb(0, 128, 0)", "color for selector '" + selectors[i] + "'"); - is(cs.zIndex, i+1, + is(cs.zIndex, String(i + 1), "z-index for selector '" + selectors[i] + "'"); } diff --git a/layout/xul/nsImageBoxFrame.cpp b/layout/xul/nsImageBoxFrame.cpp index b5ff1f4cde..a987777308 100644 --- a/layout/xul/nsImageBoxFrame.cpp +++ b/layout/xul/nsImageBoxFrame.cpp @@ -395,18 +395,19 @@ nsDisplayXULImage::ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder, } void -nsDisplayXULImage::ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& aOffset) +nsDisplayXULImage::ConfigureLayer(ImageLayer* aLayer, + const ContainerLayerParameters& aParameters) { aLayer->SetFilter(nsLayoutUtils::GetGraphicsFilterForFrame(mFrame)); - int32_t factor = mFrame->PresContext()->AppUnitsPerDevPixel(); nsImageBoxFrame* imageFrame = static_cast(mFrame); - nsRect dest; - imageFrame->GetClientRect(dest); - dest += ToReferenceFrame(); - gfxRect destRect(dest.x, dest.y, dest.width, dest.height); - destRect.ScaleInverse(factor); + nsRect clientRect; + imageFrame->GetClientRect(clientRect); + + const int32_t factor = mFrame->PresContext()->AppUnitsPerDevPixel(); + const LayoutDeviceRect destRect = + LayoutDeviceRect::FromAppUnits(clientRect + ToReferenceFrame(), factor); nsCOMPtr imgCon; imageFrame->mImageRequest->GetImage(getter_AddRefs(imgCon)); @@ -423,7 +424,13 @@ nsDisplayXULImage::ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& aOffset) DrawResult::SUCCESS); } - gfxPoint p = destRect.TopLeft() + aOffset; + // XXX(seth): Right now we ignore aParameters.Scale() and + // aParameters.Offset(), because FrameLayerBuilder already applies + // aParameters.Scale() via the layer's post-transform, and + // aParameters.Offset() is always zero. + MOZ_ASSERT(aParameters.Offset() == LayerIntPoint(0,0)); + + const LayoutDevicePoint p = destRect.TopLeft(); Matrix transform = Matrix::Translation(p.x, p.y); transform.PreScale(destRect.Width() / imageWidth, destRect.Height() / imageHeight); @@ -431,13 +438,18 @@ nsDisplayXULImage::ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& aOffset) } already_AddRefed -nsDisplayXULImage::GetContainer(LayerManager* aManager, nsDisplayListBuilder* aBuilder) +nsDisplayXULImage::GetContainer(LayerManager* aManager, + nsDisplayListBuilder* aBuilder) { - return static_cast(mFrame)->GetContainer(aManager); + uint32_t flags = aBuilder->ShouldSyncDecodeImages() + ? imgIContainer::FLAG_SYNC_DECODE + : imgIContainer::FLAG_NONE; + + return static_cast(mFrame)->GetContainer(aManager, flags); } already_AddRefed -nsImageBoxFrame::GetContainer(LayerManager* aManager) +nsImageBoxFrame::GetContainer(LayerManager* aManager, uint32_t aFlags) { bool hasSubRect = !mUseSrcAttr && (mSubRect.width > 0 || mSubRect.height > 0); if (hasSubRect || !mImageRequest) { @@ -450,9 +462,7 @@ nsImageBoxFrame::GetContainer(LayerManager* aManager) return nullptr; } - nsRefPtr container; - imgCon->GetImageContainer(aManager, getter_AddRefs(container)); - return container.forget(); + return imgCon->GetImageContainer(aManager, aFlags); } diff --git a/layout/xul/nsImageBoxFrame.h b/layout/xul/nsImageBoxFrame.h index 00f1660597..3ac07b264e 100644 --- a/layout/xul/nsImageBoxFrame.h +++ b/layout/xul/nsImageBoxFrame.h @@ -41,6 +41,7 @@ class nsImageBoxFrame final : public nsLeafBoxFrame { public: typedef mozilla::image::DrawResult DrawResult; + typedef mozilla::layers::ImageContainer ImageContainer; typedef mozilla::layers::LayerManager LayerManager; friend class nsDisplayXULImage; @@ -95,7 +96,9 @@ public: const nsRect& aDirtyRect, nsPoint aPt, uint32_t aFlags); - already_AddRefed GetContainer(LayerManager* aManager); + already_AddRefed GetContainer(LayerManager* aManager, + uint32_t aFlags); + protected: explicit nsImageBoxFrame(nsStyleContext* aContext); @@ -141,7 +144,8 @@ public: virtual already_AddRefed GetContainer(LayerManager* aManager, nsDisplayListBuilder* aBuilder) override; - virtual void ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& aOffset) override; + virtual void ConfigureLayer(ImageLayer* aLayer, + const ContainerLayerParameters& aParameters) override; virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) override { *aSnap = true; diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index f2be7f808e..d1a8db4990 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -1247,8 +1247,8 @@ nsMenuPopupFrame::SetPopupPosition(nsIFrame* aAnchorFrame, bool aIsMove, bool aS parentRect.MoveBy(referenceFrame->GetScreenRectInAppUnits().TopLeft()); // In its own app units parentRect = - parentRect.ConvertAppUnitsRoundOut(rootPresContext->AppUnitsPerDevPixel(), - presContext->AppUnitsPerDevPixel()); + parentRect.ScaleToOtherAppUnitsRoundOut(rootPresContext->AppUnitsPerDevPixel(), + presContext->AppUnitsPerDevPixel()); // Set the popup's size to the preferred size. Below, this size will be // adjusted to fit on the screen or within the content area. If the anchor diff --git a/layout/xul/nsXULPopupManager.cpp b/layout/xul/nsXULPopupManager.cpp index f9ca34e225..f58082bf5d 100644 --- a/layout/xul/nsXULPopupManager.cpp +++ b/layout/xul/nsXULPopupManager.cpp @@ -471,7 +471,7 @@ nsXULPopupManager::PopupMoved(nsIFrame* aFrame, nsIntPoint aPnt) } void -nsXULPopupManager::PopupResized(nsIFrame* aFrame, nsIntSize aSize) +nsXULPopupManager::PopupResized(nsIFrame* aFrame, LayoutDeviceIntSize aSize) { nsMenuPopupFrame* menuPopupFrame = GetPopupToMoveOrResize(aFrame); if (!menuPopupFrame) @@ -490,8 +490,8 @@ nsXULPopupManager::PopupResized(nsIFrame* aFrame, nsIntSize aSize) // as 'width' and 'height' attributes on the popup. nsPresContext* presContext = menuPopupFrame->PresContext(); - nsIntSize newCSS(presContext->DevPixelsToIntCSSPixels(aSize.width), - presContext->DevPixelsToIntCSSPixels(aSize.height)); + CSSIntSize newCSS(presContext->DevPixelsToIntCSSPixels(aSize.width), + presContext->DevPixelsToIntCSSPixels(aSize.height)); nsIContent* popup = menuPopupFrame->GetContent(); nsAutoString width, height; diff --git a/layout/xul/nsXULPopupManager.h b/layout/xul/nsXULPopupManager.h index c01d0e020d..9120420d8a 100644 --- a/layout/xul/nsXULPopupManager.h +++ b/layout/xul/nsXULPopupManager.h @@ -10,7 +10,7 @@ #ifndef nsXULPopupManager_h__ #define nsXULPopupManager_h__ -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsIContent.h" #include "nsIRollupListener.h" #include "nsIDOMEventListener.h" @@ -24,6 +24,7 @@ #include "nsStyleConsts.h" #include "nsWidgetInitData.h" #include "mozilla/Attributes.h" +#include "Units.h" // X.h defines KeyPress #ifdef KeyPress @@ -531,9 +532,9 @@ public: /** * Indicate that the popup associated with aView has been resized to the - * specified screen width and height. + * given device pixel size aSize. */ - void PopupResized(nsIFrame* aFrame, nsIntSize ASize); + void PopupResized(nsIFrame* aFrame, mozilla::LayoutDeviceIntSize aSize); /** * Called when a popup frame is destroyed. In this case, just remove the diff --git a/layout/xul/test/test_bug703150.xul b/layout/xul/test/test_bug703150.xul index 32e680b175..fab7d16774 100644 --- a/layout/xul/test/test_bug703150.xul +++ b/layout/xul/test/test_bug703150.xul @@ -33,7 +33,7 @@ function doTest() SimpleTest.executeSoon(function () { synthesizeMouseAtCenter(scrollbarThumb, { type: "mousedown" }); - is(scrollbar.getAttribute("curpos"), 0, + is(scrollbar.getAttribute("curpos"), "0", "scrollbar thumb has been moved already"); synthesizeMouseAtCenter(scrollbar, { type: "mousemove" }); diff --git a/layout/xul/test/test_stack.xul b/layout/xul/test/test_stack.xul index fdfb6977f9..781a6f298e 100644 --- a/layout/xul/test/test_stack.xul +++ b/layout/xul/test/test_stack.xul @@ -167,7 +167,7 @@ else expectedval = (vertical ? stackRect.top : stackRect.left) + Number(expectedval); - is(actual, expectedval, child.id + " " + side + (dyn ? " dynamic" : "")); + is(+actual, expectedval, child.id + " " + side + (dyn ? " dynamic" : "")); } function runTest() @@ -245,8 +245,8 @@ // stack size will be effected by it dynStack.appendChild(child); stackRect = dynStack.getBoundingClientRect(); - is(stackRect.width, child.getAttribute("stackwidth"), child.id + " stack width" + (dyn ? " dynamic" : "")); - is(stackRect.height, child.getAttribute("stackheight"), child.id + " stack height" + (dyn ? " dynamic" : "")); + is(String(stackRect.width), child.getAttribute("stackwidth"), child.id + " stack width" + (dyn ? " dynamic" : "")); + is(String(stackRect.height), child.getAttribute("stackheight"), child.id + " stack height" + (dyn ? " dynamic" : "")); } var childrect = child.getBoundingClientRect(); diff --git a/media/libstagefright/binding/MoofParser.cpp b/media/libstagefright/binding/MoofParser.cpp index 147670a514..3f45230550 100644 --- a/media/libstagefright/binding/MoofParser.cpp +++ b/media/libstagefright/binding/MoofParser.cpp @@ -8,7 +8,7 @@ #include #include "Intervals.h" -#include "prlog.h" +#include "mozilla/Logging.h" #ifdef PR_LOGGING extern PRLogModuleInfo* GetDemuxerLog(); diff --git a/media/mtransport/logging.h b/media/mtransport/logging.h index 86c9549edb..1df7095c87 100644 --- a/media/mtransport/logging.h +++ b/media/mtransport/logging.h @@ -10,7 +10,7 @@ #define logging_h__ #include -#include +#include "mozilla/Logging.h" #if defined(PR_LOGGING) diff --git a/modules/libjar/nsJAR.h b/modules/libjar/nsJAR.h index 4f6da72906..9420752725 100644 --- a/modules/libjar/nsJAR.h +++ b/modules/libjar/nsJAR.h @@ -9,7 +9,7 @@ #include "nscore.h" #include "prio.h" #include "plstr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prinrval.h" #include "mozilla/Atomics.h" diff --git a/modules/libjar/nsJARChannel.h b/modules/libjar/nsJARChannel.h index 59e0777afd..6a2941d231 100644 --- a/modules/libjar/nsJARChannel.h +++ b/modules/libjar/nsJARChannel.h @@ -24,7 +24,7 @@ #include "nsIURI.h" #include "nsCOMPtr.h" #include "nsString.h" -#include "prlog.h" +#include "mozilla/Logging.h" class nsJARInputThunk; diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp index b3d22efc4e..4d734ce835 100644 --- a/modules/libjar/nsZipArchive.cpp +++ b/modules/libjar/nsZipArchive.cpp @@ -20,7 +20,7 @@ #include "nsISupportsUtils.h" #include "prio.h" #include "plstr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "stdlib.h" #include "nsWildCard.h" #include "nsZipArchive.h" diff --git a/modules/libpref/prefapi.cpp b/modules/libpref/prefapi.cpp index cf661895bd..f6386767b0 100644 --- a/modules/libpref/prefapi.cpp +++ b/modules/libpref/prefapi.cpp @@ -22,7 +22,7 @@ #include "plstr.h" #include "pldhash.h" #include "plbase64.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prprf.h" #include "mozilla/MemoryReporting.h" #include "mozilla/dom/PContent.h" diff --git a/netwerk/base/BackgroundFileSaver.cpp b/netwerk/base/BackgroundFileSaver.cpp index a0a6b57b0e..7352c2eb85 100644 --- a/netwerk/base/BackgroundFileSaver.cpp +++ b/netwerk/base/BackgroundFileSaver.cpp @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "pk11pub.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "ScopedNSSTypes.h" #include "secoidt.h" diff --git a/netwerk/base/Predictor.cpp b/netwerk/base/Predictor.cpp index 3eb385e22e..4e1c0ce911 100644 --- a/netwerk/base/Predictor.cpp +++ b/netwerk/base/Predictor.cpp @@ -32,7 +32,7 @@ #ifdef MOZ_NUWA_PROCESS #include "ipc/Nuwa.h" #endif -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/Preferences.h" diff --git a/netwerk/base/nsAsyncRedirectVerifyHelper.cpp b/netwerk/base/nsAsyncRedirectVerifyHelper.cpp index 6a61a6910c..846699f29f 100644 --- a/netwerk/base/nsAsyncRedirectVerifyHelper.cpp +++ b/netwerk/base/nsAsyncRedirectVerifyHelper.cpp @@ -3,7 +3,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsAsyncRedirectVerifyHelper.h" #include "nsThreadUtils.h" #include "nsNetUtil.h" diff --git a/netwerk/base/nsAsyncStreamCopier.cpp b/netwerk/base/nsAsyncStreamCopier.cpp index ad8584383c..3b3d9de43d 100644 --- a/netwerk/base/nsAsyncStreamCopier.cpp +++ b/netwerk/base/nsAsyncStreamCopier.cpp @@ -8,7 +8,7 @@ #include "nsStreamUtils.h" #include "nsThreadUtils.h" #include "nsNetUtil.h" -#include "prlog.h" +#include "mozilla/Logging.h" using namespace mozilla; diff --git a/netwerk/base/nsAutodialWin.cpp b/netwerk/base/nsAutodialWin.cpp index e34c27a30c..a10d3c2baa 100644 --- a/netwerk/base/nsAutodialWin.cpp +++ b/netwerk/base/nsAutodialWin.cpp @@ -12,7 +12,7 @@ #include #include "nsString.h" #include "nsAutodialWin.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsWindowsHelpers.h" #define AUTODIAL_DEFAULT AUTODIAL_NEVER diff --git a/netwerk/base/nsChannelClassifier.cpp b/netwerk/base/nsChannelClassifier.cpp index 65db2688e6..bb139c52ef 100644 --- a/netwerk/base/nsChannelClassifier.cpp +++ b/netwerk/base/nsChannelClassifier.cpp @@ -31,7 +31,7 @@ #include "mozilla/Preferences.h" -#include "prlog.h" +#include "mozilla/Logging.h" using mozilla::ArrayLength; using mozilla::Preferences; diff --git a/netwerk/base/nsDirectoryIndexStream.cpp b/netwerk/base/nsDirectoryIndexStream.cpp index eb37f56555..9a81138055 100644 --- a/netwerk/base/nsDirectoryIndexStream.cpp +++ b/netwerk/base/nsDirectoryIndexStream.cpp @@ -16,7 +16,7 @@ #include "nsEscape.h" #include "nsDirectoryIndexStream.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prtime.h" static PRLogModuleInfo* gLog; diff --git a/netwerk/base/nsInputStreamPump.cpp b/netwerk/base/nsInputStreamPump.cpp index 8feb0bc564..9495d1af92 100644 --- a/netwerk/base/nsInputStreamPump.cpp +++ b/netwerk/base/nsInputStreamPump.cpp @@ -12,7 +12,7 @@ #include "nsIThreadRetargetableStreamListener.h" #include "nsThreadUtils.h" #include "nsCOMPtr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "GeckoProfiler.h" #include "nsIStreamListener.h" #include "nsILoadGroup.h" diff --git a/netwerk/base/nsLoadGroup.cpp b/netwerk/base/nsLoadGroup.cpp index f0b79d9b39..ef3530d6ae 100644 --- a/netwerk/base/nsLoadGroup.cpp +++ b/netwerk/base/nsLoadGroup.cpp @@ -11,7 +11,7 @@ #include "nsArrayEnumerator.h" #include "nsCOMArray.h" #include "nsCOMPtr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsString.h" #include "nsTArray.h" #include "mozilla/Atomics.h" diff --git a/netwerk/base/nsPACMan.h b/netwerk/base/nsPACMan.h index e8722a1a53..28249e8136 100644 --- a/netwerk/base/nsPACMan.h +++ b/netwerk/base/nsPACMan.h @@ -19,7 +19,7 @@ #include "mozilla/LinkedList.h" #include "nsAutoPtr.h" #include "mozilla/TimeStamp.h" -#include "prlog.h" +#include "mozilla/Logging.h" class nsPACMan; class nsISystemProxySettings; diff --git a/netwerk/base/nsProtocolProxyService.cpp b/netwerk/base/nsProtocolProxyService.cpp index 36fcb9aa76..8654bc4324 100644 --- a/netwerk/base/nsProtocolProxyService.cpp +++ b/netwerk/base/nsProtocolProxyService.cpp @@ -47,7 +47,7 @@ namespace mozilla { using namespace mozilla; -#include "prlog.h" +#include "mozilla/Logging.h" #undef LOG #define LOG(args) PR_LOG(net::GetProxyLog(), PR_LOG_DEBUG, args) diff --git a/netwerk/base/nsRequestObserverProxy.cpp b/netwerk/base/nsRequestObserverProxy.cpp index af0c46cf36..16014bc03f 100644 --- a/netwerk/base/nsRequestObserverProxy.cpp +++ b/netwerk/base/nsRequestObserverProxy.cpp @@ -9,7 +9,7 @@ #include "nsRequestObserverProxy.h" #include "nsIRequest.h" #include "nsAutoPtr.h" -#include "prlog.h" +#include "mozilla/Logging.h" using namespace mozilla; diff --git a/netwerk/base/nsSocketTransportService2.h b/netwerk/base/nsSocketTransportService2.h index a527da44ce..f83b5ad888 100644 --- a/netwerk/base/nsSocketTransportService2.h +++ b/netwerk/base/nsSocketTransportService2.h @@ -12,7 +12,7 @@ #include "nsEventQueue.h" #include "nsCOMPtr.h" #include "prinrval.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prinit.h" #include "nsIObserver.h" #include "mozilla/Mutex.h" diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index 6a281649c7..c67f24b1e9 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -15,7 +15,7 @@ #include "nsIPrefService.h" #include "nsIPrefBranch.h" #include "nsIIDNService.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsAutoPtr.h" #include "nsIProgrammingLanguage.h" #include "nsIURLParser.h" diff --git a/netwerk/cache/nsCache.h b/netwerk/cache/nsCache.h index 3744331b26..5876b325d8 100644 --- a/netwerk/cache/nsCache.h +++ b/netwerk/cache/nsCache.h @@ -11,7 +11,7 @@ #ifndef _nsCache_h_ #define _nsCache_h_ -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsISupports.h" #include "nsIFile.h" #include "nsAString.h" diff --git a/netwerk/cache2/CacheLog.h b/netwerk/cache2/CacheLog.h index 0db4f42092..911d02a3cb 100644 --- a/netwerk/cache2/CacheLog.h +++ b/netwerk/cache2/CacheLog.h @@ -5,7 +5,7 @@ #ifndef Cache2Log__h__ #define Cache2Log__h__ -#include "prlog.h" +#include "mozilla/Logging.h" namespace mozilla { namespace net { diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index 2832ca8e56..1c9217cbbe 100644 --- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -175,7 +175,7 @@ struct nsListIter // set NSPR_LOG_MODULES=cookie:4 -- shows accepted and rejected cookies // set NSPR_LOG_FILE=cookie.log // -#include "prlog.h" +#include "mozilla/Logging.h" #endif // define logging macros for convenience diff --git a/netwerk/dns/GetAddrInfo.cpp b/netwerk/dns/GetAddrInfo.cpp index c1f0a6514a..e608191600 100644 --- a/netwerk/dns/GetAddrInfo.cpp +++ b/netwerk/dns/GetAddrInfo.cpp @@ -22,7 +22,7 @@ #include #endif -#include "prlog.h" +#include "mozilla/Logging.h" static PRLogModuleInfo *gGetAddrInfoLog = PR_NewLogModule("GetAddrInfo"); #define LOG(msg, ...) \ PR_LOG(gGetAddrInfoLog, PR_LOG_DEBUG, ("[DNS]: " msg, ##__VA_ARGS__)) diff --git a/netwerk/dns/nsHostResolver.cpp b/netwerk/dns/nsHostResolver.cpp index d9f3b4e57d..8f869e6696 100644 --- a/netwerk/dns/nsHostResolver.cpp +++ b/netwerk/dns/nsHostResolver.cpp @@ -23,7 +23,7 @@ #include "prthread.h" #include "prerror.h" #include "prtime.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "pldhash.h" #include "plstr.h" #include "nsURLHelper.h" diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp index 57eebea8af..6d8068ffb1 100644 --- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp +++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp @@ -7,7 +7,7 @@ #include #include "prprf.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prtime.h" #include "nsIOService.h" diff --git a/netwerk/protocol/ftp/nsFtpControlConnection.cpp b/netwerk/protocol/ftp/nsFtpControlConnection.cpp index 43f6a4f194..1350a880a3 100644 --- a/netwerk/protocol/ftp/nsFtpControlConnection.cpp +++ b/netwerk/protocol/ftp/nsFtpControlConnection.cpp @@ -6,7 +6,7 @@ #include "nsIOService.h" #include "nsFtpControlConnection.h" #include "nsFtpProtocolHandler.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsIInputStream.h" #include "nsISocketTransportService.h" #include "nsISocketTransport.h" diff --git a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp index ee13366aa9..0ea266c883 100644 --- a/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp +++ b/netwerk/protocol/ftp/nsFtpProtocolHandler.cpp @@ -25,7 +25,7 @@ using namespace mozilla::net; #include "nsFtpProtocolHandler.h" #include "nsFTPChannel.h" #include "nsIStandardURL.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsIPrefService.h" #include "nsIPrefBranch.h" #include "nsIObserverService.h" diff --git a/netwerk/protocol/rtsp/controller/RtspController.cpp b/netwerk/protocol/rtsp/controller/RtspController.cpp index 77074dd020..5d868e1498 100644 --- a/netwerk/protocol/rtsp/controller/RtspController.cpp +++ b/netwerk/protocol/rtsp/controller/RtspController.cpp @@ -33,7 +33,7 @@ #include "nsNetUtil.h" #include "mozilla/Attributes.h" #include "mozilla/TimeStamp.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "plbase64.h" #include "prmem.h" diff --git a/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp b/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp index f0ee73897c..d90590808c 100644 --- a/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp +++ b/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp @@ -14,7 +14,7 @@ #include "mozilla/ipc/InputStreamUtils.h" #include "mozilla/ipc/URIUtils.h" #include "nsStringStream.h" -#include "prlog.h" +#include "mozilla/Logging.h" PRLogModuleInfo* gRtspChildLog = nullptr; #undef LOG diff --git a/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp b/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp index 22eacc279e..9fcb1dfec4 100644 --- a/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp +++ b/netwerk/protocol/rtsp/controller/RtspControllerParent.cpp @@ -13,7 +13,7 @@ #include "mozilla/ipc/URIUtils.h" #include "mozilla/unused.h" #include "nsNetUtil.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include diff --git a/netwerk/protocol/rtsp/controller/RtspMetaData.cpp b/netwerk/protocol/rtsp/controller/RtspMetaData.cpp index e773e32533..1ee5fb338b 100644 --- a/netwerk/protocol/rtsp/controller/RtspMetaData.cpp +++ b/netwerk/protocol/rtsp/controller/RtspMetaData.cpp @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "RtspMetaData.h" -#include "prlog.h" +#include "mozilla/Logging.h" using namespace mozilla; diff --git a/netwerk/protocol/rtsp/rtsp/RTSPConnectionHandler.h b/netwerk/protocol/rtsp/rtsp/RTSPConnectionHandler.h index e585d48842..4017fbbc70 100644 --- a/netwerk/protocol/rtsp/rtsp/RTSPConnectionHandler.h +++ b/netwerk/protocol/rtsp/rtsp/RTSPConnectionHandler.h @@ -39,7 +39,7 @@ #include #include "nsPrintfCString.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prio.h" #include "prnetdb.h" diff --git a/netwerk/protocol/rtsp/rtsp/RtspPrlog.h b/netwerk/protocol/rtsp/rtsp/RtspPrlog.h index 875a8cac33..63007afe34 100644 --- a/netwerk/protocol/rtsp/rtsp/RtspPrlog.h +++ b/netwerk/protocol/rtsp/rtsp/RtspPrlog.h @@ -7,7 +7,7 @@ #ifndef RTSPPRLOG_H #define RTSPPRLOG_H -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* gRtspLog; diff --git a/netwerk/protocol/websocket/WebSocketLog.h b/netwerk/protocol/websocket/WebSocketLog.h index 6e5008be11..5197aa818e 100644 --- a/netwerk/protocol/websocket/WebSocketLog.h +++ b/netwerk/protocol/websocket/WebSocketLog.h @@ -8,7 +8,7 @@ #define WebSocketLog_h #include "base/basictypes.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/net/NeckoChild.h" extern PRLogModuleInfo* webSocketLog; diff --git a/netwerk/protocol/wyciwyg/nsWyciwyg.h b/netwerk/protocol/wyciwyg/nsWyciwyg.h index a2849df0ff..55d2d5c6d1 100644 --- a/netwerk/protocol/wyciwyg/nsWyciwyg.h +++ b/netwerk/protocol/wyciwyg/nsWyciwyg.h @@ -10,7 +10,7 @@ // Get rid of chromium's LOG. #undef LOG -#include "prlog.h" +#include "mozilla/Logging.h" // // Log module for HTTP Protocol logging... diff --git a/netwerk/sctp/datachannel/DataChannelLog.h b/netwerk/sctp/datachannel/DataChannelLog.h index 1fb1b38617..4f832812a8 100644 --- a/netwerk/sctp/datachannel/DataChannelLog.h +++ b/netwerk/sctp/datachannel/DataChannelLog.h @@ -8,7 +8,7 @@ #define DataChannelLog_h #include "base/basictypes.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* GetDataChannelLog(); extern PRLogModuleInfo* GetSCTPLog(); diff --git a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp index 73e8ae1ea4..a83fb5a29b 100644 --- a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp +++ b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp @@ -6,7 +6,7 @@ #include "nsFTPDirListingConv.h" #include "nsMemory.h" #include "plstr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsCOMPtr.h" #include "nsEscape.h" #include "nsStringStream.h" diff --git a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp index 00adcb773f..0a54de5410 100644 --- a/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp +++ b/netwerk/system/linux/nsNotifyAddrListener_Linux.cpp @@ -19,7 +19,7 @@ #include "nsNotifyAddrListener_Linux.h" #include "nsString.h" #include "nsAutoPtr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/Services.h" #include "mozilla/Preferences.h" diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp index 2701275f79..d05d1e404a 100644 --- a/netwerk/system/win32/nsNotifyAddrListener.cpp +++ b/netwerk/system/win32/nsNotifyAddrListener.cpp @@ -19,7 +19,7 @@ #include #include #include "plstr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsThreadUtils.h" #include "nsIObserverService.h" #include "nsServiceManagerUtils.h" diff --git a/netwerk/test/TestBlockingSocket.cpp b/netwerk/test/TestBlockingSocket.cpp index 2830dbc903..d7d420fb86 100644 --- a/netwerk/test/TestBlockingSocket.cpp +++ b/netwerk/test/TestBlockingSocket.cpp @@ -12,7 +12,7 @@ #include "nsStringAPI.h" #include "nsIFile.h" #include "nsNetUtil.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prenv.h" #include "prthread.h" #include diff --git a/netwerk/test/TestIOThreads.cpp b/netwerk/test/TestIOThreads.cpp index 20daefe8ff..699c3d2a25 100644 --- a/netwerk/test/TestIOThreads.cpp +++ b/netwerk/test/TestIOThreads.cpp @@ -9,7 +9,7 @@ #include "nsIEventTarget.h" #include "nsCOMPtr.h" #include "nsNetCID.h" -#include "prlog.h" +#include "mozilla/Logging.h" // // set NSPR_LOG_MODULES=Test:5 diff --git a/netwerk/test/TestProtocols.cpp b/netwerk/test/TestProtocols.cpp index df5f66e843..678e3bc53f 100644 --- a/netwerk/test/TestProtocols.cpp +++ b/netwerk/test/TestProtocols.cpp @@ -55,7 +55,7 @@ #include "nsISimpleEnumerator.h" #include "nsStringAPI.h" #include "nsNetUtil.h" -#include "prlog.h" +#include "mozilla/Logging.h" using namespace mozilla; diff --git a/netwerk/test/TestServ.cpp b/netwerk/test/TestServ.cpp index aed92f26c3..ac89ea057c 100644 --- a/netwerk/test/TestServ.cpp +++ b/netwerk/test/TestServ.cpp @@ -11,7 +11,7 @@ #include "nsNetUtil.h" #include "nsStringAPI.h" #include "nsCOMPtr.h" -#include "prlog.h" +#include "mozilla/Logging.h" // // set NSPR_LOG_MODULES=Test:5 diff --git a/netwerk/test/TestSocketTransport.cpp b/netwerk/test/TestSocketTransport.cpp index d657aba507..550e3b8cb3 100644 --- a/netwerk/test/TestSocketTransport.cpp +++ b/netwerk/test/TestSocketTransport.cpp @@ -23,7 +23,7 @@ #include "nsIFile.h" #include "nsNetUtil.h" #include "nsAutoLock.h" -#include "prlog.h" +#include "mozilla/Logging.h" //////////////////////////////////////////////////////////////////////////////// diff --git a/netwerk/test/TestStreamChannel.cpp b/netwerk/test/TestStreamChannel.cpp index 8452f8eb79..775375da0c 100644 --- a/netwerk/test/TestStreamChannel.cpp +++ b/netwerk/test/TestStreamChannel.cpp @@ -20,7 +20,7 @@ #include "nsIFile.h" #include "nsNetUtil.h" #include "nsAutoLock.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include //////////////////////////////////////////////////////////////////////////////// diff --git a/netwerk/test/TestStreamLoader.cpp b/netwerk/test/TestStreamLoader.cpp index e43bf94bc5..adaee65fee 100644 --- a/netwerk/test/TestStreamLoader.cpp +++ b/netwerk/test/TestStreamLoader.cpp @@ -2,7 +2,7 @@ #include "TestCommon.h" #include "nsNetUtil.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/Attributes.h" #include "nsIScriptSecurityManager.h" diff --git a/netwerk/test/TestStreamPump.cpp b/netwerk/test/TestStreamPump.cpp index 6a006e48e2..7f27e5e00a 100644 --- a/netwerk/test/TestStreamPump.cpp +++ b/netwerk/test/TestStreamPump.cpp @@ -21,7 +21,7 @@ #include "nsIFile.h" #include "nsNetUtil.h" #include "nsAutoLock.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prprf.h" #include diff --git a/netwerk/test/TestStreamTransport.cpp b/netwerk/test/TestStreamTransport.cpp index c8e12e4dd0..0a286a9d53 100644 --- a/netwerk/test/TestStreamTransport.cpp +++ b/netwerk/test/TestStreamTransport.cpp @@ -20,7 +20,7 @@ #include "nsIFile.h" #include "nsNetUtil.h" #include "nsAutoLock.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prenv.h" //////////////////////////////////////////////////////////////////////////////// diff --git a/netwerk/test/TestUpload.cpp b/netwerk/test/TestUpload.cpp index b01cf13b27..2af5b9a86d 100644 --- a/netwerk/test/TestUpload.cpp +++ b/netwerk/test/TestUpload.cpp @@ -15,7 +15,7 @@ #include "nsIUploadChannel.h" -#include "prlog.h" +#include "mozilla/Logging.h" // // set NSPR_LOG_MODULES=Test:5 // diff --git a/netwerk/wifi/nsWifiAccessPoint.cpp b/netwerk/wifi/nsWifiAccessPoint.cpp index a2f1d17fb4..1243abdf67 100644 --- a/netwerk/wifi/nsWifiAccessPoint.cpp +++ b/netwerk/wifi/nsWifiAccessPoint.cpp @@ -5,7 +5,7 @@ #include "nsWifiAccessPoint.h" #include "nsString.h" #include "nsMemory.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo *gWifiMonitorLog; #define LOG(args) PR_LOG(gWifiMonitorLog, PR_LOG_DEBUG, args) diff --git a/netwerk/wifi/nsWifiMonitor.h b/netwerk/wifi/nsWifiMonitor.h index 3e462facad..21f4c8a0a1 100644 --- a/netwerk/wifi/nsWifiMonitor.h +++ b/netwerk/wifi/nsWifiMonitor.h @@ -15,7 +15,7 @@ #include "nsIWifiListener.h" #include "mozilla/Atomics.h" #include "mozilla/ReentrantMonitor.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsIObserver.h" #include "nsTArray.h" #include "nsITimer.h" diff --git a/parser/html/nsHtml5NamedCharacters.cpp b/parser/html/nsHtml5NamedCharacters.cpp index d7da564829..8b38685596 100644 --- a/parser/html/nsHtml5NamedCharacters.cpp +++ b/parser/html/nsHtml5NamedCharacters.cpp @@ -25,7 +25,7 @@ #include "nscore.h" #include "nsDebug.h" #include "mozilla/ArrayUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsHtml5NamedCharacters.h" diff --git a/parser/html/nsHtml5NamedCharacters.h b/parser/html/nsHtml5NamedCharacters.h index e80655e37a..9c6cc3a9bd 100644 --- a/parser/html/nsHtml5NamedCharacters.h +++ b/parser/html/nsHtml5NamedCharacters.h @@ -26,7 +26,7 @@ #include "jArray.h" #include "nscore.h" #include "nsDebug.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsMemory.h" struct nsHtml5CharacterName { diff --git a/parser/html/nsHtml5NamedCharactersAccel.h b/parser/html/nsHtml5NamedCharactersAccel.h index 8098c00c4f..8e6df8ebbb 100644 --- a/parser/html/nsHtml5NamedCharactersAccel.h +++ b/parser/html/nsHtml5NamedCharactersAccel.h @@ -12,7 +12,7 @@ #include "jArray.h" #include "nscore.h" #include "nsDebug.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsMemory.h" class nsHtml5NamedCharactersAccel diff --git a/rdf/base/nsCompositeDataSource.cpp b/rdf/base/nsCompositeDataSource.cpp index 7a96e20d54..b42ae54603 100644 --- a/rdf/base/nsCompositeDataSource.cpp +++ b/rdf/base/nsCompositeDataSource.cpp @@ -42,7 +42,7 @@ #include "nsEnumeratorUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prprf.h" #include PRLogModuleInfo* nsRDFLog = nullptr; diff --git a/rdf/base/nsContainerEnumerator.cpp b/rdf/base/nsContainerEnumerator.cpp index b26988b478..f1bfc64546 100644 --- a/rdf/base/nsContainerEnumerator.cpp +++ b/rdf/base/nsContainerEnumerator.cpp @@ -30,7 +30,7 @@ #include "nsRDFCID.h" #include "nsString.h" #include "nsXPIDLString.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "rdf.h" #include "rdfutil.h" diff --git a/rdf/base/nsInMemoryDataSource.cpp b/rdf/base/nsInMemoryDataSource.cpp index 66e5b67de0..103738f0e6 100644 --- a/rdf/base/nsInMemoryDataSource.cpp +++ b/rdf/base/nsInMemoryDataSource.cpp @@ -63,7 +63,7 @@ #include "rdfutil.h" #include "pldhash.h" #include "plstr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "rdf.h" #include "rdfIDataSource.h" diff --git a/rdf/base/nsRDFContentSink.cpp b/rdf/base/nsRDFContentSink.cpp index c4e58f2e59..5434f2a7f8 100644 --- a/rdf/base/nsRDFContentSink.cpp +++ b/rdf/base/nsRDFContentSink.cpp @@ -53,7 +53,7 @@ #include "nsRDFCID.h" #include "nsTArray.h" #include "nsXPIDLString.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "rdf.h" #include "rdfutil.h" #include "nsReadableUtils.h" diff --git a/rdf/base/nsRDFService.cpp b/rdf/base/nsRDFService.cpp index 237e86124f..07ad6de984 100644 --- a/rdf/base/nsRDFService.cpp +++ b/rdf/base/nsRDFService.cpp @@ -49,7 +49,7 @@ #include "pldhash.h" #include "plhash.h" #include "plstr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prprf.h" #include "prmem.h" #include "rdf.h" diff --git a/rdf/base/nsRDFXMLDataSource.cpp b/rdf/base/nsRDFXMLDataSource.cpp index 3af4e16d3e..6449c3c1b2 100644 --- a/rdf/base/nsRDFXMLDataSource.cpp +++ b/rdf/base/nsRDFXMLDataSource.cpp @@ -86,7 +86,7 @@ #include "prthread.h" #include "rdf.h" #include "rdfutil.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsNameSpaceMap.h" #include "nsCRT.h" #include "nsCycleCollectionParticipant.h" diff --git a/rdf/util/nsRDFResource.cpp b/rdf/util/nsRDFResource.cpp index f7920667b1..0e6f01f14a 100644 --- a/rdf/util/nsRDFResource.cpp +++ b/rdf/util/nsRDFResource.cpp @@ -8,7 +8,7 @@ #include "nsIRDFDelegateFactory.h" #include "nsIRDFService.h" #include "nsRDFCID.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsComponentManagerUtils.h" #include "nsServiceManagerUtils.h" diff --git a/security/apps/AppSignatureVerification.cpp b/security/apps/AppSignatureVerification.cpp index a0c83848f9..4aa8afa097 100644 --- a/security/apps/AppSignatureVerification.cpp +++ b/security/apps/AppSignatureVerification.cpp @@ -30,7 +30,7 @@ #include "nsString.h" #include "nsTHashtable.h" #include "plstr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "pkix/pkix.h" #include "pkix/pkixnss.h" #include "secmime.h" diff --git a/security/manager/boot/src/CertBlocklist.cpp b/security/manager/boot/src/CertBlocklist.cpp index 29c51517e4..60e36d9583 100644 --- a/security/manager/boot/src/CertBlocklist.cpp +++ b/security/manager/boot/src/CertBlocklist.cpp @@ -17,7 +17,7 @@ #include "nsTHashtable.h" #include "nsThreadUtils.h" #include "pkix/Input.h" -#include "prlog.h" +#include "mozilla/Logging.h" NS_IMPL_ISUPPORTS(CertBlocklist, nsICertBlocklist) diff --git a/security/manager/boot/src/PublicKeyPinningService.cpp b/security/manager/boot/src/PublicKeyPinningService.cpp index 98b3ab9de2..4c7bbcc5f8 100644 --- a/security/manager/boot/src/PublicKeyPinningService.cpp +++ b/security/manager/boot/src/PublicKeyPinningService.cpp @@ -15,7 +15,7 @@ #include "nsTArray.h" #include "pkix/stdkeywords.h" #include "pkix/pkixtypes.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "RootCertificateTelemetryUtils.h" #include "ScopedNSSTypes.h" #include "seccomon.h" diff --git a/security/manager/boot/src/RootCertificateTelemetryUtils.cpp b/security/manager/boot/src/RootCertificateTelemetryUtils.cpp index 6addc4fa04..1e4ca76468 100644 --- a/security/manager/boot/src/RootCertificateTelemetryUtils.cpp +++ b/security/manager/boot/src/RootCertificateTelemetryUtils.cpp @@ -6,7 +6,7 @@ #include "RootCertificateTelemetryUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "RootHashes.inc" // Note: Generated by genRootCAHashes.js #include "ScopedNSSTypes.h" #include "mozilla/ArrayUtils.h" diff --git a/security/manager/boot/src/nsEntropyCollector.cpp b/security/manager/boot/src/nsEntropyCollector.cpp index ef53d8717e..5a2df5bf3a 100644 --- a/security/manager/boot/src/nsEntropyCollector.cpp +++ b/security/manager/boot/src/nsEntropyCollector.cpp @@ -3,7 +3,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsEntropyCollector.h" #include "nsAlgorithm.h" #include diff --git a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp index 468d56a3c2..6013580a9a 100644 --- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp +++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp @@ -4,7 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nspr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsISecureBrowserUI.h" #include "nsSecureBrowserUIImpl.h" diff --git a/security/manager/boot/src/nsSecurityHeaderParser.cpp b/security/manager/boot/src/nsSecurityHeaderParser.cpp index 7a2bd58ded..514742bf2e 100644 --- a/security/manager/boot/src/nsSecurityHeaderParser.cpp +++ b/security/manager/boot/src/nsSecurityHeaderParser.cpp @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsSecurityHeaderParser.h" -#include "prlog.h" +#include "mozilla/Logging.h" // The character classes in this file are informed by [RFC2616], Section 2.2. // signed char is a signed data type one byte (8 bits) wide, so its value can diff --git a/security/manager/boot/src/nsSiteSecurityService.cpp b/security/manager/boot/src/nsSiteSecurityService.cpp index b4b98d293c..6cd87d5f32 100644 --- a/security/manager/boot/src/nsSiteSecurityService.cpp +++ b/security/manager/boot/src/nsSiteSecurityService.cpp @@ -21,7 +21,7 @@ #include "nsXULAppAPI.h" #include "pkix/pkixtypes.h" #include "plstr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prnetdb.h" #include "prprf.h" #include "PublicKeyPinningService.h" diff --git a/security/manager/ssl/src/PSMContentListener.cpp b/security/manager/ssl/src/PSMContentListener.cpp index 61a4083148..83aa92c16d 100644 --- a/security/manager/ssl/src/PSMContentListener.cpp +++ b/security/manager/ssl/src/PSMContentListener.cpp @@ -24,7 +24,7 @@ #include "nsNetUtil.h" #include "nsNSSHelper.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* gPIPNSSLog; diff --git a/security/manager/ssl/src/nsCertTree.cpp b/security/manager/ssl/src/nsCertTree.cpp index b7a8ad5c6d..10270fd3dd 100644 --- a/security/manager/ssl/src/nsCertTree.cpp +++ b/security/manager/ssl/src/nsCertTree.cpp @@ -22,7 +22,7 @@ #include "nsTHashtable.h" #include "nsHashKeys.h" -#include "prlog.h" +#include "mozilla/Logging.h" using namespace mozilla; diff --git a/security/manager/ssl/src/nsNSSIOLayer.cpp b/security/manager/ssl/src/nsNSSIOLayer.cpp index b93c96dcc1..79f53bd07a 100644 --- a/security/manager/ssl/src/nsNSSIOLayer.cpp +++ b/security/manager/ssl/src/nsNSSIOLayer.cpp @@ -13,7 +13,7 @@ #include "mozilla/DebugOnly.h" #include "mozilla/UniquePtr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prmem.h" #include "prnetdb.h" #include "nsIPrefService.h" diff --git a/security/manager/ssl/src/nsNTLMAuthModule.cpp b/security/manager/ssl/src/nsNTLMAuthModule.cpp index 64dfddfe5f..5e24f2594e 100644 --- a/security/manager/ssl/src/nsNTLMAuthModule.cpp +++ b/security/manager/ssl/src/nsNTLMAuthModule.cpp @@ -23,7 +23,7 @@ #include "nsNSSShutDown.h" #include "nsUnicharUtils.h" #include "pk11pub.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prsystem.h" static bool sNTLMv1Forced = false; diff --git a/storage/src/VacuumManager.cpp b/storage/src/VacuumManager.cpp index 1417dae1ce..cd3faa0344 100644 --- a/storage/src/VacuumManager.cpp +++ b/storage/src/VacuumManager.cpp @@ -13,7 +13,7 @@ #include "nsIObserverService.h" #include "nsIFile.h" #include "nsThreadUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prtime.h" #include "mozStorageConnection.h" diff --git a/storage/src/mozStorageAsyncStatement.cpp b/storage/src/mozStorageAsyncStatement.cpp index 71c9d58ee3..5f087d6bce 100644 --- a/storage/src/mozStorageAsyncStatement.cpp +++ b/storage/src/mozStorageAsyncStatement.cpp @@ -26,7 +26,7 @@ #include "mozStorageStatement.h" #include "nsDOMClassInfo.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo *gStorageLog; diff --git a/storage/src/mozStorageConnection.cpp b/storage/src/mozStorageConnection.cpp index 34fc4c77c4..f94ad8eebf 100644 --- a/storage/src/mozStorageConnection.cpp +++ b/storage/src/mozStorageConnection.cpp @@ -37,7 +37,7 @@ #include "mozStorageHelper.h" #include "GeckoProfiler.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prprf.h" #include "nsProxyRelease.h" #include diff --git a/storage/src/mozStoragePrivateHelpers.cpp b/storage/src/mozStoragePrivateHelpers.cpp index afd7f4a0c4..9ae13f42e3 100644 --- a/storage/src/mozStoragePrivateHelpers.cpp +++ b/storage/src/mozStoragePrivateHelpers.cpp @@ -23,7 +23,7 @@ #include "mozIStorageCompletionCallback.h" #include "mozIStorageBindingParams.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* gStorageLog; namespace mozilla { diff --git a/storage/src/mozStorageStatement.cpp b/storage/src/mozStorageStatement.cpp index cffa65dbf7..59eb0bca3f 100644 --- a/storage/src/mozStorageStatement.cpp +++ b/storage/src/mozStorageStatement.cpp @@ -26,7 +26,7 @@ #include "GeckoProfiler.h" #include "nsDOMClassInfo.h" -#include "prlog.h" +#include "mozilla/Logging.h" extern PRLogModuleInfo* gStorageLog; diff --git a/testing/mochitest/chrome/test_sample.xul b/testing/mochitest/chrome/test_sample.xul index d964572b1e..4b10ae2510 100644 --- a/testing/mochitest/chrome/test_sample.xul +++ b/testing/mochitest/chrome/test_sample.xul @@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=8675309 /** Test for Bug 8675309 **/ -is(1, "1", "sanity check"); +is_loosely(1, "1", "sanity check"); ok(true, "sanity check"); diff --git a/testing/mochitest/tests/Harness_sanity/test_sanity.html b/testing/mochitest/tests/Harness_sanity/test_sanity.html index a12a53678c..38791b1fae 100644 --- a/testing/mochitest/tests/Harness_sanity/test_sanity.html +++ b/testing/mochitest/tests/Harness_sanity/test_sanity.html @@ -13,7 +13,7 @@ -

@@ -22,13 +22,18 @@ /** Test for sanity **/ ok(true, "true must be ok"); -is(1, true, "1 must be true"); +is_loosely(1, true, "1 must loosely be true"); +isnot(1, true, "1 must not be true"); isnot(1, false, "1 must not be false"); -is(0, false, "0 must be false"); +is_loosely(0, false, "0 must loosely be false"); +isnot(0, false, "0 must not be false"); isnot(0, true, "0 must not be true"); -is("", 0, "Empty string must be 0"); -is("1", 1, "Numeric string must be equal the number"); +is_loosely("", 0, "Empty string must loosely be 0"); +isnot("", 0, "Empty string must not be 0"); +is_loosely("1", 1, "Numeric string must loosely equal the number"); +isnot("1", 1, "Numeric string must not equal the number"); isnot("", null, "Empty string must not be null"); +isnot(undefined, null, "Undefined must not be null"); var press1 = false; $("testKeyEvent1").focus(); diff --git a/testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-Async.html b/testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-Async.html index 63ae267169..7a321b955b 100644 --- a/testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-Async.html +++ b/testing/mochitest/tests/MochiKit-1.4.2/tests/test_MochiKit-Async.html @@ -261,7 +261,7 @@ try { callList[2].callback(4); defList.addCallback(function (lst) { - is( arrayEqual(lst, [[true, 4], [true, 6], [true, 5]]), 1, + is( arrayEqual(lst, [[true, 4], [true, 6], [true, 5]]), true, "deferredlist result ok" ); }); @@ -279,7 +279,7 @@ try { callList2[2].callback(4); defList2.addCallback(function (lst) { - is( arrayEqual(lst, [1, 6]), 1, "deferredlist fireOnOneCallback ok" ); + is( arrayEqual(lst, [1, 6]), true, "deferredlist fireOnOneCallback ok" ); }); /* @@ -331,7 +331,7 @@ try { callList5[2].callback(4); gatherRet.addCallback(function (lst) { - is( arrayEqual(lst, [4, 6, 5]), 1, + is( arrayEqual(lst, [4, 6, 5]), true, "gatherResults result ok" ); }); diff --git a/testing/mochitest/tests/SimpleTest/EventUtils.js b/testing/mochitest/tests/SimpleTest/EventUtils.js index 12b02beacc..f2581c22a4 100644 --- a/testing/mochitest/tests/SimpleTest/EventUtils.js +++ b/testing/mochitest/tests/SimpleTest/EventUtils.js @@ -674,7 +674,10 @@ const KEYBOARD_LAYOUT_THAI = /** * synthesizeNativeKey() dispatches native key event on active window. - * This is implemented only on Windows and Mac. + * This is implemented only on Windows and Mac. Note that this function + * dispatches the key event asynchronously and returns immediately. If a + * callback function is provided, the callback will be called upon + * completion of the key dispatch. * * @param aKeyboardLayout One of KEYBOARD_LAYOUT_* defined above. * @param aNativeKeyCode A native keycode value defined in @@ -687,12 +690,16 @@ const KEYBOARD_LAYOUT_THAI = * by the key event. * @param aUnmodifiedChars Specify characters of unmodified (except Shift) * aChar value. + * @param aCallback If provided, this callback will be invoked + * once the native keys have been processed + * by Gecko. Will never be called if this + * function returns false. * @return True if this function succeed dispatching * native key event. Otherwise, false. */ function synthesizeNativeKey(aKeyboardLayout, aNativeKeyCode, aModifiers, - aChars, aUnmodifiedChars) + aChars, aUnmodifiedChars, aCallback) { var utils = _getDOMWindowUtils(window); if (!utils) { @@ -707,9 +714,17 @@ function synthesizeNativeKey(aKeyboardLayout, aNativeKeyCode, aModifiers, if (nativeKeyboardLayout === null) { return false; } + + var observer = { + observe: function(aSubject, aTopic, aData) { + if (aCallback && aTopic == "keyevent") { + aCallback(aData); + } + } + }; utils.sendNativeKeyEvent(nativeKeyboardLayout, aNativeKeyCode, _parseNativeModifiers(aModifiers), - aChars, aUnmodifiedChars); + aChars, aUnmodifiedChars, observer); return true; } diff --git a/testing/mochitest/tests/SimpleTest/SimpleTest.js b/testing/mochitest/tests/SimpleTest/SimpleTest.js index 5b9d724a70..099acf6988 100644 --- a/testing/mochitest/tests/SimpleTest/SimpleTest.js +++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js @@ -270,13 +270,14 @@ SimpleTest.ok = function (condition, name, diag) { }; /** - * Roughly equivalent to ok(a==b, name) + * Roughly equivalent to ok(a===b, name) **/ SimpleTest.is = function (a, b, name) { - var pass = (a == b); + var pass = (a === b); var diag = pass ? "" : "got " + repr(a) + ", expected " + repr(b) SimpleTest.ok(pass, name, diag); }; +SimpleTest.ise = SimpleTest.is; SimpleTest.isfuzzy = function (a, b, epsilon, name) { var pass = (a >= b - epsilon) && (a <= b + epsilon); @@ -285,17 +286,17 @@ SimpleTest.isfuzzy = function (a, b, epsilon, name) { }; SimpleTest.isnot = function (a, b, name) { - var pass = (a != b); + var pass = (a !== b); var diag = pass ? "" : "didn't expect " + repr(a) + ", but got it"; SimpleTest.ok(pass, name, diag); }; /** - * Roughly equivalent to ok(a===b, name) + * Roughly equivalent to ok(a==b, name) **/ -SimpleTest.ise = function (a, b, name) { - var pass = (a === b); - var diag = pass ? "" : "got " + repr(a) + ", strictly expected " + repr(b) +SimpleTest.is_loosely = function (a, b, name) { + var pass = (a == b); + var diag = pass ? "" : "got " + repr(a) + ", expected " + repr(b) SimpleTest.ok(pass, name, diag); }; @@ -412,14 +413,14 @@ SimpleTest.info = function(name, message) { **/ SimpleTest.todo_is = function (a, b, name) { - var pass = (a == b); + var pass = (a === b); var diag = pass ? repr(a) + " should equal " + repr(b) : "got " + repr(a) + ", expected " + repr(b); SimpleTest.todo(pass, name, diag); }; SimpleTest.todo_isnot = function (a, b, name) { - var pass = (a != b); + var pass = (a !== b); var diag = pass ? repr(a) + " should not equal " + repr(b) : "didn't expect " + repr(a) + ", but got it"; SimpleTest.todo(pass, name, diag); @@ -1478,6 +1479,7 @@ var is = SimpleTest.is; var isfuzzy = SimpleTest.isfuzzy; var isnot = SimpleTest.isnot; var ise = SimpleTest.ise; +var is_loosely = SimpleTest.is_loosely; var todo = SimpleTest.todo; var todo_is = SimpleTest.todo_is; var todo_isnot = SimpleTest.todo_isnot; diff --git a/toolkit/components/filewatcher/NativeFileWatcherWin.cpp b/toolkit/components/filewatcher/NativeFileWatcherWin.cpp index defdb31d68..18324230e4 100644 --- a/toolkit/components/filewatcher/NativeFileWatcherWin.cpp +++ b/toolkit/components/filewatcher/NativeFileWatcherWin.cpp @@ -15,7 +15,7 @@ #include "nsIObserverService.h" #include "nsProxyRelease.h" #include "nsTArray.h" -#include "prlog.h" +#include "mozilla/Logging.h" namespace mozilla { diff --git a/toolkit/components/microformats/tests/test_Microformats.html b/toolkit/components/microformats/tests/test_Microformats.html index 000e9fbaaa..b311d4209d 100644 --- a/toolkit/components/microformats/tests/test_Microformats.html +++ b/toolkit/components/microformats/tests/test_Microformats.html @@ -240,11 +240,11 @@ function test_Microformats() { var nestCard3 = new hCard(document.getElementById("nested_vcard3")); is(nestCard1.fn, "John Doe", "nesting (fn) 1"); - is(nestCard1.title, "CEO", "nesting (title) 1"); + is(String(nestCard1.title), "CEO", "nesting (title) 1"); is(nestCard2.fn, "Jack Jones", "nesting (fn) 2"); - is(nestCard2.title, "Executive Assistant", "nesting (title) 2"); + is(String(nestCard2.title), "Executive Assistant", "nesting (title) 2"); is(nestCard3.fn, "Bob Smith", "nesting (fn) 3"); - is(nestCard3.title, "Office Assistant", "nesting (title) 3"); + is(String(nestCard3.title), "Office Assistant", "nesting (title) 3"); is(nestCard1.agent[0].agent[0].fn, "Bob Smith", "nesting all"); var dateCal = new hCalendar(document.getElementById("date_vcal")); @@ -253,7 +253,7 @@ function test_Microformats() { is(dateCal.dtstart, origdate, "date round trip"); var dateCal = new hCalendar(document.getElementById("vcal_vcard")); - is(dateCal.description, "Mozilla's Birthday", "vcard in vcal"); + is(String(dateCal.description), "Mozilla's Birthday", "vcard in vcal"); is(Microformats.count("hCard", document.getElementById("float_test")), 2, "Check Microformats.count for floated div"); @@ -292,7 +292,7 @@ function test_hCard() { var hCards = Microformats.get("hCard", document.getElementById("test_1"), {showHidden: true}); is(hCards[0].fn, "Tantek Çelik", "Check for fn on test vcard"); - is(hCards[0].url, "http://tantek.com/", "Check for url on test vcard"); + is(String(hCards[0].url), "http://tantek.com/", "Check for url on test vcard"); } diff --git a/toolkit/components/microformats/tests/test_Microformats_geo.html b/toolkit/components/microformats/tests/test_Microformats_geo.html index 63f0b6f14a..0fffaf31bb 100644 --- a/toolkit/components/microformats/tests/test_Microformats_geo.html +++ b/toolkit/components/microformats/tests/test_Microformats_geo.html @@ -95,18 +95,18 @@ function test_geo() { Geo = new geo(document.getElementById("01-geo-basic")); - is(Geo.latitude, "37.77", "01-geo-basic - latitude"); - is(Geo.longitude, "-122.411", "01-geo-basic - longitude"); + is(Geo.latitude, 37.77, "01-geo-basic - latitude"); + is(Geo.longitude, -122.411, "01-geo-basic - longitude"); Geo = new geo(document.getElementById("01-geo-abbr-latlong")); - is(Geo.latitude, "37.77", "02-geo-abbr-latlong - latitude"); - is(Geo.longitude, "-122.41", "02-geo-abbr-latlong - longitude"); + is(Geo.latitude, 37.77, "02-geo-abbr-latlong - latitude"); + is(Geo.longitude, -122.41, "02-geo-abbr-latlong - longitude"); Geo = new geo(document.getElementById("01-geo-abbr")); - is(Geo.latitude, "30.267991", "01-geo-abbr - latitude"); - is(Geo.longitude, "-97.739568", "01-geo-abbr - longitude"); + 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")); diff --git a/toolkit/components/microformats/tests/test_Microformats_hCalendar.html b/toolkit/components/microformats/tests/test_Microformats_hCalendar.html index 56520a1700..d884c608b6 100644 --- a/toolkit/components/microformats/tests/test_Microformats_hCalendar.html +++ b/toolkit/components/microformats/tests/test_Microformats_hCalendar.html @@ -230,7 +230,7 @@ function test_hCard() { is(hcalendar.dtstart, "2006-01-15T00:00:00", "06-component-vevent-uri-relative - dtstart"); hcalendar = new hCalendar(document.getElementById("07-component-vevent-description-simple")); - is(hcalendar.description, "Project xyz Review Meeting Minutes", "07-component-vevent-description-simple - description"); + is(String(hcalendar.description), "Project xyz Review Meeting Minutes", "07-component-vevent-description-simple - description"); hcalendar = new hCalendar(document.getElementById("08-component-vevent-multiple-classes")); is(hcalendar.dtstart, "2005-10-05", "08-component-vevent-multiple-classes - dtstart"); @@ -248,7 +248,7 @@ function test_hCard() { hcalendar = new hCalendar(document.getElementById("10-component-vevent-entity")); is(hcalendar.summary, "Cricket & Tennis Centre", "10-component-vevent-entity - summary"); - is(hcalendar.description, "Melbourne's Cricket & Tennis Centres are in the heart of the city", "10-component-vevent-entity - description"); + is(String(hcalendar.description), "Melbourne's Cricket & Tennis Centres are in the heart of the city", "10-component-vevent-entity - description"); hcalendar = new hCalendar(document.getElementById("11-component-vevent-summary-in-subelements")); is(hcalendar.dtstart, "2005-10-05T16:30:00-0700", "11-component-vevent-summary-in-subelements - dtstart"); @@ -278,7 +278,7 @@ function test_hCard() { is(hcalendar.url, "http://www.web2con.com/", "16-calendar-force-outlook - url"); hcalendar = new hCalendar(document.getElementById("17-component-vevent-description-value-in-subelements")); - is(hcalendar.description, "RESOLUTION: to have a 3rd PAW ftf meeting 18-19 Jan in Maryland; location contingent on confirmation from timbl", "17-component-vevent-description-value-in-subelements - description"); + is(String(hcalendar.description), "RESOLUTION: to have a 3rd PAW ftf meeting 18-19 Jan in Maryland; location contingent on confirmation from timbl", "17-component-vevent-description-value-in-subelements - description"); is(hcalendar.dtstart, "2006-01-18", "17-component-vevent-description-value-in-subelements - dtstart"); is(hcalendar.dtend, "2006-01-20", "17-component-vevent-description-value-in-subelements - dtend"); is(hcalendar.location, "Maryland", "17-component-vevent-description-value-in-subelements - location"); @@ -297,7 +297,7 @@ function test_hCard() { hcalendar = new hCalendar(document.getElementById("19-calendar-attachments")); hcalendar = new hCalendar(document.getElementById("empty-description")); - is (hcalendar.description, "", "Empty description"); + is(String(hcalendar.description), "", "Empty description"); } diff --git a/toolkit/components/microformats/tests/test_Microformats_hCard.html b/toolkit/components/microformats/tests/test_Microformats_hCard.html index c4348cfdc8..8b4ae9cacf 100644 --- a/toolkit/components/microformats/tests/test_Microformats_hCard.html +++ b/toolkit/components/microformats/tests/test_Microformats_hCard.html @@ -576,7 +576,7 @@ function test_hCard() { hcard = new hCard(document.getElementById("01-tantek-basic")); is(hcard.fn, "Tantek Çelik", "01-tantek-basic - fn"); - is(hcard.url, "http://tantek.com/", "01-tantek-basic - url"); + is(String(hcard.url), "http://tantek.com/", "01-tantek-basic - url"); is(hcard.n["given-name"][0], "Tantek", "01-tantek-basic - given-name"); is(hcard.n["family-name"][0], "Çelik", "01-tantek-basic - family-name"); is(hcard.org[0]["organization-name"], "Technorati", "01-tantek-basic - organization-name"); @@ -683,7 +683,7 @@ function test_hCard() { is(hcard.n["given-name"][0], "John", "07-relative-url - given-name"); is(hcard.n["family-name"][0], "Doe", "07-relative-url - family-name"); // is(hcard.url[0], "http://microformats.org/home/blah", "07-relative-url - url"); - is(hcard.url, "http://mochi.test:8888/home/blah", "07-relative-url - url"); + is(String(hcard.url), "http://mochi.test:8888/home/blah", "07-relative-url - url"); hcard = new hCard(document.getElementById("11-multiple-urls")); @@ -705,25 +705,25 @@ function test_hCard() { is(hcard.fn, "John Doe", "13-photo-logo - fn"); is(hcard.n["given-name"][0], "John", "13-photo-logo - given-name"); is(hcard.n["family-name"][0], "Doe", "13-photo-logo - family-name"); - is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - logo"); - is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - photo"); + is(String(hcard.logo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - logo"); + is(String(hcard.photo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "13-photo-logo - photo"); hcard = new hCard(document.getElementById("14-img-src-data-url")); is(hcard.fn, "John Doe", "14-img-src-data-url - fn"); is(hcard.n["given-name"][0], "John", "14-img-src-data-url - given-name"); is(hcard.n["family-name"][0], "Doe", "14-img-src-data-url - family-name"); - is(hcard.logo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - logo"); - is(hcard.photo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - photo"); + is(String(hcard.logo), "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - logo"); + is(String(hcard.photo), "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "14-img-src-data-url - photo"); hcard = new hCard(document.getElementById("15-honorific-additional-single")); is(hcard.fn, "Mr. John Maurice Doe, Ph.D.", "15-honorific-additional-single - fn"); is(hcard.n["given-name"][0], "John", "15-honorific-additional-single - given-name"); is(hcard.n["family-name"][0], "Doe", "15-honorific-additional-single - family-name"); - is(hcard.n["honorific-prefix"], "Mr.", "15-honorific-additional-single - honorific-prefix"); - is(hcard.n["additional-name"], "Maurice", "15-honorific-additional-single - additional-name"); - is(hcard.n["honorific-suffix"], "Ph.D.", "15-honorific-additional-single - honorific-suffix"); + is(String(hcard.n["honorific-prefix"]), "Mr.", "15-honorific-additional-single - honorific-prefix"); + is(String(hcard.n["additional-name"]), "Maurice", "15-honorific-additional-single - additional-name"); + is(String(hcard.n["honorific-suffix"]), "Ph.D.", "15-honorific-additional-single - honorific-suffix"); hcard = new hCard(document.getElementById("16-honorific-additional-multiple")); @@ -749,17 +749,17 @@ function test_hCard() { is(hcard.fn, "John Doe", "18-object-data-http-uri - fn"); is(hcard.n["given-name"][0], "John", "18-object-data-http-uri - given-name"); is(hcard.n["family-name"][0], "Doe", "18-object-data-http-uri - family-name"); - is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - logo"); - is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - photo"); - is(hcard.url, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - url"); + is(String(hcard.logo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - logo"); + is(String(hcard.photo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - photo"); + is(String(hcard.url), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "18-object-data-http-uri - url"); hcard = new hCard(document.getElementById("19-object-data-data-uri")); is(hcard.fn, "John Doe", "19-object-data-data-uri - fn"); is(hcard.n["given-name"][0], "John", "19-object-data-data-uri - given-name"); is(hcard.n["family-name"][0], "Doe", "19-object-data-data-uri - family-name"); - is(hcard.logo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - logo"); - is(hcard.photo, "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - photo"); + is(String(hcard.logo), "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - logo"); + is(String(hcard.photo), "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAASUExURf///8zMzJmZmWZmZjMzMwAAAPOPemkAAAM1SURBVHjaYmBgYGBkYQUBFkYWFiCPCchixQAMCCZAACF0MAMVM4K4TFh0IGsBCCAkOxhYmBnAAKaHhZkZmxaAAGJgYIbpYGBihGgBWsTMzMwE4jIhaWGAYoAAYmCECDExYAcwGxkg5oNIgABigDqLARdgZmGB2wICrKwAAcSA3xKgIxlZ0PwCEEAMBCxhgHoWSQtAADFAAxgfYEJ1GEAAQbQw4tUCsocBYQVAADEgu4uRkREeUCwszEwwLhOKLQABhNDCBA4aSDgwwhIAJKqYUPwCEEAMUK/AUwnc9aywJMCI7DAgAAggBohZ8JTBhGIJzCoWZL8ABBCYidAB8RUjWppkYUG2BSCAGMDqEMZiswUtXgACiAHsFYixTMywGGLGpgUWYgABxAA2mQkWCMyMqFoYmdD8ACQAAogBHJHMrCxg1cyIiICmCkYWDFsAAgiihYmZCewFFpR0BfI3LLch+QUggBiQ0iQjEyMDmh54qCBlUIAAYsCRJsElADQvgWKTlRGeKwECiAF3XgGmMEYQYADZzcoA9z5AAMG9RQCAtEC9DxBADFiyFyMjVi0wABBAWLQwQdIiuhYGWJIACCBg+KKUJ9BoBRdS2LQALQMIIGDQIEmwAO1kYcVWHCDZAhBAqFqYmOAxj2YNtAwDAYAAYmDEiBYWzHKKkRERYiwAAYSphZEZwxZGZiZQVEJTJkAAMTCyokc7M5oORlC5wcoEjxeAAAJqQXU0UB6W5WFmABMtEzMi1wEEEFAbE0YyAUuzMMEsYQalMkQSBQggUDmNPU3C9IA4LCxI+QUggEBiKOU8yExgqccCL3chnkPKlQABhGo6ejHBDKmdUHMlQAAhhQvQaGZGkBIkjcAMywLmI+VKgABCSowsTJhZkhlWXiBpAQggYBqBZl9GVOdBcz0LZqEEEEAMqLULMBLg1THWog9IAwQQA0qiZcRW5aPbAhBADCg1El4tMAAQQAxoiZYZXnTh1AIQQAzo2QlYpDDjcBgrxGEAAcSAJTthswmiBUwDBBC2GpkZJTaRvQ+mAQKIAUuuxdZWQvILQABBmSxMjBj5EpcWgACCMoFOYYSpZyHQHgMIMACt2hmoVEikCQAAAABJRU5ErkJggg==", "19-object-data-data-uri - photo"); hcard = new hCard(document.getElementById("20-image-alt")); @@ -767,8 +767,8 @@ function test_hCard() { is(hcard.fn, "John Doe", "20-image-alt - fn"); is(hcard.n["given-name"][0], "John", "20-image-alt - given-name"); is(hcard.n["family-name"][0], "Doe", "20-image-alt - family-name"); - is(hcard.logo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - logo"); - is(hcard.photo, "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - photo"); + is(String(hcard.logo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - logo"); + is(String(hcard.photo), "http://mochi.test:8888/tests/browser/microformats/test/picture.png", "20-image-alt - photo"); hcard = new hCard(document.getElementById("21-tel")); @@ -854,19 +854,19 @@ function test_hCard() { is(hcard.fn, "John Doe", "23-abbr-title-everything - fn"); is(hcard.n["given-name"][0], "Jonathan", "23-abbr-title-everything - given-name"); is(hcard.n["family-name"][0], "Doe-Smith", "23-abbr-title-everything - family-name"); - is(hcard.n["additional-name"], "John", "23-abbr-title-everything - additional-name"); - is(hcard.n["honorific-prefix"], "Mister", "23-abbr-title-everything - honorific-prefix"); - is(hcard.n["honorific-suffix"], "Medical Doctor", "23-abbr-title-everything - honorific-suffix"); + is(String(hcard.n["additional-name"]), "John", "23-abbr-title-everything - additional-name"); + is(String(hcard.n["honorific-prefix"]), "Mister", "23-abbr-title-everything - honorific-prefix"); + is(String(hcard.n["honorific-suffix"]), "Medical Doctor", "23-abbr-title-everything - honorific-suffix"); is(hcard["class"], "public", "23-abbr-title-everything - class"); - is(hcard.geo.latitude, "37.77", "23-abbr-title-everything - geo.latitude"); - is(hcard.geo.longitude, "-122.41", "23-abbr-title-everything - geo.longitude"); + is(hcard.geo.latitude, 37.77, "23-abbr-title-everything - geo.latitude"); + is(hcard.geo.longitude, -122.41, "23-abbr-title-everything - geo.longitude"); is(hcard.bday, "2006-04-04", "23-abbr-title-everything - bday"); is(hcard.nickname[0], "JJ", "23-abbr-title-everything - nickname"); - is(hcard.note[0], "this is a note", "23-abbr-title-everything - note"); - isnot(hcard.note[0], "this is not a note", "23-abbr-title-everything - note"); + is(String(hcard.note[0]), "this is a note", "23-abbr-title-everything - note"); + isnot(String(hcard.note[0]), "this is not a note", "23-abbr-title-everything - note"); is(hcard.org[0]["organization-name"], "Intellicorp", "23-abbr-title-everything - organization-name"); is(hcard.org[0]["organization-unit"][0], "Intelligence", "23-abbr-title-everything - organization-unit"); - is(hcard.role, "Chief", "23-abbr-title-everything - role"); + is(String(hcard.role), "Chief", "23-abbr-title-everything - role"); is(hcard.tel[0].value, "415.555.1234", "23-abbr-title-everything - tel"); is(hcard.title[0], "President", "23-abbr-title-everything - title"); is(hcard.tz, "-0700", "23-abbr-title-everything - tz"); @@ -882,29 +882,29 @@ function test_hCard() { hcard = new hCard(document.getElementById("25-geo-abbr")); 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"); + 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"); is(hcard.n["given-name"][0], "Jonathan", "26-ancestors - given-name"); is(hcard.n["family-name"][0], "Doe-Smith", "26-ancestors - family-name"); - is(hcard.n["additional-name"], "John", "26-ancestors - additional-name"); - is(hcard.n["honorific-prefix"], "Mister", "26-ancestors - honorific-prefix"); - is(hcard.n["honorific-suffix"], "Medical Doctor", "26-ancestors - honorific-suffix"); + is(String(hcard.n["additional-name"]), "John", "26-ancestors - additional-name"); + is(String(hcard.n["honorific-prefix"]), "Mister", "26-ancestors - honorific-prefix"); + is(String(hcard.n["honorific-suffix"]), "Medical Doctor", "26-ancestors - honorific-suffix"); is(hcard["class"], "public", "26-ancestors - class"); - is(hcard.geo.latitude, "37.77", "26-ancestors - geo.latitude"); - is(hcard.geo.longitude, "-122.41", "26-ancestors - geo.longitude"); + is(hcard.geo.latitude, 37.77, "26-ancestors - geo.latitude"); + is(hcard.geo.longitude, -122.41, "26-ancestors - geo.longitude"); is(hcard.bday, "2006-04-04", "26-ancestors - bday"); is(hcard.nickname[0], "JJ", "26-ancestors - nickname"); - is(hcard.note[0], "this is a note", "26-ancestors - note"); - isnot(hcard.note[0], "this is not a note", "26-ancestors - note"); + is(String(hcard.note[0]), "this is a note", "26-ancestors - note"); + isnot(String(hcard.note[0]), "this is not a note", "26-ancestors - note"); is(hcard.org[0]["organization-name"], "Intellicorp", "26-ancestors - organization-name"); is(hcard.org[0]["organization-unit"][0], "Intelligence", "26-ancestors - organization-unit"); - is(hcard.role, "Chief", "26-ancestors - role"); + is(String(hcard.role), "Chief", "26-ancestors - role"); is(hcard.agent[0].fn, "Bob Smith", "26-ancestors - agent.fn"); - is(hcard.agent[0].title, "Executive Assistant", "26-ancestors - agent.title"); + is(String(hcard.agent[0].title), "Executive Assistant", "26-ancestors - agent.title"); is(hcard.tel[0].value, "415.555.1234", "26-ancestors - tel"); is(hcard.title[0], "President", "26-ancestors - title"); is(hcard.tz, "-0700", "26-ancestors - tz"); @@ -971,7 +971,7 @@ function test_hCard() { is(hcard.fn, "Brian Suda", "31-include.1 - fn"); is(hcard.n["given-name"][0], "Brian", "31-include.1 - given-name"); is(hcard.n["family-name"][0], "Suda", "31-include.1 - family-name"); - is(hcard.url, "http://suda.co.uk/", "31-include.1 - url"); + is(String(hcard.url), "http://suda.co.uk/", "31-include.1 - url"); is(hcard.email[0].value, "correct@example.com", "31-include.1 - email"); isnot(hcard.email[0].value, "incorrect@example.com", "31-include.1 - email"); @@ -980,7 +980,7 @@ function test_hCard() { is(hcard.fn, "Brian Suda", "31-include.2 - fn"); is(hcard.n["given-name"][0], "Brian", "31-include.2 - given-name"); is(hcard.n["family-name"][0], "Suda", "31-include.2 - family-name"); - is(hcard.url, "http://suda.co.uk/", "31-include.2 - url"); + is(String(hcard.url), "http://suda.co.uk/", "31-include.2 - url"); is(hcard.email[0].value, "correct@example.com", "31-include.2 - email"); isnot(hcard.email[0].value, "incorrect@example.com", "31-include.2 - email"); @@ -989,7 +989,7 @@ function test_hCard() { is(hcard.fn, "Brian Suda", "31-include.3 - fn"); is(hcard.n["given-name"][0], "Brian", "31-include.3 - given-name"); is(hcard.n["family-name"][0], "Suda", "31-include.3 - family-name"); - is(hcard.url, "http://suda.co.uk/", "31-include.3 - url"); + is(String(hcard.url), "http://suda.co.uk/", "31-include.3 - url"); is(hcard.email[0].value, "correct@example.com", "31-include.3 - email"); isnot(hcard.email[0].value, "incorrect@example.com", "31-include.3 - email"); @@ -998,7 +998,7 @@ function test_hCard() { is(hcard.fn, "Brian Suda", "31-include.3 - fn"); is(hcard.n["given-name"][0], "Brian", "31-include.3 - given-name"); is(hcard.n["family-name"][0], "Suda", "31-include.3 - family-name"); - is(hcard.url, "http://suda.co.uk/", "31-include.3 - url"); + is(String(hcard.url), "http://suda.co.uk/", "31-include.3 - url"); hcard = new hCard(document.getElementById("32-header.1")); @@ -1006,7 +1006,7 @@ function test_hCard() { is(hcard.n["given-name"][0], "Brian", "32-header.1 - given-name"); is(hcard.n["family-name"][0], "Suda", "32-header.1 - family-name"); is(hcard.org[0]["organization-name"], "example.org", "32-header.1 - organization-name"); - is(hcard.url, "http://example.org/", "32-header.1 - url"); + is(String(hcard.url), "http://example.org/", "32-header.1 - url"); hcard = new hCard(document.getElementById("32-header.2")); @@ -1014,41 +1014,41 @@ function test_hCard() { is(hcard.n["given-name"][0], "John", "32-header.2 - given-name"); is(hcard.n["family-name"][0], "Doe", "32-header.2 - family-name"); is(hcard.org[0]["organization-name"], "example.org", "32-header.2 - organization-name"); - is(hcard.url, "http://example.org/", "32-header.2 - url"); + is(String(hcard.url), "http://example.org/", "32-header.2 - url"); hcard = new hCard(document.getElementById("33-area.1")); is(hcard.fn, "Joe Public", "33-area.1 - fn"); is(hcard.n["given-name"][0], "Joe", "33-area.1 - given-name"); is(hcard.n["family-name"][0], "Public", "33-area.1 - family-name"); - is(hcard.url, "http://example.com/", "33-area.1 - url"); + is(String(hcard.url), "http://example.com/", "33-area.1 - url"); is(hcard.email[0].value, "joe@example.com", "33-area.1 - email"); hcard = new hCard(document.getElementById("33-area.2")); is(hcard.fn, "Joe Public", "33-area.2 - fn"); - is(hcard.url, "http://example.com/", "33-area.2 - url"); + 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(hcard.url, "http://example.com/", "33-area.3 - url"); + 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(hcard.url, "http://example.com/", "33-area.4 - url"); + 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"); - is(hcard.url, "http://example.com/", "33-area.5 - url"); + is(String(hcard.url), "http://example.com/", "33-area.5 - url"); is(hcard.email[0].value, "joe@example.com", "33-area.5 - email"); is(hcard.org[0]["organization-name"], "Joe Public", "33-area.5 - organization-name"); @@ -1057,10 +1057,10 @@ function test_hCard() { is(hcard.fn, "Joe Public", "34-notes - fn"); is(hcard.n["given-name"][0], "Joe", "34-notes - given-name"); is(hcard.n["family-name"][0], "Public", "34-notes - family-name"); - is(hcard.note[0], "Note 1", "34-notes - note"); - isnot(hcard.note[1], "Note 2", "34-notes - note"); - is(hcard.note[1], "Note 3", "34-notes - note"); - is(hcard.note[2], "Note 4 with a ; and a , to be escaped", "34-notes - note"); + is(String(hcard.note[0]), "Note 1", "34-notes - note"); + isnot(String(hcard.note[1]), "Note 2", "34-notes - note"); + is(String(hcard.note[1]), "Note 3", "34-notes - note"); + is(String(hcard.note[2]), "Note 4 with a ; and a , to be escaped", "34-notes - note"); hcard = new hCard(document.getElementById("35-include-pattern.1")); @@ -1121,8 +1121,8 @@ function test_hCard() { is(hcard.uid, "unique-id-1", "37-singleton - uid"); is(hcard.tz, "+0600", "37-singleton - tz"); is(hcard["sort-string"], "d", "37-singleton - sort-string"); - is(hcard.geo.latitude, "123.45", "37-singleton - geo.latitude"); - is(hcard.geo.longitude, "67.89", "37-singleton - geo.longitude"); + is(hcard.geo.latitude, 123.45, "37-singleton - geo.latitude"); + is(hcard.geo.longitude, 67.89, "37-singleton - geo.longitude"); is(hcard["class"], "public", "37-singleton - class"); is(hcard.bday, "2006-07-07", "37-singleton - bday"); is(hcard.rev, "2006-07-07", "37-singleton - rev"); @@ -1161,12 +1161,12 @@ function test_hCard() { hcard = new hCard(document.getElementById("39-noteHTML")); - is(hcard.note[0], "Note", "39-noteHTML - note"); + is(String(hcard.note[0]), "Note", "39-noteHTML - note"); is(hcard.note[0].toHTML(), "Note", "39-noteHTML - note as HTML"); - is(hcard.note[0].match("Note"), "Note", "39-noteHTML - match in note"); + is(String(hcard.note[0].match("Note")), "Note", "39-noteHTML - match in note"); hcard = new hCard(document.getElementById("email-type")); - is(hcard.email[0].type, "internet", "email - type no value (type)"); + is(String(hcard.email[0].type), "internet", "email - type no value (type)"); is(hcard.email[0].value, "john@example.com", "email - type no value (value)"); } diff --git a/toolkit/components/microformats/tests/test_Microformats_negative.html b/toolkit/components/microformats/tests/test_Microformats_negative.html index 55943f8285..d050f402af 100644 --- a/toolkit/components/microformats/tests/test_Microformats_negative.html +++ b/toolkit/components/microformats/tests/test_Microformats_negative.html @@ -87,7 +87,7 @@ document.getElementById("testhere"), {recurseExternalFrames: true}); - is(mfs, null, "No microformat called notAMicroformat"); + is(mfs, undefined, "No microformat called notAMicroformat"); // What if we try another way? is(Microformats.isMicroformat(document.getElementById("notme")), false, diff --git a/toolkit/components/passwordmgr/test/test_prompt_async.html b/toolkit/components/passwordmgr/test/test_prompt_async.html index 7d7223efc6..4afe7de579 100644 --- a/toolkit/components/passwordmgr/test/test_prompt_async.html +++ b/toolkit/components/passwordmgr/test/test_prompt_async.html @@ -455,7 +455,7 @@ is(monitor.windowsRegistered, 1, "Registered 1 open dialog"); // ensure that the page content is not displayed on failed proxy auth - is(iframe1Doc.getElementById("ok"), undefined, "frame did not load"); + is(iframe1Doc.getElementById("ok"), null, "frame did not load"); break; case 4: @@ -473,7 +473,7 @@ is(monitor.windowsRegistered, 1, "Registered 1 open dialog"); // ensure that the page content is not displayed on failed proxy auth - is(iframe1Doc.getElementById("footnote"), undefined, "frame did not load"); + is(iframe1Doc.getElementById("footnote"), null, "frame did not load"); break; case 6: diff --git a/toolkit/content/tests/chrome/findbar_events_window.xul b/toolkit/content/tests/chrome/findbar_events_window.xul index 9907c97aa3..5dea66eafd 100644 --- a/toolkit/content/tests/chrome/findbar_events_window.xul +++ b/toolkit/content/tests/chrome/findbar_events_window.xul @@ -71,7 +71,7 @@ function checkSelection(done) { SimpleTest.executeSoon(function() { var selected = gBrowser.contentWindow.getSelection(); - is(selected, "", "No text is selected"); + is(String(selected), "", "No text is selected"); var controller = gFindBar.browser.docShell.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsISelectionDisplay) diff --git a/toolkit/content/tests/chrome/findbar_window.xul b/toolkit/content/tests/chrome/findbar_window.xul index 48938b7bde..b49001e61c 100644 --- a/toolkit/content/tests/chrome/findbar_window.xul +++ b/toolkit/content/tests/chrome/findbar_window.xul @@ -446,9 +446,9 @@ let timeout = gFindBar._matchesCountTimeoutLength + 20; function assertMatches(aTest, aMatches) { - is(aMatches[1], aTest.current, + is(aMatches[1], String(aTest.current), "Currently highlighted match should be at " + aTest.current); - is(aMatches[2], aTest.total, + is(aMatches[2], String(aTest.total), "Total amount of matches should be " + aTest.total); } @@ -502,11 +502,11 @@ prefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 0); enterStringIntoFindField("t"); - is(gBrowser.contentWindow.getSelection(), "T", "First T should be selected."); + is(String(gBrowser.contentWindow.getSelection()), "T", "First T should be selected."); prefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 1); setTimeout(function() { - is(gBrowser.contentWindow.getSelection(), "t", "First t should be selected."); + is(String(gBrowser.contentWindow.getSelection()), "t", "First t should be selected."); deferred.resolve(); }, 0); return deferred.promise; @@ -523,11 +523,11 @@ prefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 1); enterStringIntoFindField(SEARCH_TEXT.toUpperCase()); - is(gBrowser.contentWindow.getSelection(), "", "Not found."); + is(String(gBrowser.contentWindow.getSelection()), "", "Not found."); prefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 0); setTimeout(function() { - is(gBrowser.contentWindow.getSelection(), SEARCH_TEXT, "Search text should be selected."); + is(String(gBrowser.contentWindow.getSelection()), SEARCH_TEXT, "Search text should be selected."); deferred.resolve(); }, 0); return deferred.resolve(); diff --git a/toolkit/content/tests/chrome/test_datepicker.xul b/toolkit/content/tests/chrome/test_datepicker.xul index 9c403492d6..e7a61f43bc 100644 --- a/toolkit/content/tests/chrome/test_datepicker.xul +++ b/toolkit/content/tests/chrome/test_datepicker.xul @@ -48,7 +48,7 @@ function testtag_datepickers() testtag_datepicker(dppopup, "popup", "datepicker popup"); var gridpicker = document.getElementById("datepicker-grid"); - is(gridpicker.monthField.selectedIndex, 3, "datepicker grid correct month is initially selected"); + is(gridpicker.monthField.selectedIndex, "3", "datepicker grid correct month is initially selected"); testtag_datepicker(gridpicker, "grid", "datepicker grid"); dppopup.open = true; } diff --git a/toolkit/content/tests/chrome/test_deck.xul b/toolkit/content/tests/chrome/test_deck.xul index 37c665edaf..25c59c38a9 100644 --- a/toolkit/content/tests/chrome/test_deck.xul +++ b/toolkit/content/tests/chrome/test_deck.xul @@ -95,20 +95,20 @@ function test_deck_child_removal() // each time. deck = $("deck4"); let expectedIndex = 5; - is(deck.selectedIndex, expectedIndex, + is(deck.selectedIndex, String(expectedIndex), "Should have the deck element at index " + expectedIndex + " selected"); for (let i = 0; i < 3; ++i) { deck.firstChild.remove(); expectedIndex--; - is(deck.selectedIndex, expectedIndex, + is(deck.selectedIndex, String(expectedIndex), "Should have the deck element at index " + expectedIndex + " selected"); } // Check that removing the currently selected node doesn't change // behaviour. deck.childNodes[expectedIndex].remove(); - is(deck.selectedIndex, expectedIndex, + is(deck.selectedIndex, String(expectedIndex), "The selectedIndex should not change when removing the node " + "at the selected index."); @@ -116,14 +116,14 @@ function test_deck_child_removal() // nodes at indexes greater than the selected node. deck = $("deck5"); expectedIndex = 2; - is(deck.selectedIndex, expectedIndex, + is(deck.selectedIndex, String(expectedIndex), "Should have the deck element at index " + expectedIndex + " selected"); // And then remove all of the nodes, starting from last to first, making // sure that the selectedIndex does not change. while (deck.lastChild) { deck.lastChild.remove(); - is(deck.selectedIndex, expectedIndex, + is(deck.selectedIndex, String(expectedIndex), "Should have the deck element at index " + expectedIndex + " selected"); } } diff --git a/toolkit/content/tests/chrome/test_progressmeter.xul b/toolkit/content/tests/chrome/test_progressmeter.xul index deca329575..93194c83cc 100644 --- a/toolkit/content/tests/chrome/test_progressmeter.xul +++ b/toolkit/content/tests/chrome/test_progressmeter.xul @@ -46,10 +46,10 @@ function doTests() { SimpleTest.ise(n1.value, "17", "determined value set invalid"); n1.max = 200; - is(n1.max, 200, "max changed"); + is(n1.max, "200", "max changed"); n1.value = 150; n1.max = 120; - is(n1.value, 120, "max lowered below value"); + is(n1.value, "120", "max lowered below value"); n2.value = 2; SimpleTest.ise(n2.value, "0", "undetermined value set 2"); diff --git a/toolkit/content/tests/chrome/test_textbox_number.xul b/toolkit/content/tests/chrome/test_textbox_number.xul index fe32b4581b..8f4a5c9ea2 100644 --- a/toolkit/content/tests/chrome/test_textbox_number.xul +++ b/toolkit/content/tests/chrome/test_textbox_number.xul @@ -230,28 +230,28 @@ function doTests() { n1.value = 12; // no events should fire and no changes should occur when the field is read only synthesizeKeyExpectEvent("VK_UP", { }, n1, "!change", "key up read only"); - is(n1.value, 12, "key up read only value"); + is(n1.value, "12", "key up read only value"); synthesizeKeyExpectEvent("VK_DOWN", { }, n1, "!change", "key down read only"); - is(n1.value, 12, "key down read only value"); + is(n1.value, "12", "key down read only value"); synthesizeMouseExpectEvent(sb, 2, 2, { }, n1, "!change", "mouse up read only"); - is(n1.value, 12, "mouse up read only value"); + is(n1.value, "12", "mouse up read only value"); synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, n1, "!change", "mouse down read only"); - is(n1.value, 12, "mouse down read only value"); + is(n1.value, "12", "mouse down read only value"); n1.readOnly = false; n1.disabled = true; synthesizeMouseExpectEvent(sb, 2, 2, { }, n1, "!change", "mouse up disabled"); - is(n1.value, 12, "mouse up disabled value"); + is(n1.value, "12", "mouse up disabled value"); synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, n1, "!change", "mouse down disabled"); - is(n1.value, 12, "mouse down disabled value"); + is(n1.value, "12", "mouse down disabled value"); var nsbrect = $("n8").spinButtons.getBoundingClientRect(); ok(nsbrect.left == 0 && nsbrect.top == 0 && nsbrect.right == 0, nsbrect.bottom == 0, "hidespinbuttons"); var n9 = $("n9"); - is(n9.value, 0, "initial value"); + is(n9.value, "0", "initial value"); n9.select(); synthesizeKey("4", {}); is(inputEventCount, 1, "input event count"); @@ -322,26 +322,26 @@ function testIncreaseDecrease(nb, testid, increment, fixedCount, min, max) // pressing the cursor up and down keys should adjust the value synthesizeKeyExpectEvent("VK_UP", { }, nb, "change", testid + "key up"); - is(nb.value, min + increment, testid + "key up"); + is(nb.value, String(min + increment), testid + "key up"); nb.value = max; synthesizeKeyExpectEvent("VK_UP", { }, nb, "!change", testid + "key up at max"); - is(nb.value, max, testid + "key up at max"); + is(nb.value, String(max), testid + "key up at max"); synthesizeKeyExpectEvent("VK_DOWN", { }, nb, "change", testid + "key down"); - is(nb.value, max - increment, testid + "key down"); + is(nb.value, String(max - increment), testid + "key down"); nb.value = min; synthesizeKeyExpectEvent("VK_DOWN", { }, nb, "!change", testid + "key down at min"); - is(nb.value, min, testid + "key down at min"); + is(nb.value, String(min), testid + "key down at min"); // check pressing the spinbutton arrows var sb = nb.spinButtons; var sbbottom = sb.getBoundingClientRect().bottom - sb.getBoundingClientRect().top - 2; nb.value = min; synthesizeMouseExpectEvent(sb, 2, 2, { }, nb, "change", testid + "mouse up"); - is(nb.value, min + increment, testid + "mouse up"); + is(nb.value, String(min + increment), testid + "mouse up"); nb.value = max; synthesizeMouseExpectEvent(sb, 2, 2, { }, nb, "!change", testid + "mouse up at max"); synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, nb, "change", testid + "mouse down"); - is(nb.value, max - increment, testid + "mouse down"); + is(nb.value, String(max - increment), testid + "mouse down"); nb.value = min; synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, nb, "!change", testid + "mouse down at min"); } diff --git a/toolkit/content/tests/chrome/xul_selectcontrol.js b/toolkit/content/tests/chrome/xul_selectcontrol.js index 5656aa8363..2751365c72 100644 --- a/toolkit/content/tests/chrome/xul_selectcontrol.js +++ b/toolkit/content/tests/chrome/xul_selectcontrol.js @@ -133,7 +133,7 @@ function test_nsIDOMXULSelectControlElement(element, childtag, testprefix) selectionRequired ? seconditem : null, selectionRequired ? 0 : -1, selectionRequired ? secondvalue : ""); - is(removeditem.control, null, testid + "control not set"); + is(removeditem.control, undefined, testid + "control not set"); var thirditem = element.appendItem("Third Item", "third"); var fourthitem = element.appendItem("Fourth Item", fourthvalue); diff --git a/toolkit/content/tests/widgets/test_audiocontrols_dimensions.html b/toolkit/content/tests/widgets/test_audiocontrols_dimensions.html index cf832a0a4b..0f295cce9b 100644 --- a/toolkit/content/tests/widgets/test_audiocontrols_dimensions.html +++ b/toolkit/content/tests/widgets/test_audiocontrols_dimensions.html @@ -17,7 +17,7 @@ diff --git a/widget/tests/test_key_event_counts.xul b/widget/tests/test_key_event_counts.xul index 5c8697eac8..4dd4b83da4 100644 --- a/widget/tests/test_key_event_counts.xul +++ b/widget/tests/test_key_event_counts.xul @@ -35,7 +35,7 @@ e.preventDefault(); } - function runTest() + function* testBody() { window.addEventListener("keydown", onKeyDown, false); window.addEventListener("keypress", onKeyPress, false); @@ -43,27 +43,48 @@ // Test ctrl-tab gKeyDownEventCount = 0; gKeyPressEventCount = 0; - synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_Tab, {ctrlKey:1}, "\t", "\t"); + yield synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_Tab, {ctrlKey:1}, "\t", "\t", continueTest); is(gKeyDownEventCount, 1); is(gKeyPressEventCount, 0, "ctrl-tab should be consumed by tabbox of tabbrowser at keydown"); // Test cmd+shift+a gKeyDownEventCount = 0; gKeyPressEventCount = 0; - synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_A, {metaKey:1, shiftKey:1}, "a", "A"); + yield synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_A, {metaKey:1, shiftKey:1}, "a", "A", continueTest); is(gKeyDownEventCount, 1); is(gKeyPressEventCount, 1); // Test cmd-; gKeyDownEventCount = 0; gKeyPressEventCount = 0; - synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_Semicolon, {metaKey:1}, ";", ";"); + yield synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_Semicolon, {metaKey:1}, ";", ";", continueTest); is(gKeyDownEventCount, 1); is(gKeyPressEventCount, 1); window.removeEventListener("keydown", onKeyDown, false); window.removeEventListener("keypress", onKeyPress, false); } + + var gTestContinuation = null; + + function continueTest() + { + if (!gTestContinuation) { + gTestContinuation = testBody(); + } + var ret = gTestContinuation.next(); + if (ret.done) { + SimpleTest.finish(); + } else { + is(ret.value, true, "Key synthesized successfully"); + } + } + + function runTest() + { + SimpleTest.waitForExplicitFinish(); + continueTest(); + } ]]> diff --git a/widget/tests/test_keycodes.xul b/widget/tests/test_keycodes.xul index 8a08039252..a8f701eca2 100644 --- a/widget/tests/test_keycodes.xul +++ b/widget/tests/test_keycodes.xul @@ -97,19 +97,19 @@ function eventToString(aEvent) return name; } -function synthesizeKey(aEvent, aFocusElementId) +function synthesizeKey(aEvent, aFocusElementId, aCallback) { document.getElementById(aFocusElementId).focus(); - var sent = synthesizeNativeKey(aEvent.layout, aEvent.keyCode, - aEvent.modifiers, - aEvent.chars, aEvent.unmodifiedChars); - ok(sent, "synthesizeNativeKey() should send a native key event"); + return synthesizeNativeKey(aEvent.layout, aEvent.keyCode, + aEvent.modifiers, + aEvent.chars, aEvent.unmodifiedChars, + aCallback); } // Test the charcodes and modifiers being delivered to keypress handlers and // also keydown/keyup events too. -function runKeyEventTests() +function* runKeyEventTests() { const nsIDOMKeyEvent = Components.interfaces.nsIDOMKeyEvent; var eventList, keyDownFlags, keyUpFlags, testingEvent, expectedDOMKeyCode; @@ -287,17 +287,17 @@ function runKeyEventTests() var e = eventList[i]; if (e.type == "keypress") { var isCtrlExpected = - aEvent.modifiers.ctrlKey || aEvent.modifiers.ctrlRightKey || false; + !!(aEvent.modifiers.ctrlKey || aEvent.modifiers.ctrlRightKey); var isAltExpected = - aEvent.modifiers.altKey || aEvent.modifiers.altRightKey || false; + !!(aEvent.modifiers.altKey || aEvent.modifiers.altRightKey); if (IS_WIN && aEvent.modifiers.altGrKey) { isCtrlExpected = isAltExpected = ((aShouldDelivedEvent & SHOULD_NOT_CAUSE_INPUT) != 0); } is(e.ctrlKey, isCtrlExpected, name + ", Ctrl mismatch"); - is(e.metaKey, aEvent.modifiers.metaKey || aEvent.modifiers.metaRightKey || false, name + ", Command mismatch"); + is(e.metaKey, !!(aEvent.modifiers.metaKey || aEvent.modifiers.metaRightKey), name + ", Command mismatch"); is(e.altKey, isAltExpected, name + ", Alt mismatch"); - is(e.shiftKey, aEvent.modifiers.shiftKey || aEvent.modifiers.shiftRightKey || false, name + ", Shift mismatch"); + is(e.shiftKey, !!(aEvent.modifiers.shiftKey || aEvent.modifiers.shiftRightKey), name + ", Shift mismatch"); } if (aExpectGoannaChar.length > 0 && e.type == "keypress") { @@ -339,1474 +339,1475 @@ function runKeyEventTests() // test key event records that you saw Cocoa send. // Ctrl keys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"}, + nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Alt keys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{altKey:1}, chars:"\u00e5", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00e5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{altKey:1, shiftKey:1}, chars:"\u00c5", unmodifiedChars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00c5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{altKey:1}, chars:"\u00e5", unmodifiedChars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00e5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{altKey:1, shiftKey:1}, chars:"\u00c5", unmodifiedChars:"A"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00c5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Command keys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Shift-cmd gives us the shifted character - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{metaKey:1, shiftKey:1}, chars:"a", unmodifiedChars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{metaKey:1, shiftKey:1}, chars:"a", unmodifiedChars:"A"}, + nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl-cmd gives us the unshifted character - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{metaKey:1, ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{metaKey:1, ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Alt-cmd gives us the shifted character - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{metaKey:1, altKey:1}, chars:"\u00e5", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00e5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u00c5", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00c5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{metaKey:1, altKey:1}, chars:"\u00e5", unmodifiedChars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00e5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u00c5", unmodifiedChars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00c5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Greek ctrl keys produce Latin charcodes - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"\u0391"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"\u0391"}, + nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Greek command keys - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, - modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"\u03b1"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, + modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"\u03b1"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Shift-cmd gives us the shifted character - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, - modifiers:{metaKey:1, shiftKey:1}, chars:"a", unmodifiedChars:"\u0391"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, + modifiers:{metaKey:1, shiftKey:1}, chars:"a", unmodifiedChars:"\u0391"}, + nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // Ctrl-cmd gives us the unshifted character - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, - modifiers:{metaKey:1, ctrlKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, + modifiers:{metaKey:1, ctrlKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Alt-cmd gives us the shifted character - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, - modifiers:{metaKey:1, altKey:1}, chars:"\u00a8", unmodifiedChars:"\u03b1"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00a8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, - modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u00b9", unmodifiedChars:"\u0391"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00b9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, + modifiers:{metaKey:1, altKey:1}, chars:"\u00a8", unmodifiedChars:"\u03b1"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00a8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, + modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u00b9", unmodifiedChars:"\u0391"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00b9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // German - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_A, - modifiers: {}, chars:"a", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_LeftBracket, - modifiers: {}, chars:"\u00fc", unmodifiedChars:"\u00fc"}, + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_A, + modifiers: {}, chars:"a", unmodifiedChars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_LeftBracket, + modifiers: {}, chars:"\u00fc", unmodifiedChars:"\u00fc"}, 0, "\u00fc", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, - modifiers: {}, chars:"\u00df", unmodifiedChars:"\u00df"}, - nsIDOMKeyEvent.DOM_VK_QUESTION_MARK, "\u00df", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, - modifiers:{shiftKey:1}, chars:"?", unmodifiedChars:"?"}, - nsIDOMKeyEvent.DOM_VK_QUESTION_MARK, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, + modifiers: {}, chars:"\u00df", unmodifiedChars:"\u00df"}, + nsIDOMKeyEvent.DOM_VK_QUESTION_MARK, "\u00df", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, + modifiers:{shiftKey:1}, chars:"?", unmodifiedChars:"?"}, + nsIDOMKeyEvent.DOM_VK_QUESTION_MARK, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Note that Shift+SS is '?' but Cmd+Shift+SS is '/' on German layout. // Therefore, when Cmd key is pressed, the SS key's keycode is changed. - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, - modifiers:{metaKey:1}, chars:"\u00df", unmodifiedChars:"\u00df"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "\u00df", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, - modifiers:{metaKey:1, shiftKey:1}, chars:"/", unmodifiedChars:"?"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, + modifiers:{metaKey:1}, chars:"\u00df", unmodifiedChars:"\u00df"}, + nsIDOMKeyEvent.DOM_VK_SLASH, "\u00df", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus, + modifiers:{metaKey:1, shiftKey:1}, chars:"/", unmodifiedChars:"?"}, + nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Caps Lock key event // XXX keyup event of Caps Lock key is not fired. - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_CapsLock, - modifiers:{capsLockKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_CapsLock, - modifiers:{capsLockKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_CapsLock, + modifiers:{capsLockKey:1}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_CapsLock, + modifiers:{capsLockKey:0}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Shift/RightShift key event - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Shift, - modifiers:{shiftKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Shift, - modifiers:{shiftKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightShift, - modifiers:{shiftRightKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightShift, - modifiers:{shiftRightKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Shift, + modifiers:{shiftKey:1}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Shift, + modifiers:{shiftKey:0}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightShift, + modifiers:{shiftRightKey:1}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightShift, + modifiers:{shiftRightKey:0}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Control/RightControl key event - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Control, - modifiers:{ctrlKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Control, - modifiers:{ctrlKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightControl, - modifiers:{ctrlRightKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightControl, - modifiers:{ctrlRightKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Control, + modifiers:{ctrlKey:1}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Control, + modifiers:{ctrlKey:0}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightControl, + modifiers:{ctrlRightKey:1}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightControl, + modifiers:{ctrlRightKey:0}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Option/RightOption key event - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Option, - modifiers:{altKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Option, - modifiers:{altKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightOption, - modifiers:{altRightKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightOption, - modifiers:{altRightKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Option, + modifiers:{altKey:1}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Option, + modifiers:{altKey:0}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightOption, + modifiers:{altRightKey:1}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightOption, + modifiers:{altRightKey:0}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Command/RightCommand key event - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Command, - modifiers:{metaKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Command, - modifiers:{metaKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightCommand, - modifiers:{metaRightKey:1}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightCommand, - modifiers:{metaRightKey:0}, chars:"", unmodifiedChars:""}, - nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Command, + modifiers:{metaKey:1}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Command, + modifiers:{metaKey:0}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightCommand, + modifiers:{metaRightKey:1}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightCommand, + modifiers:{metaRightKey:0}, chars:"", unmodifiedChars:""}, + nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // all keys on keyboard (keyCode test) - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Tab, - modifiers: {}, chars:"\t", unmodifiedChars:"\t"}, - nsIDOMKeyEvent.DOM_VK_TAB, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadClear, - modifiers: {}, chars:"\uF739", unmodifiedChars:"\uF739"}, - nsIDOMKeyEvent.DOM_VK_CLEAR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Return, - modifiers: {}, chars:"\u000D", unmodifiedChars:"\u000D"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F15, - modifiers: {}, chars:"\uF712", unmodifiedChars:"\uF712"}, - nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Escape, - modifiers: {}, chars:"\u001B", unmodifiedChars:"\u001B"}, - nsIDOMKeyEvent.DOM_VK_ESCAPE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Space, - modifiers: {}, chars:" ", unmodifiedChars:" "}, - nsIDOMKeyEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PageUp, - modifiers: {}, chars:"\uF72C", unmodifiedChars:"\uF72C"}, - nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PageDown, - modifiers: {}, chars:"\uF72D", unmodifiedChars:"\uF72D"}, - nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_End, - modifiers: {}, chars:"\uF72B", unmodifiedChars:"\uF72B"}, - nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Home, - modifiers: {}, chars:"\uF729", unmodifiedChars:"\uF729"}, - nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_LeftArrow, - modifiers: {}, chars:"\uF702", unmodifiedChars:"\uF702"}, - nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_UpArrow, - modifiers: {}, chars:"\uF700", unmodifiedChars:"\uF700"}, - nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightArrow, - modifiers: {}, chars:"\uF703", unmodifiedChars:"\uF703"}, - nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_DownArrow, - modifiers: {}, chars:"\uF701", unmodifiedChars:"\uF701"}, - nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_PrintScreen, - modifiers: {}, chars:"\uF710", unmodifiedChars:"\uF710"}, - nsIDOMKeyEvent.DOM_VK_PRINTSCREEN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_Delete, - modifiers: {}, chars:"\uF728", unmodifiedChars:"\uF728"}, - nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_Pause, - modifiers: {}, chars:"\uF711", unmodifiedChars:"\uF711"}, - nsIDOMKeyEvent.DOM_VK_SCROLL_LOCK, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_ContextMenu, - modifiers: {}, chars:"\u0010", unmodifiedChars:"\u0010"}, - nsIDOMKeyEvent.DOM_VK_CONTEXT_MENU, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Tab, + modifiers: {}, chars:"\t", unmodifiedChars:"\t"}, + nsIDOMKeyEvent.DOM_VK_TAB, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadClear, + modifiers: {}, chars:"\uF739", unmodifiedChars:"\uF739"}, + nsIDOMKeyEvent.DOM_VK_CLEAR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Return, + modifiers: {}, chars:"\u000D", unmodifiedChars:"\u000D"}, + nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F15, + modifiers: {}, chars:"\uF712", unmodifiedChars:"\uF712"}, + nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Escape, + modifiers: {}, chars:"\u001B", unmodifiedChars:"\u001B"}, + nsIDOMKeyEvent.DOM_VK_ESCAPE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Space, + modifiers: {}, chars:" ", unmodifiedChars:" "}, + nsIDOMKeyEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PageUp, + modifiers: {}, chars:"\uF72C", unmodifiedChars:"\uF72C"}, + nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PageDown, + modifiers: {}, chars:"\uF72D", unmodifiedChars:"\uF72D"}, + nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_End, + modifiers: {}, chars:"\uF72B", unmodifiedChars:"\uF72B"}, + nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Home, + modifiers: {}, chars:"\uF729", unmodifiedChars:"\uF729"}, + nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_LeftArrow, + modifiers: {}, chars:"\uF702", unmodifiedChars:"\uF702"}, + nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_UpArrow, + modifiers: {}, chars:"\uF700", unmodifiedChars:"\uF700"}, + nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightArrow, + modifiers: {}, chars:"\uF703", unmodifiedChars:"\uF703"}, + nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_DownArrow, + modifiers: {}, chars:"\uF701", unmodifiedChars:"\uF701"}, + nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_PrintScreen, + modifiers: {}, chars:"\uF710", unmodifiedChars:"\uF710"}, + nsIDOMKeyEvent.DOM_VK_PRINTSCREEN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_Delete, + modifiers: {}, chars:"\uF728", unmodifiedChars:"\uF728"}, + nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_Pause, + modifiers: {}, chars:"\uF711", unmodifiedChars:"\uF711"}, + nsIDOMKeyEvent.DOM_VK_SCROLL_LOCK, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_ContextMenu, + modifiers: {}, chars:"\u0010", unmodifiedChars:"\u0010"}, + nsIDOMKeyEvent.DOM_VK_CONTEXT_MENU, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F1, - modifiers:{fnKey:1}, chars:"\uF704", unmodifiedChars:"\uF704"}, - nsIDOMKeyEvent.DOM_VK_F1, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F2, - modifiers:{fnKey:1}, chars:"\uF705", unmodifiedChars:"\uF705"}, - nsIDOMKeyEvent.DOM_VK_F2, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F3, - modifiers:{fnKey:1}, chars:"\uF706", unmodifiedChars:"\uF706"}, - nsIDOMKeyEvent.DOM_VK_F3, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F4, - modifiers:{fnKey:1}, chars:"\uF707", unmodifiedChars:"\uF707"}, - nsIDOMKeyEvent.DOM_VK_F4, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F5, - modifiers:{fnKey:1}, chars:"\uF708", unmodifiedChars:"\uF708"}, - nsIDOMKeyEvent.DOM_VK_F5, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F6, - modifiers:{fnKey:1}, chars:"\uF709", unmodifiedChars:"\uF709"}, - nsIDOMKeyEvent.DOM_VK_F6, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F7, - modifiers:{fnKey:1}, chars:"\uF70A", unmodifiedChars:"\uF70A"}, - nsIDOMKeyEvent.DOM_VK_F7, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F8, - modifiers:{fnKey:1}, chars:"\uF70B", unmodifiedChars:"\uF70B"}, - nsIDOMKeyEvent.DOM_VK_F8, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F9, - modifiers:{fnKey:1}, chars:"\uF70C", unmodifiedChars:"\uF70C"}, - nsIDOMKeyEvent.DOM_VK_F9, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F10, - modifiers:{fnKey:1}, chars:"\uF70D", unmodifiedChars:"\uF70D"}, - nsIDOMKeyEvent.DOM_VK_F10, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F11, - modifiers:{fnKey:1}, chars:"\uF70E", unmodifiedChars:"\uF70E"}, - nsIDOMKeyEvent.DOM_VK_F11, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F12, - modifiers:{fnKey:1}, chars:"\uF70F", unmodifiedChars:"\uF70F"}, - nsIDOMKeyEvent.DOM_VK_F12, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F16, - modifiers:{fnKey:1}, chars:"\uF713", unmodifiedChars:"\uF713"}, - nsIDOMKeyEvent.DOM_VK_F16, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F17, - modifiers:{fnKey:1}, chars:"\uF714", unmodifiedChars:"\uF714"}, - nsIDOMKeyEvent.DOM_VK_F17, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F18, - modifiers:{fnKey:1}, chars:"\uF715", unmodifiedChars:"\uF715"}, - nsIDOMKeyEvent.DOM_VK_F18, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F19, - modifiers:{fnKey:1}, chars:"\uF716", unmodifiedChars:"\uF716"}, - nsIDOMKeyEvent.DOM_VK_F19, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F1, + modifiers:{fnKey:1}, chars:"\uF704", unmodifiedChars:"\uF704"}, + nsIDOMKeyEvent.DOM_VK_F1, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F2, + modifiers:{fnKey:1}, chars:"\uF705", unmodifiedChars:"\uF705"}, + nsIDOMKeyEvent.DOM_VK_F2, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F3, + modifiers:{fnKey:1}, chars:"\uF706", unmodifiedChars:"\uF706"}, + nsIDOMKeyEvent.DOM_VK_F3, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F4, + modifiers:{fnKey:1}, chars:"\uF707", unmodifiedChars:"\uF707"}, + nsIDOMKeyEvent.DOM_VK_F4, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F5, + modifiers:{fnKey:1}, chars:"\uF708", unmodifiedChars:"\uF708"}, + nsIDOMKeyEvent.DOM_VK_F5, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F6, + modifiers:{fnKey:1}, chars:"\uF709", unmodifiedChars:"\uF709"}, + nsIDOMKeyEvent.DOM_VK_F6, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F7, + modifiers:{fnKey:1}, chars:"\uF70A", unmodifiedChars:"\uF70A"}, + nsIDOMKeyEvent.DOM_VK_F7, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F8, + modifiers:{fnKey:1}, chars:"\uF70B", unmodifiedChars:"\uF70B"}, + nsIDOMKeyEvent.DOM_VK_F8, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F9, + modifiers:{fnKey:1}, chars:"\uF70C", unmodifiedChars:"\uF70C"}, + nsIDOMKeyEvent.DOM_VK_F9, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F10, + modifiers:{fnKey:1}, chars:"\uF70D", unmodifiedChars:"\uF70D"}, + nsIDOMKeyEvent.DOM_VK_F10, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F11, + modifiers:{fnKey:1}, chars:"\uF70E", unmodifiedChars:"\uF70E"}, + nsIDOMKeyEvent.DOM_VK_F11, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F12, + modifiers:{fnKey:1}, chars:"\uF70F", unmodifiedChars:"\uF70F"}, + nsIDOMKeyEvent.DOM_VK_F12, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F16, + modifiers:{fnKey:1}, chars:"\uF713", unmodifiedChars:"\uF713"}, + nsIDOMKeyEvent.DOM_VK_F16, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F17, + modifiers:{fnKey:1}, chars:"\uF714", unmodifiedChars:"\uF714"}, + nsIDOMKeyEvent.DOM_VK_F17, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F18, + modifiers:{fnKey:1}, chars:"\uF715", unmodifiedChars:"\uF715"}, + nsIDOMKeyEvent.DOM_VK_F18, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F19, + modifiers:{fnKey:1}, chars:"\uF716", unmodifiedChars:"\uF716"}, + nsIDOMKeyEvent.DOM_VK_F19, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // US // Alphabet - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers: {}, chars:"a", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{shiftKey:1}, chars:"A", unmodifiedChars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{altKey:1}, chars:"\u00E5", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, - modifiers:{}, chars:"b", unmodifiedChars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, - modifiers:{shiftKey:1}, chars:"B", unmodifiedChars:"B"}, - nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, - modifiers:{ctrlKey:1}, chars:"\u0002", unmodifiedChars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, - modifiers:{altKey:1}, chars:"\u222B", unmodifiedChars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "\u222B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, - modifiers:{metaKey:1}, chars:"b", unmodifiedChars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, - modifiers:{}, chars:"c", unmodifiedChars:"c"}, - nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, - modifiers:{shiftKey:1}, chars:"C", unmodifiedChars:"C"}, - nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, - modifiers:{ctrlKey:1}, chars:"\u0003", unmodifiedChars:"c"}, - nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, - modifiers:{altKey:1}, chars:"\u00E7", unmodifiedChars:"c"}, - nsIDOMKeyEvent.DOM_VK_C, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, - modifiers:{metaKey:1}, chars:"c", unmodifiedChars:"c"}, - nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, - modifiers:{}, chars:"d", unmodifiedChars:"d"}, - nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, - modifiers:{shiftKey:1}, chars:"D", unmodifiedChars:"D"}, - nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, - modifiers:{ctrlKey:1}, chars:"\u0004", unmodifiedChars:"d"}, - nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, - modifiers:{altKey:1}, chars:"\u2202", unmodifiedChars:"d"}, - nsIDOMKeyEvent.DOM_VK_D, "\u2202", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, - modifiers:{metaKey:1}, chars:"d", unmodifiedChars:"d"}, - nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, - modifiers:{}, chars:"e", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, - modifiers:{shiftKey:1}, chars:"E", unmodifiedChars:"E"}, - nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, - modifiers:{ctrlKey:1}, chars:"\u0005", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, - modifiers:{altKey:1}, chars:"", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, - modifiers:{metaKey:1}, chars:"e", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, - modifiers:{}, chars:"f", unmodifiedChars:"f"}, - nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, - modifiers:{shiftKey:1}, chars:"F", unmodifiedChars:"F"}, - nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, - modifiers:{ctrlKey:1}, chars:"\u0006", unmodifiedChars:"f"}, - nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, - modifiers:{altKey:1}, chars:"\u0192", unmodifiedChars:"f"}, - nsIDOMKeyEvent.DOM_VK_F, "\u0192", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers: {}, chars:"a", unmodifiedChars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{shiftKey:1}, chars:"A", unmodifiedChars:"A"}, + nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{altKey:1}, chars:"\u00E5", unmodifiedChars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00E5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, + modifiers:{}, chars:"b", unmodifiedChars:"b"}, + nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, + modifiers:{shiftKey:1}, chars:"B", unmodifiedChars:"B"}, + nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, + modifiers:{ctrlKey:1}, chars:"\u0002", unmodifiedChars:"b"}, + nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, + modifiers:{altKey:1}, chars:"\u222B", unmodifiedChars:"b"}, + nsIDOMKeyEvent.DOM_VK_B, "\u222B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B, + modifiers:{metaKey:1}, chars:"b", unmodifiedChars:"b"}, + nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, + modifiers:{}, chars:"c", unmodifiedChars:"c"}, + nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, + modifiers:{shiftKey:1}, chars:"C", unmodifiedChars:"C"}, + nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, + modifiers:{ctrlKey:1}, chars:"\u0003", unmodifiedChars:"c"}, + nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, + modifiers:{altKey:1}, chars:"\u00E7", unmodifiedChars:"c"}, + nsIDOMKeyEvent.DOM_VK_C, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C, + modifiers:{metaKey:1}, chars:"c", unmodifiedChars:"c"}, + nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, + modifiers:{}, chars:"d", unmodifiedChars:"d"}, + nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, + modifiers:{shiftKey:1}, chars:"D", unmodifiedChars:"D"}, + nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, + modifiers:{ctrlKey:1}, chars:"\u0004", unmodifiedChars:"d"}, + nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, + modifiers:{altKey:1}, chars:"\u2202", unmodifiedChars:"d"}, + nsIDOMKeyEvent.DOM_VK_D, "\u2202", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D, + modifiers:{metaKey:1}, chars:"d", unmodifiedChars:"d"}, + nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, + modifiers:{}, chars:"e", unmodifiedChars:"e"}, + nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, + modifiers:{shiftKey:1}, chars:"E", unmodifiedChars:"E"}, + nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, + modifiers:{ctrlKey:1}, chars:"\u0005", unmodifiedChars:"e"}, + nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, + modifiers:{altKey:1}, chars:"", unmodifiedChars:"e"}, + nsIDOMKeyEvent.DOM_VK_E, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E, + modifiers:{metaKey:1}, chars:"e", unmodifiedChars:"e"}, + nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, + modifiers:{}, chars:"f", unmodifiedChars:"f"}, + nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, + modifiers:{shiftKey:1}, chars:"F", unmodifiedChars:"F"}, + nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, + modifiers:{ctrlKey:1}, chars:"\u0006", unmodifiedChars:"f"}, + nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, + modifiers:{altKey:1}, chars:"\u0192", unmodifiedChars:"f"}, + nsIDOMKeyEvent.DOM_VK_F, "\u0192", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // XXX This test starts fullscreen mode. - // testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, - // modifiers:{metaKey:1}, chars:"f", unmodifiedChars:"f"}, - // nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, - modifiers:{}, chars:"g", unmodifiedChars:"g"}, - nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, - modifiers:{shiftKey:1}, chars:"G", unmodifiedChars:"G"}, - nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, - modifiers:{ctrlKey:1}, chars:"\u0007", unmodifiedChars:"g"}, - nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, - modifiers:{altKey:1}, chars:"\u00A9", unmodifiedChars:"g"}, - nsIDOMKeyEvent.DOM_VK_G, "\u00A9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, - modifiers:{metaKey:1}, chars:"g", unmodifiedChars:"g"}, - nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, - modifiers:{}, chars:"h", unmodifiedChars:"h"}, - nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, - modifiers:{shiftKey:1}, chars:"H", unmodifiedChars:"H"}, - nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, - modifiers:{ctrlKey:1}, chars:"\u0008", unmodifiedChars:"h"}, - nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, - modifiers:{altKey:1}, chars:"\u02D9", unmodifiedChars:"h"}, - nsIDOMKeyEvent.DOM_VK_H, "\u02D9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, - modifiers:{metaKey:1}, chars:"h", unmodifiedChars:"h"}, - nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, - modifiers:{}, chars:"i", unmodifiedChars:"i"}, - nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, - modifiers:{shiftKey:1}, chars:"I", unmodifiedChars:"I"}, - nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, - modifiers:{ctrlKey:1}, chars:"\u0009", unmodifiedChars:"i"}, - nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, - modifiers:{altKey:1}, chars:"", unmodifiedChars:"i"}, - nsIDOMKeyEvent.DOM_VK_I, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, + // modifiers:{metaKey:1}, chars:"f", unmodifiedChars:"f"}, + // nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, + modifiers:{}, chars:"g", unmodifiedChars:"g"}, + nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, + modifiers:{shiftKey:1}, chars:"G", unmodifiedChars:"G"}, + nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, + modifiers:{ctrlKey:1}, chars:"\u0007", unmodifiedChars:"g"}, + nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, + modifiers:{altKey:1}, chars:"\u00A9", unmodifiedChars:"g"}, + nsIDOMKeyEvent.DOM_VK_G, "\u00A9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G, + modifiers:{metaKey:1}, chars:"g", unmodifiedChars:"g"}, + nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, + modifiers:{}, chars:"h", unmodifiedChars:"h"}, + nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, + modifiers:{shiftKey:1}, chars:"H", unmodifiedChars:"H"}, + nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, + modifiers:{ctrlKey:1}, chars:"\u0008", unmodifiedChars:"h"}, + nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, + modifiers:{altKey:1}, chars:"\u02D9", unmodifiedChars:"h"}, + nsIDOMKeyEvent.DOM_VK_H, "\u02D9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H, + modifiers:{metaKey:1}, chars:"h", unmodifiedChars:"h"}, + nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, + modifiers:{}, chars:"i", unmodifiedChars:"i"}, + nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, + modifiers:{shiftKey:1}, chars:"I", unmodifiedChars:"I"}, + nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, + modifiers:{ctrlKey:1}, chars:"\u0009", unmodifiedChars:"i"}, + nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, + modifiers:{altKey:1}, chars:"", unmodifiedChars:"i"}, + nsIDOMKeyEvent.DOM_VK_I, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key // XXX This test causes memory leak. - // testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, - // modifiers:{metaKey:1}, chars:"i", unmodifiedChars:"i"}, - // nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, - modifiers:{}, chars:"j", unmodifiedChars:"j"}, - nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, - modifiers:{shiftKey:1}, chars:"J", unmodifiedChars:"J"}, - nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, - modifiers:{ctrlKey:1}, chars:"\u000A", unmodifiedChars:"j"}, - nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, - modifiers:{altKey:1}, chars:"\u2206", unmodifiedChars:"j"}, - nsIDOMKeyEvent.DOM_VK_J, "\u2206", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, - modifiers:{metaKey:1}, chars:"j", unmodifiedChars:"j"}, - nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, - modifiers:{}, chars:"k", unmodifiedChars:"k"}, - nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, - modifiers:{shiftKey:1}, chars:"K", unmodifiedChars:"K"}, - nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, - modifiers:{ctrlKey:1}, chars:"\u000B", unmodifiedChars:"k"}, - nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, - modifiers:{altKey:1}, chars:"\u02DA", unmodifiedChars:"k"}, - nsIDOMKeyEvent.DOM_VK_K, "\u02DA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, - modifiers:{metaKey:1}, chars:"k", unmodifiedChars:"k"}, - nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, - modifiers:{}, chars:"l", unmodifiedChars:"l"}, - nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, - modifiers:{shiftKey:1}, chars:"L", unmodifiedChars:"L"}, - nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, - modifiers:{ctrlKey:1}, chars:"\u000C", unmodifiedChars:"l"}, - nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, - modifiers:{altKey:1}, chars:"\u00AC", unmodifiedChars:"l"}, - nsIDOMKeyEvent.DOM_VK_L, "\u00AC", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, - modifiers:{metaKey:1}, chars:"l", unmodifiedChars:"l"}, - nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, - modifiers:{}, chars:"m", unmodifiedChars:"m"}, - nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, - modifiers:{shiftKey:1}, chars:"M", unmodifiedChars:"M"}, - nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, - modifiers:{ctrlKey:1}, chars:"\u000D", unmodifiedChars:"m"}, - nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, - modifiers:{altKey:1}, chars:"\u00B5", unmodifiedChars:"m"}, - nsIDOMKeyEvent.DOM_VK_M, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, - modifiers:{metaKey:1}, chars:"m", unmodifiedChars:"m"}, - nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, - modifiers:{}, chars:"n", unmodifiedChars:"n"}, - nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, - modifiers:{shiftKey:1}, chars:"N", unmodifiedChars:"N"}, - nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, - modifiers:{ctrlKey:1}, chars:"\u000E", unmodifiedChars:"n"}, - nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, - modifiers:{altKey:1}, chars:"", unmodifiedChars:"n"}, - nsIDOMKeyEvent.DOM_VK_N, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, - modifiers:{metaKey:1}, chars:"n", unmodifiedChars:"n"}, - nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, - modifiers:{}, chars:"o", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, - modifiers:{shiftKey:1}, chars:"O", unmodifiedChars:"O"}, - nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, - modifiers:{ctrlKey:1}, chars:"\u000F", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, - modifiers:{altKey:1}, chars:"\u00F8", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "\u00F8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, - modifiers:{metaKey:1}, chars:"o", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, - modifiers:{}, chars:"p", unmodifiedChars:"p"}, - nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, - modifiers:{shiftKey:1}, chars:"P", unmodifiedChars:"P"}, - nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, - modifiers:{ctrlKey:1}, chars:"\u0010", unmodifiedChars:"p"}, - nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, - modifiers:{altKey:1}, chars:"\u03C0", unmodifiedChars:"p"}, - nsIDOMKeyEvent.DOM_VK_P, "\u03C0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I, + // modifiers:{metaKey:1}, chars:"i", unmodifiedChars:"i"}, + // nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, + modifiers:{}, chars:"j", unmodifiedChars:"j"}, + nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, + modifiers:{shiftKey:1}, chars:"J", unmodifiedChars:"J"}, + nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, + modifiers:{ctrlKey:1}, chars:"\u000A", unmodifiedChars:"j"}, + nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, + modifiers:{altKey:1}, chars:"\u2206", unmodifiedChars:"j"}, + nsIDOMKeyEvent.DOM_VK_J, "\u2206", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J, + modifiers:{metaKey:1}, chars:"j", unmodifiedChars:"j"}, + nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, + modifiers:{}, chars:"k", unmodifiedChars:"k"}, + nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, + modifiers:{shiftKey:1}, chars:"K", unmodifiedChars:"K"}, + nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, + modifiers:{ctrlKey:1}, chars:"\u000B", unmodifiedChars:"k"}, + nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, + modifiers:{altKey:1}, chars:"\u02DA", unmodifiedChars:"k"}, + nsIDOMKeyEvent.DOM_VK_K, "\u02DA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K, + modifiers:{metaKey:1}, chars:"k", unmodifiedChars:"k"}, + nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, + modifiers:{}, chars:"l", unmodifiedChars:"l"}, + nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, + modifiers:{shiftKey:1}, chars:"L", unmodifiedChars:"L"}, + nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, + modifiers:{ctrlKey:1}, chars:"\u000C", unmodifiedChars:"l"}, + nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, + modifiers:{altKey:1}, chars:"\u00AC", unmodifiedChars:"l"}, + nsIDOMKeyEvent.DOM_VK_L, "\u00AC", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L, + modifiers:{metaKey:1}, chars:"l", unmodifiedChars:"l"}, + nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, + modifiers:{}, chars:"m", unmodifiedChars:"m"}, + nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, + modifiers:{shiftKey:1}, chars:"M", unmodifiedChars:"M"}, + nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, + modifiers:{ctrlKey:1}, chars:"\u000D", unmodifiedChars:"m"}, + nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, + modifiers:{altKey:1}, chars:"\u00B5", unmodifiedChars:"m"}, + nsIDOMKeyEvent.DOM_VK_M, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M, + modifiers:{metaKey:1}, chars:"m", unmodifiedChars:"m"}, + nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, + modifiers:{}, chars:"n", unmodifiedChars:"n"}, + nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, + modifiers:{shiftKey:1}, chars:"N", unmodifiedChars:"N"}, + nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, + modifiers:{ctrlKey:1}, chars:"\u000E", unmodifiedChars:"n"}, + nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, + modifiers:{altKey:1}, chars:"", unmodifiedChars:"n"}, + nsIDOMKeyEvent.DOM_VK_N, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N, + modifiers:{metaKey:1}, chars:"n", unmodifiedChars:"n"}, + nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, + modifiers:{}, chars:"o", unmodifiedChars:"o"}, + nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, + modifiers:{shiftKey:1}, chars:"O", unmodifiedChars:"O"}, + nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, + modifiers:{ctrlKey:1}, chars:"\u000F", unmodifiedChars:"o"}, + nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, + modifiers:{altKey:1}, chars:"\u00F8", unmodifiedChars:"o"}, + nsIDOMKeyEvent.DOM_VK_O, "\u00F8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O, + modifiers:{metaKey:1}, chars:"o", unmodifiedChars:"o"}, + nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, + modifiers:{}, chars:"p", unmodifiedChars:"p"}, + nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, + modifiers:{shiftKey:1}, chars:"P", unmodifiedChars:"P"}, + nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, + modifiers:{ctrlKey:1}, chars:"\u0010", unmodifiedChars:"p"}, + nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, + modifiers:{altKey:1}, chars:"\u03C0", unmodifiedChars:"p"}, + nsIDOMKeyEvent.DOM_VK_P, "\u03C0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // XXX This test starts private browsing mode (stopped at the confirmation dialog) - // testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, - // modifiers:{metaKey:1}, chars:"p", unmodifiedChars:"p"}, - // nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, - modifiers:{}, chars:"q", unmodifiedChars:"q"}, - nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, - modifiers:{shiftKey:1}, chars:"Q", unmodifiedChars:"Q"}, - nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, - modifiers:{ctrlKey:1}, chars:"\u0011", unmodifiedChars:"q"}, - nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, - modifiers:{altKey:1}, chars:"\u0153", unmodifiedChars:"q"}, - nsIDOMKeyEvent.DOM_VK_Q, "\u0153", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, - modifiers:{metaKey:1}, chars:"q", unmodifiedChars:"q"}, - nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, - modifiers:{}, chars:"r", unmodifiedChars:"r"}, - nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, - modifiers:{shiftKey:1}, chars:"R", unmodifiedChars:"R"}, - nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, - modifiers:{ctrlKey:1}, chars:"\u0012", unmodifiedChars:"r"}, - nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, - modifiers:{altKey:1}, chars:"\u00AE", unmodifiedChars:"r"}, - nsIDOMKeyEvent.DOM_VK_R, "\u00AE", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P, + // modifiers:{metaKey:1}, chars:"p", unmodifiedChars:"p"}, + // nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, + modifiers:{}, chars:"q", unmodifiedChars:"q"}, + nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, + modifiers:{shiftKey:1}, chars:"Q", unmodifiedChars:"Q"}, + nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, + modifiers:{ctrlKey:1}, chars:"\u0011", unmodifiedChars:"q"}, + nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, + modifiers:{altKey:1}, chars:"\u0153", unmodifiedChars:"q"}, + nsIDOMKeyEvent.DOM_VK_Q, "\u0153", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q, + modifiers:{metaKey:1}, chars:"q", unmodifiedChars:"q"}, + nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, + modifiers:{}, chars:"r", unmodifiedChars:"r"}, + nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, + modifiers:{shiftKey:1}, chars:"R", unmodifiedChars:"R"}, + nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, + modifiers:{ctrlKey:1}, chars:"\u0012", unmodifiedChars:"r"}, + nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, + modifiers:{altKey:1}, chars:"\u00AE", unmodifiedChars:"r"}, + nsIDOMKeyEvent.DOM_VK_R, "\u00AE", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // XXX This test makes some tabs and dialogs. - // testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, - // modifiers:{metaKey:1}, chars:"r", unmodifiedChars:"r"}, - // nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, - modifiers:{}, chars:"s", unmodifiedChars:"s"}, - nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, - modifiers:{shiftKey:1}, chars:"S", unmodifiedChars:"S"}, - nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, - modifiers:{ctrlKey:1}, chars:"\u0013", unmodifiedChars:"s"}, - nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, - modifiers:{altKey:1}, chars:"\u00DF", unmodifiedChars:"s"}, - nsIDOMKeyEvent.DOM_VK_S, "\u00DF", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, - modifiers:{metaKey:1}, chars:"s", unmodifiedChars:"s"}, - nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, - modifiers:{}, chars:"t", unmodifiedChars:"t"}, - nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, - modifiers:{shiftKey:1}, chars:"T", unmodifiedChars:"T"}, - nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, - modifiers:{ctrlKey:1}, chars:"\u0014", unmodifiedChars:"t"}, - nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, - modifiers:{altKey:1}, chars:"\u2020", unmodifiedChars:"t"}, - nsIDOMKeyEvent.DOM_VK_T, "\u2020", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, - modifiers:{metaKey:1}, chars:"t", unmodifiedChars:"t"}, - nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, - modifiers:{}, chars:"u", unmodifiedChars:"u"}, - nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, - modifiers:{shiftKey:1}, chars:"U", unmodifiedChars:"U"}, - nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, - modifiers:{ctrlKey:1}, chars:"\u0015", unmodifiedChars:"u"}, - nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, - modifiers:{altKey:1}, chars:"", unmodifiedChars:"u"}, - nsIDOMKeyEvent.DOM_VK_U, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, - modifiers:{metaKey:1}, chars:"u", unmodifiedChars:"u"}, - nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, - modifiers:{}, chars:"v", unmodifiedChars:"v"}, - nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, - modifiers:{shiftKey:1}, chars:"V", unmodifiedChars:"V"}, - nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, - modifiers:{ctrlKey:1}, chars:"\u0016", unmodifiedChars:"v"}, - nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, - modifiers:{altKey:1}, chars:"\u221A", unmodifiedChars:"v"}, - nsIDOMKeyEvent.DOM_VK_V, "\u221A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, - modifiers:{metaKey:1}, chars:"v", unmodifiedChars:"v"}, - nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, - modifiers:{}, chars:"w", unmodifiedChars:"w"}, - nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, - modifiers:{shiftKey:1}, chars:"W", unmodifiedChars:"W"}, - nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, - modifiers:{ctrlKey:1}, chars:"\u0017", unmodifiedChars:"w"}, - nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, - modifiers:{altKey:1}, chars:"\u2211", unmodifiedChars:"w"}, - nsIDOMKeyEvent.DOM_VK_W, "\u2211", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, - modifiers:{metaKey:1}, chars:"w", unmodifiedChars:"w"}, - nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, - modifiers:{}, chars:"x", unmodifiedChars:"x"}, - nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, - modifiers:{shiftKey:1}, chars:"X", unmodifiedChars:"X"}, - nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, - modifiers:{ctrlKey:1}, chars:"\u0018", unmodifiedChars:"x"}, - nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, - modifiers:{altKey:1}, chars:"\u2248", unmodifiedChars:"x"}, - nsIDOMKeyEvent.DOM_VK_X, "\u2248", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, - modifiers:{metaKey:1}, chars:"x", unmodifiedChars:"x"}, - nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, - modifiers:{}, chars:"y", unmodifiedChars:"y"}, - nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, - modifiers:{shiftKey:1}, chars:"Y", unmodifiedChars:"Y"}, - nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, - modifiers:{ctrlKey:1}, chars:"\u0019", unmodifiedChars:"y"}, - nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, - modifiers:{altKey:1}, chars:"\u00A5", unmodifiedChars:"y"}, - nsIDOMKeyEvent.DOM_VK_Y, "\u00A5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, - modifiers:{metaKey:1}, chars:"y", unmodifiedChars:"y"}, - nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, - modifiers:{}, chars:"z", unmodifiedChars:"z"}, - nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, - modifiers:{shiftKey:1}, chars:"Z", unmodifiedChars:"Z"}, - nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, - modifiers:{ctrlKey:1}, chars:"\u001A", unmodifiedChars:"z"}, - nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, - modifiers:{altKey:1}, chars:"\u03A9", unmodifiedChars:"z"}, - nsIDOMKeyEvent.DOM_VK_Z, "\u03A9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, - modifiers:{metaKey:1}, chars:"z", unmodifiedChars:"z"}, - nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R, + // modifiers:{metaKey:1}, chars:"r", unmodifiedChars:"r"}, + // nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, + modifiers:{}, chars:"s", unmodifiedChars:"s"}, + nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, + modifiers:{shiftKey:1}, chars:"S", unmodifiedChars:"S"}, + nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, + modifiers:{ctrlKey:1}, chars:"\u0013", unmodifiedChars:"s"}, + nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, + modifiers:{altKey:1}, chars:"\u00DF", unmodifiedChars:"s"}, + nsIDOMKeyEvent.DOM_VK_S, "\u00DF", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S, + modifiers:{metaKey:1}, chars:"s", unmodifiedChars:"s"}, + nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, + modifiers:{}, chars:"t", unmodifiedChars:"t"}, + nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, + modifiers:{shiftKey:1}, chars:"T", unmodifiedChars:"T"}, + nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, + modifiers:{ctrlKey:1}, chars:"\u0014", unmodifiedChars:"t"}, + nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, + modifiers:{altKey:1}, chars:"\u2020", unmodifiedChars:"t"}, + nsIDOMKeyEvent.DOM_VK_T, "\u2020", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T, + modifiers:{metaKey:1}, chars:"t", unmodifiedChars:"t"}, + nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, + modifiers:{}, chars:"u", unmodifiedChars:"u"}, + nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, + modifiers:{shiftKey:1}, chars:"U", unmodifiedChars:"U"}, + nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, + modifiers:{ctrlKey:1}, chars:"\u0015", unmodifiedChars:"u"}, + nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, + modifiers:{altKey:1}, chars:"", unmodifiedChars:"u"}, + nsIDOMKeyEvent.DOM_VK_U, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U, + modifiers:{metaKey:1}, chars:"u", unmodifiedChars:"u"}, + nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, + modifiers:{}, chars:"v", unmodifiedChars:"v"}, + nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, + modifiers:{shiftKey:1}, chars:"V", unmodifiedChars:"V"}, + nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, + modifiers:{ctrlKey:1}, chars:"\u0016", unmodifiedChars:"v"}, + nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, + modifiers:{altKey:1}, chars:"\u221A", unmodifiedChars:"v"}, + nsIDOMKeyEvent.DOM_VK_V, "\u221A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V, + modifiers:{metaKey:1}, chars:"v", unmodifiedChars:"v"}, + nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, + modifiers:{}, chars:"w", unmodifiedChars:"w"}, + nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, + modifiers:{shiftKey:1}, chars:"W", unmodifiedChars:"W"}, + nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, + modifiers:{ctrlKey:1}, chars:"\u0017", unmodifiedChars:"w"}, + nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, + modifiers:{altKey:1}, chars:"\u2211", unmodifiedChars:"w"}, + nsIDOMKeyEvent.DOM_VK_W, "\u2211", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W, + modifiers:{metaKey:1}, chars:"w", unmodifiedChars:"w"}, + nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, + modifiers:{}, chars:"x", unmodifiedChars:"x"}, + nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, + modifiers:{shiftKey:1}, chars:"X", unmodifiedChars:"X"}, + nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, + modifiers:{ctrlKey:1}, chars:"\u0018", unmodifiedChars:"x"}, + nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, + modifiers:{altKey:1}, chars:"\u2248", unmodifiedChars:"x"}, + nsIDOMKeyEvent.DOM_VK_X, "\u2248", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X, + modifiers:{metaKey:1}, chars:"x", unmodifiedChars:"x"}, + nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, + modifiers:{}, chars:"y", unmodifiedChars:"y"}, + nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, + modifiers:{shiftKey:1}, chars:"Y", unmodifiedChars:"Y"}, + nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, + modifiers:{ctrlKey:1}, chars:"\u0019", unmodifiedChars:"y"}, + nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, + modifiers:{altKey:1}, chars:"\u00A5", unmodifiedChars:"y"}, + nsIDOMKeyEvent.DOM_VK_Y, "\u00A5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y, + modifiers:{metaKey:1}, chars:"y", unmodifiedChars:"y"}, + nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, + modifiers:{}, chars:"z", unmodifiedChars:"z"}, + nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, + modifiers:{shiftKey:1}, chars:"Z", unmodifiedChars:"Z"}, + nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, + modifiers:{ctrlKey:1}, chars:"\u001A", unmodifiedChars:"z"}, + nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, + modifiers:{altKey:1}, chars:"\u03A9", unmodifiedChars:"z"}, + nsIDOMKeyEvent.DOM_VK_Z, "\u03A9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z, + modifiers:{metaKey:1}, chars:"z", unmodifiedChars:"z"}, + nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // numeric - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, - modifiers:{}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, - modifiers:{shiftKey:1}, chars:"!", unmodifiedChars:"!"}, - nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, - modifiers:{ctrlKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, - modifiers:{altKey:1}, chars:"\u00A1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "\u00A1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, - modifiers:{metaKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, - modifiers:{}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, - modifiers:{shiftKey:1}, chars:"@", unmodifiedChars:"@"}, - nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, - modifiers:{ctrlKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, - modifiers:{altKey:1}, chars:"\u00A1", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "\u00A1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, - modifiers:{metaKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, - modifiers:{}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, - modifiers:{shiftKey:1}, chars:"#", unmodifiedChars:"#"}, - nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, - modifiers:{ctrlKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, - modifiers:{altKey:1}, chars:"\u00A3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, - modifiers:{metaKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, - modifiers:{}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, - modifiers:{shiftKey:1}, chars:"$", unmodifiedChars:"$"}, - nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, - modifiers:{ctrlKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, - modifiers:{altKey:1}, chars:"\u00A2", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "\u00A2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, - modifiers:{metaKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, - modifiers:{}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, - modifiers:{shiftKey:1}, chars:"%", unmodifiedChars:"%"}, - nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, - modifiers:{ctrlKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, - modifiers:{altKey:1}, chars:"\u221E", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "\u221E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, - modifiers:{metaKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, - modifiers:{}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, - modifiers:{shiftKey:1}, chars:"^", unmodifiedChars:"^"}, - nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, - modifiers:{ctrlKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, - modifiers:{altKey:1}, chars:"\u00A7", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, - modifiers:{metaKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, - modifiers:{}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, - modifiers:{shiftKey:1}, chars:"\u0026;", unmodifiedChars:"\u0026;"}, - nsIDOMKeyEvent.DOM_VK_7, "\u0026", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, - modifiers:{ctrlKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, - modifiers:{altKey:1}, chars:"\u00B6", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "\u00B6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, - modifiers:{metaKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, - modifiers:{}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, - modifiers:{shiftKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, - modifiers:{ctrlKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, - modifiers:{altKey:1}, chars:"\u2022", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "\u2022", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, - modifiers:{metaKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, - modifiers:{}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, - modifiers:{shiftKey:1}, chars:"(", unmodifiedChars:"("}, - nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, - modifiers:{ctrlKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, - modifiers:{altKey:1}, chars:"\u00AA", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "\u00AA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, - modifiers:{metaKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, - modifiers:{}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, - modifiers:{shiftKey:1}, chars:")", unmodifiedChars:")"}, - nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, - modifiers:{ctrlKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, - modifiers:{altKey:1}, chars:"\u00BA", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "\u00BA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, - modifiers:{metaKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, + modifiers:{}, chars:"1", unmodifiedChars:"1"}, + nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, + modifiers:{shiftKey:1}, chars:"!", unmodifiedChars:"!"}, + nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, + modifiers:{ctrlKey:1}, chars:"1", unmodifiedChars:"1"}, + nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, + modifiers:{altKey:1}, chars:"\u00A1", unmodifiedChars:"1"}, + nsIDOMKeyEvent.DOM_VK_1, "\u00A1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1, + modifiers:{metaKey:1}, chars:"1", unmodifiedChars:"1"}, + nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, + modifiers:{}, chars:"2", unmodifiedChars:"2"}, + nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, + modifiers:{shiftKey:1}, chars:"@", unmodifiedChars:"@"}, + nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, + modifiers:{ctrlKey:1}, chars:"2", unmodifiedChars:"2"}, + nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, + modifiers:{altKey:1}, chars:"\u00A1", unmodifiedChars:"2"}, + nsIDOMKeyEvent.DOM_VK_2, "\u00A1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2, + modifiers:{metaKey:1}, chars:"2", unmodifiedChars:"2"}, + nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, + modifiers:{}, chars:"3", unmodifiedChars:"3"}, + nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, + modifiers:{shiftKey:1}, chars:"#", unmodifiedChars:"#"}, + nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, + modifiers:{ctrlKey:1}, chars:"3", unmodifiedChars:"3"}, + nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, + modifiers:{altKey:1}, chars:"\u00A3", unmodifiedChars:"3"}, + nsIDOMKeyEvent.DOM_VK_3, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3, + modifiers:{metaKey:1}, chars:"3", unmodifiedChars:"3"}, + nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, + modifiers:{}, chars:"4", unmodifiedChars:"4"}, + nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, + modifiers:{shiftKey:1}, chars:"$", unmodifiedChars:"$"}, + nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, + modifiers:{ctrlKey:1}, chars:"4", unmodifiedChars:"4"}, + nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, + modifiers:{altKey:1}, chars:"\u00A2", unmodifiedChars:"4"}, + nsIDOMKeyEvent.DOM_VK_4, "\u00A2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4, + modifiers:{metaKey:1}, chars:"4", unmodifiedChars:"4"}, + nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, + modifiers:{}, chars:"5", unmodifiedChars:"5"}, + nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, + modifiers:{shiftKey:1}, chars:"%", unmodifiedChars:"%"}, + nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, + modifiers:{ctrlKey:1}, chars:"5", unmodifiedChars:"5"}, + nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, + modifiers:{altKey:1}, chars:"\u221E", unmodifiedChars:"5"}, + nsIDOMKeyEvent.DOM_VK_5, "\u221E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5, + modifiers:{metaKey:1}, chars:"5", unmodifiedChars:"5"}, + nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, + modifiers:{}, chars:"6", unmodifiedChars:"6"}, + nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, + modifiers:{shiftKey:1}, chars:"^", unmodifiedChars:"^"}, + nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, + modifiers:{ctrlKey:1}, chars:"6", unmodifiedChars:"6"}, + nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, + modifiers:{altKey:1}, chars:"\u00A7", unmodifiedChars:"6"}, + nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6, + modifiers:{metaKey:1}, chars:"6", unmodifiedChars:"6"}, + nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, + modifiers:{}, chars:"7", unmodifiedChars:"7"}, + nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, + modifiers:{shiftKey:1}, chars:"\u0026;", unmodifiedChars:"\u0026;"}, + nsIDOMKeyEvent.DOM_VK_7, "\u0026", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, + modifiers:{ctrlKey:1}, chars:"7", unmodifiedChars:"7"}, + nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, + modifiers:{altKey:1}, chars:"\u00B6", unmodifiedChars:"7"}, + nsIDOMKeyEvent.DOM_VK_7, "\u00B6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7, + modifiers:{metaKey:1}, chars:"7", unmodifiedChars:"7"}, + nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, + modifiers:{}, chars:"8", unmodifiedChars:"8"}, + nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, + modifiers:{shiftKey:1}, chars:"*", unmodifiedChars:"*"}, + nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, + modifiers:{ctrlKey:1}, chars:"8", unmodifiedChars:"8"}, + nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, + modifiers:{altKey:1}, chars:"\u2022", unmodifiedChars:"8"}, + nsIDOMKeyEvent.DOM_VK_8, "\u2022", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8, + modifiers:{metaKey:1}, chars:"8", unmodifiedChars:"8"}, + nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, + modifiers:{}, chars:"9", unmodifiedChars:"9"}, + nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, + modifiers:{shiftKey:1}, chars:"(", unmodifiedChars:"("}, + nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, + modifiers:{ctrlKey:1}, chars:"9", unmodifiedChars:"9"}, + nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, + modifiers:{altKey:1}, chars:"\u00AA", unmodifiedChars:"9"}, + nsIDOMKeyEvent.DOM_VK_9, "\u00AA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9, + modifiers:{metaKey:1}, chars:"9", unmodifiedChars:"9"}, + nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, + modifiers:{}, chars:"0", unmodifiedChars:"0"}, + nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, + modifiers:{shiftKey:1}, chars:")", unmodifiedChars:")"}, + nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, + modifiers:{ctrlKey:1}, chars:"0", unmodifiedChars:"0"}, + nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, + modifiers:{altKey:1}, chars:"\u00BA", unmodifiedChars:"0"}, + nsIDOMKeyEvent.DOM_VK_0, "\u00BA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0, + modifiers:{metaKey:1}, chars:"0", unmodifiedChars:"0"}, + nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // other chracters - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, - modifiers:{}, chars:"`", unmodifiedChars:"`"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, - modifiers:{shiftKey:1}, chars:"~", unmodifiedChars:"~"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, - modifiers:{ctrlKey:1}, chars:"`", unmodifiedChars:"`"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, - modifiers:{altKey:1}, chars:"", unmodifiedChars:"`"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, - modifiers:{metaKey:1}, chars:"`", unmodifiedChars:"`"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, - modifiers:{}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, - modifiers:{shiftKey:1}, chars:"_", unmodifiedChars:"_"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, + modifiers:{}, chars:"`", unmodifiedChars:"`"}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, + modifiers:{shiftKey:1}, chars:"~", unmodifiedChars:"~"}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, + modifiers:{ctrlKey:1}, chars:"`", unmodifiedChars:"`"}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, + modifiers:{altKey:1}, chars:"", unmodifiedChars:"`"}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave, + modifiers:{metaKey:1}, chars:"`", unmodifiedChars:"`"}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, + modifiers:{}, chars:"-", unmodifiedChars:"-"}, + nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, + modifiers:{shiftKey:1}, chars:"_", unmodifiedChars:"_"}, + nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: - // testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, - // modifiers:{ctrlKey:1}, chars:"\u001F", unmodifiedChars:"-"}, - // nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, - modifiers:{altKey:1}, chars:"\u2013", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "\u2013", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, - modifiers:{metaKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, - modifiers:{}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, - modifiers:{shiftKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, - modifiers:{ctrlKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, - modifiers:{altKey:1}, chars:"\u2260", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "\u2260", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, - modifiers:{metaKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, - modifiers:{}, chars:"[", unmodifiedChars:"["}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, - modifiers:{shiftKey:1}, chars:"{", unmodifiedChars:"{"}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, + // modifiers:{ctrlKey:1}, chars:"\u001F", unmodifiedChars:"-"}, + // nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, + modifiers:{altKey:1}, chars:"\u2013", unmodifiedChars:"-"}, + nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "\u2013", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus, + modifiers:{metaKey:1}, chars:"-", unmodifiedChars:"-"}, + nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, + modifiers:{}, chars:"=", unmodifiedChars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, + modifiers:{shiftKey:1}, chars:"+", unmodifiedChars:"+"}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, + modifiers:{ctrlKey:1}, chars:"=", unmodifiedChars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, + modifiers:{altKey:1}, chars:"\u2260", unmodifiedChars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "\u2260", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal, + modifiers:{metaKey:1}, chars:"=", unmodifiedChars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, + modifiers:{}, chars:"[", unmodifiedChars:"["}, + nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, + modifiers:{shiftKey:1}, chars:"{", unmodifiedChars:"{"}, + nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: - // testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, - // modifiers:{ctrlKey:1}, chars:"\u001B", unmodifiedChars:"["}, - // nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, - modifiers:{altKey:1}, chars:"\u201C", unmodifiedChars:"["}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "\u201C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, - modifiers:{metaKey:1}, chars:"[", unmodifiedChars:"["}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, - modifiers:{}, chars:"]", unmodifiedChars:"]"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, - modifiers:{shiftKey:1}, chars:"}", unmodifiedChars:"}"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, + // modifiers:{ctrlKey:1}, chars:"\u001B", unmodifiedChars:"["}, + // nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, + modifiers:{altKey:1}, chars:"\u201C", unmodifiedChars:"["}, + nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "\u201C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket, + modifiers:{metaKey:1}, chars:"[", unmodifiedChars:"["}, + nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, + modifiers:{}, chars:"]", unmodifiedChars:"]"}, + nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, + modifiers:{shiftKey:1}, chars:"}", unmodifiedChars:"}"}, + nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: - // testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, - // modifiers:{ctrlKey:1}, chars:"\u001D", unmodifiedChars:"]"}, - // nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, - modifiers:{altKey:1}, chars:"\u2018", unmodifiedChars:"]"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "\u2018", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, - modifiers:{metaKey:1}, chars:"]", unmodifiedChars:"]"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, - modifiers:{}, chars:"\\", unmodifiedChars:"\\"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, - modifiers:{shiftKey:1}, chars:"|", unmodifiedChars:"|"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, + // modifiers:{ctrlKey:1}, chars:"\u001D", unmodifiedChars:"]"}, + // nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, + modifiers:{altKey:1}, chars:"\u2018", unmodifiedChars:"]"}, + nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "\u2018", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket, + modifiers:{metaKey:1}, chars:"]", unmodifiedChars:"]"}, + nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, + modifiers:{}, chars:"\\", unmodifiedChars:"\\"}, + nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, + modifiers:{shiftKey:1}, chars:"|", unmodifiedChars:"|"}, + nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: - // testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, - // modifiers:{ctrlKey:1}, chars:"\u001C", unmodifiedChars:"\\"}, - // nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, - modifiers:{altKey:1}, chars:"\u00AB", unmodifiedChars:"\\"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\u00AB", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, - modifiers:{metaKey:1}, chars:"\\", unmodifiedChars:"\\"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, - modifiers:{}, chars:";", unmodifiedChars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, - modifiers:{shiftKey:1}, chars:":", unmodifiedChars:":"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, - modifiers:{ctrlKey:1}, chars:";", unmodifiedChars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, - modifiers:{altKey:1}, chars:"\u2026", unmodifiedChars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, "\u2026", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, - modifiers:{metaKey:1}, chars:";", unmodifiedChars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, - modifiers:{}, chars:"'", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, - modifiers:{shiftKey:1}, chars:"\"", unmodifiedChars:"\""}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, - modifiers:{ctrlKey:1}, chars:"'", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, - modifiers:{altKey:1}, chars:"\u00E6", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "\u00E6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, - modifiers:{metaKey:1}, chars:"'", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, - modifiers:{}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, - modifiers:{shiftKey:1}, chars:"\u003C", unmodifiedChars:"\u003C"}, - nsIDOMKeyEvent.DOM_VK_COMMA, "\u003C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, - modifiers:{ctrlKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, - modifiers:{altKey:1}, chars:"\u2264", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, "\u2264", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, - modifiers:{metaKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, - modifiers:{}, chars:".", unmodifiedChars:"."}, - nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, - modifiers:{shiftKey:1}, chars:"\u003E", unmodifiedChars:"\u003E"}, - nsIDOMKeyEvent.DOM_VK_PERIOD, "\u003E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, - modifiers:{ctrlKey:1}, chars:".", unmodifiedChars:"."}, - nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, - modifiers:{altKey:1}, chars:"\u2265", unmodifiedChars:"."}, - nsIDOMKeyEvent.DOM_VK_PERIOD, "\u2265", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, - modifiers:{metaKey:1}, chars:".", unmodifiedChars:"."}, - nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, - modifiers:{}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, - modifiers:{shiftKey:1}, chars:"?", unmodifiedChars:"?"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, - modifiers:{ctrlKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, - modifiers:{altKey:1}, chars:"\u00F7", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "\u00F7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, - modifiers:{metaKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, + // modifiers:{ctrlKey:1}, chars:"\u001C", unmodifiedChars:"\\"}, + // nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, + modifiers:{altKey:1}, chars:"\u00AB", unmodifiedChars:"\\"}, + nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\u00AB", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash, + modifiers:{metaKey:1}, chars:"\\", unmodifiedChars:"\\"}, + nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, + modifiers:{}, chars:";", unmodifiedChars:";"}, + nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, + modifiers:{shiftKey:1}, chars:":", unmodifiedChars:":"}, + nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, + modifiers:{ctrlKey:1}, chars:";", unmodifiedChars:";"}, + nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, + modifiers:{altKey:1}, chars:"\u2026", unmodifiedChars:";"}, + nsIDOMKeyEvent.DOM_VK_SEMICOLON, "\u2026", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, + modifiers:{metaKey:1}, chars:";", unmodifiedChars:";"}, + nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, + modifiers:{}, chars:"'", unmodifiedChars:"'"}, + nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, + modifiers:{shiftKey:1}, chars:"\"", unmodifiedChars:"\""}, + nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, + modifiers:{ctrlKey:1}, chars:"'", unmodifiedChars:"'"}, + nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, + modifiers:{altKey:1}, chars:"\u00E6", unmodifiedChars:"'"}, + nsIDOMKeyEvent.DOM_VK_QUOTE, "\u00E6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote, + modifiers:{metaKey:1}, chars:"'", unmodifiedChars:"'"}, + nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, + modifiers:{}, chars:",", unmodifiedChars:","}, + nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, + modifiers:{shiftKey:1}, chars:"\u003C", unmodifiedChars:"\u003C"}, + nsIDOMKeyEvent.DOM_VK_COMMA, "\u003C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, + modifiers:{ctrlKey:1}, chars:",", unmodifiedChars:","}, + nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, + modifiers:{altKey:1}, chars:"\u2264", unmodifiedChars:","}, + nsIDOMKeyEvent.DOM_VK_COMMA, "\u2264", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma, + modifiers:{metaKey:1}, chars:",", unmodifiedChars:","}, + nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, + modifiers:{}, chars:".", unmodifiedChars:"."}, + nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, + modifiers:{shiftKey:1}, chars:"\u003E", unmodifiedChars:"\u003E"}, + nsIDOMKeyEvent.DOM_VK_PERIOD, "\u003E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, + modifiers:{ctrlKey:1}, chars:".", unmodifiedChars:"."}, + nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, + modifiers:{altKey:1}, chars:"\u2265", unmodifiedChars:"."}, + nsIDOMKeyEvent.DOM_VK_PERIOD, "\u2265", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, + modifiers:{metaKey:1}, chars:".", unmodifiedChars:"."}, + nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, + modifiers:{}, chars:"/", unmodifiedChars:"/"}, + nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, + modifiers:{shiftKey:1}, chars:"?", unmodifiedChars:"?"}, + nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, + modifiers:{ctrlKey:1}, chars:"/", unmodifiedChars:"/"}, + nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, + modifiers:{altKey:1}, chars:"\u00F7", unmodifiedChars:"/"}, + nsIDOMKeyEvent.DOM_VK_SLASH, "\u00F7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash, + modifiers:{metaKey:1}, chars:"/", unmodifiedChars:"/"}, + nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // numpad - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, - modifiers:{numericKeyPadKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, - modifiers:{numericKeyPadKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, - modifiers:{numericKeyPadKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, - modifiers:{numericKeyPadKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, - modifiers:{numericKeyPadKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, - modifiers:{numericKeyPadKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, - modifiers:{numericKeyPadKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, - modifiers:{numericKeyPadKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, - modifiers:{numericKeyPadKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, - modifiers:{numericKeyPadKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, - modifiers:{numericKeyPadKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"=", unmodifiedChars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, - modifiers:{numericKeyPadKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, - modifiers:{numericKeyPadKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"*", unmodifiedChars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, - modifiers:{numericKeyPadKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"-", unmodifiedChars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, - modifiers:{numericKeyPadKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"+", unmodifiedChars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, - modifiers:{numericKeyPadKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, - modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, - modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, - modifiers:{numericKeyPadKey:1, altKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, - modifiers:{numericKeyPadKey:1, metaKey:1}, chars:",", unmodifiedChars:","}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, + modifiers:{numericKeyPadKey:1}, chars:"1", unmodifiedChars:"1"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"1", unmodifiedChars:"1"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"1", unmodifiedChars:"1"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"1", unmodifiedChars:"1"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"1", unmodifiedChars:"1"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, + modifiers:{numericKeyPadKey:1}, chars:"2", unmodifiedChars:"2"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"2", unmodifiedChars:"2"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"2", unmodifiedChars:"2"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"2", unmodifiedChars:"2"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"2", unmodifiedChars:"2"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, + modifiers:{numericKeyPadKey:1}, chars:"3", unmodifiedChars:"3"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"3", unmodifiedChars:"3"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"3", unmodifiedChars:"3"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"3", unmodifiedChars:"3"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"3", unmodifiedChars:"3"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, + modifiers:{numericKeyPadKey:1}, chars:"4", unmodifiedChars:"4"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"4", unmodifiedChars:"4"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"4", unmodifiedChars:"4"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"4", unmodifiedChars:"4"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"4", unmodifiedChars:"4"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, + modifiers:{numericKeyPadKey:1}, chars:"5", unmodifiedChars:"5"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"5", unmodifiedChars:"5"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"5", unmodifiedChars:"5"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"5", unmodifiedChars:"5"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"5", unmodifiedChars:"5"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, + modifiers:{numericKeyPadKey:1}, chars:"6", unmodifiedChars:"6"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"6", unmodifiedChars:"6"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"6", unmodifiedChars:"6"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"6", unmodifiedChars:"6"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"6", unmodifiedChars:"6"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, + modifiers:{numericKeyPadKey:1}, chars:"7", unmodifiedChars:"7"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"7", unmodifiedChars:"7"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"7", unmodifiedChars:"7"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"7", unmodifiedChars:"7"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"7", unmodifiedChars:"7"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, + modifiers:{numericKeyPadKey:1}, chars:"8", unmodifiedChars:"8"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"8", unmodifiedChars:"8"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"8", unmodifiedChars:"8"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"8", unmodifiedChars:"8"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"8", unmodifiedChars:"8"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, + modifiers:{numericKeyPadKey:1}, chars:"9", unmodifiedChars:"9"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"9", unmodifiedChars:"9"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"9", unmodifiedChars:"9"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"9", unmodifiedChars:"9"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"9", unmodifiedChars:"9"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, + modifiers:{numericKeyPadKey:1}, chars:"0", unmodifiedChars:"0"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"0", unmodifiedChars:"0"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"0", unmodifiedChars:"0"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"0", unmodifiedChars:"0"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"0", unmodifiedChars:"0"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, + modifiers:{numericKeyPadKey:1}, chars:"=", unmodifiedChars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"=", unmodifiedChars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"=", unmodifiedChars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"=", unmodifiedChars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"=", unmodifiedChars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, + modifiers:{numericKeyPadKey:1}, chars:"/", unmodifiedChars:"/"}, + nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"/", unmodifiedChars:"/"}, + nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"/", unmodifiedChars:"/"}, + nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"/", unmodifiedChars:"/"}, + nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"/", unmodifiedChars:"/"}, + nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, + modifiers:{numericKeyPadKey:1}, chars:"*", unmodifiedChars:"*"}, + nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"*", unmodifiedChars:"*"}, + nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"*", unmodifiedChars:"*"}, + nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"*", unmodifiedChars:"*"}, + nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"*", unmodifiedChars:"*"}, + nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, + modifiers:{numericKeyPadKey:1}, chars:"-", unmodifiedChars:"-"}, + nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"-", unmodifiedChars:"-"}, + nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"-", unmodifiedChars:"-"}, + nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"-", unmodifiedChars:"-"}, + nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"-", unmodifiedChars:"-"}, + nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, + modifiers:{numericKeyPadKey:1}, chars:"+", unmodifiedChars:"+"}, + nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"+", unmodifiedChars:"+"}, + nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"+", unmodifiedChars:"+"}, + nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"+", unmodifiedChars:"+"}, + nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"+", unmodifiedChars:"+"}, + nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, + modifiers:{numericKeyPadKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, + nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, + nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, + nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, + nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"}, + nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, + modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:",", unmodifiedChars:","}, + nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, + modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:",", unmodifiedChars:","}, + nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, + modifiers:{numericKeyPadKey:1, altKey:1}, chars:",", unmodifiedChars:","}, + nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma, + modifiers:{numericKeyPadKey:1, metaKey:1}, chars:",", unmodifiedChars:","}, + nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // French, numeric - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, - modifiers:{}, chars:"\u0026", unmodifiedChars:"\u0026"}, - nsIDOMKeyEvent.DOM_VK_1, "\u0026", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, - modifiers:{shiftKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, - modifiers:{ctrlKey:1}, chars:"1", unmodifiedChars:"\u0026"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, - modifiers:{metaKey:1}, chars:"\u0026", unmodifiedChars:"\u0026"}, - nsIDOMKeyEvent.DOM_VK_1, "\u0026", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, - modifiers:{metaKey:1, shiftKey:1}, chars:"1", unmodifiedChars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, - modifiers:{}, chars:"\u00E9", unmodifiedChars:"\u00E9"}, - nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, - modifiers:{shiftKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, - modifiers:{ctrlKey:1}, chars:"2", unmodifiedChars:"\u00E9"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, - modifiers:{metaKey:1}, chars:"\u00E9", unmodifiedChars:"\u00E9"}, - nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, - modifiers:{metaKey:1, shiftKey:1}, chars:"2", unmodifiedChars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, - modifiers:{}, chars:"\"", unmodifiedChars:"\""}, - nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, - modifiers:{shiftKey:1}, chars:"3", unmodifiedChars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, - modifiers:{ctrlKey:1}, chars:"3", unmodifiedChars:"\""}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, - modifiers:{metaKey:1}, chars:"\"", unmodifiedChars:"\""}, - nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, + modifiers:{}, chars:"\u0026", unmodifiedChars:"\u0026"}, + nsIDOMKeyEvent.DOM_VK_1, "\u0026", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, + modifiers:{shiftKey:1}, chars:"1", unmodifiedChars:"1"}, + nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, + modifiers:{ctrlKey:1}, chars:"1", unmodifiedChars:"\u0026"}, + nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, + modifiers:{metaKey:1}, chars:"\u0026", unmodifiedChars:"\u0026"}, + nsIDOMKeyEvent.DOM_VK_1, "\u0026", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1, + modifiers:{metaKey:1, shiftKey:1}, chars:"1", unmodifiedChars:"1"}, + nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, + modifiers:{}, chars:"\u00E9", unmodifiedChars:"\u00E9"}, + nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, + modifiers:{shiftKey:1}, chars:"2", unmodifiedChars:"2"}, + nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, + modifiers:{ctrlKey:1}, chars:"2", unmodifiedChars:"\u00E9"}, + nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, + modifiers:{metaKey:1}, chars:"\u00E9", unmodifiedChars:"\u00E9"}, + nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2, + modifiers:{metaKey:1, shiftKey:1}, chars:"2", unmodifiedChars:"2"}, + nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, + modifiers:{}, chars:"\"", unmodifiedChars:"\""}, + nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, + modifiers:{shiftKey:1}, chars:"3", unmodifiedChars:"3"}, + nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, + modifiers:{ctrlKey:1}, chars:"3", unmodifiedChars:"\""}, + nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, + modifiers:{metaKey:1}, chars:"\"", unmodifiedChars:"\""}, + nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Cmd+Shift+3 is a shortcut key of taking a snapshot - // testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, - // modifiers:{metaKey:1, shiftKey:1}, chars:"\"", unmodifiedChars:"\""}, - // nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, - modifiers:{}, chars:"'", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, - modifiers:{shiftKey:1}, chars:"4", unmodifiedChars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, - modifiers:{ctrlKey:1}, chars:"4", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, - modifiers:{metaKey:1}, chars:"'", unmodifiedChars:"'"}, - nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3, + // modifiers:{metaKey:1, shiftKey:1}, chars:"\"", unmodifiedChars:"\""}, + // nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, + modifiers:{}, chars:"'", unmodifiedChars:"'"}, + nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, + modifiers:{shiftKey:1}, chars:"4", unmodifiedChars:"4"}, + nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, + modifiers:{ctrlKey:1}, chars:"4", unmodifiedChars:"'"}, + nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, + modifiers:{metaKey:1}, chars:"'", unmodifiedChars:"'"}, + nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Cmd+Shift+4 is a shortcut key of taking a snapshot in specific range - // testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, - // modifiers:{metaKey:1, shiftKey:1}, chars:"4", unmodifiedChars:"4"}, - // nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, - modifiers:{}, chars:"(", unmodifiedChars:"("}, - nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, - modifiers:{shiftKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, - modifiers:{ctrlKey:1}, chars:"5", unmodifiedChars:"("}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, - modifiers:{metaKey:1}, chars:"(", unmodifiedChars:"("}, - nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, - modifiers:{metaKey:1, shiftKey:1}, chars:"5", unmodifiedChars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, - modifiers:{}, chars:"\u00A7", unmodifiedChars:"\u00A7"}, - nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, - modifiers:{shiftKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4, + // modifiers:{metaKey:1, shiftKey:1}, chars:"4", unmodifiedChars:"4"}, + // nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, + modifiers:{}, chars:"(", unmodifiedChars:"("}, + nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, + modifiers:{shiftKey:1}, chars:"5", unmodifiedChars:"5"}, + nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, + modifiers:{ctrlKey:1}, chars:"5", unmodifiedChars:"("}, + nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, + modifiers:{metaKey:1}, chars:"(", unmodifiedChars:"("}, + nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5, + modifiers:{metaKey:1, shiftKey:1}, chars:"5", unmodifiedChars:"5"}, + nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, + modifiers:{}, chars:"\u00A7", unmodifiedChars:"\u00A7"}, + nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, + modifiers:{shiftKey:1}, chars:"6", unmodifiedChars:"6"}, + nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: - // testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, - // modifiers:{ctrlKey:1}, chars:"\u001D", unmodifiedChars:"\u00A7"}, - // nsIDOMKeyEvent.DOM_VK_6, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl+6 sets strange char - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, - modifiers:{metaKey:1}, chars:"\u00A7", unmodifiedChars:"\u00A7"}, - nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, - modifiers:{metaKey:1, shiftKey:1}, chars:"6", unmodifiedChars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, - modifiers:{}, chars:"\u00E8", unmodifiedChars:"\u00E8"}, - nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, - modifiers:{shiftKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, - modifiers:{ctrlKey:1}, chars:"7", unmodifiedChars:"\u00E8"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, - modifiers:{metaKey:1}, chars:"\u00E8", unmodifiedChars:"\u00E8"}, - nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, - modifiers:{metaKey:1, shiftKey:1}, chars:"7", unmodifiedChars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, - modifiers:{}, chars:"!", unmodifiedChars:"!"}, - nsIDOMKeyEvent.DOM_VK_8, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, - modifiers:{shiftKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, - modifiers:{ctrlKey:1}, chars:"8", unmodifiedChars:"!"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, - modifiers:{metaKey:1}, chars:"!", unmodifiedChars:"!"}, - nsIDOMKeyEvent.DOM_VK_8, "!", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, - modifiers:{metaKey:1, shiftKey:1}, chars:"8", unmodifiedChars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, - modifiers:{}, chars:"\u00E7", unmodifiedChars:"\u00E7"}, - nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, - modifiers:{shiftKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, + // modifiers:{ctrlKey:1}, chars:"\u001D", unmodifiedChars:"\u00A7"}, + // nsIDOMKeyEvent.DOM_VK_6, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl+6 sets strange char + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, + modifiers:{metaKey:1}, chars:"\u00A7", unmodifiedChars:"\u00A7"}, + nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6, + modifiers:{metaKey:1, shiftKey:1}, chars:"6", unmodifiedChars:"6"}, + nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, + modifiers:{}, chars:"\u00E8", unmodifiedChars:"\u00E8"}, + nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, + modifiers:{shiftKey:1}, chars:"7", unmodifiedChars:"7"}, + nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, + modifiers:{ctrlKey:1}, chars:"7", unmodifiedChars:"\u00E8"}, + nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, + modifiers:{metaKey:1}, chars:"\u00E8", unmodifiedChars:"\u00E8"}, + nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7, + modifiers:{metaKey:1, shiftKey:1}, chars:"7", unmodifiedChars:"7"}, + nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, + modifiers:{}, chars:"!", unmodifiedChars:"!"}, + nsIDOMKeyEvent.DOM_VK_8, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, + modifiers:{shiftKey:1}, chars:"8", unmodifiedChars:"8"}, + nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, + modifiers:{ctrlKey:1}, chars:"8", unmodifiedChars:"!"}, + nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, + modifiers:{metaKey:1}, chars:"!", unmodifiedChars:"!"}, + nsIDOMKeyEvent.DOM_VK_8, "!", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8, + modifiers:{metaKey:1, shiftKey:1}, chars:"8", unmodifiedChars:"8"}, + nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, + modifiers:{}, chars:"\u00E7", unmodifiedChars:"\u00E7"}, + nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, + modifiers:{shiftKey:1}, chars:"9", unmodifiedChars:"9"}, + nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // TODO: - // testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, - // modifiers:{ctrlKey:1}, chars:"\u001C", unmodifiedChars:"\u00E7"}, - // nsIDOMKeyEvent.DOM_VK_9, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl+9 sets strange char - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, - modifiers:{metaKey:1}, chars:"\u00E7", unmodifiedChars:"\u00E7"}, - nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, - modifiers:{metaKey:1, shiftKey:1}, chars:"9", unmodifiedChars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, - modifiers:{}, chars:"\u00E0", unmodifiedChars:"\u00E0"}, - nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, - modifiers:{shiftKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, + // modifiers:{ctrlKey:1}, chars:"\u001C", unmodifiedChars:"\u00E7"}, + // nsIDOMKeyEvent.DOM_VK_9, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl+9 sets strange char + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, + modifiers:{metaKey:1}, chars:"\u00E7", unmodifiedChars:"\u00E7"}, + nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9, + modifiers:{metaKey:1, shiftKey:1}, chars:"9", unmodifiedChars:"9"}, + nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, + modifiers:{}, chars:"\u00E0", unmodifiedChars:"\u00E0"}, + nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, + modifiers:{shiftKey:1}, chars:"0", unmodifiedChars:"0"}, + nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // XXX No events fired, not sure the reason. - // testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, - // modifiers:{ctrlKey:1}, chars:"", unmodifiedChars:"\u00E0"}, - // nsIDOMKeyEvent.DOM_VK_0, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, - modifiers:{metaKey:1}, chars:"\u00E0", unmodifiedChars:"\u00E0"}, - nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, - modifiers:{metaKey:1, shiftKey:1}, chars:"0", unmodifiedChars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, + // modifiers:{ctrlKey:1}, chars:"", unmodifiedChars:"\u00E0"}, + // nsIDOMKeyEvent.DOM_VK_0, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, + modifiers:{metaKey:1}, chars:"\u00E0", unmodifiedChars:"\u00E0"}, + nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0, + modifiers:{metaKey:1, shiftKey:1}, chars:"0", unmodifiedChars:"0"}, + nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Thai // keycode should be DOM_VK_[A-Z] of the key on the latest ASCII capable keyboard layout is for alphabet - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_A, - modifiers:{}, chars:"\u0E1F", unmodifiedChars:"\u0E1F"}, - nsIDOMKeyEvent.DOM_VK_A, "\u0E1F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_A, + modifiers:{}, chars:"\u0E1F", unmodifiedChars:"\u0E1F"}, + nsIDOMKeyEvent.DOM_VK_A, "\u0E1F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // keycode should be shifted character if unshifted character isn't an ASCII character - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_Quote, - modifiers:{}, chars:"\u0E07", unmodifiedChars:"\u0E07"}, - nsIDOMKeyEvent.DOM_VK_PERIOD, "\u0E07", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_Quote, + modifiers:{}, chars:"\u0E07", unmodifiedChars:"\u0E07"}, + nsIDOMKeyEvent.DOM_VK_PERIOD, "\u0E07", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // keycode should be zero if the character of the key on the latest ASCII capable keyboard layout isn't for alphabet - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_Period, - modifiers:{}, chars:"\u0E43", unmodifiedChars:"\u0E43"}, - 0, "\u0E43", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_Period, + modifiers:{}, chars:"\u0E43", unmodifiedChars:"\u0E43"}, + 0, "\u0E43", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // keycode should be DOM_VK_[0-9] if the key on the latest ASCII capable keyboard layout is for numeric - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_1, - modifiers:{}, chars:"\u0E45", unmodifiedChars:"\u0E45"}, - nsIDOMKeyEvent.DOM_VK_1, "\u0E45", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_2, - modifiers:{}, chars:"/", unmodifiedChars:"/"}, - nsIDOMKeyEvent.DOM_VK_2, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_3, - modifiers:{}, chars:"_", unmodifiedChars:"_"}, - nsIDOMKeyEvent.DOM_VK_3, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_4, - modifiers:{}, chars:"\u0E20", unmodifiedChars:"\u0E20"}, - nsIDOMKeyEvent.DOM_VK_4, "\u0E20", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_5, - modifiers:{}, chars:"\u0E16", unmodifiedChars:"\u0E16"}, - nsIDOMKeyEvent.DOM_VK_5, "\u0E16", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_6, - modifiers:{}, chars:"\u0E38", unmodifiedChars:"\u0E38"}, - nsIDOMKeyEvent.DOM_VK_6, "\u0E38", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_7, - modifiers:{}, chars:"\u0E36", unmodifiedChars:"\u0E36"}, - nsIDOMKeyEvent.DOM_VK_7, "\u0E36", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_8, - modifiers:{}, chars:"\u0E04", unmodifiedChars:"\u0E04"}, - nsIDOMKeyEvent.DOM_VK_8, "\u0E04", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_9, - modifiers:{}, chars:"\u0E15", unmodifiedChars:"\u0E15"}, - nsIDOMKeyEvent.DOM_VK_9, "\u0E15", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_0, - modifiers:{}, chars:"\u0E08", unmodifiedChars:"\u0E08"}, - nsIDOMKeyEvent.DOM_VK_0, "\u0E08", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_1, + modifiers:{}, chars:"\u0E45", unmodifiedChars:"\u0E45"}, + nsIDOMKeyEvent.DOM_VK_1, "\u0E45", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_2, + modifiers:{}, chars:"/", unmodifiedChars:"/"}, + nsIDOMKeyEvent.DOM_VK_2, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_3, + modifiers:{}, chars:"_", unmodifiedChars:"_"}, + nsIDOMKeyEvent.DOM_VK_3, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_4, + modifiers:{}, chars:"\u0E20", unmodifiedChars:"\u0E20"}, + nsIDOMKeyEvent.DOM_VK_4, "\u0E20", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_5, + modifiers:{}, chars:"\u0E16", unmodifiedChars:"\u0E16"}, + nsIDOMKeyEvent.DOM_VK_5, "\u0E16", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_6, + modifiers:{}, chars:"\u0E38", unmodifiedChars:"\u0E38"}, + nsIDOMKeyEvent.DOM_VK_6, "\u0E38", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_7, + modifiers:{}, chars:"\u0E36", unmodifiedChars:"\u0E36"}, + nsIDOMKeyEvent.DOM_VK_7, "\u0E36", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_8, + modifiers:{}, chars:"\u0E04", unmodifiedChars:"\u0E04"}, + nsIDOMKeyEvent.DOM_VK_8, "\u0E04", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_9, + modifiers:{}, chars:"\u0E15", unmodifiedChars:"\u0E15"}, + nsIDOMKeyEvent.DOM_VK_9, "\u0E15", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_0, + modifiers:{}, chars:"\u0E08", unmodifiedChars:"\u0E08"}, + nsIDOMKeyEvent.DOM_VK_0, "\u0E08", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dvorak-Qwerty, layout should be changed when Command key is pressed. - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, - modifiers:{}, chars:"o", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, - modifiers:{shiftKey:1}, chars:"O", unmodifiedChars:"O"}, - nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, - modifiers:{ctrlKey:1}, chars:"\u000F", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, - modifiers:{altKey:1}, chars:"\u00F8", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "\u00F8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, - modifiers:{metaKey:1}, chars:"s", unmodifiedChars:"o"}, - nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, - modifiers:{}, chars:"e", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, - modifiers:{shiftKey:1}, chars:"E", unmodifiedChars:"E"}, - nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, - modifiers:{ctrlKey:1}, chars:"\u0005", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, - modifiers:{altKey:1}, chars:"", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, - modifiers:{metaKey:1}, chars:"d", unmodifiedChars:"e"}, - nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_I, - modifiers:{metaKey:1, altKey:1}, chars:"^", unmodifiedChars:"c"}, - nsIDOMKeyEvent.DOM_VK_I, "^", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_I, - modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u02C6", unmodifiedChars:"C"}, - nsIDOMKeyEvent.DOM_VK_I, "\u02C6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, + modifiers:{}, chars:"o", unmodifiedChars:"o"}, + nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, + modifiers:{shiftKey:1}, chars:"O", unmodifiedChars:"O"}, + nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, + modifiers:{ctrlKey:1}, chars:"\u000F", unmodifiedChars:"o"}, + nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, + modifiers:{altKey:1}, chars:"\u00F8", unmodifiedChars:"o"}, + nsIDOMKeyEvent.DOM_VK_O, "\u00F8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S, + modifiers:{metaKey:1}, chars:"s", unmodifiedChars:"o"}, + nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, + modifiers:{}, chars:"e", unmodifiedChars:"e"}, + nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, + modifiers:{shiftKey:1}, chars:"E", unmodifiedChars:"E"}, + nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, + modifiers:{ctrlKey:1}, chars:"\u0005", unmodifiedChars:"e"}, + nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, + modifiers:{altKey:1}, chars:"", unmodifiedChars:"e"}, + nsIDOMKeyEvent.DOM_VK_E, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D, + modifiers:{metaKey:1}, chars:"d", unmodifiedChars:"e"}, + nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_I, + modifiers:{metaKey:1, altKey:1}, chars:"^", unmodifiedChars:"c"}, + nsIDOMKeyEvent.DOM_VK_I, "^", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_I, + modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u02C6", unmodifiedChars:"C"}, + nsIDOMKeyEvent.DOM_VK_I, "\u02C6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); } else if (IS_WIN) { // On Windows, you can use Spy++ or Winspector (free) to watch window messages. // The keyCode is given by the wParam of the last WM_KEYDOWN message. The @@ -1814,1077 +1815,1077 @@ function runKeyEventTests() // is not needed on Windows. // Plain text input - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{}, chars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B, - modifiers:{}, chars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{shiftKey:1}, chars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{}, chars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B, + modifiers:{}, chars:"b"}, + nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{shiftKey:1}, chars:"A"}, + nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl keys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{ctrlKey:1}, chars:"\u0001"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{ctrlKey:1}, chars:"\u0001"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001"}, + nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Alt keys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{altKey:1}, chars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{altKey:1, shiftKey:1}, chars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{altKey:1}, chars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{altKey:1, shiftKey:1}, chars:"A"}, + nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Shift-ctrl-alt generates no WM_CHAR, but we still get a keypress - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Greek plain text - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, - modifiers:{}, chars:"\u03b1"}, - nsIDOMKeyEvent.DOM_VK_A, "\u03b1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, - modifiers:{shiftKey:1}, chars:"\u0391"}, - nsIDOMKeyEvent.DOM_VK_A, "\u0391", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, + modifiers:{}, chars:"\u03b1"}, + nsIDOMKeyEvent.DOM_VK_A, "\u03b1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, + modifiers:{shiftKey:1}, chars:"\u0391"}, + nsIDOMKeyEvent.DOM_VK_A, "\u0391", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Greek ctrl keys produce Latin charcodes - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, - modifiers:{ctrlKey:1}, chars:"\u0001"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, + modifiers:{ctrlKey:1}, chars:"\u0001"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001"}, + nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Caps Lock key event - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CAPITAL, - modifiers:{capsLockKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CAPITAL, - modifiers:{capsLockKey:0}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CAPITAL, + modifiers:{capsLockKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CAPITAL, + modifiers:{capsLockKey:0}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Shift keys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LSHIFT, - modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RSHIFT, - modifiers:{shiftRightKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LSHIFT, + modifiers:{shiftKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RSHIFT, + modifiers:{shiftRightKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Ctrl keys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LCONTROL, - modifiers:{ctrlKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RCONTROL, - modifiers:{ctrlRightKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LCONTROL, + modifiers:{ctrlKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RCONTROL, + modifiers:{ctrlRightKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Alt keys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LMENU, - modifiers:{altKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RMENU, - modifiers:{altRightKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LMENU, + modifiers:{altKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RMENU, + modifiers:{altRightKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // Win keys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LWIN, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RWIN, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LWIN, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RWIN, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT); // all keys on keyboard (keyCode test) - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_BACK, - modifiers:{}, chars:"\u0008"}, - nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_TAB, - modifiers:{}, chars:"\t"}, - nsIDOMKeyEvent.DOM_VK_TAB, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RETURN, - modifiers:{}, chars:"\r"}, - nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PAUSE, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_KANA, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_KANA, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_JUNJA, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_JUNJA, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_FINAL, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_FINAL, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_KANJI, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_KANJI, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ESCAPE, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_ESCAPE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CONVERT, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CONVERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NONCONVERT, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_NONCONVERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ACCEPT, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_ACCEPT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MODECHANGE, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_MODECHANGE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SPACE, - modifiers:{}, chars:" "}, - nsIDOMKeyEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SELECT, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_SELECT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PRINT, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_PRINT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_EXECUTE, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_EXECUTE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SNAPSHOT, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_PRINTSCREEN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_HELP, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_HELP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SLEEP, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_SLEEP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_BACK, + modifiers:{}, chars:"\u0008"}, + nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_TAB, + modifiers:{}, chars:"\t"}, + nsIDOMKeyEvent.DOM_VK_TAB, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RETURN, + modifiers:{}, chars:"\r"}, + nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PAUSE, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_KANA, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_KANA, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_JUNJA, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_JUNJA, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_FINAL, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_FINAL, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_KANJI, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_KANJI, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ESCAPE, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_ESCAPE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CONVERT, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CONVERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NONCONVERT, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_NONCONVERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ACCEPT, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_ACCEPT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MODECHANGE, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_MODECHANGE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SPACE, + modifiers:{}, chars:" "}, + nsIDOMKeyEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SELECT, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_SELECT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PRINT, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_PRINT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_EXECUTE, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_EXECUTE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SNAPSHOT, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_PRINTSCREEN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_HELP, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_HELP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SLEEP, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_SLEEP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // XXX TODO: we cannot test Home, Up, PageUp, Left, Right, End, Down, PageDown, Ins and Del. // US // Alphabet - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{}, chars:"a"}, - nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{shiftKey:1}, chars:"A"}, - nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B, - modifiers:{}, chars:"b"}, - nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B, - modifiers:{shiftKey:1}, chars:"B"}, - nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C, - modifiers:{}, chars:"c"}, - nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C, - modifiers:{shiftKey:1}, chars:"C"}, - nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D, - modifiers:{}, chars:"d"}, - nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D, - modifiers:{shiftKey:1}, chars:"D"}, - nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E, - modifiers:{}, chars:"e"}, - nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E, - modifiers:{shiftKey:1}, chars:"E"}, - nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F, - modifiers:{}, chars:"f"}, - nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F, - modifiers:{shiftKey:1}, chars:"F"}, - nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G, - modifiers:{}, chars:"g"}, - nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G, - modifiers:{shiftKey:1}, chars:"G"}, - nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H, - modifiers:{}, chars:"h"}, - nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H, - modifiers:{shiftKey:1}, chars:"H"}, - nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I, - modifiers:{}, chars:"i"}, - nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I, - modifiers:{shiftKey:1}, chars:"I"}, - nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J, - modifiers:{}, chars:"j"}, - nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J, - modifiers:{shiftKey:1}, chars:"J"}, - nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K, - modifiers:{}, chars:"k"}, - nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K, - modifiers:{shiftKey:1}, chars:"K"}, - nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L, - modifiers:{}, chars:"l"}, - nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L, - modifiers:{shiftKey:1}, chars:"L"}, - nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M, - modifiers:{}, chars:"m"}, - nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M, - modifiers:{shiftKey:1}, chars:"M"}, - nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N, - modifiers:{}, chars:"n"}, - nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N, - modifiers:{shiftKey:1}, chars:"N"}, - nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O, - modifiers:{}, chars:"o"}, - nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O, - modifiers:{shiftKey:1}, chars:"O"}, - nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P, - modifiers:{}, chars:"p"}, - nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P, - modifiers:{shiftKey:1}, chars:"P"}, - nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q, - modifiers:{}, chars:"q"}, - nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q, - modifiers:{shiftKey:1}, chars:"Q"}, - nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R, - modifiers:{}, chars:"r"}, - nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R, - modifiers:{shiftKey:1}, chars:"R"}, - nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S, - modifiers:{}, chars:"s"}, - nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S, - modifiers:{shiftKey:1}, chars:"S"}, - nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T, - modifiers:{}, chars:"t"}, - nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T, - modifiers:{shiftKey:1}, chars:"T"}, - nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U, - modifiers:{}, chars:"u"}, - nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U, - modifiers:{shiftKey:1}, chars:"U"}, - nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V, - modifiers:{}, chars:"v"}, - nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V, - modifiers:{shiftKey:1}, chars:"V"}, - nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W, - modifiers:{}, chars:"w"}, - nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W, - modifiers:{shiftKey:1}, chars:"W"}, - nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, - modifiers:{}, chars:"x"}, - nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, - modifiers:{shiftKey:1}, chars:"X"}, - nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y, - modifiers:{}, chars:"y"}, - nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y, - modifiers:{shiftKey:1}, chars:"Y"}, - nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z, - modifiers:{}, chars:"z"}, - nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z, - modifiers:{shiftKey:1}, chars:"Z"}, - nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{}, chars:"a"}, + nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{shiftKey:1}, chars:"A"}, + nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B, + modifiers:{}, chars:"b"}, + nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B, + modifiers:{shiftKey:1}, chars:"B"}, + nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C, + modifiers:{}, chars:"c"}, + nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C, + modifiers:{shiftKey:1}, chars:"C"}, + nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D, + modifiers:{}, chars:"d"}, + nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D, + modifiers:{shiftKey:1}, chars:"D"}, + nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E, + modifiers:{}, chars:"e"}, + nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E, + modifiers:{shiftKey:1}, chars:"E"}, + nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F, + modifiers:{}, chars:"f"}, + nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F, + modifiers:{shiftKey:1}, chars:"F"}, + nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G, + modifiers:{}, chars:"g"}, + nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G, + modifiers:{shiftKey:1}, chars:"G"}, + nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H, + modifiers:{}, chars:"h"}, + nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H, + modifiers:{shiftKey:1}, chars:"H"}, + nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I, + modifiers:{}, chars:"i"}, + nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I, + modifiers:{shiftKey:1}, chars:"I"}, + nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J, + modifiers:{}, chars:"j"}, + nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J, + modifiers:{shiftKey:1}, chars:"J"}, + nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K, + modifiers:{}, chars:"k"}, + nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K, + modifiers:{shiftKey:1}, chars:"K"}, + nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L, + modifiers:{}, chars:"l"}, + nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L, + modifiers:{shiftKey:1}, chars:"L"}, + nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M, + modifiers:{}, chars:"m"}, + nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M, + modifiers:{shiftKey:1}, chars:"M"}, + nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N, + modifiers:{}, chars:"n"}, + nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N, + modifiers:{shiftKey:1}, chars:"N"}, + nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O, + modifiers:{}, chars:"o"}, + nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O, + modifiers:{shiftKey:1}, chars:"O"}, + nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P, + modifiers:{}, chars:"p"}, + nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P, + modifiers:{shiftKey:1}, chars:"P"}, + nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q, + modifiers:{}, chars:"q"}, + nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q, + modifiers:{shiftKey:1}, chars:"Q"}, + nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R, + modifiers:{}, chars:"r"}, + nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R, + modifiers:{shiftKey:1}, chars:"R"}, + nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S, + modifiers:{}, chars:"s"}, + nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S, + modifiers:{shiftKey:1}, chars:"S"}, + nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T, + modifiers:{}, chars:"t"}, + nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T, + modifiers:{shiftKey:1}, chars:"T"}, + nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U, + modifiers:{}, chars:"u"}, + nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U, + modifiers:{shiftKey:1}, chars:"U"}, + nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V, + modifiers:{}, chars:"v"}, + nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V, + modifiers:{shiftKey:1}, chars:"V"}, + nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W, + modifiers:{}, chars:"w"}, + nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W, + modifiers:{shiftKey:1}, chars:"W"}, + nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, + modifiers:{}, chars:"x"}, + nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, + modifiers:{shiftKey:1}, chars:"X"}, + nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y, + modifiers:{}, chars:"y"}, + nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y, + modifiers:{shiftKey:1}, chars:"Y"}, + nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z, + modifiers:{}, chars:"z"}, + nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z, + modifiers:{shiftKey:1}, chars:"Z"}, + nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Numeric - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0, - modifiers:{}, chars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0, - modifiers:{shiftKey:1}, chars:")"}, - nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1, - modifiers:{}, chars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1, - modifiers:{shiftKey:1}, chars:"!"}, - nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2, - modifiers:{}, chars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2, - modifiers:{shiftKey:1}, chars:"@"}, - nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3, - modifiers:{}, chars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3, - modifiers:{shiftKey:1}, chars:"#"}, - nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4, - modifiers:{}, chars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4, - modifiers:{shiftKey:1}, chars:"$"}, - nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5, - modifiers:{}, chars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5, - modifiers:{shiftKey:1}, chars:"%"}, - nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6, - modifiers:{}, chars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6, - modifiers:{shiftKey:1}, chars:"^"}, - nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7, - modifiers:{}, chars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7, - modifiers:{shiftKey:1}, chars:"&"}, - nsIDOMKeyEvent.DOM_VK_7, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8, - modifiers:{}, chars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8, - modifiers:{shiftKey:1}, chars:"*"}, - nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9, - modifiers:{}, chars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9, - modifiers:{shiftKey:1}, chars:"("}, - nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0, + modifiers:{}, chars:"0"}, + nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0, + modifiers:{shiftKey:1}, chars:")"}, + nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1, + modifiers:{}, chars:"1"}, + nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1, + modifiers:{shiftKey:1}, chars:"!"}, + nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2, + modifiers:{}, chars:"2"}, + nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2, + modifiers:{shiftKey:1}, chars:"@"}, + nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3, + modifiers:{}, chars:"3"}, + nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3, + modifiers:{shiftKey:1}, chars:"#"}, + nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4, + modifiers:{}, chars:"4"}, + nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4, + modifiers:{shiftKey:1}, chars:"$"}, + nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5, + modifiers:{}, chars:"5"}, + nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5, + modifiers:{shiftKey:1}, chars:"%"}, + nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6, + modifiers:{}, chars:"6"}, + nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6, + modifiers:{shiftKey:1}, chars:"^"}, + nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7, + modifiers:{}, chars:"7"}, + nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7, + modifiers:{shiftKey:1}, chars:"&"}, + nsIDOMKeyEvent.DOM_VK_7, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8, + modifiers:{}, chars:"8"}, + nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8, + modifiers:{shiftKey:1}, chars:"*"}, + nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9, + modifiers:{}, chars:"9"}, + nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9, + modifiers:{shiftKey:1}, chars:"("}, + nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // OEM keys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS, - modifiers:{}, chars:"-"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS, - modifiers:{shiftKey:1}, chars:"_"}, - nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS, - modifiers:{}, chars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS, - modifiers:{shiftKey:1}, chars:"+"}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4, - modifiers:{}, chars:"["}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4, - modifiers:{shiftKey:1}, chars:"{"}, - nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6, - modifiers:{}, chars:"]"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6, - modifiers:{shiftKey:1}, chars:"}"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, - modifiers:{}, chars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, - modifiers:{shiftKey:1}, chars:":"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7, - modifiers:{}, chars:"'"}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7, - modifiers:{shiftKey:1}, chars:"\""}, - nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5, - modifiers:{}, chars:"\\"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5, - modifiers:{shiftKey:1}, chars:"|"}, - nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA, - modifiers:{}, chars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA, - modifiers:{shiftKey:1}, chars:"<"}, - nsIDOMKeyEvent.DOM_VK_COMMA, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD, - modifiers:{}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD, - modifiers:{shiftKey:1}, chars:">"}, - nsIDOMKeyEvent.DOM_VK_PERIOD, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2, - modifiers:{}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2, - modifiers:{shiftKey:1}, chars:"?"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3, - modifiers:{}, chars:"`"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3, - modifiers:{shiftKey:1}, chars:"~"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS, + modifiers:{}, chars:"-"}, + nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS, + modifiers:{shiftKey:1}, chars:"_"}, + nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS, + modifiers:{}, chars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS, + modifiers:{shiftKey:1}, chars:"+"}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4, + modifiers:{}, chars:"["}, + nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4, + modifiers:{shiftKey:1}, chars:"{"}, + nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6, + modifiers:{}, chars:"]"}, + nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6, + modifiers:{shiftKey:1}, chars:"}"}, + nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, + modifiers:{}, chars:";"}, + nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, + modifiers:{shiftKey:1}, chars:":"}, + nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7, + modifiers:{}, chars:"'"}, + nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7, + modifiers:{shiftKey:1}, chars:"\""}, + nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5, + modifiers:{}, chars:"\\"}, + nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5, + modifiers:{shiftKey:1}, chars:"|"}, + nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA, + modifiers:{}, chars:","}, + nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA, + modifiers:{shiftKey:1}, chars:"<"}, + nsIDOMKeyEvent.DOM_VK_COMMA, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD, + modifiers:{}, chars:"."}, + nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD, + modifiers:{shiftKey:1}, chars:">"}, + nsIDOMKeyEvent.DOM_VK_PERIOD, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2, + modifiers:{}, chars:"/"}, + nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2, + modifiers:{shiftKey:1}, chars:"?"}, + nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3, + modifiers:{}, chars:"`"}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3, + modifiers:{shiftKey:1}, chars:"~"}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Numpad - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD0, - modifiers:{numLockKey:1}, chars:"0"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD1, - modifiers:{numLockKey:1}, chars:"1"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD2, - modifiers:{numLockKey:1}, chars:"2"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD3, - modifiers:{numLockKey:1}, chars:"3"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD4, - modifiers:{numLockKey:1}, chars:"4"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD5, - modifiers:{numLockKey:1}, chars:"5"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD6, - modifiers:{numLockKey:1}, chars:"6"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD7, - modifiers:{numLockKey:1}, chars:"7"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD8, - modifiers:{numLockKey:1}, chars:"8"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD9, - modifiers:{numLockKey:1}, chars:"9"}, - nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD0, + modifiers:{numLockKey:1}, chars:"0"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD1, + modifiers:{numLockKey:1}, chars:"1"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD2, + modifiers:{numLockKey:1}, chars:"2"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD3, + modifiers:{numLockKey:1}, chars:"3"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD4, + modifiers:{numLockKey:1}, chars:"4"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD5, + modifiers:{numLockKey:1}, chars:"5"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD6, + modifiers:{numLockKey:1}, chars:"6"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD7, + modifiers:{numLockKey:1}, chars:"7"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD8, + modifiers:{numLockKey:1}, chars:"8"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD9, + modifiers:{numLockKey:1}, chars:"9"}, + nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MULTIPLY, - modifiers:{numLockKey:1}, chars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MULTIPLY, - modifiers:{numLockKey:1, shiftKey:1}, chars:"*"}, - nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ADD, - modifiers:{numLockKey:1}, chars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ADD, - modifiers:{numLockKey:1, shiftKey:1}, chars:"+"}, - nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MULTIPLY, + modifiers:{numLockKey:1}, chars:"*"}, + nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MULTIPLY, + modifiers:{numLockKey:1, shiftKey:1}, chars:"*"}, + nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ADD, + modifiers:{numLockKey:1}, chars:"+"}, + nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ADD, + modifiers:{numLockKey:1, shiftKey:1}, chars:"+"}, + nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // VK_SEPARATOR is keycode for NEC's PC-98 series whose keyboard layout was // different from current PC's keyboard layout and it cannot connect to // current PC. Note that even if we synthesize WM_KEYDOWN with // VK_SEPARATOR, it doesn't work on Win7. - //testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SEPARATOR, - // modifiers:{numLockKey:1}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - //testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SEPARATOR, - // modifiers:{numLockKey:1, shiftKey:1}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SUBTRACT, - modifiers:{numLockKey:1}, chars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SUBTRACT, - modifiers:{numLockKey:1, shiftKey:1}, chars:"-"}, - nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DECIMAL, - modifiers:{numLockKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DECIMAL, - modifiers:{numLockKey:1, shiftKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DIVIDE, - modifiers:{numLockKey:1}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DIVIDE, - modifiers:{numLockKey:1, shiftKey:1}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + //yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SEPARATOR, + // modifiers:{numLockKey:1}, chars:""}, + // nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + //yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SEPARATOR, + // modifiers:{numLockKey:1, shiftKey:1}, chars:""}, + // nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SUBTRACT, + modifiers:{numLockKey:1}, chars:"-"}, + nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SUBTRACT, + modifiers:{numLockKey:1, shiftKey:1}, chars:"-"}, + nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DECIMAL, + modifiers:{numLockKey:1}, chars:"."}, + nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DECIMAL, + modifiers:{numLockKey:1, shiftKey:1}, chars:"."}, + nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DIVIDE, + modifiers:{numLockKey:1}, chars:"/"}, + nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DIVIDE, + modifiers:{numLockKey:1, shiftKey:1}, chars:"/"}, + nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // Numpad without NumLock - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PRIOR, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NEXT, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_END, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_HOME, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LEFT, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_UP, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RIGHT, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DOWN, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_INSERT, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_INSERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DELETE, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CLEAR, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CLEAR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PRIOR, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NEXT, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_END, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_HOME, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LEFT, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_UP, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RIGHT, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DOWN, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_INSERT, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_INSERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DELETE, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CLEAR, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CLEAR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // Even if widget receives unknown keycode, it should dispatch key events // whose keycode is 0 rather than native keycode. - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:0x3A, - modifiers:{numLockKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:0x3A, + modifiers:{numLockKey:1}, chars:""}, + 0, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // French // Numeric - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, - modifiers:{}, chars:"\u00E0"}, - nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, - modifiers:{shiftKey:1}, chars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, - modifiers:{}, chars:"&"}, - nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, - modifiers:{shiftKey:1}, chars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, - modifiers:{}, chars:"\u00E9"}, - nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, - modifiers:{shiftKey:1}, chars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, - modifiers:{}, chars:"\""}, - nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, - modifiers:{shiftKey:1}, chars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, - modifiers:{}, chars:"'"}, - nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, - modifiers:{shiftKey:1}, chars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, - modifiers:{}, chars:"("}, - nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, - modifiers:{shiftKey:1}, chars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, - modifiers:{}, chars:"-"}, - nsIDOMKeyEvent.DOM_VK_6, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, - modifiers:{shiftKey:1}, chars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, - modifiers:{}, chars:"\u00E8"}, - nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, - modifiers:{shiftKey:1}, chars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, - modifiers:{}, chars:"_"}, - nsIDOMKeyEvent.DOM_VK_8, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, - modifiers:{shiftKey:1}, chars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, - modifiers:{}, chars:"\u00E7"}, - nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, - modifiers:{shiftKey:1}, chars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, + modifiers:{}, chars:"\u00E0"}, + nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, + modifiers:{shiftKey:1}, chars:"0"}, + nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, + modifiers:{}, chars:"&"}, + nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, + modifiers:{shiftKey:1}, chars:"1"}, + nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, + modifiers:{}, chars:"\u00E9"}, + nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, + modifiers:{shiftKey:1}, chars:"2"}, + nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, + modifiers:{}, chars:"\""}, + nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, + modifiers:{shiftKey:1}, chars:"3"}, + nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, + modifiers:{}, chars:"'"}, + nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, + modifiers:{shiftKey:1}, chars:"4"}, + nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, + modifiers:{}, chars:"("}, + nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, + modifiers:{shiftKey:1}, chars:"5"}, + nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, + modifiers:{}, chars:"-"}, + nsIDOMKeyEvent.DOM_VK_6, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, + modifiers:{shiftKey:1}, chars:"6"}, + nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, + modifiers:{}, chars:"\u00E8"}, + nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, + modifiers:{shiftKey:1}, chars:"7"}, + nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, + modifiers:{}, chars:"_"}, + nsIDOMKeyEvent.DOM_VK_8, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, + modifiers:{shiftKey:1}, chars:"8"}, + nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, + modifiers:{}, chars:"\u00E7"}, + nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, + modifiers:{shiftKey:1}, chars:"9"}, + nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Numeric with ShiftLock - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, - modifiers:{capsLockKey:1}, chars:"0"}, - nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E0"}, - nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, - modifiers:{capsLockKey:1}, chars:"1"}, - nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"&"}, - nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, - modifiers:{capsLockKey:1}, chars:"2"}, - nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E9"}, - nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, - modifiers:{capsLockKey:1}, chars:"3"}, - nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"\""}, - nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, - modifiers:{capsLockKey:1}, chars:"4"}, - nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"'"}, - nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, - modifiers:{capsLockKey:1}, chars:"5"}, - nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"("}, - nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, - modifiers:{capsLockKey:1}, chars:"6"}, - nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"-"}, - nsIDOMKeyEvent.DOM_VK_6, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, - modifiers:{capsLockKey:1}, chars:"7"}, - nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E8"}, - nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, - modifiers:{capsLockKey:1}, chars:"8"}, - nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"_"}, - nsIDOMKeyEvent.DOM_VK_8, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, - modifiers:{capsLockKey:1}, chars:"9"}, - nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E7"}, - nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, + modifiers:{capsLockKey:1}, chars:"0"}, + nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E0"}, + nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, + modifiers:{capsLockKey:1}, chars:"1"}, + nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"&"}, + nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, + modifiers:{capsLockKey:1}, chars:"2"}, + nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E9"}, + nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, + modifiers:{capsLockKey:1}, chars:"3"}, + nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"\""}, + nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, + modifiers:{capsLockKey:1}, chars:"4"}, + nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"'"}, + nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, + modifiers:{capsLockKey:1}, chars:"5"}, + nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"("}, + nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, + modifiers:{capsLockKey:1}, chars:"6"}, + nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"-"}, + nsIDOMKeyEvent.DOM_VK_6, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, + modifiers:{capsLockKey:1}, chars:"7"}, + nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E8"}, + nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, + modifiers:{capsLockKey:1}, chars:"8"}, + nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"_"}, + nsIDOMKeyEvent.DOM_VK_8, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, + modifiers:{capsLockKey:1}, chars:"9"}, + nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E7"}, + nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // OEM keys - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, - modifiers:{}, chars:"\u00B2"}, - 0, "\u00B2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, - modifiers:{shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, - modifiers:{}, chars:")"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, - modifiers:{shiftKey:1}, chars:"\u00B0"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "\u00B0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, - modifiers:{}, chars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, - modifiers:{shiftKey:1}, chars:"+"}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - //testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - // modifiers:{}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key - //testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - // modifiers:{shiftKey:1}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, - modifiers:{}, chars:"$"}, - nsIDOMKeyEvent.DOM_VK_DOLLAR, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, - modifiers:{shiftKey:1}, chars:"\u00A3"}, - nsIDOMKeyEvent.DOM_VK_DOLLAR, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, - modifiers:{}, chars:"\u00F9"}, - nsIDOMKeyEvent.DOM_VK_PERCENT, "\u00F9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, - modifiers:{shiftKey:1}, chars:"%"}, - nsIDOMKeyEvent.DOM_VK_PERCENT, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, - modifiers:{}, chars:"*"}, - nsIDOMKeyEvent.DOM_VK_ASTERISK, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, - modifiers:{shiftKey:1}, chars:"\u00B5"}, - nsIDOMKeyEvent.DOM_VK_ASTERISK, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, - modifiers:{}, chars:"<"}, - nsIDOMKeyEvent.DOM_VK_LESS_THAN, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, - modifiers:{shiftKey:1}, chars:">"}, - nsIDOMKeyEvent.DOM_VK_LESS_THAN, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, - modifiers:{}, chars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, - modifiers:{shiftKey:1}, chars:"?"}, - nsIDOMKeyEvent.DOM_VK_COMMA, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, - modifiers:{}, chars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, - modifiers:{shiftKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, - modifiers:{}, chars:":"}, - nsIDOMKeyEvent.DOM_VK_COLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, - modifiers:{shiftKey:1}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_COLON, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, - modifiers:{}, chars:"!"}, - nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, - modifiers:{shiftKey:1}, chars:"\u00A7"}, - nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, + modifiers:{}, chars:"\u00B2"}, + 0, "\u00B2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, + modifiers:{shiftKey:1}, chars:""}, + 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, + modifiers:{}, chars:")"}, + nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, + modifiers:{shiftKey:1}, chars:"\u00B0"}, + nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "\u00B0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, + modifiers:{}, chars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, + modifiers:{shiftKey:1}, chars:"+"}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + // modifiers:{}, chars:""}, + // nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + // modifiers:{shiftKey:1}, chars:""}, + // nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, + modifiers:{}, chars:"$"}, + nsIDOMKeyEvent.DOM_VK_DOLLAR, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, + modifiers:{shiftKey:1}, chars:"\u00A3"}, + nsIDOMKeyEvent.DOM_VK_DOLLAR, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, + modifiers:{}, chars:"\u00F9"}, + nsIDOMKeyEvent.DOM_VK_PERCENT, "\u00F9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, + modifiers:{shiftKey:1}, chars:"%"}, + nsIDOMKeyEvent.DOM_VK_PERCENT, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, + modifiers:{}, chars:"*"}, + nsIDOMKeyEvent.DOM_VK_ASTERISK, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, + modifiers:{shiftKey:1}, chars:"\u00B5"}, + nsIDOMKeyEvent.DOM_VK_ASTERISK, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, + modifiers:{}, chars:"<"}, + nsIDOMKeyEvent.DOM_VK_LESS_THAN, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, + modifiers:{shiftKey:1}, chars:">"}, + nsIDOMKeyEvent.DOM_VK_LESS_THAN, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, + modifiers:{}, chars:","}, + nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, + modifiers:{shiftKey:1}, chars:"?"}, + nsIDOMKeyEvent.DOM_VK_COMMA, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, + modifiers:{}, chars:";"}, + nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, + modifiers:{shiftKey:1}, chars:"."}, + nsIDOMKeyEvent.DOM_VK_SEMICOLON, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, + modifiers:{}, chars:":"}, + nsIDOMKeyEvent.DOM_VK_COLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, + modifiers:{shiftKey:1}, chars:"/"}, + nsIDOMKeyEvent.DOM_VK_COLON, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, + modifiers:{}, chars:"!"}, + nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, + modifiers:{shiftKey:1}, chars:"\u00A7"}, + nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // OEM keys with ShiftLock - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, - modifiers:{capsLockKey:1}, chars:"\u00B2"}, - 0, "\u00B2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, - modifiers:{capsLockKey:1, shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, - modifiers:{capsLockKey:1}, chars:"\u00B0"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "\u00B0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, - modifiers:{capsLockKey:1, shiftKey:1}, chars:")"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, - modifiers:{capsLockKey:1}, chars:"+"}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"="}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - //testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - // modifiers:{capsLockKey:1}, chars:""}, - // 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key - //testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - // modifiers:{capsLockKey:1, shiftKey:1}, chars:""}, - // 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, - modifiers:{capsLockKey:1}, chars:"\u00A3"}, - nsIDOMKeyEvent.DOM_VK_DOLLAR, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"$"}, - nsIDOMKeyEvent.DOM_VK_DOLLAR, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, - modifiers:{capsLockKey:1}, chars:"%"}, - nsIDOMKeyEvent.DOM_VK_PERCENT, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00F9"}, - nsIDOMKeyEvent.DOM_VK_PERCENT, "\u00F9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, - modifiers:{capsLockKey:1}, chars:"\u00B5"}, - nsIDOMKeyEvent.DOM_VK_ASTERISK, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"*"}, - nsIDOMKeyEvent.DOM_VK_ASTERISK, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, - modifiers:{capsLockKey:1}, chars:"<"}, - nsIDOMKeyEvent.DOM_VK_LESS_THAN, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, - modifiers:{capsLockKey:1, shiftKey:1}, chars:">"}, - nsIDOMKeyEvent.DOM_VK_LESS_THAN, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, - modifiers:{capsLockKey:1}, chars:"?"}, - nsIDOMKeyEvent.DOM_VK_COMMA, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, - modifiers:{capsLockKey:1, shiftKey:1}, chars:","}, - nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, - modifiers:{capsLockKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, - modifiers:{capsLockKey:1, shiftKey:1}, chars:";"}, - nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, - modifiers:{capsLockKey:1}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_COLON, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, - modifiers:{capsLockKey:1, shiftKey:1}, chars:":"}, - nsIDOMKeyEvent.DOM_VK_COLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, - modifiers:{capsLockKey:1}, chars:"\u00A7"}, - nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, - modifiers:{capsLockKey:1, shiftKey:1}, chars:"!"}, - nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, + modifiers:{capsLockKey:1}, chars:"\u00B2"}, + 0, "\u00B2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7, + modifiers:{capsLockKey:1, shiftKey:1}, chars:""}, + 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, + modifiers:{capsLockKey:1}, chars:"\u00B0"}, + nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "\u00B0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, + modifiers:{capsLockKey:1, shiftKey:1}, chars:")"}, + nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, + modifiers:{capsLockKey:1}, chars:"+"}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"="}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + // modifiers:{capsLockKey:1}, chars:""}, + // 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + // modifiers:{capsLockKey:1, shiftKey:1}, chars:""}, + // 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, + modifiers:{capsLockKey:1}, chars:"\u00A3"}, + nsIDOMKeyEvent.DOM_VK_DOLLAR, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"$"}, + nsIDOMKeyEvent.DOM_VK_DOLLAR, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, + modifiers:{capsLockKey:1}, chars:"%"}, + nsIDOMKeyEvent.DOM_VK_PERCENT, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00F9"}, + nsIDOMKeyEvent.DOM_VK_PERCENT, "\u00F9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, + modifiers:{capsLockKey:1}, chars:"\u00B5"}, + nsIDOMKeyEvent.DOM_VK_ASTERISK, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"*"}, + nsIDOMKeyEvent.DOM_VK_ASTERISK, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, + modifiers:{capsLockKey:1}, chars:"<"}, + nsIDOMKeyEvent.DOM_VK_LESS_THAN, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102, + modifiers:{capsLockKey:1, shiftKey:1}, chars:">"}, + nsIDOMKeyEvent.DOM_VK_LESS_THAN, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, + modifiers:{capsLockKey:1}, chars:"?"}, + nsIDOMKeyEvent.DOM_VK_COMMA, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA, + modifiers:{capsLockKey:1, shiftKey:1}, chars:","}, + nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, + modifiers:{capsLockKey:1}, chars:"."}, + nsIDOMKeyEvent.DOM_VK_SEMICOLON, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD, + modifiers:{capsLockKey:1, shiftKey:1}, chars:";"}, + nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, + modifiers:{capsLockKey:1}, chars:"/"}, + nsIDOMKeyEvent.DOM_VK_COLON, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2, + modifiers:{capsLockKey:1, shiftKey:1}, chars:":"}, + nsIDOMKeyEvent.DOM_VK_COLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, + modifiers:{capsLockKey:1}, chars:"\u00A7"}, + nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8, + modifiers:{capsLockKey:1, shiftKey:1}, chars:"!"}, + nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // AltGr - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, - modifiers:{altGrKey:1}, chars:"@"}, - nsIDOMKeyEvent.DOM_VK_0, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, - modifiers:{altGrKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL_BUT_NOT_CAUSE_INPUT, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - //testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, - // modifiers:{altGrKey:1}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, - modifiers:{altGrKey:1}, chars:"#"}, - nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, - modifiers:{altGrKey:1}, chars:"{"}, - nsIDOMKeyEvent.DOM_VK_4, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, - modifiers:{altGrKey:1}, chars:"["}, - nsIDOMKeyEvent.DOM_VK_5, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, - modifiers:{altGrKey:1}, chars:"|"}, - nsIDOMKeyEvent.DOM_VK_6, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - //testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, - // modifiers:{altGrKey:1}, chars:""}, - // nsIDOMKeyEvent.DOM_VK_7, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, - modifiers:{altGrKey:1}, chars:"\\"}, - nsIDOMKeyEvent.DOM_VK_8, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, - modifiers:{altGrKey:1}, chars:"^"}, - nsIDOMKeyEvent.DOM_VK_9, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, - modifiers:{altGrKey:1}, chars:"]"}, - nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, - modifiers:{altGrKey:1}, chars:"}"}, - nsIDOMKeyEvent.DOM_VK_EQUALS, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0, + modifiers:{altGrKey:1}, chars:"@"}, + nsIDOMKeyEvent.DOM_VK_0, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1, + modifiers:{altGrKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL_BUT_NOT_CAUSE_INPUT, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2, + // modifiers:{altGrKey:1}, chars:""}, + // nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3, + modifiers:{altGrKey:1}, chars:"#"}, + nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4, + modifiers:{altGrKey:1}, chars:"{"}, + nsIDOMKeyEvent.DOM_VK_4, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5, + modifiers:{altGrKey:1}, chars:"["}, + nsIDOMKeyEvent.DOM_VK_5, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6, + modifiers:{altGrKey:1}, chars:"|"}, + nsIDOMKeyEvent.DOM_VK_6, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7, + // modifiers:{altGrKey:1}, chars:""}, + // nsIDOMKeyEvent.DOM_VK_7, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8, + modifiers:{altGrKey:1}, chars:"\\"}, + nsIDOMKeyEvent.DOM_VK_8, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9, + modifiers:{altGrKey:1}, chars:"^"}, + nsIDOMKeyEvent.DOM_VK_9, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4, + modifiers:{altGrKey:1}, chars:"]"}, + nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS, + modifiers:{altGrKey:1}, chars:"}"}, + nsIDOMKeyEvent.DOM_VK_EQUALS, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // German - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:WIN_VK_OEM_2, - modifiers:{}, chars:"#"}, - nsIDOMKeyEvent.DOM_VK_HASH, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:WIN_VK_OEM_2, - modifiers:{shiftKey:1}, chars:"'"}, - nsIDOMKeyEvent.DOM_VK_HASH, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:WIN_VK_OEM_2, + modifiers:{}, chars:"#"}, + nsIDOMKeyEvent.DOM_VK_HASH, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:WIN_VK_OEM_2, + modifiers:{shiftKey:1}, chars:"'"}, + nsIDOMKeyEvent.DOM_VK_HASH, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Norwegian - testKey({layout:KEYBOARD_LAYOUT_NORWEGIAN, keyCode:WIN_VK_OEM_5, - modifiers:{}, chars:"|"}, - nsIDOMKeyEvent.DOM_VK_PIPE, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_NORWEGIAN, keyCode:WIN_VK_OEM_5, - modifiers:{shiftKey:1}, chars:"\u00A7"}, - nsIDOMKeyEvent.DOM_VK_PIPE, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_NORWEGIAN, keyCode:WIN_VK_OEM_5, + modifiers:{}, chars:"|"}, + nsIDOMKeyEvent.DOM_VK_PIPE, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_NORWEGIAN, keyCode:WIN_VK_OEM_5, + modifiers:{shiftKey:1}, chars:"\u00A7"}, + nsIDOMKeyEvent.DOM_VK_PIPE, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Brazilian ABNT - testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1, - modifiers:{}, chars:"/"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1, - modifiers:{shiftKey:1}, chars:"?"}, - nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C2, - modifiers:{numLockKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_DECIMAL, - modifiers:{numLockKey:1}, chars:","}, - nsIDOMKeyEvent.DOM_VK_DECIMAL, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1, + modifiers:{}, chars:"/"}, + nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1, + modifiers:{shiftKey:1}, chars:"?"}, + nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C2, + modifiers:{numLockKey:1}, chars:"."}, + nsIDOMKeyEvent.DOM_VK_SEPARATOR, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_DECIMAL, + modifiers:{numLockKey:1}, chars:","}, + nsIDOMKeyEvent.DOM_VK_DECIMAL, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // Mac JIS keyboard // The separator key on JIS keyboard for Mac doesn't cause any character even with Japanese keyboard layout. - testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_ABNT_C2, - modifiers:{numLockKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); - testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_DECIMAL, - modifiers:{numLockKey:1}, chars:"."}, - nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_ABNT_C2, + modifiers:{numLockKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); + yield testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_DECIMAL, + modifiers:{numLockKey:1}, chars:"."}, + nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD); // Dead keys on any layouts - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - modifiers:{}, chars:"^^"}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "^^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + modifiers:{}, chars:"^^"}, + nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "^^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, - modifiers:{}, chars:"\u00E2"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, + modifiers:{}, chars:"\u00E2"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, - modifiers:{shiftKey:1}, chars:"\u00C2"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, + modifiers:{shiftKey:1}, chars:"\u00C2"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00C2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_Q, - modifiers:{}, chars:"^q"}, - nsIDOMKeyEvent.DOM_VK_Q, "^q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_Q, + modifiers:{}, chars:"^q"}, + nsIDOMKeyEvent.DOM_VK_Q, "^q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - modifiers:{shiftKey:1}, chars:"\u00A8\u00A8"}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "\u00A8\u00A8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + modifiers:{shiftKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + modifiers:{shiftKey:1}, chars:"\u00A8\u00A8"}, + nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "\u00A8\u00A8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, - modifiers:{shiftKey:1}, chars:"\u00C4"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + modifiers:{shiftKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, + modifiers:{shiftKey:1}, chars:"\u00C4"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00C4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, - modifiers:{}, chars:"\u00E4"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + modifiers:{shiftKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A, + modifiers:{}, chars:"\u00E4"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00E4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, - modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_Q, - modifiers:{shiftKey:1}, chars:"\u00A8Q"}, - nsIDOMKeyEvent.DOM_VK_Q, "\u00A8Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6, + modifiers:{shiftKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_Q, + modifiers:{shiftKey:1}, chars:"\u00A8Q"}, + nsIDOMKeyEvent.DOM_VK_Q, "\u00A8Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, - modifiers:{}, chars:"``"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "``", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, + modifiers:{}, chars:"``"}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "``", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, - modifiers:{}, chars:"\u00E0"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, + modifiers:{}, chars:"\u00E0"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, - modifiers:{shiftKey:1}, chars:"\u00C0"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, + modifiers:{shiftKey:1}, chars:"\u00C0"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00C0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, - modifiers:{}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, - modifiers:{}, chars:"`q"}, - nsIDOMKeyEvent.DOM_VK_Q, "`q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, + modifiers:{}, chars:""}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, + modifiers:{}, chars:"`q"}, + nsIDOMKeyEvent.DOM_VK_Q, "`q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, - modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, - modifiers:{shiftKey:1}, chars:"^^"}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "^^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, + modifiers:{shiftKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, + modifiers:{shiftKey:1}, chars:"^^"}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "^^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, - modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, - modifiers:{shiftKey:1}, chars:"\u00C2"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, + modifiers:{shiftKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, + modifiers:{shiftKey:1}, chars:"\u00C2"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00C2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, - modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, - modifiers:{}, chars:"\u00E2"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, + modifiers:{shiftKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, + modifiers:{}, chars:"\u00E2"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, - modifiers:{shiftKey:1}, chars:""}, - nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, - modifiers:{shiftKey:1}, chars:"^Q"}, - nsIDOMKeyEvent.DOM_VK_Q, "^Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1, + modifiers:{shiftKey:1}, chars:""}, + nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, + modifiers:{shiftKey:1}, chars:"^Q"}, + nsIDOMKeyEvent.DOM_VK_Q, "^Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, - modifiers:{}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, - modifiers:{}, chars:"\u00B4\u00B4"}, - 0, "\u00B4\u00B4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, + modifiers:{}, chars:""}, + 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, + modifiers:{}, chars:"\u00B4\u00B4"}, + 0, "\u00B4\u00B4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, - modifiers:{}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, - modifiers:{}, chars:"\u00E1"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, + modifiers:{}, chars:""}, + 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, + modifiers:{}, chars:"\u00E1"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00E1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, - modifiers:{}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, - modifiers:{shiftKey:1}, chars:"\u00C1"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, + modifiers:{}, chars:""}, + 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, + modifiers:{shiftKey:1}, chars:"\u00C1"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00C1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, - modifiers:{}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, - modifiers:{}, chars:"\u00B4q"}, - nsIDOMKeyEvent.DOM_VK_Q, "\u00B4q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, + modifiers:{}, chars:""}, + 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, + modifiers:{}, chars:"\u00B4q"}, + nsIDOMKeyEvent.DOM_VK_Q, "\u00B4q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, - modifiers:{shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, - modifiers:{shiftKey:1}, chars:"\u00A8\u00A8"}, - 0, "\u00A8\u00A8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, + modifiers:{shiftKey:1}, chars:""}, + 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, + modifiers:{shiftKey:1}, chars:"\u00A8\u00A8"}, + 0, "\u00A8\u00A8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, - modifiers:{shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, - modifiers:{shiftKey:1}, chars:"\u00C4"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00C4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, + modifiers:{shiftKey:1}, chars:""}, + 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, + modifiers:{shiftKey:1}, chars:"\u00C4"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00C4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, - modifiers:{shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, - modifiers:{}, chars:"\u00E4"}, - nsIDOMKeyEvent.DOM_VK_A, "\u00E4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, + modifiers:{shiftKey:1}, chars:""}, + 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A, + modifiers:{}, chars:"\u00E4"}, + nsIDOMKeyEvent.DOM_VK_A, "\u00E4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, - modifiers:{shiftKey:1}, chars:""}, - 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); - testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, - modifiers:{shiftKey:1}, chars:"\u00A8Q"}, - nsIDOMKeyEvent.DOM_VK_Q, "\u00A8Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7, + modifiers:{shiftKey:1}, chars:""}, + 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); + yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q, + modifiers:{shiftKey:1}, chars:"\u00A8Q"}, + nsIDOMKeyEvent.DOM_VK_Q, "\u00A8Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); } document.removeEventListener("keydown", onKeyEvent, false); @@ -2893,7 +2894,7 @@ function runKeyEventTests() } // Test the activation (or not) of an HTML accesskey -function runAccessKeyTests() +function* runAccessKeyTests() { var button = document.getElementById("button"); var activationCount; @@ -2910,11 +2911,14 @@ function runAccessKeyTests() activationCount = 0; button.setAttribute("accesskey", aAccessKey); - synthesizeKey(aEvent, "button"); + return synthesizeKey(aEvent, "button", function() { - var name = eventToString(aEvent); + var name = eventToString(aEvent); - is(activationCount, aShouldActivate ? 1 : 0, name + ", activating '" + aAccessKey + "'"); + is(activationCount, aShouldActivate ? 1 : 0, name + ", activating '" + aAccessKey + "'"); + + continueTest(); + }); } button.addEventListener("click", onClick, false); @@ -2922,246 +2926,249 @@ function runAccessKeyTests() // These tests have to be per-plaform. if (IS_MAC) { // Basic sanity checks - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{}, chars:"a", unmodifiedChars:"a"}, - "a", false); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, - "a", false); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, - "A", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{}, chars:"a", unmodifiedChars:"a"}, + "a", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, + "a", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"}, + "A", false); // Shift-ctrl does not activate accesskeys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"}, - "a", false); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"}, - "A", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"}, + "a", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"}, + "A", false); // Alt-ctrl activate accesskeys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"a"}, - "a", true); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"a"}, - "A", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"a"}, + "a", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"a"}, + "A", true); // Greek layout can activate a Latin accesskey - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, - "a", true); - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, - "A", true); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, + "a", true); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, + "A", true); // ... and a Greek accesskey! - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, - "\u03b1", true); - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, - "\u0391", true); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, + "\u03b1", true); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"}, + "\u0391", true); // bug 359638 - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, - modifiers:{ctrlKey:1, altKey:1}, chars:".", unmodifiedChars:"."}, - ".", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period, + modifiers:{ctrlKey:1, altKey:1}, chars:".", unmodifiedChars:"."}, + ".", true); // German (KCHR/KeyTranslate case) - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, altKey:1}, chars:"a", unmodifiedChars:"a"}, - "a", true); - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_A, - modifiers:{ctrlKey:1, altKey:1}, chars:"a", unmodifiedChars:"a"}, - "A", true); - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_LeftBracket, - modifiers:{ctrlKey:1, altKey:1}, chars:"\u00fc", unmodifiedChars:"\u00fc"}, - "\u00fc", true); - testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_LeftBracket, - modifiers:{ctrlKey:1, altKey:1}, chars:"\u00fc", unmodifiedChars:"\u00fc"}, - "\u00dc", true); + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, altKey:1}, chars:"a", unmodifiedChars:"a"}, + "a", true); + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_A, + modifiers:{ctrlKey:1, altKey:1}, chars:"a", unmodifiedChars:"a"}, + "A", true); + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_LeftBracket, + modifiers:{ctrlKey:1, altKey:1}, chars:"\u00fc", unmodifiedChars:"\u00fc"}, + "\u00fc", true); + yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_LeftBracket, + modifiers:{ctrlKey:1, altKey:1}, chars:"\u00fc", unmodifiedChars:"\u00fc"}, + "\u00dc", true); } else if (IS_WIN) { // Basic sanity checks - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{}, chars:"a"}, - "a", false); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{shiftKey:1, altKey:1}, chars:"A"}, - "a", true); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{shiftKey:1, altKey:1}, chars:"A"}, - "A", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{}, chars:"a"}, + "a", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{shiftKey:1, altKey:1}, chars:"A"}, + "a", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{shiftKey:1, altKey:1}, chars:"A"}, + "A", true); // shift-alt-ctrl does not activate accesskeys - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{ctrlKey:1, shiftKey:1, altKey:1}, chars:""}, - "a", false); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{ctrlKey:1, shiftKey:1, altKey:1}, chars:""}, - "A", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{ctrlKey:1, shiftKey:1, altKey:1}, chars:""}, + "a", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{ctrlKey:1, shiftKey:1, altKey:1}, chars:""}, + "A", false); // Greek layout can activate a Latin accesskey - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, - modifiers:{shiftKey:1, altKey:1}, chars:"A"}, - "a", true); - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, - modifiers:{shiftKey:1, altKey:1}, chars:"A"}, - "A", true); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, + modifiers:{shiftKey:1, altKey:1}, chars:"A"}, + "a", true); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, + modifiers:{shiftKey:1, altKey:1}, chars:"A"}, + "A", true); // ... and a Greek accesskey! - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, - modifiers:{shiftKey:1, altKey:1}, chars:"A"}, - "\u03b1", true); - testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, - modifiers:{shiftKey:1, altKey:1}, chars:"A"}, - "\u0391", true); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, + modifiers:{shiftKey:1, altKey:1}, chars:"A"}, + "\u03b1", true); + yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A, + modifiers:{shiftKey:1, altKey:1}, chars:"A"}, + "\u0391", true); // bug 359638 - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD, - modifiers:{shiftKey:1, altKey:1}, chars:".", unmodifiedChars:"."}, - ".", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD, + modifiers:{shiftKey:1, altKey:1}, chars:".", unmodifiedChars:"."}, + ".", true); } button.removeEventListener("click", onClick, false); } -function runXULKeyTests() +function* runXULKeyTests() { function testKey(aEvent, aElem, aShouldActivate) { var elem = document.getElementById(aElem); elem.activeCount = 0; - synthesizeKey(aEvent, "button"); + return synthesizeKey(aEvent, "button", function() { - var name = eventToString(aEvent); + var name = eventToString(aEvent); - is(elem.activeCount, aShouldActivate ? 1 : 0, - name + " activating " + aElem); + is(elem.activeCount, aShouldActivate ? 1 : 0, + name + " activating " + aElem); + + continueTest(); + }); } if (IS_MAC) { - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, - modifiers:{metaKey:1}, chars:";", unmodifiedChars:";"}, - "unshiftedKey", true); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, - modifiers:{metaKey:1}, chars:";", unmodifiedChars:";"}, - "shiftedKey", false); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, - modifiers:{metaKey:1, shiftKey:1}, chars:";", unmodifiedChars:":"}, - "shiftedKey", true); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, - modifiers:{metaKey:1, shiftKey:1}, chars:";", unmodifiedChars:":"}, - "unshiftedKey", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, + modifiers:{metaKey:1}, chars:";", unmodifiedChars:";"}, + "unshiftedKey", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, + modifiers:{metaKey:1}, chars:";", unmodifiedChars:";"}, + "shiftedKey", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, + modifiers:{metaKey:1, shiftKey:1}, chars:";", unmodifiedChars:":"}, + "shiftedKey", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon, + modifiers:{metaKey:1, shiftKey:1}, chars:";", unmodifiedChars:":"}, + "unshiftedKey", false); } else if (IS_WIN) { - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, - modifiers:{ctrlKey:1}, chars:";"}, - "unshiftedKey", true); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, - modifiers:{ctrlKey:1}, chars:";"}, - "shiftedKey", false); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, - modifiers:{ctrlKey:1, shiftKey:1}, chars:";"}, - "shiftedKey", true); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, - modifiers:{ctrlKey:1, shiftKey:1}, chars:";"}, - "unshiftedKey", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, + modifiers:{ctrlKey:1}, chars:";"}, + "unshiftedKey", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, + modifiers:{ctrlKey:1}, chars:";"}, + "shiftedKey", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, + modifiers:{ctrlKey:1, shiftKey:1}, chars:";"}, + "shiftedKey", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1, + modifiers:{ctrlKey:1, shiftKey:1}, chars:";"}, + "unshiftedKey", false); } keyElems = ["commandOptionF"]; // 429160 if (IS_MAC) { - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, - modifiers:{metaKey:1, altKey:1}, chars:"\u0192", unmodifiedChars:"f"}, - "commandOptionF", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F, + modifiers:{metaKey:1, altKey:1}, chars:"\u0192", unmodifiedChars:"f"}, + "commandOptionF", true); } else if (IS_WIN) { - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F, - modifiers:{ctrlKey:1, altKey:1}, chars:"\u0006"}, - "commandOptionF", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F, + modifiers:{ctrlKey:1, altKey:1}, chars:"\u0006"}, + "commandOptionF", true); } // 432112 if (IS_MAC) { - testKey({layout:KEYBOARD_LAYOUT_SWEDISH, keyCode:MAC_VK_ANSI_Minus, - modifiers:{metaKey:1, shiftKey:1}, chars:"+", unmodifiedChars:"?"}, - "question", true); + yield testKey({layout:KEYBOARD_LAYOUT_SWEDISH, keyCode:MAC_VK_ANSI_Minus, + modifiers:{metaKey:1, shiftKey:1}, chars:"+", unmodifiedChars:"?"}, + "question", true); } else if (IS_WIN) { - testKey({layout:KEYBOARD_LAYOUT_SWEDISH, keyCode:WIN_VK_OEM_PLUS, - modifiers:{ctrlKey:1, shiftKey:1}, chars:""}, - "question", true); - testKey({layout:KEYBOARD_LAYOUT_SWEDISH, keyCode:WIN_VK_OEM_PLUS, - modifiers:{ctrlKey:1}, chars:""}, - "question", false); + yield testKey({layout:KEYBOARD_LAYOUT_SWEDISH, keyCode:WIN_VK_OEM_PLUS, + modifiers:{ctrlKey:1, shiftKey:1}, chars:""}, + "question", true); + yield testKey({layout:KEYBOARD_LAYOUT_SWEDISH, keyCode:WIN_VK_OEM_PLUS, + modifiers:{ctrlKey:1}, chars:""}, + "question", false); } // bug 433192 if (IS_WIN) { - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1}, chars:"\u0018"}, - "unshiftedX", true); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1}, chars:"\u0018"}, - "shiftedX", false); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, - "unshiftedX", false); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, - "shiftedX", true); - testKey({layout:KEYBOARD_LAYOUT_ARABIC, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1}, chars:"\u0018"}, - "unshiftedX", true); - testKey({layout:KEYBOARD_LAYOUT_ARABIC, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1}, chars:"\u0018"}, - "shiftedX", false); - testKey({layout:KEYBOARD_LAYOUT_ARABIC, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, - "unshiftedX", false); - testKey({layout:KEYBOARD_LAYOUT_ARABIC, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, - "shiftedX", true); - testKey({layout:KEYBOARD_LAYOUT_HEBREW, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1}, chars:"\u0018"}, - "unshiftedX", true); - testKey({layout:KEYBOARD_LAYOUT_HEBREW, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1}, chars:"\u0018"}, - "shiftedX", false); - testKey({layout:KEYBOARD_LAYOUT_HEBREW, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, - "unshiftedX", false); - testKey({layout:KEYBOARD_LAYOUT_HEBREW, keyCode:WIN_VK_X, - modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, - "shiftedX", true); - testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_OEM_PLUS, - modifiers:{ctrlKey:1}, chars:""}, - "unshiftedPlus", false); - testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_OEM_PLUS, - modifiers:{ctrlKey:1, shiftKey:1}, chars:""}, - "unshiftedPlus", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1}, chars:"\u0018"}, + "unshiftedX", true); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1}, chars:"\u0018"}, + "shiftedX", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, + "unshiftedX", false); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, + "shiftedX", true); + yield testKey({layout:KEYBOARD_LAYOUT_ARABIC, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1}, chars:"\u0018"}, + "unshiftedX", true); + yield testKey({layout:KEYBOARD_LAYOUT_ARABIC, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1}, chars:"\u0018"}, + "shiftedX", false); + yield testKey({layout:KEYBOARD_LAYOUT_ARABIC, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, + "unshiftedX", false); + yield testKey({layout:KEYBOARD_LAYOUT_ARABIC, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, + "shiftedX", true); + yield testKey({layout:KEYBOARD_LAYOUT_HEBREW, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1}, chars:"\u0018"}, + "unshiftedX", true); + yield testKey({layout:KEYBOARD_LAYOUT_HEBREW, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1}, chars:"\u0018"}, + "shiftedX", false); + yield testKey({layout:KEYBOARD_LAYOUT_HEBREW, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, + "unshiftedX", false); + yield testKey({layout:KEYBOARD_LAYOUT_HEBREW, keyCode:WIN_VK_X, + modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"}, + "shiftedX", true); + yield testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_OEM_PLUS, + modifiers:{ctrlKey:1}, chars:""}, + "unshiftedPlus", false); + yield testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_OEM_PLUS, + modifiers:{ctrlKey:1, shiftKey:1}, chars:""}, + "unshiftedPlus", true); } // bug 759346 if (IS_WIN) { - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_1, - modifiers:{ctrlKey:1}, chars:""}, - "unshiftedPlus", false); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_1, - modifiers:{ctrlKey:1, shiftKey:1}, chars:""}, - "unshiftedPlus", true); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_OEM_PLUS, - modifiers:{ctrlKey:1}, chars:""}, - "unshiftedPlus", true); - testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_OEM_PLUS, - modifiers:{ctrlKey:1, shiftKey:1}, chars:""}, - "unshiftedPlus", false); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_1, + modifiers:{ctrlKey:1}, chars:""}, + "unshiftedPlus", false); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_1, + modifiers:{ctrlKey:1, shiftKey:1}, chars:""}, + "unshiftedPlus", true); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_OEM_PLUS, + modifiers:{ctrlKey:1}, chars:""}, + "unshiftedPlus", true); + yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_OEM_PLUS, + modifiers:{ctrlKey:1, shiftKey:1}, chars:""}, + "unshiftedPlus", false); } } -function runTextInputTests() +function* runTextInputTests() { var textbox = document.getElementById("textbox"); @@ -3169,45 +3176,48 @@ function runTextInputTests() textbox.value = ""; textbox.focus(); - synthesizeKey(aEvent, "textbox"); + return synthesizeKey(aEvent, "textbox", function() { - var name = eventToString(aEvent); + var name = eventToString(aEvent); - is(textbox.value, aExpectText, name + " does not input correct text."); + is(textbox.value, aExpectText, name + " does not input correct text."); + + continueTest(); + }); } if (IS_WIN) { // Basic sanity checks - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{}, chars:"a"}, - "a"); - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{shiftKey:1}, chars:"A"}, - "A"); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{}, chars:"a"}, + "a"); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{shiftKey:1}, chars:"A"}, + "A"); // When Ctrl+Alt are pressed, any text should not be inputted. - testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, - modifiers:{ctrlKey:1, altKey:1}, chars:""}, - ""); + yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A, + modifiers:{ctrlKey:1, altKey:1}, chars:""}, + ""); // Lithuanian AltGr should be consumed at 9/0 keys pressed - testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_8, - modifiers:{}, chars:"\u016B"}, - "\u016B"); - testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_9, - modifiers:{}, chars:"9"}, - "9"); - testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_0, - modifiers:{}, chars:"0"}, - "0"); - testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_8, - modifiers:{ctrlKey:1, altKey:1}, chars:"8"}, - "8"); - testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_9, - modifiers:{ctrlKey:1, altKey:1}, chars:"9"}, - "9"); - testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_0, - modifiers:{ctrlKey:1, altKey:1}, chars:"0"}, - "0"); + yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_8, + modifiers:{}, chars:"\u016B"}, + "\u016B"); + yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_9, + modifiers:{}, chars:"9"}, + "9"); + yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_0, + modifiers:{}, chars:"0"}, + "0"); + yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_8, + modifiers:{ctrlKey:1, altKey:1}, chars:"8"}, + "8"); + yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_9, + modifiers:{ctrlKey:1, altKey:1}, chars:"9"}, + "9"); + yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_0, + modifiers:{ctrlKey:1, altKey:1}, chars:"0"}, + "0"); } else todo(false, "runTextInputTests() checks Windows only"); @@ -3217,6 +3227,28 @@ function runTextInputTests() document.getElementById("button").focus(); } +function* runAllTests() { + yield* runKeyEventTests(); + yield* runAccessKeyTests(); + yield* runXULKeyTests(); + yield* runTextInputTests(); +} + +var gTestContinuation = null; + +function continueTest() +{ + if (!gTestContinuation) { + gTestContinuation = runAllTests(); + } + var ret = gTestContinuation.next(); + if (ret.done) { + SimpleTest.finish(); + } else { + is(ret.value, true, "Key synthesized successfully"); + } +} + function runTest() { if (!IS_MAC && !IS_WIN) { @@ -3228,12 +3260,7 @@ function runTest() clearInfobars(); - runKeyEventTests(); - runAccessKeyTests(); - runXULKeyTests(); - runTextInputTests(); - - SimpleTest.finish(); + continueTest(); } ]]> diff --git a/widget/tests/test_native_key_bindings_mac.html b/widget/tests/test_native_key_bindings_mac.html index e843f91bac..c4ccb55145 100644 --- a/widget/tests/test_native_key_bindings_mac.html +++ b/widget/tests/test_native_key_bindings_mac.html @@ -297,7 +297,7 @@ aElement.id + ": Incorrect selection end"); } - function testRun(aElement, aSelectionCheck) + function* testRun(aElement, aSelectionCheck, aCallback) { if (document.activeElement) { document.activeElement.blur(); @@ -306,21 +306,38 @@ aElement.focus(); for (let i = 0; i < synthesizedKeys.length; i++) { - synthesizeNativeKey.apply(null, synthesizedKeys[i]); - aSelectionCheck.call(null, aElement, expectations[i]); + synthesizedKeys[i].push(function() { + aSelectionCheck.call(null, aElement, expectations[i]); + continueTest(); + }); + var synthOk = synthesizeNativeKey.apply(null, synthesizedKeys[i]); + synthesizedKeys[i].pop(); + yield synthOk; } } - function doTest() - { - testRun(document.getElementById("editable"), checkWindowSelection); - testRun(document.getElementById("textarea"), checkElementSelection); - testRun(document.getElementById("input"), checkElementSelection); - - SimpleTest.finish(); + function* doTest() { + yield* testRun(document.getElementById("editable"), checkWindowSelection); + yield* testRun(document.getElementById("textarea"), checkElementSelection); + yield* testRun(document.getElementById("input"), checkElementSelection); } - SimpleTest.waitForFocus(doTest); + let gTestContinuation = null; + + function continueTest() + { + if (!gTestContinuation) { + gTestContinuation = doTest(); + } + var ret = gTestContinuation.next(); + if (ret.done) { + SimpleTest.finish(); + } else { + is(ret.value, true, "Successfully synthesized key"); + } + } + + SimpleTest.waitForFocus(continueTest); diff --git a/widget/tests/test_plugin_input_event.html b/widget/tests/test_plugin_input_event.html index 9ab61301f8..6ed2a14c4b 100644 --- a/widget/tests/test_plugin_input_event.html +++ b/widget/tests/test_plugin_input_event.html @@ -35,7 +35,7 @@ var gUtils = window. QueryInterface(Components.interfaces.nsIInterfaceRequestor). getInterface(Components.interfaces.nsIDOMWindowUtils); -function doTest() { +function* doTest() { gPlugin.focus(); is(gUtils.IMEStatus, gUtils.IME_STATUS_PLUGIN, @@ -43,19 +43,31 @@ function doTest() { is(gPlugin.getLastKeyText(), "", "Must be empty before first key test"); - synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, WIN_VK_A, {}, "a", "a"); + yield synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, WIN_VK_A, {}, "a", "a", continueTest); is(gPlugin.getLastKeyText(), "a", "Invalid character was inputted"); - synthesizeNativeKey(KEYBOARD_LAYOUT_GERMAN, WIN_VK_OEM_PLUS, {}, "+", "+"); + yield synthesizeNativeKey(KEYBOARD_LAYOUT_GERMAN, WIN_VK_OEM_PLUS, {}, "+", "+", continueTest); is(gPlugin.getLastKeyText(), "+", "Invalid character was inputted"); - synthesizeNativeKey(KEYBOARD_LAYOUT_GERMAN, WIN_VK_OEM_PLUS, {altGrKey:1}, "~", "+"); + yield synthesizeNativeKey(KEYBOARD_LAYOUT_GERMAN, WIN_VK_OEM_PLUS, {altGrKey:1}, "~", "+", continueTest); is(gPlugin.getLastKeyText(), "~", "Invalid character was inputted"); - - SimpleTest.finish(); } -SimpleTest.waitForFocus(doTest); +var gTestContinuation = null; + +function continueTest() { + if (!gTestContinuation) { + gTestContinuation = doTest(continueTest); + } + var ret = gTestContinuation.next(); + if (ret.done) { + SimpleTest.finish(); + } else { + is(ret.value, true, "Key synthesized successfully"); + } +} + +SimpleTest.waitForFocus(continueTest); diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp index a3ef21033c..08c37172b0 100644 --- a/widget/windows/KeyboardLayout.cpp +++ b/widget/windows/KeyboardLayout.cpp @@ -3,7 +3,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/ArrayUtils.h" #include "mozilla/DebugOnly.h" diff --git a/widget/windows/WinMouseScrollHandler.cpp b/widget/windows/WinMouseScrollHandler.cpp index 34146a95c9..9c1f0cfe97 100644 --- a/widget/windows/WinMouseScrollHandler.cpp +++ b/widget/windows/WinMouseScrollHandler.cpp @@ -6,7 +6,7 @@ #include "mozilla/DebugOnly.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "WinMouseScrollHandler.h" #include "nsWindow.h" diff --git a/widget/windows/WinUtils.cpp b/widget/windows/WinUtils.cpp index a986e35a92..d5a00bc1a3 100644 --- a/widget/windows/WinUtils.cpp +++ b/widget/windows/WinUtils.cpp @@ -20,7 +20,7 @@ #include "nsIContentPolicy.h" #include "nsContentUtils.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsString.h" #include "nsDirectoryServiceUtils.h" diff --git a/widget/windows/nsDeviceContextSpecWin.cpp b/widget/windows/nsDeviceContextSpecWin.cpp index 86325eb093..6538d7e459 100644 --- a/widget/windows/nsDeviceContextSpecWin.cpp +++ b/widget/windows/nsDeviceContextSpecWin.cpp @@ -41,7 +41,7 @@ #include "nsIStringBundle.h" #define NS_ERROR_GFX_PRINTER_BUNDLE_URL "chrome://global/locale/printing.properties" -#include "prlog.h" +#include "mozilla/Logging.h" PRLogModuleInfo * kWidgetPrintingLogMod = PR_NewLogModule("printing-widget"); #define PR_PL(_p1) PR_LOG(kWidgetPrintingLogMod, PR_LOG_DEBUG, _p1) diff --git a/widget/windows/nsIMM32Handler.cpp b/widget/windows/nsIMM32Handler.cpp index 78bfd0ecfc..e57a6d2313 100644 --- a/widget/windows/nsIMM32Handler.cpp +++ b/widget/windows/nsIMM32Handler.cpp @@ -4,7 +4,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsIMM32Handler.h" #include "nsWindow.h" diff --git a/widget/windows/nsSound.cpp b/widget/windows/nsSound.cpp index 8bef15580e..dd3efb5a67 100644 --- a/widget/windows/nsSound.cpp +++ b/widget/windows/nsSound.cpp @@ -19,7 +19,7 @@ #include "nsContentUtils.h" #include "nsCRT.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prtime.h" #include "prprf.h" #include "prmem.h" diff --git a/widget/windows/nsTextStore.cpp b/widget/windows/nsTextStore.cpp index e1bdfbcf23..5796843b71 100644 --- a/widget/windows/nsTextStore.cpp +++ b/widget/windows/nsTextStore.cpp @@ -6,7 +6,7 @@ #include #include -#include "prlog.h" +#include "mozilla/Logging.h" #include "nscore.h" #include "nsWindow.h" diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index a82f5bad57..24ac3c5187 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -75,7 +75,7 @@ #include #include -#include "prlog.h" +#include "mozilla/Logging.h" #include "prtime.h" #include "prprf.h" #include "prmem.h" @@ -5838,8 +5838,11 @@ nsWindow::SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout, int32_t aNativeKeyCode, uint32_t aModifierFlags, const nsAString& aCharacters, - const nsAString& aUnmodifiedCharacters) + const nsAString& aUnmodifiedCharacters, + nsIObserver* aObserver) { + AutoObserverNotifier notifier(aObserver, "keyevent"); + KeyboardLayout* keyboardLayout = KeyboardLayout::GetInstance(); return keyboardLayout->SynthesizeNativeKeyEvent( this, aNativeKeyboardLayout, aNativeKeyCode, aModifierFlags, @@ -5849,8 +5852,11 @@ nsWindow::SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout, nsresult nsWindow::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint, uint32_t aNativeMessage, - uint32_t aModifierFlags) + uint32_t aModifierFlags, + nsIObserver* aObserver) { + AutoObserverNotifier notifier(aObserver, "mouseevent"); + ::SetCursorPos(aPoint.x, aPoint.y); INPUT input; @@ -5870,8 +5876,10 @@ nsWindow::SynthesizeNativeMouseScrollEvent(LayoutDeviceIntPoint aPoint, double aDeltaY, double aDeltaZ, uint32_t aModifierFlags, - uint32_t aAdditionalFlags) + uint32_t aAdditionalFlags, + nsIObserver* aObserver) { + AutoObserverNotifier notifier(aObserver, "mousescrollevent"); return MouseScrollHandler::SynthesizeNativeMouseScrollEvent( this, aPoint, aNativeMessage, (aNativeMessage == WM_MOUSEWHEEL || aNativeMessage == WM_VSCROLL) ? diff --git a/widget/windows/nsWindow.h b/widget/windows/nsWindow.h index cf9dd2c966..1e7e26e44c 100644 --- a/widget/windows/nsWindow.h +++ b/widget/windows/nsWindow.h @@ -162,13 +162,16 @@ public: int32_t aNativeKeyCode, uint32_t aModifierFlags, const nsAString& aCharacters, - const nsAString& aUnmodifiedCharacters); + const nsAString& aUnmodifiedCharacters, + nsIObserver* aObserver) override; virtual nsresult SynthesizeNativeMouseEvent(mozilla::LayoutDeviceIntPoint aPoint, uint32_t aNativeMessage, - uint32_t aModifierFlags); + uint32_t aModifierFlags, + nsIObserver* aObserver) override; - virtual nsresult SynthesizeNativeMouseMove(mozilla::LayoutDeviceIntPoint aPoint) - { return SynthesizeNativeMouseEvent(aPoint, MOUSEEVENTF_MOVE, 0); } + virtual nsresult SynthesizeNativeMouseMove(mozilla::LayoutDeviceIntPoint aPoint, + nsIObserver* aObserver) override + { return SynthesizeNativeMouseEvent(aPoint, MOUSEEVENTF_MOVE, 0, aObserver); } virtual nsresult SynthesizeNativeMouseScrollEvent(mozilla::LayoutDeviceIntPoint aPoint, uint32_t aNativeMessage, @@ -176,7 +179,8 @@ public: double aDeltaY, double aDeltaZ, uint32_t aModifierFlags, - uint32_t aAdditionalFlags); + uint32_t aAdditionalFlags, + nsIObserver* aObserver) override; NS_IMETHOD_(void) SetInputContext(const InputContext& aContext, const InputContextAction& aAction); NS_IMETHOD_(InputContext) GetInputContext(); diff --git a/widget/windows/nsWindowBase.cpp b/widget/windows/nsWindowBase.cpp index 28e66decad..0ab56bf6da 100644 --- a/widget/windows/nsWindowBase.cpp +++ b/widget/windows/nsWindowBase.cpp @@ -110,8 +110,11 @@ nsWindowBase::SynthesizeNativeTouchPoint(uint32_t aPointerId, nsIWidget::TouchPointerState aPointerState, nsIntPoint aPointerScreenPoint, double aPointerPressure, - uint32_t aPointerOrientation) + uint32_t aPointerOrientation, + nsIObserver* aObserver) { + AutoObserverNotifier notifier(aObserver, "touchpoint"); + if (!InitTouchInjection()) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -180,8 +183,9 @@ nsWindowBase::CancelTouchPoints(const unsigned int& aPointerId, nsAutoPtr diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp index 6cc2184654..dbbba07321 100644 --- a/xpcom/base/nsDebugImpl.cpp +++ b/xpcom/base/nsDebugImpl.cpp @@ -14,7 +14,7 @@ #include "nsString.h" #include "nsXULAppAPI.h" #include "prprf.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsError.h" #include "prerror.h" #include "prerr.h" diff --git a/xpcom/build/nsXULAppAPI.h b/xpcom/build/nsXULAppAPI.h index 0d407cdcc8..0b07d7be75 100644 --- a/xpcom/build/nsXULAppAPI.h +++ b/xpcom/build/nsXULAppAPI.h @@ -10,7 +10,7 @@ #include "xrecore.h" #include "nsXPCOM.h" #include "nsISupports.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsXREAppData.h" #include "js/TypeDecls.h" diff --git a/xpcom/build/perfprobe.h b/xpcom/build/perfprobe.h index e7245a1401..4a4be944db 100644 --- a/xpcom/build/perfprobe.h +++ b/xpcom/build/perfprobe.h @@ -17,7 +17,7 @@ #include "nsError.h" #include "nsString.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsTArray.h" #include "nsAutoPtr.h" #include diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index 47ec2755e3..487441c5c0 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -77,7 +77,7 @@ #include "mozilla/Omnijar.h" -#include "prlog.h" +#include "mozilla/Logging.h" using namespace mozilla; diff --git a/xpcom/components/nsNativeModuleLoader.cpp b/xpcom/components/nsNativeModuleLoader.cpp index 558b032298..e230c169db 100644 --- a/xpcom/components/nsNativeModuleLoader.cpp +++ b/xpcom/components/nsNativeModuleLoader.cpp @@ -16,7 +16,7 @@ #include "nsNativeModuleLoader.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prinit.h" #include "prerror.h" diff --git a/xpcom/ds/TimeStamp_windows.cpp b/xpcom/ds/TimeStamp_windows.cpp index b48784b8b0..4266957cc0 100644 --- a/xpcom/ds/TimeStamp_windows.cpp +++ b/xpcom/ds/TimeStamp_windows.cpp @@ -14,7 +14,7 @@ #include #include "nsCRT.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prprf.h" #include diff --git a/xpcom/ds/nsExpirationTracker.h b/xpcom/ds/nsExpirationTracker.h index 98d770b7f7..49892c02fa 100644 --- a/xpcom/ds/nsExpirationTracker.h +++ b/xpcom/ds/nsExpirationTracker.h @@ -6,7 +6,7 @@ #ifndef NSEXPIRATIONTRACKER_H_ #define NSEXPIRATIONTRACKER_H_ -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsTArray.h" #include "nsITimer.h" #include "nsCOMPtr.h" diff --git a/xpcom/ds/nsObserverService.cpp b/xpcom/ds/nsObserverService.cpp index b0f1a0d6fe..09d8671383 100644 --- a/xpcom/ds/nsObserverService.cpp +++ b/xpcom/ds/nsObserverService.cpp @@ -3,7 +3,7 @@ * 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/. */ -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsAutoPtr.h" #include "nsIObserverService.h" #include "nsIObserver.h" diff --git a/xpcom/ds/nsStaticAtom.h b/xpcom/ds/nsStaticAtom.h index ac01e7889b..657bb29449 100644 --- a/xpcom/ds/nsStaticAtom.h +++ b/xpcom/ds/nsStaticAtom.h @@ -8,7 +8,7 @@ #include "nsIAtom.h" #include "nsStringBuffer.h" -#include "prlog.h" +#include "mozilla/Logging.h" typedef char16_t nsStaticAtomStringType; diff --git a/xpcom/glue/BlockingResourceBase.h b/xpcom/glue/BlockingResourceBase.h index 3407e8dd94..6c25007479 100644 --- a/xpcom/glue/BlockingResourceBase.h +++ b/xpcom/glue/BlockingResourceBase.h @@ -8,7 +8,7 @@ #ifndef mozilla_BlockingResourceBase_h #define mozilla_BlockingResourceBase_h -#include "prlog.h" +#include "mozilla/Logging.h" #include "nscore.h" #include "nsDebug.h" diff --git a/xpcom/glue/nsStringAPI.h b/xpcom/glue/nsStringAPI.h index d6ee498287..fa473c8d70 100644 --- a/xpcom/glue/nsStringAPI.h +++ b/xpcom/glue/nsStringAPI.h @@ -21,7 +21,7 @@ #include "nsXPCOMStrings.h" #include "nsISupportsImpl.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsTArray.h" /** diff --git a/xpcom/glue/nsTextFormatter.cpp b/xpcom/glue/nsTextFormatter.cpp index dc9e7bfd63..e7b16fd53d 100644 --- a/xpcom/glue/nsTextFormatter.cpp +++ b/xpcom/glue/nsTextFormatter.cpp @@ -26,7 +26,7 @@ #include #include #include "prdtoa.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "prprf.h" #include "prmem.h" #include "nsCRTGlue.h" diff --git a/xpcom/glue/nsThreadUtils.h b/xpcom/glue/nsThreadUtils.h index dd65a13f91..53bf91b985 100644 --- a/xpcom/glue/nsThreadUtils.h +++ b/xpcom/glue/nsThreadUtils.h @@ -607,8 +607,8 @@ struct ParameterStorage // struct used to store arguments and later apply them to a method. template struct nsRunnableMethodArguments; -// Specializations for 0-4 arguments, add more as required. -// TODO Use tuple instead; And/or use lambdas. +// Specializations for 0-8 arguments, add more as required. +// TODO Use tuple instead; And/or use lambdas (see bug 1152753) template <> struct nsRunnableMethodArguments<> { @@ -682,6 +682,121 @@ struct nsRunnableMethodArguments m2.PassAsParameter(), m3.PassAsParameter()); } }; +template +struct nsRunnableMethodArguments +{ + typename ::detail::ParameterStorage::Type m0; + typename ::detail::ParameterStorage::Type m1; + typename ::detail::ParameterStorage::Type m2; + typename ::detail::ParameterStorage::Type m3; + typename ::detail::ParameterStorage::Type m4; + template + nsRunnableMethodArguments(A0&& a0, A1&& a1, A2&& a2, A3&& a3, A4&& a4) + : m0(mozilla::Forward(a0)) + , m1(mozilla::Forward(a1)) + , m2(mozilla::Forward(a2)) + , m3(mozilla::Forward(a3)) + , m4(mozilla::Forward(a4)) + {} + template void apply(C* o, M m) + { + ((*o).*m)(m0.PassAsParameter(), m1.PassAsParameter(), + m2.PassAsParameter(), m3.PassAsParameter(), + m4.PassAsParameter()); + } +}; +template +struct nsRunnableMethodArguments +{ + typename ::detail::ParameterStorage::Type m0; + typename ::detail::ParameterStorage::Type m1; + typename ::detail::ParameterStorage::Type m2; + typename ::detail::ParameterStorage::Type m3; + typename ::detail::ParameterStorage::Type m4; + typename ::detail::ParameterStorage::Type m5; + template + nsRunnableMethodArguments(A0&& a0, A1&& a1, A2&& a2, A3&& a3, A4&& a4, + A5&& a5) + : m0(mozilla::Forward(a0)) + , m1(mozilla::Forward(a1)) + , m2(mozilla::Forward(a2)) + , m3(mozilla::Forward(a3)) + , m4(mozilla::Forward(a4)) + , m5(mozilla::Forward(a5)) + {} + template void apply(C* o, M m) + { + ((*o).*m)(m0.PassAsParameter(), m1.PassAsParameter(), + m2.PassAsParameter(), m3.PassAsParameter(), + m4.PassAsParameter(), m5.PassAsParameter()); + } +}; +template +struct nsRunnableMethodArguments +{ + typename ::detail::ParameterStorage::Type m0; + typename ::detail::ParameterStorage::Type m1; + typename ::detail::ParameterStorage::Type m2; + typename ::detail::ParameterStorage::Type m3; + typename ::detail::ParameterStorage::Type m4; + typename ::detail::ParameterStorage::Type m5; + typename ::detail::ParameterStorage::Type m6; + template + nsRunnableMethodArguments(A0&& a0, A1&& a1, A2&& a2, A3&& a3, A4&& a4, + A5&& a5, A6&& a6) + : m0(mozilla::Forward(a0)) + , m1(mozilla::Forward(a1)) + , m2(mozilla::Forward(a2)) + , m3(mozilla::Forward(a3)) + , m4(mozilla::Forward(a4)) + , m5(mozilla::Forward(a5)) + , m6(mozilla::Forward(a6)) + {} + template void apply(C* o, M m) + { + ((*o).*m)(m0.PassAsParameter(), m1.PassAsParameter(), + m2.PassAsParameter(), m3.PassAsParameter(), + m4.PassAsParameter(), m5.PassAsParameter(), + m6.PassAsParameter()); + } +}; +template +struct nsRunnableMethodArguments +{ + typename ::detail::ParameterStorage::Type m0; + typename ::detail::ParameterStorage::Type m1; + typename ::detail::ParameterStorage::Type m2; + typename ::detail::ParameterStorage::Type m3; + typename ::detail::ParameterStorage::Type m4; + typename ::detail::ParameterStorage::Type m5; + typename ::detail::ParameterStorage::Type m6; + typename ::detail::ParameterStorage::Type m7; + template + nsRunnableMethodArguments(A0&& a0, A1&& a1, A2&& a2, A3&& a3, A4&& a4, + A5&& a5, A6&& a6, A7&& a7) + : m0(mozilla::Forward(a0)) + , m1(mozilla::Forward(a1)) + , m2(mozilla::Forward(a2)) + , m3(mozilla::Forward(a3)) + , m4(mozilla::Forward(a4)) + , m5(mozilla::Forward(a5)) + , m6(mozilla::Forward(a6)) + , m7(mozilla::Forward(a7)) + {} + template void apply(C* o, M m) + { + ((*o).*m)(m0.PassAsParameter(), m1.PassAsParameter(), + m2.PassAsParameter(), m3.PassAsParameter(), + m4.PassAsParameter(), m5.PassAsParameter(), + m6.PassAsParameter(), m7.PassAsParameter()); + } +}; template class nsRunnableMethodImpl @@ -764,7 +879,7 @@ NS_NewRunnableMethodWithArgs(PtrType&& aPtr, Method aMethod, Args&&... aArgs) } template -typename nsRunnableMethodTraits::base_type* +typename nsRunnableMethodTraits::base_type* NS_NewNonOwningRunnableMethodWithArgs(PtrType&& aPtr, Method aMethod, Args&&... aArgs) { diff --git a/xpcom/io/nsInputStreamTee.cpp b/xpcom/io/nsInputStreamTee.cpp index f6cd8c16f3..0df5ac22b3 100644 --- a/xpcom/io/nsInputStreamTee.cpp +++ b/xpcom/io/nsInputStreamTee.cpp @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/Mutex.h" #include "mozilla/Attributes.h" diff --git a/xpcom/io/nsPipe3.cpp b/xpcom/io/nsPipe3.cpp index fdcdc15067..f44a120085 100644 --- a/xpcom/io/nsPipe3.cpp +++ b/xpcom/io/nsPipe3.cpp @@ -17,7 +17,7 @@ #include "nsStreamUtils.h" #include "nsCOMPtr.h" #include "nsCRT.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsIClassInfoImpl.h" #include "nsAlgorithm.h" #include "nsMemory.h" diff --git a/xpcom/io/nsStorageStream.cpp b/xpcom/io/nsStorageStream.cpp index 21531e7572..d38ef72856 100644 --- a/xpcom/io/nsStorageStream.cpp +++ b/xpcom/io/nsStorageStream.cpp @@ -21,7 +21,7 @@ #include "nsIInputStream.h" #include "nsIIPCSerializableInputStream.h" #include "nsISeekableStream.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/Attributes.h" #include "mozilla/Likely.h" #include "mozilla/MathAlgorithms.h" diff --git a/xpcom/string/nsSubstring.cpp b/xpcom/string/nsSubstring.cpp index 6c2024e1d4..233de61839 100644 --- a/xpcom/string/nsSubstring.cpp +++ b/xpcom/string/nsSubstring.cpp @@ -355,7 +355,7 @@ nsStringBuffer::SizeOfIncludingThisEvenIfShared(mozilla::MallocSizeOf aMallocSiz // Check that internal and external strings have the same size. // See https://bugzilla.mozilla.org/show_bug.cgi?id=430581 -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsXPCOMStrings.h" static_assert(sizeof(nsStringContainer_base) == sizeof(nsSubstring), diff --git a/xpcom/threads/nsEventQueue.cpp b/xpcom/threads/nsEventQueue.cpp index 39280f3299..0678aa261e 100644 --- a/xpcom/threads/nsEventQueue.cpp +++ b/xpcom/threads/nsEventQueue.cpp @@ -6,7 +6,7 @@ #include "nsEventQueue.h" #include "nsAutoPtr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsThreadUtils.h" #include "prthread.h" #include "mozilla/ChaosMode.h" diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp index 001cd06f49..aa3ed517af 100644 --- a/xpcom/threads/nsThread.cpp +++ b/xpcom/threads/nsThread.cpp @@ -22,7 +22,7 @@ #include "nsAutoPtr.h" #include "nsCOMPtr.h" #include "pratom.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "nsIObserverService.h" #if !defined(MOZILLA_XPCOMRT_API) #include "mozilla/HangMonitor.h" diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp index ebb4f3974a..04ead99b8a 100644 --- a/xpcom/threads/nsThreadPool.cpp +++ b/xpcom/threads/nsThreadPool.cpp @@ -11,7 +11,7 @@ #include "nsMemory.h" #include "nsAutoPtr.h" #include "prinrval.h" -#include "prlog.h" +#include "mozilla/Logging.h" using namespace mozilla; diff --git a/xpcom/threads/nsTimerImpl.h b/xpcom/threads/nsTimerImpl.h index 27ebf8ff36..0ede59f771 100644 --- a/xpcom/threads/nsTimerImpl.h +++ b/xpcom/threads/nsTimerImpl.h @@ -13,7 +13,7 @@ #include "nsCOMPtr.h" -#include "prlog.h" +#include "mozilla/Logging.h" #include "mozilla/TimeStamp.h" #include "mozilla/Attributes.h"