Commit Graph

567 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
a9d4bf384e Bug 1585317 - When using the scrollport, account for scroll-padding for anchor node selection. r=botond
Unclear whether the visual viewport code path is the right thing to do at all.

Differential Revision: https://phabricator.services.mozilla.com/D47791

--HG--
extra : moz-landing-system : lando
2019-10-02 17:24:25 +00:00
Botond Ballo
88ed171110 Bug 1577859 - Additional post container scrolling removal cleanup in Layout code. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D45596

--HG--
extra : moz-landing-system : lando
2019-09-15 21:51:41 +00:00
Botond Ballo
3a1c85bca4 Bug 1577859 - Remove the layout.scroll.root-frame-containers pref and code that depends directly on it. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D45198

--HG--
extra : moz-landing-system : lando
2019-09-15 17:01:22 +00:00
Emilio Cobos Álvarez
31c8224bf5 Bug 1561450 - Suppress scroll anchoring adjustments from scroll event listeners. r=dholbert
See https://github.com/w3c/csswg-drafts/issues/4239

This fixes what is in my opinion one of the biggest issues of scroll anchoring
as specified / currently implemented.

It's trivial to flush layout on a scroll handler and create scroll adjustments,
which in turn would trigger other scroll events to be fired. This situation,
which is what has happened in most of the scroll anchoring regressions I've
fixed, at best gets pages to get stuck in an infinite CPU loop. At worst, it
causes scrolling to be unusable because the page keeps reacting to scroll
events.

An alternative, slightly more elegant but not clear to me if 100% implementable
approach would be bug 1529702.

This should enormously reduce the need for scroll anchoring suppression
triggers[1], I'd think, which in turn would allow me to investigate removing
some of that complexity.

https://drafts.csswg.org/css-scroll-anchoring/#suppression-triggers

The setup to set / unset the boolean is a bit awkward but I couldn't come up
with anything better.

Differential Revision: https://phabricator.services.mozilla.com/D43233

--HG--
extra : moz-landing-system : lando
2019-08-23 22:29:49 +00:00
Hiroyuki Ikezoe
ba1ce0580a Bug 1508177 - Use expanded layout viewport height to tell whether we need to render the vertical overlay scrollbar. r=tnikkel
In the previous commit, we expanded layout viewport height but during reflow
the expanded layout viewport size hasn't reflected in
ScrollReflowInput::mContentsOverflowAreas.ScrollableOverflow(). We explicitly
need to use the expanded height to tell whether we need vertical vertical
scrollbars or not.

Note that the expanded layout viewport height should NOT be used for non-overlay
scrollbars cases since, for example, if the content width is specified by
`width: 100%`, the non-overlay vertical scrollbar narrows down the content's
used width a little bit because of the vertical scrollbar width, which in turn
the minimum scale gets bigger because the content's width became bit narrower,
thus the layout viewport size calculated with the minimum scale gets smaller,
then it results the vertical scrollbar no longer needs to be rendered, thus
the minimum scale gets back to the original value, then the vertical scroll
needs to be rendered again, thus this sequence of processes happens repreatedly.

Differential Revision: https://phabricator.services.mozilla.com/D40772

--HG--
extra : moz-landing-system : lando
2019-08-13 22:38:01 +00:00
Kristen Wright
5855268c8e Bug 1571544 - Convert the two layout.framevisibility.amountscrollbeforeupdate* prefs to static prefs. r=njn
Converts layout.framevisibility.amountscrollbeforeupdatevertical and layout.framevisibility.amountscrollbeforeupdatehorizontal to static prefs.

Differential Revision: https://phabricator.services.mozilla.com/D40718

--HG--
extra : moz-landing-system : lando
2019-08-05 23:30:33 +00:00
L. David Baron
ce547cd6f5 Bug 1566945 - Add a parameter to nsContainerFrame::InsertFrames for aPrevFrame's line box. r=dholbert
For now, always pass null, except when passing it through from one
overload to another.

Differential Revision: https://phabricator.services.mozilla.com/D38389

--HG--
extra : moz-landing-system : lando
2019-07-17 23:34:45 +00:00
Sylvestre Ledru
e77bfc655d Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D38057

--HG--
extra : moz-landing-system : lando
2019-07-16 07:33:44 +00:00
Emilio Cobos Álvarez
1a121e2e21 Bug 1546027 - Don't apply scroll anchor adjustments if we're restoring our scroll position. r=dholbert
Since scroll position restoration is absolute, and we'll lose it as soon as we
apply any adjustment or do any other sort of scrolling.

Differential Revision: https://phabricator.services.mozilla.com/D37941

--HG--
extra : moz-landing-system : lando
2019-07-15 17:46:11 +00:00
Cameron McCormack
9bbe5b00a3 Bug 1554571 - Part 3: Cache computed styles of scrollbar part anonymous content. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D33123

--HG--
extra : moz-landing-system : lando
2019-06-27 07:22:22 +00:00
Mihai Alexandru Michis
b485399185 Backed out 4 changesets (bug 1554571) for causing failures in minimal-xul.css
Backed out changeset 1cc4e6374b8a (bug 1554571)
Backed out changeset 30728685499e (bug 1554571)
Backed out changeset c14e9c381345 (bug 1554571)
Backed out changeset a2143551d7bc (bug 1554571)

--HG--
extra : rebase_source : 4b4442d96eb40e57b0a9834b4048b11f9be1a964
2019-06-27 07:09:55 +03:00
Cameron McCormack
8538a62557 Bug 1554571 - Part 3: Cache computed styles of scrollbar part anonymous content. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D33123

--HG--
extra : moz-landing-system : lando
2019-06-27 00:25:03 +00:00
Hiroyuki Ikezoe
a377b45fe1 Bug 1560237 - Rename ScrollFrameHelper::GetFrameForScrollSnap to ScrollFrameHelper::GetFrameForStyle. r=botond
The function will also be used for `scroll-behavior` property in a later patch
in this commit series, so it needs a more reasonable name.

Differential Revision: https://phabricator.services.mozilla.com/D35738

--HG--
extra : moz-landing-system : lando
2019-06-26 20:59:14 +00:00
Hiroyuki Ikezoe
0670fe9a3f Bug 1560237 - Introduce nsIScrollableFrame::IsSmoothScroll. r=botond
This is pretty much the same as ScrollStyles::IsSmoothScroll right now,
but in the next commit, we will no longer propagate scroll-behavior on <body> to
the root element so that nsIScrollableFrame::IsSmoothScroll will be changed
to reflect it.

Differential Revision: https://phabricator.services.mozilla.com/D35737

--HG--
extra : moz-landing-system : lando
2019-06-26 20:59:01 +00:00
Mihai Alexandru Michis
9f81e46a34 Backed out 2 changesets (bug 1559690) for causing failures in browser_tabCloseSpacer.js CLOSED TREE
Backed out changeset 9f45982e7800 (bug 1559690)
Backed out changeset fdb96c16d976 (bug 1559690)
2019-06-26 21:04:20 +03:00
Emilio Cobos Álvarez
d4281c8529 Bug 1559690 - Make scroll port events use the same mechanism as scroll events. r=hiro
This prevents them from being called from layout and is more similar to what
WillPaintObservers did.

Differential Revision: https://phabricator.services.mozilla.com/D35604
2019-06-26 14:32:32 +02:00
Emilio Cobos Álvarez
1542425954 Bug 1559690 - Move scroll event declarations to nsGfxScrollFrame.cpp r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D35603
2019-06-26 14:32:32 +02:00
Botond Ballo
c0ca36e4fd Bug 1554813 - Size the scroll parts clip to the scroll frame's true outer size. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D33377

--HG--
extra : moz-landing-system : lando
2019-06-10 16:30:42 +00:00
Cameron McCormack
f5b7d1380b Bug 866102 - Implement -webkit-line-clamp. r=mats,emilio,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D20115

--HG--
extra : moz-landing-system : lando
2019-05-09 02:32:30 +00:00
Emilio Cobos Álvarez
11ea945833 Bug 1546697 - Use a consistent style for enum classes in layout. r=dholbert
Per the discussion in:

  https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ

They should be CamelCase, and that's what most of them already do. This converts
the rest, which are a few.

For the ones that already used `e` or `k` prefixes, I've mostly done:

 for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done

For the ones that used uppercase, I've removed the prefix if it was already in
the type name, and turn them into CamelCase.

Depends on D28680

Differential Revision: https://phabricator.services.mozilla.com/D28681

--HG--
extra : moz-landing-system : lando
2019-04-25 23:03:04 +00:00
Hiroyuki Ikezoe
7356d7a696 Bug 1544198 - Use the proper frame to get scroll-snap-type value on the root element. r=botond
Now scroll-snap-type property on body element doesn't affect scroll position
so that scrollTo-scrollBy-snaps.html is needed to be modified to specify
scroll-snap-type on html.

Differential Revision: https://phabricator.services.mozilla.com/D27987

--HG--
extra : moz-landing-system : lando
2019-04-23 01:16:02 +00:00
Hiroyuki Ikezoe
eb6519bbae Bug 1544198 - Split ScrolLFrameHelper::ComputeScrollSnapInto into two functions. r=botond
The one is for the scroll snap module v1 implementation, the other is for the
old scroll snap implementation.  Now both functions have the same pieces of
code to get scroll-snap-type values, but for v1 implemention in the next commit
we will use GetFrameForScrollSnap() to get the value instead.

Differential Revision: https://phabricator.services.mozilla.com/D27986

--HG--
extra : moz-landing-system : lando
2019-04-23 01:12:38 +00:00
Hiroyuki Ikezoe
7b325b6485 Bug 1544198 - Factor out the function to get the frame for scroll-snap-type and scroll-padding. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D27985

--HG--
extra : moz-landing-system : lando
2019-04-23 01:12:24 +00:00
Masayuki Nakano
2f9688c14e Bug 1544343 - part 2: Make factory methods take mozilla::PresShell instead of nsIPresShell r=emilio
Additionally, this patch makes `nsFrame.h` stop including `nsIPresShell.h`
and makes each users include `mozilla/PresShell.h` instead.  So, this improves
rebuild performance of `nsIPresShell.h` (and `mozilla/PresShell.h` in the
future).

Note that due to `nsIFrame::PresShell()`, `mozilla::` prefix is necessary for
`PresShell` in a lot of classes which are derived from `nsIFrame` even in
`.cpp` files.

Differential Revision: https://phabricator.services.mozilla.com/D27476

--HG--
extra : moz-landing-system : lando
2019-04-16 07:24:49 +00:00
Hiroyuki Ikezoe
7b600a0531 Bug 1534070 - Factor scroll-padding into the position calculation where nsIPresShell::ScrollContentIntoView() is going to scroll if necessary. r=botond
In the case where scroll-snap-type is specified for the scroll container, the
scroll-padding is also factored into in ScrollFrameHelper::ComputeScrollSnapInfo
which is called via ScrollFrameHelper::ScrollToWithOrigin.  It doesn't double
the scroll-padding value, but it's actually redundant, we should avoid it.
We could separate the functionality of ScrollToWithOrigin, one is to scroll
to a given element, the other is to scroll to a given position.  The former will
be used for Element.scrollIntoElement and relevant stuff, the latter will be
used for Element.scrollTo and relevant stuff.  That's being said, as of now, we
have still the old scroll snap implementation, so the separation will introduce
complexity, the separation should be done once after the old implementation
removed.

There are 9 call sites of nsIPresShell::ScrollContentIntoView:
  nsIPresShell::GoToAnchor
  nsIPresShell::ScrollToAnchor
  Element::ScrollIntoView
   We definitely needs scroll-padding and scroll-margin for these functions.

  nsCoreUtils::ScrollTo
   This is used for Accesible::ScrollTo which scrolls to a given accesible node,
   probably we should behave as what Element::ScrollIntoView does.

  Accessible::DispatchClickEvent
   Similar to the above, similated various mouse events on a given target node.

  PresShell::EventHandler::PrepareToUseCaretPosition
  PresShell::EventHandler::GetCurrentItemAndPositionForElement
   Both are for context menu, we shouldn't consider scroll-padding and
   scroll-margin.

  nsFormFillController::SetPopupOpen
   This is used for autocompletion popup, we shouldn't consider scroll-padding
   and scroll-margin.

  nsFocusManager::ScrollIntoView
   This is bit unfortunate, we should use scroll-padding and scroll-margin
   depending on call site of this function. Bug 1535232 is for this case.

cssom-view/scrollIntoView-scrollPadding.html which has some tests that is
actually testing scroll-padding with scrollIntoView passes with this change.

The reftest in this change is a test case that the browser navigates to an
element with specifying the anchor to the element.

Differential Revision: https://phabricator.services.mozilla.com/D23084

--HG--
extra : moz-landing-system : lando
2019-04-11 06:22:14 +00:00
Hiroyuki Ikezoe
ee992bd0bb Bug 1373835 - Cull out elements which will be invisible in the snapport for programatic scrolls. r=botond
As for scrolling on the compositor we don't cull out them since we don't know
the final snapport rect at the time when we send the information about
snapping to the compositor.  And we will handle it for APZ in bug 1531589.

https://drafts.csswg.org/css-scroll-snap-1/#snap-scope

Depends on D21632

Differential Revision: https://phabricator.services.mozilla.com/D21633

--HG--
extra : moz-landing-system : lando
2019-04-11 06:21:23 +00:00
Hiroyuki Ikezoe
eab0011ba9 Bug 1373835 - Make ComputeScrollSnapInfo a private method of ScrollFrameHelper. r=botond
Depends on D21626

Differential Revision: https://phabricator.services.mozilla.com/D21627

--HG--
extra : moz-landing-system : lando
2019-04-11 06:20:24 +00:00
Hiroyuki Ikezoe
66dd57767b Bug 1373835 - Enable scroll snap for programatic scrolls. r=botond
From the spec [1];

 Using the scroll-snap-type property on the relevant scroll container, the
 author can request a particular bias for the scrollport to land on a snap
 position after scrolling operations (including programmatic scrolls such
 as the scrollTo() method).

The target here are functions exposed in web contents other than
Element.scrollIntoView which will be changed in the next commit.

[1] https://drafts.csswg.org/css-scroll-snap-1/#overview

Depends on D21624

Differential Revision: https://phabricator.services.mozilla.com/D21625

--HG--
extra : moz-landing-system : lando
2019-04-11 06:20:04 +00:00
Botond Ballo
8095c8e25d Bug 1516056 - Rename ScrollFrameHelper::GetScrollRangeForClamping() to GetVisualScrollRange(). r=kats
Depends on D20279

Differential Revision: https://phabricator.services.mozilla.com/D20280

--HG--
extra : moz-landing-system : lando
2019-04-08 23:34:52 +00:00
Botond Ballo
d79e2f5b64 Bug 1516056 - Rename ScrollFrameHelper::GetScrollRange() to GetLayoutScrollRange(). r=kats
Differential Revision: https://phabricator.services.mozilla.com/D20279

--HG--
extra : moz-landing-system : lando
2019-04-08 23:34:43 +00:00
Hiroyuki Ikezoe
9db5bc51b8 Bug 1519013 - Shrink the content to display size if user has never changed the site resolution. r=botond
elementFromPoint-002.html, elementFromPoint-003.html and dialog-showModal.html
use document.elementFromPoint with a given point which is calculated from the
value returned by getBoundingClientRect() for a 100% width element.  Before
this change, the given point is outside of view because there is no viewport
meta tag in the documents so that elementFromPoint fails.  After this change, the
documents fit to the visual viewport so that elementFromPoint works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D16155

--HG--
extra : moz-landing-system : lando
2019-03-28 03:04:59 +00:00
Botond Ballo
573a6eaafa Bug 1538511 - Move nsIScrollableFrame::ScrollMode into a separate file. r=kats
This allows this enumeration to be used from nsIPresShell.h without introducing
a circular dependency.

Its new home in layout/base/ScrollTypes.h, included as mozilla/ScrollTypes.h.
Others similar enums can be added to that file if desired.

This patch also makes ScrollMode an enum class (as it's no longer nested
inside a class) and switches its enumerators to the |eName| naming convention.

Differential Revision: https://phabricator.services.mozilla.com/D24796

--HG--
extra : moz-landing-system : lando
2019-03-25 23:17:20 +00:00
Botond Ballo
e6c2c99584 Bug 1531535 - Add visual smooth scroll support to nsIPresShell. r=kats
This patch renames nsIPresShell::SetPendingVisualScrollUpdate() to
ScrollToVisual(), and adds an instant vs. smooth option.

SetPendingVisualScrollUpdate() still exists, as a helper for the instant case.

Differential Revision: https://phabricator.services.mozilla.com/D24553

--HG--
extra : moz-landing-system : lando
2019-03-23 20:23:35 +00:00
Botond Ballo
902b978f7f Bug 1531535 - Extract an ApzSmoothScrollTo() helper function. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D24552

--HG--
extra : moz-landing-system : lando
2019-03-23 20:23:20 +00:00
Hiroyuki Ikezoe
af78a85968 Bug 1532443 - Drop clampScrollPoistion stuff. r=kats
This was introduced in bug 726817 for B2G stuff and there is no call site of
SetClampScrollPosition now and the only one entry point to call the function
was nsIFrameLoader.clampScrollPosition which was removed in
https://hg.mozilla.org/mozilla-central/rev/cd9aace7bb96 .

ScrollFrameHelper::ShouldClampScrollPosition() had always returned true in both
cases of root and non-root scrollable frames. (In the case of non-root
scrollable, nsFrameLoader.mClampScrollPosition is initially set to true and
nobody changes the value)

Differential Revision: https://phabricator.services.mozilla.com/D22026

--HG--
extra : moz-landing-system : lando
2019-03-04 22:16:46 +00:00
Botond Ballo
5a7e4e2124 Bug 1528743 - Move the top-layer display items inside the async zoom container. r=mstange
This maintains the important invariant that layers that carry scroll metadata
for the RCD-RSF are inside the async zoom container.

Differential Revision: https://phabricator.services.mozilla.com/D22049

--HG--
extra : moz-landing-system : lando
2019-03-06 22:51:09 +00:00
Ryan Hunt
fc7e92ad83 Bug 1520363 - Rename nsIScrollableFrame::GetAnchor() to Anchor(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D19872

--HG--
extra : moz-landing-system : lando
2019-02-15 01:25:55 +00:00
Hiroyuki Ikezoe
ff820309e3 Bug 1525075 - Use the ICB size for Element.{clientWidth, clientHeight} instead of expanded the layout viewport size. r=botond
This is what Chrome does.

documentElement-clientWidth-on-minimum-scale-size.tentative.html was the test
case for this but unfortunately it was disabled in bug 1515043. And it seems
that the test case failed on Android in the first place.

Differential Revision: https://phabricator.services.mozilla.com/D19461

--HG--
extra : moz-landing-system : lando
2019-02-13 23:47:32 +00:00
Emilio Cobos Álvarez
12867b1a3f Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D18734
2019-02-07 11:15:36 +01:00
Daniel Holbert
4147f36107 Bug 969874: Make scrollable frames derive their baseline from their scrolled content (unless their display value is block-inside). r=mats
Before this patch, we made scrollable frames derive their baseline from their
margin-box, because that's what the spec requires for scrollable inline-block
boxes. However, the spec now singles out inline-block as a special case, and
other sorts of scrollable inline-level containers are supposed to derive their
baseline from the scrolled content. So, this patch makes us do that, with an
exception for scrollable inline-block boxes.

For more info about the block-inside special case, see the end of the "block
containers" chunk here: https://drafts.csswg.org/css-align/#baseline-export
(Though that spec text may be a bit too specific, per my spec issue at
https://github.com/w3c/csswg-drafts/issues/3611 -- that's why this patch checks
for block-inside rather than inline-block.)

Differential Revision: https://phabricator.services.mozilla.com/D18481

--HG--
extra : moz-landing-system : lando
2019-02-06 00:22:56 +00:00
Daniel Holbert
3cee4428b6 Bug 1525133: Explicitly skip orthogonal-flow children when determining last-baseline of a block from its children. r=mats
Without the check that I'm adding in this patch, we'd violate the
"parallel writing mode" expectation of some baseline accessors
that we use in the now-guarded code. And we'd produce bogus layout
as a result.

The added assertions are just for good measure. The included testcase
causes us to fail both assertions, in a build that's missing the fix.

Differential Revision: https://phabricator.services.mozilla.com/D18715

--HG--
extra : moz-landing-system : lando
2019-02-05 19:45:46 +00:00
Ryan Hunt
6d38cefd3d Bug 1522264 - Translate the visual viewport offset to be relative to the scroll port. r=botond
This was lost in the change to only use the visual viewport if both the
size and offset were set.

Differential Revision: https://phabricator.services.mozilla.com/D17752

--HG--
extra : moz-landing-system : lando
2019-01-28 19:48:00 +00:00
Ryan Hunt
3e87663a7f Bug 1518640 - Use the visual viewport for anchor node selection. r=botond
--HG--
extra : rebase_source : 0f7038a4bf6b7d2a7958177b883c7fbb4130d288
extra : intermediate-source : 97681055c88c7af478467d6c76e227d0cb916aad
extra : source : 27bbb318ecb4f44c315f87584bdeb1b239d80cef
2019-01-22 13:37:16 -06:00
Csoregi Natalia
54be80a8cf Backed out 2 changesets (bug 1518640) for reftest failures on gfx/layers/apz/test/reftest/frame-reconstruction-scroll-clamping.html. CLOSED TREE
Backed out changeset 27bbb318ecb4 (bug 1518640)
Backed out changeset 3b192e4631cc (bug 1518640)
2019-01-22 22:37:00 +02:00
Ryan Hunt
04f720e12c Bug 1518640 - Use the visual viewport for anchor node selection. r=botond
--HG--
extra : histedit_source : 44a540ddceb42939c124e51486c18856584de39a
2019-01-22 13:37:16 -06:00
Hiroyuki Ikezoe
496dff9a8b Bug 1423013 - Expand the layout viewport to the minimum scale size for overflow:hidden pages. r=botond,tnikkel
Depends on D15345

Differential Revision: https://phabricator.services.mozilla.com/D15347

--HG--
extra : moz-landing-system : lando
2019-01-15 09:48:18 +00:00
Oana Pop Rus
e6a470fee9 Backed out 3 changesets (bug 1423013) for failing at reftests/transform/compound-1a.html on a CLOSED TREE
Backed out changeset 91624c065046 (bug 1423013)
Backed out changeset 050a2ef2393d (bug 1423013)
Backed out changeset db57901030e9 (bug 1423013)
2019-01-15 09:35:57 +02:00
Hiroyuki Ikezoe
4faf5e4991 Bug 1423013 - Expand the layout viewport to the minimum scale size for overflow:hidden pages. r=botond,tnikkel
Depends on D15345

Differential Revision: https://phabricator.services.mozilla.com/D15347

--HG--
extra : moz-landing-system : lando
2019-01-15 03:28:10 +00:00
Jan Henning
79fe5e1e56 Bug 1498812 - Part 11: Use Visual Viewport for storing scroll position in the PresState. r=botond,tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D15691

--HG--
extra : moz-landing-system : lando
2019-01-11 19:50:24 +00:00
Ryan Hunt
43e96a0c82 Bug 1305957 part 7 - Adjust scroll offset to match change in relative position of scroll anchor after reflow. r=hiro,dbaron
This commit implements anchor offset adjustment. When the position of a frame
that is an anchor is changed during reflow, we notify the anchor container. The
anchor container will then post a reflow callback.

Then when reflow is completed, the anchor container will perform a scroll to
keep the anchor node in the same relative position.

Differential Revision: https://phabricator.services.mozilla.com/D13270

--HG--
extra : rebase_source : 9d40a5d5b73777d0da3799f162eeb85bb8e6d8f0
extra : source : d9052f7b34d9857863b66d64797f8b0b82504bec
2018-12-21 10:26:10 -06:00