flypig.co.uk

List items

Items from the current list are shown below.

Gecko

17 Sep 2023 : Day 32 #
This morning I awoke to find most of the changes I worked through yesterday had gone through nicely. There's just one catch:
187:10.38 ${PROJECT}/gecko-dev/mobile/sailfishos/embedshared/EmbedLiteViewChild.cpp:1163:49: error: ‘class mozilla::Maybe’ has no member named ‘StartOffset’
187:10.38        selectionEvent.mOffset = selection.mReply.StartOffset() + replacementStart;
This was due to a faulty change I made yesterday. This was the change I made to try to fix things:
-      selectionEvent.mOffset = selection.mReply.mOffset + replacementStart;
+      selectionEvent.mOffset = selection.mReply.StartOffset() + replacementStart;
But the error is clearly indicating that this won't wash. So time to dig a bit deeper.

I can see the appropriate method — the StartOffset() method I thought ought to work — defined in the Reply struct:
    MOZ_NEVER_INLINE_DEBUG uint32_t StartOffset() const {
      MOZ_ASSERT(mOffsetAndData.isSome());
      return mOffsetAndData->StartOffset();
    }
The WidgetQueryContentEvent::Reply struct can be found in TextEvents.h. For my previous failed attempt I copied the changes made in D98264 where I saw this:
  WidgetQueryContentEvent charAt(true, eQueryCharacterAtPoint, widget);
  [...]
  uint32_t offset = charAt.mReply.mOffset;
Which in the diff is replaced by this:
  WidgetQueryContentEvent queryCharAtPointEvent(true, eQueryCharacterAtPoint,
                                                widget);
  [..]
  uint32_t offset = queryCharAtPointEvent.mReply->StartOffset();
That looks very similar to the situation I'm in, so why didn't that work for me?

It turns out there's a crucial difference between the upstream change and mine: one's using a dot, the other's using an arrow. That is, one's expecting the instance of the class to be the instance itself, the other's expecting it to be a pointer to the instance.

To get this through I therefore need to resolve the pointer using the indirect arrow accessor. So it's a three character fix.

After making this change and building again it goes through. Now we have further unrelated errors. I'm going to list the first few here, but in practice these will be errors to fix tomorrow:
193:51.55 In file included from ${PROJECT}/gecko-dev/mobile/sailfishos/
                                embedshared/EmbedLiteViewParent.cpp:16,
193:51.55                  from Unified_cpp_mobile_sailfishos1.cpp:2:
193:51.55 ${PROJECT}/gecko-dev/mobile/sailfishos/embedthread/
          EmbedContentController.h:32:16: error: ‘virtual void mozilla::
          embedlite::EmbedContentController::NotifyLayerTransforms(const
          nsTArray&)’ marked ‘override’, but
          does not override
193:51.55    virtual void NotifyLayerTransforms(
193:51.55                 ^~~~~~~~~~~~~~~~~~~~~
193:51.55 ${PROJECT}/gecko-dev/mobile/sailfishos/embedthread/
          EmbedContentController.h:54:16: error: ‘virtual void mozilla::
          embedlite::EmbedContentController::NotifyPinchGesture(mozilla::
          PinchGestureInput::PinchGestureType, const ScrollableLayerGuid&,
          mozilla::LayoutDeviceCoord, mozilla::Modifiers)’ marked ‘override’,
          but does not override
193:51.55    virtual void NotifyPinchGesture(PinchGestureInput::PinchGestureType aType,
193:51.55                 ^~~~~~~~~~~~~~~~~~
193:51.55 In file included from Unified_cpp_mobile_sailfishos1.cpp:2:
193:51.55 ${PROJECT}/gecko-dev/mobile/sailfishos/embedshared/
          EmbedLiteViewParent.cpp: In constructor ‘mozilla::embedlite::
          EmbedLiteViewParent::EmbedLiteViewParent(const uint32_t&, const
          uint32_t&, const uint32_t&, const uintptr_t&, const bool&, const bo
          invalid new-expression of abstract class type ‘mozilla::embedlite::
          EmbedContentController’
193:51.55    , mContentController(new EmbedContentController(this, mThread))
193:51.55                                                                 ^
193:51.56 In file included from ${PROJECT}/gecko-dev/mobile/sailfishos/
                           embedshared/EmbedLiteViewParent.cpp:16,
193:51.56                  from Unified_cpp_mobile_sailfishos1.cpp:2:
193:51.56 ${PROJECT}/gecko-dev/mobile/sailfishos/embedthread/
          EmbedContentController.h:19:7: note:   because the following virtual
          functions are pure within ‘mozilla::embedlite::EmbedContentController’:
193:51.56  class EmbedContentController : public mozilla::layers::GeckoContentController
193:51.56        ^~~~~~~~~~~~~~~~~~~~~~
193:51.56 In file included from ${PROJECT}/obj-build-mer-qt-xr/ipc/ipdl/_ipdlheaders/
                                mozilla/embedlite/PEmbedLiteViewParent.h:24,
193:51.56                  from ${PROJECT}/gecko-dev/mobile/sailfishos/embedshared/
                                EmbedLiteViewParent.h:9,
193:51.56                  from ${PROJECT}/gecko-dev/mobile/sailfishos/embedshared/
                                EmbedLiteViewParent.cpp:9,
193:51.56                  from Unified_cpp_mobile_sailfishos1.cpp:2:
193:51.56 ${PROJECT}/obj-build-mer-qt-xr/dist/include/mozilla/layers/
          GeckoContentController.h:43:16: note:         ‘virtual void mozilla::
          layers::GeckoContentController::NotifyLayerTransforms(nsTArray
          &&)’
193:51.56    virtual void NotifyLayerTransforms(nsTArray&& aTransforms) = 0;
193:51.56                 ^~~~~~~~~~~~~~~~~~~~~
193:51.56 ${PROJECT}/obj-build-mer-qt-xr/dist/include/mozilla/layers/
          GeckoContentController.h:83:16: note:         ‘virtual void mozilla::
          layers::GeckoContentController::NotifyPinchGesture(mozilla::
          PinchGestureInput::PinchGestureType, const mozilla::layers::
          ScrollableLayerGuid&, const LayoutDevicePoint&,
          mozilla::LayoutDeviceCoord, mozilla::Modifiers)’
193:51.56    virtual void NotifyPinchGesture(PinchGestureInput::PinchGestureType aType,
193:51.56                 ^~~~~~~~~~~~~~~~~~
193:51.57 In file included from Unified_cpp_mobile_sailfishos1.cpp:2:
193:51.57 ${PROJECT}/gecko-dev/mobile/sailfishos/embedshared/
          EmbedLiteViewParent.cpp: In member function ‘virtual nsresult 
          mozilla::embedlite::EmbedLiteViewParent::ReceiveInputEvent
          (const mozilla::InputData&)’:
193:51.57 ${PROJECT}/gecko-dev/mobile/sailfishos/embedshared/
          EmbedLiteViewParent.cpp:464:17: error: ‘nsEventStatus mozilla::
          layers::APZEventResult::mStatus’ is private within this context
193:51.58    if (apzResult.mStatus == nsEventStatus_eConsumeNoDefault) {
193:51.58                  ^~~~~~~
193:51.58 In file included from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                mozilla/layers/LayersMessageUtils.h:22,
193:51.58                  from ${PROJECT}/obj-build-mer-qt-xr/ipc/ipdl/
                                _ipdlheaders/mozilla/layers/PCompositorManager.h:27,
193:51.58                  from ${PROJECT}/obj-build-mer-qt-xr/ipc/ipdl/
                                _ipdlheaders/mozilla/layers/PCompositorManagerParent.h:9,
193:51.58                  from ${PROJECT}/obj-build-mer-qt-xr/dist/include/
                                mozilla/layers/CompositorManagerParent.h:15,
193:51.58                  from ${PROJECT}/gecko-dev/mobile/sailfishos/
                                embedthread/EmbedLiteCompositorBridgeParent.h:15,
193:51.58                  from ${PROJECT}/gecko-dev/mobile/sailfishos/
                                embedshared/EmbedLiteViewParent.cpp:14,
193:51.58                  from Unified_cpp_mobile_sailfishos1.cpp:2:
193:51.58 ${PROJECT}/obj-build-mer-qt-xr/dist/include/mozilla/layers/
          APZInputBridge.h:150:17: note: declared private here
193:51.58    nsEventStatus mStatus;
193:51.58                  ^~~~~~~
          field ‘nsEventStatus mozilla::layers::APZEventResult::mStatus’ can be
          accessed via ‘nsEventStatus mozilla::layers::APZEventResult::GetStatus() const’
193:51.58    if (apzResult.mStatus == nsEventStatus_eConsumeNoDefault) {
193:51.58                  ^~~~~~~
193:51.58                  GetStatus()
[...]
193:56.65 make[4]: *** [${PROJECT}/gecko-dev/config/rules.mk:676: Unified_cpp_mobile_sailfishos1.o] Error 1
So that's it for today, not a long one, but if you want to read my other posts don't forget they're all available in my full Gecko Dev Diary.

Comments

Uncover Disqus comments