Граф коммитов

1173 Коммитов

Автор SHA1 Сообщение Дата
Timothy Nikkel 4bbac61cfe Bug 1651332. Update scrollbar position when the visual viewport offset changes. r=kats
The scrollbar is now positioned using the visual viewport offset, so we need to update when that changes.

Differential Revision: https://phabricator.services.mozilla.com/D82687
2020-07-19 10:04:42 +00:00
Hiroyuki Ikezoe a6522ef178 Bug 1652190 - Set nsPresContext::mDynamicToolbarHeight in nsPresContext::SetDynamicToolbarMaxHeight. r=botond
nsPreContext::mDynamicToolbarHeight is representing the state of the dynamic
toolbar in transition or is being collapsed. So if we leave the value as it is,
we misrecognize the state, the visual viewport width/height are significantly
affected by the misrecognition, it returns 0 because in the collapsed or the
transition state, it returns the special value [1] which is never properly set
without calling nsPresContext::UpdateDynamicToolbarOffset.

This mismatching state doesn't much matter in the real sites since we don't
often change the max height of the dynamic toolbar but in automated tests it's
a big problem. In fact a test case which will be introduced in the next commit
will not work properly without this fix.

[1] https://searchfox.org/mozilla-central/rev/1b95a0179507a4dc7d4b0c94c2df420dc1a72885/dom/base/VisualViewport.cpp#78

Differential Revision: https://phabricator.services.mozilla.com/D83902
2020-07-21 02:52:51 +00:00
Ting-Yu Lin fdc00547f6 Bug 1637130 - Rename visual overflow to ink overflow. r=dbaron
This patch is generated by:

```
# Rename the nsOverflowType enum.
rg -l "eVisualOverflow" layout/ gfx/ | xargs sed -i "s/eVisualOverflow/eInkOverflow/g"

# Rename and drop the "Get" prefix from various functions.
rg -l "GetVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowRect/InkOverflowRect/g"
rg -l "GetPreEffectsVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetPreEffectsVisualOverflowRect/PreEffectsInkOverflowRect/g"
rg -l "GetVisualOverflowFromDeltas" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowFromDeltas/InkOverflowFromDeltas/g"
rg -l "GetScrollableOverflowRect" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowRect/ScrollableOverflowRect/g"

# Rename, drop the "Get" prefix, and change the suffix "Area" to "Rect"
# (because they return nsRect) for the two methods in nsLineBox.
rg -l "GetVisualOverflowArea" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowArea/InkOverflowRect/g"
rg -l "GetScrollableOverflowArea" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowArea/ScrollableOverflowRect/g"

# Rename rest of the functions and variables.
rg -l "VisualOverflow" layout/ gfx/ | xargs sed -i "s/VisualOverflow/InkOverflow/g"
rg -l "visual overflow" layout/ gfx/ | xargs sed -i "s/visual overflow/ink overflow/g"
rg -l "visualOverflow" layout/ gfx/ | xargs sed -i "s/visualOverflow/inkOverflow/g"
rg -l "visOverflow" layout/ gfx/ | xargs sed -i "s/visOverflow/inkOverflow/g"
rg -l "vis-overflow" layout/ gfx/ python/ | xargs sed -i "s/vis-overflow/ink-overflow/g"

./mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D84231
2020-07-20 20:17:36 +00:00
Cameron McCormack c9ce840ad8 Bug 1652120 - Initialize local variable in PresShell::CreateRangePaintInfo. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D83739
2020-07-16 06:37:51 +00:00
Cameron McCormack 1fe732d979 Bug 1620467 - Part 3: Defer to -moz-default-appearance when appearance is auto. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D83429
2020-07-16 22:04:12 +00:00
Kagami Sascha Rosylight f4c2e30310 Bug 1652188 - Return struct from nsILineIterator::GetLine() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D83215
2020-07-13 18:36:30 +00:00
longsonr c2fc063be0 Bug 1652254 - Remove svg from some moz.build local includes r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D83247
2020-07-12 16:38:26 +00:00
Ting-Yu Lin ffcfb6dcec Bug 1651171 - Convert NS_SUBTREE_DIRTY to an inline method of nsIFrame. r=jfkthame
This is a straightforward conversion except that
`NS_SUBTREE_DIRTY(this)` can be written terser as `IsSubtreeDirty()`.

Differential Revision: https://phabricator.services.mozilla.com/D82811
2020-07-09 18:29:15 +00:00
Hiroyuki Ikezoe 2e4ceac41e Bug 1525561 - Rename nsPresContext::GetToplevelContentDocumentPresContext to GetInProcessRootContentDocumentPresContext. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D82812
2020-07-09 01:58:59 +00:00
Kagami Sascha Rosylight f6d17b63b5 Bug 1630704 - Part 28: Remove nsFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81865
2020-07-06 22:38:11 +00:00
Kagami Sascha Rosylight 1afcf4d621 Bug 1630704 - Part 27: Remove nsFrame from inheritance chain r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81864
2020-07-06 22:29:42 +00:00
Simon Giesecke 9364b353d4 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Kartikaya Gupta 40a788d924 Bug 1647034 - Change how the visual viewport is updated to eliminate spurious reflows. r=tnikkel
There's two code changes in this patch:

- The update to the visual viewport that was happening just before positioning
  the fixed items gets moved to happen after determining the scrollbars for
  the root scrollframe. This moves it a little bit earlier, to basically the
  earliest point at which the visual viewport can actually be computed, since
  it depends on the presence of the root scrollframe's scrollbars.

  More importantly, this change sets the visual viewport without checking to
  see if one was already set, as the old code did. This means every reflow
  of the root scrollframe on a presShell with an MVM will now have a visual
  viewport set. Previously the visual viewport would only get set for the first
  time when the MVM got a load or first-paint event, and then would get updated
  for subsequent reflows. The net effect here is that the visual viewport is
  set earlier, and this can sometimes eliminate extra reflows from after the
  load event, because everything is already in a consistent state.

- The NotifyResizeReflow call to MVM is replaced by a NotifyReflow call that
  runs before every reflow, instead of just on resizes. Note that the
  NotifyReflow also doesn't update the visual viewport like NotifyResizeReflow
  used to do, because that is taken care of by the above-mentioned code change
  to set the visual viewport.

  This is desirable because there are things that run during reflow that attempt
  to read the display size from the MVM, and they were getting a zero size
  for reflows that happened before the first resize or load/first-paint events.
  Now they get a valid display size on every reflow, and so again this allows
  fewer overall reflows as the code converges to a stable state faster.

Together these changes ensure that every reflow has access to up-to-date
properties (display size, mobile viewport size, visual viewport size) from the
MVM. This eliminates unnecessary reflows because of out-of-order computations
based on stale values and such. Therefore the number of reflows goes down,
which is reflected by the changes to the crashtest assertion counts.

Differential Revision: https://phabricator.services.mozilla.com/D81375
2020-06-29 18:39:57 +00:00
Kagami Sascha Rosylight 105b257eeb Bug 1647525 - Use HasAnyStateBits() in PresShell r=emilio
Depends on D81096

Differential Revision: https://phabricator.services.mozilla.com/D81097
2020-06-25 14:09:31 +00:00
Kartikaya Gupta fcd82d40d2 Bug 1648451 - Stop resetting the scroll anchor on visual viewport size changes. r=emilio
While it makes sense to do this when the visual viewport offset changes, it
doesn't make as much sense when the visual viewport size changes. The size can
change whenever non-overlay scrollbars are added or removed to the root
scrollframe, which is an operation that seems like it shouldn't interfere with
scroll anchoring at all.

Differential Revision: https://phabricator.services.mozilla.com/D81071
2020-06-25 12:58:50 +00:00
Emilio Cobos Álvarez 2948ee6b8c Bug 1647871 - Remove AutoResizeReflowSquasher. r=kats
After the above, I don't think this is needed anymore, because we
shouldn't be looking at the widget size from layout.

It also shouldn't cause more reflows on desktop at least, because of the
early out in ResizeReflowIgnoreOverride before calling
SimpleResizeReflow().

Differential Revision: https://phabricator.services.mozilla.com/D80731
2020-06-24 13:29:18 +00:00
Andrew Osmond a70c654c29 Bug 1550710 - Make vector images enable high quality scaling for embedded raster images. r=tnikkel
We did not pass FLAG_HIGH_QUALITY_SCALING down to the document used to
rasterize the SVG to a surface, resulting in embedded raster images to
not use high quality downscaling.

Differential Revision: https://phabricator.services.mozilla.com/D56422
2020-06-23 12:43:21 +00:00
Kartikaya Gupta 6529d86dc8 Bug 1644271 - Log the URI for each MVM created. r=tnikkel
There's a lot of documents that get created (about:blank and friends) and this
makes it easier to figure out which MVM we actually care about.

Differential Revision: https://phabricator.services.mozilla.com/D80085
2020-06-21 20:48:39 +00:00
Emilio Cobos Álvarez b9b9e38dd9 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-22 09:45:40 +00:00
Razvan Maries c60adf564e Backed out 6 changesets (bug 1644271) for perma failures on browser_bug1170531.js.
Backed out changeset 9d4e746c732d (bug 1644271)
Backed out changeset 681a48643a84 (bug 1644271)
Backed out changeset 3cf3176c45d4 (bug 1644271)
Backed out changeset efaddcd67a33 (bug 1644271)
Backed out changeset 03aaac05c759 (bug 1644271)
Backed out changeset a780f5111efa (bug 1644271)
2020-06-21 23:44:04 +03:00
Kartikaya Gupta 565bdb8643 Bug 1644271 - Log the URI for each MVM created. r=tnikkel
There's a lot of documents that get created (about:blank and friends) and this
makes it easier to figure out which MVM we actually care about.

Differential Revision: https://phabricator.services.mozilla.com/D80085
2020-06-18 11:20:46 +00:00
Kartikaya Gupta 3cdcbca508 Bug 1646385 - Move SetVisualViewport goop from nsLayoutUtils to PresShell. r=tnikkel
There's no need to put this in nsLayoutUtils since it's so closely bound
to presShell anyway. So we move it from being a static nsLayoutUtils function
that takes a PresShell pointer, to being a method on the PresShell itself.

Two functional changes here:
1. Don't run the MaybeReflowForInflationScreenSizeChange code unless the
   visual viewport actually changes
2. Run the MaybeReflowForInflationScreenSizeChange if the visual viewport
   is reset.

These functional changes can be logically thought of as "group the font-
inflation reflow stuff together with the other visual-viewport-triggered
reflow stuff".

Depends on D80040

Differential Revision: https://phabricator.services.mozilla.com/D80041
2020-06-18 11:54:01 +00:00
Kartikaya Gupta 6540b81148 Bug 1646385 - Ensure we recompute the visual viewport size when the root scrollframe's scrollbars get added or removed. r=tnikkel
There are two parts here. One is the "backstop" in the scrollframe's
ReflowFinished callback, that recomputes the visual viewport size if layout
scrollbars are being used in the root scrollframe. This ensures that the
visual viewport gets resized properly after a reflow, possibly at the expense
of a second reflow to reposition fixed-pos items.

There is also an update to the visual viewport during the reflow itself, after
we have reflowed the in-flow contents (including the root scrollframe) but
before we reflow the fixed-pos items. This allows us to avoid the second reflow
by using the new visual viewport for positioning the fixed-pos items correctly.
This early reflow also skips marking things for a second reflow.

This patch fixes a problem described in bug 1644271 comment 2, among other
things. Specifically, it ensures that when the scrollbar properties (e.g.
maxpos, minpos) are computed, they are computed using an up-to-date visual
viewport size. The up-to-date visual viewport size correctly excludes the space
taken up by non-overlay scrollbars, which wasn't happening without this patch.

Depends on D80039

Differential Revision: https://phabricator.services.mozilla.com/D80040
2020-06-18 22:30:00 +00:00
Kartikaya Gupta e28e2f103c Bug 1645954 - Ensure we update both the content viewer and widget sizes before doing a reflow. r=tnikkel
The existing comment in BrowserChild::RecvUpdateDimensions may have been
accurate at some point in the past, but I'm seeing cases where setting
the content viewer size itself triggers a reflow. Since the widget size
hasn't been updated yet, the reflow uses some stale values and produces
incorrect outcomes. This patch ensures both the content viewer and widget
get their sizes updated first, and only then do we do the reflow.

Differential Revision: https://phabricator.services.mozilla.com/D79885
2020-06-20 11:25:22 +00:00
Edgar Chen 4d53288bec Bug 1635784 - Part 1: IsRemoteTarget should take fission OOP iframe into account; r=smaug
And add IsTopLevelRemoteTarget for the original usage.

Differential Revision: https://phabricator.services.mozilla.com/D79441
2020-06-18 20:38:34 +00:00
Cosmin Sabou 65d75a47f3 Backed out changeset 299e19193e11 (bug 1646224) for causing font related failures. CLOSED TREE 2020-06-18 18:26:51 +03:00
Emilio Cobos Álvarez 090e3d2409 Bug 1646224 - Use mozilla::Length rather than nscoord to store font sizes. r=heycam,jfkthame
This avoids arbitrary precision loss when computing REM units and so on,
which is particularly important if we ever change the base of our app
units (but useful regardless).

Differential Revision: https://phabricator.services.mozilla.com/D79928
2020-06-18 13:55:03 +00:00
Markus Stange b1f429577f Bug 1592739 - Ignore the background-color CSS value on the window document's root element if that element has a non-glass -moz-appearance. r=tnikkel
For regular elements, whenever -moz-appearance is used, the CSS background is
ignored. Root elements were behaving specially, and the background color also
needed to be adjusted.
For example, for Windows 7, we have the following CSS rule;

```
:root {
  background-color: transparent;
  -moz-appearance: -moz-win-borderless-glass;
}
```

This change makes the root element more consistent with other elements, if non-glass
-moz-appearance values are used. For example, for platforms where `-moz-appearance: dialog`
has (partially) transparent rendering, the extra `background-color: transparent`
declaration is now no longer necessary.

This patch preserves the behavior for Windows 7 glass because there are several other
things that would need to be adjusted for the glass case (see bug 1601183 and bug 1599366).
Maybe we can just wait until we drop Windows 7 entirely, to clean this up.

This change does not let content documents opt out of forced opaqueness:
Root content documents still get an opaque background color from an existing
check further down in this method.

Differential Revision: https://phabricator.services.mozilla.com/D51459
2020-06-12 03:53:58 +00:00
Sylvestre Ledru 85c05f3a47 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D79795
2020-06-16 14:37:23 +00:00
Kartikaya Gupta f199649765 Bug 1645520 - Ensure an MVM operating in VisualViewportOnly mode knows about display resizes. r=tnikkel
This is important because if the apz.allow_zooming pref is enabled (and
eventually even without that pref), VisualViewportOnly-type MVMs do set
the visual viewport size based on the display size and zoom, and so need
to be updated when those change.

It's also important to keep the mMobileViewportSize updated and in sync
with the display size, because it may get used via ComputeIntrinsicResolution
when fullscreening.

Differential Revision: https://phabricator.services.mozilla.com/D79594
2020-06-15 13:32:44 +00:00
Botond Ballo 2090aa6d30 Bug 1638594 - Use visual coordinates when hit testing in a chrome document. r=tnikkel
It does not make sense to ask for layout coordinates relative to
a chrome document. If the chrome document has a zoomed (RCD)
descendant in the same process, this means we do not apply the
visual-to-layout transform when later entering the RCD.

Depends on D79588

Differential Revision: https://phabricator.services.mozilla.com/D79589
2020-06-13 03:30:12 +00:00
Bogdan Tara 67ffb08651 Backed out changeset b44a56033fc8 (bug 1645520) for test_fullscreen-api.html failures CLOSED TREE 2020-06-13 17:16:24 +03:00
Kartikaya Gupta fa92ff33df Bug 1645520 - Ensure an MVM operating in VisualViewportOnly mode knows about display resizes. r=tnikkel
This is important because if the apz.allow_zooming pref is enabled (and
eventually even without that pref), VisualViewportOnly-type MVMs do set
the visual viewport size based on the display size and zoom, and so need
to be updated when those change.

Differential Revision: https://phabricator.services.mozilla.com/D79594
2020-06-13 11:41:40 +00:00
Emilio Cobos Álvarez 0f9181c73b Bug 1642922 - Tweak scroll-padding implementation to also account for visibility. r=hiro
The previous implementation made us think that stuff was visible when in
fact it was not.

Differential Revision: https://phabricator.services.mozilla.com/D79345
2020-06-11 21:24:33 +00:00
Kartikaya Gupta 2c71f100fb Bug 1644271 - Don't let the MVM control reflow dimensions unless we're using mobile viewport sizing. r=tnikkel
Allowing the MVM to control the reflow means that the requested reflow size
is ignored, and instead the existing CSS/layout viewport is used. This is
undesirable for calls to SizeToContent(), where the intent is to do a reflow
to figure out the smallest amount of space the content fits in.

In general though unless we are using mobile viewport sizing we shouldn't be
needing the MVM to drive reflows.

Differential Revision: https://phabricator.services.mozilla.com/D79225
2020-06-12 01:15:44 +00:00
Kartikaya Gupta ba088f5b71 Bug 1644271 - Add a ManagerType field to the MVM, to allow conditional behaviour. r=tnikkel
The MVM is needed for both handling of meta-viewport tags and APZ zooming.
However, the set of functionality needed in the two modes are not the same.
This patch adds a mechanism to create an MVM with a flag that lets it know
which mode it is operating in. Eventually we may want to split this into two
or more classes but for now this seems like a reasonable way forward.

The flag is currently set on the MVM on creation based on whether or not the
meta-viewport support is needed. There's no code that meaningfully *uses* the
flag yet, so this patch should have no functional change. The bulk of the
patch is ensuring that we appropriately destroy and re-create the MVM if the
flag required changes.

Differential Revision: https://phabricator.services.mozilla.com/D79224
2020-06-12 01:15:42 +00:00
Kartikaya Gupta f89c7c3302 Bug 1644271 - Add a pref to enable the MobileViewportManager. r=tnikkel
Currently false by default, so no functional change in the default
configuration.

Differential Revision: https://phabricator.services.mozilla.com/D79223
2020-06-12 01:15:40 +00:00
Simon Giesecke 82dc9b2271 Bug 1642949 - Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78027
2020-06-10 10:46:14 +00:00
Butkovits Atila e3dce68834 Backed out 3 changesets (bug 1643289, bug 1642949) for causing failure at test_headless_screenshot.html. CLOSED TREE
Backed out changeset 98c420f73380 (bug 1643289)
Backed out changeset 9447ea8910aa (bug 1643289)
Backed out changeset 0c827da9d847 (bug 1642949)
2020-06-10 10:07:23 +03:00
Simon Giesecke d419f0ff08 Bug 1642949 - Replace uses of RemoveElementAt by RemoveLastElement/PopLastElement where possible. r=necko-reviewers,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78027
2020-06-10 05:49:28 +00:00
Kartikaya Gupta c4698ef203 Bug 1627708 - Add boolean telemetry histograms for recording if APZ zooming occurred. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D77827
2020-06-06 00:32:12 +00:00
Kartikaya Gupta 7ac36807b1 Bug 1643042 - Turn the scroll origin parameter into a strongly-typed enum. r=tnikkel
This patch is a fairly mechanical conversion. The old `nullptr` gets converted
to ScrollOrigin::NotSpecified, and all the other possible values get corresponding
values in the new ScrollOrigin enum. A few switch statements are introduced to
clean up big if statements, but other than that, additional cleanups will happen
in later patches.

Differential Revision: https://phabricator.services.mozilla.com/D78438
2020-06-05 09:37:51 +00:00
Tom Ritter fdd6915c4d Bug 1634602 - Exempt about:black from color scheme preference in RFP mode r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D77833
2020-06-02 20:42:31 +00:00
Kartikaya Gupta 8ad102a1a2 Bug 1254030 - Fix positioning of drag images with APZ zoom applied. r=botond
This adjusts the position at which the drag images appear when doing drag
actions, so that they appear where you would expect when APZ zoom is applied.
There doesn't seem to be a good way to test this, but I did a bunch of manual
testing, with all the possible expansions of this sentence:
   Dragging {a small image,a large image,some text} in {an iframe,the root
   content document}, with {,no }zooming applied.
In all cases, the drag image/text should appear such that the part under the
cursor is the same as what was under the cursor on the original rendering of
the page.

Differential Revision: https://phabricator.services.mozilla.com/D77436
2020-06-01 21:42:19 +00:00
Kartikaya Gupta d807edde6f Bug 1254030 - Scale drag image by APZ zoom. r=botond
When rasterizing the drag image, we pick up the resolution from ancestor
presShells and ensure that the drag image is rasterized at that resolution,
with appropriate limits for memory usage.

Differential Revision: https://phabricator.services.mozilla.com/D77435
2020-06-01 21:40:39 +00:00
Kartikaya Gupta b0ee5dd871 Bug 1641246 - Remove nsDisplayResolution. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D77111
2020-05-27 22:17:09 +00:00
sefeng 727ca5589e Bug 1322947 - Add support of cancel dialog modal with escape key r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D74937
2020-05-27 14:37:19 +00:00
Botond Ballo 6c825b036b Bug 1637135 - Hit-test input events in layout coordinates on mobile. r=tnikkel
Depends on D76996

Differential Revision: https://phabricator.services.mozilla.com/D76997
2020-05-27 06:55:39 +00:00
Cameron McCormack 1e8189c0f1 Bug 1640537 - Improve style sheet dumping in the layout debugger. r=TYLin
Make it show the contents of style sheets (as it used to before Stylo)
and make it work in --disable-debug --enable-layout-debugger builds.

Differential Revision: https://phabricator.services.mozilla.com/D76640
2020-05-26 23:07:36 +00:00
Emilio Cobos Álvarez 89958b377a Bug 1640605 - Remove IsInAnonymousSubtree / IsRootOfAnonymousSubtree. r=edgar
In favor of the NativeAnonymous versions which they forward to.

Done automatically with:

  rg -l 'IsInAnonymousSubtree' | xargs sed -i 's/IsInAnonymousSubtree/IsInNativeAnonymousSubtree/g'

And removing the function definitions afterwards.

Differential Revision: https://phabricator.services.mozilla.com/D76681
2020-05-25 11:43:51 +00:00
Emilio Cobos Álvarez bb457d5b09 Bug 1640264 - Simplify the "notify of theme changes in all windows" code in Android. r=geckoview-reviewers,agi
I want to do something similar in the child process, and turns out
we already kinda have something like this.

Differential Revision: https://phabricator.services.mozilla.com/D76535
2020-05-22 23:03:43 +00:00
Ting-Yu Lin 162c8d3a67 Bug 1638928 Part 2 - Rename nsIFrame's GetChildLists() to ChildLists(). r=mats
This patch is generated by using my editor's rename functionality.

In the next patch, `nsIFrame::` prefix is going to be removed manually
from all the ChildLists() calls.

Differential Revision: https://phabricator.services.mozilla.com/D75893
2020-05-19 12:37:37 +00:00
Timothy Nikkel 61fceb7c07 Bug 1632789. Teach PresShell::ProcessSynthMouseMoveEvent to understand desktop zooming. r=botond
Basically, we use nsLayoutUtils::TransformPoint (which understands desktop zooming) instead of nsView::ConvertFromParentCoords (which doesn't).

Differential Revision: https://phabricator.services.mozilla.com/D72340
2020-04-30 01:35:40 +00:00
Ting-Yu Lin f99a520eb6 Bug 1635319 Part 2 - Use range-based for loops and array iterators instead of ChildListIterator in layout/generic/. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D75653
2020-05-18 01:17:15 +00:00
Botond Ballo 887327825b Bug 1556556 - Convert mRefPoint to visual coordinates for synthesized events. r=tnikkel
As part of this change, PresShell::mMouseLocation in stored visual coordinates.

Differential Revision: https://phabricator.services.mozilla.com/D69640
2020-05-05 19:28:41 +00:00
Botond Ballo 967bb355ae Bug 1556556 - Include the layout-to-visual transform for a zoomed content root in GetTransformMatrix(). r=kats,mattwoodrow
This is the "core" change of the patch series, which causes most
existing layout codepaths to correctly factor in the visual to
layout transform (or its inverse), as long as the callers correctly
propagate it in the correct ViewportType.

Differential Revision: https://phabricator.services.mozilla.com/D68920
2020-05-05 19:27:47 +00:00
Botond Ballo 173d001b86 Bug 1556556 - Propagate RelativeTo far and wide. r=kats,mattwoodrow
This "upgrades" various nsLayoutUtils functions which take as inputs
a set of coordinates and a frame that the coordinates are relative to,
to accept a RelativeTo object instead of a frame.

Most of the patch is just dumb propagation, but the few places where
we use an explicit ViewportType::Visual are important. There are
probably a few other places I've overlooked, but this seems to cover
the important ones that come up commonly.

There are undoubtedly other functions into which we can propagate
RelativeTo, in this patch I've propagated it as far as necessary
for my needs in this bug (mainly GetTransformToAncestor() and
GetEventCoordinatesRelativeTo()).

Differential Revision: https://phabricator.services.mozilla.com/D68919
2020-05-05 19:26:38 +00:00
Botond Ballo f7fde53875 Bug 1556556 - Remove some cruft related to handling the resolution in non-e10s setups. r=tnikkel
Prior to this bug, it was necessary to handle non-e10s specially, because the
resolution was being unapplied at the process boundary, and in non-e10s there
was no process boundary.

The remaining patches in this bug move the resolution unapplication away from
the process boundary in all cases, making special handling for non-e10s
unnecessary.

Differential Revision: https://phabricator.services.mozilla.com/D68273
2020-05-05 19:20:00 +00:00
Masayuki Nakano 11af44e544 Bug 1632726 - part 2: Remove some unused `nsISelectionController` methods r=smaug
Even in comm-central and BlueGriffon, `nsISelectionController::*ForDelete()`
are not used.  Therefore, we can remove them safely.

Differential Revision: https://phabricator.services.mozilla.com/D72296
2020-04-27 06:20:31 +00:00
Csoregi Natalia b073baab86 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)
2020-04-28 12:43:11 +03:00
Botond Ballo 29e3ec7e90 Bug 1556556 - Convert mRefPoint to visual coordinates for synthesized events. r=tnikkel
As part of this change, PresShell::mMouseLocation in stored visual coordinates.

Differential Revision: https://phabricator.services.mozilla.com/D69640
2020-04-28 01:42:49 +00:00
Botond Ballo a44bc6dd0b Bug 1556556 - Include the layout-to-visual transform for a zoomed content root in GetTransformMatrix(). r=kats,mattwoodrow
This is the "core" change of the patch series, which causes most
existing layout codepaths to correctly factor in the visual to
layout transform (or its inverse), as long as the callers correctly
propagate it in the correct ViewportType.

Differential Revision: https://phabricator.services.mozilla.com/D68920
2020-04-28 01:42:14 +00:00
Botond Ballo 405c8807cd Bug 1556556 - Propagate RelativeTo far and wide. r=kats,mattwoodrow
This "upgrades" various nsLayoutUtils functions which take as inputs
a set of coordinates and a frame that the coordinates are relative to,
to accept a RelativeTo object instead of a frame.

Most of the patch is just dumb propagation, but the few places where
we use an explicit ViewportType::Visual are important. There are
probably a few other places I've overlooked, but this seems to cover
the important ones that come up commonly.

There are undoubtedly other functions into which we can propagate
RelativeTo, in this patch I've propagated it as far as necessary
for my needs in this bug (mainly GetTransformToAncestor() and
GetEventCoordinatesRelativeTo()).

Differential Revision: https://phabricator.services.mozilla.com/D68919
2020-04-28 01:40:35 +00:00
Botond Ballo 5e9a66a3de Bug 1556556 - Remove some cruft related to handling the resolution in non-e10s setups. r=tnikkel
Prior to this bug, it was necessary to handle non-e10s specially, because the
resolution was being unapplied at the process boundary, and in non-e10s there
was no process boundary.

The remaining patches in this bug move the resolution unapplication away from
the process boundary in all cases, making special handling for non-e10s
unnecessary.

Differential Revision: https://phabricator.services.mozilla.com/D68273
2020-04-28 02:03:18 +00:00
Nika Layzell cc54537c86 Bug 1580565 - Part 4: Use WindowContext to manage BrowsingContext cached status, r=farre
The existing infrastructure which stored cached BrowsingContexts on the
BrowsingContextGroup was added before WindowContexts were added, and can cause
racing issues with partially discarded trees during process switches.

Differential Revision: https://phabricator.services.mozilla.com/D71238
2020-04-24 18:33:04 +00:00
Simon Giesecke 191a830575 Bug 1628715 - Part 7: Add MOZ_NONNULL_RETURN to infallible nsTArray::AppendElements. r=xpcom-reviewers,necko-reviewers,nika,valentin
Differential Revision: https://phabricator.services.mozilla.com/D70831
2020-04-24 13:31:14 +00:00
Narcis Beleuzu fffdcb0203 Backed out 7 changesets (bug 1580565) for bustages on nsDocShell.cpp . CLOSED TREE
Backed out changeset 8237f9a307f8 (bug 1580565)
Backed out changeset 47f5698d6c72 (bug 1580565)
Backed out changeset e1802670dcc4 (bug 1580565)
Backed out changeset 0a44c410b59b (bug 1580565)
Backed out changeset 20dbcfc9eacc (bug 1580565)
Backed out changeset cdf2b600e779 (bug 1580565)
Backed out changeset a421d33d03ce (bug 1580565)
2020-04-24 05:31:55 +03:00
Nika Layzell 8f2ceafb38 Bug 1580565 - Part 4: Use WindowContext to manage BrowsingContext cached status, r=farre
The existing infrastructure which stored cached BrowsingContexts on the
BrowsingContextGroup was added before WindowContexts were added, and can cause
racing issues with partially discarded trees during process switches.

Differential Revision: https://phabricator.services.mozilla.com/D71238
2020-04-23 21:52:47 +00:00
Andreea Pavel b74d860d87 Backed out 7 changesets (bug 1580565) for bc failures on a CLOSED TREE
Backed out changeset e44e0a6366f8 (bug 1580565)
Backed out changeset c0849928f934 (bug 1580565)
Backed out changeset 3d4f155096be (bug 1580565)
Backed out changeset 108d5fb4418e (bug 1580565)
Backed out changeset d8dea951a032 (bug 1580565)
Backed out changeset f9ab41f29552 (bug 1580565)
Backed out changeset fd5d76304c09 (bug 1580565)
2020-04-22 21:51:17 +03:00
Nika Layzell 7a75edbe29 Bug 1580565 - Part 4: Use WindowContext to manage BrowsingContext cached status, r=farre
The existing infrastructure which stored cached BrowsingContexts on the
BrowsingContextGroup was added before WindowContexts were added, and can cause
racing issues with partially discarded trees during process switches.

Differential Revision: https://phabricator.services.mozilla.com/D71238
2020-04-22 15:48:17 +00:00
Dorel Luca 7daa9a6695 Backed out 7 changesets (bug 1580565) for Gecko-view failures in Test.crashParent. CLOSED TREE
Backed out changeset 7da9785ebb06 (bug 1580565)
Backed out changeset a80e177a91b2 (bug 1580565)
Backed out changeset 2cf821f2a6ea (bug 1580565)
Backed out changeset a30f158eba45 (bug 1580565)
Backed out changeset 276b131190a8 (bug 1580565)
Backed out changeset 3c15e4c600c4 (bug 1580565)
Backed out changeset bf8877cdb10f (bug 1580565)
2020-04-22 18:42:24 +03:00
Nika Layzell 60ee58560f Bug 1580565 - Part 4: Use WindowContext to manage BrowsingContext cached status, r=farre
The existing infrastructure which stored cached BrowsingContexts on the
BrowsingContextGroup was added before WindowContexts were added, and can cause
racing issues with partially discarded trees during process switches.

Differential Revision: https://phabricator.services.mozilla.com/D71238
2020-04-22 06:05:41 +00:00
Bogdan Tara 4bd759fa8e Backed out 7 changesets (bug 1580565) for browser_entry_point_telemetry.js failures CLOSED TREE
Backed out changeset 12a4f3de76a8 (bug 1580565)
Backed out changeset 81d537df2dc1 (bug 1580565)
Backed out changeset b182e872c9d4 (bug 1580565)
Backed out changeset 0b4595b2c153 (bug 1580565)
Backed out changeset 4363e3a3d799 (bug 1580565)
Backed out changeset cbb14b2c7b33 (bug 1580565)
Backed out changeset 46b251848297 (bug 1580565)
2020-04-22 06:15:43 +03:00
Nika Layzell 88b3fbe306 Bug 1580565 - Part 4: Use WindowContext to manage BrowsingContext cached status, r=farre
The existing infrastructure which stored cached BrowsingContexts on the
BrowsingContextGroup was added before WindowContexts were added, and can cause
racing issues with partially discarded trees during process switches.

Differential Revision: https://phabricator.services.mozilla.com/D71238
2020-04-22 01:37:55 +00:00
Emilio Cobos Álvarez 31821e1fc4 Bug 1449522 - Remove nsIEditorStyleSheets. r=masayuki,m_kato
Users have much better, easier alternatives, like
DOMWindowUtils.{loadSheetUsingURIString,removeSheet}, which we use to
replace the only caller that exists in mozilla-central (the editor
element, which loads EditorOverride.css).

This allows to clean up the style system and editor. There are other
callers in comm-central, but it seems they can switch to DOMWindowUtils
trivially, as the DOMWindowUtils APIs also use the system principal and
thus they can load any URL.

I'll make sure to give them some time with the migration and/or help
out of course.

Differential Revision: https://phabricator.services.mozilla.com/D71263
2020-04-17 22:54:48 +00:00
Emilio Cobos Álvarez 142b7d3c57 Bug 1629096 - Always honor scroll-margin / scroll-padding from nsFocusManager. r=masayuki
We should always do this, otherwise stuff may not end up being visible which is
not acceptable for focus navigation.

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

--HG--
extra : moz-landing-system : lando
2020-04-13 11:34:48 +00:00
Emilio Cobos Álvarez 79f62fbd71 Bug 1626291 - Repaint selection when safe. r=masayuki
Note that we intentionally don't move the SetDisplaySelection stuff to the
runnables. It would probably be safe enough, but it's not required and it makes
reasoning about this code harder.

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

--HG--
extra : moz-landing-system : lando
2020-04-09 09:50:58 +00:00
Kristen Wright 37d15858db Bug 1626388 - Convert layout.framevisibility.enabled to a static pref r=njn
Converts `layout.framevisibility.enabled` to a static pref.

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

--HG--
extra : moz-landing-system : lando
2020-04-06 19:55:07 +00:00
Jonathan Kew 37a6e3c816 Bug 1619349 - patch 2 - Report font-matching statistics via telemetry ping. r=chutten
Differential Revision: https://phabricator.services.mozilla.com/D67788

--HG--
extra : moz-landing-system : lando
2020-04-02 01:38:16 +00:00
Jonathan Kew 9ae6c0bed1 Bug 1619349 - patch 1 - Record statistics about font-matching behavior in the presContext. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D67787

--HG--
extra : moz-landing-system : lando
2020-04-02 01:38:18 +00:00
Ciure Andrei e1cb0f1e21 Backed out 4 changesets (bug 1619349, bug 1619350) for causing test_font_whitelist.html to fail CLOSED TREE
Backed out changeset ba16b09b5da0 (bug 1619349)
Backed out changeset f8ca02252dfc (bug 1619349)
Backed out changeset 01a2a527aa1a (bug 1619350)
Backed out changeset 67ee13868a44 (bug 1619350)
2020-04-02 04:34:31 +03:00
Jonathan Kew 5ab49ca20e Bug 1619349 - patch 2 - Report font-matching statistics via telemetry ping. r=chutten
Differential Revision: https://phabricator.services.mozilla.com/D67788

--HG--
extra : moz-landing-system : lando
2020-03-30 19:56:34 +00:00
Jonathan Kew 82984492e6 Bug 1619349 - patch 1 - Record statistics about font-matching behavior in the presContext. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D67787

--HG--
extra : moz-landing-system : lando
2020-04-01 21:42:36 +00:00
Emilio Cobos Álvarez fcff6b1a69 Bug 1624829 - Use FunctionRef for various Enumerate* callbacks. r=edgar
This avoids a bunch of ugly casts and void pointers, without much overhead
(unlike std::function or such).

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

--HG--
extra : moz-landing-system : lando
2020-03-26 12:44:47 +00:00
Kristen Wright 1991a7758d Bug 1622111 - Convert dom.w3c_pointer_events.implicit_capture to a static pref. r=njn
Converts dom.w3c_pointer_events.implicit_capture to a static pref, removes the initializer in PointerEventHandler.

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

--HG--
extra : moz-landing-system : lando
2020-03-19 00:54:31 +00:00
Botond Ballo c2743ac5d0 Bug 1623476 - Fix an incorrect assertion in PresShell about capturing content. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D67516

--HG--
extra : moz-landing-system : lando
2020-03-23 22:20:44 +00:00
Botond Ballo 8ee14bcbbe Bug 1623476 - Rename enum RelativeTo to DisplayportRelativeTo. r=tnikkel
This is in anticipation of introducing a struct named RelativeTo
in bug 1556556.

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

--HG--
extra : moz-landing-system : lando
2020-03-23 22:20:11 +00:00
Mirko Brodesser 66f056b308 Bug 1623858: part 4) Document `PresShell::mSelectionFlags`. r=smaug
Depends on D67601

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

--HG--
extra : moz-landing-system : lando
2020-03-20 13:24:48 +00:00
Emilio Cobos Álvarez 04828e3a4a Bug 253870 - Make disabled form controls selectable. r=masayuki,MarcoZ
This rejiggers a bit the way selection focus is handled so that focusing a
disabled form control with the mouse handles selection properly, and hides the
document selection and so on.

This matches the behavior of other browsers as far as I can tell.

Given now readonly and disabled editors behave the same, we can simplify a bit
the surrounding editor code.

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

--HG--
extra : moz-landing-system : lando
2020-03-19 13:18:16 +00:00
Stefan Hindli 5f419e4b50 Backed out 9 changesets (bug 1622111) for causing mochitest failures in dom/animation/test/mozilla/test_restyles.html CLOSED TREE
Backed out changeset c244160797f8 (bug 1622111)
Backed out changeset dd9209f6bd8b (bug 1622111)
Backed out changeset d694c9e7061f (bug 1622111)
Backed out changeset 486aae809f6d (bug 1622111)
Backed out changeset 709266168c41 (bug 1622111)
Backed out changeset ca0d47bb86a8 (bug 1622111)
Backed out changeset caa735c8bb91 (bug 1622111)
Backed out changeset 12397711ab25 (bug 1622111)
Backed out changeset b66002fd1480 (bug 1622111)
2020-03-19 02:47:51 +02:00
Kristen Wright e771b4ad21 Bug 1622111 - Convert dom.w3c_pointer_events.implicit_capture to a static pref. r=njn
Converts dom.w3c_pointer_events.implicit_capture to a static pref, removes the initializer in PointerEventHandler.

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

--HG--
extra : moz-landing-system : lando
2020-03-18 22:27:24 +00:00
Simon Giesecke 8aa47bcfb7 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in layout. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D66016

--HG--
extra : moz-landing-system : lando
2020-03-17 09:38:32 +00:00
Mihai Alexandru Michis 58bc354025 Backed out changeset 9eeee9ec66d9 (bug 253870) for causing failures in browser_bug1261299.js
CLOSED TREE
2020-03-16 22:32:41 +02:00
Emilio Cobos Álvarez 9f28f89085 Bug 253870 - Make disabled form controls selectable. r=masayuki,MarcoZ
This rejiggers a bit the way selection focus is handled so that focusing a
disabled form control with the mouse handles selection properly, and hides the
document selection and so on.

This matches the behavior of other browsers as far as I can tell.

Given now readonly and disabled editors behave the same, we can simplify a bit
the surrounding editor code.

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

--HG--
extra : moz-landing-system : lando
2020-03-16 17:41:07 +00:00
Mirko Brodesser b58f603d3f Bug 1620952: part 2) Remove `nsFrameSelection::Init`. r=jfkthame
Will allow to declare some members const.

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

--HG--
extra : moz-landing-system : lando
2020-03-10 12:41:05 +00:00
Andrew Osmond 91b071ed14 Bug 1618345 - Enforce proper color management by splitting gfx::Color into sRGBColor and DeviceColor types. r=jrmuizel
gfx::Color is currently misused in many places. The DrawTargets expect
the color space to be in device space, e.g. what we are actually going
to draw using. Everything sitting above generally deals with sRGB, as
specified in CSS. Sometimes we missed the conversion from sRGB to device
space when issuing draw calls, and similarly sometimes we converted the
color to device space twice.

This patch splits the type in two. sRGBColor and DeviceColor now
represent sRGB and device color spaces respectively. DrawTarget only
accepts DeviceColor, and one can get a DeviceColor from an sRGBColor via
the ToDeviceColor helper API. The reftests now pass with color
management enabled for everything (e.g. CSS) instead of just tagged
raster images.

There will be a follow up patch to enable color management everywhere by
default on all supported platforms.

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

--HG--
extra : moz-landing-system : lando
2020-03-09 14:16:17 +00:00
Masayuki Nakano c90d6c80b3 Bug 1569512 - Make `PresShell` ignore synthesized `mousemove` events coming from another process if the child process stores mouse location of synthesized mouse events for tests r=smaug
The reason of intermittent failure of `test_bug656379-2.html` is, synthesized
`mousemove` event coming from the parent process causes `mouseout` and
`mouseleave` events of the last synthesized `mousemove` in the test.  The
reason is, synthesized `mousemove` for tests makes `PresShell` in the content
process record the cursor location, but won't make it `PresShell` in the
parent process do it.  Therefore, parent process may synthesize `mousemove`
event for the system cursor position which does not match with the synthesized
mouse location in the content process.  Therefore, `:hover` state may be
updated unexpectedly.

This patch makes `WidgetEvent::mFlags` have a flag to indicate whether it
came from another process.  Then, makes `PresShell::HandleEvent()` ignore
synthesized `mousemove` events coming from another process only when the
recorded mouse location was set by a mouse event synthesized for tests.

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

--HG--
extra : moz-landing-system : lando
2020-03-05 21:34:28 +00:00
Tom Schuster 0b1dab0c5a Bug 1408122 - Apply prefers-color-scheme: dark to top-level about:blank. r=emilio,bzbarsky
I think during the All Hands in Berlin you might have suggested to do this in nsPresContext::DefaultBackgroundColor,
but this seems a bit more targeted and not a header.

I haven't try tested this yet, so this more of a feedback?

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

--HG--
extra : moz-landing-system : lando
2020-02-28 13:43:02 +00:00
Andrew McCreight 4babb2b5ab Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

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

--HG--
extra : moz-landing-system : lando
2020-02-27 17:39:15 +00:00
Ciure Andrei 00dd87f6f4 Backed out changeset d407a28318e6 (bug 1609815) for causing windows ming bustages CLOSED TREE
--HG--
extra : histedit_source : b2c748e31e0f6ba8fcf9960a336e0bbd361b07e6
2020-02-27 07:05:19 +02:00
Andrew McCreight b197e1f783 Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

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

--HG--
extra : moz-landing-system : lando
2020-02-27 04:43:48 +00:00
Emilio Cobos Álvarez 0fd680394f Bug 1617746 - Minor cleanup of ServoStyleSet. r=nordzilla
Removing unused arguments and so on.

The origin can always be inferred from the stylesheet so it wasn't being used.

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

--HG--
extra : moz-landing-system : lando
2020-02-27 01:46:10 +00:00
Cosmin Sabou 3497aa8314 Backed out 2 changesets (bug 1617746) assertion failures on ShadowRoot.cpp.
CLOSED TREE
Backed out changeset 6cb30e866b95 (bug 1617746)
Backed out changeset 3543162b815b (bug 1617746)
2020-02-27 01:12:46 +02:00
Emilio Cobos Álvarez 28effe5605 Bug 1617746 - Minor cleanup of ServoStyleSet. r=nordzilla
Removing unused arguments and so on.

The origin can always be inferred from the stylesheet so it wasn't being used.

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

--HG--
extra : moz-landing-system : lando
2020-02-26 21:20:38 +00:00
Timothy Nikkel 34bf1314fd Bug 1613482. Clear nsRefreshDriver::mHasScheduleFlush whenever mViewManagerFlushIsPending is cleared. r=mattwoodrow
mHasScheduleFlush is meant to track mViewManagerFlushIsPending except mViewManagerFlushIsPending gets set to false just before we call ProcessPendingUpdates, whereas mHasScheduleFlush is set to false just after we call ProcessPendingUpdates.

There are a couple places where mViewManagerFlushIsPending gets set to false that don't clear mHasScheduleFlush though. This leaves mHasScheduleFlush true until we get another paint that changed something. This causes this code

https://searchfox.org/mozilla-central/rev/3a0a8e2762821c6afc1d235b3eb3dde63ad3b01a/layout/painting/nsDisplayList.cpp#3058

in nsDisplayList::PaintRoot to always notify of invalidation (with webrender). This in turn causes a loop in the reftest harness: notify invalidation -> mozafterpaint -> update canvas -> paint -> notify invalidation.

This code changed a bunch until settling on the current design in bug 1404091.

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

--HG--
extra : moz-landing-system : lando
2020-02-11 19:01:29 +00:00
Simon Giesecke b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
Markus Stange ac0687ac8b Back out bug 1592739 due to multiple regressions (bug 1599366, bug 1601183, bug 1602193). a=backout
Differential Revision: https://phabricator.services.mozilla.com/D62753

--HG--
extra : moz-landing-system : lando
2020-02-13 14:26:51 +00:00
shindli 91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke f604a47fa5 Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-12 17:24:41 +00:00
Mirko Brodesser ea1f257885 Bug 1614636: simplify arguments of `nsFrameSelection::HandleClick`. r=jfkthame
Simplifies understanding its dependent methods.

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

--HG--
extra : moz-landing-system : lando
2020-02-11 15:12:26 +00:00
Emilio Cobos Álvarez 69c87f6cb2 Bug 1613349 - Rename nsINode::DeleteProperty to RemoveProperty. r=smaug
And the related methods as well.

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

--HG--
extra : moz-landing-system : lando
2020-02-06 16:06:49 +00:00
Emilio Cobos Álvarez c5c0ef9787 Bug 1613349 - Rename nsIFrame::DeleteProperty to RemoveProperty. r=dholbert
As it doesn't necessarily call delete and that may be confusing.

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

--HG--
extra : moz-landing-system : lando
2020-02-06 16:06:49 +00:00
Masayuki Nakano 450b71f763 Bug 1612085 - part 1: Hide constructor of `nsRange` r=smaug
`nsRange` instances are allocated a lot in the heap especially by editor and
spellchecker.  The allocation cost is too bad for benchmarks.  Therefore,
we should reuse released instances as far as possible.  For managing it in
static factory methods of `nsRange`, we need to hide `nsRange` constructor.

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

--HG--
extra : moz-landing-system : lando
2020-01-30 13:23:35 +00:00
Kousuke Takaki 04bba6950f Bug 1602088 - Move nsIScrollableFrame::ScrollUnit to namespace scope. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D61140

--HG--
extra : source : 69fded25adc2ac25e302b49c1128f8926e1311a3
2020-01-30 09:13:19 +00:00
Cosmin Sabou 5a3d320cd0 Backed out changeset 69fded25adc2 (bug 1602088) for causing several box-shadow reftest failures.
CLOSED TREE
2020-01-30 13:23:10 +02:00
Kousuke Takaki 9681569b70 Bug 1602088 - Move nsIScrollableFrame::ScrollUnit to namespace scope. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D61140

--HG--
extra : moz-landing-system : lando
2020-01-30 09:13:19 +00:00
Hiroyuki Ikezoe 63a96a5c4a Bug 1611038 - Introduce PresShell::AddResizeEventFlushObserverIfNeeded. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60811

--HG--
extra : moz-landing-system : lando
2020-01-23 11:30:02 +00:00
Nazım Can Altınova d8afe0647a Bug 1609708 - Rename PROFILER_TRACING to PROFILER_TRACING_MARKER. r=gerald
Depends on D60229

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

--HG--
extra : moz-landing-system : lando
2020-01-17 21:29:15 +00:00
Ting-Yu Lin 16737fbf2f Bug 1306634 Part 1 - Handle a long press to select a word in an unfocused iframe. r=mats,marionette-reviewers,whimboo
Long-pressing on a text in an unfocused iframe to select a word never
works. Currently, you need to single tap to focus the iframe first.

Each PresShell has an associated AccessibleCaretEventHub. This patch
fixes this bug by routing the event to the AccessibleCaretEventHub under
the event point, and handle it there. If the event is not handled, then
we handle it by the focused AccessibleCaretEventHub as before.

I've experimented with only routing the event to the
AccessibleCaretEventHub under the event point, without routing to the
fallback focused AccessibleCaretEventHub. However, caret dragging didn't
work in iframes. I didn't debug further.

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

--HG--
extra : moz-landing-system : lando
2020-01-17 22:21:35 +00:00
Brad Werth 465b225500 Bug 1569626 Part 1: Save and restore the presshell resolution when creating and destroying an MVM. r=botond
We need the resolution to be restored when and if the presshell creates
a MobileViewportManager. That decision happens in
PresShell::UpdateViewportOverridden. In order for the resolution to be
saved somewhere it has to exist outside the presshell itself, since
the presshell will be destroyed and recreated during some of the
operations that also destroy the MVM -- such as closing the devtools'
Responsive Design Mode. So Document holds this resolution and gets
accessor methods to allow the presshell to get and set that resolution
as needed.

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

--HG--
extra : moz-landing-system : lando
2020-01-17 21:57:56 +00:00
Masayuki Nakano 487e463bb5 Bug 1543315 - part 21: Mark `PresShell::DidCauseReflow()` as `MOZ_CAN_RUN_SCRIPT` r=smaug
It removes a script blocker.  Therefore, although it depends on the caller
whether it causes running script or not.  However, we should mark it as
`MOZ_CAN_RUN_SCRIPT` for safer code.

It's called only by the destructor of `nsAutoCauseReflowNotifier`.  Therefore,
this patch also marks its constructor as `MOZ_CAN_RUN_SCRIPT` for making
each creator method marked as `MOZ_CAN_RUN_SCRIPT` or
`MOZ_CAN_RUN_SCRIPT_BOUNDARY`.

Most of the creators is mutation listener methods.  However, `PresShell`
does nothing after destroying `nsAutoCauseReflowNotifier`.  Therefore,
this patch does not change the callers in MutationObserver.cpp to use
`RefPtr<PresShell>` at calling them because changing it may cause performance
regression.

Perhaps, we should create another methods of `WillCauseReflow()` and
`DidCauseReflow()` to avoid unnecessary `MOZ_CAN_RUN_SCRIPT` marking.
However, I'm not sure whether most callers may run script or not because
of outside of my knowledge.

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

--HG--
extra : moz-landing-system : lando
2020-01-17 10:00:28 +00:00
Noemi Erli 13b7594c46 Backed out 2 changesets (bug 1306634) for causing assertion failures in nsAutoLayoutPhase.cpp CLOSED TREE
Backed out changeset fb20602d0c39 (bug 1306634)
Backed out changeset 35651fd9e240 (bug 1306634)
2020-01-17 01:01:09 +02:00
Ting-Yu Lin 2e68f8780b Bug 1306634 Part 1 - Handle a long press to select a word in an unfocused iframe. r=mats,marionette-reviewers,whimboo
Long-pressing on a text in an unfocused iframe to select a word never
works. Currently, you need to single tap to focus the iframe first.

Each PresShell has an associated AccessibleCaretEventHub. This patch
fixes this bug by routing the event to the AccessibleCaretEventHub under
the event point, and handle it there. If the event is not handled, then
we handle it by the focused AccessibleCaretEventHub as before.

I've experimented with only routing the event to the
AccessibleCaretEventHub under the event point, without routing to the
fallback focused AccessibleCaretEventHub. However, caret dragging didn't
work in iframes. I didn't debug further.

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

--HG--
extra : moz-landing-system : lando
2020-01-16 05:08:36 +00:00
Emilio Cobos Álvarez 077183556a Bug 1561900 - Fix scroll state restoration when not coming from the bfcache on the initial frame construction. r=bzbarsky
There is no way this ever properly worked, as we always passed null for
`aFrameState`.

So it'd only work if we reframed the document element or such...  Which is not
amazing.

For simpler test-cases, when we don't construct the scrollframe via
PresShell::Initialize, but via the regular frame constructor updates
(ContentAppended, etc...), those end up working because we go through lazy frame
construction, which ends up in RecreateFramesForContent, which passes
mTempFrameTreeState.

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

--HG--
extra : moz-landing-system : lando
2020-01-15 13:18:52 +00:00
Eric Rahm 78ee6675cf Bug 1606187 - Part 2b: Update users of nsClassHashtable to handle UniquePtr differences r=KrisWright,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D59042

--HG--
extra : moz-landing-system : lando
2020-01-13 19:18:56 +00:00
Mirko Brodesser efd738af5b Bug 1608071: part 2) Rename `nsContentUtils::GetCommonAncestor` and related methods. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D59319

--HG--
extra : moz-landing-system : lando
2020-01-13 10:29:44 +00:00
Jamie Nicol 188f4eae4e Bug 1581868 - Make webrender schedule a frame immediately on resume. r=sotaro
On webrender on android, parent-process pages (eg about:support) were not being
rendered immediately after minimising then resuming the app, resulting in a
black screen. The problem was that webrender believed the previous frame was
still valid, and therefore that it did not need to render a new
one. Content-process pages were unnaffected because we clear cached resources
when the app is minimised, so we accidentally rendered a new frame on
resumption.

To fix this we always force a new frame to be rendered immediately on
resumption. This uncovers a race condition which causes us to sometimes render
frames at the wrong size when the window size has changed (for example when
showing or hiding the keyboard), so that is also fixed.

This also fixes a bug affecting fenix, where when opening a page in a new tab
the portion of the screen where the keyboard used to be would remain black until
the page had loaded. This no longer occurs because we force a composite as soon
as the keyboard is hidden.

Additionally, this patch reverts the original attempt at fixing this
bug, as it is not necessary.

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

--HG--
extra : moz-landing-system : lando
2020-01-10 02:01:30 +00:00
Sebastian Streich 0df7a35f3c Bug 1602487 - Remove GetURI calls in PresShell.cpp r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D58790

--HG--
extra : moz-landing-system : lando
2020-01-09 12:09:18 +00:00
Ting-Yu Lin c6549fba3f Bug 1606492 - Add nsAutoScriptBlocker to PresShell::DidDoReflow(). r=emilio
Add a script block to prevent reflow observers from running the scripts,
which may flush layout, until the end of DidDoReflow().

Specifically, Document::MaybeInitializeFinalizeFrameLoaders() can flush
layout somewhere down in the stack as bug 1606492 comment 0 shows.
Adding a script block can force it to schedule its runnable to run at
the end of DidDoReflow().

Also, HandlePostedReflowCallbacks() can flush layout. It's better to check
`mIsDestroying` before proceeding.

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

--HG--
extra : moz-landing-system : lando
2020-01-07 22:58:37 +00:00
Ting-Yu Lin 91b81ef6ad Bug 1607123 - Terminate AccessibleCaretEventHub after tearing down the frame tree. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D58738

--HG--
extra : moz-landing-system : lando
2020-01-06 20:18:06 +00:00
Emilio Cobos Álvarez ce358595b7 Bug 1605956 - Don't invalidate scroll anchor on visual viewport offset updates if visual viewport size is not set. r=botond
As we only use the offset if the visual viewport size is set.

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

--HG--
extra : moz-landing-system : lando
2019-12-30 17:03:46 +00:00
Emilio Cobos Álvarez 29800f6c89 Bug 1595435 - Allow content to steal focus from a cross-origin iframe. r=masayuki
This matches other browsers.

Keep the restriction just to chrome nodes, and in that case, avoid getting into
the broken state, which is what causes the issue. I'm not sure if this even
matters anymore given e10s but...

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

--HG--
extra : moz-landing-system : lando
2019-12-25 06:50:25 +00:00
Chris Peterson 406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

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

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
Ting-Yu Lin 391acfb3c7 Bug 1604701 - Make EventTargetData::mPresShell always compute from the frame. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D57601

--HG--
extra : moz-landing-system : lando
2019-12-19 17:08:41 +00:00
Hiroyuki Ikezoe 04b4206ae2 Bug 1596317 - Use CallState for SubDocEnumFunc. r=smaug
`true` -> `CallState::Continue`
`false` -> `CallState::Stop`

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

--HG--
extra : moz-landing-system : lando
2019-12-19 07:58:45 +00:00
Bogdan Tara a96ffb25c5 Backed out 7 changesets (bug 1596317) for causing build bustages CLOSED TREE
Backed out changeset 0d3208fcb948 (bug 1596317)
Backed out changeset fe5554dc4115 (bug 1596317)
Backed out changeset 019de59cbc93 (bug 1596317)
Backed out changeset f4851472b087 (bug 1596317)
Backed out changeset a984cf515db8 (bug 1596317)
Backed out changeset d0da5bf9b4d4 (bug 1596317)
Backed out changeset abe5f2030dd9 (bug 1596317)
2019-12-19 06:49:39 +02:00
Hiroyuki Ikezoe 9e4bf031ae Bug 1596317 - Use CallState for SubDocEnumFunc. r=smaug
`true` -> `CallState::Continue`
`false` -> `CallState::Stop`

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

--HG--
extra : moz-landing-system : lando
2019-12-19 04:16:10 +00:00
Emilio Cobos Álvarez 3405fe8b57 No bug - Remove a useless include in PresShell.h. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D57690

--HG--
extra : moz-landing-system : lando
2019-12-18 22:57:48 +00:00
Masayuki Nakano 271d1b6d1d Bug 1543315 - part 20: Mark `PresShell::ContentStateChanged()` as `MOZ_CAN_RUN_SCRIPT_BOUNDARY` r=smaug
While it calls `RestyleManager::ContentStateChanged()`, it blocks script
with `nsAutoCauseReflowNotifier`.  Therefore, it should be marked as
`MOZ_CAN_RUN_SCRIPT_BOUNDARY` at least (looks like the other override,
`DocAccessible::ContentStateChanged()` does not run script).

There is a concern about the lifetime of `RestyleManager`.  It's destroyed
when `nsPresContext::DetachPresShell()` is called.  It's called by
`PresShell::Destroy()` and destructor of `nsPresContext`.  The latter is
safe since `PresShell` owns `mPresContext` and it's never cleared.  However,
I'm not sure about the former.  It might be better to create blocker of
synchronous handling of `PresShell::Destroy()`.

And also this does not make `Document::ContentStateChanged()` use
`RefPtr<PresShell>` at calling it because it might cause performance
regression, but it does not do anything after destroying
`nsAutoCauseReflowNotifier`.

Finally, for guaranteeing that the lifetime of `PresShell::mPresContext` is
longer than `PresShell`, this makes it to `RefPtr<nsPresContext> const`.
However, initializing it in constructor breaks other objects' initialization
process since they assume that `PresShell::GetPresContext()` won't return
valid pointer until the `nsPresContext` is attached.  For solving this issue
safe, this patch keeps setting `mPresContext` in `Init()` with `const_cast`
hack.

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

--HG--
extra : moz-landing-system : lando
2019-12-11 12:18:33 +00:00
Emilio Cobos Álvarez 3ccc6c30ab Bug 1603313 - Subdocument enum callbacks should take a reference. r=bzbarsky
As they can never take null.

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

--HG--
extra : moz-landing-system : lando
2019-12-14 05:08:39 +00:00
Masayuki Nakano d586d5dc73 Bug 1543315 - part 19: Mark `PresShell::ReconstructFrames()` as `MOZ_CAN_RUN_SCRIPT` r=smaug
It calls `Document::FlushPendingNotification()` so that we should mark it
as `MOZ_CAN_RUN_SCRIPT`.

And the method calls it of `mDocument` and `mDocument` is never modified
after it's initialized.  Therefore, we can move the initializer to the
constructor and make `RefPtr<Document>` to `RefPtr<Document> const`.  Thus,
we can avoid unnecessary auto `RefPtr`.

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

--HG--
extra : moz-landing-system : lando
2019-12-11 12:18:00 +00:00
Gabriele Svelto 69790bc62e Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:16:44 +00:00
Emilio Cobos Álvarez dfba5de9ef Bug 1601624 - Don't suppress shrink-to-fit resize reflows on unchanged size. r=tnikkel
As the width and height arguments to ResizeReflow are treated as constraints,
not the final size, in that case.

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

--HG--
extra : moz-landing-system : lando
2019-12-06 01:03:45 +00:00
Kris Taeleman 6423d3a0b9 Bug 1581868 - Black page sometimes when restoring geckoview_example/fenix with webrender enabled. r=jnicol
Differential Revision: https://phabricator.services.mozilla.com/D55338

--HG--
extra : moz-landing-system : lando
2019-12-02 08:01:37 +00:00
Emilio Cobos Álvarez 0eb000c3ae Bug 1599161 - Rename nsLayoutStylesheetCache to GlobalStyleSheetCache. r=boris
It's a better name, and will avoid confusion when I add other stylesheet caches
outside of the CSS loader.

Depends on D54556

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

--HG--
rename : layout/style/nsLayoutStylesheetCache.cpp => layout/style/GlobalStyleSheetCache.cpp
rename : layout/style/nsLayoutStylesheetCache.h => layout/style/GlobalStyleSheetCache.h
extra : moz-landing-system : lando
2019-11-25 22:08:43 +00:00
Hiroyuki Ikezoe 7afdb8487c Bug 1586986 - Fire visual viewport resize events and flush position:fixed elements' layout in the same way what Chrome does. r=botond
On Chrome, visual viewport resize event is fired repeatedly during dynamic
toolbar transitions and visual viewport height obtained by the VisualViewport
API is also changed, but in terms of layout the height value is never used
until the dynamic toolbar height reaches to zero or is changed from zero.
The height used at the time is the height for vh units when the toolbar height
reaches to zero and the ICB height when the toolbar height is changed from zero.
To do so, we need to have another visual viewport size in parallel to the
original one and use them depending on situations.

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

--HG--
extra : moz-landing-system : lando
2019-11-21 21:36:59 +00:00
Hiroyuki Ikezoe 9b165804d8 Bug 1586986 - Deliver 'fixed-bottom' offset to the top of the pres context on the foreground tab. r=geckoview-reviewers,tnikkel,snorp
The dynamic toolbar transition doesn't affect on background tabs since to
switch tabs the dynamic toolbar should be restored to its original state (i.e.,
completely visible state).

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

--HG--
extra : moz-landing-system : lando
2019-11-21 21:15:46 +00:00
Daniel Holbert d766f0195b Bug 1597348: When reflow is interrupted, purge flex items' cached measurements during the same traversal that we use to mark ancestor-chain as dirty. r=emilio
This means we no longer have any use for the frame state bit
"NS_STATE_FLEX_MEASUREMENTS_INTERRUPTED". Now, if a flex container
has N children and only the last child is interrupted, we'll only
purge the last child's measurement (and we'll do it promptly at the
end of the whole interrupted reflow).

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

--HG--
extra : moz-landing-system : lando
2019-11-18 19:19:42 +00:00
Emilio Cobos Álvarez f36874d798 Bug 1596445 - Add some supporting code to nsINode to deal with NAC and shadow DOM separately. r=bzbarsky
We'll use these to remove GetBindingParent.

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

--HG--
extra : moz-landing-system : lando
2019-11-15 15:10:45 +00:00
Doug Thayer 97c5d40384 Bug 1586920 - Sometimes include dynamic string of label frames in BHR r=nika
This adds two AUTO_PROFILER_LABEL_DYNAMIC_... macros and updates select
usages of the old macros to use the new ones. These new macros cause
the dynamic string of the label to be included in BHR stacks.

We don't want to do this all of the time, as in many cases we may not
be interested enough in the dynamic string or it may be sensitive
information, but it is rather important information for certain cases.

This uses the same buffer that we use for the strings for JS frames,
and if we fail to fit into that buffer we just append the raw label.

If the string is too long for our static buffer (128 bytes), we just
leave it truncated, as it should be stable and we may be able to infer
from the truncated form what the full form would be.

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

--HG--
extra : moz-landing-system : lando
2019-11-11 20:27:44 +00:00
Brian Grinstead 8e592888cb Bug 1593119 - clang-format the files affected by the MOZ_XBL unifdef r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D52057

--HG--
extra : moz-landing-system : lando
2019-11-07 00:35:25 +00:00
Brian Grinstead f19f38776b Bug 1593119 - unifdef MOZ_XBL r=bzbarsky
This was generated with:

```
rg -l -g '*.{cpp,h}' MOZ_XBL . | while read FILE ; do
   echo $FILE
   unifdef -m -UMOZ_XBL $FILE
done
```

After this, I manually removed the directive in nsContentUtils.cpp due to:

  unifdef: ./dom/base/nsContentUtils.cpp: 4630: Unterminated string literal
  unifdef: Output may be truncated

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

--HG--
extra : moz-landing-system : lando
2019-11-07 00:35:13 +00:00
Markus Stange a3e9f03c73 Bug 1592739 - Ignore the background-color CSS value on the window document's root element if that element has a -moz-appearance. r=tnikkel
For regular elements, whenever -moz-appearance is used, the CSS background is
ignored. Root elements were behaving specially, and the background color also
needed to be adjusted.
For example, for Windows 7, we have the following CSS rule;

```
    :root {
      background-color: transparent;
      -moz-appearance: -moz-win-borderless-glass;
    }
```

This change makes the root element more consistent with other elements, so the
extra `background-color: transparent` declaration is no longer necessary.

This change does not let content documents opt out of forced opaqueness:
Root content documents still get an opaque background color from an existing
check further down in this method.

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

--HG--
extra : moz-landing-system : lando
2019-11-05 18:47:30 +00:00
Brian Hackett c6cedf4eac Bug 1575657 - Always create record/replay checkpoints when painting, r=mstange.
Differential Revision: https://phabricator.services.mozilla.com/D46244

--HG--
extra : moz-landing-system : lando
2019-11-03 12:22:20 +00:00
Dan Glastonbury 196b08c653 Bug 1578319: Telemetry for total time spent in layout per Refresh Driver tick. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D44427

--HG--
extra : moz-landing-system : lando
2019-11-01 04:33:48 +00:00
Masayuki Nakano a434f646f8 Bug 1577058 - part 2: Make `nsFrameSelection::CommonPageMove()` handle `nsFrameSelection::ScrollSelectionIntoView()` too r=smaug
Currently, `nsFrameSelection::CommonPageMove()` is called before every caller
calls `nsFrameSelection::ScrollSelectionIntoView()`.  However, when an editing
host has focus, the scroll target may be outside of it.  In such case, without
moving caret, user may want only to scroll the scrollable element.

Chrome behaves like so.  Chrome also can scroll outside scrollable element
of focused editing host.  However, it scrolls caret into view only when
caret is moved actually.  Therefore, it makes sense to follow this behavior.

This patch makes `nsFrameSelection::CommonPageMove()` also call
`nsFrameSelection::ScrollSelectionIntoView()`.  However, it newly takes
`SelectionIntoView` flag for making callers can choose the condition.  I.e.,
`ScrollSelectionIntoView()` should be called always, or only when selection
is actually changed, or shouldn't be called.

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

--HG--
extra : moz-landing-system : lando
2019-10-28 10:03:37 +00:00
Cosmin Sabou 3c54e28fc8 Backed out 2 changesets (bug 1577058) for causing bug 1541915 to nearly permafail.
Backed out changeset c556c5228132 (bug 1577058)
Backed out changeset d00a7e091efd (bug 1577058)
2019-10-27 17:38:58 +02:00
Masayuki Nakano 7a894386f2 Bug 1577058 - part 2: Make `nsFrameSelection::CommonPageMove()` handle `nsFrameSelection::ScrollSelectionIntoView()` too r=smaug
Currently, `nsFrameSelection::CommonPageMove()` is called before every caller
calls `nsFrameSelection::ScrollSelectionIntoView()`.  However, when an editing
host has focus, the scroll target may be outside of it.  In such case, without
moving caret, user may want only to scroll the scrollable element.

Chrome behaves like so.  Chrome also can scroll outside scrollable element
of focused editing host.  However, it scrolls caret into view only when
caret is moved actually.  Therefore, it makes sense to follow this behavior.

This patch makes `nsFrameSelection::CommonPageMove()` also call
`nsFrameSelection::ScrollSelectionIntoView()`.  However, it newly takes
`SelectionIntoView` flag for making callers can choose the condition.  I.e.,
`ScrollSelectionIntoView()` should be called always, or only when selection
is actually changed, or shouldn't be called.

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

--HG--
extra : moz-landing-system : lando
2019-10-27 01:44:55 +00:00
Timothy Nikkel ede6368cfb Bug 1590551. Allow nsPresContext::GetNearestWidget to work when there is no frame tree. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D50135

--HG--
extra : moz-landing-system : lando
2019-10-23 23:37:11 +00:00
Botond Ballo 432e039626 Bug 1560770 - Use a method of getting the widget in UseMobileViewportManager() than does not require the frame tree to be constructed. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D50121

--HG--
extra : moz-landing-system : lando
2019-10-22 20:40:35 +00:00
Botond Ballo 7b80a2f886 Bug 1560770 - Don't use MobileViewportManager if we're not using APZ. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D50023

--HG--
extra : moz-landing-system : lando
2019-10-22 04:20:07 +00:00
Nazım Can Altınova 20fc64e558 Bug 1583271 - Part 1: Change profiler page information IDs to BrowsingContextID and InnerWindowID r=gerald,nika
We were keeping nsDocShell::mHistoryId and nsDocShell::mOSHE as keys. They
weren't quite good because:
1. While loading an iframe, they were being registered twice with the same
ids(for about:blank and the real URL) sometimes.
2. It wasn't possible to access to the parent mHistoryId and mOSHE from a child
processes if the parent is in a different process. That may not be the case for
now, but it will be after fission.
So we had to find other IDs to:
1. Determine the Tab of the frames.
2. Determine the URLs of the frames.
For the first use case, we were using nsDocShell::mHistoryId for that purpose
but that was wrong. The closest thing that we can get to a tab ID is
BrowsingContext ID because they don't change after a navigation. But iframes
have different BrowsingContext's, so we still need to create a tree to
construct a tab content. That can be either in the front-end or capture time.
For the second use case, we were using a key pair of mHistoryId and mOSHE. We
now chose to keep inner window IDs for that purpose. Inner window IDs are
unique for each navigation loads because inner window correspond to each JS
window global objects. That's why we can use that without any problem. But one
problem is that we cannot handle `history.pushState` and `history.replaceState`
changes with that change since window global objects won't change during those.
But that was the best thing we can do after fission. So this will be a small
sacrifice for us to keep that functionality working after fission.
In that patch we also remove the registration/unregistration calls. We are
going to add those calls in the next patch.

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

--HG--
extra : moz-landing-system : lando
2019-10-09 21:25:11 +00:00
Brendan Dahl c68cd30ef2 Bug 1510785 - Only build XBL related code when MOZ_XBL is defined. r=bzbarsky
When XBL is disabled, no code in dom/xbl will be built. Also, adds ifdefs
to remove any of the XBL related code elsewhere. There's definitely more
that can be done here, but I think it's better to wait to do the rest of
the cleanup when we actually remove the code.

Depends on D45612

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

--HG--
extra : moz-landing-system : lando
2019-10-08 23:52:14 +00:00
Sylvestre Ledru f12b9fa5c3 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-10-06 18:29:55 +00:00
Emilio Cobos Álvarez c66f205994 Bug 1584263 - No need to flush delayed resizes while flushing layout. r=bzbarsky
We have already called FlushDelayedResize(false) earlier in this method, and
after bug 1583534 that queues a reflow if one is needed. All the boolean
controls is whether reflows are processed by the FlushDelayedResize call.

Since we plan to process reflows anyway a few lines later, there is no need to
do that explicitly that via FlushDelayedResize(true).

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

--HG--
extra : moz-landing-system : lando
2019-09-29 20:41:17 +00:00
Emilio Cobos Álvarez e0740e7784 Bug 1578933 - Run scroll anchoring adjustments when blocking script. r=dholbert
I wanted to fix the more general problem and script-block more of
FlushPendingNotifications, but simple attempts to do that have resulted in
terribly orange try runs with very bizarre failures, so in the "perfect is the
enemy of good" spirit, fix the issue at hand (scroll anchoring adjustments not
dealing with layout reentering beneath them) by running them while
script-blocked, which is the right thing to do anyway.

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

--HG--
extra : moz-landing-system : lando
2019-09-26 17:07:03 +00:00
Emilio Cobos Álvarez aef57af453 Bug 1553772 - Bug 1549812 - Try to assert a bit harder about stuff not flushing under our nose. r=TYLin,mats
I think these should hold, everything that runs under them should just schedule
other stuff to some later date:

 * Synth mouse events -> scheduled as refresh driver observers.
 * Scroll events -> Scheduled as well.
 * Caret state change events -> Also scheduled after last patch.
 * IME and accessibility stuff -> I don't think they can reenter layout.

We can always revert this if it causes troubles, plus it shouldn't crash on
release so should be fine.

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

--HG--
extra : moz-landing-system : lando
2019-09-26 20:55:58 +00:00
Emilio Cobos Álvarez 161cb16ca8 Bug 1551659 - Remove MVMContext::ResizeEventFlag and related code. r=botond,hiro
D46944 / bug 1583534 is what fixes the root cause of bug 1528052 by not
having the first call to ResizeReflow have a wrong old size of 0x0.

This removes the code that bug introduces to suppress resize events, which
fixes this bug. I think our behavior now is pretty sane.

In particular, consider the test-case:

<!doctype html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<a href="" target="_blank">Open me in a separate tab</a>
<pre id="log"></pre>
<script>
  // This shouldn't be needed, but otherwise Fenix doesn't show the tooltip on
  // longpress...
  document.querySelector("a").href = location.href;

  function logSize() {
    log.innerText += window.innerWidth + "x" + window.innerHeight + "\n";
  }
  logSize();
  onresize = logSize;
</script>

(Hosted at https://crisal.io/tmp/gecko-mobile-resize.html for convenience)

Right now on trunk, when you click the link from GVE or Fenix, we're only
getting an initial size of 0x0 (which is not great, btw), and only after first
paint we get the real device size, but content doesn't get a resize event.

This is obviously wrong, every time the layout viewport changes we should fire
resize events.

Pages that get opened in new tabs and get refreshed when resized may get an
extra reload with this approach, but this seems not avoidable unless widget sets
the viewport size right in advance (which from discussion with snorp and agi
doesn't seem possible in the general case).

What used to happen is that we were triggering a redundant resize reflow from
the initial paint which didn't update the layout viewport (because the content
viewer and co had the right viewport from the previous navigation).

Now that we optimize those away, I think our behavior should be correct.

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

--HG--
extra : moz-landing-system : lando
2019-09-25 19:35:29 +00:00
Emilio Cobos Álvarez 848d89d65f Bug 1583534 - Further simplify PresShell::ResizeReflow. r=botond
In particular, not let ResizeReflow take the old and new size. Most of the
callers pass dummy values anyway.

Instead, use the old size of the layout viewport. This ensures we fire resize
events only if the layout viewport actually changes.

This is important because the first resize of the mobile viewport manager
after a navigation has an "old size" of 0x0, even though the layout viewport
is initialized on presshell initialization to the right size.

Thus, we fire resize events unnecessarily in that case, which is the root cause
for bug 1528052.

To do this, we need to shuffle a bit of code in nsDocumentViewer that deals with
delayed resizes, to set the visible area _and_ invalidate layout, rather than
setting the visible area and _then_ relying on doing a resize reflow.

Further cleanup is possible, though not required for my android resizing fix, so
will do separately.

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

--HG--
extra : moz-landing-system : lando
2019-09-25 19:12:44 +00:00
Emilio Cobos Álvarez 28b566cf8f Bug 1575138 - Do not schedule reconstruction for <slot> if there's no fallback. r=smaug
Just realized that we probably want this too.

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

--HG--
extra : moz-landing-system : lando
2019-09-24 15:13:34 +00:00
Emilio Cobos Álvarez 45f30e1d19 Bug 1575138 - Don't bother scheduling a reconstruct on <slot>s that have no fallback. r=smaug
So basically what's going on is that we remove all children from the popup here:

  https://searchfox.org/mozilla-central/rev/153feabebc2d13bb4c29ef8adf104ec1ebd246ae/browser/base/content/browser-places.js#687

This makes us schedule a reconstruct of the slot, in case it has fallback
content:

  https://searchfox.org/mozilla-central/rev/153feabebc2d13bb4c29ef8adf104ec1ebd246ae/dom/base/ShadowRoot.cpp#616

Then we insert frames for the items. They get inserted right away, because we
don't support lazy frame construction for XUL:

  https://searchfox.org/mozilla-central/rev/153feabebc2d13bb4c29ef8adf104ec1ebd246ae/layout/base/nsCSSFrameConstructor.cpp#6507

If this was normal HTML content, the insertion would've been lazy, and no
reconstruct would've happened.

The right fix is to support lazy frame construction for XUL. Now that there's
very little XBL it should be possible. This fixes it but it's a kind-of stop-gap
solution.

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

--HG--
extra : moz-landing-system : lando
2019-09-24 00:03:39 +00:00
Edgar Chen 5bc0854d2b Bug 1578355 - Part 1: Move user-activation code from EventStateManager to UserActivation; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D45168

--HG--
extra : moz-landing-system : lando
2019-09-20 20:51:25 +00:00
Daniel Varga bc19cdb06d Backed out 3 changesets (bug 1578355) for build bustage at build/src/dom/base/nsSyncLoadService.h:48:21. On a CLOSED TREE
Backed out changeset d50ad759f129 (bug 1578355)
Backed out changeset 339ab54ca471 (bug 1578355)
Backed out changeset 284299dac42c (bug 1578355)
2019-09-20 14:05:12 +03:00
Edgar Chen 5b6fe53148 Bug 1578355 - Part 1: Move user-activation code from EventStateManager to UserActivation; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D45168

--HG--
extra : moz-landing-system : lando
2019-09-20 10:31:55 +00:00
Adam Gashlin 7f498141e7 Bug 1561546 Part 2 - Update theme when nsXPLookAndFeel prefs change. r=dholbert,jmathies
Also causes removing a pref to take effect immediately, and prevents
losing all color pref overrides when the theme changes.

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

--HG--
extra : moz-landing-system : lando
2019-09-19 19:05:01 +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 8e44d6c57b Bug 1577258 - Streamline the shrink-wrapping resize reflow code. r=botond
Now that this code path is on its own, we can write more straight-forward code.



Depends on D43799

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

--HG--
extra : moz-landing-system : lando
2019-09-12 21:27:06 +00:00
Emilio Cobos Álvarez f94e56699a Bug 1577258 - Add a simpler resize reflow function for when we're not shrink-wrapping. r=bzbarsky
This is much easier than the existing ResizeReflowIgnoreOverride function, and
this will allow me to avoid flushing if needed (we already kinda do that
already with the "suppressResizeReflow" thing), which in turn allows me to
consolidate a bunch of the logic for resizes.

The function should be much easier to follow:

 * Set the new viewport (async, doesn't do any work).
 * Invalidate layout as needed due to the viewport change (that is, resize hint
   for the root frame, and invalidate isizes if needed). Also async and doesn't
   do any reflowing itself.
 * Flush layout / do the reflowing all at once. I think we can stop doing this
   much more often now, but that's follow-up work.



Depends on D43798

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

--HG--
extra : moz-landing-system : lando
2019-09-13 00:21:04 +00:00
shindli ce58db2119 Backed out changeset 9ef1dd77e6b2 (bug 1561546) for causing frequent failures in dom/animation/test/mozilla/test_restyles.html CLOSED TREE 2019-09-11 23:21:46 +03:00
Adam Gashlin 28fa13a2e5 Bug 1561546 - Update theme when nsXPLookAndFeel prefs change. r=dholbert,jmathies
Also causes removing a pref to take effect immediately, and prevents
losing all color pref overrides when the theme changes.

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

--HG--
extra : moz-landing-system : lando
2019-09-11 18:35:44 +00:00
Emilio Cobos Álvarez 0ec0984d05 Bug 1577258 - early-return for noop resizes. r=botond
This avoids doing wasted work and sending spurious resize
events if this case would be hit.

In practice, it cannot be hit yet, I think, because
callers do check for this and bail out earlier. But
there's no assertion to that respect so this shouldn't
hurt.

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

--HG--
extra : moz-landing-system : lando
2019-08-28 22:03:26 +00:00
Dan Glastonbury 41fff20f69 Bug 1571612 - P2: Collect flush req and flush telemetry. r=heycam
Collect telemetry for the number of pending style and layout flush requests per
flush and the number of style and layout flushes per nsRefreshDriver::Tick.  A
style flush reports only style requests, but a layout flush reports style and
layout requests since flushing layout implies a style flush also.

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

--HG--
extra : moz-landing-system : lando
2019-08-21 01:43:30 +00:00
Dan Glastonbury d87e8fd612 Bug 1571612 - P1: Split FlushType::Style and FlushType::Frame. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D40755

--HG--
extra : moz-landing-system : lando
2019-08-07 03:51:20 +00:00
Kristen Wright 1e91da4122 Bug 1573268 - Convert font.size.systemFontScale to static pref. r=njn
Converts font.size.systemFontScale to a static pref. Removes the function in nsLayoutUtils and does the float division directly in PresShell.

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

--HG--
extra : moz-landing-system : lando
2019-08-14 18:27:11 +00:00
kriswright cccb97beb8 Bug 1573268 - Convert two font.size.inflation.* prefs to static prefs. r=njn
Converts font.size.inflation.forceEnabled and font.size.inflation.disabledInMasterProcess to static prefs. Like previous revisions, I retained the member variables in PresShell and set them to the static prefs.

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

--HG--
extra : moz-landing-system : lando
2019-08-13 20:15:52 +00:00
kriswright 1774881905 Bug 1573268 - Convert font.size.inflation.lineThreshold to a static pref. r=njn
Converts font.size.inflation.lineThreshold varcache pref to a static pref. Like previous revisions, this retains the member variable in PresShell.

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

--HG--
extra : moz-landing-system : lando
2019-08-13 18:23:54 +00:00
kriswright 6a396a8167 Bug 1573268 - Convert 3 font.size.inflation.* prefs to static prefs. r=njn
Converts font.size.inflation.minTwips, font.size.inflation.emPerLine, and font.size.inflation.mappingIntercept to static prefs and removes their associated functions from nsLayoutUtils. There are associated member variables in PresShell, but since documentation specified that these variables are set specifically to prevent changes to the cache from being read until page reload, I made the decision to leave these and set them to the static prefs.

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

--HG--
extra : moz-landing-system : lando
2019-08-13 18:19:33 +00:00
Brad Werth 960bd36add Bug 1523844 Part 3: Make the MVM set resolution only as an adjustment, not a restore resolution. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D41632

--HG--
extra : moz-landing-system : lando
2019-08-12 22:23:34 +00:00
Kris Maglione 64c062d570 Bug 1570773: Move browsingContext getter to nsIDocShellTreeItem and add notxpcom variant. r=nika
This also renames the existing infallible nsDocShell:GetBrowsingContext()
getter to BrowsingContextRef(), and changes the return type, since several
callers rely on it returning a raw pointer rather than an already_AddRefed.

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

--HG--
extra : moz-landing-system : lando
2019-08-07 16:59:30 +00:00
Emilio Cobos Álvarez 5ab3251196 Bug 1528616 - Move PresShell::GetRectVisibility to nsTypeAheadFind.cpp. r=dholbert
nsTypeAheadFind.cpp contains all of the callsites to this function, so it seems like a logical place for it to live.

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

--HG--
extra : moz-landing-system : lando
2019-08-07 11:21:55 +00:00
Nicholas Nethercote fcb4a59f7d Bug 1570212 - Convert layout.reflow.synthMouseMove to a static pref. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D40338

--HG--
extra : moz-landing-system : lando
2019-08-02 11:59:06 +00:00
Emilio Cobos Álvarez b6589b23d2 Bug 1528616 - Back out changeset bf824987ef9f (bug 1528616) since it can clearly be hit. r=me
MANUAL PUSH: Backout of existing revision.
2019-07-26 21:26:23 +02:00
Kannan Vijayan 3fb6190ec6 Bug 1559414 - Rename unaudited pre-fission methods with SameProcess for future audit burndown. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D39378

--HG--
extra : moz-landing-system : lando
2019-07-26 16:48:31 +00:00
Nicholas Nethercote 18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

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

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Emilio Cobos Álvarez eb7d8bffd8 Bug 1567237 - Only use scroll range to select scrollable frames to scroll to, don't use scrollbar visibility. r=tnikkel
This is what other browsers do, and it does make sense to me, it's useless to
try to scroll a frame with no scroll range in a given direction.

I think all callers of this function should be treated like this, so this is
more like a RFC / feedback request than a patch per se.

The wheel handling code already checks scroll range, so there's no difference of
behavior in that case, if I'm reading the code right.

There are a few other functions that check the result of
GetPerceivedScrollingDirections(), but I think if we change this we should
change this consistently.

I also think that if we do this we should rename the method to something like
GetAvailableScrollingDirections() or such.

Anyhow, wdyt? I should also add a test for this if we go with this.

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

--HG--
extra : moz-landing-system : lando
2019-07-24 22:33:57 +00:00
Coroiu Cristina 50837746c0 Backed out changeset 2fe42a3dda2c (bug 1567237) for causing leaks on a CLOSED TREE 2019-07-24 20:52:07 +03:00
Emilio Cobos Álvarez 06d6ff95a8 Bug 1567237 - Only use scroll range to select scrollable frames to scroll to, don't use scrollbar visibility. r=tnikkel
This is what other browsers do, and it does make sense to me, it's useless to
try to scroll a frame with no scroll range in a given direction.

I think all callers of this function should be treated like this, so this is
more like a RFC / feedback request than a patch per se.

The wheel handling code already checks scroll range, so there's no difference of
behavior in that case, if I'm reading the code right.

There are a few other functions that check the result of
GetPerceivedScrollingDirections(), but I think if we change this we should
change this consistently.

I also think that if we do this we should rename the method to something like
GetAvailableScrollingDirections() or such.

Anyhow, wdyt? I should also add a test for this if we go with this.

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

--HG--
extra : moz-landing-system : lando
2019-07-24 13:17:11 +00:00
Emilio Cobos Álvarez a404ea1a40 Bug 1528616 - Make an assertion fatal to figure out how this can happen. r=dholbert
We shouldn't have a frame and a null root frame. This assertion failing is the
only way to get this to happen.

So assert it a bit harder so that we can hopefully find a way to repro it and
thus figure out what the right thing to do is. If it legitimately fails, chances
are we shouldn't be putting this function on PresShell in the first place.

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

--HG--
extra : moz-landing-system : lando
2019-07-24 05:08:18 +00:00