Backed out changeset a8d6f6fd7bda (bug 1359017) for failing wpt's /html/dom/reflection-forms.html. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 13 Sep 2017 08:56:53 +0200
changeset 430143 c147e40c83dad4c219095fe695a7e87f1d65054c
parent 430142 18167b57d0762f92204099950b476df86ed76339
child 430144 f0361c81ca3e5111f4634214073a6db0c42b3296
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1359017
milestone57.0a1
backs outa8d6f6fd7bda07666155c8c9288c6d6bbf417fcf
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
Backed out changeset a8d6f6fd7bda (bug 1359017) for failing wpt's /html/dom/reflection-forms.html. r=backout
dom/base/nsGkAtomList.h
dom/messagechannel/MessagePort.cpp
dom/messagechannel/MessagePort.h
dom/webidl/MessagePort.webidl
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -915,17 +915,16 @@ GK_ATOM(onlevelchange, "onlevelchange")
 GK_ATOM(onLoad, "onLoad")
 GK_ATOM(onload, "onload")
 GK_ATOM(onloading, "onloading")
 GK_ATOM(onloadingdone, "onloadingdone")
 GK_ATOM(onloadingerror, "onloadingerror")
 GK_ATOM(onpopstate, "onpopstate")
 GK_ATOM(only, "only")               // this one is not an event
 GK_ATOM(onmessage, "onmessage")
-GK_ATOM(onmessageerror, "onmessageerror")
 GK_ATOM(onmousedown, "onmousedown")
 GK_ATOM(onmouseenter, "onmouseenter")
 GK_ATOM(onmouseleave, "onmouseleave")
 GK_ATOM(onmouselongtap, "onmouselongtap")
 GK_ATOM(onmousemove, "onmousemove")
 GK_ATOM(onmouseout, "onmouseout")
 GK_ATOM(onmouseover, "onmouseover")
 GK_ATOM(onMozMouseHittest, "onMozMouseHittest")
--- a/dom/messagechannel/MessagePort.cpp
+++ b/dom/messagechannel/MessagePort.cpp
@@ -132,29 +132,27 @@ private:
       end = MakeUnique<MessagePortTimelineMarker>(
         ProfileTimelineMessagePortOperationType::DeserializeData,
         MarkerTracingType::END);
       timelines->AddMarkerForAllObservedDocShells(start);
       timelines->AddMarkerForAllObservedDocShells(end);
     }
 
     if (NS_WARN_IF(rv.Failed())) {
-      mPort->DispatchError();
       return rv.StealNSResult();
     }
 
     // Create the event
     nsCOMPtr<mozilla::dom::EventTarget> eventTarget =
       do_QueryInterface(mPort->GetOwner());
     RefPtr<MessageEvent> event =
       new MessageEvent(eventTarget, nullptr, nullptr);
 
     Sequence<OwningNonNull<MessagePort>> ports;
     if (!mData->TakeTransferredPortsAsSequence(ports)) {
-      mPort->DispatchError();
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
     event->InitMessageEvent(nullptr, NS_LITERAL_STRING("message"),
                             false /* non-bubbling */,
                             false /* cancelable */, value, EmptyString(),
                             EmptyString(), nullptr, ports);
     event->SetTrusted(true);
@@ -691,17 +689,17 @@ MessagePort::Entangled(nsTArray<ClonedMe
     // only clear after `messages` have gone out of scope.
     mMessagesForTheOtherPort.Clear();
   }
 
   // We must convert the messages into SharedMessagePortMessages to avoid leaks.
   FallibleTArray<RefPtr<SharedMessagePortMessage>> data;
   if (NS_WARN_IF(!SharedMessagePortMessage::FromMessagesToSharedChild(aMessages,
                                                                       data))) {
-    DispatchError();
+    // OOM, we cannot continue.
     return;
   }
 
   // If the next step is to close the port, we do it ignoring the received
   // messages.
   if (oldState == eStateEntanglingForClose) {
     CloseForced();
     return;
@@ -745,17 +743,17 @@ MessagePort::MessagesReceived(nsTArray<C
              mState == eStateDisentangledForClose);
   MOZ_ASSERT(mMessagesForTheOtherPort.IsEmpty());
 
   RemoveDocFromBFCache();
 
   FallibleTArray<RefPtr<SharedMessagePortMessage>> data;
   if (NS_WARN_IF(!SharedMessagePortMessage::FromMessagesToSharedChild(aMessages,
                                                                       data))) {
-    DispatchError();
+    // OOM, We cannot continue.
     return;
   }
 
   mMessages.AppendElements(data);
 
   if (mState == eStateEntangled) {
     Dispatch();
   }
@@ -1001,33 +999,10 @@ MessagePort::RemoveDocFromBFCache()
 }
 
 /* static */ void
 MessagePort::ForceClose(const MessagePortIdentifier& aIdentifier)
 {
   ForceCloseHelper::ForceClose(aIdentifier);
 }
 
-void
-MessagePort::DispatchError()
-{
-  nsCOMPtr<nsIGlobalObject> globalObject = GetParentObject();
-
-  AutoJSAPI jsapi;
-  if (!globalObject || !jsapi.Init(globalObject)) {
-    NS_WARNING("Failed to initialize AutoJSAPI object.");
-    return;
-  }
-
-  RootedDictionary<MessageEventInit> init(jsapi.cx());
-  init.mBubbles = false;
-  init.mCancelable = false;
-
-  RefPtr<Event> event =
-    MessageEvent::Constructor(this, NS_LITERAL_STRING("messageerror"), init);
-  event->SetTrusted(true);
-
-  bool dummy;
-  DispatchEvent(event, &dummy);
-}
-
 } // namespace dom
 } // namespace mozilla
--- a/dom/messagechannel/MessagePort.h
+++ b/dom/messagechannel/MessagePort.h
@@ -69,18 +69,16 @@ public:
   void Start();
 
   void Close();
 
   EventHandlerNonNull* GetOnmessage();
 
   void SetOnmessage(EventHandlerNonNull* aCallback);
 
-  IMPL_EVENT_HANDLER(messageerror)
-
   // Non WebIDL methods
 
   void UnshippedEntangle(MessagePort* aEntangledPort);
 
   void CloneAndDisentangle(MessagePortIdentifier& aIdentifier);
 
   void CloseForced();
 
@@ -144,18 +142,16 @@ private:
                   uint32_t aSequenceID, bool mNeutered, State aState,
                   ErrorResult& aRv);
 
   void ConnectToPBackground();
 
   // Dispatch events from the Message Queue using a nsRunnable.
   void Dispatch();
 
-  void DispatchError();
-
   void StartDisentangling();
   void Disentangle();
 
   void RemoveDocFromBFCache();
 
   void CloseInternal(bool aSoftly);
 
   // This method is meant to keep alive the MessagePort when this object is
--- a/dom/webidl/MessagePort.webidl
+++ b/dom/webidl/MessagePort.webidl
@@ -12,11 +12,10 @@ interface MessagePort : EventTarget {
   [Throws]
   void postMessage(any message, optional sequence<object> transferable = []);
 
   void start();
   void close();
 
   // event handlers
   attribute EventHandler onmessage;
-  attribute EventHandler onmessageerror;
 };
 // MessagePort implements Transferable;