Commit b073baab authored by Csoregi Natalia's avatar Csoregi Natalia
Browse files

Backed out 30 changesets (bug 1556556, bug 1631568) for multiple mochitest failures. CLOSED TREE

Backed out changeset edd529f7a9c5 (bug 1631568)
Backed out changeset 1cc0881e244b (bug 1631568)
Backed out changeset ed3c1e85d5e3 (bug 1556556)
Backed out changeset 38ffc6215bbf (bug 1556556)
Backed out changeset 03c2c25d8023 (bug 1556556)
Backed out changeset 9c717eb067b8 (bug 1556556)
Backed out changeset 98e26bc98b85 (bug 1556556)
Backed out changeset 05a6a581e755 (bug 1556556)
Backed out changeset 867946cf05bb (bug 1556556)
Backed out changeset 20d72a334530 (bug 1556556)
Backed out changeset 2c62e61d9054 (bug 1556556)
Backed out changeset 62a223d057d2 (bug 1556556)
Backed out changeset 2c5d55a1f0b1 (bug 1556556)
Backed out changeset 700447945b4e (bug 1556556)
Backed out changeset 93190ae4f5ff (bug 1556556)
Backed out changeset a7bd34d961bb (bug 1556556)
Backed out changeset fccd1d3c7189 (bug 1556556)
Backed out changeset 24056e47183d (bug 1556556)
Backed out changeset 204881474cc1 (bug 1556556)
Backed out changeset 387320881876 (bug 1556556)
Backed out changeset be8f5eb58460 (bug 1556556)
Backed out changeset 629c58a9166b (bug 1556556)
Backed out changeset 4312b2b5dda8 (bug 1556556)
Backed out changeset d11dbf6403a5 (bug 1556556)
Backed out changeset 95c54c023779 (bug 1556556)
Backed out changeset 80fcb7e71188 (bug 1556556)
Backed out changeset d75a4ecb0d47 (bug 1556556)
Backed out changeset 903c4de34e7a (bug 1556556)
Backed out changeset f15334a3e803 (bug 1556556)
Backed out changeset 9553e99137ea (bug 1556556)
parent 879ef8e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ void DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer,
  nsRect scrollPort = sf ? sf->GetScrollPortRect() : rootFrame->GetRect();

  nsLayoutUtils::GetFramesForArea(
      RelativeTo{presShell->GetRootFrame()}, scrollPort, frames,
      presShell->GetRootFrame(), scrollPort, frames,
      nsLayoutUtils::FrameForPointOption::OnlyVisible);
  AccessibleHashtable inViewAccs;
  for (size_t i = 0; i < frames.Length(); i++) {
+20 −2
Original line number Diff line number Diff line
@@ -527,8 +527,26 @@ Accessible* Accessible::ChildAtPoint(int32_t aX, int32_t aY,
  nsPoint offset(presContext->DevPixelsToAppUnits(aX) - screenRect.X(),
                 presContext->DevPixelsToAppUnits(aY) - screenRect.Y());

  nsIFrame* foundFrame = nsLayoutUtils::GetFrameForPoint(
      RelativeTo{startFrame, ViewportType::Visual}, offset);
  // We need to take into account a non-1 resolution set on the presshell.
  // This happens in mobile platforms with async pinch zooming.
  offset = offset.RemoveResolution(presContext->PresShell()->GetResolution());

  // We need to translate with the offset of the edge of the visual
  // viewport from top edge of the layout viewport.
  offset += presContext->PresShell()->GetVisualViewportOffset() -
            presContext->PresShell()->GetLayoutViewportOffset();

  EnumSet<nsLayoutUtils::FrameForPointOption> options = {
#ifdef MOZ_WIDGET_ANDROID
      // This is needed in Android to ignore the clipping of the scroll frame
      // when zoomed in. May regress something on other platforms, so
      // keeping it Android-exclusive for now.
      nsLayoutUtils::FrameForPointOption::IgnoreRootScrollFrame
#endif
  };

  nsIFrame* foundFrame =
      nsLayoutUtils::GetFrameForPoint(startFrame, offset, options);

  nsIContent* content = nullptr;
  if (!foundFrame || !(content = foundFrame->GetContent()))
+3 −3
Original line number Diff line number Diff line
@@ -12322,7 +12322,7 @@ already_AddRefed<nsDOMCaretPosition> Document::CaretPositionFromPoint(
  }
  nsIFrame* ptFrame = nsLayoutUtils::GetFrameForPoint(
      RelativeTo{rootFrame}, pt,
      rootFrame, pt,
      {FrameForPointOption::IgnorePaintSuppression,
       FrameForPointOption::IgnoreCrossDoc});
  if (!ptFrame) {
@@ -12334,8 +12334,8 @@ already_AddRefed<nsDOMCaretPosition> Document::CaretPositionFromPoint(
  nsCOMPtr<nsIWidget> widget = nsContentUtils::GetWidget(presShell, &aOffset);
  LayoutDeviceIntPoint refPoint = nsContentUtils::ToWidgetPoint(
      CSSPoint(aX, aY), aOffset, GetPresContext());
  nsPoint adjustedPoint = nsLayoutUtils::GetEventCoordinatesRelativeTo(
      widget, refPoint, RelativeTo{ptFrame});
  nsPoint adjustedPoint =
      nsLayoutUtils::GetEventCoordinatesRelativeTo(widget, refPoint, ptFrame);
  nsFrame::ContentOffsets offsets =
      ptFrame->GetContentOffsetsFromPoint(adjustedPoint);
+11 −16
Original line number Diff line number Diff line
@@ -363,7 +363,7 @@ template <typename NodeOrElement>
static void QueryNodesFromRect(DocumentOrShadowRoot& aRoot, const nsRect& aRect,
                               EnumSet<FrameForPointOption> aOptions,
                               FlushLayout aShouldFlushLayout,
                               Multiple aMultiple, ViewportType aViewportType,
                               Multiple aMultiple,
                               nsTArray<RefPtr<NodeOrElement>>& aNodes) {
  static_assert(std::is_same<nsINode, NodeOrElement>::value ||
                    std::is_same<Element, NodeOrElement>::value,
@@ -395,8 +395,7 @@ static void QueryNodesFromRect(DocumentOrShadowRoot& aRoot, const nsRect& aRect,
  aOptions += FrameForPointOption::IgnoreCrossDoc;

  AutoTArray<nsIFrame*, 8> frames;
  nsLayoutUtils::GetFramesForArea({rootFrame, aViewportType}, aRect, frames,
                                  aOptions);
  nsLayoutUtils::GetFramesForArea(rootFrame, aRect, frames, aOptions);

  for (nsIFrame* frame : frames) {
    nsIContent* content = doc->GetContentInThisDocument(frame);
@@ -440,7 +439,7 @@ template <typename NodeOrElement>
static void QueryNodesFromPoint(DocumentOrShadowRoot& aRoot, float aX, float aY,
                                EnumSet<FrameForPointOption> aOptions,
                                FlushLayout aShouldFlushLayout,
                                Multiple aMultiple, ViewportType aViewportType,
                                Multiple aMultiple,
                                nsTArray<RefPtr<NodeOrElement>>& aNodes) {
  // As per the spec, we return null if either coord is negative.
  if (!aOptions.contains(FrameForPointOption::IgnoreRootScrollFrame) &&
@@ -452,37 +451,35 @@ static void QueryNodesFromPoint(DocumentOrShadowRoot& aRoot, float aX, float aY,
  nscoord y = nsPresContext::CSSPixelsToAppUnits(aY);
  nsPoint pt(x, y);
  QueryNodesFromRect(aRoot, nsRect(pt, nsSize(1, 1)), aOptions,
                     aShouldFlushLayout, aMultiple, aViewportType, aNodes);
                     aShouldFlushLayout, aMultiple, aNodes);
}

}  // namespace

Element* DocumentOrShadowRoot::ElementFromPoint(float aX, float aY) {
  return ElementFromPointHelper(aX, aY, false, true, ViewportType::Layout);
  return ElementFromPointHelper(aX, aY, false, true);
}

void DocumentOrShadowRoot::ElementsFromPoint(
    float aX, float aY, nsTArray<RefPtr<Element>>& aElements) {
  QueryNodesFromPoint(*this, aX, aY, {}, FlushLayout::Yes, Multiple::Yes,
                      ViewportType::Layout, aElements);
                      aElements);
}

void DocumentOrShadowRoot::NodesFromPoint(float aX, float aY,
                                          nsTArray<RefPtr<nsINode>>& aNodes) {
  QueryNodesFromPoint(*this, aX, aY, {}, FlushLayout::Yes, Multiple::Yes,
                      ViewportType::Layout, aNodes);
                      aNodes);
}

nsINode* DocumentOrShadowRoot::NodeFromPoint(float aX, float aY) {
  AutoTArray<RefPtr<nsINode>, 1> nodes;
  QueryNodesFromPoint(*this, aX, aY, {}, FlushLayout::Yes, Multiple::No,
                      ViewportType::Layout, nodes);
  QueryNodesFromPoint(*this, aX, aY, {}, FlushLayout::Yes, Multiple::No, nodes);
  return nodes.SafeElementAt(0);
}

Element* DocumentOrShadowRoot::ElementFromPointHelper(
    float aX, float aY, bool aIgnoreRootScrollFrame, bool aFlushLayout,
    ViewportType aViewportType) {
    float aX, float aY, bool aIgnoreRootScrollFrame, bool aFlushLayout) {
  EnumSet<FrameForPointOption> options;
  if (aIgnoreRootScrollFrame) {
    options += FrameForPointOption::IgnoreRootScrollFrame;
@@ -491,8 +488,7 @@ Element* DocumentOrShadowRoot::ElementFromPointHelper(
  auto flush = aFlushLayout ? FlushLayout::Yes : FlushLayout::No;

  AutoTArray<RefPtr<Element>, 1> elements;
  QueryNodesFromPoint(*this, aX, aY, options, flush, Multiple::No,
                      aViewportType, elements);
  QueryNodesFromPoint(*this, aX, aY, options, flush, Multiple::No, elements);
  return elements.SafeElementAt(0);
}

@@ -524,8 +520,7 @@ void DocumentOrShadowRoot::NodesFromRect(float aX, float aY, float aTopSize,
  }

  auto flush = aFlushLayout ? FlushLayout::Yes : FlushLayout::No;
  QueryNodesFromRect(*this, rect, options, flush, Multiple::Yes,
                     ViewportType::Layout, aReturn);
  QueryNodesFromRect(*this, rect, options, flush, Multiple::Yes, aReturn);
}

Element* DocumentOrShadowRoot::AddIDTargetObserver(nsAtom* aID,
+1 −3
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@

#include "mozilla/dom/NameSpaceConstants.h"
#include "mozilla/IdentifierMapEntry.h"
#include "mozilla/RelativeTo.h"
#include "nsClassHashtable.h"
#include "nsContentListDeclarations.h"
#include "nsTArray.h"
@@ -136,8 +135,7 @@ class DocumentOrShadowRoot {
   */
  Element* ElementFromPointHelper(float aX, float aY,
                                  bool aIgnoreRootScrollFrame,
                                  bool aFlushLayout,
                                  ViewportType aViewportType);
                                  bool aFlushLayout);

  void NodesFromRect(float aX, float aY, float aTopSize, float aRightSize,
                     float aBottomSize, float aLeftSize,
Loading