Bug 633602 - Implement Pointer Lock (Mouse Lock) API. r=roc,smaug
authorDavid Humphrey (:humph) <david.humphrey@senecacollege.ca>
Wed, 11 Apr 2012 17:55:21 -0400
changeset 91447 637a5d7228be
parent 91446 66e7ce7034c7
child 91448 26eb08593f89
push id8227
push userryanvm@gmail.com
push dateWed, 11 Apr 2012 21:55:33 +0000
treeherdermozilla-inbound@4b667b134bc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, smaug
bugs633602
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 633602 - Implement Pointer Lock (Mouse Lock) API. r=roc,smaug
content/base/public/nsIDocument.h
content/base/public/nsINode.h
content/base/src/nsDocument.cpp
content/base/src/nsDocument.h
content/base/src/nsGenericElement.cpp
content/base/src/nsGkAtomList.h
content/events/public/nsEventNameList.h
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMEvent.h
content/events/src/nsDOMMouseEvent.cpp
content/events/src/nsDOMUIEvent.cpp
content/events/src/nsDOMUIEvent.h
content/events/src/nsEventStateManager.cpp
content/events/src/nsEventStateManager.h
content/html/content/test/test_fullscreen-api.html
dom/interfaces/core/nsIDOMDocument.idl
dom/interfaces/core/nsIDOMElement.idl
dom/interfaces/core/nsIDOMXMLDocument.idl
dom/interfaces/core/nsIInlineEventHandlers.idl
dom/interfaces/events/nsIDOMMouseEvent.idl
dom/interfaces/html/nsIDOMHTMLAnchorElement.idl
dom/interfaces/html/nsIDOMHTMLAppletElement.idl
dom/interfaces/html/nsIDOMHTMLAreaElement.idl
dom/interfaces/html/nsIDOMHTMLAudioElement.idl
dom/interfaces/html/nsIDOMHTMLBRElement.idl
dom/interfaces/html/nsIDOMHTMLBaseElement.idl
dom/interfaces/html/nsIDOMHTMLBodyElement.idl
dom/interfaces/html/nsIDOMHTMLButtonElement.idl
dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
dom/interfaces/html/nsIDOMHTMLCommandElement.idl
dom/interfaces/html/nsIDOMHTMLDListElement.idl
dom/interfaces/html/nsIDOMHTMLDataListElement.idl
dom/interfaces/html/nsIDOMHTMLDirectoryElement.idl
dom/interfaces/html/nsIDOMHTMLDivElement.idl
dom/interfaces/html/nsIDOMHTMLDocument.idl
dom/interfaces/html/nsIDOMHTMLElement.idl
dom/interfaces/html/nsIDOMHTMLEmbedElement.idl
dom/interfaces/html/nsIDOMHTMLFieldSetElement.idl
dom/interfaces/html/nsIDOMHTMLFontElement.idl
dom/interfaces/html/nsIDOMHTMLFormElement.idl
dom/interfaces/html/nsIDOMHTMLFrameElement.idl
dom/interfaces/html/nsIDOMHTMLFrameSetElement.idl
dom/interfaces/html/nsIDOMHTMLHRElement.idl
dom/interfaces/html/nsIDOMHTMLHeadElement.idl
dom/interfaces/html/nsIDOMHTMLHeadingElement.idl
dom/interfaces/html/nsIDOMHTMLHtmlElement.idl
dom/interfaces/html/nsIDOMHTMLIFrameElement.idl
dom/interfaces/html/nsIDOMHTMLImageElement.idl
dom/interfaces/html/nsIDOMHTMLInputElement.idl
dom/interfaces/html/nsIDOMHTMLLIElement.idl
dom/interfaces/html/nsIDOMHTMLLabelElement.idl
dom/interfaces/html/nsIDOMHTMLLegendElement.idl
dom/interfaces/html/nsIDOMHTMLLinkElement.idl
dom/interfaces/html/nsIDOMHTMLMapElement.idl
dom/interfaces/html/nsIDOMHTMLMediaElement.idl
dom/interfaces/html/nsIDOMHTMLMenuElement.idl
dom/interfaces/html/nsIDOMHTMLMenuItemElement.idl
dom/interfaces/html/nsIDOMHTMLMetaElement.idl
dom/interfaces/html/nsIDOMHTMLModElement.idl
dom/interfaces/html/nsIDOMHTMLOListElement.idl
dom/interfaces/html/nsIDOMHTMLObjectElement.idl
dom/interfaces/html/nsIDOMHTMLOptGroupElement.idl
dom/interfaces/html/nsIDOMHTMLOptionElement.idl
dom/interfaces/html/nsIDOMHTMLOutputElement.idl
dom/interfaces/html/nsIDOMHTMLParagraphElement.idl
dom/interfaces/html/nsIDOMHTMLParamElement.idl
dom/interfaces/html/nsIDOMHTMLPreElement.idl
dom/interfaces/html/nsIDOMHTMLProgressElement.idl
dom/interfaces/html/nsIDOMHTMLQuoteElement.idl
dom/interfaces/html/nsIDOMHTMLScriptElement.idl
dom/interfaces/html/nsIDOMHTMLSelectElement.idl
dom/interfaces/html/nsIDOMHTMLSourceElement.idl
dom/interfaces/html/nsIDOMHTMLStyleElement.idl
dom/interfaces/html/nsIDOMHTMLTableCaptionElem.idl
dom/interfaces/html/nsIDOMHTMLTableCellElement.idl
dom/interfaces/html/nsIDOMHTMLTableColElement.idl
dom/interfaces/html/nsIDOMHTMLTableElement.idl
dom/interfaces/html/nsIDOMHTMLTableRowElement.idl
dom/interfaces/html/nsIDOMHTMLTableSectionElem.idl
dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl
dom/interfaces/html/nsIDOMHTMLTitleElement.idl
dom/interfaces/html/nsIDOMHTMLUListElement.idl
dom/interfaces/html/nsIDOMHTMLUnknownElement.idl
dom/interfaces/html/nsIDOMHTMLVideoElement.idl
dom/interfaces/svg/nsIDOMSVGAElement.idl
dom/interfaces/svg/nsIDOMSVGAltGlyphElement.idl
dom/interfaces/svg/nsIDOMSVGAnimateElement.idl
dom/interfaces/svg/nsIDOMSVGAnimateMotionElement.idl
dom/interfaces/svg/nsIDOMSVGAnimateTransformElement.idl
dom/interfaces/svg/nsIDOMSVGAnimationElement.idl
dom/interfaces/svg/nsIDOMSVGCircleElement.idl
dom/interfaces/svg/nsIDOMSVGClipPathElement.idl
dom/interfaces/svg/nsIDOMSVGDefsElement.idl
dom/interfaces/svg/nsIDOMSVGDescElement.idl
dom/interfaces/svg/nsIDOMSVGDocument.idl
dom/interfaces/svg/nsIDOMSVGElement.idl
dom/interfaces/svg/nsIDOMSVGEllipseElement.idl
dom/interfaces/svg/nsIDOMSVGFilterElement.idl
dom/interfaces/svg/nsIDOMSVGFilters.idl
dom/interfaces/svg/nsIDOMSVGForeignObjectElem.idl
dom/interfaces/svg/nsIDOMSVGGElement.idl
dom/interfaces/svg/nsIDOMSVGGradientElement.idl
dom/interfaces/svg/nsIDOMSVGImageElement.idl
dom/interfaces/svg/nsIDOMSVGLineElement.idl
dom/interfaces/svg/nsIDOMSVGMarkerElement.idl
dom/interfaces/svg/nsIDOMSVGMaskElement.idl
dom/interfaces/svg/nsIDOMSVGMetadataElement.idl
dom/interfaces/svg/nsIDOMSVGMpathElement.idl
dom/interfaces/svg/nsIDOMSVGPathElement.idl
dom/interfaces/svg/nsIDOMSVGPatternElement.idl
dom/interfaces/svg/nsIDOMSVGPolygonElement.idl
dom/interfaces/svg/nsIDOMSVGPolylineElement.idl
dom/interfaces/svg/nsIDOMSVGRectElement.idl
dom/interfaces/svg/nsIDOMSVGSVGElement.idl
dom/interfaces/svg/nsIDOMSVGScriptElement.idl
dom/interfaces/svg/nsIDOMSVGSetElement.idl
dom/interfaces/svg/nsIDOMSVGStopElement.idl
dom/interfaces/svg/nsIDOMSVGStyleElement.idl
dom/interfaces/svg/nsIDOMSVGSwitchElement.idl
dom/interfaces/svg/nsIDOMSVGSymbolElement.idl
dom/interfaces/svg/nsIDOMSVGTSpanElement.idl
dom/interfaces/svg/nsIDOMSVGTextContentElement.idl
dom/interfaces/svg/nsIDOMSVGTextElement.idl
dom/interfaces/svg/nsIDOMSVGTextPathElement.idl
dom/interfaces/svg/nsIDOMSVGTextPositionElem.idl
dom/interfaces/svg/nsIDOMSVGTitleElement.idl
dom/interfaces/svg/nsIDOMSVGUseElement.idl
dom/interfaces/xul/nsIDOMXULButtonElement.idl
dom/interfaces/xul/nsIDOMXULCheckboxElement.idl
dom/interfaces/xul/nsIDOMXULContainerElement.idl
dom/interfaces/xul/nsIDOMXULControlElement.idl
dom/interfaces/xul/nsIDOMXULDescriptionElement.idl
dom/interfaces/xul/nsIDOMXULImageElement.idl
dom/interfaces/xul/nsIDOMXULLabelElement.idl
dom/interfaces/xul/nsIDOMXULLabeledControlEl.idl
dom/interfaces/xul/nsIDOMXULMenuListElement.idl
dom/interfaces/xul/nsIDOMXULMultSelectCntrlEl.idl
dom/interfaces/xul/nsIDOMXULPopupElement.idl
dom/interfaces/xul/nsIDOMXULSelectCntrlEl.idl
dom/interfaces/xul/nsIDOMXULSelectCntrlItemEl.idl
dom/interfaces/xul/nsIDOMXULTextboxElement.idl
dom/tests/mochitest/Makefile.in
dom/tests/mochitest/pointerlock/Makefile.in
dom/tests/mochitest/pointerlock/file_childIframe.html
dom/tests/mochitest/pointerlock/file_doubleLock.html
dom/tests/mochitest/pointerlock/file_escapeKey.html
dom/tests/mochitest/pointerlock/file_infiniteMovement.html
dom/tests/mochitest/pointerlock/file_locksvgelement.html
dom/tests/mochitest/pointerlock/file_movementXY.html
dom/tests/mochitest/pointerlock/file_nestedFullScreen.html
dom/tests/mochitest/pointerlock/file_pointerLockPref.html
dom/tests/mochitest/pointerlock/file_pointerlock-api.html
dom/tests/mochitest/pointerlock/file_pointerlockerror.html
dom/tests/mochitest/pointerlock/file_removedFromDOM.html
dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html
dom/tests/mochitest/pointerlock/file_screenClientXYConst.html
dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html
dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html
dom/tests/mochitest/pointerlock/file_withoutDOM.html
dom/tests/mochitest/pointerlock/iframe_differentDOM.html
dom/tests/mochitest/pointerlock/pointerlock_utils.js
dom/tests/mochitest/pointerlock/test_pointerlock-api.html
layout/base/nsIPresShell.h
layout/base/nsPresShell.cpp
modules/libpref/src/init/all.js
rdf/base/idl/xulstubs.idl
widget/cocoa/nsChildView.h
widget/gtk2/nsWindow.cpp
widget/gtk2/nsWindow.h
widget/nsGUIEvent.h
widget/nsIWidget.h
widget/windows/nsWindow.h
widget/xpwidgets/nsBaseWidget.h
--- a/content/base/public/nsIDocument.h
+++ b/content/base/public/nsIDocument.h
@@ -779,16 +779,22 @@ public:
 
   /**
    * Exits all documents from DOM full-screen mode, and moves the top-level
    * browser window out of full-screen mode. If aRunAsync is true, this runs
    * asynchronously.
    */
   static void ExitFullScreen(bool aRunAsync);
 
+
+  virtual void RequestPointerLock(Element* aElement) = 0;
+
+  static void UnlockPointer();
+
+
   //----------------------------------------------------------------------
 
   // Document notification API's
 
   /**
    * Add a new observer of document change notifications. Whenever
    * content is changed, appended, inserted or removed the observers are
    * informed.  An observer that is already observing the document must
--- a/content/base/public/nsINode.h
+++ b/content/base/public/nsINode.h
@@ -1290,16 +1290,18 @@ private:
     NodeIsCCBlackTree,
     // Maybe set if the node is a root of a subtree 
     // which needs to be kept in the purple buffer.
     NodeIsPurpleRoot,
     // Set if the node has an explicit base URI stored
     NodeHasExplicitBaseURI,
     // Set if the element has some style states locked
     ElementHasLockedStyleStates,
+    // Set if element has pointer locked
+    ElementHasPointerLock,
     // Set if the node may have DOMMutationObserver attached to it.
     NodeMayHaveDOMMutationObserver,
     // Guard value
     BooleanFlagCount
   };
 
   void SetBoolFlag(BooleanFlag name, bool value) {
     PR_STATIC_ASSERT(BooleanFlagCount <= 8*sizeof(mBoolFlags));
@@ -1353,16 +1355,19 @@ public:
   void SetIsPurpleRoot(bool aValue)
     { SetBoolFlag(NodeIsPurpleRoot, aValue); }
   bool IsPurpleRoot() const { return GetBoolFlag(NodeIsPurpleRoot); }
   bool MayHaveDOMMutationObserver()
     { return GetBoolFlag(NodeMayHaveDOMMutationObserver); }
   void SetMayHaveDOMMutationObserver()
     { SetBoolFlag(NodeMayHaveDOMMutationObserver, true); }
   bool HasListenerManager() { return HasFlag(NODE_HAS_LISTENERMANAGER); }
+  bool HasPointerLock() const { return GetBoolFlag(ElementHasPointerLock); }
+  void SetPointerLock() { SetBoolFlag(ElementHasPointerLock); }
+  void ClearPointerLock() { ClearBoolFlag(ElementHasPointerLock); }
 protected:
   void SetParentIsContent(bool aValue) { SetBoolFlag(ParentIsContent, aValue); }
   void SetInDocument() { SetBoolFlag(IsInDocument); }
   void ClearInDocument() { ClearBoolFlag(IsInDocument); }
   void SetIsElement() { SetBoolFlag(NodeIsElement); }
   void ClearIsElement() { ClearBoolFlag(NodeIsElement); }
   void SetHasID() { SetBoolFlag(ElementHasID); }
   void ClearHasID() { ClearBoolFlag(ElementHasID); }
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -8679,16 +8679,23 @@ nsDocument::ExitFullScreen()
 
   // Stores a list of documents to which we must dispatch "mozfullscreenchange".
   // We're required by the spec to dispatch the events in leaf-to-root
   // order when exiting full-screen, but we traverse the doctree in a
   // root-to-leaf order, so we save references to the documents we must
   // dispatch to so that we dispatch in the specified order.
   nsAutoTArray<nsIDocument*, 8> changed;
 
+  // We may also need to unlock the pointer, if it's locked.
+  nsCOMPtr<Element> pointerLockedElement =
+    do_QueryReferent(nsEventStateManager::sPointerLockedElement);
+  if (pointerLockedElement) {
+    UnlockPointer();
+  }
+
   // Walk the tree of full-screen documents, and reset their full-screen state.
   ResetFullScreen(root, static_cast<void*>(&changed));
 
   // Dispatch "mozfullscreenchange" events. Note this loop is in reverse
   // order so that the events for the leaf document arrives before the root
   // document, as required by the spec.
   for (PRUint32 i = 0; i < changed.Length(); ++i) {
     DispatchFullScreenChange(changed[changed.Length() - i - 1]);
@@ -8709,30 +8716,39 @@ nsDocument::RestorePreviousFullScreenSta
 {
   NS_ASSERTION(!IsFullScreenDoc() || sFullScreenDoc != nsnull,
                "Should have a full-screen doc when full-screen!");
 
   if (!IsFullScreenDoc() || !GetWindow() || !sFullScreenDoc) {
     return;
   }
 
+  // If fullscreen mode is updated the pointer should be unlocked
+  nsCOMPtr<Element> pointerLockedElement =
+    do_QueryReferent(nsEventStateManager::sPointerLockedElement);
+  if (pointerLockedElement) {
+    UnlockPointer();
+  }
+
   // Clear full-screen stacks in all descendant documents, bottom up.
   nsCOMPtr<nsIDocument> fullScreenDoc(do_QueryReferent(sFullScreenDoc));
   nsIDocument* doc = fullScreenDoc;
   while (doc != this) {
     NS_ASSERTION(doc->IsFullScreenDoc(), "Should be full-screen doc");
     static_cast<nsDocument*>(doc)->ClearFullScreenStack();
+    UnlockPointer();
     DispatchFullScreenChange(doc);
     doc = doc->GetParentDocument();
   }
 
   // Roll-back full-screen state to previous full-screen element.
   NS_ASSERTION(doc == this, "Must have reached this doc.");
   while (doc != nsnull) {
     static_cast<nsDocument*>(doc)->FullScreenStackPop();
+    UnlockPointer();
     DispatchFullScreenChange(doc);
     if (static_cast<nsDocument*>(doc)->mFullScreenStack.IsEmpty()) {
       // Full-screen stack in document is empty. Go back up to the parent
       // document. We'll pop the containing element off its stack, and use
       // its next full-screen element as the full-screen element.
       doc = doc->GetParentDocument();
     } else {
       // Else we popped the top of the stack, and there's still another
@@ -8998,17 +9014,32 @@ nsDocument::RequestFullScreen(Element* a
   // too. We're required by the spec to dispatch the events in root-to-leaf
   // order, but we traverse the doctree in a leaf-to-root order, so we save
   // references to the documents we must dispatch to so that we get the order
   // as specified.
   nsAutoTArray<nsIDocument*, 8> changed;
 
   // Remember the root document, so that if a full-screen document is hidden
   // we can reset full-screen state in the remaining visible full-screen documents.
-  sFullScreenRootDoc = do_GetWeakReference(nsContentUtils::GetRootDocument(this));
+  nsIDocument* fullScreenDoc = nsContentUtils::GetRootDocument(this);
+  sFullScreenRootDoc = do_GetWeakReference(fullScreenDoc);
+
+  // If a document is already in fullscreen, then unlock the mouse pointer
+  // before setting a new document to fullscreen
+  if (fullScreenDoc) {
+    UnlockPointer();
+  }
+
+  // If a document is already in fullscreen, then unlock the mouse pointer
+  // before setting a new document to fullscreen
+  nsCOMPtr<Element> pointerLockedElement =
+    do_QueryReferent(nsEventStateManager::sPointerLockedElement);
+  if (pointerLockedElement) {
+    UnlockPointer();
+  }
 
   // Set the full-screen element. This sets the full-screen style on the
   // element, and the full-screen-ancestor styles on ancestors of the element
   // in this document.
   DebugOnly<bool> x = FullScreenStackPush(aElement);
   NS_ASSERTION(x, "Full-screen state of requesting doc should always change!");
   changed.AppendElement(this);
   
@@ -9162,16 +9193,233 @@ nsDocument::IsFullScreenEnabled(bool aCa
       return false;
     }
     node = nsContentUtils::GetCrossDocParentNode(node);
   } while (node);
 
   return true;
 }
 
+static void
+DispatchPointerLockChange(nsIDocument* aTarget)
+{
+  nsRefPtr<nsAsyncDOMEvent> e =
+    new nsAsyncDOMEvent(aTarget,
+                        NS_LITERAL_STRING("mozpointerlockchange"),
+                        true,
+                        false);
+  e->PostDOMEvent();
+}
+
+static void
+DispatchPointerLockError(nsIDocument* aTarget)
+{
+  nsRefPtr<nsAsyncDOMEvent> e =
+    new nsAsyncDOMEvent(aTarget,
+                        NS_LITERAL_STRING("mozpointerlockerror"),
+                        true,
+                        false);
+  e->PostDOMEvent();
+}
+
+void
+nsDocument::RequestPointerLock(Element* aElement)
+{
+  NS_ASSERTION(aElement,
+    "Must pass non-null element to nsDocument::RequestPointerLock");
+
+  nsCOMPtr<Element> pointerLockedElement =
+    do_QueryReferent(nsEventStateManager::sPointerLockedElement);
+  if (aElement == pointerLockedElement) {
+    DispatchPointerLockChange(this);
+    return;
+  }
+
+  if (!ShouldLockPointer(aElement) ||
+      !SetPointerLock(aElement, NS_STYLE_CURSOR_NONE)) {
+    DispatchPointerLockError(this);
+    return;
+  }
+
+  aElement->SetPointerLock();
+  nsEventStateManager::sPointerLockedElement = do_GetWeakReference(aElement);
+  nsEventStateManager::sPointerLockedDoc =
+    do_GetWeakReference(static_cast<nsIDocument*>(this));
+  DispatchPointerLockChange(this);
+}
+
+bool
+nsDocument::ShouldLockPointer(Element* aElement)
+{
+  // Check if pointer lock pref is enabled
+  if (!Preferences::GetBool("full-screen-api.pointer-lock.enabled")) {
+    NS_WARNING("ShouldLockPointer(): Pointer Lock pref not enabled");
+    return false;
+  }
+
+  if (aElement != GetFullScreenElement()) {
+    NS_WARNING("ShouldLockPointer(): Element not in fullscreen");
+    return false;
+  }
+
+  if (!aElement->IsInDoc()) {
+    NS_WARNING("ShouldLockPointer(): Element without Document");
+    return false;
+  }
+
+  // Check if the element is in a document with a docshell.
+  nsCOMPtr<nsIDocument> ownerDoc = aElement->OwnerDoc();
+  if (!ownerDoc) {
+    return false;
+  }
+  if (!nsCOMPtr<nsISupports>(ownerDoc->GetContainer())) {
+    return false;
+  }
+  nsCOMPtr<nsPIDOMWindow> ownerWindow = ownerDoc->GetWindow();
+  if (!ownerWindow) {
+    return false;
+  }
+  nsCOMPtr<nsPIDOMWindow> ownerInnerWindow = ownerDoc->GetInnerWindow();
+  if (!ownerInnerWindow) {
+    return false;
+  }
+  if (ownerWindow->GetCurrentInnerWindow() != ownerInnerWindow) {
+    return false;
+  }
+
+  return true;
+}
+
+bool
+nsDocument::SetPointerLock(Element* aElement, int aCursorStyle)
+{
+  // NOTE: aElement will be nsnull when unlocking.
+  nsCOMPtr<nsPIDOMWindow> window = GetWindow();
+  if (!window) {
+    NS_WARNING("SetPointerLock(): No Window");
+    return false;
+  }
+
+  nsIDocShell *docShell = window->GetDocShell();
+  if (!docShell) {
+    NS_WARNING("SetPointerLock(): No DocShell (window already closed?)");
+    return false;
+  }
+
+  nsRefPtr<nsPresContext> presContext;
+  docShell->GetPresContext(getter_AddRefs(presContext));
+  if (!presContext) {
+    NS_WARNING("SetPointerLock(): Unable to get presContext in \
+                domWindow->GetDocShell()->GetPresContext()");
+    return false;
+  }
+
+  nsCOMPtr<nsIPresShell> shell = presContext->PresShell();
+  if (!shell) {
+    NS_WARNING("SetPointerLock(): Unable to find presContext->PresShell()");
+    return false;
+  }
+
+  nsIFrame* rootFrame = shell->GetRootFrame();
+  if (!rootFrame) {
+    NS_WARNING("SetPointerLock(): Unable to get root frame");
+    return false;
+  }
+
+  nsCOMPtr<nsIWidget> widget = rootFrame->GetNearestWidget();
+  if (!widget) {
+    NS_WARNING("SetPointerLock(): Unable to find widget in \
+                shell->GetRootFrame()->GetNearestWidget();");
+    return false;
+  }
+
+  if (aElement && (aElement->OwnerDoc() != this)) {
+    NS_WARNING("SetPointerLock(): Element not in this document.");
+    return false;
+  }
+
+  // Hide the cursor and set pointer lock for future mouse events
+  nsRefPtr<nsEventStateManager> esm = presContext->EventStateManager();
+  esm->SetCursor(aCursorStyle, nsnull, false,
+                 0.0f, 0.0f, widget, true);
+  esm->SetPointerLock(widget, aElement);
+
+  return true;
+}
+
+void
+nsDocument::UnlockPointer()
+{
+  if (!nsEventStateManager::sIsPointerLocked) {
+    return;
+  }
+
+  nsCOMPtr<nsIDocument> pointerLockedDoc =
+    do_QueryReferent(nsEventStateManager::sPointerLockedDoc);
+  if (!pointerLockedDoc) {
+    return;
+  }
+  nsDocument* doc = static_cast<nsDocument*>(pointerLockedDoc.get());
+  if (!doc->SetPointerLock(nsnull, NS_STYLE_CURSOR_AUTO)) {
+    return;
+  }
+
+  nsCOMPtr<Element> pointerLockedElement =
+    do_QueryReferent(nsEventStateManager::sPointerLockedElement);
+  if (!pointerLockedElement) {
+    return;
+  }
+
+  nsEventStateManager::sPointerLockedElement = nsnull;
+  nsEventStateManager::sPointerLockedDoc = nsnull;
+  pointerLockedElement->ClearPointerLock();
+  DispatchPointerLockChange(pointerLockedDoc);
+}
+
+void
+nsIDocument::UnlockPointer()
+{
+  nsDocument::UnlockPointer();
+}
+
+NS_IMETHODIMP
+nsDocument::MozExitPointerLock()
+{
+  UnlockPointer();
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDocument::GetMozPointerLockElement(nsIDOMElement** aPointerLockedElement)
+{
+  NS_ENSURE_ARG_POINTER(aPointerLockedElement);
+  *aPointerLockedElement = nsnull;
+  nsCOMPtr<Element> pointerLockedElement =
+    do_QueryReferent(nsEventStateManager::sPointerLockedElement);
+  if (!pointerLockedElement) {
+    return NS_OK;
+  }
+
+  // Make sure pointer locked element is in the same document and domain.
+  nsCOMPtr<nsIDocument> pointerLockedDoc =
+    do_QueryReferent(nsEventStateManager::sPointerLockedDoc);
+  nsDocument* doc = static_cast<nsDocument*>(pointerLockedDoc.get());
+  if (doc != this) {
+    return NS_OK;
+  }
+  nsCOMPtr<nsIDOMNode> pointerLockedNode =
+    do_QueryInterface(pointerLockedElement);
+  nsresult rv = nsContentUtils::CheckSameOrigin(this, pointerLockedNode.get());
+  if (NS_FAILED(rv)) {
+    return NS_OK;
+  }
+
+  return CallQueryInterface(pointerLockedElement, aPointerLockedElement);
+}
+
 #define EVENT(name_, id_, type_, struct_)                                 \
   NS_IMETHODIMP nsDocument::GetOn##name_(JSContext *cx, jsval *vp) {      \
     return nsINode::GetOn##name_(cx, vp);                                 \
   }                                                                       \
   NS_IMETHODIMP nsDocument::SetOn##name_(JSContext *cx, const jsval &v) { \
     return nsINode::SetOn##name_(cx, v);                                  \
   }
 #define TOUCH_EVENT EVENT
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -981,16 +981,21 @@ public:
   // Remove the top element from the full-screen stack. Removes the full-screen
   // styles from the former top element, and applies them to the new top
   // element, if there is one.
   void FullScreenStackPop();
 
   // Returns the top element from the full-screen stack.
   Element* FullScreenStackTop();
 
+  void RequestPointerLock(Element* aElement);
+  bool ShouldLockPointer(Element* aElement);
+  bool SetPointerLock(Element* aElement, int aCursorStyle);
+  static void UnlockPointer();
+
   // This method may fire a DOM event; if it does so it will happen
   // synchronously.
   void UpdateVisibilityState();
   // Posts an event to call UpdateVisibilityState
   virtual void PostVisibilityUpdateEvent();
 
   virtual void DocSizeOfExcludingThis(nsWindowSizes* aWindowSizes) const;
   // DocSizeOfIncludingThis is inherited from nsIDocument.
--- a/content/base/src/nsGenericElement.cpp
+++ b/content/base/src/nsGenericElement.cpp
@@ -3275,16 +3275,19 @@ nsGenericElement::UnbindFromTree(bool aD
       // exit full-screen state.
       nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
                                       "DOM", OwnerDoc(),
                                       nsContentUtils::eDOM_PROPERTIES,
                                       "RemovedFullScreenElement");
       // Fully exit full-screen.
       nsIDocument::ExitFullScreen(false);
     }
+    if (HasPointerLock()) {
+      nsIDocument::UnlockPointer();
+    }
     if (GetParent()) {
       NS_RELEASE(mParent);
     } else {
       mParent = nsnull;
     }
     SetParentIsContent(false);
   }
   ClearInDocument();
@@ -6451,16 +6454,23 @@ nsINode::Contains(const nsINode* aOther)
 nsresult
 nsINode::Contains(nsIDOMNode* aOther, bool* aReturn)
 {
   nsCOMPtr<nsINode> node = do_QueryInterface(aOther);
   *aReturn = Contains(node);
   return NS_OK;
 }
 
+NS_IMETHODIMP
+nsGenericElement::MozRequestPointerLock()
+{
+  OwnerDoc()->RequestPointerLock(this);
+  return NS_OK;
+}
+
 PRUint32
 nsINode::Length() const
 {
   switch (NodeType()) {
   case nsIDOMNode::DOCUMENT_TYPE_NODE:
     return 0;
 
   case nsIDOMNode::TEXT_NODE:
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -588,16 +588,18 @@ GK_ATOM(monochrome, "monochrome")
 GK_ATOM(mousedown, "mousedown")
 GK_ATOM(mousemove, "mousemove")
 GK_ATOM(mouseout, "mouseout")
 GK_ATOM(mouseover, "mouseover")
 GK_ATOM(mousethrough, "mousethrough")
 GK_ATOM(mouseup, "mouseup")
 GK_ATOM(mozfullscreenchange, "mozfullscreenchange")
 GK_ATOM(mozfullscreenerror, "mozfullscreenerror")
+GK_ATOM(mozpointerlockchange, "mozpointerlockchange")
+GK_ATOM(mozpointerlockerror, "mozpointerlockerror")
 GK_ATOM(moz_opaque, "moz-opaque")
 GK_ATOM(moz_action_hint, "mozactionhint")
 GK_ATOM(x_moz_errormessage, "x-moz-errormessage")
 GK_ATOM(msthemecompatible, "msthemecompatible")
 GK_ATOM(multicol, "multicol")
 GK_ATOM(multiple, "multiple")
 #ifdef MOZ_MEDIA
 GK_ATOM(muted, "muted")
@@ -709,16 +711,18 @@ GK_ATOM(onmouseleave, "onmouseleave")
 GK_ATOM(onmousemove, "onmousemove")
 GK_ATOM(onmouseout, "onmouseout")
 GK_ATOM(onmouseover, "onmouseover")
 GK_ATOM(onMozMouseHittest, "onMozMouseHittest")
 GK_ATOM(onmouseup, "onmouseup")
 GK_ATOM(onMozAfterPaint, "onMozAfterPaint")
 GK_ATOM(onmozfullscreenchange, "onmozfullscreenchange")
 GK_ATOM(onmozfullscreenerror, "onmozfullscreenerror")
+GK_ATOM(onmozpointerlockchange, "onmozpointerlockchange")
+GK_ATOM(onmozpointerlockerror, "onmozpointerlockerror")
 GK_ATOM(onMozMousePixelScroll, "onMozMousePixelScroll")
 GK_ATOM(onMozScrolledAreaChanged, "onMozScrolledAreaChanged")
 GK_ATOM(ononline, "ononline")
 GK_ATOM(onoffline, "onoffline")
 GK_ATOM(onopen, "onopen")
 GK_ATOM(onoverflow, "onoverflow")
 GK_ATOM(onoverflowchanged, "onoverflowchanged")
 GK_ATOM(onpagehide, "onpagehide")
--- a/content/events/public/nsEventNameList.h
+++ b/content/events/public/nsEventNameList.h
@@ -270,16 +270,24 @@ EVENT(mouseup,
 EVENT(mozfullscreenchange,
       NS_FULLSCREENCHANGE,
       EventNameType_HTML,
       NS_EVENT_NULL)
 EVENT(mozfullscreenerror,
       NS_FULLSCREENERROR,
       EventNameType_HTML,
       NS_EVENT_NULL)
+EVENT(mozpointerlockchange,
+      NS_POINTERLOCKCHANGE,
+      EventNameType_HTML,
+      NS_EVENT_NULL)
+EVENT(mozpointerlockerror,
+      NS_POINTERLOCKERROR,
+      EventNameType_HTML,
+      NS_EVENT_NULL)
 // Not supported yet; probably never because "wheel" is a better idea.
 // EVENT(mousewheel)
 EVENT(pause,
       NS_PAUSE,
       EventNameType_HTML,
       NS_EVENT_NULL)
 EVENT(play,
       NS_PLAY,
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -95,16 +95,18 @@ static const char* const sEventNames[] =
   "loadedmetadata", "loadeddata", "waiting", "playing", "canplay",
   "canplaythrough", "seeking", "seeked", "timeupdate", "ended", "ratechange",
   "durationchange", "volumechange", "MozAudioAvailable",
 #endif // MOZ_MEDIA
   "MozAfterPaint",
   "MozBeforeResize",
   "mozfullscreenchange",
   "mozfullscreenerror",
+  "mozpointerlockchange",
+  "mozpointerlockerror",
   "MozSwipeGesture",
   "MozMagnifyGestureStart",
   "MozMagnifyGestureUpdate",
   "MozMagnifyGesture",
   "MozRotateGestureStart",
   "MozRotateGestureUpdate",
   "MozRotateGesture",
   "MozTapGesture",
@@ -1165,16 +1167,20 @@ nsDOMEvent::Shutdown()
   }
 }
 
 nsIntPoint
 nsDOMEvent::GetScreenCoords(nsPresContext* aPresContext,
                             nsEvent* aEvent,
                             nsIntPoint aPoint)
 {
+  if (nsEventStateManager::sIsPointerLocked) {
+    return nsEventStateManager::sLastScreenPoint;
+  }
+
   if (!aEvent || 
        (aEvent->eventStructType != NS_MOUSE_EVENT &&
         aEvent->eventStructType != NS_POPUP_EVENT &&
         aEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
         aEvent->eventStructType != NS_MOZTOUCH_EVENT &&
         aEvent->eventStructType != NS_TOUCH_EVENT &&
         aEvent->eventStructType != NS_DRAG_EVENT &&
         aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT)) {
@@ -1220,16 +1226,20 @@ nsDOMEvent::GetPageCoords(nsPresContext*
 
 // static
 nsIntPoint
 nsDOMEvent::GetClientCoords(nsPresContext* aPresContext,
                             nsEvent* aEvent,
                             nsIntPoint aPoint,
                             nsIntPoint aDefaultPoint)
 {
+  if (nsEventStateManager::sIsPointerLocked) {
+    return nsEventStateManager::sLastClientPoint;
+  }
+
   if (!aEvent ||
       (aEvent->eventStructType != NS_MOUSE_EVENT &&
        aEvent->eventStructType != NS_POPUP_EVENT &&
        aEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
        aEvent->eventStructType != NS_MOZTOUCH_EVENT &&
        aEvent->eventStructType != NS_TOUCH_EVENT &&
        aEvent->eventStructType != NS_DRAG_EVENT &&
        aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT) ||
--- a/content/events/src/nsDOMEvent.h
+++ b/content/events/src/nsDOMEvent.h
@@ -178,16 +178,18 @@ public:
     eDOMEvents_durationchange,
     eDOMEvents_volumechange,
     eDOMEvents_mozaudioavailable,
 #endif
     eDOMEvents_afterpaint,
     eDOMEvents_beforeresize,
     eDOMEvents_mozfullscreenchange,
     eDOMEvents_mozfullscreenerror,
+    eDOMEvents_mozpointerlockchange,
+    eDOMEvents_mozpointerlockerror,
     eDOMEvents_MozSwipeGesture,
     eDOMEvents_MozMagnifyGestureStart,
     eDOMEvents_MozMagnifyGestureUpdate,
     eDOMEvents_MozMagnifyGesture,
     eDOMEvents_MozRotateGestureStart,
     eDOMEvents_MozRotateGestureUpdate,
     eDOMEvents_MozRotateGesture,
     eDOMEvents_MozTapGesture,
--- a/content/events/src/nsDOMMouseEvent.cpp
+++ b/content/events/src/nsDOMMouseEvent.cpp
@@ -228,16 +228,34 @@ nsDOMMouseEvent::GetRelatedTarget(nsIDOM
       }
     }
 
     CallQueryInterface(relatedTarget, aRelatedTarget);
   }
   return NS_OK;
 }
 
+NS_IMETHODIMP
+nsDOMMouseEvent::GetMozMovementX(PRInt32* aMovementX)
+{
+  NS_ENSURE_ARG_POINTER(aMovementX);
+  *aMovementX = GetMovementPoint().x;
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsDOMMouseEvent::GetMozMovementY(PRInt32* aMovementY)
+{
+  NS_ENSURE_ARG_POINTER(aMovementY);
+  *aMovementY = GetMovementPoint().y;
+
+  return NS_OK;
+}
+
 NS_METHOD nsDOMMouseEvent::GetScreenX(PRInt32* aScreenX)
 {
   NS_ENSURE_ARG_POINTER(aScreenX);
   *aScreenX = nsDOMEvent::GetScreenCoords(mPresContext,
                                           mEvent,
                                           mEvent->refPoint).x;
   return NS_OK;
 }
--- a/content/events/src/nsDOMUIEvent.cpp
+++ b/content/events/src/nsDOMUIEvent.cpp
@@ -44,25 +44,27 @@
 #include "nsIPresShell.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMNode.h"
 #include "nsIContent.h"
 #include "nsContentUtils.h"
 #include "nsEventStateManager.h"
 #include "nsIFrame.h"
-#include "nsLayoutUtils.h"
 #include "nsIScrollableFrame.h"
 #include "DictionaryHelpers.h"
 
 nsDOMUIEvent::nsDOMUIEvent(nsPresContext* aPresContext, nsGUIEvent* aEvent)
   : nsDOMEvent(aPresContext, aEvent ?
                static_cast<nsEvent *>(aEvent) :
                static_cast<nsEvent *>(new nsUIEvent(false, 0, 0)))
   , mClientPoint(0, 0), mLayerPoint(0, 0), mPagePoint(0, 0)
+  , mIsPointerLocked(nsEventStateManager::sIsPointerLocked)
+  , mLastScreenPoint(nsEventStateManager::sLastScreenPoint)
+  , mLastClientPoint(nsEventStateManager::sLastClientPoint)
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
@@ -119,65 +121,63 @@ NS_IMPL_RELEASE_INHERITED(nsDOMUIEvent, 
 DOMCI_DATA(UIEvent, nsDOMUIEvent)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMUIEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMUIEvent)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(UIEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
 
 nsIntPoint
-nsDOMUIEvent::GetScreenPoint()
+nsDOMUIEvent::GetMovementPoint()
 {
-  if (!mEvent || 
+  if (!mEvent ||
        (mEvent->eventStructType != NS_MOUSE_EVENT &&
         mEvent->eventStructType != NS_POPUP_EVENT &&
         mEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
         mEvent->eventStructType != NS_MOZTOUCH_EVENT &&
         mEvent->eventStructType != NS_DRAG_EVENT &&
         mEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT)) {
     return nsIntPoint(0, 0);
   }
 
-  if (!((nsGUIEvent*)mEvent)->widget ) {
-    return mEvent->refPoint;
+  if (!((nsGUIEvent*)mEvent)->widget) {
+    return mEvent->lastRefPoint;
   }
 
-  nsIntPoint offset = mEvent->refPoint + 
+  // Calculate the delta between the previous screen point and the current one.
+  nsIntPoint currentPoint = CalculateScreenPoint(mPresContext, mEvent);
+
+  // Adjust previous event's refPoint so it compares to current screenX, screenY
+  nsIntPoint offset = mEvent->lastRefPoint +
     ((nsGUIEvent*)mEvent)->widget->WidgetToScreenOffset();
   nscoord factor = mPresContext->DeviceContext()->UnscaledAppUnitsPerDevPixel();
-  return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor),
-                    nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));
+  nsIntPoint lastPoint = nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor),
+                                    nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));
+
+  return currentPoint - lastPoint;
+}
+
+nsIntPoint
+nsDOMUIEvent::GetScreenPoint()
+{
+  if (mIsPointerLocked) {
+    return mLastScreenPoint;
+  }
+
+  return CalculateScreenPoint(mPresContext, mEvent);
 }
 
 nsIntPoint
 nsDOMUIEvent::GetClientPoint()
 {
-  if (!mEvent ||
-      (mEvent->eventStructType != NS_MOUSE_EVENT &&
-       mEvent->eventStructType != NS_POPUP_EVENT &&
-       mEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
-       mEvent->eventStructType != NS_MOZTOUCH_EVENT &&
-       mEvent->eventStructType != NS_DRAG_EVENT &&
-       mEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT) ||
-      !mPresContext ||
-      !((nsGUIEvent*)mEvent)->widget) {
-    return mClientPoint;
+  if (mIsPointerLocked) {
+    return mLastClientPoint;
   }
 
-  nsPoint pt(0, 0);
-  nsIPresShell* shell = mPresContext->GetPresShell();
-  if (!shell) {
-    return nsIntPoint(0, 0);
-  }
-  nsIFrame* rootFrame = shell->GetRootFrame();
-  if (rootFrame)
-    pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(mEvent, rootFrame);
-
-  return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(pt.x),
-                    nsPresContext::AppUnitsToIntCSSPixels(pt.y));
+  return CalculateClientPoint(mPresContext, mEvent, &mClientPoint);
 }
 
 NS_IMETHODIMP
 nsDOMUIEvent::GetView(nsIDOMWindow** aView)
 {
   *aView = mView;
   NS_IF_ADDREF(*aView);
   return NS_OK;
--- a/content/events/src/nsDOMUIEvent.h
+++ b/content/events/src/nsDOMUIEvent.h
@@ -36,16 +36,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsDOMUIEvent_h
 #define nsDOMUIEvent_h
 
 #include "nsIDOMUIEvent.h"
 #include "nsDOMEvent.h"
+#include "nsLayoutUtils.h"
 
 class nsDOMUIEvent : public nsDOMEvent,
                      public nsIDOMUIEvent
 {
 public:
   nsDOMUIEvent(nsPresContext* aPresContext, nsGUIEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
@@ -61,20 +62,77 @@ public:
   
   // Forward to nsDOMEvent
   NS_FORWARD_TO_NSDOMEVENT
 
   NS_FORWARD_NSIDOMNSEVENT(nsDOMEvent::)
 
   virtual nsresult InitFromCtor(const nsAString& aType,
                                 JSContext* aCx, jsval* aVal);
+
+  static nsIntPoint CalculateScreenPoint(nsPresContext* aPresContext,
+                                         nsEvent* aEvent)
+  {
+    if (!aEvent ||
+        (aEvent->eventStructType != NS_MOUSE_EVENT &&
+         aEvent->eventStructType != NS_POPUP_EVENT &&
+         aEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
+         aEvent->eventStructType != NS_MOZTOUCH_EVENT &&
+         aEvent->eventStructType != NS_DRAG_EVENT &&
+         aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT)) {
+      return nsIntPoint(0, 0);
+    }
+
+    if (!((nsGUIEvent*)aEvent)->widget ) {
+      return aEvent->refPoint;
+    }
+
+    nsIntPoint offset = aEvent->refPoint +
+                        ((nsGUIEvent*)aEvent)->widget->WidgetToScreenOffset();
+    nscoord factor = aPresContext->DeviceContext()->UnscaledAppUnitsPerDevPixel();
+    return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor),
+                      nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));
+  }
+
+  static nsIntPoint CalculateClientPoint(nsPresContext* aPresContext,
+                                         nsEvent* aEvent,
+                                         nsIntPoint* aDefaultClientPoint)
+  {
+    if (!aEvent ||
+        (aEvent->eventStructType != NS_MOUSE_EVENT &&
+         aEvent->eventStructType != NS_POPUP_EVENT &&
+         aEvent->eventStructType != NS_MOUSE_SCROLL_EVENT &&
+         aEvent->eventStructType != NS_MOZTOUCH_EVENT &&
+         aEvent->eventStructType != NS_DRAG_EVENT &&
+         aEvent->eventStructType != NS_SIMPLE_GESTURE_EVENT) ||
+        !aPresContext ||
+        !((nsGUIEvent*)aEvent)->widget) {
+      return (nsnull == aDefaultClientPoint ? nsIntPoint(0, 0) :
+        nsIntPoint(aDefaultClientPoint->x, aDefaultClientPoint->y));
+    }
+
+    nsPoint pt(0, 0);
+    nsIPresShell* shell = aPresContext->GetPresShell();
+    if (!shell) {
+      return nsIntPoint(0, 0);
+    }
+    nsIFrame* rootFrame = shell->GetRootFrame();
+    if (rootFrame) {
+      pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame);
+    }
+
+    return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(pt.x),
+                      nsPresContext::AppUnitsToIntCSSPixels(pt.y));
+  }
+
 protected:
   // Internal helper functions
   nsIntPoint GetScreenPoint();
   nsIntPoint GetClientPoint();
+  nsIntPoint GetMovementPoint();
   nsIntPoint GetLayerPoint();
   nsIntPoint GetPagePoint();
 
   // Allow specializations.
   virtual nsresult Which(PRUint32* aWhich)
   {
     NS_ENSURE_ARG_POINTER(aWhich);
     // Usually we never reach here, as this is reimplemented for mouse and keyboard events.
@@ -83,15 +141,19 @@ protected:
   }
 
   nsCOMPtr<nsIDOMWindow> mView;
   PRInt32 mDetail;
   nsIntPoint mClientPoint;
   // Screenpoint is mEvent->refPoint.
   nsIntPoint mLayerPoint;
   nsIntPoint mPagePoint;
+  nsIntPoint mMovement;
+  bool mIsPointerLocked;
+  nsIntPoint mLastScreenPoint;
+  nsIntPoint mLastClientPoint;
 };
 
 #define NS_FORWARD_TO_NSDOMUIEVENT \
   NS_FORWARD_NSIDOMUIEVENT(nsDOMUIEvent::) \
   NS_FORWARD_TO_NSDOMEVENT
 
 #endif // nsDOMUIEvent_h
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -132,16 +132,18 @@
 #include "mozilla/Services.h"
 #include "mozAutoDocUpdate.h"
 #include "nsHTMLLabelElement.h"
 
 #include "mozilla/Preferences.h"
 #include "mozilla/LookAndFeel.h"
 #include "sampler.h"
 
+#include "nsIDOMClientRect.h"
+
 #ifdef XP_MACOSX
 #import <ApplicationServices/ApplicationServices.h>
 #endif
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 //#define DEBUG_DOCSHELL_FOCUS
@@ -154,16 +156,25 @@ static bool sLeftClickOnly = true;
 static bool sKeyCausesActivation = true;
 static PRUint32 sESMInstanceCount = 0;
 static PRInt32 sChromeAccessModifier = 0, sContentAccessModifier = 0;
 PRInt32 nsEventStateManager::sUserInputEventDepth = 0;
 bool nsEventStateManager::sNormalLMouseEventInProcess = false;
 nsEventStateManager* nsEventStateManager::sActiveESM = nsnull;
 nsIDocument* nsEventStateManager::sMouseOverDocument = nsnull;
 nsWeakFrame nsEventStateManager::sLastDragOverFrame = nsnull;
+nsIntPoint nsEventStateManager::sLastRefPoint = nsIntPoint(0,0);
+nsIntPoint nsEventStateManager::sLastScreenOffset = nsIntPoint(0,0);
+nsIntPoint nsEventStateManager::sLastScreenPoint = nsIntPoint(0,0);
+nsIntPoint nsEventStateManager::sLastClientPoint = nsIntPoint(0,0);
+bool nsEventStateManager::sIsPointerLocked = false;
+// Reference to the pointer locked element.
+nsWeakPtr nsEventStateManager::sPointerLockedElement;
+// Reference to the document which requested pointer lock.
+nsWeakPtr nsEventStateManager::sPointerLockedDoc;
 nsCOMPtr<nsIContent> nsEventStateManager::sDragOverContent = nsnull;
 
 static PRUint32 gMouseOrKeyboardEventCounter = 0;
 static nsITimer* gUserInteractionTimer = nsnull;
 static nsITimerCallback* gUserInteractionTimerCallback = nsnull;
 
 // Pixel scroll accumulation for synthetic line scrolls
 static nscoord gPixelScrollDeltaX = 0;
@@ -767,16 +778,17 @@ nsMouseWheelTransaction::LimitToOnePageS
 }
 
 /******************************************************************/
 /* nsEventStateManager                                            */
 /******************************************************************/
 
 nsEventStateManager::nsEventStateManager()
   : mLockCursor(0),
+    mPreLockPoint(0,0),
     mCurrentTarget(nsnull),
     mLastMouseOverFrame(nsnull),
     // init d&d gesture state machine variables
     mGestureDownPoint(0,0),
     mPresContext(nsnull),
     mLClickCount(0),
     mMClickCount(0),
     mRClickCount(0),
@@ -1041,16 +1053,33 @@ nsEventStateManager::PreHandleEvent(nsPr
   mCurrentTarget = aTargetFrame;
   mCurrentTargetContent = nsnull;
 
   // Focus events don't necessarily need a frame.
   if (NS_EVENT_NEEDS_FRAME(aEvent)) {
     NS_ASSERTION(mCurrentTarget, "mCurrentTarget is null.  this should not happen.  see bug #13007");
     if (!mCurrentTarget) return NS_ERROR_NULL_POINTER;
   }
+#ifdef DEBUG
+  if (NS_IS_DRAG_EVENT(aEvent) && sIsPointerLocked) {
+    NS_ASSERTION(sIsPointerLocked,
+      "sIsPointerLocked is true. Drag events should be suppressed when the pointer is locked.");
+  }
+#endif
+  // Store last known screenPoint and clientPoint so pointer lock
+  // can use these values as constants.
+  if (NS_IS_TRUSTED_EVENT(aEvent) &&
+      (NS_IS_MOUSE_EVENT_STRUCT(aEvent) &&
+       IsMouseEventReal(aEvent)) ||
+       aEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) {
+    if (!sIsPointerLocked) {
+      sLastScreenPoint = nsDOMUIEvent::CalculateScreenPoint(aPresContext, aEvent);
+      sLastClientPoint = nsDOMUIEvent::CalculateClientPoint(aPresContext, aEvent, nsnull);
+    }
+  }
 
   // Do not take account NS_MOUSE_ENTER/EXIT so that loading a page
   // when user is not active doesn't change the state to active.
   if (NS_IS_TRUSTED_EVENT(aEvent) &&
       ((aEvent->eventStructType == NS_MOUSE_EVENT  &&
         IsMouseEventReal(aEvent) &&
         aEvent->message != NS_MOUSE_ENTER &&
         aEvent->message != NS_MOUSE_EXIT) ||
@@ -3774,16 +3803,35 @@ public:
   nsCOMPtr<nsIContent> mTarget;
 };
 
 nsIFrame*
 nsEventStateManager::DispatchMouseEvent(nsGUIEvent* aEvent, PRUint32 aMessage,
                                         nsIContent* aTargetContent,
                                         nsIContent* aRelatedContent)
 {
+  // http://dvcs.w3.org/hg/webevents/raw-file/default/mouse-lock.html#methods
+  // "[When the mouse is locked on an element...e]vents that require the concept
+  // of a mouse cursor must not be dispatched (for example: mouseover, mouseout).
+  if (sIsPointerLocked &&
+      (aMessage == NS_MOUSELEAVE ||
+       aMessage == NS_MOUSEENTER ||
+       aMessage == NS_MOUSE_ENTER_SYNTH ||
+       aMessage == NS_MOUSE_EXIT_SYNTH)) {
+    mCurrentTargetContent = nsnull;
+    nsCOMPtr<Element> pointerLockedElement =
+      do_QueryReferent(nsEventStateManager::sPointerLockedElement);
+    if (!pointerLockedElement) {
+      NS_WARNING("Should have pointer locked element, but didn't.");
+      return nsnull;
+    }
+    nsCOMPtr<nsIContent> content = do_QueryInterface(pointerLockedElement);
+    return mPresContext->GetPrimaryFrameFor(content);
+  }
+
   SAMPLE_LABEL("Input", "DispatchMouseEvent");
   nsEventStatus status = nsEventStatus_eIgnore;
   nsMouseEvent event(NS_IS_TRUSTED_EVENT(aEvent), aMessage, aEvent->widget,
                      nsMouseEvent::eReal);
   event.refPoint = aEvent->refPoint;
   event.isShift = ((nsMouseEvent*)aEvent)->isShift;
   event.isControl = ((nsMouseEvent*)aEvent)->isControl;
   event.isAlt = ((nsMouseEvent*)aEvent)->isAlt;
@@ -3984,16 +4032,36 @@ nsEventStateManager::GenerateMouseEnterE
     return;
 
   // Hold onto old target content through the event and reset after.
   nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
 
   switch(aEvent->message) {
   case NS_MOUSE_MOVE:
     {
+      if (sIsPointerLocked && aEvent->widget) {
+        // Perform mouse lock by recentering the mouse directly, then remembering the deltas.
+        nsIntRect bounds;
+        aEvent->widget->GetScreenBounds(bounds);
+        aEvent->lastRefPoint = GetMouseCoords(bounds);
+
+        // refPoint should not be the centre on mousemove
+        if (aEvent->refPoint.x == aEvent->lastRefPoint.x &&
+            aEvent->refPoint.y == aEvent->lastRefPoint.y) {
+          aEvent->refPoint = sLastRefPoint;
+        } else {
+          aEvent->widget->SynthesizeNativeMouseMove(aEvent->lastRefPoint);
+        }
+      } else {
+        aEvent->lastRefPoint = nsIntPoint(sLastRefPoint.x, sLastRefPoint.y);
+      }
+
+      // Update the last known refPoint with the current refPoint.
+      sLastRefPoint = nsIntPoint(aEvent->refPoint.x, aEvent->refPoint.y);
+
       // Get the target content target (mousemove target == mouseover target)
       nsCOMPtr<nsIContent> targetElement = GetEventTargetContent(aEvent);
       if (!targetElement) {
         // We're always over the document root, even if we're only
         // over dead space in a page (whose frame is not associated with
         // any content) or in print preview dead space
         targetElement = mDocument->GetRootElement();
       }
@@ -4020,16 +4088,89 @@ nsEventStateManager::GenerateMouseEnterE
     break;
   }
 
   // reset mCurretTargetContent to what it was
   mCurrentTargetContent = targetBeforeEvent;
 }
 
 void
+nsEventStateManager::SetPointerLock(nsIWidget* aWidget,
+                                    nsIContent* aElement)
+{
+  // NOTE: aElement will be nsnull when unlocking.
+  sIsPointerLocked = !!aElement;
+
+  if (!aWidget) {
+    return;
+  }
+
+  // Reset mouse wheel transaction
+  nsMouseWheelTransaction::EndTransaction();
+
+  // Deal with DnD events
+  nsCOMPtr<nsIDragService> dragService =
+    do_GetService("@mozilla.org/widget/dragservice;1");
+
+  if (sIsPointerLocked) {
+    // Store the last known ref point so we can reposition the pointer after unlock.
+    mPreLockPoint = sLastRefPoint + sLastScreenOffset;
+
+    nsIntRect bounds;
+    aWidget->GetScreenBounds(bounds);
+    sLastRefPoint = GetMouseCoords(bounds);
+    aWidget->SynthesizeNativeMouseMove(sLastRefPoint);
+
+    // Retarget all events to this element via capture.
+    nsIPresShell::SetCapturingContent(aElement, CAPTURE_POINTERLOCK);
+
+    // Suppress DnD
+    if (dragService) {
+      dragService->Suppress();
+    }
+  } else {
+    // Unlocking, so return pointer to the original position
+    aWidget->SynthesizeNativeMouseMove(sLastScreenPoint);
+
+    // Don't retarget events to this element any more.
+    nsIPresShell::SetCapturingContent(nsnull, CAPTURE_POINTERLOCK);
+
+    // Unsuppress DnD
+    if (dragService) {
+      dragService->Unsuppress();
+    }
+  }
+}
+
+nsIntPoint
+nsEventStateManager::GetMouseCoords(nsIntRect aBounds)
+{
+  NS_ASSERTION(sIsPointerLocked, "GetMouseCoords when not pointer locked!");
+
+  nsCOMPtr<nsIDocument> pointerLockedDoc =
+    do_QueryReferent(nsEventStateManager::sPointerLockedDoc);
+  if (!pointerLockedDoc) {
+    NS_WARNING("GetMouseCoords(): No Document");
+    return nsIntPoint(0, 0);
+  }
+
+  nsCOMPtr<nsPIDOMWindow> domWin = pointerLockedDoc->GetInnerWindow();
+  if (!domWin) {
+    NS_WARNING("GetMouseCoords(): No Window");
+    return nsIntPoint(0, 0);
+  }
+
+  int innerHeight;
+  domWin->GetInnerHeight(&innerHeight);
+
+  return nsIntPoint((aBounds.width / 2) + aBounds.x,
+                    (innerHeight / 2) + (aBounds.y + (aBounds.height - innerHeight)));
+}
+
+void
 nsEventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
                                                nsGUIEvent* aEvent)
 {
   //Hold onto old target content through the event and reset after.
   nsCOMPtr<nsIContent> targetBeforeEvent = mCurrentTargetContent;
 
   switch(aEvent->message) {
   case NS_DRAGDROP_OVER:
--- a/content/events/src/nsEventStateManager.h
+++ b/content/events/src/nsEventStateManager.h
@@ -223,16 +223,22 @@ public:
   static void SetActiveManager(nsEventStateManager* aNewESM,
                                nsIContent* aContent);
 
   // Sets the full-screen event state on aElement to aIsFullScreen.
   static void SetFullScreenState(mozilla::dom::Element* aElement, bool aIsFullScreen);
 
   static bool IsRemoteTarget(nsIContent* aTarget);
 
+  static nsIntPoint sLastScreenPoint;
+  static nsIntPoint sLastClientPoint;
+  static bool sIsPointerLocked;
+  static nsWeakPtr sPointerLockedElement;
+  static nsWeakPtr sPointerLockedDoc;
+
 protected:
   friend class MouseEnterLeaveDispatcher;
 
   void UpdateCursor(nsPresContext* aPresContext, nsEvent* aEvent, nsIFrame* aTargetFrame, nsEventStatus* aStatus);
   /**
    * Turn a GUI mouse event into a mouse event targeted at the specified
    * content.  This returns the primary frame for the content (or null
    * if it goes away during the event).
@@ -475,21 +481,26 @@ private:
                                    bool aAddState);
   static void UpdateAncestorState(nsIContent* aStartNode,
                                   nsIContent* aStopBefore,
                                   nsEventStates aState,
                                   bool aAddState);
 
   PRInt32     mLockCursor;
 
+  // Point when mouse was locked, used to reposition after unlocking.
+  nsIntPoint  mPreLockPoint;
+
   nsWeakFrame mCurrentTarget;
   nsCOMPtr<nsIContent> mCurrentTargetContent;
   nsWeakFrame mLastMouseOverFrame;
   nsCOMPtr<nsIContent> mLastMouseOverElement;
   static nsWeakFrame sLastDragOverFrame;
+  static nsIntPoint sLastRefPoint;
+  static nsIntPoint sLastScreenOffset;
 
   // member variables for the d&d gesture state machine
   nsIntPoint mGestureDownPoint; // screen coordinates
   // The content to use as target if we start a d&d (what we drag).
   nsCOMPtr<nsIContent> mGestureDownContent;
   // The content of the frame where the mouse-down event occurred. It's the same
   // as the target in most cases but not always - for example when dragging
   // an <area> of an image map this is the image. (bug 289667)
@@ -551,16 +562,19 @@ public:
 
   // Functions used for click hold context menus
   bool mClickHoldContextMenu;
   nsCOMPtr<nsITimer> mClickHoldTimer;
   void CreateClickHoldTimer ( nsPresContext* aPresContext, nsIFrame* inDownFrame,
                               nsGUIEvent* inMouseDownEvent ) ;
   void KillClickHoldTimer ( ) ;
   void FireContextClick ( ) ;
+
+  void SetPointerLock(nsIWidget* aWidget, nsIContent* aElement) ;
+  nsIntPoint GetMouseCoords(nsIntRect aBounds);
   static void sClickHoldCallback ( nsITimer* aTimer, void* aESM ) ;
 };
 
 /**
  * This class is used while processing real user input. During this time, popups
  * are allowed. For mousedown events, mouse capturing is also permitted.
  */
 class nsAutoHandlingUserInputStatePusher
--- a/content/html/content/test/test_fullscreen-api.html
+++ b/content/html/content/test/test_fullscreen-api.html
@@ -43,16 +43,18 @@ var gTestWindows = [
   "file_fullscreen-hidden.html",
   "file_fullscreen-svg-element.html",
   "file_fullscreen-navigation.html"
 ];
 
 var testWindow = null;
 var gTestIndex = 0;
 
+// TODO: if ever we remove these checks for XP and Lion, we should do the same
+// in dom/tests/mochitest/pointerlock/test_pointerlock-api.html, which uses the same pattern.
 const isWinXP = navigator.userAgent.indexOf("Windows NT 5.1") != -1;
 const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
 
 function nextTest() {
   if (isWinXP) {
     todo(false, "Can't reliably run full-screen tests on Windows XP due to bug 704010");
     SimpleTest.finish();
     return;
--- a/dom/interfaces/core/nsIDOMDocument.idl
+++ b/dom/interfaces/core/nsIDOMDocument.idl
@@ -61,17 +61,17 @@ interface nsIDOMLocation;
  * cannot exist outside the context of a Document, the nsIDOMDocument 
  * interface also contains the factory methods needed to create these 
  * objects.
  *
  * For more information on this interface please see 
  * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
  */
 
-[scriptable, uuid(ac4942fe-1679-4000-aaa7-41dee590a120)]
+[scriptable, uuid(FDB92F4F-C6B4-4509-A29D-A309981E28AC)]
 interface nsIDOMDocument : nsIDOMNode
 {
   readonly attribute nsIDOMDocumentType         doctype;
   readonly attribute nsIDOMDOMImplementation    implementation;
   readonly attribute nsIDOMElement              documentElement;
   nsIDOMElement                 createElement(in DOMString tagName)
                                   raises(DOMException);
   nsIDOMDocumentFragment        createDocumentFragment();
@@ -392,16 +392,31 @@ interface nsIDOMDocument : nsIDOMNode
    * plugins are present, and all ancestor documents have the
    * mozallowfullscreen attribute set.
    *
    * @see <https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI>
    */
   readonly attribute boolean mozFullScreenEnabled;
 
   /**
+   * The element to which the mouse pointer is locked, if any, as per the
+   * DOM pointer lock api.
+   *
+   * @see <http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html>
+   */
+  readonly attribute nsIDOMElement mozPointerLockElement;
+
+  /**
+   * Exit pointer is lock if locked, as per the DOM pointer lock api.
+   *
+   * @see <http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html>
+   */
+  void mozExitPointerLock();
+
+  /**
    * Inline event handler for readystatechange events.
    */
   [implicit_jscontext] attribute jsval onreadystatechange;
 
   [implicit_jscontext] attribute jsval onmouseenter;
   [implicit_jscontext] attribute jsval onmouseleave;
 
   /**
--- a/dom/interfaces/core/nsIDOMElement.idl
+++ b/dom/interfaces/core/nsIDOMElement.idl
@@ -44,17 +44,17 @@
 /**
  * The nsIDOMElement interface represents an element in an HTML or 
  * XML document. 
  *
  * For more information on this interface please see 
  * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-element
  */
 
-[scriptable, uuid(295e05d9-9174-48ae-bc59-d7e6a8757726)]
+[scriptable, uuid(69D44CE2-B544-49A8-BB5F-87804B971EE4)]
 interface nsIDOMElement : nsIDOMNode
 {
   readonly attribute DOMString        tagName;
 
   /**
    * Returns a DOMTokenList object reflecting the class attribute.
    */
   readonly attribute nsIDOMDOMTokenList classList;
@@ -223,9 +223,17 @@ interface nsIDOMElement : nsIDOMNode
   // Mozilla extensions
   /**
    * Requests that this element be made the full-screen element, as per the DOM
    * full-screen api.
    *
    * @see <https://wiki.mozilla.org/index.php?title=Gecko:FullScreenAPI>
    */
   void mozRequestFullScreen();
+
+  /**
+   * Requests that this element be made the pointer-locked element, as per the DOM
+   * pointer lock api.
+   *
+   * @see <http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html>
+   */
+  void mozRequestPointerLock();
 };
--- a/dom/interfaces/core/nsIDOMXMLDocument.idl
+++ b/dom/interfaces/core/nsIDOMXMLDocument.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMDocument.idl"
 
-[scriptable, uuid(2ba0cbad-d03e-424d-a47f-560541192bc3)]
+[scriptable, uuid(18C55EFC-560B-4BDD-9776-A8D239EF7052)]
 interface nsIDOMXMLDocument : nsIDOMDocument
 {
   // DOM Level 3 Load & Save, DocumentLS
   // http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS
   /**
    * Whether to load synchronously or asynchronously.
    * The default is async==true.
    */
--- a/dom/interfaces/core/nsIInlineEventHandlers.idl
+++ b/dom/interfaces/core/nsIInlineEventHandlers.idl
@@ -77,16 +77,18 @@ interface nsIInlineEventHandlers : nsISu
   [implicit_jscontext] attribute jsval onmousemove;
   [implicit_jscontext] attribute jsval onmouseout;
   [implicit_jscontext] attribute jsval onmouseover;
   [implicit_jscontext] attribute jsval onmouseup;
   // Not supported yet
   // [implicit_jscontext] attribute jsval onmousewheel;
   [implicit_jscontext] attribute jsval onmozfullscreenchange;
   [implicit_jscontext] attribute jsval onmozfullscreenerror;
+  [implicit_jscontext] attribute jsval onmozpointerlockchange;
+  [implicit_jscontext] attribute jsval onmozpointerlockerror;
   [implicit_jscontext] attribute jsval onpause;
   [implicit_jscontext] attribute jsval onplay;
   [implicit_jscontext] attribute jsval onplaying;
   [implicit_jscontext] attribute jsval onprogress;
   [implicit_jscontext] attribute jsval onratechange;
   [implicit_jscontext] attribute jsval onreset;
   [implicit_jscontext] attribute jsval onscroll;
   [implicit_jscontext] attribute jsval onseeked;
--- a/dom/interfaces/events/nsIDOMMouseEvent.idl
+++ b/dom/interfaces/events/nsIDOMMouseEvent.idl
@@ -43,22 +43,25 @@
 /**
  * The nsIDOMMouseEvent interface is the datatype for all mouse events
  * in the Document Object Model.
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/DOM-Level-2-Events/
  */
 
-[scriptable, uuid(7f57aa45-6792-4d8b-ba5b-201533cf0b2f)]
+[scriptable, uuid(53E29996-F851-4032-B896-8AAFBD0BDF25)]
 interface nsIDOMMouseEvent : nsIDOMUIEvent
 {
   readonly attribute long               screenX;
   readonly attribute long               screenY;
 
+  readonly attribute long               mozMovementX;
+  readonly attribute long               mozMovementY;
+
   readonly attribute long               clientX;
   readonly attribute long               clientY;
 
   readonly attribute boolean            ctrlKey;
   readonly attribute boolean            shiftKey;
   readonly attribute boolean            altKey;
   readonly attribute boolean            metaKey;
 
--- a/dom/interfaces/html/nsIDOMHTMLAnchorElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLAnchorElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(8ca68d9c-1701-47e0-87d4-ddf9d36609a2)]
+[scriptable, uuid(68F49F8F-5FFD-44EB-A59F-D2B3F4817299)]
 interface nsIDOMHTMLAnchorElement : nsIDOMHTMLElement
 {
            attribute DOMString        href;
            attribute DOMString        target;
 
            attribute DOMString        ping;
 
            attribute DOMString        rel;
--- a/dom/interfaces/html/nsIDOMHTMLAppletElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLAppletElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(27b49244-7752-43d4-8f2c-e22f26ebea0e)]
+[scriptable, uuid(F3D34247-A6E9-416A-AE37-761E26A3881E)]
 interface nsIDOMHTMLAppletElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
            attribute DOMString        alt;
            attribute DOMString        archive;
            attribute DOMString        code;
            attribute DOMString        codeBase;
            attribute DOMString        height;
--- a/dom/interfaces/html/nsIDOMHTMLAreaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLAreaElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(eaf79702-058c-4a02-b5e5-5606b3d60255)]
+[scriptable, uuid(D3043539-158A-43EC-B845-175B5726AEB7)]
 interface nsIDOMHTMLAreaElement : nsIDOMHTMLElement
 {
            attribute DOMString        alt;
            attribute DOMString        coords;
            attribute DOMString        shape;
            attribute DOMString        href;
            attribute DOMString        target;
 
--- a/dom/interfaces/html/nsIDOMHTMLAudioElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLAudioElement.idl
@@ -47,17 +47,17 @@
  * <audio> element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#audio
  *
  * @status UNDER_DEVELOPMENT
  */
 
-[scriptable, uuid(ecf4ed75-83b0-4a96-af11-d6cefab59dc0)]
+[scriptable, uuid(D5844B73-30E2-46D5-894C-108967E05C80)]
 interface nsIDOMHTMLAudioElement : nsIDOMHTMLMediaElement
 {
   // Setup the audio stream for writing
   void mozSetup(in PRUint32 channels, in PRUint32 rate);
 
   // Write audio to the audio stream
   [implicit_jscontext]
   unsigned long mozWriteAudio(in jsval data);
--- a/dom/interfaces/html/nsIDOMHTMLBRElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLBRElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(b0cde271-9773-43dd-a5c4-22159bd6addb)]
+[scriptable, uuid(11D1C93A-9538-4BE3-8E90-372E25AB9D61)]
 interface nsIDOMHTMLBRElement : nsIDOMHTMLElement
 {
            attribute DOMString        clear;
 };
--- a/dom/interfaces/html/nsIDOMHTMLBaseElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLBaseElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(66a5612b-66e4-4455-b805-6df735889e8d)]
+[scriptable, uuid(CC18F6D7-560F-485E-BC37-23354B2384F4)]
 interface nsIDOMHTMLBaseElement : nsIDOMHTMLElement
 {
            attribute DOMString        href;
            attribute DOMString        target;
 };
--- a/dom/interfaces/html/nsIDOMHTMLBodyElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLBodyElement.idl
@@ -49,17 +49,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(9b4bd03e-cc71-4fab-b0b8-51156c666cb4)]
+[scriptable, uuid(D8F00C8B-D317-4DF2-A9BF-4A1E6F19F945)]
 interface nsIDOMHTMLBodyElement : nsIDOMHTMLElement
 {
            attribute DOMString        aLink;
            attribute DOMString        background;
            attribute DOMString        bgColor;
            attribute DOMString        link;
            attribute DOMString        text;
            attribute DOMString        vLink;
--- a/dom/interfaces/html/nsIDOMHTMLButtonElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLButtonElement.idl
@@ -47,17 +47,17 @@
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
 interface nsIDOMValidityState;
 
-[scriptable, uuid(6b78685d-1ef4-4d89-9d6b-823c3dac361f)]
+[scriptable, uuid(8E40D4D7-C204-4192-802A-0B5602E9C669)]
 interface nsIDOMHTMLButtonElement : nsIDOMHTMLElement
 {
            attribute boolean               autofocus;
            attribute boolean               disabled;
   readonly attribute nsIDOMHTMLFormElement form;
            attribute DOMString             formAction;
            attribute DOMString             formEnctype;
            attribute DOMString             formMethod;
--- a/dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
@@ -51,17 +51,17 @@
  *
  * @status UNDER_DEVELOPMENT
  */
 
 interface nsIDOMFile;
 interface nsIVariant;
 interface nsIInputStreamCallback;
 
-[scriptable, uuid(21296a59-25d8-45fb-8c27-290044c88922)]
+[scriptable, uuid(5929542B-C68E-48AB-84F9-D9642DA39720)]
 interface nsIDOMHTMLCanvasElement : nsIDOMHTMLElement
 {
   attribute unsigned long width;
   attribute unsigned long height;
   attribute boolean mozOpaque;
 
   nsISupports getContext(in DOMString contextId,
                          [optional] in jsval contextOptions);
--- a/dom/interfaces/html/nsIDOMHTMLCommandElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLCommandElement.idl
@@ -41,17 +41,17 @@
  * <command> element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#the-command-element
  *
  * @status UNDER_DEVELOPMENT
  */
 
-[scriptable, uuid(2ee6f391-342a-42b9-a9f6-f0f7e6d1701b)]
+[scriptable, uuid(A6963C8F-6475-4631-B7E0-41DD7DC8F388)]
 interface nsIDOMHTMLCommandElement : nsIDOMHTMLElement
 {
            attribute DOMString        type;
            attribute DOMString        label;
            attribute DOMString        icon;
            attribute boolean          disabled;
            attribute boolean          defaultChecked;
            attribute boolean          checked;
--- a/dom/interfaces/html/nsIDOMHTMLDListElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDListElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(0344a153-f2c7-4d0c-9b4c-b7616db89728)]
+[scriptable, uuid(957E223E-217A-4BBF-B6D8-D723ACFB9168)]
 interface nsIDOMHTMLDListElement : nsIDOMHTMLElement
 {
            attribute boolean          compact;
 };
--- a/dom/interfaces/html/nsIDOMHTMLDataListElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDataListElement.idl
@@ -44,14 +44,14 @@
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#the-datalist-element
  *
  * @status UNDER_DEVELOPMENT
  */
 
 interface nsIDOMHTMLCollection;
 
-[scriptable, uuid(a652777e-9ad9-4afe-861d-172f888c2f46)]
+[scriptable, uuid(EEB039A1-FD4E-41A3-805A-B367BA235DC2)]
 interface nsIDOMHTMLDataListElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLCollection options;
 };
 
--- a/dom/interfaces/html/nsIDOMHTMLDirectoryElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDirectoryElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(c60c67d6-ef9a-40ce-8608-9c837da7fbbc)]
+[scriptable, uuid(2C83A5C4-67AB-4DC5-A133-CFDAF260963C)]
 interface nsIDOMHTMLDirectoryElement : nsIDOMHTMLElement
 {
            attribute boolean          compact;
 };
--- a/dom/interfaces/html/nsIDOMHTMLDivElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDivElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(32b88969-3c24-4c4b-be73-13b29a73cc81)]
+[scriptable, uuid(A9651DAE-DBD8-4CBE-B42B-A20124C2FE6D)]
 interface nsIDOMHTMLDivElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
 };
--- a/dom/interfaces/html/nsIDOMHTMLDocument.idl
+++ b/dom/interfaces/html/nsIDOMHTMLDocument.idl
@@ -42,17 +42,17 @@
 /**
  * The nsIDOMHTMLDocument interface is the interface to a [X]HTML
  * document object.
  *
  * @see <http://www.whatwg.org/html/>
  */
 interface nsISelection;
 
-[scriptable, uuid(3dae5807-3615-4567-913f-c3956a2aa251)]
+[scriptable, uuid(1B93973F-28CC-4F33-8E7B-B89C63AA9200)]
 interface nsIDOMHTMLDocument : nsIDOMDocument
 {
   readonly attribute DOMString            URL;
            attribute DOMString            domain;
            attribute DOMString            cookie;
   // returns "BackCompat" if we're in quirks mode,
   // or "CSS1Compat" if we're in strict mode
   readonly attribute DOMString            compatMode;
--- a/dom/interfaces/html/nsIDOMHTMLElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLElement.idl
@@ -48,17 +48,17 @@ interface nsIDOMHTMLMenuElement;
  * tree.
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
-[scriptable, uuid(b5d80fa5-91bc-4b3b-b8bc-1becb563ae15)]
+[scriptable, uuid(5C8B21BC-EF6E-4599-A26F-FACC05B4ADBE)]
 interface nsIDOMHTMLElement : nsIDOMElement
 {
   // metadata attributes
            attribute DOMString        id;
            attribute DOMString        title;
            attribute DOMString        lang;
            attribute DOMString        dir;
            attribute DOMString        className;
--- a/dom/interfaces/html/nsIDOMHTMLEmbedElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLEmbedElement.idl
@@ -42,17 +42,17 @@
 /**
  * The nsIDOMHTMLEmbedElement interface is the interface to a [X]HTML
  * embed element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#the-embed-element
  */
 
-[scriptable, uuid(e4c2af44-3a99-47d7-b9b2-4ccc5c832618)]
+[scriptable, uuid(BF234467-1F2E-4A6A-A5AA-74EC86299150)]
 interface nsIDOMHTMLEmbedElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
            attribute DOMString        height;
            attribute DOMString        name;
            attribute DOMString        src;
            attribute DOMString        type;
            attribute DOMString        width;
--- a/dom/interfaces/html/nsIDOMHTMLFieldSetElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLFieldSetElement.idl
@@ -47,17 +47,17 @@
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
 interface nsIDOMValidityState;
 
-[scriptable, uuid(7b26c8d8-f802-4b04-b114-b44201000faf)]
+[scriptable, uuid(AB2F9E30-1217-4172-9A95-262480FEC534)]
 interface nsIDOMHTMLFieldSetElement : nsIDOMHTMLElement
 {
            attribute boolean                disabled;
   readonly attribute nsIDOMHTMLFormElement  form;
            attribute DOMString              name;
 
   readonly attribute DOMString              type;
 
--- a/dom/interfaces/html/nsIDOMHTMLFontElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLFontElement.idl
@@ -45,15 +45,15 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(833bb94c-5069-4d79-8228-d658d90cf970)]
+[scriptable, uuid(EFF9CEAC-BE69-4A94-9DD4-0C023DEF00B3)]
 interface nsIDOMHTMLFontElement : nsIDOMHTMLElement
 {
            attribute DOMString        color;
            attribute DOMString        face;
            attribute DOMString        size;
 };
--- a/dom/interfaces/html/nsIDOMHTMLFormElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLFormElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(13a92ac0-7b39-4a5b-8c0d-e75064646c62)]
+[scriptable, uuid(59C0DC07-D784-410B-8B5E-C26BAF7CB8A6)]
 interface nsIDOMHTMLFormElement : nsIDOMHTMLElement
 {
            attribute DOMString            acceptCharset;
            attribute DOMString            action;
            attribute DOMString            autocomplete;
            attribute DOMString            enctype;
            attribute DOMString            encoding;
            attribute DOMString            method;
--- a/dom/interfaces/html/nsIDOMHTMLFrameElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLFrameElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(1169be36-b8b6-4a8e-9456-274409fce393)]
+[scriptable, uuid(2AA7855A-0667-47C3-AF1E-9101002816C1)]
 interface nsIDOMHTMLFrameElement : nsIDOMHTMLElement
 {
            attribute DOMString        frameBorder;
            attribute DOMString        longDesc;
            attribute DOMString        marginHeight;
            attribute DOMString        marginWidth;
            attribute DOMString        name;
            attribute boolean          noResize;
--- a/dom/interfaces/html/nsIDOMHTMLFrameSetElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLFrameSetElement.idl
@@ -49,17 +49,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(1c2925dc-8374-4ed8-8981-a38445b6e4ed)]
+[scriptable, uuid(B4D06FF4-877A-4FA3-9EFB-A75D2C843520)]
 interface nsIDOMHTMLFrameSetElement : nsIDOMHTMLElement
 {
            attribute DOMString        cols;
            attribute DOMString        rows;
 
            [implicit_jscontext] attribute jsval            onafterprint;
            [implicit_jscontext] attribute jsval            onbeforeprint;
            [implicit_jscontext] attribute jsval            onbeforeunload;
--- a/dom/interfaces/html/nsIDOMHTMLHRElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLHRElement.idl
@@ -46,17 +46,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(cc836228-8f6e-4a8d-a973-3931e4660ed2)]
+[scriptable, uuid(739078CD-3251-44C9-B5F9-128C0AF23707)]
 interface nsIDOMHTMLHRElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
            attribute boolean          noShade;
            attribute DOMString        size;
            attribute DOMString        width;
            attribute DOMString        color;
 };
--- a/dom/interfaces/html/nsIDOMHTMLHeadElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLHeadElement.idl
@@ -45,12 +45,12 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(8d2107f9-d045-40eb-915b-9de87a950ce7)]
+[scriptable, uuid(8B38545F-7FA5-47D5-A902-C8EA8E78FB0D)]
 interface nsIDOMHTMLHeadElement : nsIDOMHTMLElement
 {
 };
--- a/dom/interfaces/html/nsIDOMHTMLHeadingElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLHeadingElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(ee1169f0-67d8-4f2a-af10-016ba3bf9794)]
+[scriptable, uuid(B302D445-7B7B-4B6D-9C6D-AEC30CE4F2E0)]
 interface nsIDOMHTMLHeadingElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
 };
--- a/dom/interfaces/html/nsIDOMHTMLHtmlElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLHtmlElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(f44f6721-1cb3-4a98-b458-2a1a29c25e2f)]
+[scriptable, uuid(73706343-BA89-4C80-932E-E636E5E8D8E2)]
 interface nsIDOMHTMLHtmlElement : nsIDOMHTMLElement
 {
            attribute DOMString        version;
 };
--- a/dom/interfaces/html/nsIDOMHTMLIFrameElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLIFrameElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(0ead5a5c-e4d3-4e4d-88b8-7c9dc9d2665c)]
+[scriptable, uuid(97E4F0E1-BD27-40EC-9287-5634DAF15B73)]
 interface nsIDOMHTMLIFrameElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
            attribute DOMString        frameBorder;
            attribute DOMString        height;
            attribute DOMString        longDesc;
            attribute DOMString        marginHeight;
            attribute DOMString        marginWidth;
--- a/dom/interfaces/html/nsIDOMHTMLImageElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLImageElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(cb711ec9-17e8-4259-9045-ca9ad128f62e)]
+[scriptable, uuid(AACA79C6-FC1D-4AC6-B358-C5CF9595A797)]
 interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
 {
            attribute DOMString        alt;
            attribute DOMString        src;
            attribute DOMString        crossOrigin;
            attribute DOMString        useMap;
            attribute boolean          isMap;
            attribute unsigned long    width;
--- a/dom/interfaces/html/nsIDOMHTMLInputElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLInputElement.idl
@@ -49,17 +49,17 @@ interface nsIDOMValidityState;
   *
   * This interface is trying to follow the DOM Level 2 HTML specification:
   * http://www.w3.org/TR/DOM-Level-2-HTML/
   *
   * with changes from the work-in-progress WHATWG HTML specification:
   * http://www.whatwg.org/specs/web-apps/current-work/
   */
 
-[scriptable, uuid(0c8e11b5-94f3-405a-aa1b-c5e7eec4ba4d)]
+[scriptable, uuid(05FEDF7E-3050-4143-AB97-B994F3CC9329)]
 interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
 {
            attribute DOMString             accept;
            attribute DOMString             alt;
 
            attribute DOMString             autocomplete;
            attribute boolean               autofocus;
            attribute boolean               defaultChecked;
--- a/dom/interfaces/html/nsIDOMHTMLLIElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLLIElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(f4949a2d-ca29-47a8-88f3-c83570f9e3d4)]
+[scriptable, uuid(C233D9D0-F0ED-4322-B3DB-C075711B816C)]
 interface nsIDOMHTMLLIElement : nsIDOMHTMLElement
 {
            attribute DOMString           type;
            attribute long                value;
 };
--- a/dom/interfaces/html/nsIDOMHTMLLabelElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLLabelElement.idl
@@ -45,15 +45,15 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(4e5d92a3-8f9b-438d-98d8-42a1526369be)]
+[scriptable, uuid(479F4997-6551-4F8F-AEE5-5FF6F176B0ED)]
 interface nsIDOMHTMLLabelElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLFormElement form;
            attribute DOMString             htmlFor;
   readonly attribute nsIDOMHTMLElement     control;
 };
--- a/dom/interfaces/html/nsIDOMHTMLLegendElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLLegendElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(1fbae5ab-036e-4941-8b09-754ab8f217cc)]
+[scriptable, uuid(457A1606-1FDA-4C2B-869E-050C58D9C32E)]
 interface nsIDOMHTMLLegendElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLFormElement form;
            attribute DOMString             align;
 };
--- a/dom/interfaces/html/nsIDOMHTMLLinkElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLLinkElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(36c22a1c-d53d-4e59-bb84-c8e538ba9621)]
+[scriptable, uuid(59AE3529-170A-41E4-8D7A-241DCA6B5760)]
 interface nsIDOMHTMLLinkElement : nsIDOMHTMLElement
 {
            attribute boolean          disabled;
            attribute DOMString        charset;
            attribute DOMString        href;
            attribute DOMString        hreflang;
            attribute DOMString        media;
            attribute DOMString        rel;
--- a/dom/interfaces/html/nsIDOMHTMLMapElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMapElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(39ed3fe6-1ff6-4d1d-bf77-7a10a35bfccc)]
+[scriptable, uuid(34CD4620-62BA-4264-8D29-E5007F2641A6)]
 interface nsIDOMHTMLMapElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLCollection areas;
            attribute DOMString            name;
 };
--- a/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
@@ -52,17 +52,17 @@
 
 // undef the GetCurrentTime macro defined in WinBase.h from the MS Platform SDK
 %{C++
 #ifdef GetCurrentTime
 #undef GetCurrentTime
 #endif
 %}
 
-[scriptable, uuid(60ea8009-022b-4e65-a452-054b0483182e)]
+[scriptable, uuid(02FB205D-68B5-4722-982B-1D12238FBF72)]
 interface nsIDOMHTMLMediaElement : nsIDOMHTMLElement
 {
   // error state
   readonly attribute nsIDOMMediaError error;
 
   // network state
            attribute DOMString src;
   readonly attribute DOMString currentSrc;
--- a/dom/interfaces/html/nsIDOMHTMLMenuElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMenuElement.idl
@@ -45,16 +45,16 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(be2d054e-e9cd-45bd-b075-58783cdca8a4)]
+[scriptable, uuid(8A3975C9-729A-45A5-AB20-DD2B47EE9508)]
 interface nsIDOMHTMLMenuElement : nsIDOMHTMLElement
 {
            attribute boolean          compact;
 
            attribute DOMString        type;
            attribute DOMString        label;
 };
--- a/dom/interfaces/html/nsIDOMHTMLMenuItemElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMenuItemElement.idl
@@ -38,12 +38,12 @@
 
 /**
  * The nsIDOMHTMLMenuItemElement interface is the interface to a HTML
  * <menuitem> element.
  *
  * @status UNDER_DEVELOPMENT
  */
 
-[scriptable, uuid(74ffab29-3a81-4099-8f38-55b1ad3a6988)]
+[scriptable, uuid(685E02FF-8148-4414-A0D6-319E817F3B56)]
 interface nsIDOMHTMLMenuItemElement : nsIDOMHTMLCommandElement
 {
 };
--- a/dom/interfaces/html/nsIDOMHTMLMetaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMetaElement.idl
@@ -45,16 +45,16 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(75f9f39c-7389-4acb-9100-cda379151b12)]
+[scriptable, uuid(AA3B1280-669C-43ED-8815-B60B395A8D66)]
 interface nsIDOMHTMLMetaElement : nsIDOMHTMLElement
 {
            attribute DOMString        content;
            attribute DOMString        httpEquiv;
            attribute DOMString        name;
            attribute DOMString        scheme;
 };
--- a/dom/interfaces/html/nsIDOMHTMLModElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLModElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(34cc420e-ac88-44ac-817f-6c6bf39e5dc1)]
+[scriptable, uuid(4564C9EF-795B-4080-AE48-C4527855390C)]
 interface nsIDOMHTMLModElement : nsIDOMHTMLElement
 {
            attribute DOMString        cite;
            attribute DOMString        dateTime;
 };
--- a/dom/interfaces/html/nsIDOMHTMLOListElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLOListElement.idl
@@ -45,15 +45,15 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(bdae649e-9cfd-4010-b9f6-5ff29c75aeaa)]
+[scriptable, uuid(64155DCA-83CA-4FFE-8B64-A7F82F29586F)]
 interface nsIDOMHTMLOListElement : nsIDOMHTMLElement
 {
            attribute boolean          compact;
            attribute long             start;
            attribute DOMString        type;
 };
--- a/dom/interfaces/html/nsIDOMHTMLObjectElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLObjectElement.idl
@@ -47,17 +47,17 @@
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
 interface nsIDOMValidityState;
 
-[scriptable, uuid(b85a1d53-77b8-4550-98ae-d9c4339f2ef9)]
+[scriptable, uuid(A70595DD-68A5-41F5-AB52-73A47D98BD78)]
 interface nsIDOMHTMLObjectElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLFormElement form;
            attribute DOMString             code;
            attribute DOMString             align;
            attribute DOMString             archive;
            attribute DOMString             border;
            attribute DOMString             codeBase;
--- a/dom/interfaces/html/nsIDOMHTMLOptGroupElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLOptGroupElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(466575ed-ea87-459e-931e-978877db9d41)]
+[scriptable, uuid(BEDB0D8D-030E-409A-B3B5-28DC0E0D9C34)]
 interface nsIDOMHTMLOptGroupElement : nsIDOMHTMLElement
 {
            attribute boolean          disabled;
            attribute DOMString        label;
 };
--- a/dom/interfaces/html/nsIDOMHTMLOptionElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLOptionElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(f3cbd120-a456-41bf-807e-1aa648c02363)]
+[scriptable, uuid(68A5D794-39BF-4B00-AEFE-754B9E8F7EC6)]
 interface nsIDOMHTMLOptionElement : nsIDOMHTMLElement
 {
            attribute boolean               disabled;
   readonly attribute nsIDOMHTMLFormElement form;
            attribute DOMString             label;
            attribute boolean               defaultSelected;
            attribute boolean               selected;
            attribute DOMString             value;
--- a/dom/interfaces/html/nsIDOMHTMLOutputElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLOutputElement.idl
@@ -45,17 +45,17 @@
  * http://www.whatwg.org/specs/web-apps/current-work/#the-output-element
  *
  * @status UNDER_DEVELOPMENT
  */
 
 interface nsIDOMDOMSettableTokenList;
 interface nsIDOMValidityState;
 
-[scriptable, uuid(b13de107-dd83-4b1b-8970-c25a0890e799)]
+[scriptable, uuid(01542000-CD00-4E8A-841C-9BAAD6BA0368)]
 interface nsIDOMHTMLOutputElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMDOMSettableTokenList htmlFor;
   readonly attribute nsIDOMHTMLFormElement      form;
            attribute DOMString                  name;
 
   readonly attribute DOMString                  type;
            attribute DOMString                  defaultValue;
--- a/dom/interfaces/html/nsIDOMHTMLParagraphElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLParagraphElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(c3f56887-058b-4143-ac75-de01fbd088c7)]
+[scriptable, uuid(32840748-F8A8-414C-B0DE-DD947E5B0BD0)]
 interface nsIDOMHTMLParagraphElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
 };
--- a/dom/interfaces/html/nsIDOMHTMLParamElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLParamElement.idl
@@ -45,16 +45,16 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(9e2e501c-28a0-420c-9a4d-476db717ea41)]
+[scriptable, uuid(1FBEC0F8-C7CF-4DC8-84BE-247985A65E07)]
 interface nsIDOMHTMLParamElement : nsIDOMHTMLElement
 {
            attribute DOMString        name;
            attribute DOMString        type;
            attribute DOMString        value;
            attribute DOMString        valueType;
 };
--- a/dom/interfaces/html/nsIDOMHTMLPreElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLPreElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(75825309-f449-451f-a252-c3ac83c857af)]
+[scriptable, uuid(FDAF779F-BCCA-4653-91AE-CD4D23E4CC69)]
 interface nsIDOMHTMLPreElement : nsIDOMHTMLElement
 {
            attribute long             width;
 };
--- a/dom/interfaces/html/nsIDOMHTMLProgressElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLProgressElement.idl
@@ -42,17 +42,17 @@
  * <progress> element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#the-progress-element
  *
  * @status UNDER_DEVELOPMENT
  */
 
-[scriptable, uuid(6312474b-9c6c-4eb4-8408-2a1754799e30)]
+[scriptable, uuid(842AEE33-8381-4DA4-A347-9E70C797BC3E)]
 interface nsIDOMHTMLProgressElement : nsIDOMHTMLElement
 {
            attribute double value;
            attribute double max;
   readonly attribute double position;
   readonly attribute nsIDOMHTMLFormElement form;
   /**
    * The labels attribute will be done with bug 567740.
--- a/dom/interfaces/html/nsIDOMHTMLQuoteElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLQuoteElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(e6a8a758-079c-4411-a3e5-b9c47f3e92b1)]
+[scriptable, uuid(38409533-9A85-4542-B734-BB2012966480)]
 interface nsIDOMHTMLQuoteElement : nsIDOMHTMLElement
 {
            attribute DOMString        cite;
 };
--- a/dom/interfaces/html/nsIDOMHTMLScriptElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLScriptElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(2a9a1a1b-d4cf-4594-a71c-f47ebd790f0d)]
+[scriptable, uuid(E2F548F6-9955-4820-A9E6-3A9FD43C7111)]
 interface nsIDOMHTMLScriptElement : nsIDOMHTMLElement
 {
            attribute DOMString        src;
            attribute boolean          async;
            attribute boolean          defer;
            attribute DOMString        type;
            attribute DOMString        charset;
            attribute DOMString        text;
--- a/dom/interfaces/html/nsIDOMHTMLSelectElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLSelectElement.idl
@@ -48,17 +48,17 @@
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
 interface nsIDOMValidityState;
 
-[scriptable, uuid(828961d4-cca1-4024-aaf1-dc0e0d1e6d98)]
+[scriptable, uuid(2A50D295-8DB8-4223-AE0D-070C6EB6C76E)]
 interface nsIDOMHTMLSelectElement : nsIDOMHTMLElement
 {
            attribute boolean                     autofocus;
            attribute boolean                     disabled;
   readonly attribute nsIDOMHTMLFormElement       form;
            attribute boolean                     multiple;
            attribute DOMString                   name;
            attribute long                        size;
--- a/dom/interfaces/html/nsIDOMHTMLSourceElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLSourceElement.idl
@@ -43,14 +43,14 @@
  * <source> element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#source
  *
  * @status UNDER_DEVELOPMENT
  */
 
-[scriptable, uuid(cff81c92-fefa-4d0f-8d07-a4d98fabb6b6)]
+[scriptable, uuid(4BF58085-9986-47B5-BB03-62BAA0451497)]
 interface nsIDOMHTMLSourceElement : nsIDOMHTMLElement
 {
            attribute DOMString src;
            attribute DOMString type;
 };
--- a/dom/interfaces/html/nsIDOMHTMLStyleElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLStyleElement.idl
@@ -45,15 +45,15 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(6687fa89-8141-421c-bd76-70f9b89bccc9)]
+[scriptable, uuid(830D9170-F8EB-4749-B721-16D60D6B0F1B)]
 interface nsIDOMHTMLStyleElement : nsIDOMHTMLElement
 {
            attribute boolean          disabled;
            attribute DOMString        media;
            attribute DOMString        type;
 };
--- a/dom/interfaces/html/nsIDOMHTMLTableCaptionElem.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableCaptionElem.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(77d7863a-1a8d-4c25-9b3a-33ef760c78e5)]
+[scriptable, uuid(526C4DC4-25CD-46DE-A9B2-1501D624F7DF)]
 interface nsIDOMHTMLTableCaptionElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
 };
--- a/dom/interfaces/html/nsIDOMHTMLTableCellElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableCellElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(89cc7b76-0c34-42c1-93b8-1db28d54ce67)]
+[scriptable, uuid(8434C7E8-5E4E-4AB5-9192-3F1C00815920)]
 interface nsIDOMHTMLTableCellElement : nsIDOMHTMLElement
 {
   readonly attribute long             cellIndex;
            attribute DOMString        abbr;
            attribute DOMString        align;
            attribute DOMString        axis;
            attribute DOMString        bgColor;
            attribute DOMString        ch;
--- a/dom/interfaces/html/nsIDOMHTMLTableColElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableColElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(f8656d47-dea5-4f00-bc63-a6a9c12e2a14)]
+[scriptable, uuid(8F98865C-1600-4282-A553-838D87CC9F1F)]
 interface nsIDOMHTMLTableColElement : nsIDOMHTMLElement
 {
            attribute DOMString        align;
            attribute DOMString        ch;
            attribute DOMString        chOff;
            attribute long             span;
            attribute DOMString        vAlign;
            attribute DOMString        width;
--- a/dom/interfaces/html/nsIDOMHTMLTableElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(f9710237-bd89-4411-a67a-cf972430e3cc)]
+[scriptable, uuid(AE50DE74-BC26-402E-85DC-A980F506B655)]
 interface nsIDOMHTMLTableElement : nsIDOMHTMLElement
 {
   // Modified in DOM Level 2:
            attribute nsIDOMHTMLTableCaptionElement caption;
                                              // raises(DOMException) on setting
 
   // Modified in DOM Level 2:
            attribute nsIDOMHTMLTableSectionElement tHead;
--- a/dom/interfaces/html/nsIDOMHTMLTableRowElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableRowElement.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(365b26ba-b077-4a98-8a0f-9691ac6677f1)]
+[scriptable, uuid(0AC4A382-4F97-4143-A3B3-DE0A54978C67)]
 interface nsIDOMHTMLTableRowElement : nsIDOMHTMLElement
 {
   // Modified in DOM Level 2:
   readonly attribute long                 rowIndex;
   // Modified in DOM Level 2:
   readonly attribute long                 sectionRowIndex;
   // Modified in DOM Level 2:
   readonly attribute nsIDOMHTMLCollection cells;
--- a/dom/interfaces/html/nsIDOMHTMLTableSectionElem.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTableSectionElem.idl
@@ -45,17 +45,17 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(3c402173-8315-43ed-9e2c-130b159d7c8f)]
+[scriptable, uuid(006D2482-0B89-401B-9A16-EDE4D9971F02)]
 interface nsIDOMHTMLTableSectionElement : nsIDOMHTMLElement
 {
            attribute DOMString            align;
            attribute DOMString            ch;
            attribute DOMString            chOff;
            attribute DOMString            vAlign;
   readonly attribute nsIDOMHTMLCollection rows;
   // Modified in DOM Level 2:
--- a/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl
@@ -48,17 +48,17 @@ interface nsIDOMValidityState;
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(81efc7a5-ea76-494c-a3ce-02556afba337)]
+[scriptable, uuid(2A395065-2D92-48C1-AC00-643DE9CA681B)]
 interface nsIDOMHTMLTextAreaElement : nsIDOMHTMLElement
 {
            attribute boolean               autofocus;
            attribute unsigned long         cols;
            attribute boolean               disabled;
   readonly attribute nsIDOMHTMLFormElement form;
            attribute long                  maxLength;
            attribute DOMString             name;
--- a/dom/interfaces/html/nsIDOMHTMLTitleElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLTitleElement.idl
@@ -45,13 +45,13 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(1c03280b-324b-4c83-bfdf-76738cdc70c1)]
+[scriptable, uuid(DB0440CC-FB98-4FB0-84E8-6ADD4764A48F)]
 interface nsIDOMHTMLTitleElement : nsIDOMHTMLElement
 {
            attribute DOMString        text;
 };
--- a/dom/interfaces/html/nsIDOMHTMLUListElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLUListElement.idl
@@ -45,14 +45,14 @@
  *
  * This interface is trying to follow the DOM Level 2 HTML specification:
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  *
  * with changes from the work-in-progress WHATWG HTML specification:
  * http://www.whatwg.org/specs/web-apps/current-work/
  */
 
-[scriptable, uuid(dfe7d584-6330-44de-a46f-a0e9d55fa9f4)]
+[scriptable, uuid(7DFD92D6-4DC3-4C52-8384-BA35E0AE4B8B)]
 interface nsIDOMHTMLUListElement : nsIDOMHTMLElement
 {
            attribute boolean          compact;
            attribute DOMString        type;
 };
--- a/dom/interfaces/html/nsIDOMHTMLUnknownElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLUnknownElement.idl
@@ -38,12 +38,12 @@
 #include "nsIDOMHTMLElement.idl"
 
 /**
  * The nsIDOMHTMLUnknownElement interface is the interface to an unknown HTML
  * element.
  *
  * @see <http://www.whatwg.org/html/#htmlunknownelement>
  */
-[scriptable, uuid(d74ee527-8397-4a09-b161-f9bcb0382924)]
+[scriptable, uuid(74ACC5C9-A18D-4AEC-AEFC-A719EF69499C)]
 interface nsIDOMHTMLUnknownElement : nsIDOMHTMLElement
 {
 };
--- a/dom/interfaces/html/nsIDOMHTMLVideoElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLVideoElement.idl
@@ -43,17 +43,17 @@
  * <video> element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#video
  *
  * @status UNDER_DEVELOPMENT
  */
 
-[scriptable, uuid(9904233c-1345-440d-aa0f-1d3dd4457d83)]
+[scriptable, uuid(E3763903-928B-47C4-AC3B-C47EB43884CA)]
 interface nsIDOMHTMLVideoElement : nsIDOMHTMLMediaElement
 {
            attribute long width; 
            attribute long height;
   readonly attribute unsigned long videoWidth;
   readonly attribute unsigned long videoHeight;
            attribute DOMString poster;
            
--- a/dom/interfaces/svg/nsIDOMSVGAElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGAElement.idl
@@ -39,17 +39,17 @@
 
 /**
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG/linking.html#AElement
  */
 
 interface nsIDOMSVGAnimatedString;
 
-[scriptable, uuid(bc060816-4cab-4552-af1f-39e15e6f4f59)]
+[scriptable, uuid(DBC9B56C-3DE3-4475-A934-EE88D3BCB03C)]
 interface nsIDOMSVGAElement
   : nsIDOMSVGElement
 /*
   The SVG DOM makes use of multiple interface inheritance.
   Since XPCOM only supports single interface inheritance,
   the best thing that we can do is to promise that whenever
   an object implements _this_ interface it will also
   implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGAltGlyphElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGAltGlyphElement.idl
@@ -30,17 +30,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGTextPositionElem.idl"
 
-[scriptable, uuid(289aa3c3-9724-48a3-81cc-a0bc7c1f1fea)]
+[scriptable, uuid(D7274F91-0FC7-42F1-AD56-3C58AF2B0113)]
 interface nsIDOMSVGAltGlyphElement : nsIDOMSVGTextPositioningElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
         hop between them.)
--- a/dom/interfaces/svg/nsIDOMSVGAnimateElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGAnimateElement.idl
@@ -32,10 +32,10 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGAnimationElement.idl"
 
-[scriptable, uuid(a662ffce-086f-4c5b-886b-78acb654db10)]
+[scriptable, uuid(11E98EA0-C8D2-4471-88B0-A3E6708021E4)]
 interface nsIDOMSVGAnimateElement : nsIDOMSVGAnimationElement {};
--- a/dom/interfaces/svg/nsIDOMSVGAnimateMotionElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGAnimateMotionElement.idl
@@ -32,10 +32,10 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGAnimationElement.idl"
 
-[scriptable, uuid(3d1d0c0d-9d5b-4e30-9fc8-97ec7e49ec18)]
+[scriptable, uuid(964CDA18-C400-4D1E-B113-2000B4BF777E)]
 interface nsIDOMSVGAnimateMotionElement : nsIDOMSVGAnimationElement { };
--- a/dom/interfaces/svg/nsIDOMSVGAnimateTransformElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGAnimateTransformElement.idl
@@ -32,10 +32,10 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGAnimationElement.idl"
 
-[scriptable, uuid(1c7be1dc-a799-4837-865f-4c0bd1e51255)]
+[scriptable, uuid(EF6A356E-AA64-49EB-931B-5D9EFC62FC97)]
 interface nsIDOMSVGAnimateTransformElement : nsIDOMSVGAnimationElement {};
--- a/dom/interfaces/svg/nsIDOMSVGAnimationElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGAnimationElement.idl
@@ -32,17 +32,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(2dfaf726-a479-4a9d-8e16-cd5d07696eea)]
+[scriptable, uuid(26BF6187-A720-47AA-B453-DEFB98FF433C)]
 interface nsIDOMSVGAnimationElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGCircleElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGCircleElement.idl
@@ -35,17 +35,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 
-[scriptable, uuid(79314559-4561-4259-9839-f9b8df90e050)]
+[scriptable, uuid(150C9D2F-66D1-4EC4-A351-4F53534FA314)]
 interface nsIDOMSVGCircleElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGClipPathElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGClipPathElement.idl
@@ -42,17 +42,17 @@
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG11/masking.html
  *
  */
 
 interface nsIDOMSVGAnimatedEnumeration;
 
-[scriptable, uuid(77909883-71d3-46a4-87df-baab182eea6c)]
+[scriptable, uuid(5A4D77E5-D887-4050-A9F7-0D690AD35500)]
 interface nsIDOMSVGClipPathElement
   : nsIDOMSVGElement
 /*
   The SVG DOM makes use of multiple interface inheritance.
   Since XPCOM only supports single interface inheritance,
   the best thing that we can do is to promise that whenever
   an object implements _this_ interface it will also
   implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGDefsElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGDefsElement.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(50a7b30c-fbad-4f60-baca-a6e018e66a06)]
+[scriptable, uuid(3F8D6B9C-CF03-45A6-B8A5-57ECBB7655DA)]
 interface nsIDOMSVGDefsElement
   : nsIDOMSVGElement
 /*
   The SVG DOM makes use of multiple interface inheritance.
   Since XPCOM only supports single interface inheritance,
   the best thing that we can do is to promise that whenever
   an object implements _this_ interface it will also
   implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGDescElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGDescElement.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(18c4a5f0-9f12-4f7a-bc14-91d575238a34)]
+[scriptable, uuid(ED14BA6A-090D-4096-A225-08BD56678FE6)]
 interface nsIDOMSVGDescElement
   : nsIDOMSVGElement
 /*
   The SVG DOM makes use of multiple interface inheritance.
   Since XPCOM only supports single interface inheritance,
   the best thing that we can do is to promise that whenever
   an object implements _this_ interface it will also
   implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGDocument.idl
+++ b/dom/interfaces/svg/nsIDOMSVGDocument.idl
@@ -34,15 +34,15 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMDocument.idl"
 
 interface nsIDOMSVGSVGElement;
 
-[scriptable, uuid(b3c5a715-ccee-48e4-8d2b-dcf7fa6ccb7c)]
+[scriptable, uuid(4AEBF9E7-F275-4147-AA90-601626476132)]
 interface nsIDOMSVGDocument : nsIDOMDocument
 {
   readonly attribute DOMString domain;
   readonly attribute DOMString URL;
   readonly attribute nsIDOMSVGSVGElement rootElement;
 };
--- a/dom/interfaces/svg/nsIDOMSVGElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGElement.idl
@@ -35,16 +35,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMElement.idl"
 
 interface nsIDOMSVGSVGElement;
 
-[scriptable, uuid(0eb0952f-05a9-44e8-ab48-66bed5641ebf)]
+[scriptable, uuid(9B16734D-DBFD-4465-8EAF-354694934A1D)]
 interface nsIDOMSVGElement : nsIDOMElement 
 { 
   attribute DOMString id;
             // raises DOMException on setting
   readonly attribute nsIDOMSVGSVGElement ownerSVGElement;
   readonly attribute nsIDOMSVGElement    viewportElement;
 };
--- a/dom/interfaces/svg/nsIDOMSVGEllipseElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGEllipseElement.idl
@@ -35,17 +35,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 
-[scriptable, uuid(a19b7c99-3b3f-4860-aa94-d66789afa021)]
+[scriptable, uuid(C03C3C5F-7510-4392-BA7A-DADC0AB92E28)]
 interface nsIDOMSVGEllipseElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGFilterElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGFilterElement.idl
@@ -35,17 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 interface nsIDOMSVGAnimatedEnumeration;
 interface nsIDOMSVGAnimatedInteger;
 
-[scriptable, uuid(34bf1f97-ec77-48b4-9f3b-c61ef957ebf7)]
+[scriptable, uuid(974C7633-0258-4BE7-B1AE-E0ED1964C87F)]
 interface nsIDOMSVGFilterElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGFilters.idl
+++ b/dom/interfaces/svg/nsIDOMSVGFilters.idl
@@ -40,63 +40,63 @@
 interface nsIDOMSVGAnimatedLength;
 interface nsIDOMSVGAnimatedString;
 interface nsIDOMSVGAnimatedNumber;
 interface nsIDOMSVGAnimatedEnumeration;
 interface nsIDOMSVGAnimatedNumberList;
 interface nsIDOMSVGAnimatedInteger;
 interface nsIDOMSVGAnimatedBoolean;
 
-[scriptable, uuid(f96cedb9-568c-43d0-b07f-565d5116ae34)]
+[scriptable, uuid(117CFA4C-B0EB-4C0F-A590-F77FBF42E76D)]
 interface nsIDOMSVGFilterPrimitiveStandardAttributes : nsIDOMSVGElement
 { 
     readonly attribute nsIDOMSVGAnimatedLength      x;
     readonly attribute nsIDOMSVGAnimatedLength      y;
     readonly attribute nsIDOMSVGAnimatedLength      width;
     readonly attribute nsIDOMSVGAnimatedLength      height;
     readonly attribute nsIDOMSVGAnimatedString      result;
 };
 
-[scriptable, uuid(215023bc-e4d6-473d-b0fd-db96727b9e0d)]
+[scriptable, uuid(02DB0A51-087B-4EA4-ABC4-3DCAB65BFE83)]
 interface nsIDOMSVGFEBlendElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 {
     const unsigned short SVG_MODE_UNKNOWN   = 0;
     const unsigned short SVG_MODE_NORMAL    = 1;
     const unsigned short SVG_MODE_MULTIPLY  = 2;
     const unsigned short SVG_MODE_SCREEN    = 3;
     const unsigned short SVG_MODE_DARKEN    = 4;
     const unsigned short SVG_MODE_LIGHTEN   = 5;
 
     readonly attribute nsIDOMSVGAnimatedString        in1;
     readonly attribute nsIDOMSVGAnimatedString        in2;
     readonly attribute nsIDOMSVGAnimatedEnumeration   mode;
 };
 
-[scriptable, uuid(92205955-4d55-4097-9b93-b38d7e5a72e4)]
+[scriptable, uuid(BB966D00-CF60-4696-9954-43525401E209)]
 interface nsIDOMSVGFEColorMatrixElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 {
     // Color Matrix Types
     const unsigned short SVG_FECOLORMATRIX_TYPE_UNKNOWN            = 0;
     const unsigned short SVG_FECOLORMATRIX_TYPE_MATRIX             = 1;
     const unsigned short SVG_FECOLORMATRIX_TYPE_SATURATE           = 2;
     const unsigned short SVG_FECOLORMATRIX_TYPE_HUE_ROTATE         = 3;
     const unsigned short SVG_FECOLORMATRIX_TYPE_LUMINANCE_TO_ALPHA = 4;
 
     readonly attribute nsIDOMSVGAnimatedString in1;
     readonly attribute nsIDOMSVGAnimatedEnumeration type;
     readonly attribute nsIDOMSVGAnimatedNumberList  values;
 };
 
-[scriptable, uuid(69612612-c893-4d2c-902d-5a4887ebfe0a)]
+[scriptable, uuid(539000B3-2272-4F1A-BF24-23340DD408AF)]
 interface nsIDOMSVGFEComponentTransferElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 {
     readonly attribute nsIDOMSVGAnimatedString in1;
 };
 
-[scriptable, uuid(1b758c80-c6f2-4f57-a8cf-964c98c8d0f0)]
+[scriptable, uuid(75FAB13E-9D34-4653-B992-BF7DF78BA379)]
 interface nsIDOMSVGComponentTransferFunctionElement : nsIDOMSVGElement
 {
     // Component Transfer Types
     const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN  = 0;
     const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY = 1;
     const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_TABLE    = 2;
     const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE = 3;
     const unsigned short SVG_FECOMPONENTTRANSFER_TYPE_LINEAR   = 4;
@@ -106,17 +106,17 @@ interface nsIDOMSVGComponentTransferFunc
     readonly attribute nsIDOMSVGAnimatedNumberList  tableValues;
     readonly attribute nsIDOMSVGAnimatedNumber      slope;
     readonly attribute nsIDOMSVGAnimatedNumber      intercept;
     readonly attribute nsIDOMSVGAnimatedNumber      amplitude;
     readonly attribute nsIDOMSVGAnimatedNumber      exponent;
     readonly attribute nsIDOMSVGAnimatedNumber      offset;
 };
 
-[scriptable, uuid(71142479-68eb-44a3-9964-19faa09c4720)]
+[scriptable, uuid(32887E8E-A5DE-4FBB-84F2-842743FEE02B)]
 interface nsIDOMSVGFECompositeElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 {
     // Operator Types
     const unsigned short SVG_OPERATOR_UNKNOWN    = 0;
     const unsigned short SVG_OPERATOR_OVER       = 1;
     const unsigned short SVG_OPERATOR_IN         = 2;
     const unsigned short SVG_OPERATOR_OUT        = 3;
     const unsigned short SVG_OPERATOR_ATOP       = 4;
@@ -130,75 +130,75 @@ interface nsIDOMSVGFECompositeElement : 
     readonly attribute nsIDOMSVGAnimatedNumber  k3;
     readonly attribute nsIDOMSVGAnimatedNumber  k4;
     readonly attribute nsIDOMSVGAnimatedEnumeration operator;
     
     void setK ( in float k1, in float k2, in float k3, in float k4 );
 
 };
 
-[scriptable, uuid(4f358571-3dcb-4ac5-990b-19e3fd355d43)]
+[scriptable, uuid(B0FDBC88-ACE2-4EA1-A37B-A3D49A49C014)]
 interface nsIDOMSVGFEFuncRElement : nsIDOMSVGComponentTransferFunctionElement
 {
 };
 
-[scriptable, uuid(a2b6baf7-4f8a-4b3a-86e9-6e232ad25889)]
+[scriptable, uuid(7F03F95A-5C78-4872-9CF6-856F66C76F8B)]
 interface nsIDOMSVGFEFuncGElement : nsIDOMSVGComponentTransferFunctionElement
 {
 };
 
-[scriptable, uuid(b6d6522d-6721-453b-99f9-a08349d84dd0)]
+[scriptable, uuid(1AE3374C-1F60-4DD0-BC08-3B16FF9A63B0)]
 interface nsIDOMSVGFEFuncBElement : nsIDOMSVGComponentTransferFunctionElement
 {
 };
 
-[scriptable, uuid(70c084fc-d823-43b3-b4f1-476387b40079)]
+[scriptable, uuid(EF68B840-E84F-45B6-89A6-B716D6A0BFEC)]
 interface nsIDOMSVGFEFuncAElement : nsIDOMSVGComponentTransferFunctionElement
 {
 };
 
-[scriptable, uuid(bd19cfb2-5259-4551-abf5-3f9a9967ccf0)]
+[scriptable, uuid(32741F93-2AC4-4173-96AE-B1E65634C1EF)]
 interface nsIDOMSVGFEGaussianBlurElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 { 
     readonly attribute nsIDOMSVGAnimatedString in1;
     readonly attribute nsIDOMSVGAnimatedNumber stdDeviationX;
     readonly attribute nsIDOMSVGAnimatedNumber stdDeviationY;
 
     void setStdDeviation ( in float stdDeviationX, in float stdDeviationY );
 };
 
-[scriptable, uuid(ebb57b0d-e198-4f10-b5a9-4ab5b0729c85)]
+[scriptable, uuid(F698E5A2-DA0E-4D6F-9F45-C57D6464ECF1)]
 interface nsIDOMSVGFEMergeElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 {
 };
 
-[scriptable, uuid(5b701f2f-b636-4bbb-8d2a-c74fa79b0280)]
+[scriptable, uuid(517828DE-69F7-4FAB-915E-862E4F77493D)]
 interface nsIDOMSVGFEMergeNodeElement : nsIDOMSVGElement { 
     readonly attribute nsIDOMSVGAnimatedString in1;
 };
 
-[scriptable, uuid(15746ca6-8b27-4cc1-bd84-3422d3aea18c)]
+[scriptable, uuid(0BAE928A-92FE-4C5F-A8CB-DAED171FA6A2)]
 interface nsIDOMSVGFEOffsetElement : nsIDOMSVGFilterPrimitiveStandardAttributes { 
     readonly attribute nsIDOMSVGAnimatedString in1;
     readonly attribute nsIDOMSVGAnimatedNumber dx;
     readonly attribute nsIDOMSVGAnimatedNumber dy;
 };
 
-[scriptable, uuid(436ca74a-eba8-4a50-8947-c180eb612a34)]
+[scriptable, uuid(F1635489-F34F-4554-8284-C848500FE0DD)]
 interface nsIDOMSVGFEFloodElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 {
 };
 
-[scriptable, uuid(4cf173d3-6b67-4e2c-8050-61412e6e9d7c)]
+[scriptable, uuid(C587EFE9-0A22-44E6-9964-B68DA564804A)]
 interface nsIDOMSVGFETileElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 {
     readonly attribute nsIDOMSVGAnimatedString in1;
 };
 
-[scriptable, uuid(9235e6a7-ba2c-4a41-9e80-20735159014b)]
+[scriptable, uuid(15BB448A-B589-4769-AA92-7C680A919F76)]
 interface nsIDOMSVGFETurbulenceElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 { 
     // Turbulence Types
     const unsigned short SVG_TURBULENCE_TYPE_UNKNOWN      = 0;
     const unsigned short SVG_TURBULENCE_TYPE_FRACTALNOISE = 1;
     const unsigned short SVG_TURBULENCE_TYPE_TURBULENCE   = 2;
     // Stitch Options
     const unsigned short SVG_STITCHTYPE_UNKNOWN  = 0;
@@ -208,33 +208,33 @@ interface nsIDOMSVGFETurbulenceElement :
     readonly attribute nsIDOMSVGAnimatedNumber      baseFrequencyX;
     readonly attribute nsIDOMSVGAnimatedNumber      baseFrequencyY;
     readonly attribute nsIDOMSVGAnimatedInteger     numOctaves;
     readonly attribute nsIDOMSVGAnimatedNumber      seed;
     readonly attribute nsIDOMSVGAnimatedEnumeration stitchTiles;
     readonly attribute nsIDOMSVGAnimatedEnumeration type;
 };
 
-[scriptable, uuid(b994b0e3-cff1-4550-bfb2-f5de7679acb9)]
+[scriptable, uuid(645DEF2E-C176-47CC-A2C4-C9CC49D0AFC8)]
 interface nsIDOMSVGFEMorphologyElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 { 
     // Operator Types
     const unsigned short SVG_OPERATOR_UNKNOWN  = 0;
     const unsigned short SVG_OPERATOR_ERODE    = 1;
     const unsigned short SVG_OPERATOR_DILATE   = 2;
 
     readonly attribute nsIDOMSVGAnimatedString      in1;
     readonly attribute nsIDOMSVGAnimatedNumber      radiusX;
     readonly attribute nsIDOMSVGAnimatedNumber      radiusY;
     readonly attribute nsIDOMSVGAnimatedEnumeration operator;
     
     void setRadius ( in float rx, in float ry );
 };
 
-[scriptable, uuid(b64766fa-c393-4985-a775-deedb5b07ed2)]
+[scriptable, uuid(42A1FB88-DCD7-4211-9DD7-431460708D12)]
 interface nsIDOMSVGFEConvolveMatrixElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 { 
     // Edge Mode Values
     const unsigned short SVG_EDGEMODE_UNKNOWN   = 0;
     const unsigned short SVG_EDGEMODE_DUPLICATE = 1;
     const unsigned short SVG_EDGEMODE_WRAP      = 2;
     const unsigned short SVG_EDGEMODE_NONE      = 3;
 
@@ -247,73 +247,73 @@ interface nsIDOMSVGFEConvolveMatrixEleme
     readonly attribute nsIDOMSVGAnimatedInteger     targetX;
     readonly attribute nsIDOMSVGAnimatedInteger     targetY;
     readonly attribute nsIDOMSVGAnimatedEnumeration edgeMode;
     readonly attribute nsIDOMSVGAnimatedNumber      kernelUnitLengthX;
     readonly attribute nsIDOMSVGAnimatedNumber      kernelUnitLengthY;
     readonly attribute nsIDOMSVGAnimatedBoolean     preserveAlpha;
 };
 
-[scriptable, uuid(47343967-4da5-4309-a3a4-c37ffab05b1f)]
+[scriptable, uuid(43662657-4DA9-4B64-8891-033B08DBD11B)]
 interface nsIDOMSVGFEDiffuseLightingElement :  nsIDOMSVGFilterPrimitiveStandardAttributes
 { 
   readonly attribute nsIDOMSVGAnimatedString in1;
   readonly attribute nsIDOMSVGAnimatedNumber surfaceScale;
   readonly attribute nsIDOMSVGAnimatedNumber diffuseConstant;
   readonly attribute nsIDOMSVGAnimatedNumber kernelUnitLengthX;
   readonly attribute nsIDOMSVGAnimatedNumber kernelUnitLengthY;
 };
 
-[scriptable, uuid(b647355f-1be8-40da-9c3b-05dce4c0eaa4)]
+[scriptable, uuid(473A96B5-E644-4BAC-93B8-8C923F6568F7)]
 interface nsIDOMSVGFESpecularLightingElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 { 
   readonly attribute nsIDOMSVGAnimatedString in1;
   readonly attribute nsIDOMSVGAnimatedNumber surfaceScale;
   readonly attribute nsIDOMSVGAnimatedNumber specularConstant;
   readonly attribute nsIDOMSVGAnimatedNumber specularExponent;
   readonly attribute nsIDOMSVGAnimatedNumber kernelUnitLengthX;
   readonly attribute nsIDOMSVGAnimatedNumber kernelUnitLengthY;
 };
 
-[scriptable, uuid(1073827f-77e5-4096-81c5-6ebffefe258b)]
+[scriptable, uuid(3C166FDD-A486-4089-9247-DEAC33001BD3)]
 interface nsIDOMSVGFEDistantLightElement : nsIDOMSVGElement { 
   readonly attribute nsIDOMSVGAnimatedNumber azimuth;
   readonly attribute nsIDOMSVGAnimatedNumber elevation;
 };
 
-[scriptable, uuid(d75d49ad-4265-4774-aa5c-02e4cdbfa2b1)]
+[scriptable, uuid(88C14474-3B95-454C-A62E-7FBE05DBD4A9)]
 interface nsIDOMSVGFEPointLightElement : nsIDOMSVGElement { 
   readonly attribute nsIDOMSVGAnimatedNumber x;
   readonly attribute nsIDOMSVGAnimatedNumber y;
   readonly attribute nsIDOMSVGAnimatedNumber z;
 };
 
-[scriptable, uuid(8cbaa2ea-159d-4b28-a963-8e42979eae84)]
+[scriptable, uuid(CDF0A4CD-99A0-4B8D-9E17-9EA7513A34B9)]
 interface nsIDOMSVGFESpotLightElement : nsIDOMSVGElement { 
   readonly attribute nsIDOMSVGAnimatedNumber x;
   readonly attribute nsIDOMSVGAnimatedNumber y;
   readonly attribute nsIDOMSVGAnimatedNumber z;
   readonly attribute nsIDOMSVGAnimatedNumber pointsAtX;
   readonly attribute nsIDOMSVGAnimatedNumber pointsAtY;
   readonly attribute nsIDOMSVGAnimatedNumber pointsAtZ;
   readonly attribute nsIDOMSVGAnimatedNumber specularExponent;
   readonly attribute nsIDOMSVGAnimatedNumber limitingConeAngle;
 };
 
-[scriptable, uuid(f46d36a1-5ea5-4152-9d73-2dd967c3a709)]
+[scriptable, uuid(6457A423-0686-486F-AB12-846B9542DFCF)]
 interface nsIDOMSVGFEImageElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 /*
   nsIDOMSVGURIReference,
   nsIDOMSVGLangSpace,
   nsIDOMSVGExternalResourcesRequired
 */
 {
 };
 
-[scriptable, uuid(84db9e0e-ea0b-4906-8929-d97b4fd637c3)]
+[scriptable, uuid(9B82CB0B-004D-4F26-BF3C-4E2BD4E1E82C)]
 interface nsIDOMSVGFEDisplacementMapElement : nsIDOMSVGFilterPrimitiveStandardAttributes
 {
   // Channel Selectors
   const unsigned short SVG_CHANNEL_UNKNOWN = 0;
   const unsigned short SVG_CHANNEL_R       = 1;
   const unsigned short SVG_CHANNEL_G       = 2;
   const unsigned short SVG_CHANNEL_B       = 3;
   const unsigned short SVG_CHANNEL_A       = 4;
--- a/dom/interfaces/svg/nsIDOMSVGForeignObjectElem.idl
+++ b/dom/interfaces/svg/nsIDOMSVGForeignObjectElem.idl
@@ -35,17 +35,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 
-[scriptable, uuid(aa51c975-0450-4deb-9c15-a0b8c01ca4e2)]
+[scriptable, uuid(4F9EB1B8-5949-4BD4-8843-35EFA8384929)]
 interface nsIDOMSVGForeignObjectElement
   : nsIDOMSVGElement
 /*
   The SVG DOM makes use of multiple interface inheritance.
   Since XPCOM only supports single interface inheritance,
   the best thing that we can do is to promise that whenever
   an object implements _this_ interface it will also
   implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGGElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGGElement.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(55235238-a7ae-4342-adf1-226069810dbc)]
+[scriptable, uuid(E348255B-FFF0-4D5F-9B32-FC200CF1C873)]
 interface nsIDOMSVGGElement
   : nsIDOMSVGElement
 /*
   The SVG DOM makes use of multiple interface inheritance.
   Since XPCOM only supports single interface inheritance,
   the best thing that we can do is to promise that whenever
   an object implements _this_ interface it will also
   implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGGradientElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGGradientElement.idl
@@ -45,17 +45,17 @@
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG11/pservers.html
  *
  */
 
 interface nsIDOMSVGAnimatedEnumeration;
 interface nsIDOMSVGAnimatedTransformList;
 
-[scriptable, uuid(c0eda839-02d3-4133-b088-6cd6cbbc3c99)]
+[scriptable, uuid(5056512E-2ACE-4B68-8F52-124E24CF0F55)]
 interface nsIDOMSVGGradientElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
@@ -83,17 +83,17 @@ interface nsIDOMSVGGradientElement
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG11/pservers.html
  *
  */
 
 // Linear gradient
 interface nsIDOMSVGAnimatedLength;
 
-[scriptable, uuid(90e26673-027a-42fc-915c-de60d39cfd41)]
+[scriptable, uuid(AC3E0464-5B49-4323-850D-563573F754EC)]
 interface nsIDOMSVGLinearGradientElement
   : nsIDOMSVGGradientElement
 { 
   readonly attribute nsIDOMSVGAnimatedLength x1;
   readonly attribute nsIDOMSVGAnimatedLength y1;
   readonly attribute nsIDOMSVGAnimatedLength x2;
   readonly attribute nsIDOMSVGAnimatedLength y2;
 };
@@ -105,17 +105,17 @@ interface nsIDOMSVGLinearGradientElement
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG11/pservers.html
  *
  */
 
 // Radial gradient
 interface nsIDOMSVGAnimatedLength;
 
-[scriptable, uuid(8d87299d-ed91-4a9c-8aa7-3ac24ad8785b)]
+[scriptable, uuid(7300FBAB-84AE-425E-BB3B-CF8C1E584CCD)]
 interface nsIDOMSVGRadialGradientElement
   : nsIDOMSVGGradientElement
 { 
   readonly attribute nsIDOMSVGAnimatedLength cx;
   readonly attribute nsIDOMSVGAnimatedLength cy;
   readonly attribute nsIDOMSVGAnimatedLength r;
   readonly attribute nsIDOMSVGAnimatedLength fx;
   readonly attribute nsIDOMSVGAnimatedLength fy;
--- a/dom/interfaces/svg/nsIDOMSVGImageElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGImageElement.idl
@@ -36,17 +36,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 interface nsIDOMSVGAnimatedPreserveAspectRatio;
 
-[scriptable, uuid(31fdac45-fc15-4b09-a755-bcc641edac29)]
+[scriptable, uuid(2268AAD3-7E88-4F7B-89A3-F5294C89514D)]
 interface nsIDOMSVGImageElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGLineElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGLineElement.idl
@@ -35,17 +35,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 
-[scriptable, uuid(1ae0646a-8a4a-4ba6-a0d1-bc87f8146fa1)]
+[scriptable, uuid(8FE29A33-98F2-4E8E-93F8-F4DCDA4CA14E)]
 interface nsIDOMSVGLineElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGMarkerElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGMarkerElement.idl
@@ -46,17 +46,17 @@ interface nsIDOMSVGMatrix;
 /**
  * The nsIDOMSVGMarker interface is the interface to an SVG marker element.
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG11/painting.html#InterfaceSVGMarkerElement
  *
  */
 
-[scriptable, uuid(f5f93dff-7abc-4a13-a659-6c256d80e598)]
+[scriptable, uuid(0258F664-8251-4075-A0F5-F3D2170A913A)]
 interface nsIDOMSVGMarkerElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGMaskElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGMaskElement.idl
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 interface nsIDOMSVGAnimatedEnumeration;
 
-[scriptable, uuid(5540ae8e-5798-4399-b711-0eca44ab29cc)]
+[scriptable, uuid(D9FE9060-DE7E-4841-A33B-5601EC133982)]
 interface nsIDOMSVGMaskElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGMetadataElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGMetadataElement.idl
@@ -33,13 +33,13 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(5e919004-5f14-4eee-9622-4e130cc8e821)]
+[scriptable, uuid(749982A4-743B-4EC6-8BB2-FA602976EA58)]
 interface nsIDOMSVGMetadataElement
   : nsIDOMSVGElement
 {
 };
--- a/dom/interfaces/svg/nsIDOMSVGMpathElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGMpathElement.idl
@@ -38,17 +38,17 @@
 
 #include "nsIDOMSVGElement.idl"
 
 /**
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG/animate.html#mpathElement
  */
 
-[scriptable, uuid(f1fb5fb2-efa7-455c-b307-8d2203badadd)]
+[scriptable, uuid(67DB3F0C-2A3F-4D56-984F-3D30752FAF37)]
 interface nsIDOMSVGMpathElement
   : nsIDOMSVGElement
 /*
   The SVG DOM makes use of multiple interface inheritance.
   Since XPCOM only supports single interface inheritance,
   the best thing that we can do is to promise that whenever
   an object implements _this_ interface it will also
   implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGPathElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGPathElement.idl
@@ -55,17 +55,17 @@ interface nsIDOMSVGPathSegLinetoHorizont
 interface nsIDOMSVGPathSegLinetoHorizontalRel;
 interface nsIDOMSVGPathSegLinetoVerticalAbs;
 interface nsIDOMSVGPathSegLinetoVerticalRel;
 interface nsIDOMSVGPathSegCurvetoCubicSmoothAbs;
 interface nsIDOMSVGPathSegCurvetoCubicSmoothRel;
 interface nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs;
 interface nsIDOMSVGPathSegCurvetoQuadraticSmoothRel;
 
-[scriptable, uuid(661a4651-8530-44fc-b163-fa3eb6db7fa9)]
+[scriptable, uuid(89AF3EAE-1703-461A-A2E0-86D2131C11AC)]
 interface nsIDOMSVGPathElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGPatternElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGPatternElement.idl
@@ -46,17 +46,17 @@
  * http://www.w3.org/TR/SVG11/pservers.html
  *
  */
 
 interface nsIDOMSVGAnimatedEnumeration;
 interface nsIDOMSVGAnimatedTransformList;
 interface nsIDOMSVGAnimatedLength;
 
-[scriptable, uuid(1dfae3d2-49d3-48a5-a0f0-8d71dbad5fb6)]
+[scriptable, uuid(A8D23223-A3DA-46DB-87F0-EA6BBCF4A7DD)]
 interface nsIDOMSVGPatternElement 
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGPolygonElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGPolygonElement.idl
@@ -34,17 +34,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(f734e5b0-15f2-4a38-98ef-5539fd13765c)]
+[scriptable, uuid(23365F22-9A77-439B-BF86-B5D840DAB910)]
 interface nsIDOMSVGPolygonElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGPolylineElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGPolylineElement.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(14595952-41f3-48ea-a3be-c0d088ede062)]
+[scriptable, uuid(189F12DA-B61D-4AD5-9EE0-0A7F4CE59970)]
 interface nsIDOMSVGPolylineElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGRectElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGRectElement.idl
@@ -35,17 +35,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 
-[scriptable, uuid(77ef1fe9-c589-4b7e-b626-85036974e870)]
+[scriptable, uuid(67F1F097-A2A8-40D4-A2B5-12A6E8D0455E)]
 interface nsIDOMSVGRectElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGSVGElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGSVGElement.idl
@@ -50,17 +50,17 @@ interface nsIDOMSVGTransform;
 
 // undef the GetCurrentTime macro defined in WinBase.h from the MS Platform SDK
 %{C++
 #ifdef GetCurrentTime
 #undef GetCurrentTime
 #endif
 %}
 
-[scriptable, uuid(716cca1f-9512-4350-a492-d034eb45e547)]
+[scriptable, uuid(EF862DDA-DE4E-4F1C-9A70-4D3BEBDE5E6E)]
 interface nsIDOMSVGSVGElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGScriptElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGScriptElement.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(5f7314ba-d7b9-457b-a299-cb57658464ee)]
+[scriptable, uuid(B3314A7D-9909-4367-BBDB-9FAFB069CDFD)]
 interface nsIDOMSVGScriptElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGSetElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGSetElement.idl
@@ -32,10 +32,10 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGAnimationElement.idl"
 
-[scriptable, uuid(a3afd23f-da69-4cfb-8e0e-80f427301619)]
+[scriptable, uuid(8AA250A7-06F9-4B8D-BC84-8FD38A4227F2)]
 interface nsIDOMSVGSetElement : nsIDOMSVGAnimationElement {};
--- a/dom/interfaces/svg/nsIDOMSVGStopElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGStopElement.idl
@@ -44,17 +44,17 @@
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/SVG11/pservers.html
  *
  */
 
 interface nsIDOMSVGAnimatedNumber;
 
-[scriptable, uuid(cfbd6716-568f-4cab-8e55-7cd5f9050716)]
+[scriptable, uuid(B3A7410B-0066-404D-9DDC-AD212D97891F)]
 interface nsIDOMSVGStopElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGStyleElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGStyleElement.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(48f78866-ea65-4199-ad3d-b8d289fe9277)]
+[scriptable, uuid(53DA8F96-E2F0-45AC-B8AE-3CACC5981383)]
 interface nsIDOMSVGStyleElement
   : nsIDOMSVGElement
 {
   attribute DOMString         xmlspace;
                        // raises DOMException on setting
   attribute DOMString         type;
                        // raises DOMException on setting
   attribute DOMString         media;
--- a/dom/interfaces/svg/nsIDOMSVGSwitchElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGSwitchElement.idl
@@ -31,17 +31,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(7b0a1f88-401f-4f0d-92e8-45ac3bfc3d85)]
+[scriptable, uuid(101FC4D8-5D79-41B5-B759-142BF401FA36)]
 interface nsIDOMSVGSwitchElement
   : nsIDOMSVGElement
 /*
   The SVG DOM makes use of multiple interface inheritance.
   Since XPCOM only supports single interface inheritance,
   the best thing that we can do is to promise that whenever
   an object implements _this_ interface it will also
   implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGSymbolElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGSymbolElement.idl
@@ -31,17 +31,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(f512634f-f69f-48ae-90f0-89b695cdba51)]
+[scriptable, uuid(165A3430-F103-4472-A81F-072A3F59DB76)]
 interface nsIDOMSVGSymbolElement
   : nsIDOMSVGElement
 /*
   The SVG DOM makes use of multiple interface inheritance.
   Since XPCOM only supports single interface inheritance,
   the best thing that we can do is to promise that whenever
   an object implements _this_ interface it will also
   implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGTSpanElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGTSpanElement.idl
@@ -33,12 +33,12 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGTextPositionElem.idl"
 
-[scriptable, uuid(26e33f1d-a657-419a-882c-d94a1fa63e2b)]
+[scriptable, uuid(B209767F-B902-4831-8614-40CEFB788042)]
 interface nsIDOMSVGTSpanElement : nsIDOMSVGTextPositioningElement
 { 
 };
--- a/dom/interfaces/svg/nsIDOMSVGTextContentElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGTextContentElement.idl
@@ -39,17 +39,17 @@
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 interface nsIDOMSVGAnimatedEnumeration;
 interface nsIDOMSVGPoint;
 interface nsIDOMSVGRect;
 
 
-[scriptable, uuid(c3cab232-a0c0-418a-9410-bc09261d4701)]
+[scriptable, uuid(8A884160-DB64-4BF7-B932-15398E536A8D)]
 interface nsIDOMSVGTextContentElement
   : nsIDOMSVGElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGTextElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGTextElement.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGTextPositionElem.idl"
 
-[scriptable, uuid(fbd5ea26-3e8d-4a6e-a9c4-3013e2ddca1b)]
+[scriptable, uuid(E69F79F5-F6FE-4885-8F47-481BA88572C1)]
 interface nsIDOMSVGTextElement : nsIDOMSVGTextPositioningElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
         hop between them.)
--- a/dom/interfaces/svg/nsIDOMSVGTextPathElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGTextPathElement.idl
@@ -34,17 +34,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGTextContentElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 interface nsIDOMSVGAnimatedEnumeration;
 
-[scriptable, uuid(e01999af-1ec4-4669-aa70-f2347d90264f)]
+[scriptable, uuid(89FFAFFA-3BF5-4C6C-82B9-155BB2F33033)]
 interface nsIDOMSVGTextPathElement
   : nsIDOMSVGTextContentElement
 /*
         The SVG DOM makes use of multiple interface inheritance.
         Since XPCOM only supports single interface inheritance,
         the best thing that we can do is to promise that whenever
         an object implements _this_ interface it will also
         implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGTextPositionElem.idl
+++ b/dom/interfaces/svg/nsIDOMSVGTextPositionElem.idl
@@ -36,17 +36,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGTextContentElement.idl"
 
 interface nsIDOMSVGAnimatedLengthList;
 interface nsIDOMSVGAnimatedNumberList;
 
-[scriptable, uuid(716f0adc-3e78-4c12-aa64-b8a85af8129b)]
+[scriptable, uuid(5D04C053-DB94-468E-BFD6-588569851A6B)]
 interface nsIDOMSVGTextPositioningElement : nsIDOMSVGTextContentElement
 { 
   readonly attribute nsIDOMSVGAnimatedLengthList x;
   readonly attribute nsIDOMSVGAnimatedLengthList y;
   readonly attribute nsIDOMSVGAnimatedLengthList dx;
   readonly attribute nsIDOMSVGAnimatedLengthList dy;
   readonly attribute nsIDOMSVGAnimatedNumberList rotate;
 };
--- a/dom/interfaces/svg/nsIDOMSVGTitleElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGTitleElement.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
-[scriptable, uuid(b65bd7ad-6c0f-437d-b4fa-d0652f7497f0)]
+[scriptable, uuid(9AD90BA6-9FFD-439E-AE0A-AAB109A6B888)]
 interface nsIDOMSVGTitleElement
   : nsIDOMSVGElement
 /*
   The SVG DOM makes use of multiple interface inheritance.
   Since XPCOM only supports single interface inheritance,
   the best thing that we can do is to promise that whenever
   an object implements _this_ interface it will also
   implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/svg/nsIDOMSVGUseElement.idl
+++ b/dom/interfaces/svg/nsIDOMSVGUseElement.idl
@@ -33,17 +33,17 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMSVGElement.idl"
 
 interface nsIDOMSVGAnimatedLength;
 
-[scriptable, uuid(9d5c4ac2-645f-478d-bd44-68d2f1d9d466)]
+[scriptable, uuid(1C2F17CF-3ABF-4E03-94AF-E0A3B93CEEBB)]
 interface nsIDOMSVGUseElement
   : nsIDOMSVGElement
 /*
   The SVG DOM makes use of multiple interface inheritance.
   Since XPCOM only supports single interface inheritance,
   the best thing that we can do is to promise that whenever
   an object implements _this_ interface it will also
   implement the following interfaces. (We then have to QI to
--- a/dom/interfaces/xul/nsIDOMXULButtonElement.idl
+++ b/dom/interfaces/xul/nsIDOMXULButtonElement.idl
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMXULLabeledControlEl.idl"
 
-[scriptable, uuid(b2057c12-27d6-45e3-ab8e-aec74217d32c)]
+[scriptable, uuid(A0308BD1-A6D7-4352-86F9-2BD4AEE2EAFC)]
 interface nsIDOMXULButtonElement : nsIDOMXULLabeledControlElement {
   const short CHECKSTATE_UNCHECKED = 0;
   const short CHECKSTATE_CHECKED = 1;
   const short CHECKSTATE_MIXED = 2;
 
   attribute DOMString type;
   attribute DOMString dlgType;
 
--- a/dom/interfaces/xul/nsIDOMXULCheckboxElement.idl
+++ b/dom/interfaces/xul/nsIDOMXULCheckboxElement.idl
@@ -35,17 +35,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMElement.idl"
 #include "nsIDOMXULLabeledControlEl.idl"
 
-[scriptable, uuid(2873c8d4-4098-4a30-a98d-ec1684c2fd87)]
+[scriptable, uuid(A275393E-8402-46E1-8229-F1CE5B2E926C)]
 interface nsIDOMXULCheckboxElement : nsIDOMXULLabeledControlElement {
   const short CHECKSTATE_UNCHECKED = 0;
   const short CHECKSTATE_CHECKED = 1;
   const short CHECKSTATE_MIXED = 2;
 
   attribute boolean checked;
   attribute long checkState;
   attribute boolean autoCheck;
--- a/dom/interfaces/xul/nsIDOMXULContainerElement.idl
+++ b/dom/interfaces/xul/nsIDOMXULContainerElement.idl
@@ -34,26 +34,26 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMXULElement.idl"
 interface nsIDOMXULContainerElement;
 
-[scriptable, uuid(156c66b4-6dd2-47e7-8090-f7cdea63dec3)]
+[scriptable, uuid(6B94FBAB-5171-432C-8E7A-6183C535E344)]
 interface nsIDOMXULContainerItemElement : nsIDOMXULElement
 {
   /**
    * Returns the parent container if any.
    */
   readonly attribute nsIDOMXULContainerElement parentContainer;
 };
 
-[scriptable, uuid(237192dc-8b36-4f6c-9883-1047949e8399)]
+[scriptable, uuid(40211F96-98A5-4DE5-BE0C-8CBF4CA4D615)]
 interface nsIDOMXULContainerElement : nsIDOMXULContainerItemElement
 {
   /**
    * Creates an item for the given label and value and appends it to the
    * container.
    *
    * @param aLabel - the label for the new item
    * @param aValue - the value of the new item
--- a/dom/interfaces/xul/nsIDOMXULControlElement.idl
+++ b/dom/interfaces/xul/nsIDOMXULControlElement.idl
@@ -37,17 +37,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMElement.idl"
 #include "nsIDOMXULElement.idl"
 
 interface nsIControllers;
 
-[scriptable, uuid(2574d3c9-07b5-44b2-8bec-890329623696)]
+[scriptable, uuid(6E4ADF19-92D9-4866-8F09-9C71FD4AF430)]
 interface nsIDOMXULControlElement : nsIDOMXULElement {
   attribute boolean disabled;
   attribute long tabIndex;
   
 // XXX defined in XULElement, but should be defined here
 //  readonly attribute nsIControllers controllers;
   
 //  void focus();
--- a/dom/interfaces/xul/nsIDOMXULDescriptionElement.idl
+++ b/dom/interfaces/xul/nsIDOMXULDescriptionElement.idl
@@ -35,15 +35,15 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMXULElement.idl"
 
-[scriptable, uuid(eb1a8ac7-b106-4af1-9c96-159cee1f8cc4)]
+[scriptable, uuid(31063E54-678C-442C-B487-D87F4C3E4751)]
 interface nsIDOMXULDescriptionElement : nsIDOMXULElement {
   attribute boolean disabled;
   attribute boolean crop;
   attribute DOMString value;
 };
 
--- a/dom/interfaces/xul/nsIDOMXULImageElement.idl
+++ b/dom/interfaces/xul/nsIDOMXULImageElement.idl
@@ -32,13 +32,13 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMElement.idl"
 #include "nsIDOMXULElement.idl"
 
-[scriptable, uuid(320a5a86-3f38-4631-acfc-dbe9dd5316fe)]
+[scriptable, uuid(A21944EA-FB11-4B37-80ED-38C8D12D0649)]
 interface nsIDOMXULImageElement : nsIDOMXULElement {
   attribute DOMString src;
 };
 
--- a/dom/interfaces/xul/nsIDOMXULLabelElement.idl
+++ b/dom/interfaces/xul/nsIDOMXULLabelElement.idl
@@ -34,14 +34,14 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMXULDescriptionElement.idl"
 
-[scriptable, uuid(68af51d9-3fd0-429d-98e9-959f83d34ae6)]
+[scriptable, uuid(042FB07F-AFEB-454E-809C-532A5A8557D0)]
 interface nsIDOMXULLabelElement : nsIDOMXULDescriptionElement {
   attribute DOMString accessKey;
   attribute DOMString control;
 };
 
--- a/dom/interfaces/xul/nsIDOMXULLabeledControlEl.idl
+++ b/dom/interfaces/xul/nsIDOMXULLabeledControlEl.idl
@@ -35,17 +35,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMElement.idl"
 #include "nsIDOMXULControlElement.idl"
 
-[scriptable, uuid(0fda2256-4a1c-41b1-bafb-908ae09f4858)]
+[scriptable, uuid(DD80E029-5535-4418-B3A0-13CF6BD2AA6B)]
 interface nsIDOMXULLabeledControlElement : nsIDOMXULControlElement {
   attribute DOMString crop;
   attribute DOMString image;
   attribute DOMString label;
   attribute DOMString accessKey;
   attribute DOMString command;
 
 //  void doCommand();
--- a/dom/interfaces/xul/nsIDOMXULMenuListElement.idl
+++ b/dom/interfaces/xul/nsIDOMXULMenuListElement.idl
@@ -35,17 +35,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMXULSelectCntrlEl.idl"
 interface nsIDOMXULTextBoxElement;
 
-[scriptable, uuid(de18d11b-8380-44c9-9e57-94c90431e370)]
+[scriptable, uuid(510561F2-7772-4DE3-934E-F4619509398B)]
 interface nsIDOMXULMenuListElement : nsIDOMXULSelectControlElement {
   attribute boolean editable;
   attribute boolean open;
   
   // label of selected option or value of textfield for editable menu lists
   readonly attribute DOMString label;
 
   attribute DOMString crop;
--- a/dom/interfaces/xul/nsIDOMXULMultSelectCntrlEl.idl
+++ b/dom/interfaces/xul/nsIDOMXULMultSelectCntrlEl.idl
@@ -34,17 +34,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMXULSelectCntrlEl.idl"
 
-[scriptable, uuid(ad5a4cb8-8dce-46df-b85a-7894dac66463)]
+[scriptable, uuid(E3CD8269-9502-4E70-910C-0D6D71B22253)]
 interface nsIDOMXULMultiSelectControlElement : nsIDOMXULSelectControlElement
 {
   attribute DOMString selType;
 
   attribute nsIDOMXULSelectControlItemElement currentItem;
   attribute long currentIndex;
 
   readonly attribute nsIDOMNodeList selectedItems;
--- a/dom/interfaces/xul/nsIDOMXULPopupElement.idl
+++ b/dom/interfaces/xul/nsIDOMXULPopupElement.idl
@@ -34,17 +34,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMElement.idl"
 #include "nsIDOMXULElement.idl"
 
-[scriptable, uuid(e8beb7ac-63dd-4c9a-8da4-b2ebd9e4d60f)]
+[scriptable, uuid(53E3087D-0D16-4F29-9412-EE9EC3F4AD25)]
 interface nsIDOMXULPopupElement : nsIDOMXULElement {
   const unsigned short      BEFORE_START                   = 1;
   const unsigned short      BEFORE_END                     = 2;
   const unsigned short      AFTER_START                    = 3;
   const unsigned short      AFTER_END                      = 4;
   const unsigned short      START_BEFORE                   = 5;
   const unsigned short      START_AFTER                    = 6;
   const unsigned short      END_BEFORE                     = 7;
--- a/dom/interfaces/xul/nsIDOMXULSelectCntrlEl.idl
+++ b/dom/interfaces/xul/nsIDOMXULSelectCntrlEl.idl
@@ -34,17 +34,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMXULControlElement.idl"
 interface nsIDOMXULSelectControlItemElement;
 
-[scriptable, uuid(5cc7f3ab-a244-4674-9d86-6509b7fd3025)]
+[scriptable, uuid(5775F3E3-B6C1-4047-B59A-5775937D87F2)]
 interface nsIDOMXULSelectControlElement : nsIDOMXULControlElement {
   attribute nsIDOMXULSelectControlItemElement selectedItem;
   attribute long selectedIndex;
 
   attribute DOMString value;
   
   nsIDOMXULSelectControlItemElement appendItem(in DOMString label, in DOMString value);
   nsIDOMXULSelectControlItemElement insertItemAt(in long index, in DOMString label, in DOMString value);
--- a/dom/interfaces/xul/nsIDOMXULSelectCntrlItemEl.idl
+++ b/dom/interfaces/xul/nsIDOMXULSelectCntrlItemEl.idl
@@ -34,17 +34,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMXULElement.idl"
 interface nsIDOMXULSelectControlElement;
 
-[scriptable, uuid(ad66674e-cf5f-40f0-8053-87aa9ddfac62)]
+[scriptable, uuid(6EFA5B50-4197-4015-BC0C-A61762FBDAF1)]
 interface nsIDOMXULSelectControlItemElement : nsIDOMXULElement {
   attribute boolean disabled;
   attribute DOMString crop;
   attribute DOMString image;
   attribute DOMString label;
   attribute DOMString accessKey;
   attribute DOMString command;
   
--- a/dom/interfaces/xul/nsIDOMXULTextboxElement.idl
+++ b/dom/interfaces/xul/nsIDOMXULTextboxElement.idl
@@ -34,17 +34,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMXULLabeledControlEl.idl"
 interface nsIDOMHTMLInputElement;
 
-[scriptable, uuid(0fa9b092-952f-4e54-aa05-5025448c104f)]
+[scriptable, uuid(1CDD14AC-6707-43D8-86DE-791D21CDAFED)]
 interface nsIDOMXULTextBoxElement : nsIDOMXULControlElement
 {
   // inputField may be any type of editable field, such as an
   // HTML <input type="text"> or <textarea>
   readonly attribute nsIDOMNode inputField;
 
   readonly attribute long textLength;
   attribute long maxLength;
--- a/dom/tests/mochitest/Makefile.in
+++ b/dom/tests/mochitest/Makefile.in
@@ -52,16 +52,17 @@ DIRS	+= \
 	chrome \
 	general \
 	whatwg \
 	geolocation \
 	localstorage \
 	orientation \
 	sessionstorage \
 	storageevent \
+	pointerlock \
 	w3c \
 	browser-frame \
 	$(NULL)
 
 #needs IPC support, also tests do not run successfully in Firefox for now
 #ifneq (mobile,$(MOZ_BUILD_APP))
 #DIRS	+= notification
 #endif
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/Makefile.in
@@ -0,0 +1,38 @@
+# 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/.
+
+DEPTH	= ../../../..
+topsrcdir	= @top_srcdir@
+srcdir	= @srcdir@
+VPATH	= @srcdir@
+relativesrcdir	= dom/tests/mochitest/pointerlock
+
+include $(DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/rules.mk
+
+_TEST_FILES	= \
+		test_pointerlock-api.html \
+		pointerlock_utils.js \
+		file_pointerlock-api.html \
+		file_pointerlockerror.html \
+		file_escapeKey.html \
+		file_withoutDOM.html \
+		file_removedFromDOM.html \
+		file_pointerLockPref.html \
+		file_nestedFullScreen.html \
+		file_doubleLock.html \
+		file_childIframe.html \
+		file_movementXY.html \
+		file_infiniteMovement.html \
+		file_retargetMouseEvents.html \
+		file_targetOutOfFocus.html \
+		file_screenClientXYConst.html \
+		file_suppressSomeMouseEvents.html \
+		file_locksvgelement.html \
+		iframe_differentDOM.html \
+		$(NULL)
+
+libs:: $(_TEST_FILES)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_childIframe.html
@@ -0,0 +1,141 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+-->
+<head>
+  <title>Bug 633602 - file_childIframe.html</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+  </script>
+  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="application/javascript" src="pointerlock_utils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <style>
+    #parent, #childDiv, #iframe, #table, #table td {
+      margin: 0;
+      padding: 0;
+      border: none;
+    }
+    #iframe, #table {
+      background-color: red;
+      width: 100%;
+      height: 100%;
+    }
+    #childDiv, #table td {
+      background-color: blue;
+      width: 50%;
+      height: 50%;
+    }
+  </style>
+</head>
+<body>
+  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+    Mozilla Bug 633602
+  </a>
+
+  <div id="parent">
+    <table id="childTable">
+      <tr>
+        <td>
+          <iframe id="iframe" src="iframe_differentDOM.html" onload="start();">
+          </iframe>
+        </td>
+        <td>
+          <div id="childDiv">
+          </div>
+        </td>
+      </tr>
+    </table>
+  </div>
+
+  <pre id="test">
+    <script type="application/javascript">
+      /*
+       * Test for Bug 633602
+       * Check if pointer is locked when over a child iframe of
+       * the locked element
+       * Check if pointer is being repositioned back to center of
+       * the locked element even when pointer goes over a child ifame
+       */
+
+      SimpleTest.waitForExplicitFinish();
+
+      var parent = document.getElementById("parent")
+        , childDiv = document.getElementById("childDiv")
+        , iframe = document.getElementById("iframe");
+
+      function MozMovementStats() {
+        this.mozMovementX = false;
+        this.mozMovementY = false;
+      }
+
+      var firstMove = new MozMovementStats()
+        , secondMove = new MozMovementStats()
+        , hoverIframe = false;
+
+      function runTests () {
+        ok(hoverIframe, "Pointer should be locked even when pointer " +
+          "hovers over a child iframe");
+        is(firstMove.mozMovementX, secondMove.mozMovementX, "MovementX of first " +
+          "move to childDiv should be equal to movementX of second move " +
+          "to child div");
+        is(firstMove.mozMovementY, secondMove.mozMovementY, "MovementY of first " +
+          "move to childDiv should be equal to movementY of second move " +
+          "to child div");
+      }
+
+      var firstMoveChild = function (e) {
+        firstMove.mozMovementX = e.mozMovementX;
+        firstMove.mozMovementY = e.mozMovementY;
+
+        parent.removeEventListener("mousemove", firstMoveChild);
+        parent.addEventListener("mousemove", moveIframe);
+
+        synthesizeMouseAtCenter(iframe, {type: "mousemove"}, window);
+      };
+
+      var moveIframe = function (e) {
+        hoverIframe = !!document.mozPointerLockElement;
+
+        parent.removeEventListener("mousemove", moveIframe);
+        parent.addEventListener("mousemove", secondMoveChild);
+
+        synthesizeMouseAtCenter(childDiv, {type: "mousemove"}, window);
+      };
+
+      var secondMoveChild = function (e) {
+        secondMove.mozMovementX = e.mozMovementX;
+        secondMove.mozMovementY = e.mozMovementY;
+        parent.removeEventListener("mousemove", secondMoveChild);
+
+        document.mozCancelFullScreen();
+      };
+
+      document.addEventListener("mozpointerlockchange", function () {
+        if (document.mozPointerLockElement === parent) {
+          parent.addEventListener("mousemove", firstMoveChild);
+          synthesizeMouseAtCenter(childDiv, {type: "mousemove"}, window);
+        }
+      }, false);
+
+      document.addEventListener("mozpointerlockerror", function () {
+        document.mozCancelFullScreen();
+      }, false);
+
+      document.addEventListener("mozfullscreenchange", function (e)  {
+        if (document.mozFullScreenElement === parent) {
+          parent.mozRequestPointerLock();
+        }
+        else {
+          runTests();
+          SimpleTest.finish();
+        }
+      }, false);
+
+      function start() {
+        parent.mozRequestFullScreen();
+      }
+    </script>
+  </pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_doubleLock.html
@@ -0,0 +1,69 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+-->
+<head>
+  <title>Bug 633602 - file_doubleLockCallBack.html</title>
+  <script type="text/javascript"
+          src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript"
+          src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="application/javascript" src="pointerlock_utils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <style type="text/css">
+      #test-element { background-color: #94E01B; width:100px; height:100px; }
+  </style>
+</head>
+<body>
+  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+    Mozilla Bug 633602</a>
+  <div id="div"></div>
+  <pre id="test">
+    <script type="text/javascript">
+      /*
+       * Test for Bug 633602
+       * If element requests pointerlock on itself while in pointerlock state
+       * mozpointerlockchange event should be dispatched
+       */
+
+      SimpleTest.waitForExplicitFinish();
+
+      var div = document.getElementById("div")
+        , numberOfLocks = 0;
+
+      function runTests () {
+        is(numberOfLocks, 2, "Requesting pointer lock on a locked element " +
+          "should dispatch mozpointerlockchange event");
+      }
+
+      document.addEventListener("mozpointerlockchange", function (e) {
+        if (document.mozPointerLockElement === div) {
+          if (numberOfLocks === 2) {
+            document.mozCancelFullScreen();
+          }
+          else {
+            numberOfLocks++;
+            div.mozRequestPointerLock();
+          }
+        }
+      }, false);
+
+      document.addEventListener("mozfullscreenchange", function (e) {
+        if (document.mozFullScreenElement === div) {
+          div.mozRequestPointerLock();
+        }
+        else {
+          runTests();
+          SimpleTest.finish();
+        }
+      }, false);
+
+      function start() {
+        console.log('started');
+        div.mozRequestFullScreen();
+      }
+    </script>
+  </pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_escapeKey.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML>
+<html>
+<!--https://bugzilla.mozilla.org/show_bug.cgi?id=633602-->
+<head>
+  <title>Bug 633602</title>
+  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js">
+  </script>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+  </script>
+  <script type="application/javascript" src="pointerlock_utils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+  <a target="_blank"
+    href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+    Mozilla Bug 633602
+  </a>
+  <div id="div"></div>
+  <pre id="test">
+    <script type="text/javascript">
+      /*
+       * Test for Bug 633602
+       * Escape key should unlock the pointer
+       */
+
+      SimpleTest.waitForExplicitFinish();
+
+      var div = document.getElementById("div")
+        , pointerUnLocked = false;
+
+      function runTests () {
+        ok(pointerUnLocked, "Pressing Escape key should unlock the pointer");
+      }
+
+      document.addEventListener("mozpointerlockchange", function (e) {
+        if (document.mozPointerLockElement === div) {
+          synthesizeKey("VK_ESCAPE", {});
+        }
+        else {
+          pointerUnLocked = true;
+          document.mozCancelFullScreen();
+        }
+      }, false);
+
+      document.addEventListener("mozfullscreenchange", function(e) {
+        if (document.mozFullScreenElement === div) {
+          div.mozRequestPointerLock();
+        }
+        else {
+          runTests();
+          SimpleTest.finish();
+        }
+      }, false);
+
+      function start() {
+        div.mozRequestFullScreen();
+      }
+    </script>
+  </pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_infiniteMovement.html
@@ -0,0 +1,98 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+-->
+  <head>
+    <title>Bug 633602 - file_movementXY.html</title>
+    <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+    </script>
+    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js">
+    </script>
+    <script type="application/javascript" src="pointerlock_utils.js"></script>
+    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  </head>
+  <body>
+    <a target="_blank"
+      href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+      Mozilla Bug 633602
+    </a>
+    <div id="div"></div>
+    <pre id="test">
+      <script type="application/javascript">
+        /*
+         * Test for Bug 633602
+         * This test checks if mozMovementX and mozMovementY
+         * are present in a mouse event object.
+         * It also checks the values for mozMovementXY.
+         * They should be equal to the current screenXY minus
+         * the last screenXY
+         * This test will also test that the incremental movement is
+         * not constrained to the width of the screen.
+         */
+
+        SimpleTest.waitForExplicitFinish();
+
+        var div = document.getElementById("div")
+          , divCenterWidth = 0
+          , divCenterHeight = 0
+          , totalMovementX = 0
+          , totalMovementY = 0;
+
+        function runTests () {
+          ok(totalMovementX > div.getBoundingClientRect().width,
+               "Should have moved more than one screen's worth in width." +
+               "TotalX: " + totalMovementX + " Screensize X: " + div.getBoundingClientRect().width);
+          ok(totalMovementY > div.getBoundingClientRect().height,
+             "Should have moved more than one screen's worth in height." +
+             "TotalY: " + totalMovementY + " Screensize Y: " + div.getBoundingClientRect().height);
+        }
+
+        var firstMoveListener = function (e) {
+          div.removeEventListener("mousemove", firstMoveListener, false);
+          div.addEventListener("mousemove", secondMoveListener, false);
+
+          synthesizeMouse(div,(divCenterWidth/2) * 3,
+            (divCenterHeight/2) * 3, {
+            type: "mousemove"
+          }, window);
+        }
+
+        var secondMoveListener = function (e) {
+          totalMovementX = divCenterWidth + ((divCenterWidth / 2) * 3);
+          totalMovementY = divCenterHeight + ((divCenterHeight / 2) * 3);
+
+          div.removeEventListener("mousemove", secondMoveListener, false);
+          document.mozCancelFullScreen();
+        }
+
+        document.addEventListener("mozpointerlockchange", function (e) {
+          if (document.mozPointerLockElement === div) {
+            div.addEventListener("mousemove", firstMoveListener, false);
+
+            divCenterWidth = Math.round(div.getBoundingClientRect().width / 2);
+            divCenterHeight = Math.round(div.getBoundingClientRect().height / 2);
+
+            synthesizeMouse(div, divCenterWidth, divCenterHeight, {
+              type: "mousemove"
+            }, window);
+          }
+        }, false);
+
+        document.addEventListener("mozfullscreenchange", function() {
+          if (document.mozFullScreenElement === div) {
+            div.mozRequestPointerLock();
+          }
+          else {
+            runTests();
+            SimpleTest.finish();
+          }
+        }, false);
+
+        function start() {
+          div.mozRequestFullScreen();
+        }
+      </script>
+    </pre>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_locksvgelement.html
@@ -0,0 +1,64 @@
+<!DOCTYPE HTML>
+<html>
+  <!--
+  https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+  -->
+  <head>
+    <title>Bug 633602</title>
+    <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+    </script>
+    <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js">
+    </script>
+    <script type="application/javascript" src="pointerlock_utils.js"></script>
+    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+  </head>
+  <body>
+    <a target="_blank"
+       href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+      Mozilla Bug 633602</a>
+    <p id="display"></p>
+
+    <svg width="100" height="100" viewbox="0 0 100 100">
+        <rect id="svg-elem" x="10" y="10" width="50" height="50"
+        fill="black" stroke="blue" stroke-width="2"/>
+    </svg>
+
+    <pre id="test">
+      <script type="application/javascript">
+        /*
+         * Test for Bug 633602
+         * Test locking non-html element.
+         */
+
+        SimpleTest.waitForExplicitFinish(1);
+
+        var elem,
+          elemWasLocked = false;
+
+        document.addEventListener("mozpointerlockchange", function (e) {
+          if (document.mozFullScreen &&
+              document.mozPointerLockElement === elem) {
+            elemWasLocked = true;
+            document.mozExitPointerLock();
+          } else {
+            document.mozCancelFullScreen();
+          }
+        }, false);
+
+        document.addEventListener("mozfullscreenchange", function (e) {
+          if (document.mozFullScreenElement === elem) {
+            elem.mozRequestPointerLock();
+          } else {
+            ok(elemWasLocked, "Expected SVG elem to become locked.");
+            SimpleTest.finish();
+          }
+        }, false);
+
+        function start() {
+          elem = document.getElementById("svg-elem");
+          elem.mozRequestFullScreen();
+        }
+      </script>
+    </pre>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_movementXY.html
@@ -0,0 +1,103 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+-->
+  <head>
+    <title>Bug 633602 - file_movementXY.html</title>
+    <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+    </script>
+    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js">
+    </script>
+    <script type="application/javascript" src="pointerlock_utils.js"></script>
+    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  </head>
+  <body>
+    <a target="_blank"
+      href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+      Mozilla Bug 633602
+    </a>
+    <div id="div"></div>
+    <pre id="test">
+      <script type="application/javascript">
+        /*
+         * Test for Bug 633602
+         * Checks if mozMovementX and mozMovementY are present
+         * in the mouse event object.
+         * It also checks the values for mozMovementXY.
+         * They should be equal to the current screenXY minus
+         * the last screenXY
+         */
+
+        SimpleTest.waitForExplicitFinish();
+
+        function MouseMovementStats() {
+          this.screenX = false;
+          this.screenY = false;
+          this.mozMovementX = false;
+          this.mozMovementY = false;
+        }
+
+        var div = document.getElementById("div")
+          , divCenterWidth = 0
+          , divCenterHeight = 0
+          , mozMovementX = false
+          , mozMovementY = false
+          , firstMove = new MouseMovementStats()
+          , secondMove = new MouseMovementStats();
+
+        function runTests () {
+          ok(mozMovementX && mozMovementY, "mozMovementX and " +
+            "mozMovementY should exist in mouse events objects.");
+          is(secondMove.mozMovementX, secondMove.screenX - firstMove.screenX,
+           "mozMovementX should be equal to eNow.screenX-ePrevious.screenX");
+          is(secondMove.mozMovementY, secondMove.screenY - firstMove.screenY,
+           "mozMovementY should be equal to eNow.screenY-ePrevious.screenY");
+        }
+
+        var moveMouse = function(e) {
+          mozMovementX = ("mozMovementX" in e);
+          mozMovementY = ("mozMovementY" in e);
+
+          div.removeEventListener("mousemove", moveMouse, false);
+          div.addEventListener("mousemove", moveMouseAgain, false);
+
+          firstMove.screenX = e.screenX;
+          firstMove.screenY = e.screenY;
+
+          divCenterWidth = Math.round(div.getBoundingClientRect().width / 2);
+          divCenterHeight = Math.round(div.getBoundingClientRect().height / 2);
+
+          synthesizeMouse(div, (divCenterWidth + 10), (divCenterHeight + 10), {
+            type: "mousemove"
+          }, window);
+        };
+
+        var moveMouseAgain = function(e) {
+          secondMove.screenX = e.screenX;
+          secondMove.screenY = e.screenY;
+          secondMove.mozMovementX = e.mozMovementX;
+          secondMove.mozMovementY = e.mozMovementY;
+
+          div.removeEventListener("mousemove", moveMouseAgain, false);
+          document.mozCancelFullScreen();
+        };
+
+        document.addEventListener("mozfullscreenchange", function() {
+          if (document.mozFullScreenElement === div) {
+            div.addEventListener("mousemove", moveMouse, false);
+            synthesizeMouseAtCenter(div, {type: "mousemove"}, window);
+          }
+          else {
+            runTests();
+            SimpleTest.finish();
+          }
+        }, false);
+
+        function start() {
+          div.mozRequestFullScreen();
+        }
+      </script>
+    </pre>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML>
+<html>
+  <!--
+  https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+  -->
+  <head>
+    <title>Bug 633602 - file_nestedFullScreen.html</title>
+    <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+    </script>
+    <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js">
+    </script>
+    <script type="application/javascript" src="pointerlock_utils.js"></script>
+    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  </head>
+  <body>
+    <a target="_blank"
+       href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+      Mozilla Bug 633602
+    </a>
+
+    <div id="parentDiv">
+      <div id="childDiv"></div>
+    </div>
+
+    <script type="application/javascript">
+      /*
+       * Test for Bug 633602
+       * Requesting fullscreen on a child element of the element with
+       * the pointer locked should unlock the pointer
+       */
+
+      SimpleTest.waitForExplicitFinish();
+
+      var parentDiv = document.getElementById("parentDiv")
+        , childDiv = document.getElementById("childDiv")
+        , parentDivLocked = false
+        , parentDivFullScreen = false
+        , pointerLocked = false;
+
+      function runTests () {
+        ok(parentDivLocked, "After requesting pointerlock on parentDiv " +
+          "document.mozPointerLockElement should be equal to " +
+          " parentDiv element");
+        isnot(pointerLocked, true, "Requesting fullscreen on " +
+          "childDiv while parentDiv still in fullscreen should " +
+          "unlock the pointer");
+      }
+
+      document.addEventListener("mozpointerlockchange", function (e) {
+        if (document.mozPointerLockElement === parentDiv) {
+          parentDivLocked = true;
+          childDiv.mozRequestFullScreen();
+        }
+      }, false);
+
+      document.addEventListener("mozfullscreenchange", function() {
+        if (document.mozFullScreenElement === parentDiv) {
+          if (parentDivFullScreen === true) {
+            document.mozCancelFullScreen();
+          }
+          parentDivFullScreen = true;
+          parentDiv.mozRequestPointerLock();
+        }
+        else if (document.mozFullScreenElement === childDiv) {
+          pointerLocked = !!document.mozPointerLockElement;
+          document.mozCancelFullScreen();
+        }
+        else {
+          runTests();
+          SimpleTest.finish();
+        }
+      }, false);
+
+      function start() {
+        parentDiv.mozRequestFullScreen();
+      }
+    </script>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_pointerLockPref.html
@@ -0,0 +1,78 @@
+<!DOCTYPE HTML>
+<html>
+  <!--
+  https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+  -->
+  <head>
+    <title>Bug 633602</title>
+    <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+    </script>
+    <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js">
+    </script>
+    <script type="application/javascript" src="pointerlock_utils.js"></script>
+    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+  </head>
+  <body>
+    <a target="_blank"
+       href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+      Mozilla Bug 633602</a>
+    <p id="display"></p>
+    <div id="div"></div>
+    <pre id="test">
+      <script type="application/javascript">
+        /*
+         * Test for Bug 633602
+         * Tests full-screen-api.pointer-lock pref
+         */
+
+        SimpleTest.waitForExplicitFinish();
+
+        var div = document.getElementById("div")
+          , prefEnabled = false
+          , prefDisabled = false;
+
+        function runTests () {
+          ok(prefEnabled, "Element should be able to lock the pointer " +
+            "if pointer-lock pref is set to TRUE");
+          ok(prefDisabled, "Element should NOT be able to lock the pointer " +
+            "if pointer-lock pref is set to FALSE");
+        }
+
+        document.addEventListener("mozpointerlockchange", function (e) {
+          if (document.mozPointerLockElement === div) {
+            prefEnabled = true;
+            document.mozExitPointerLock();
+          }
+          else {
+            SpecialPowers.setBoolPref("full-screen-api.pointer-lock.enabled",
+                                      false );
+            div.mozRequestPointerLock();
+          }
+        }, false);
+
+        document.addEventListener("mozpointerlockerror", function (e) {
+          prefDisabled = true;
+          document.mozCancelFullScreen();
+        }, false);
+
+        document.addEventListener("mozfullscreenchange", function (e) {
+          if (document.mozFullScreenElement === div) {
+            SpecialPowers.setBoolPref("full-screen-api.pointer-lock.enabled",
+                                      true );
+            div.mozRequestPointerLock();
+          }
+          else {
+            SpecialPowers.setBoolPref("full-screen-api.pointer-lock.enabled",
+                                       true );
+            runTests();
+            SimpleTest.finish();
+          }
+        }, false);
+
+        function start() {
+          div.mozRequestFullScreen();
+        }
+      </script>
+    </pre>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_pointerlock-api.html
@@ -0,0 +1,90 @@
+<!DOCTYPE HTML>
+<html>
+<!--https://bugzilla.mozilla.org/show_bug.cgi?id=633602-->
+<head>
+  <title>Bug 633602</title>
+  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js">
+  </script>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+  </script>
+  <script type="application/javascript" src="pointerlock_utils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+  <a target="_blank"
+    href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+    Mozilla Bug 633602
+  </a>
+  <div id="div"></div>
+  <pre id="test">
+    <script type="text/javascript">
+      /*
+       * Test for Bug 633602
+       * Make sure DOM API is correct.
+       */
+
+      SimpleTest.waitForExplicitFinish();
+
+      var div,
+        hasRequestPointerLock = false,
+        pointerLockChangeEventFired = false,
+        pointerUnlocked = false,
+        pointerLocked = false,
+        hasExitPointerLock = false,
+        pointerLockElement = false,
+        hasMovementX = false,
+        hasMovementY = false;
+
+      function runTests () {
+        ok(hasRequestPointerLock, "Element should have mozRequestPointerLock.");
+        ok(pointerLockChangeEventFired, "pointerlockchange event should fire.");
+        ok(pointerUnlocked, "Should be able to unlock pointer locked element.");
+        ok(pointerLocked, "Requested element should be able to lock.");
+        ok(hasExitPointerLock, "Document should have mozExitPointerLock");
+        ok(pointerLockElement, "Document should keep track of correct pointer locked element");
+        ok(hasMovementX, "Mouse Event should have mozMovementX.");
+        ok(hasMovementY, "Mouse Event should have mozMovementY.");
+      }
+
+      function mouseMoveHandler(e) {
+        document.removeEventListener("mousemove", mouseMoveHandler, false);
+
+        hasMovementX = "mozMovementX" in e;
+        hasMovementY = "mozMovementY" in e;
+
+        hasExitPointerLock = "mozExitPointerLock" in document;
+        document.mozExitPointerLock();
+      }
+
+      document.addEventListener("mozpointerlockchange", function (e) {
+        pointerLockChangeEventFired = true;
+
+        if (document.mozPointerLockElement) {
+          pointerLocked = true;
+          pointerLockElement = document.mozPointerLockElement === div;
+          document.addEventListener("mousemove", mouseMoveHandler, false);
+          synthesizeMouseAtCenter(div, {type: "mousemove"}, window);
+        } else {
+          pointerUnlocked = true;
+          document.mozCancelFullScreen();
+        }
+      }, false);
+
+      document.addEventListener("mozfullscreenchange", function(e) {
+        if (document.mozFullScreenElement === div) {
+          hasRequestPointerLock = "mozRequestPointerLock" in div;
+          div.mozRequestPointerLock();
+        } else {
+          runTests();
+          SimpleTest.finish();
+        }
+      }, false);
+
+      function start() {
+        div = document.getElementById("div");
+        div.mozRequestFullScreen();
+      }
+    </script>
+  </pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_pointerlockerror.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML>
+<html>
+<!--https://bugzilla.mozilla.org/show_bug.cgi?id=633602-->
+<head>
+  <title>Bug 633602</title>
+  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js">
+  </script>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+  </script>
+  <script type="application/javascript" src="pointerlock_utils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+  <a target="_blank"
+    href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+    Mozilla Bug 633602
+  </a>
+
+  <pre id="test">
+    <script type="text/javascript">
+      /*
+       * Test for Bug 633602
+       * Make sure pointerlockerror event fires.
+       */
+
+      SimpleTest.waitForExplicitFinish();
+
+      document.addEventListener("mozpointerlockerror", function (e) {
+        ok(true, "pointerlockerror event should fire.");
+        SimpleTest.finish();
+      }, false);
+
+      function start() {
+        // element not in the DOM, not fullscreen, should fail to lock
+        div = document.createElement("div");
+        div.mozRequestPointerLock();
+      }
+    </script>
+  </pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_removedFromDOM.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<html>
+  <!--
+  https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+
+  Test DOM tree in full screen
+  -->
+  <head>
+    <title>Bug 633602 - file_DOMtree.html</title>
+    <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js">
+    </script>
+    <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+    </script>
+    <script type="application/javascript" src="pointerlock_utils.js"></script>
+    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+    <style>
+    </style>
+  </head>
+  <body>
+    <a target="_blank"
+       href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+      Mozilla Bug 633602
+    </a>
+    <div id="div"></div>
+    <pre id="test">
+      <script type="text/javascript">
+        /*
+         * Test for Bug 633602
+         * Checks if pointer is unlocked when element is removed from
+         * the DOM Tree
+         */
+
+        SimpleTest.waitForExplicitFinish();
+
+        var div = document.getElementById("div")
+          , removedDOM = false;
+
+        function runTests() {
+          ok(removedDOM, "Pointer should be unlocked when " +
+            "an element is removed the DOM Tree");
+        }
+
+        document.addEventListener("mozpointerlockchange", function (e) {
+          if (document.mozPointerLockElement === div) {
+            document.body.removeChild(div);
+            removedDOM = !document.mozPointerLockElement;
+            document.mozCancelFullScreen();
+          }
+
+        }, false);
+
+        document.addEventListener("mozfullscreenchange", function (e) {
+          if (document.mozFullScreenElement === div) {
+              div.mozRequestPointerLock();
+          }
+          else {
+            runTests();
+            SimpleTest.finish();
+          }
+        }, false);
+
+        function start() {
+          div.mozRequestFullScreen();
+        }
+      </script>
+    </pre>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html
@@ -0,0 +1,161 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+-->
+<head>
+  <title>Bug 633602 - file_retargetMouseEvents.html</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+  </script>
+  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="application/javascript" src="pointerlock_utils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+    Mozilla Bug 633602
+  </a>
+
+  <div id="parent">
+    <div id="child" style="width: 100%; height: 100%;">
+    </div>
+  </div>
+
+  <pre id="test">
+    <script type="application/javascript">
+      /*
+       * Test for Bug 633602
+       * Retarget mouse events to the locked element
+       */
+
+      SimpleTest.waitForExplicitFinish();
+
+      function MouseEventStats() {
+        this.mouseMove = false;
+        this.mouseDown = false;
+        this.mouseUp = false;
+        this.mouseClick = false;
+        this.mouseScroll = false;
+      }
+
+      var parent = document.getElementById("parent")
+        , child = document.getElementById("child")
+        , parentStats = new MouseEventStats()
+        , childStats = new MouseEventStats();
+
+      function runTests () {
+        is(childStats.mouseMove, false, "Child shound not receive mousemove event.");
+        is(childStats.mouseDown, false, "Child should not receive mousedown event.");
+        is(childStats.mouseUp, false, "Child should not receive mouseup event.");
+        is(childStats.mouseClick, false, "Child should not receive click event.");
+        is(childStats.mouseScroll, false, "Child should not receive DOMMouseScroll event.");
+
+        ok(parentStats.mouseMove, "Parent should receive mousemove event.");
+        ok(parentStats.mouseDown, "Parent should receive mousedown event.");
+        ok(parentStats.mouseUp, "Parent should receive mouseup event.");
+        ok(parentStats.mouseClick, "Parent should receive click event.");
+        ok(parentStats.mouseScroll, "Parent should receive DOMMouseScroll event.");
+      }
+
+
+      /**
+       * The event listeners for the child element shouldn't be fired
+       * Mouse events will only happen when the pointer is locked
+       * and if the pointer is locked all the mouse events should be
+       * retargetted to the locked element
+       **/
+      var childMoveTest = function() {
+        childStats.mouseMove = true;
+      }
+
+      var childDownTest = function() {
+        childStats.mouseDown = true;
+      };
+
+      var childUpTest = function() {
+        childStats.mouseUp = true;
+      };
+
+      var childClickTest = function() {
+        childStats.mouseClick = true;
+      };
+
+      var childScrollTest = function() {
+        childStats.mouseScroll = true;
+      };
+
+      //  Event listeners for the parent element
+      var startMouseTests = function() {
+        parent.removeEventListener("mousemove", startMouseTests);
+        parent.addEventListener("DOMMouseScroll", parentScrollTest);
+        child.addEventListener("DOMMouseScroll", childScrollTest);
+        synthesizeMouseScroll(child, 5, 5, {'delta': 10, 'type': "DOMMouseScroll"});
+      };
+
+      var parentScrollTest = function (e) {
+        parentStats.mouseScroll = true;
+        parent.removeEventListener("DOMMouseScroll", parentScrollTest);
+        child.removeEventListener("DOMMouseScroll", childScrollTest);
+        parent.addEventListener("mousedown", parentDownTest);
+        child.addEventListener("mousedown", childDownTest);
+        synthesizeMouseAtCenter(child, {type: "mousedown"}, window);
+      };
+
+      var parentDownTest = function (e) {
+        parentStats.mouseDown = true;
+        parent.removeEventListener("mousedown", parentDownTest);
+        child.removeEventListener("mousedown", childDownTest);
+        parent.addEventListener("mouseup", parentUpTest);
+        child.addEventListener("mouseup", childUpTest);
+        synthesizeMouseAtCenter(child, {type: "mouseup"}, window);
+      };
+
+      var parentUpTest = function (e) {
+        parentStats.mouseUp = true;
+        parent.removeEventListener("mouseup", parentUpTest);
+        child.removeEventListener("mouseup", childUpTest);
+        parent.addEventListener("click", parentClickTest);
+        child.addEventListener("click", childClickTest);
+        synthesizeMouseAtCenter(child, {type: "click"}, window);
+      };
+
+      var parentClickTest = function (e) {
+        parentStats.mouseClick = true;
+        parent.removeEventListener("click", parentClickTest);
+        child.removeEventListener("click", childClickTest);
+        parent.addEventListener("mousemove", parentMoveTest);
+        child.addEventListener("mousemove", childMoveTest);
+        synthesizeMouseAtCenter(child, {type: "mousemove"}, window);
+      };
+
+      var parentMoveTest = function (e) {
+        parentStats.mouseMove = true;
+        parent.removeEventListener("mousemove", parentMoveTest);
+        child.removeEventListener("mousemove", childMoveTest);
+        document.mozCancelFullScreen();
+      }
+
+      document.addEventListener("mozpointerlockchange", function (e) {
+        if (document.mozPointerLockElement === parent) {
+          parent.addEventListener("mousemove", startMouseTests);
+          child.addEventListener("mousemove", childMoveTest);
+          synthesizeMouseAtCenter(parent, {type: "mousemove"}, window);
+        }
+      }, false);
+
+      document.addEventListener("mozfullscreenchange", function (e)  {
+        if (document.mozFullScreenElement === parent) {
+          parent.mozRequestPointerLock();
+        } else {
+          runTests();
+          SimpleTest.finish();
+        }
+      }, false);
+
+      function start() {
+        parent.mozRequestFullScreen();
+      }
+    </script>
+  </pre>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html
@@ -0,0 +1,104 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+-->
+<head>
+  <title>Bug 633602 - constantXY.html</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+  </script>
+  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="application/javascript" src="pointerlock_utils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+    Mozilla Bug 633602
+  </a>
+  <div id="div"></div>
+  <script type="application/javascript">
+      /*
+       * Test for Bug 633602
+       * Confirm that screenX/Y and clientX/Y are constants when the pointer
+       * is locked.
+       */
+
+      SimpleTest.waitForExplicitFinish();
+
+      var div
+        , divRect
+        , unLockedCoords
+        , lockedCoords
+        , isUnlocked = false
+        , isLocked = false;
+
+      function runTests () {
+        ok(isUnlocked, "Pointer should be unlocked");
+        ok(isLocked, "Pointer should be locked");
+
+        // Confirm that pointer coords are constant while locked
+        is(unLockedCoords.clientX, lockedCoords.clientX,
+           "clientX should be equal to where the mouse was originaly locked");
+        is(unLockedCoords.clientY, lockedCoords.clientY,
+           "clientY should be equal to where the mouse was originaly locked");
+        is(unLockedCoords.screenX, lockedCoords.screenX,
+           "screenX should be equal to where the mouse was originaly locked");
+        is(unLockedCoords.screenY, lockedCoords.screenY,
+           "screenY should be equal to where the mouse was originaly locked");
+      }
+
+      function moveUnlocked(e) {
+        div.removeEventListener("mousemove", moveUnlocked, false);
+
+        isUnlocked = !document.mozPointerLockElement;
+        unLockedCoords = {
+          screenX: e.screenX,
+          screenY: e.screenY,
+          clientX: e.clientX,
+          clientY: e.clientY
+        };
+
+        div.mozRequestPointerLock();
+      }
+
+      function moveLocked(e) {
+        div.removeEventListener("mousemove", moveLocked, false);
+
+        isLocked = !!document.mozPointerLockElement;
+        lockedCoords = {
+          screenX: e.screenX,
+          screenY: e.screenY,
+          clientX: e.clientX,
+          clientY: e.clientY
+        };
+
+        document.mozCancelFullScreen();
+      }
+
+      document.addEventListener("mozpointerlockchange", function (e) {
+        if (document.mozPointerLockElement === div) {
+          div.addEventListener("mousemove", moveLocked, false);
+          divRect = div.getBoundingClientRect();
+          synthesizeMouse(div, (divRect.width / 4) * 3, (divRect.height / 4) * 3, {
+            type: "mousemove"
+          }, window);
+        }
+      }, false);
+
+      document.addEventListener("mozfullscreenchange", function() {
+        if (document.mozFullScreenElement === div) {
+          div.addEventListener("mousemove", moveUnlocked, false);
+          synthesizeMouseAtCenter(div, { type: "mousemove" }, window);
+        } else {
+          runTests();
+          SimpleTest.finish();
+        }
+      }, false);
+
+      function start() {
+        div = document.getElementById("div");
+        div.mozRequestFullScreen();
+      }
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html
@@ -0,0 +1,161 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+-->
+<head>
+  <title>Bug 633602 - file_cursorPosEvents.html</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+  </script>
+  <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <script type="application/javascript" src="pointerlock_utils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <style type="text/css">
+    #child {
+      width: 100px;
+      height: 100px;
+      background-color:Green;
+    }
+  </style>
+</head>
+<body>
+  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+  Mozilla Bug 633602</a>
+
+  <div id="parent">
+    <div id="child"></div>
+  </div>
+
+  <script type="application/javascript">
+      /*
+       * Test for Bug 633602
+       * Test will check to make sure that the following mouse events are no
+       * longer executed in pointer lock.
+       *  - mouseover, mouseout, mouseenter, mouseleave
+       */
+
+      SimpleTest.waitForExplicitFinish();
+
+      function PointerEventStats() {
+        this.mouseEnter = false;
+        this.mouseLeave = false;
+        this.mouseOver = false;
+        this.mouseOut = false;
+      }
+
+      var parent
+        , child
+        , parentStats = new PointerEventStats()
+        , childStats = new PointerEventStats()
+        , isPointerLocked = false;
+
+      function runTests () {
+        ok(isPointerLocked, "expected mouse to be locked, but wasn't.");
+
+        is(childStats.mouseEnter, false,
+           "child's mouseenter should not be firing in Full Screen and Pointer Lock.");
+        is(childStats.mouseOver, false,
+           "child's mouseover should not be firing in Full Screen and Pointer Lock.");
+        is(childStats.mouseLeave, false,
+           "child's mouseleave should not be firing in Full Screen and Pointer Lock.");
+        is(childStats.mouseOut, false,
+           "child's mouseout should not be firing in Full Screen and Pointer Lock.");
+
+        is(parentStats.mouseEnter, false,
+           "parent's mouseenter should not be firing in Full Screen and Pointer Lock.");
+        is(parentStats.mouseOver, false,
+           "parent's mouseover should not be firing in Full Screen and Pointer Lock.");
+        is(parentStats.mouseLeave, false,
+           "parent's mouseleave should not be firing in Full Screen and Pointer Lock.");
+        is(parentStats.mouseOut, false,
+           "parent's mouseout should not be firing in Full Screen and Pointer Lock.");
+      }
+
+      var parentMoveListener = function () {
+        isPointerLocked = !!document.mozPointerLockElement;
+        removeEventListeners();
+        document.mozExitPointerLock();
+      };
+
+      var parentOutListener = function (e) {
+          parentStats.mouseOut = true;
+      };
+      var parentLeaveListener = function (e) {
+          parentStats.mouseLeave = true;
+      };
+      var parentOverListener = function (e) {
+          parentStats.mouseOver = true;
+      };
+      var parentEnterListener = function (e) {
+          parentStats.mouseEnter = true;
+      };
+
+      var childOutListener = function (e) {
+          childStats.mouseOut = true;
+      };
+      var childLeaveListener = function (e) {
+          childStats.mouseLeave = true;
+      };
+      var childOverListener = function (e) {
+          childStats.mouseOver = true;
+      };
+      var childEnterListener = function (e) {
+          childStats.mouseEnter = true;
+      };
+
+      function addEventListeners() {
+        parent.addEventListener("mousemove", parentMoveListener, false);
+
+        parent.addEventListener("mouseout", parentOutListener, false);
+        parent.addEventListener("mouseleave", parentLeaveListener, false);
+        parent.addEventListener("mouseover", parentOverListener, false);
+        parent.addEventListener("mouseenter", parentEnterListener, false);
+
+        child.addEventListener("mouseout", childOutListener, false);
+        child.addEventListener("mouseleave", childLeaveListener, false);
+        child.addEventListener("mouseover", childOverListener, false);
+        child.addEventListener("mouseenter", childEnterListener, false);
+      }
+
+      function removeEventListeners() {
+        parent.removeEventListener("mousemove", parentMoveListener, false);
+
+        parent.removeEventListener("mouseout", parentOutListener, false);
+        parent.removeEventListener("mouseleave", parentLeaveListener, false);
+        parent.removeEventListener("mouseover", parentOverListener, false);
+        parent.removeEventListener("mouseenter", parentEnterListener, false);
+
+        child.removeEventListener("mouseout", childOutListener, false);
+        child.removeEventListener("mouseleave", childLeaveListener, false);
+        child.removeEventListener("mouseover"  , childOverListener, false);
+        child.removeEventListener("mouseenter", childEnterListener, false);
+      }
+
+      document.addEventListener("mozpointerlockchange", function (e) {
+        if (document.mozPointerLockElement === parent) {
+          addEventListeners();
+          synthesizeMouseAtCenter(child, { type: "mousemove" }, window);
+        }
+        else {
+          document.mozCancelFullScreen();
+        }
+      }, false);
+
+      document.addEventListener("mozfullscreenchange", function() {
+        if (document.mozFullScreenElement === parent) {
+          parent.mozRequestPointerLock();
+        }
+        else {
+          runTests();
+          SimpleTest.finish();
+        }
+      }, false);
+
+      function start() {
+        parent = document.getElementById("parent");
+        child = document.getElementById("child");
+        parent.mozRequestFullScreen();
+      }
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML>
+<html>
+  <!--
+  https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+  -->
+  <head>
+    <title>Bug 633602 - file_targetOutOfFocus.html</title>
+    <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+    </script>
+    <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js">
+    </script>
+    <script type="application/javascript" src="pointerlock_utils.js"></script>
+    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  </head>
+  <body>
+    <a target="_blank"
+      href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+      Mozilla Bug 633602
+    </a>
+    <p id="display"></p>
+    <div id="content">
+    </div>
+    <div id="div"></div>
+    <input id="input" type="text" />
+    <pre id="test">
+      <script type="application/javascript">
+        /*
+         * Test for Bug 633602
+         * Element doesn't need to have focus to request
+         * pointer lock
+        */
+
+        SimpleTest.waitForExplicitFinish();
+
+        var div = document.getElementById("div")
+          , input = document.getElementById("input")
+          , divPointerLock = false;
+
+        function runTests () {
+          ok(divPointerLock, "Pointer should be locked even if " +
+            "the element being locked is not focused");
+        }
+
+        input.addEventListener("focus", function() {
+          div.mozRequestPointerLock();
+        }, false);
+
+        document.addEventListener("mozpointerlockchange", function (e) {
+          if (document.mozPointerLockElement === div) {
+            divPointerLock = true;
+            document.mozCancelFullScreen();
+          }
+        }, false);
+
+        document.addEventListener("mozfullscreenchange", function() {
+          if (document.mozFullScreenElement === div) {
+            input.focus();
+          } else {
+            runTests();
+            SimpleTest.finish();
+          }
+        }, false);
+
+        function start() {
+          div.mozRequestFullScreen();
+        }
+      </script>
+    </pre>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/file_withoutDOM.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML>
+<html>
+  <!--
+  https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+
+  Test DOM tree in full screen
+  -->
+  <head>
+    <title>Bug 633602 - file_DOMtree.html</title>
+    <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js">
+    </script>
+    <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js">
+    </script>
+    <script type="application/javascript" src="pointerlock_utils.js"></script>
+    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+    <style>
+    </style>
+  </head>
+  <body>
+    <a target="_blank"
+       href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+      Mozilla Bug 633602
+    </a>
+    <pre id="test">
+      <script type="text/javascript">
+        /*
+         * Test for Bug 633602
+         * Checks if element is attached to the DOM Tree before locking
+         * the pointer
+         */
+
+        SimpleTest.waitForExplicitFinish();
+
+        var div = document.createElement("div")
+          , withouthDOM = false;
+
+        function runTests () {
+          ok(withouthDOM, "If an element is NOT in the " +
+            "DOM Tree pointer should NOT be locked");
+        }
+
+        document.addEventListener("mozpointerlockerror", function (e) {
+          withouthDOM = true;
+          runTests();
+          SimpleTest.finish();
+        }, false);
+
+        function start() {
+          div.mozRequestPointerLock();
+        }
+      </script>
+    </pre>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/iframe_differentDOM.html
@@ -0,0 +1,7 @@
+<html>
+  <head>
+  </head>
+  <body>
+    <div id="div"></div>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/pointerlock_utils.js
@@ -0,0 +1,59 @@
+const isWinXP = navigator.userAgent.indexOf("Windows NT 5.1") != -1;
+const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
+
+// If we're running in a child window, shim things so it works the same
+// as if we were running stand-alone.
+if (window.opener) {
+  // Get test filename for page being run in popup so errors are more useful
+  var testName = location.pathname.split('/').pop();
+
+  // Wrap test functions and pass to parent window
+  window.ok = function(a, msg) {
+    opener.ok(a, testName + ": " + msg);
+  };
+
+  window.is = function(a, b, msg) {
+    opener.is(a, b, testName + ": " + msg);
+  };
+
+  window.isnot = function(a, b, msg) {
+    opener.isnot(a, b, testName + ": " + msg);
+  };
+
+  window.todo = function(a, msg) {
+    opener.todo(a, testName + ": " + msg);
+  };
+
+  window.todo_is = function(a, b, msg) {
+    opener.todo_is(a, b, testName + ": " + msg);
+  };
+
+  window.todo_isnot = function(a, b, msg) {
+    opener.todo_isnot(a, b, testName + ": " + msg);
+  };
+
+  // Override bits of SimpleTest so test files work stand-alone
+  var SimpleTest = SimpleTest || {};
+
+  SimpleTest.waitForExplicitFinish = function() {
+    dump("[POINTERLOCK] Starting " + testName+ "\n");
+  };
+
+  SimpleTest.finish = function () {
+    dump("[POINTERLOCK] Finishing " + testName+ "\n");
+    opener.nextTest();
+  };
+} else {
+  // If we're not running in a child window, prefs need to get flipped here,
+  // otherwise it was already done in the test runner parent.
+
+  // Ensure the full-screen api is enabled, and will be disabled on test exit.
+  SpecialPowers.setBoolPref("full-screen-api.enabled", true);
+
+  // Disable the requirement for trusted contexts only, so the tests are easier to write.
+  SpecialPowers.setBoolPref("full-screen-api.allow-trusted-requests-only", false);
+}
+
+addLoadEvent(function() {
+  SimpleTest.waitForFocus(start);
+});
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html
@@ -0,0 +1,98 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=633602
+-->
+  <head>
+    <title>Test for Bug 633602</title>
+    <script type="application/javascript"  src="/tests/SimpleTest/SimpleTest.js"></script>
+    <script type="application/javascript"  src="/tests/SimpleTest/EventUtils.js"></script>
+    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  </head>
+  <body>
+    <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
+      Mozilla Bug 633602
+    </a>
+    <div id="content">
+    </div>
+    <pre id="test">
+      <script type="application/javascript">
+        /**
+         * Pointer Lock tests for bug 633602.  These depend on the fullscreen api
+         * which doesn't work well on all platforms when run in an iframe, even
+         * when allowing fullscreen on the iframe.  To get around this, all tests
+         * are run in a child window, which can go fullscreen.  This method is
+         * borrowed from content/html/content/test/test_fullscreen-api.html.
+         **/
+
+        SimpleTest.waitForExplicitFinish();
+
+        // Ensure the full-screen api is enabled, and will be disabled on test exit.
+        SpecialPowers.setBoolPref("full-screen-api.enabled", true);
+
+        // Disable the requirement for trusted contexts only, so the tests are easier to write.
+        SpecialPowers.setBoolPref("full-screen-api.allow-trusted-requests-only", false);
+
+        // Run the tests which go full-screen in new window, as Mochitests
+        // normally run in an iframe, which by default will not have the
+        // mozallowfullscreen attribute set, so full-screen won't work.
+        var gTestFiles = [
+          "file_screenClientXYConst.html",
+          "file_childIframe.html",
+          "file_doubleLock.html",
+          "file_escapeKey.html",
+          "file_infiniteMovement.html",
+          "file_locksvgelement.html",
+          "file_movementXY.html",
+          "file_nestedFullScreen.html",
+          "file_pointerlock-api.html",
+          "file_pointerlockerror.html",
+          "file_pointerLockPref.html",
+          "file_removedFromDOM.html",
+          "file_retargetMouseEvents.html",
+          "file_suppressSomeMouseEvents.html",
+          "file_targetOutOfFocus.html",
+          "file_withoutDOM.html"
+        ];
+
+        var gTestWindow = null;
+        var gTestIndex = 0;
+
+        // TODO: if ever we remove these checks for XP and Lion, we should do the same
+        // in content/html/content/test/test_fullscreen-api.html, which uses the same pattern.
+        const isWinXP = navigator.userAgent.indexOf("Windows NT 5.1") != -1;
+        const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
+
+        function nextTest() {
+          if (isWinXP) {
+            todo(false, "Can't reliably run full-screen tests on Windows XP due to bug 704010");
+            SimpleTest.finish();
+            return;
+          }
+          if (isOSXLion) {
+            todo(false, "Can't reliably run full-screen tests on OS X Lion, see bug 744125");
+            SimpleTest.finish();
+            return;
+          }
+          if (gTestWindow) {
+            gTestWindow.close();
+          }
+          SimpleTest.waitForFocus(runNextTest);
+        }
+
+        function runNextTest() {
+          if (gTestIndex < gTestFiles.length) {
+            gTestWindow = window.open(gTestFiles[gTestIndex], "", "width=500,height=500");
+            gTestIndex++;
+          } else {
+            SpecialPowers.clearUserPref("full-screen-api.enabled");
+            SpecialPowers.clearUserPref("full-screen-api.allow-trusted-requests-only");
+            SimpleTest.finish();
+          }
+        }
+
+        addLoadEvent(nextTest);
+      </script>
+    </pre>
+  </body>
+</html>
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -129,20 +129,23 @@ class LayerManager;
 // Flags to pass to SetCapturingContent
 //
 // when assigning capture, ignore whether capture is allowed or not
 #define CAPTURE_IGNOREALLOWED 1
 // true if events should be targeted at the capturing content or its children
 #define CAPTURE_RETARGETTOELEMENT 2
 // true if the current capture wants drags to be prevented
 #define CAPTURE_PREVENTDRAG 4
+// true when the mouse is pointer locked, and events are sent to locked elemnt
+#define CAPTURE_POINTERLOCK 8
 
 typedef struct CapturingContentInfo {
   // capture should only be allowed during a mousedown event
   bool mAllowed;
+  bool mPointerLock;
   bool mRetargetToElement;
   bool mPreventDrag;
   nsIContent* mContent;
 } CapturingContentInfo;
 
 #define NS_IPRESSHELL_IID    \
         { 0x4dc4db09, 0x03d4, 0x4427, \
           { 0xbe, 0xfb, 0xc9, 0x29, 0xac, 0x5c, 0x62, 0xab } }
@@ -1098,16 +1101,21 @@ public:
    * If CAPTURE_RETARGETTOELEMENT is set, all mouse events are targeted at
    * aContent only. Otherwise, mouse events are targeted at aContent or its
    * descendants. That is, descendants of aContent receive mouse events as
    * they normally would, but mouse events outside of aContent are retargeted
    * to aContent.
    *
    * If CAPTURE_PREVENTDRAG is set then drags are prevented from starting while
    * this capture is active.
+   *
+   * If CAPTURE_POINTERLOCK is set, similar to CAPTURE_RETARGETTOELEMENT, then
+   * events are targeted at aContent, but capturing is held more strongly (i.e.,
+   * calls to SetCapturingContent won't unlock unless CAPTURE_POINTERLOCK is
+   * set again).
    */
   static void SetCapturingContent(nsIContent* aContent, PRUint8 aFlags);
 
   /**
    * Return the active content currently capturing the mouse if any.
    */
   static nsIContent* GetCapturingContent()
   {
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -223,17 +223,17 @@
 
 #define ANCHOR_SCROLL_FLAGS (SCROLL_OVERFLOW_HIDDEN | SCROLL_NO_PARENT_FRAMES)
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::layers;
 
 CapturingContentInfo nsIPresShell::gCaptureInfo =
-  { false /* mAllowed */,     false /* mRetargetToElement */,
+  { false /* mAllowed */, false /* mPointerLock */, false /* mRetargetToElement */,
     false /* mPreventDrag */, nsnull /* mContent */ };
 nsIContent* nsIPresShell::gKeyDownTarget;
 nsInterfaceHashtable<nsUint32HashKey, nsIDOMTouch> nsIPresShell::gCaptureTouchList;
 bool nsIPresShell::gPreventMouseEvents = false;
 
 static PRUint32
 ChangeFlag(PRUint32 aFlags, bool aOnOff, PRUint32 aFlag)
 {
@@ -5443,26 +5443,37 @@ PresShell::Paint(nsIView*           aVie
 
   presContext->NotifyDidPaintForSubtree();
 }
 
 // static
 void
 nsIPresShell::SetCapturingContent(nsIContent* aContent, PRUint8 aFlags)
 {
+  // If capture was set for pointer lock, don't unlock unless we are coming
+  // out of pointer lock explicitly.
+  if (!aContent && gCaptureInfo.mPointerLock &&
+      !(aFlags & CAPTURE_POINTERLOCK)) {
+    return;
+  }
+
   NS_IF_RELEASE(gCaptureInfo.mContent);
 
-  // only set capturing content if allowed or the CAPTURE_IGNOREALLOWED flag
-  // is used
-  if ((aFlags & CAPTURE_IGNOREALLOWED) || gCaptureInfo.mAllowed) {
+  // only set capturing content if allowed or the CAPTURE_IGNOREALLOWED or
+  // CAPTURE_POINTERLOCK flags are used.
+  if ((aFlags & CAPTURE_IGNOREALLOWED) || gCaptureInfo.mAllowed ||
+      (aFlags & CAPTURE_POINTERLOCK)) {
     if (aContent) {
       NS_ADDREF(gCaptureInfo.mContent = aContent);
     }
-    gCaptureInfo.mRetargetToElement = (aFlags & CAPTURE_RETARGETTOELEMENT) != 0;
+    // CAPTURE_POINTERLOCK is the same as CAPTURE_RETARGETTOELEMENT & CAPTURE_IGNOREALLOWED
+    gCaptureInfo.mRetargetToElement = ((aFlags & CAPTURE_RETARGETTOELEMENT) != 0) ||
+                                      ((aFlags & CAPTURE_POINTERLOCK) != 0);
     gCaptureInfo.mPreventDrag = (aFlags & CAPTURE_PREVENTDRAG) != 0;
+    gCaptureInfo.mPointerLock = (aFlags & CAPTURE_POINTERLOCK) != 0;
   }
 }
 
 nsIFrame*
 PresShell::GetCurrentEventFrame()
 {
   if (NS_UNLIKELY(mIsDestroying)) {
     return nsnull;
@@ -5746,17 +5757,18 @@ PresShell::HandleEvent(nsIFrame        *
 #endif
 
   if (!nsContentUtils::IsSafeToRunScript())
     return NS_OK;
 
   NS_TIME_FUNCTION_MIN(1.0);
 
   nsIContent* capturingContent =
-    NS_IS_MOUSE_EVENT(aEvent) ? GetCapturingContent() : nsnull;
+    NS_IS_MOUSE_EVENT(aEvent) || aEvent->eventStructType == NS_MOUSE_SCROLL_EVENT ?
+      GetCapturingContent() : nsnull;
 
   nsCOMPtr<nsIDocument> retargetEventDoc;
   if (!aDontRetargetEvents) {
     // key and IME related events should not cross top level window boundary.
     // Basically, such input events should be fired only on focused widget.
     // However, some IMEs might need to clean up composition after focused
     // window is deactivated.  And also some tests on MozMill want to test key
     // handling on deactivated window because MozMill window can be activated
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -3486,16 +3486,17 @@ pref("alerts.totalOpenTime", 4000);
 pref("alerts.disableSlidingEffect", false);
 
 // DOM full-screen API.
 pref("full-screen-api.enabled", false);
 pref("full-screen-api.allow-trusted-requests-only", true);
 pref("full-screen-api.key-input-restricted", true);
 pref("full-screen-api.warning.enabled", true);
 pref("full-screen-api.exit-on-deactivate", true);
+pref("full-screen-api.pointer-lock.enabled", true);
 
 // Time limit, in milliseconds, for nsEventStateManager::IsHandlingUserInput().
 // Used to detect long running handlers of user-generated events.
 pref("dom.event.handling-user-input-time-limit", 1000);
  
 //3D Transforms
 pref("layout.3d-transforms.enabled", true);
 
--- a/rdf/base/idl/xulstubs.idl
+++ b/rdf/base/idl/xulstubs.idl
@@ -41,20 +41,20 @@
 /* C++ should ignore this file because there are real DOM interfaces
    elsewhere, so if 0 it out
 */
 #if 0
 %}
 
 #include "domstubs.idl"
 
-[scriptable, uuid(7f4b6b5d-7982-417c-bcd4-2fcddd35b404)]
+[scriptable, uuid(7FB67F1D-F1FF-450A-9A63-261344E13AC4)]
 interface nsIDOMXULElement : nsIDOMElement {};
 
-[scriptable, uuid(318f68f5-1840-475f-a656-7c3f09bd3252)]
+[scriptable, uuid(E3F0D263-10A2-4703-BD5F-E68F32F4DC31)]
 interface nsIDOMXULTreeElement : nsIDOMXULElement {};
 
 [scriptable, uuid(f3c50361-14fe-11d3-bf87-00105a1b0627)]
 interface nsIDOMXULCommandDispatcher : nsISupports {};
 
 [scriptable, uuid(17ddd8c0-c5f8-11d2-a6ae-00104bde6048)]
 interface nsIDOMXULDocument : nsISupports {};
 
--- a/widget/cocoa/nsChildView.h
+++ b/widget/cocoa/nsChildView.h
@@ -483,17 +483,20 @@ public:
                                             PRInt32 aNativeKeyCode,
                                             PRUint32 aModifierFlags,
                                             const nsAString& aCharacters,
                                             const nsAString& aUnmodifiedCharacters);
 
   virtual nsresult SynthesizeNativeMouseEvent(nsIntPoint aPoint,
                                               PRUint32 aNativeMessage,
                                               PRUint32 aModifierFlags);
-  
+
+  virtual nsresult SynthesizeNativeMouseMove(nsIntPoint aPoint)
+  { return SynthesizeNativeMouseEvent(aPoint, NSMouseMoved, 0); }
+
   // Mac specific methods
   
   virtual bool      DispatchWindowEvent(nsGUIEvent& event);
   
 #ifdef ACCESSIBILITY
   already_AddRefed<nsAccessible> GetDocumentAccessible();
 #endif
 
--- a/widget/gtk2/nsWindow.cpp
+++ b/widget/gtk2/nsWindow.cpp
@@ -6488,8 +6488,24 @@ nsWindow::ClearCachedResources()
     GList* children = gdk_window_peek_children(mGdkWindow);
     for (GList* list = children; list; list = list->next) {
         nsWindow* window = get_window_for_gdk_window(GDK_WINDOW(list->data));
         if (window) {
             window->ClearCachedResources();
         }
     }
 }
+
+nsresult
+nsWindow::SynthesizeNativeMouseEvent(nsIntPoint aPoint,
+                                     PRUint32 aNativeMessage,
+                                     PRUint32 aModifierFlags)
+{
+  if (!mGdkWindow) {
+    return NS_OK;
+  }
+
+  GdkDisplay* display = gdk_window_get_display(mGdkWindow);
+  GdkScreen* screen = gdk_window_get_screen(mGdkWindow);
+  gdk_display_warp_pointer(display, screen, aPoint.x, aPoint.y);
+
+  return NS_OK;
+}
--- a/widget/gtk2/nsWindow.h
+++ b/widget/gtk2/nsWindow.h
@@ -342,16 +342,23 @@ public:
 
     static already_AddRefed<gfxASurface> GetSurfaceForGdkDrawable(GdkDrawable* aDrawable,
                                                                   const nsIntSize& aSize);
 #else
     gfxASurface       *GetThebesSurface(cairo_t *cr);
 #endif
     NS_IMETHOD         ReparentNativeWidget(nsIWidget* aNewParent);
 
+    virtual nsresult SynthesizeNativeMouseEvent(nsIntPoint aPoint,
+                                                PRUint32 aNativeMessage,
+                                                PRUint32 aModifierFlags);
+
+    virtual nsresult SynthesizeNativeMouseMove(nsIntPoint aPoint)
+    { return SynthesizeNativeMouseEvent(aPoint, GDK_MOTION_NOTIFY, 0); }
+
 protected:
     // Helper for SetParent and ReparentNativeWidget.
     void ReparentNativeWidgetInternal(nsIWidget* aNewParent,
                                       GtkWidget* aNewContainer,
                                       GdkWindow* aNewParentWindow,
                                       GtkWidget* aOldContainer);
     nsCOMPtr<nsIWidget> mParent;
     // Is this a toplevel window?
--- a/widget/nsGUIEvent.h
+++ b/widget/nsGUIEvent.h
@@ -553,16 +553,21 @@ class nsHashKey;
 #define NS_TOUCH_EVENT_START         5200
 #define NS_TOUCH_START               (NS_TOUCH_EVENT_START)
 #define NS_TOUCH_MOVE                (NS_TOUCH_EVENT_START+1)
 #define NS_TOUCH_END                 (NS_TOUCH_EVENT_START+2)
 #define NS_TOUCH_ENTER               (NS_TOUCH_EVENT_START+3)
 #define NS_TOUCH_LEAVE               (NS_TOUCH_EVENT_START+4)
 #define NS_TOUCH_CANCEL              (NS_TOUCH_EVENT_START+5)
 
+// Pointerlock DOM API
+#define NS_POINTERLOCK_START         5300
+#define NS_POINTERLOCKCHANGE         (NS_POINTERLOCK_START)
+#define NS_POINTERLOCKERROR          (NS_POINTERLOCK_START + 1)
+
 /**
  * Return status for event processors, nsEventStatus, is defined in
  * nsEvent.h.
  */
 
 /**
  * different types of (top-level) window z-level positioning
  */
@@ -578,32 +583,34 @@ enum nsWindowZ {
 
 class nsEvent
 {
 protected:
   nsEvent(bool isTrusted, PRUint32 msg, PRUint8 structType)
     : eventStructType(structType),
       message(msg),
       refPoint(0, 0),
+      lastRefPoint(0, 0),
       time(0),
       flags(isTrusted ? NS_EVENT_FLAG_TRUSTED : NS_EVENT_FLAG_NONE),
       userType(0)
   {
     MOZ_COUNT_CTOR(nsEvent);
   }
 
   nsEvent()
   {
   }
 
 public:
   nsEvent(bool isTrusted, PRUint32 msg)
     : eventStructType(NS_EVENT),
       message(msg),
       refPoint(0, 0),
+      lastRefPoint(0, 0),
       time(0),
       flags(isTrusted ? NS_EVENT_FLAG_TRUSTED : NS_EVENT_FLAG_NONE),
       userType(0)
   {
     MOZ_COUNT_CTOR(nsEvent);
   }
 
   ~nsEvent()
@@ -613,16 +620,18 @@ public:
 
   // See event struct types
   PRUint8     eventStructType;
   // See GUI MESSAGES,
   PRUint32    message;
   // Relative to the widget of the event, or if there is no widget then it is
   // in screen coordinates. Not modified by layout code.
   nsIntPoint  refPoint;
+  // The previous refPoint, if known, used to calculate mouse movement deltas.
+  nsIntPoint  lastRefPoint;
   // Elapsed time, in milliseconds, from a platform-specific zero time
   // to the time the message was created
   PRUint64    time;
   // Flags to hold event flow stage and capture/bubble cancellation
   // status. This is used also to indicate whether the event is trusted.
   PRUint32    flags;
   // Additional type info for user defined events
   nsCOMPtr<nsIAtom>     userType;
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -113,18 +113,18 @@ typedef nsEventStatus (* EVENT_CALLBACK)
 #endif
 #ifdef XP_WIN
 #define NS_NATIVE_TSF_THREAD_MGR       100
 #define NS_NATIVE_TSF_CATEGORY_MGR     101
 #define NS_NATIVE_TSF_DISPLAY_ATTR_MGR 102
 #endif
 
 #define NS_IWIDGET_IID \
-  { 0xe7af49c1, 0xd11b, 0x4070, \
-    { 0x99, 0x7a, 0x2d, 0x2b, 0x7, 0x4b, 0xea, 0xf4 } }
+  { 0xb5bb55c7, 0x9a50, 0x4fa8, \
+    { 0xa7, 0x6e, 0xbd, 0x31, 0x6f, 0x3e, 0x9c, 0x13 } }
 
 /*
  * Window shadow styles
  * Also used for the -moz-window-shadow CSS property
  */
 
 #define NS_STYLE_WINDOW_SHADOW_NONE             0
 #define NS_STYLE_WINDOW_SHADOW_DEFAULT          1
@@ -1372,16 +1372,21 @@ class nsIWidget : public nsISupports {
      * @param aModifierFlags *platform-specific* modifier flags (ignored
      * on Windows)
      */
     virtual nsresult SynthesizeNativeMouseEvent(nsIntPoint aPoint,
                                                 PRUint32 aNativeMessage,
                                                 PRUint32 aModifierFlags) = 0;
 
     /**
+     * A shortcut to SynthesizeNativeMouseEvent, abstracting away the native message.
+     */
+    virtual nsresult SynthesizeNativeMouseMove(nsIntPoint aPoint) = 0;
+
+    /**
      * Utility method intended for testing. Dispatching native mouse scroll
      * events may move the mouse cursor.
      *
      * @param aPoint            Mouse cursor position in screen coordinates.
      *                          In device pixels, the origin at the top left of
      *                          the primary display.
      * @param aNativeMessage    Platform native message.
      * @param aDeltaX           The delta value for X direction.  If the native
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -172,16 +172,20 @@ public:
   virtual nsresult        SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout,
                                                    PRInt32 aNativeKeyCode,
                                                    PRUint32 aModifierFlags,
                                                    const nsAString& aCharacters,
                                                    const nsAString& aUnmodifiedCharacters);
   virtual nsresult        SynthesizeNativeMouseEvent(nsIntPoint aPoint,
                                                      PRUint32 aNativeMessage,
                                                      PRUint32 aModifierFlags);
+
+  virtual nsresult        SynthesizeNativeMouseMove(nsIntPoint aPoint)
+                          { return SynthesizeNativeMouseEvent(aPoint, MOUSEEVENTF_MOVE, 0); }
+
   virtual nsresult        SynthesizeNativeMouseScrollEvent(nsIntPoint aPoint,
                                                            PRUint32 aNativeMessage,
                                                            double aDeltaX,
                                                            double aDeltaY,
                                                            double aDeltaZ,
                                                            PRUint32 aModifierFlags,
                                                            PRUint32 aAdditionalFlags);
   NS_IMETHOD              ResetInputState();
--- a/widget/xpwidgets/nsBaseWidget.h
+++ b/widget/xpwidgets/nsBaseWidget.h
@@ -265,16 +265,19 @@ protected:
                                             const nsAString& aUnmodifiedCharacters)
   { return NS_ERROR_UNEXPECTED; }
 
   virtual nsresult SynthesizeNativeMouseEvent(nsIntPoint aPoint,
                                               PRUint32 aNativeMessage,
                                               PRUint32 aModifierFlags)
   { return NS_ERROR_UNEXPECTED; }
 
+  virtual nsresult SynthesizeNativeMouseMove(nsIntPoint aPoint)
+  { return NS_ERROR_UNEXPECTED; }
+
   virtual nsresult SynthesizeNativeMouseScrollEvent(nsIntPoint aPoint,
                                                     PRUint32 aNativeMessage,
                                                     double aDeltaX,
                                                     double aDeltaY,
                                                     double aDeltaZ,
                                                     PRUint32 aModifierFlags,
                                                     PRUint32 aAdditionalFlags)
   { return NS_ERROR_UNEXPECTED; }