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

21635 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Kew 039d64f49f Bug 1665904 - Rename paperName to paperId for better clarity (front-end). r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D90791
2020-09-20 14:09:59 +00:00
Kartikaya Gupta 0a8f544bee Bug 1664626 - Delete now-unused code. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D90724
2020-09-19 00:36:20 +00:00
Botond Ballo 95ba24f326 Bug 1666022 - Make nsLayoutUtils::AsyncPanZoomEnabled() const. r=hiro
The patch also adds a const version of GetDisplayRootFrame().

Differential Revision: https://phabricator.services.mozilla.com/D90754
2020-09-18 20:38:50 +00:00
Kartikaya Gupta fb97ec2e40 Bug 1654836 - Redo how we expand displayport alignment for webrender. r=nical
The displayport is aligned to screen pixels by an alignment number; there was
code to increase that alignment number for the WebRender codepath. This is
desirable because it causes the displayport to move less frequently, which
provides better performance characteristics with WebRender. However, the
way that was implemented, it was possible for the aligned displayport to not
completely enclose the unaligned displayport, which could then result in
perma-checkerboarding.

This patch removes that code and replaces it with a simpler approach to scale
up the existing alignment number by a factor based on the size of the scroller's
base rect (roughly how much of the scroller is visible to the user).

This does make the displayports larger, more so for scrollers with more visible
area. This has negative performance implications, so we mitigate that by also
scaling down the displayport margin multiplier by the same scaling factor. This
isn't perfect, but seems to work well enough in practice.

Differential Revision: https://phabricator.services.mozilla.com/D90503
2020-09-18 12:40:08 +00:00
Kartikaya Gupta ff619cad8f Bug 1654836 - Add a bunch of verbose-level displayport logging. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D90499
2020-09-18 08:05:50 +00:00
Kris Maglione a3b66dd82c Bug 1662841: Remove Fission-incompatible `nsDocumentViewer::AppendSubtree`. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D90615
2020-09-17 22:43:47 +00:00
Olli Pettay 3f30b17ab9 Bug 1665165 - Disable some bfcache tests on Fission, r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D90303
2020-09-17 17:36:24 +00:00
Dorel Luca 72ef712fd0 Backed out 10 changesets (bug 1518999) for GeckoView failures in PanZoomControllerTest.scroll. CLOSED TREE
Backed out changeset 7b5bdd071d05 (bug 1518999)
Backed out changeset 401e488734dd (bug 1518999)
Backed out changeset c13e51e17329 (bug 1518999)
Backed out changeset 2a2d67ba15b8 (bug 1518999)
Backed out changeset 3d4d84003227 (bug 1518999)
Backed out changeset 972731762965 (bug 1518999)
Backed out changeset f21b13582dad (bug 1518999)
Backed out changeset 13a4c749a802 (bug 1518999)
Backed out changeset 5a6cea5fd344 (bug 1518999)
Backed out changeset c3bb552e76a3 (bug 1518999)
2020-09-17 02:58:34 +03:00
Emilio Cobos Álvarez 567d300760 Bug 1663826 - Keep freezing navigation during window.print() for compat. r=smaug
This broke in bug 1636728 because we started setting the bit in the
cloned docshell rather than the original one.

Behavior in other browsers seems to be a bit all over the place, but for
now keeping our behavior during window.print() seems sane.

Differential Revision: https://phabricator.services.mozilla.com/D90456
2020-09-16 22:55:19 +00:00
Timothy Nikkel bd79bff909 Bug 1665507. Back out changeset 25760b432ecb from bug 1663562. The workaround is no longer needed.
Differential Revision: https://phabricator.services.mozilla.com/D90490
2020-09-16 22:30:01 +00:00
Sean Feng 3aaaa826c0 Bug 1518999 - Update ContentfulPaint algorithm to follow the spec r=emilio
This patch includes a couple of changes.
1) Notify contentful paint only during refresh driver ticks.
2) Not only the root document, sub document should also have their own
   contentful paint entry.
3) Consider invisible text as contentful as well.

Differential Revision: https://phabricator.services.mozilla.com/D89498
2020-09-14 18:47:34 +00:00
Sean Feng 11a2849f32 Bug 1518999 - Implement PerformancePaintTiming for FirstContentfulPaint r=smaug,mstange
Spec: https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming
We only support FirstContentfulPaint at the moment.

Differential Revision: https://phabricator.services.mozilla.com/D66463
2020-09-14 15:13:18 +00:00
Andreas Farre f9f96d23ca Bug 1662410 - Part 1: Fix usage of ChildSHistory.legacySHistory . r=peterv
ChildSHistory.legacySHistory isn't valid for content processes when
session history in the parent is enabled. We try to fix this by either
delegating to the parent by IPC or move the implementation partially
or as a whole to the parent.

Differential Revision: https://phabricator.services.mozilla.com/D89353
2020-09-16 14:51:01 +00:00
Emilio Cobos Álvarez 706ceffb4b Bug 1665125 - Make print background settings infallible. r=bobowen
This makes callers simpler.

Differential Revision: https://phabricator.services.mozilla.com/D90285
2020-09-16 11:21:41 +00:00
Emilio Cobos Álvarez ba7373413f Bug 1665064 - Honor print background image settings on WebRender too. r=kats,jwatt CLOSED TREE
We usually suppress background images in
nsCSSRendering::PaintStyleImageLayerWithSC, but that codepath isn't hit
by WebRender, so instead do it during display list building, the same
way we suppress background colors.

Differential Revision: https://phabricator.services.mozilla.com/D90278
2020-09-15 16:26:05 +00:00
Narcis Beleuzu 38f63aa9b6 Backed out changeset 0834b634ea07 (bug 1665125) for reftest failures. CLOSED TREE 2020-09-15 23:32:11 +03:00
Barret Rennie 2e9f3011e1 Bug 1663762 - Add probes to measure input event latency during load correlated with preload r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90208
2020-09-15 17:43:10 +00:00
Barret Rennie 099ef90095 Bug 1663760 - Add probes to measure TTFI correlated with preload r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90183
2020-09-15 16:42:54 +00:00
Narcis Beleuzu 746b4430d0 Backed out changeset a572a639204f (bug 1665064) for reftest failures. CLOSED TREE 2020-09-15 21:33:06 +03:00
Emilio Cobos Álvarez f8330284c5 Bug 1665064 - Honor print background image settings on WebRender too. r=kats,jwatt
We usually suppress background images in
nsCSSRendering::PaintStyleImageLayerWithSC, but that codepath isn't hit
by WebRender, so instead do it during display list building, the same
way we suppress background colors.

Differential Revision: https://phabricator.services.mozilla.com/D90278
2020-09-15 16:26:05 +00:00
Emilio Cobos Álvarez f3927b672a Bug 1665125 - Make print background settings infallible. r=bobowen
This makes callers simpler.

Differential Revision: https://phabricator.services.mozilla.com/D90285
2020-09-15 16:19:20 +00:00
Timothy Nikkel 8646146723 Bug 1663562. Don't call MaybeReflowForInflationScreenSizeChange with webrender when running mochitests in dom/base/test to work around webrender bug for now. r=botond
This is sad, but seems like the least bad option to enable desktop zooming scrollbars reasonable soon.

Differential Revision: https://phabricator.services.mozilla.com/D90181
2020-09-15 04:33:49 +00:00
Timothy Nikkel 9a661331df Bug 1663562. Call MaybeReflowForInflationScreenSizeChange when any prefs that could affect font inflation change. r=kats
When I start setting the pref ui.useOverlayScrollbars in bug 1663537 we trigger this assert

```
###!!! ASSERTION: can't mark frame dirty during reflow: '!mIsReflowing', file /builds/worker/checkouts/gecko/layout/base/PresShell.cpp, line 2677
#01: mozilla::PresShell::MaybeReflowForInflationScreenSizeChange() [layout/base/PresShell.cpp:11148]
#02: mozilla::PresShell::CompleteChangeToVisualViewportSize() [layout/base/PresShell.cpp:11177]
#03: MobileViewportManager::UpdateVisualViewportSize(mozilla::gfx::IntSizeTyped<mozilla::ScreenPixel> const&, mozilla::gfx::ScaleFactor<mozilla::CSSPixel, mozilla::ScreenPixel> const&) [layout/base/MobileViewportManager.cpp:504]
#04: MobileViewportManager::RefreshVisualViewportSize() [layout/base/MobileViewportManager.cpp:557]
#05: nsHTMLScrollFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/nsGfxScrollFrame.cpp:1340]
#06: nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, int, int, nsIFrame::ReflowChildFlags, nsReflowStatus&, nsOverflowContinuationTracker*) [layout/generic/nsContainerFrame.cpp:1115]
#07: mozilla::ViewportFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/ViewportFrame.cpp:297]
#08: mozilla::PresShell::DoReflow(nsIFrame*, bool, mozilla::OverflowChangedTracker*) [layout/base/PresShell.cpp:9650]
#09: mozilla::PresShell::ProcessReflowCommands(bool) [layout/base/PresShell.cpp:9816]
#10: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [layout/base/PresShell.cpp:4239]
#11: nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp) [layout/base/nsRefreshDriver.cpp:2139]
```

This happens after the test is finish when we unset the ui.useOverlayScrollbars pref which (I'm assuming because it must) causes reflow. When running a font-inflation related reftest we also unset the font inflation related prefs that were specified in the reftest.list file. This causes font-inflation to go from enabled to disabled and we detect that for the first time while reflowing the scroll frame.

Instead we should reflow when any pref that could affect font inflation is changed. I scanned the font-inflation code in PresShell and Document::GetViewportInfo for prefs are consulted, but I didn't go a super exhaustive search.

Differential Revision: https://phabricator.services.mozilla.com/D89409
2020-09-15 04:33:38 +00:00
Mihai Alexandru Michis a64de8bf5f Backed out 2 changesets (bug 1663562) for causing bustages in nsPresContext.cpp
CLOSED TREE

Backed out changeset 67cbb5422dbc (bug 1663562)
Backed out changeset 574709176152 (bug 1663562)
2020-09-15 07:22:29 +03:00
Timothy Nikkel 147ca18b99 Bug 1663562. Don't call MaybeReflowForInflationScreenSizeChange with webrender when running mochitests in dom/base/test to work around webrender bug for now. r=botond
This is sad, but seems like the least bad option to enable desktop zooming scrollbars reasonable soon.

Depends on D89409

Differential Revision: https://phabricator.services.mozilla.com/D90181
2020-09-15 04:07:21 +00:00
Timothy Nikkel d1a2ce8468 Bug 1663562. Call MaybeReflowForInflationScreenSizeChange when any prefs that could affect font inflation change. r=kats
When I start setting the pref ui.useOverlayScrollbars in bug 1663537 we trigger this assert

```
###!!! ASSERTION: can't mark frame dirty during reflow: '!mIsReflowing', file /builds/worker/checkouts/gecko/layout/base/PresShell.cpp, line 2677
#01: mozilla::PresShell::MaybeReflowForInflationScreenSizeChange() [layout/base/PresShell.cpp:11148]
#02: mozilla::PresShell::CompleteChangeToVisualViewportSize() [layout/base/PresShell.cpp:11177]
#03: MobileViewportManager::UpdateVisualViewportSize(mozilla::gfx::IntSizeTyped<mozilla::ScreenPixel> const&, mozilla::gfx::ScaleFactor<mozilla::CSSPixel, mozilla::ScreenPixel> const&) [layout/base/MobileViewportManager.cpp:504]
#04: MobileViewportManager::RefreshVisualViewportSize() [layout/base/MobileViewportManager.cpp:557]
#05: nsHTMLScrollFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/nsGfxScrollFrame.cpp:1340]
#06: nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, int, int, nsIFrame::ReflowChildFlags, nsReflowStatus&, nsOverflowContinuationTracker*) [layout/generic/nsContainerFrame.cpp:1115]
#07: mozilla::ViewportFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/ViewportFrame.cpp:297]
#08: mozilla::PresShell::DoReflow(nsIFrame*, bool, mozilla::OverflowChangedTracker*) [layout/base/PresShell.cpp:9650]
#09: mozilla::PresShell::ProcessReflowCommands(bool) [layout/base/PresShell.cpp:9816]
#10: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [layout/base/PresShell.cpp:4239]
#11: nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp) [layout/base/nsRefreshDriver.cpp:2139]
```

This happens after the test is finish when we unset the ui.useOverlayScrollbars pref which (I'm assuming because it must) causes reflow. When running a font-inflation related reftest we also unset the font inflation related prefs that were specified in the reftest.list file. This causes font-inflation to go from enabled to disabled and we detect that for the first time while reflowing the scroll frame.

Instead we should reflow when any pref that could affect font inflation is changed. I scanned the font-inflation code in PresShell and Document::GetViewportInfo for prefs are consulted, but I didn't go a super exhaustive search.

Differential Revision: https://phabricator.services.mozilla.com/D89409
2020-09-14 22:19:09 +00:00
Bas Schouten 343a7ab31c Bug 1661881 - Part 3: Make RefreshDriver's tick call SetInputHandlingStartTime directly. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D89536
2020-09-14 12:13:13 +00:00
Timothy Nikkel 30f528e804 Bug 1664446. Properly wait to make sure any potential scroll events get fired in several tests. r=kats
Doing rAF rAF flushApzRepaints is not enough to make sure that any potential scroll events are sent to content. The reason is that if the apz repaint request causes us to do scrolling on the main thread then the scrolling will be finished after flushApzRepaints, and the scroll event will be pending, but it's not sent until the next refresh driver tick. So we need to do at least one rAF after flushApzRepaints.

Differential Revision: https://phabricator.services.mozilla.com/D90035
2020-09-13 20:21:11 +00:00
Emilio Cobos Álvarez 948fa5c6d2 Bug 1664156 - Remove -moz-suppressed. r=edgar
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2020-09-13 11:33:13 +00:00
Noemi Erli 733e3b440c Backed out changeset 64eb902728bc (bug 1664156) for causing mochitest failures in test_meta_csp_self.html CLOSED TREE 2020-09-12 22:56:18 +03:00
Emilio Cobos Álvarez 4b18c556e4 Bug 1664156 - Remove -moz-suppressed. r=edgar
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2020-09-12 17:39:18 +00:00
Kartikaya Gupta 8b10d15d15 Bug 1662014 - Remove unused fields/APIs. r=botond,tnikkel
These things are all unused now.

Differential Revision: https://phabricator.services.mozilla.com/D88750
2020-09-12 13:06:39 +00:00
Kartikaya Gupta 378887e276 Bug 1662013 - Introduce a ScrollPositionUpdate and plumb it in. r=tnikkel,botond
This adds a ScrollPositionUpdate class. Code in nsGfxScrollFrame creates
instances of these classes every time the scroll generation is incremented,
and saves them to an array. The array is sent in the scroll metadata to the
compositor as part of a paint transaction.

Currently this data is not used at all on the APZ side, and exists alongside
(independently of) the existing scroll fields, so this patch should not have
any functional effects.

Differential Revision: https://phabricator.services.mozilla.com/D88741
2020-09-12 13:05:53 +00:00
Emilio Cobos Álvarez 1ef2a5628a Bug 1664432 - Remove -moz-user-disabled. r=edgar
We treat it exactly the same as -moz-broken. The pseudo-class is not
exposed to content, so I don't think we have a reason to keep it around.

Differential Revision: https://phabricator.services.mozilla.com/D89904
2020-09-11 19:26:40 +00:00
Razvan Maries 8f97d6d022 Backed out changeset b5d0e150491e (bug 1661544) for perma failures on HTMLBody-ScrollArea_quirksmode.html. 2020-09-12 09:48:34 +03:00
Botond Ballo d5b3bf63f9 Bug 1661544 - Ensure initial viewport is computed before reporting innerWidth. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D88947
2020-09-09 21:14:31 +00:00
Ting-Yu Lin 8763701634 Bug 1663822 Part 6 - Convert the anonymous enum controlling ReflowInput's behavior into an EnumSet. r=dholbert
This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89545
2020-09-11 17:59:21 +00:00
Ting-Yu Lin a11075f9e1 Bug 1663822 Part 3 - Move ComputeSizeFlags to LayoutConstants.h, and put it under mozilla namespace. r=dholbert
In the next part, I'm going to use ComputeSizeFlags as the arguments in
some ReflowInput's methods. Because nsIFrame.h includes ReflowInput.h,
to solve the circular dependency, ComputeSizeFlags needs to be moved to
somewhere else.

Also, revise the document for ComputeSizeFlag. The rest of the patch is
just dropping `nsIFrame::` and adding `mozilla::` as needed.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89542
2020-09-11 18:32:08 +00:00
Timothy Nikkel 86ef6eea77 Bug 1663537. Fix various tests for desktop zooming scrollbars. r=kats
The test fixes all fell into the follow categories:

A) The test uses requestAnimationFrame to wait one frame and expects scrolling to be complete. With the desktop zooming scrollbars in order for the scrolling to show up on the main thread we need to send the scroll request to the compositor and then hear back from it via an apz repaint request (apz callback helper). Waiting on requestAnimationFrame will complete the first part, but not necessarily the second part. The fix is to wait for a scroll event.

B) Switching tests to wait for scroll events exposes another problem: the test can do things that cause a scroll in order to setup the test (and that may not be obvious that it causes a scroll) before actually proceeding to do the test and do something that causes a scroll and then checks for the scroll change of the second thing. Waiting for a requestAnimationFrame would include both those scrolls without desktop zooming scrollbars, but if we wait for a scroll event we will get the scroll event for the first thing which we are not interested in. So we need to make sure scroll events are cleared out before waiting for any scroll events. We do this by waiting two requestAnimationFrame's and waiting for apz to be flushed. We also use this when a test does something and it wants to test that scrolling is not performed.

The main thing that causes scrolling that may not be obvious: calling node.focus(). With stacks like:

from test_scroll_per_page.html

```
#01: mozilla::ScrollFrameHelper::CompleteAsyncScroll(nsRect const&, mozilla::ScrollOrigin) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d6cc0]
#02: mozilla::ScrollFrameHelper::ScrollToWithOrigin(nsPoint, mozilla::ScrollMode, mozilla::ScrollOrigin, nsRect const*, nsIScrollbarMediator::ScrollSnapMode) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d7732]
#03: mozilla::layout::ScrollAnchorContainer::ApplyAdjustments() [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4742913]
#04: mozilla::PresShell::FlushPendingScrollAnchorAdjustments() [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4650069]
#05: mozilla::PresShell::ProcessReflowCommands(bool) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x465742b]
#06: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4656af8]
#07: mozilla::dom::Document::FlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1a87d3c]
#08: mozilla::PresShell::ScrollContentIntoView(nsIContent*, mozilla::ScrollAxis, mozilla::ScrollAxis, mozilla::ScrollFlags) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4652b96]
#09: nsFocusManager::ScrollIntoView(mozilla::PresShell*, nsIContent*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1bedd1c]
#10: nsFocusManager::Focus(nsPIDOMWindowOuter*, mozilla::dom::Element*, unsigned int, bool, bool, bool, bool, bool, nsIContent*) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be6be0]
#11: nsFocusManager::SetFocusInner(mozilla::dom::Element*, int, bool, bool) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be212f]
#12: nsFocusManager::SetFocus(mozilla::dom::Element*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be32ba]
#13: mozilla::dom::Element::Focus(mozilla::dom::FocusOptions const&, mozilla::dom::CallerType, mozilla::ErrorResult&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1aaf283]
#14: mozilla::dom::HTMLElement_Binding::focus(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x2d65f3b]
```

from editor/libeditor/tests/test_bug549262.html

```
#01: mozilla::ScrollFrameHelper::CompleteAsyncScroll(nsRect const&, mozilla::ScrollOrigin) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d6cc0]
#02: mozilla::ScrollFrameHelper::ScrollToWithOrigin(nsPoint, mozilla::ScrollMode, mozilla::ScrollOrigin, nsRect const*, nsIScrollbarMediator::ScrollSnapMode) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x47d7732]
#03: mozilla::PresShell::ScrollFrameRectIntoView(nsIFrame*, nsRect const&, mozilla::ScrollAxis, mozilla::ScrollAxis, mozilla::ScrollFlags) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x46541bc]
#04: mozilla::PresShell::DoScrollContentIntoView() [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4653776]
#05: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4656b11]
#06: mozilla::dom::Document::FlushPendingNotifications(mozilla::ChangesToFlush) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1a87d3c]
#07: mozilla::PresShell::ScrollContentIntoView(nsIContent*, mozilla::ScrollAxis, mozilla::ScrollAxis, mozilla::ScrollFlags) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x4652b96]
#08: nsFocusManager::ScrollIntoView(mozilla::PresShell*, nsIContent*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1bedd1c]
#09: nsFocusManager::Focus(nsPIDOMWindowOuter*, mozilla::dom::Element*, unsigned int, bool, bool, bool, bool, bool, nsIContent*) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be6be0]
#10: nsFocusManager::SetFocusInner(mozilla::dom::Element*, int, bool, bool) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be212f]
#11: nsFocusManager::SetFocus(mozilla::dom::Element*, unsigned int) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1be32ba]
#12: mozilla::dom::Element::Focus(mozilla::dom::FocusOptions const&, mozilla::dom::CallerType, mozilla::ErrorResult&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x1aaf283]
#13: mozilla::dom::HTMLElement_Binding::focus(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) [/Users/tim/ffopt2/src/obj-x86_64-apple-darwin19.6.0/toolkit/library/build/XUL + 0x2d65f3b]
```

C) Several tests use nsIDOMWindowUtils advanceTimeAndRefresh/restoreNormalRefresh and expect scrolling to be done after a call to advanceTimeAndRefresh. This is basically A), advanceTimeAndRefresh does a refresh driver tick but doesn't allow a repaint request to come back to the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D89403
2020-09-11 10:45:28 +00:00
Gerald Squelart a087b2df35 Bug 1663554 - Convert AUTO_PROFILER_TEXT_MARKER_... to new AUTO_PROFILER_MARKER_TEXT - r=gregtatum
The name `AUTO_PROFILER_MARKER_TEXT` is more consistent with the equivalent non-`AUTO` macro, and similarly arguments have been re-ordered to be the same, i.e.: Name, category&options, text.

The different macros with different argument sets can now be collapsed into one macro, and the optional arguments (timing, inner window id, backtrace) can easily be added to the `MarkerOptions` where needed.

As a bonus, a specific start time can optionally be provided at construction time.

Differential Revision: https://phabricator.services.mozilla.com/D89588
2020-09-11 00:42:51 +00:00
Narcis Beleuzu 57fd870466 Backed out 3 changesets (bug 1308104) for bustages on nsHttp.cpp . CLOSED TREE
Backed out changeset e78791b93526 (bug 1308104)
Backed out changeset b5c1875c11c7 (bug 1308104)
Backed out changeset 9c8433be706e (bug 1308104)
2020-09-10 22:43:25 +03:00
Nicklas Boman 7576762235 Bug 1308104 - Replace PL_strchr with a safer Gecko string class or function layout/ r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D89327
2020-09-10 17:38:55 +00:00
Emilio Cobos Álvarez c921f4ff34 Bug 1664227 - The default page margin should be at least the unwriteable section, but not added on top. r=jwatt
We were adding the unwriteable to the default margin. I was going to
consider not painting the headers / footers if they overlapped with the
content box of the page, but turns out our default configuration
overlaps slightly at the bottom, so I just punted on that.

Users can remove the headers / footers quite easily anyhow.

Differential Revision: https://phabricator.services.mozilla.com/D89794
2020-09-10 18:03:04 +00:00
Emilio Cobos Álvarez 5ed9da2bf7 Bug 1664205 - Simplify rect getters in nsIPrintSettings. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D89778
2020-09-10 15:25:59 +00:00
Gerald Squelart 5f9ff13253 Bug 1663543 - Convert PROFILER_ADD_MARKER and 2-arg profiler_add_marker to PROFILER_MARKER_UNTYPED - r=gregtatum
Mostly mechanical change, with some extra work where non-literal names are provided.
Also, when this is the only profiler call in a file, `#include "GeckoProfiler.h"` can be changed to `#include "mozilla/ProfilerMarkers.h"`.

Differential Revision: https://phabricator.services.mozilla.com/D89415
2020-09-10 03:02:36 +00:00
Sean Feng 787c7f4ce9 Bug 1661166 - Don't record paint timings if it is a print context r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D88908
2020-09-09 17:30:05 +00:00
Bogdan Tara f73b69b818 Backed out changeset 6698b842822e (bug 1663562) for mozglue_static::panic_hook crashes CLOSED TREE 2020-09-09 05:14:12 +03:00
Timothy Nikkel 75f67e42ee Bug 1663562. Call MaybeReflowForInflationScreenSizeChange when any prefs that could affect font inflation change. r=kats
When I start setting the pref ui.useOverlayScrollbars in bug 1663537 we trigger this assert

```
###!!! ASSERTION: can't mark frame dirty during reflow: '!mIsReflowing', file /builds/worker/checkouts/gecko/layout/base/PresShell.cpp, line 2677
#01: mozilla::PresShell::MaybeReflowForInflationScreenSizeChange() [layout/base/PresShell.cpp:11148]
#02: mozilla::PresShell::CompleteChangeToVisualViewportSize() [layout/base/PresShell.cpp:11177]
#03: MobileViewportManager::UpdateVisualViewportSize(mozilla::gfx::IntSizeTyped<mozilla::ScreenPixel> const&, mozilla::gfx::ScaleFactor<mozilla::CSSPixel, mozilla::ScreenPixel> const&) [layout/base/MobileViewportManager.cpp:504]
#04: MobileViewportManager::RefreshVisualViewportSize() [layout/base/MobileViewportManager.cpp:557]
#05: nsHTMLScrollFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/nsGfxScrollFrame.cpp:1340]
#06: nsContainerFrame::ReflowChild(nsIFrame*, nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, int, int, nsIFrame::ReflowChildFlags, nsReflowStatus&, nsOverflowContinuationTracker*) [layout/generic/nsContainerFrame.cpp:1115]
#07: mozilla::ViewportFrame::Reflow(nsPresContext*, mozilla::ReflowOutput&, mozilla::ReflowInput const&, nsReflowStatus&) [layout/generic/ViewportFrame.cpp:297]
#08: mozilla::PresShell::DoReflow(nsIFrame*, bool, mozilla::OverflowChangedTracker*) [layout/base/PresShell.cpp:9650]
#09: mozilla::PresShell::ProcessReflowCommands(bool) [layout/base/PresShell.cpp:9816]
#10: mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush) [layout/base/PresShell.cpp:4239]
#11: nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp) [layout/base/nsRefreshDriver.cpp:2139]
```

This happens after the test is finish when we unset the ui.useOverlayScrollbars pref which (I'm assuming because it must) causes reflow. When running a font-inflation related reftest we also unset the font inflation related prefs that were specified in the reftest.list file. This causes font-inflation to go from enabled to disabled and we detect that for the first time while reflowing the scroll frame.

Instead we should reflow when any pref that could affect font inflation is changed. I scanned the font-inflation code in PresShell and Document::GetViewportInfo for prefs are consulted, but I didn't go a super exhaustive search.

Differential Revision: https://phabricator.services.mozilla.com/D89409
2020-09-08 20:03:09 +00:00
Emilio Cobos Alvarez ef6d2f0832 Bug 1663426 - Add a null-check to SetDocumentInternal. r=bobowen
This shouldn't generally happen, but seems it can under some circumstances and
even though I've fixed the error condition that triggers this a null-check here is harmless.

Differential Revision: https://phabricator.services.mozilla.com/D89453
2020-09-08 12:32:15 +00:00
Timothy Nikkel 39905f40a3 Bug 1663537. Fix layout/base/tests/test_scroll_event_ordering.html to work with desktop zooming scrollbars. r=kats
sendKey uses our new relative scroll path that does the scroll by the apz. But we don't have any scroll event ordering expectations when apz is doing the scroll. We trade lossing those expectations for smoother apz scrolling.

So change the test to use a method that doesn't use our new relative apz scroll path and goes back to main thread scrolling.

Differential Revision: https://phabricator.services.mozilla.com/D89402
2020-09-08 08:12:25 +00:00
lonocvb ac824cbee2 Bug 1662655 - Elements with pointer event are considered clickable. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D89236
2020-09-03 08:03:32 +00:00
Hiroyuki Ikezoe b15a8fe457 Bug 1661873 - Add wpts and mochitests to make sure downloadable font is properly printed or rendered in print preview. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D89095
2020-09-03 01:31:36 +00:00
Nathan Froyd cfb8fb313f Bug 1662251 - stop assigning from NS_Convert* values, mostly; r=sg
This patch was generated by running:

```
perl -p -i \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
     $FILE
```

against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes.  The errors fell into three categories:

1. Calling the convert functions with `std::string::c_str()`; these were
   changed to simply pass the string instead, relying on implicit conversion
   to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
   with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
   replacement not being type-aware.  These changes were reverted.

Differential Revision: https://phabricator.services.mozilla.com/D88903
2020-09-02 09:54:37 +00:00
Emilio Cobos Álvarez 33caaa4bbb Bug 1661838 - Fix builds with --disable-printing. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D89166
2020-09-02 16:13:01 +00:00
Jonathan Watt 7422304c17 Bug 1657220. Add telemetry for new print UI. r=bobowen,mbalfanz
Differential Revision: https://phabricator.services.mozilla.com/D87303
2020-09-01 18:47:15 +00:00
Kartikaya Gupta ba7397a11e Bug 1661897 - Acknowledge pending visual scroll updates for any RSF. r=botond
We set pending visual scroll updates even for RSFs that are on subdocuments,
so we should ensure they get acknowledged and cleared on paints. Otherwise
the pending visual scroll update can get "stuck" and it affects things that
depend on it, such as the drag-selection code.

Differential Revision: https://phabricator.services.mozilla.com/D88893
2020-09-01 18:18:01 +00:00
Emilio Cobos Álvarez 8a9cac4917 Bug 1662277 - Make IntersectionObserver entries have the same timestamp as other timestamp-returning things during the "update the rendering steps". r=sefeng
This is per spec, see the link in the test. I wouldn't see much point on
doing this for IntersectionObserver on its own, see:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1518999#c28

Though I see the point of doing this for the paint timing API, and I
guess for consistency we should do it here too.

Differential Revision: https://phabricator.services.mozilla.com/D88926
2020-09-01 15:02:54 +00:00
Emilio Cobos Álvarez 6a183a94f4 Bug 1660774 - Masks shouldn't be suppressed for print. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D88899
2020-09-01 13:43:54 +00:00
Jonathan Watt ad76c1dcba Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D88703
2020-09-01 11:00:36 +00:00
Edgar Chen 2990a39c60 Bug 1662124 - element.setPointerCapture should throw NotFoundError if the pointer id is invalid; r=smaug
https://github.com/w3c/pointerevents/issues/256

Differential Revision: https://phabricator.services.mozilla.com/D88859
2020-09-01 09:13:56 +00:00
Narcis Beleuzu b4560d9e94 Backed out 2 changesets (bug 1661897) for mochitest failures on test_group_mouseevents.html . CLOSED TREE
Backed out changeset 34ee0403ab1e (bug 1661897)
Backed out changeset f83db4b41bf6 (bug 1661897)
2020-09-01 07:47:59 +03:00
Kartikaya Gupta 447dd12c94 Bug 1661897 - Acknowledge pending visual scroll updates for any RSF. r=botond
We set pending visual scroll updates even for RSFs that are on subdocuments,
so we should ensure they get acknowledged and cleared on paints. Otherwise
the pending visual scroll update can get "stuck" and it affects things that
depend on it, such as the drag-selection code.

Differential Revision: https://phabricator.services.mozilla.com/D88893
2020-08-31 20:34:34 +00:00
Emilio Cobos Álvarez 28231ea1e1 Bug 1662204 - Prevent all printed documents, not just print preview, from getting a regular non-print presentation. r=jwatt
Before bug 1636728 this couldn't happen because print documents weren't
hosted in an <browser>. The presentation of documents that are being
printed should be managed by the print job.

We should, in fact, probably just make mDocument->IsStaticDocument() the
condition, or such.

Differential Revision: https://phabricator.services.mozilla.com/D88901
2020-08-31 20:16:11 +00:00
Ting-Yu Lin ad069fecf2 Bug 1657256 - Always update the cached mImaginaryCaretRect in SetPosition(). r=marionette-reviewers,mats,whimboo
During scrolling, the caret's position relative to the
custom-content-container (cached in mImaginaryCaretRectInContainerFrame)
may not change, but its position relative to root frame can (cached in
mImaginaryCaretRect).

We need to update mImaginaryCaret each time we are in SetPosition().
Otherwise, the caret still remembers its pre-scrolling old position next
time when we drag it, resulting the caret jumping to its old
pre-scrolling position suddenly.

Note this bug only occurs on the root scroll frame where the APZ is
enabled, not in any sub-scroll frames where APZ is disable when the
caret is shown.

Differential Revision: https://phabricator.services.mozilla.com/D88638
2020-08-31 17:54:19 +00:00
Sylvestre Ledru 9c192aa9ca Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 09:23:02 +00:00
Mihai Alexandru Michis 261d01524b Backed out changeset d0f173a90792 (bug 1519636) for causing bustages.
CLOSED TREE
2020-08-31 10:14:58 +03:00
Sylvestre Ledru 939dd426e6 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 06:51:21 +00:00
Jonathan Kew b7d6067688 Bug 1533462 - Run font-info loader immediately for accessiblecaret and forms tests, for more consistent behavior. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D88545
2020-08-30 22:59:57 +00:00
Edgar Chen e4efe37095 Bug 1653949 - Part 4: Add MouseExitFromWidget event to the delayed event queue if event handling is suppressed; r=smaug
So that we won't lost it if it happens in nested event loop.

Differential Revision: https://phabricator.services.mozilla.com/D86953
2020-08-27 17:19:07 +00:00
Edgar Chen 55691da377 Bug 1653949 - Part 2: Add ePuppet to WidgetMouseEvent::ExitFrom; r=smaug
eTopLevel is reused in content process to indicates that the mouse leaves
the puppet widget rendering area, now we add a separated type, ePuppet, for it.

Differential Revision: https://phabricator.services.mozilla.com/D84748
2020-08-27 17:19:14 +00:00
Edgar Chen 36ccda1d13 Bug 1653949 - Part 1: Change mExitFrom in WidgetMouseEvent to be Maybe<ExitFrom>; r=smaug
mExitFrom now contains a value only when mMessage is eMouseExitFromWidget

Differential Revision: https://phabricator.services.mozilla.com/D88225
2020-08-27 17:19:03 +00:00
Ting-Yu Lin 0cdadc6d83 Bug 1365982 followup - Update FrameProperties::Has() document. r=jfkthame
The `HasSkippingBitCheck` variant has been removed in
https://hg.mozilla.org/mozilla-central/rev/b37e4d256cd6

DONTBUILD NPOTB because this is a comment-only change.

Differential Revision: https://phabricator.services.mozilla.com/D88687
2020-08-29 00:04:18 +00:00
Botond Ballo 35448ccbee Bug 1661608 - Use correct viewport type in RecordMouseLocation(). r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D88676
2020-08-28 21:44:16 +00:00
Cosmin Sabou 2a9db10f24 Backed out 7 changesets (bug 1518999) for causing browsertime failures. CLOSED TREE
Backed out changeset d93cb254eef5 (bug 1518999)
Backed out changeset a9715e73e862 (bug 1518999)
Backed out changeset e28081d16e3c (bug 1518999)
Backed out changeset c9d88f3f1f5b (bug 1518999)
Backed out changeset 9836adcc4e83 (bug 1518999)
Backed out changeset 9f01755d327f (bug 1518999)
Backed out changeset ef494065b8e2 (bug 1518999)
2020-08-28 06:27:11 +03:00
Mats Palmgren bb86544bb1 Bug 1548753 - [css-lists] Prefer an ancestor's counter scope over a sibling's scope. r=emilio
https://github.com/w3c/csswg-drafts/issues/5477

Differential Revision: https://phabricator.services.mozilla.com/D87991
2020-08-27 18:26:38 +00:00
Sean Feng 61ec0bd3c3 Bug 1518999 - Implement PerformancePaintTiming for FirstContentfulPaint r=smaug,mstange
Spec: https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming
We only support FirstContentfulPaint at the moment.

Differential Revision: https://phabricator.services.mozilla.com/D66463
2020-08-27 14:50:43 +00:00
Cosmin Sabou 403893bc7e Backed out 5 changesets (bug 1653949) for assertion failures on EventStateManager.cpp. CLOSED TREE
Backed out changeset ad7c35ab2a40 (bug 1653949)
Backed out changeset 31cb90ef998a (bug 1653949)
Backed out changeset 03e65cbd2a11 (bug 1653949)
Backed out changeset a87ac2a7db70 (bug 1653949)
Backed out changeset 390dd2c04cd4 (bug 1653949)
2020-08-27 20:13:20 +03:00
Edgar Chen bc49d1ce72 Bug 1653949 - Part 4: Add MouseExitFromWidget event to the delayed event queue if event handling is suppressed; r=smaug
So that we won't lost it if it happens in nested event loop.

Differential Revision: https://phabricator.services.mozilla.com/D86953
2020-08-25 23:27:21 +00:00
Edgar Chen c4125fd9d4 Bug 1653949 - Part 2: Add ePuppet to WidgetMouseEvent::ExitFrom; r=smaug
eTopLevel is reused in content process to indicates that the mouse leaves
the puppet widget rendering area, now we add a separated type, ePuppet, for it.

Differential Revision: https://phabricator.services.mozilla.com/D84748
2020-08-26 20:31:46 +00:00
Edgar Chen 363e80d673 Bug 1653949 - Part 1: Change mExitFrom in WidgetMouseEvent to be Maybe<ExitFrom>; r=smaug
mExitFrom now contains a value only when mMessage is eMouseExitFromWidget

Differential Revision: https://phabricator.services.mozilla.com/D88225
2020-08-26 14:19:46 +00:00
Botond Ballo 9be0302277 Bug 1661356 - Change nsLayoutUtils::ComputeScrollMetadata() to take a scrollport size instead of a scrollport rect. r=kats
No one meaningfully uses the scrollport rect's origin, so there's no
point in having callers compute it.

Differential Revision: https://phabricator.services.mozilla.com/D88337
2020-08-27 01:40:19 +00:00
Jonathan Kew 1dde07b021 Bug 1659259 - Don't reconstruct frames as a result of font-list refresh if we're in a printing or print-preview context. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D87177
2020-08-26 15:09:54 +00:00
Emilio Cobos Álvarez 72730e8e3d Bug 1636728 - Make calling window.print() before load keep deferring the actual printing and closing the window until load. r=smaug
Other engines also do this, but with my previous patch breaks it
(because we only hit print() on the print-content-viewer _after_ doing
the clone).

So move it before triggering all the machinery, and only for
window.print().  Given we didn't check this for print preview etc, I
think it's fine to carry on for user-triggered loads.

Trivial test-case (which I'm not quite sure how to turn into an
automated test...)

    <!doctype html>
    <h1>I do get printed but...</h1>

    <script>
      window.print();
    </script>

    <h2>Do I?</h2>

Note that this is broken with the new print preview UI already, this
fixes it.

Differential Revision: https://phabricator.services.mozilla.com/D87898
2020-08-25 17:45:24 +00:00
Emilio Cobos Álvarez 044b3c4332 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
This centralizes our print and preview setup in nsGlobalWindowOuter so
that we never re-clone a clone, and so that we reuse the window.open()
codepath to create the browsing context to clone into.

For window.print, for both old print dialog / silent printing and new
print preview UI, we now create a hidden browser (as in with visibility:
collapse, which takes no space but still gets a layout box).

 * In the modern UI case, this browser is swapped with the actual print
   preview clone, and the UI takes care of removing the browser.

 * In the print dialog / silent printing case, the printing code calls
   window.close() from nsDocumentViewer::OnDonePrinting().

 * We don't need to care about the old print preview UI for this case
   because it can't be open from window.print().

We need to fall back to an actual window when there's no
nsIBrowserDOMWindow around for WPT print tests and the like, which don't
have one. That seems fine, we could special-case this code path more if
needed but it doesn't seem worth it.

Differential Revision: https://phabricator.services.mozilla.com/D87063
2020-08-25 17:45:12 +00:00
Daniel Holbert e3a6a51032 Bug 1660502 part 1: Give nsIWebBrowserPrint a "rawNumPages" attribute. r=TYLin
This is backed by an existing nsPageSequenceFrame API, which this patch also
renames to use the word "Raw" for consistency across the full callstack.

Differential Revision: https://phabricator.services.mozilla.com/D87886
2020-08-24 23:53:11 +00:00
Stephen A Pohl 4c95e75c52 Bug 1656264: Adjust default font size for non-native theming. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D85415
2020-08-24 14:42:46 +00:00
Cosmin Sabou 7b214fd81a Backed out 6 changesets (bug 1518999) for geckoview failures on scrollToVerticalOnZoomedContentAuto.
Backed out changeset 10bf1552e301 (bug 1518999)
Backed out changeset e62cd63e3595 (bug 1518999)
Backed out changeset 1bf0b02bb0e0 (bug 1518999)
Backed out changeset 2203a9c52afa (bug 1518999)
Backed out changeset 10f07ca7a246 (bug 1518999)
Backed out changeset b90cf6b54c09 (bug 1518999)
2020-08-25 01:02:36 +03:00
Sean Feng 517cde9bae Bug 1518999 - Implement PerformancePaintTiming for FirstContentfulPaint r=smaug,mstange
Spec: https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming
We only support FirstContentfulPaint at the moment.

Differential Revision: https://phabricator.services.mozilla.com/D66463
2020-08-24 16:03:31 +00:00
Emilio Cobos Álvarez 6e52b0c1c7 Bug 1636728 - Request a longer timeout in test_printpreview.xhtml. r=jwatt
The first patch in this bug makes this test a bit more heavy-weight.

Instead of rendering the print-preview document in an iframe, and
snapshotting the 400x400 pixels in the top left corner, we open a window
and snapshot the whole print preview document.

I could keep it doing the same if needed by passing the docshell
argument to window.printPreview. But this test wasn't great to begin
with, and the changes in part 1 are a net improvement imo.

The bad part is that they cause the test to become slower such as it can
time out in some debug builds. Request a longer timeout because of this.

Differential Revision: https://phabricator.services.mozilla.com/D87966
2020-08-24 11:14:27 +00:00
Botond Ballo 3a5e8351c5 Bug 1659973 - Bring back FrameMetrics::mVisualViewportOffset (but call it mVisualDestination). r=kats
Differential Revision: https://phabricator.services.mozilla.com/D87941
2020-08-22 22:59:47 +00:00
Honza Bambas 2bc91fef35 Bug 1657974 - MOZ_LOG schedule and run of `FrameRequestCallback`, r=froydnj
Depends on D86740

Differential Revision: https://phabricator.services.mozilla.com/D86741
2020-08-13 14:41:16 +00:00
Honza Bambas 13026539fa Bug 1657960 - MOZ_LOG schedule and run of `mStyleFlushObservers` and `mLayoutFlushObservers`, r=froydnj
Depends on D86737

Differential Revision: https://phabricator.services.mozilla.com/D86738
2020-08-13 14:41:15 +00:00
Honza Bambas 8c06001afd Bug 1657941 - Log the first paint in `PresShell::Paint`, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D86737
2020-08-13 14:39:45 +00:00
Bob Owen 72fd7de5a6 Bug 1658299 Part 2: Add createDefaultSettings() to nsIPrinter for Windows. r=jwatt,jfkthame
This retrieves the same settings from the printer as
InitPrintSettingsFromPrinter.
There is probably a lot of scope for de-duplication of code here, but I decided
to try and protect the old fallback paths.

Depends on D87125

Differential Revision: https://phabricator.services.mozilla.com/D87604
2020-08-20 23:25:10 +00:00
Hiroyuki Ikezoe d19326f840 Bug 1660213 - Fixed an used variable error in nsDocumentViewer::GetCurrentSheetFrameAndPageNumber. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D87806
2020-08-20 22:02:54 +00:00
Erik Nordin 352e314767 Bug 1660285 - Improve Print Paper Size Test Assertions r=dholbert
This improves the paper assertions to check for attribute type, rather
than checking if the attribute is null, since undefined is not null and
can cause false positives.

Also updates the formatting to be congruent with other related tests.

Differential Revision: https://phabricator.services.mozilla.com/D87783
2020-08-20 17:52:20 +00:00
Emilio Cobos Álvarez 54b5a9f5f5 Bug 1659457 - Do clone xml-pretty-printer's UA widget. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D87714
2020-08-20 11:29:45 +00:00
Erik Nordin b81a2922ac Bug 1658299 - Part 1: Add createDefaultSettings() to nsIPrinter for CUPS r=jwatt,emilio,geckoview-reviewers,owlish
This patch adds a createDefaultSettings() method to nsIPrinter to
initialize a default print settings object specific to that printer.
It implements the functionality for Linux and macOS but adds only stubs
for Windows.

Differential Revision: https://phabricator.services.mozilla.com/D87125
2020-08-20 06:11:08 +00:00
Bogdan Tara 48d00fff60 Backed out changeset ebf8dfa204ea (bug 1658299) for test_printer_default_settings.html failures CLOSED TREE 2020-08-20 05:36:37 +03:00
Erik Nordin 851b8f7c70 Bug 1658299 - Part 1: Add createDefaultSettings() to nsIPrinter for CUPS r=jwatt,emilio,geckoview-reviewers,owlish
This patch adds a createDefaultSettings() method to nsIPrinter to
initialize a default print settings object specific to that printer.
It implements the functionality for Linux and macOS but adds only stubs
for Windows.

Differential Revision: https://phabricator.services.mozilla.com/D87125
2020-08-20 00:23:59 +00:00
Hiroyuki Ikezoe 50f539d050 Bug 1657550 - Rewrite nsDocumentViewer::PrintPreviewScrollToPage. r=emilio
This change consists of;

1) Use switch statement for the given PrintPreview Navigation type.
2) Simply iterate over the children of nsPageSequenceFrame for
   PRINTPREVIEW_GOTO_PAGENUM
3) Use GetCurrentSheetFrameAndPageNumber for PRINTPREVIEW_PREV_PAGE and
   PRINTPREVIEW_NEXT_PAGE so that it should now match
   printPreviewCurrentPageNumber
   (that means the edge case where the current scroll position is in
    the gap between pages has been fixed by this change)
4) Scroll to the position where the target frame is positioned at the center of
   the print preview scroll port in the cases of PRINTPREVIEW_PREV_PAGE,
   PRINTPREVIEW_NEXT_PAGE and PRINTPREVIEW_GOTO_PAGENUM

4) is a bit debatable but it can be now easily modified by changing
ComputeScrollPositionFrameAtCenter later if it turns out the current way is not
reasonable.

Differential Revision: https://phabricator.services.mozilla.com/D87548
2020-08-19 22:50:54 +00:00
Hiroyuki Ikezoe 1f301a0a87 Bug 1657550 - Make GetCurrentPageNumberInPrintPreview return the current sheet frame along with the current page. r=emilio
We need the current sheet frame for PRINTPREVIEW_NEXT_PAGE and
PRINTPREVIEW_PREV_PAGE cases.

Differential Revision: https://phabricator.services.mozilla.com/D87547
2020-08-19 22:50:39 +00:00
Hiroyuki Ikezoe 692b6393c2 Bug 1657550 - Factor out the function to get the current page number in the print preview. r=emilio
We have to use the logic in the function for
nsDocumentViewer::PrintPreviewScrollToPage in subsequent changes.

Differential Revision: https://phabricator.services.mozilla.com/D87546
2020-08-19 22:50:29 +00:00
Hiroyuki Ikezoe ce091f13c6 Bug 1657550 - Preserve x-axis scroll position on printPreviewScrollToPage call in any cases. r=emilio
That's what we've done for PRINTPREVIEW_PREV_PAGE, PRINTPREVIEW_NEXT_PAGE
and PRINTPREVIEW_GOTO_PAGENUM.

Differential Revision: https://phabricator.services.mozilla.com/D87545
2020-08-19 22:50:15 +00:00
Hiroyuki Ikezoe 8c4b16591d Bug 1657550 - Use `scrollTopMax` position for PRINTPREVIEW_END. r=emilio
I suppose PRINTPREVIEW_END doesn't mean the last page.

Differential Revision: https://phabricator.services.mozilla.com/D87544
2020-08-19 22:50:05 +00:00
Hiroyuki Ikezoe 3a5eb8feb0 Bug 1657550 - Copy nsDocumentViewer::PrintPreviewScrollToPage for the old print preview UI. r=emilio
So that we can keep using the logic in the old print preview UI.

For the new print preview UI, the original PrintPreviewScrollToPage will be
modified gradually in subsequent changes.

Differential Revision: https://phabricator.services.mozilla.com/D87543
2020-08-19 22:51:07 +00:00
Jamie Nicol 54ed855193 Bug 1647797 - Add GeckoView API to listen for when contentful paint status has been reset. r=geckoview-reviewers,agi,esawin
Android-components listens to the GeckoView callback onFirstContentfulPaint to
track whether a contentful paint has occured, in order to decide when to
thumbnail a tab. Currently this gets fired once per tab.

However, when the GeckoSession is paused, we clear cached resources in the
compositor. This means that when the session is resumed, the compositor does not
have the necessary information to render the page (such as painted content
buffers, or the webrender display list). Because android-components attempts to
capture a new thumbnail immediately upon resuming, it ends up capturing a blank
thumbnail.

To fix this, add a new callback onPaintStatusReset() which is invoked when the
cached resources are cleared. Android-components can listen for this to be
informed when the contentful paint is no longer visible. It can then wait until
the subsequent contentful paint occurs before capturing the thumbnail.

Differential Revision: https://phabricator.services.mozilla.com/D87341
2020-08-19 15:24:14 +00:00
Emilio Cobos Álvarez 7c7897149c Bug 1414600 - Make media queries and viewport units in print be evaluated against the default page size minus margins. r=dholbert,nordzilla
For that, move the default page margin computation to nsPresContext.

See https://github.com/w3c/csswg-drafts/issues/5437 as to why doing this
and other alternatives.

Differential Revision: https://phabricator.services.mozilla.com/D87311
2020-08-19 10:32:16 +00:00
Csoregi Natalia 9af7b6fe90 Backed out changeset b6d1532f6cd4 (bug 1414600) for failures on mq_print_height.xhtml . CLOSED TREE 2020-08-19 04:58:49 +03:00
Botond Ballo eff3b083d0 Bug 1659642 - Split out a new file APZPublicUtils.h from APZUtils.h. r=kats
By moving the few things that need to be exposed to other components
to APZPublicUtils.h, APZUtils.h becomes much less widely included
(and thus changing it triggers a quicker recompile) while retaining
most of its utilities.

Differential Revision: https://phabricator.services.mozilla.com/D87404
2020-08-19 00:51:46 +00:00
Emilio Cobos Álvarez ae622cd8cd Bug 1414600 - Make media queries and viewport units in print be evaluated against the default page size minus margins. r=dholbert,nordzilla
For that, move the default page margin computation to nsPresContext.

See https://github.com/w3c/csswg-drafts/issues/5437 as to why doing this
and other alternatives.

Differential Revision: https://phabricator.services.mozilla.com/D87311
2020-08-19 00:02:34 +00:00
Csoregi Natalia c1ed2ba64f Backed out 6 changesets (bug 1518999) for marionette failures on test_refresh_firefox.py. CLOSED TREE
Backed out changeset eb8e5411868e (bug 1518999)
Backed out changeset 0924e0169dcb (bug 1518999)
Backed out changeset b7de245b329c (bug 1518999)
Backed out changeset f2a6a3797ef1 (bug 1518999)
Backed out changeset 123403a14312 (bug 1518999)
Backed out changeset 1968b8ca14d7 (bug 1518999)
2020-08-18 23:53:26 +03:00
Sean Feng d914187ce2 Bug 1518999 - Implement PerformancePaintTiming for FirstContentfulPaint r=smaug,mstange
Spec: https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming
We only support FirstContentfulPaint at the moment.

Differential Revision: https://phabricator.services.mozilla.com/D66463
2020-08-06 16:13:44 +00:00
Botond Ballo d0d6c1480e Bug 1519285 - Remove FrameMetrics::mVisualViewportOffset. r=kats
It is now redundant with mScrollOffset which always stores the
visual scroll offset.

Differential Revision: https://phabricator.services.mozilla.com/D87162
2020-08-18 05:12:37 +00:00
Botond Ballo aa190d473c Bug 1519285 - Populate the (main thread's view of the) visual scroll offset in ComputeScrollMetadata(). r=kats
Differential Revision: https://phabricator.services.mozilla.com/D87160
2020-08-18 04:13:01 +00:00
Botond Ballo a4ecb96c87 Bug 1519285 - Replace most calls to FrameMetrics::{Get,Set}ScrollOffset() with calls to the more specific visual or layout accessors. r=kats
Likewise for RepaintRequest, and direct usages of mScrollOffset
inside FrameMetrics.

The general idea is:

 * APZ's copy of the FrameMetrics stores the visual scroll offset,
   so calls to GetScrollOffset() on it are replaced with
   GetVisualScrollOffset()

 * The layer tree's copy of the frame metrics (and copies derived
   from that like mLastContentPaintMetrics) currently stores the
   layout scroll offset, so calls to GetScrollOffset() on those
   are replaced with GetLayoutScrollOffset().

The latter changes are particularly important, as they enable us
to modify the layer tree's copy to store (a main thread snapshot
of) the visual offset in mScrollOffset in a future patch.

This patch intends no functional changes. In the cases where we
change GetScrollOffset() to GetLayoutScrollOffset(), mScrollOffset
and mLayoutViewport.TopLeft() should already be storing the same
thing.

The patch identifies a few usages as suspicious but leaves them
functionally unchanged for now.

A few problematic usages of GetScrollOffset() remain, which will
require other fixes to remove.

Differential Revision: https://phabricator.services.mozilla.com/D87159
2020-08-18 05:11:23 +00:00
Botond Ballo 6ec4a23dd3 Bug 1519285 - Populate both scroll offsets in CalculateBasicFrameMetrics(). r=kats
Take advantage of them in CalculateRectToZoomTo(), where we also fix
a previously-incorrect usage.

Differential Revision: https://phabricator.services.mozilla.com/D87156
2020-08-18 04:55:46 +00:00
Jonathan Watt 970f8373d2 Bug 1659489. Rename nsPrintJob's mIsDoingPrintPreview to mCreatedForPrintPreview. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D87296
2020-08-17 21:27:00 +00:00
Emilio Cobos Álvarez fb68681896 Bug 1659432 - Don't reuse the existing print job when restarting print preview. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D87417
2020-08-18 12:03:38 +00:00
Daniel Holbert 1cc2b45cc6 Bug 1658173 part 1: Increase the height of the print-preview viewport in automated test. r=emilio
This hange ensures that the upper-left corner of this test's print-preview
area continues to show the previewed sheet (rather than the uninteresting gray
print preview background color).

Without this test change, the next patch in this series would cause this test's
print-previewed-sheet to be scaled down vertically (and shifted over
horizontally); and the shift is sizeable enough to push the sheet "out of
frame" of the relatively-small area that this test snapshots when doing
screenshot comparisons.  We obviously don't want that to happen; that would
nerf this test's screenshot-equality comparisons, and it would also cause this
test's screenshot-not-equal comparisons to start failing.

As noted in the included code-comment in the test: we can probably revert this
change once we've fixed this test to make it compare a larger area of the
print-preview rendering, in bug 1602410.

Differential Revision: https://phabricator.services.mozilla.com/D87317
2020-08-17 21:08:29 +00:00
Hiroyuki Ikezoe 1bfd4639dc Bug 1657763 - Choose the closest page to the center of the scroll port as the "current" page. r=emilio
Unfortunately there is no particular way to write automated tests without
exposing a bunch of metrics in the print preview window, such as each
PrintedSheetFrame height, the gap length between the sheets, print preview
scale, the scroll port rect, the current scroll position, etc. etc. So I just
tested this change with the frontend change to show the current page number
there by :mstriemer. [1]

[1] https://phabricator.services.mozilla.com/D86427

Differential Revision: https://phabricator.services.mozilla.com/D87203
2020-08-17 20:54:06 +00:00
Boris Chiou 5b6832c5f3 Bug 1639963 - Define the default size for replaced elements. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D81006
2020-08-17 07:10:39 +00:00
longsonr 09a2a0f739 Bug 1658455 - Remove eANIMATION and eFILTER from IsNodeOfType r=dholbert
- eANIMATION is the same as testing for SVGAnimationElement
- eFILTER is the same as testing for SVGFE

Differential Revision: https://phabricator.services.mozilla.com/D86695
2020-08-15 10:38:17 +00:00
Ting-Yu Lin 3489d995ee Bug 1597462 - Register observers for AccessibelCaretEventhub only on current docshell. r=hiro
This effectively reverts Bug 1441279 Part 6.
https://hg.mozilla.org/mozilla-central/rev/eab2985673a5

The original patch's extend commit message describes that if a
AccessibleCaretEventHub registers scroll and reflow observers only on the leaf
docshell, it fails to update caret position when an ancestor iframe is
scrolled.

I think the above statement is incorrect. When scrolling an ancestor
iframe, the visible caret in an inner iframe should scroll with other
elements by virtue of APZ. Also, `AccessibleCaret::SetPosition()` itself
detects whether its position is changed relative to the top level
absolute position container (the moz-custom-content-container under
CanvasFrame). When scrolling an ancestor iframe, AccessibleCaret's
position in the inner iframe should remain static (relative to the inner
frame.)

Differential Revision: https://phabricator.services.mozilla.com/D84873
2020-08-14 23:30:55 +00:00
Timothy Nikkel 89a79d6e8e Bug 1619186 - Apply the layout-to-visual transform when querying text/caret rects. r=masayuki,botond
Differential Revision: https://phabricator.services.mozilla.com/D86983
2020-08-15 00:43:51 +00:00
Emilio Cobos Álvarez 4af1306128 Bug 1658469 - Don't clone UA widgets for printing. r=smaug
We run the widget initialization code regardless on bind, and some of it
doesn't deal with shadow roots being already populated.

Differential Revision: https://phabricator.services.mozilla.com/D86952
2020-08-14 16:27:49 +00:00
Csoregi Natalia bd22249ff0 Backed out 2 changesets (bug 1658469) for assertion failures on nsVideoFrame.cpp. CLOSED TREE
Backed out changeset 08a78618c76c (bug 1658469)
Backed out changeset 5c8a07fc83ed (bug 1658469)
2020-08-13 21:13:08 +03:00
Emilio Cobos Álvarez 5576f7d53c Bug 1658469 - Fix new test so that we actually load the second page.
MANUAL PUSH: Fix orange on a CLOSED TREE
2020-08-13 17:43:26 +02:00
Emilio Cobos Álvarez 6368b296b2 Bug 1658469 - When cloning a shadow root for printing, also copy the UA-widget-ness. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D86952
2020-08-13 13:06:38 +00:00
Emilio Cobos Álvarez 68dd457e8b Bug 1658903 - Remove nsPrintJob::TurnScriptingOn. r=jwatt
This code was there to prevent stuff like bug 424377, but nowadays clone
documents are data documents to begin with, so they can't load scripts.

Differential Revision: https://phabricator.services.mozilla.com/D86948
2020-08-13 12:22:56 +00:00
Emilio Cobos Álvarez ce8137da72 Bug 1657991 - Don't bail out on some printpreview tests if there are no printers. r=jwatt
Before bug 1657164 there was always some printer on Linux and this test
ran just fine.

We don't really need a printer to test print preview, the test works
just fine.

I noticed this while auditing the "lastPrinterName" checks.

Differential Revision: https://phabricator.services.mozilla.com/D86404
2020-08-13 11:57:36 +00:00
Emilio Cobos Álvarez 2b6c7db4e8 Bug 1657363 - Make nsIPrinterList.printers return a promise. r=jwatt
I intentionally removed the "move the default printer to the front" in
windows because that's not a guarantee that we provide in CUPS, but lmk
if you want it back.

I have zero idea about why the GlobalPrinters code was so ridiculously
complex.

Depends on D86396

Differential Revision: https://phabricator.services.mozilla.com/D86397
2020-08-09 22:05:57 +00:00
Kartikaya Gupta b242b603bc Bug 1657995 - Rename UpdateViewportOverridden to a more appropriate name. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D86491
2020-08-09 21:40:56 +00:00
Kartikaya Gupta 6a68ea3e31 Bug 1657995 - Remove GetIsViewportOverridden. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D86438
2020-08-09 20:28:49 +00:00
Timothy Nikkel 2de46c6ff5 Bug 1656802. Make visual viewport only layout scrollbars affect the composition bounds/visual viewport. r=emilio,kats
AFAICT the spec says that these layout scrollbars that take up no layout space that scroll the visual viewport do affect the size of the visual viewport. (Double check this)

Most other users don't care about the size of these special scrollbars.

I left nsIDOMWindowUtils::getScrollbarSize unchanged (NB different from nsIDOMWindowUtils::getScrollbarSizes which is modified by this patch) because I'm less sure. I will file a followup about it.

Differential Revision: https://phabricator.services.mozilla.com/D85708
2020-08-07 11:40:52 +00:00
Ting-Yu Lin 547520683e Bug 1042151 Part 4 - Consider flexbox's main & cross axis when getting scrolled rect. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86078
2020-08-07 19:11:38 +00:00
Ting-Yu Lin b040f29dc0 Bug 1042151 Part 2 - Refactor the conditions that decide which edge to clamp when getting scrolled rect. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86076
2020-08-07 02:20:44 +00:00
Ting-Yu Lin 04e997fc43 Bug 1042151 Part 1 - Sort the #include statements in nsLayoutUtils.cpp. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86075
2020-08-07 02:20:42 +00:00
Kartikaya Gupta 6d0fac60b9 Bug 1658046 - Fix missing return statement. r=tnikkel,botond
Differential Revision: https://phabricator.services.mozilla.com/D86439
2020-08-07 21:02:28 +00:00
Bogdan Tara 06a9a6d13f Backed out 11 changesets (bug 1656802) for async-scrolling reftests failures CLOSED TREE
Backed out changeset 941ee8aa9735 (bug 1656802)
Backed out changeset c5b1b38d1d35 (bug 1656802)
Backed out changeset fe2dd5de83ef (bug 1656802)
Backed out changeset 8e217fc1c6d4 (bug 1656802)
Backed out changeset 21f574f6acb4 (bug 1656802)
Backed out changeset 753f93dffe07 (bug 1656802)
Backed out changeset 386554110008 (bug 1656802)
Backed out changeset 2d3576ace2f1 (bug 1656802)
Backed out changeset 06a47c35c531 (bug 1656802)
Backed out changeset 57fa48542435 (bug 1656802)
Backed out changeset b1517bc33eff (bug 1656802)
2020-08-07 14:36:21 +03:00
Timothy Nikkel 2f60aa099a Bug 1656802. Make visual viewport only layout scrollbars affect the composition bounds/visual viewport. r=emilio,kats
AFAICT the spec says that these layout scrollbars that take up no layout space that scroll the visual viewport do affect the size of the visual viewport. (Double check this)

Most other users don't care about the size of these special scrollbars.

I left nsIDOMWindowUtils::getScrollbarSize unchanged (NB different from nsIDOMWindowUtils::getScrollbarSizes which is modified by this patch) because I'm less sure. I will file a followup about it.

Differential Revision: https://phabricator.services.mozilla.com/D85708
2020-08-07 10:05:10 +00:00
Simon Giesecke 1e02318b49 Bug 1653335 - Replace MakeSpan uses by constructor calls. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83817
2020-08-07 07:49:47 +00:00
Mihai Alexandru Michis da15ff7259 Bug 1657515 - Fix bustages regarding nsDocumentViewer.cpp and 'pageCount'. a=bustage-fix
CLOSED TREE
2020-08-07 07:37:28 +03:00
Brindusan Cristian 41ea5830c7 Backed out 5 changesets (bug 1042151) for causing wpt failures in negative-overflow.html. CLOSED TREE
Backed out changeset a9a3507991fa (bug 1042151)
Backed out changeset 14e34cd9dfd8 (bug 1042151)
Backed out changeset bf4991db4445 (bug 1042151)
Backed out changeset ad498cd179b9 (bug 1042151)
Backed out changeset 1eac44fb3f6f (bug 1042151)
2020-08-07 05:16:01 +03:00
Ting-Yu Lin b5b96a98d8 Bug 1042151 Part 4 - Consider flexbox's main & cross axis when getting scrolled rect. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86078
2020-08-06 22:38:11 +00:00
Ting-Yu Lin 80e5b54e12 Bug 1042151 Part 2 - Refactor the conditions that decide which edge to clamp when getting scrolled rect. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86076
2020-08-06 22:38:00 +00:00
Ting-Yu Lin 3a3615c34f Bug 1042151 Part 1 - Sort the #include statements in nsLayoutUtils.cpp. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D86075
2020-08-06 22:37:53 +00:00
Emma Malysz 18fe337c0c Bug 1657161, enable print.tab_modal.enabled for EARLY_BETA_OR_EARLIER and hide page range section r=mstriemer,fluent-reviewers,preferences-reviewers,flod
We want this to be turned on for nightly users by default. The page range is still a WIP,
so we should hide that section for now.
This also adds the pref to the "Nightly Experiment" panel, turned on by default.

Differential Revision: https://phabricator.services.mozilla.com/D85907
2020-08-06 23:02:13 +00:00
Hiroyuki Ikezoe 3d007edf96 Bug 1657515 - Add nsIWebBrowserPrint.printPreviewCurrentPageNumber. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D86151
2020-08-06 22:54:16 +00:00
Hiroyuki Ikezoe 103cf5ff04 Bug 1657515 - Constify some nsIDocumentViewerPrint methods. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D86149
2020-08-06 22:54:16 +00:00
Hiroyuki Ikezoe 163ef31b74 Bug 1657515 - Rename `pageFrame` to `sheetFrame` in PrintPreviewScrollToPage. r=TYLin
Since bug 1652278, it's not a page frame.

Differential Revision: https://phabricator.services.mozilla.com/D86148
2020-08-06 22:57:24 +00:00
Hiroyuki Ikezoe 39c56580df Bug 1657515 - Rename `pt` to `currentScrollPosition` in PrintPreviewScrollToPage. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D86147
2020-08-06 22:22:56 +00:00
Edgar Chen 47b2d8fc3f Bug 1597463 - Audit usage of nsIDocShellTreeItem in PresShell::GetParentPresShellForEventHandling; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D84694
2020-08-05 01:50:21 +00:00
Hiroyuki Ikezoe e6c0d31860 Bug 1657535 - Rename runTest18 to runTest19 to run runTest18 properly in printpreview_helper.xhtml. r=emilio
There are two runTest18 functions. :)

Differential Revision: https://phabricator.services.mozilla.com/D86134
2020-08-06 07:59:17 +00:00
Emilio Cobos Álvarez bdca8af91d Bug 1655558 - Retrieve the paper margins lazily on Windows. r=jwatt,bobowen
This is no worse than what we were doing.

In the future, instead of just querying the margin we may want to query
extra information that requires a DC in windows too or what not, for
example.

Differential Revision: https://phabricator.services.mozilla.com/D85919
2020-08-05 11:26:13 +00:00
Emilio Cobos Álvarez 6d5ce8f732 Bug 1655558 - Retrieve paper information from CUPS, and convert paperList to an async attribute. r=jwatt
This builds on top of bug 1656146 to compute the page information on a
background task, and return it via a promise.

Co-Authored-By: Erik Nordin <enordin@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D85865
2020-08-05 01:24:49 +00:00
Simon Giesecke 1e6ec7ec86 Bug 1656117 - Reduce include dependencies on nsRefreshDriver.h. r=mstange
The abstract observer base classes are moved to a separate header file
nsRefreshObservers.h and the includes are adjusted accordingly.

Some method implementations are moved to the corresponding implementation files
to avoid the need to include the nsRefreshDriver.h file in the header.

Differential Revision: https://phabricator.services.mozilla.com/D85764
2020-08-04 21:17:50 +00:00
Daniel Holbert 96d67c6eb3 Bug 1652278 part 2: Flesh out PrintedSheetFrame implementation so that it serves as the container for nsPageFrame. r=TYLin
This patch:
- Creates an anon-box pseudo-style for PrintedSheetFrame, in part so that it
  can co-opt the styles that we formerly gave to page-frames in ua.css, to draw
  the sheet of paper and the shadow in Print Preview.
- Adjusts nsCSSFrameConstructor to create a PrintedSheetFrame as the parent of
  nsPageFrame (inserting between it and its nsPageSequenceFrame container, in
  the frame tree).
- Fleshes out out a simple BuildDisplayList() implementation for
  PrintedSheetFrame (taking the responsibility for "paper"-drawing from
  nsPageFrame).
- Fleshes out a simple Reflow implementation for PrintedSheetFrame, just
  placing the child page (assuming there's only one for now) at the origin.
- Adjusts nsPageFrame and nsPageSequenceFrame to account for the fact that
  there's another layer between them now.

Note that PrintedSheetFrame needs to implement AppendDirectlyOwnedAnonBoxes()
(just as nsSimplePageSequence and nsPageFrame do), since it owns anonymous
nsPageFrame instances. This implementation only needs to append the first
child, as explained in the code-comment and in
https://bugzilla.mozilla.org/show_bug.cgi?id=1374761#c9 (and of course, for
now, PrintedSheetFrame only has one child at a time anyway.)

Differential Revision: https://phabricator.services.mozilla.com/D83457
2020-08-05 03:28:32 +00:00
Kashav Madan 0944a1d57c Bug 1655521 - Remove unnecessary code from nsDocumentViewer::ExitPrintPreview, r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D85343
2020-08-04 16:41:52 +00:00
Emilio Cobos Álvarez a4066afce1 Bug 1656146 - Introduce nsPrinterBase, and add facilities for async attributes queried in a background thread. r=heycam
While at it, properly CC the printer classes, as they're going to hold
promises and it's very easy to introduce leaks otherwise.

Co-Authored-By: Jonathan Watt <jwatt@jwatt.org>

Differential Revision: https://phabricator.services.mozilla.com/D85791
2020-08-04 12:06:37 +00:00
Simon Giesecke 96f3e7e019 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-04 11:27:07 +00:00
Bob Owen c4f92dc077 Bug 1653334 part 1: Remove unused isRangeSelection and isIFrameSelected. r=jwatt
These unused members are removed from nsIWebBrowserPrint and PPrintingTypes
along with their supporting functions.

Differential Revision: https://phabricator.services.mozilla.com/D85007
2020-08-03 14:23:27 +00:00
Brindusan Cristian 858434b58d Backed out changeset 5913d9f4c3e9 (bug 1655558) for build bustages at nsPaperCUPS.h:9:10. CLOSED TREE 2020-08-04 08:41:27 +03:00
Erik Nordin be6e7c626c Bug 1655558 - Part 1 Retrieve Paper Information from CUPS on macOS r=jwatt
Retrieve paper size information directy from CUPS.

- Add unwriteable margins tests.
- Rename nsPaper to nsPaperCUPS.
- Add new functionality to nsCUPSShim.
- Retrieve paper info from CUPS

Differential Revision: https://phabricator.services.mozilla.com/D85211
2020-08-04 04:43:47 +00:00
Noemi Erli 381fca9783 Backed out 4 changesets (bug 1654992, bug 1654991) for causing timeous in mask-opacity-1e.html
Backed out changeset 11f0f54c6e0a (bug 1654992)
Backed out changeset a353dd5b3f08 (bug 1654991)
Backed out changeset 6a7964ba549f (bug 1654991)
Backed out changeset cf3bfb91d98c (bug 1654991)
2020-08-03 22:09:36 +03:00
Simon Giesecke 032d2ac9d3 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-03 14:54:18 +00:00
Bob Owen 57c231d365 Bug 1651117 part 1: Add nsIPrinter supportsColor attribute and Windows implementation. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D85032
2020-08-03 11:45:35 +00:00
Butkovits Atila 076d3aa7ed Backed out 2 changesets (bug 1653334) for reftest failures at test-print-selection.html. CLOSED TREE
Backed out changeset 6cc6bbaa91f0 (bug 1653334)
Backed out changeset 75a5873f02a4 (bug 1653334)
2020-08-03 15:35:37 +03:00
Bob Owen d5715ceb42 Bug 1653334 part 1: Remove unused isRangeSelection and isIFrameSelected. r=jwatt
These unused members are removed from nsIWebBrowserPrint and PPrintingTypes
along with their supporting functions.

Differential Revision: https://phabricator.services.mozilla.com/D85007
2020-08-03 08:53:44 +00:00
Sylvestre Ledru 843f943758 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D85678
2020-08-02 15:29:15 +00:00
Emilio Cobos Álvarez 4f644719ae Bug 1436758 - Make color-adjust: exact not darken foreground colors. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D85660
2020-08-02 08:45:29 +00:00
Mats Palmgren 910e11aa99 Bug 1531609 part 2 - Implement overflow:clip/visible combinations. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73717
2020-08-01 01:57:41 +00:00
Jeremy Ir 20235b390f Bug 1531609 part 1 - Rename overflow:-moz-hidden-unscrollable to overflow:clip. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73716
2020-08-01 01:56:58 +00:00
Mats Palmgren 21b713c1f1 Bug 1635473 - [css-overflow] Make viewport propagation for 'overflow:-moz-hidden-unscrollable' compatible with the spec for 'clip'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D84171
2020-08-01 02:00:23 +00:00
Markus Stange cbf4ac0e8a Bug 1656331 - Create a TickReasons bitfield and add the tick reasons to the RefreshDriverTick profiler marker. r=smaug
Example profile: https://share.firefox.dev/2P7QpqL

Differential Revision: https://phabricator.services.mozilla.com/D85458
2020-07-31 23:06:10 +00:00
Markus Stange 7f8346ef73 Bug 1656331 - Capture a cause callstack in EnsureTimerStarted() and insert the RefreshDriverTick marker in a different place. r=smaug
We can have markers with empty cause stacks, if we keep the timer running
without calling EnsureTimerStarted() again.

Differential Revision: https://phabricator.services.mozilla.com/D85457
2020-07-31 23:04:54 +00:00
Markus Stange 34b668de52 Bug 1656331 - Factor out nsRefreshDriver::HasReasonToTick() and ShouldKeepTimerRunningWhileWaitingForFirstContentfulPaint(). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D85456
2020-07-31 23:04:30 +00:00
Chris Liu 89c666046b Bug 1494838 - Add a profiler marker with a cause stack for paints (view manager flushes). r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D85455
2020-08-01 00:55:57 +00:00
Butkovits Atila cc95b93cba Backed out 3 changesets (bug 1635473, bug 1531609) for reftest failures. CLOSED TREE
Backed out changeset 1e7b32808be8 (bug 1531609)
Backed out changeset e64a61869cdb (bug 1531609)
Backed out changeset 6da37d7f6dd3 (bug 1635473)
2020-07-31 23:56:54 +03:00
Chris Martin 552aa91269 Bug 1652561 - Remote Win32k calls in nsLookAndFeel::GetFontImpl() r=emilio,geckoview-reviewers,agi,froydnj
Content processes will now receive cached values for GetFontImpl() from the
parent process during initialization and whenever the theme changes.

This eliminates the use of several Win32k calls in content.

Differential Revision: https://phabricator.services.mozilla.com/D83406
2020-07-31 16:21:44 +00:00
Mats Palmgren c875610606 Bug 1531609 part 2 - Implement overflow:clip/visible combinations. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73717
2020-07-31 15:31:36 +00:00
Jeremy Ir 92b8f0f77a Bug 1531609 part 1 - Rename overflow:-moz-hidden-unscrollable to overflow:clip. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D73716
2020-07-31 16:40:48 +00:00
Mats Palmgren 043846d390 Bug 1635473 - [css-overflow] Make viewport propagation for 'overflow:-moz-hidden-unscrollable' compatible with the spec for 'clip'. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D84171
2020-07-31 16:40:48 +00:00
Dorel Luca fe3518a094 Backed out changeset 8045dfbc21b9 (bug 1651117) for OXS Build bustage. CLOSED TREE 2020-07-31 19:39:50 +03:00
Bob Owen ef8374ad93 Bug 1651117 part 1: Add nsIPrinter supportsColor attribute and Windows implementation. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D85032
2020-07-31 15:32:15 +00:00
Stephen A Pohl 09651af1bd Bug 1640195: Address UX feedback for non-native widget styling. r=geckoview-reviewers,emilio,agi
Differential Revision: https://phabricator.services.mozilla.com/D76509
2020-07-30 17:02:02 +00:00
Noemi Erli 4d01914553 Backed out changeset 4fbc6775e743 (bug 1640195) for causing multiple failures CLOSED TREE 2020-07-30 02:58:03 +03:00
Stephen A Pohl 597bb7d3e0 Bug 1640195: Address UX feedback for non-native widget styling. r=geckoview-reviewers,emilio,agi
Differential Revision: https://phabricator.services.mozilla.com/D76509
2020-07-29 22:16:06 +00:00
Emilio Cobos Álvarez 3250836323 Bug 1654489 - Properly guard against huge default margins in nsPageFrame::Reflow. r=jfkthame
We were already guarding against huge @page { margins } and so on, but
not about huge default margins.

Differential Revision: https://phabricator.services.mozilla.com/D85273
2020-07-29 19:14:19 +00:00
Jonathan Kew cb36b1b7de Bug 1654594 - Remove unused #include from ScrollStyles.cpp. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D84550
2020-07-22 17:17:50 +00:00
Jonathan Kew c724ed21c3 Bug 1654576 - Reorder data members in nsPresContext for more efficient packing. r=emilio
This reduces sizeof(nsPresContext) in my (opt) build on macOS from 568 to 544 bytes.

Depends on D84541

Differential Revision: https://phabricator.services.mozilla.com/D84542
2020-07-23 02:27:56 +00:00
Jonathan Kew 01100e3c09 Bug 1654575 - Remove unused field nsPresContext::mExistThrottledUpdates. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D84541
2020-07-23 17:28:27 +00:00
Jonathan Kew 4e8b62706e Bug 1647573 - On font-list reinitialization, reconstruct frames rather than just restyling. r=jwatt
As a bonus, this also fixes a pre-existing bug that we never cleared the
mPrefChangePendingNeedsReflow flag after using it, so future pref changes
that shouldn't need a reflow would still trigger one.

Depends on D84518

Differential Revision: https://phabricator.services.mozilla.com/D84519
2020-07-24 21:10:09 +00:00
Tim Nguyen f4e86cd6e4 Bug 558594 - Implement layout for <input type='search'>. r=emilio,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D56302
2020-07-27 12:09:40 +00:00
Bob Owen e6aa1ea2a2 Bug 1651115 part 1: Add nsIPrinter supportsDuplex attribute and Windows implementation. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D84786
2020-07-24 18:02:22 +00:00
Cameron McCormack 5a44fc3b55 Bug 1654925 - Make FindNearestCommonAncestorFrameWithinBlock handle bad frame trees without crashing. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D84768
2020-07-24 22:43:36 +00:00
Nicolas Silva 6647720701 Bug 1653615 - Ensure displayport snapping doesn't move by more than the margin. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D84552
2020-07-24 07:09:47 +00:00
Philipp Zech 3d4be168ae Bug 1648938 - Convert writing-modes #defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D84016
2020-07-23 21:31:23 +00:00
Olli Pettay 1b3d2a37fb Bug 1647229 - Synchronize layouthistorystate to parent process, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D81753
2020-07-23 19:35:29 +00:00
tkhan e778811453 Bug 1653400 - Add xorigin and fission annotations, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D84006
2020-07-23 18:05:05 +00:00
Emilio Cobos Álvarez ff61891772 Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Timothy Nikkel 227f22acef Bug 1651332. Use purely relative scroll offset updates for many scrollbar initiated scrolls. r=kats
This patch basically attempts to make clicking in the scrollbar track outside of the scrollthumb "work". Clicking in the scrollbar track usually does a page scroll via nsSliderFrame::PageScroll. This eventually ends up in ScrollFrameHelper::ScrollBy where we turn the request from a relative one ("scroll by a page") into an absolute one ("scroll to this position").

This page scroll is typically a smooth scroll and is currently done on the main thread/layout side. Once we start scrolling the visual viewport offset with the scrollbars we can no longer do this purely on the layout side, we at least need the help of the compositor side. I think the simplest way to do this is to hand the scroll request off to the compositor and have it handle the whole thing.

Now we need to consider the following situation: user clicks scrollbar track to page scroll, smooth scroll gets partway complete on the compositor, user clicks again on scrollbar track for a further page scroll. The main thread can't send an absolute scroll offset update request to the compositor at this point because it has outdated information (it needs a 'starting position' to add the page scroll offset amount) so it'll end up scrolling to the wrong place. It has to send a relative scroll offset update.

We already have a mechanism to send relative scroll offset updates. It is implemented by sending a base scroll offset and the desired scroll offset, and then on the compositor send the difference between those two is computed and then added to the scroll offset.

This patch creates a new mechanism (so called "pure relative") that just sends a relative offset update without any absolute scroll positions. The reason I did this is because the existing relative scroll offset update mechanism is not aware of visual viewport offsets, but rather only layout scroll position. For example, here

https://searchfox.org/mozilla-central/rev/8d55e18875b89cdf2a22a7cba60dc40999c18356/layout/generic/nsGfxScrollFrame.h#446

the value we use for the base scroll offset (mApzScrollPos) is set to the layout scroll position. It may be entirely reasonable to make this existing mechanism vv offset aware, but I wanted to implement something to get it working with a smaller chance of regressions to things that already exist and work. Ideally these two mechanims would be merged.

Differential Revision: https://phabricator.services.mozilla.com/D82688
2020-07-19 14:56:24 +00:00
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
Emilio Cobos Álvarez 5f16e77dfd Bug 1650719 - Don't lose the rect offset from the composition bounds. r=kats
This offset was reset in one of the two codepaths of D80723, but turns
out it's important for same-origin documents that are also
root-content-documents, like about: pages in the parent process, which
happened to hit the codepath that did _not_ reset it. :(

Differential Revision: https://phabricator.services.mozilla.com/D84584
2020-07-22 22:02:35 +00:00
Emilio Cobos Álvarez f197b3c60e Bug 1648064 - Disable the URL in the header in printpreview_helper. r=nordzilla
It seems win7 sometimes displaces it slightly. We've hit this in the
past and it's not the point of the test so just get rid of it.

Differential Revision: https://phabricator.services.mozilla.com/D84597
2020-07-22 20:30:23 +00:00
Emilio Cobos Álvarez 8db5de01c5 Bug 1648064 - Allow for some fuzziness in the tests. r=jwatt
Before my patches the background images in table-background-print didn't
seem to load on time.

I tried to make the images* tests non-fuzzy, but the <svg:image> really
ruined the deal. A bit of a shame that they fall into a subpixel
boundary because of page margins. So allow a bit of fuzz there rather
than spending another few days trying :)

Differential Revision: https://phabricator.services.mozilla.com/D84516
2020-07-22 20:30:23 +00:00
Emilio Cobos Álvarez ae92038d84 Bug 1648064 - Make service workers of the original document intercept the static document's requests. r=smaug,asuth
We need to set the original document ASAP so images triggered from the
clone use the right service worker.

It is a bit unfortunate to have the static document checks twice, but we
may get to Document::GetClientInfo before the cloned doc has a window,
so it's not 100% clear to me how we could avoid it.

Differential Revision: https://phabricator.services.mozilla.com/D82081
2020-07-22 20:29:41 +00:00
Emilio Cobos Álvarez a1687ac170 Bug 1648064 - Make print preview documents wait properly for the document to be loaded. r=smaug
Otherwise my test fails intermittently on CI. We need to block on all
the load blockers because stuff like responsive images doesn't fire the
load directly but they do that as a micro task (blocking the load
event).

Differential Revision: https://phabricator.services.mozilla.com/D81989
2020-07-22 20:29:16 +00:00
Emilio Cobos Álvarez 5f53233ca1 Bug 1648064 - Switch DOM images to work like CSS images for the purposes of printing. r=tnikkel,smaug
Make them perform the image load (if needed), instead of copying the
image requests from the original document.

This is needed for CSS for stuff like:

@media print {
  #foo::before {
    content: url(bar.png);
  }
}

And so on. For images, we should do this as well. Nothing prevents you
from doing:

  <picture>
    <source srcset="print.png" media="print">
    <source srcset="screen.png" media="not print">
    <img>
  </picture>

And that should in theory work. It works after this patch, and I added a
test for that.

This patch is a bit bigger than I'd like, but I didn't find a more
reasonable way to split it up.

Making static docs able to do image loads is most of the patch and is
mostly straight-forward. This allows to remove the hacky "change the
loading document" thing that CSS images do, which is just working around
the CSP of the print document.

I need to enable background colors in printpreview_helper so as to be
able to have a reference page for all the different image types.

Differential Revision: https://phabricator.services.mozilla.com/D81779
2020-07-22 20:29:00 +00:00
Narcis Beleuzu 46367e2f7d Backed out 6 changesets (bug 1648064) for wp failures on test_printpreview.xhtml . CLOSED TREE
Backed out changeset 8ac892c60eda (bug 1648064)
Backed out changeset 189401f7b6e8 (bug 1648064)
Backed out changeset 2598e2706bd0 (bug 1648064)
Backed out changeset 4ec12eb9788c (bug 1648064)
Backed out changeset f735d4f6b21f (bug 1648064)
Backed out changeset 0fed6928b53d (bug 1648064)
2020-07-22 21:28:10 +03:00
Emilio Cobos Álvarez a70ea247b5 Bug 1648064 - Allow for some fuzziness in the tests. r=jwatt
Before my patches the background images in table-background-print didn't
seem to load on time.

I tried to make the images* tests non-fuzzy, but the <svg:image> really
ruined the deal. A bit of a shame that they fall into a subpixel
boundary because of page margins. So allow a bit of fuzz there rather
than spending another few days trying :)

Differential Revision: https://phabricator.services.mozilla.com/D84516
2020-07-22 17:16:03 +00:00
Emilio Cobos Álvarez 91062db9ac Bug 1648064 - Make service workers of the original document intercept the static document's requests. r=smaug,asuth
We need to set the original document ASAP so images triggered from the
clone use the right service worker.

It is a bit unfortunate to have the static document checks twice, but we
may get to Document::GetClientInfo before the cloned doc has a window,
so it's not 100% clear to me how we could avoid it.

Differential Revision: https://phabricator.services.mozilla.com/D82081
2020-07-22 14:39:53 +00:00
Emilio Cobos Álvarez 636792f039 Bug 1648064 - Make print preview documents wait properly for the document to be loaded. r=smaug
Otherwise my test fails intermittently on CI. We need to block on all
the load blockers because stuff like responsive images doesn't fire the
load directly but they do that as a micro task (blocking the load
event).

Differential Revision: https://phabricator.services.mozilla.com/D81989
2020-07-22 14:39:47 +00:00
Emilio Cobos Álvarez 08db8b4b15 Bug 1648064 - Switch DOM images to work like CSS images for the purposes of printing. r=tnikkel,smaug
Make them perform the image load (if needed), instead of copying the
image requests from the original document.

This is needed for CSS for stuff like:

@media print {
  #foo::before {
    content: url(bar.png);
  }
}

And so on. For images, we should do this as well. Nothing prevents you
from doing:

  <picture>
    <source srcset="print.png" media="print">
    <source srcset="screen.png" media="not print">
    <img>
  </picture>

And that should in theory work. It works after this patch, and I added a
test for that.

This patch is a bit bigger than I'd like, but I didn't find a more
reasonable way to split it up.

Making static docs able to do image loads is most of the patch and is
mostly straight-forward. This allows to remove the hacky "change the
loading document" thing that CSS images do, which is just working around
the CSP of the print document.

I need to enable background colors in printpreview_helper so as to be
able to have a reference page for all the different image types.

Differential Revision: https://phabricator.services.mozilla.com/D81779
2020-07-22 14:39:43 +00:00
Hiroyuki Ikezoe 2cec69d8c5 Bug 1652190 - Don't expand the composition size including the dynamic toolbar height if the root content is not scrollable. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D83601
2020-07-21 02:53:09 +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
longsonr 0e8dd6fc35 Bug 1653848 - Make SVGPaintServer and SVGGradientFrames queryable r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D84102
2020-07-20 18:02:25 +00:00
Cameron McCormack 82b32f112e Bug 1643246 - Don't use attribute selectors for determining if a select is a drop down or a list box. r=emilio
Instead add a pseudo-class that does the expected size="" attribute parsing.

Removing the Gtk-specific rule setting the text color since it doesn't
seem to have any effect currently.

Differential Revision: https://phabricator.services.mozilla.com/D83448
2020-07-17 09:56:53 +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
longsonr 63ae9a2469 Bug 1652194 - Remove SVGGenericContainerFrame r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D83257
2020-07-16 20:53:36 +00:00
Simon Giesecke 4e8c935384 Bug 1652023 - Remove unnecessary includes from PresShell.h. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D83114
2020-07-15 13:53:02 +00:00
Simon Giesecke d017d73cd9 Bug 1652022 - Remove unnecessary includes from WritingModes.h. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D83113
2020-07-15 13:56:31 +00:00
Simon Giesecke 96fb649d21 Bug 1652017 - Remove unnecessary includes for expensive nsIFrame.h. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D83111
2020-07-15 13:44:39 +00:00
Emilio Cobos Álvarez b769a57503 Bug 1651947 - Scale the page sequence in print preview so that pages don't overflow the viewport horizontally. r=dholbert
This is going to be useful for the new print preview UI, which is in a
doorhanger and thus much more likely to be less than the page size.

We (ab)use the existing print preview scaling mechanism. We only need it
after reflowing all pages, so this works.

This whole scaling mechanism is all-in-all not amazing, but the patch is
less gross than I initially thought. It's nice, actually.

We could put the new behavior behind a pref trivially, if that's wanted,
but I honestly thing this behavior is better even without the doorhanger
ui.

Differential Revision: https://phabricator.services.mozilla.com/D83309
2020-07-15 11:16:43 +00:00
Ting-Yu Lin fe4a027e82 Bug 1422908 - Use fieldset frame itself as the aPositionedFrame argument on PushAbsoluteContainingBlock. r=mats
Per documentation, `aPositionedFrame` (the second argument) of
`PushAbsoluteContainingBlock` should be the frame whose style actually
makes the new absolute containing block a containing block, so it should
be the fieldset frame itself, not fieldset's inner frame.

Co-authored-by: Mats Palmgren <mats@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D82651
2020-07-14 17:49:05 +00:00
Daniel Holbert 0df096b344 Bug 1652788: Preemptively fix unified build bustage in layout/{base,generic,printing}. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D83534
2020-07-14 18:15:49 +00:00
Erik Nordin 251f881853 Bug 1650886 - Part 2 Expose Paper Sizes for macOS r=jwatt
- Add macOS-specific function to retrieve the paper list for a given printer.
- Add JS test to ensure papers are initialized with valid values.

Differential Revision: https://phabricator.services.mozilla.com/D82598
2020-07-13 19:33:00 +00:00
tkhan 75ea54bf01 Bug 1650919 - Adding manifest annotations for xorigin test harness. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D82763
2020-07-13 20:34:46 +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
Butkovits Atila fa8b334372 Backed out 2 changesets (bug 1650886) for causing bustage at Unified_cpp_widget_windows1.obj. CLOSED TREE
Backed out changeset de485a27b337 (bug 1650886)
Backed out changeset f65d2491cbb4 (bug 1650886)
2020-07-13 22:15:01 +03:00
Erik Nordin e615e501cf Bug 1650886 - Part 2 Expose Paper Sizes for macOS r=jwatt
- Add macOS-specific function to retrieve the paper list for a given printer.
- Add JS test to ensure papers are initialized with valid values.

Differential Revision: https://phabricator.services.mozilla.com/D82598
2020-07-13 18:30:18 +00:00
Bogdan Tara 6faddf7d8f Backed out changeset 1a0f002865d3 (bug 1650919) for test_deprecated.html failures CLOSED TREE 2020-07-13 19:22:21 +03:00
tkhan e50031dfc7 Bug 1650919 - Adding manifest annotations for xorigin test harness. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D82763
2020-07-13 13:01:43 +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
Jonathan Watt ab6c618f65 Bug 1652368. Clean up nsDocumentViewer::Print. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D83276
2020-07-13 07:25:13 +00:00
Hiroyuki Ikezoe 43c6d349f1 Bug 1650981 - Send TIME_TO_FIRST_INTERACTION_MS only from the top level content. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D83214
2020-07-13 07:11:11 +00:00
Jonathan Watt b800c4c54e Bug 1652344 p3. Stop creating an nsIPrintSettings in nsGlobalWindowOuter::PrintOuter. r=bobowen
The fallback code in nsPrintJob::DoCommonPrint to create an nsIPrintSettings if
none is passed in is never used, since all callers pass a settings object.
However, to simplify future changes I'd like nsGlobalWindowOuter::PrintOuter to
stop creating and passing in its own default valued nsIPrintSettings object.

This patch makes the fallback code that DoCommonPrint calls do what
nsGlobalWindowOuter::PrintOuter does, and makes the latter stop passing in a
settings object.

This patch also removes nsIWebBrowserPrint.globalPrintSettings since
nsGlobalWindowOuter::PrintOuter was its only consumer.

Differential Revision: https://phabricator.services.mozilla.com/D83268
2020-07-13 00:22:28 +00:00
Jonathan Watt dc75460193 Bug 1652344 p2. Fix the print settings creation in the print preview tests. r=hiro
nsIWebBrowserPrint.globalPrintSettings returns a new object each time.  That is
why the code in these tests doesn't work, and why they have the workaround to
set the pref to disable the progress dialog. This patch fixes the code and
removes the prefs setting workaround.

This patch also changes the code to use the print settings service to get the
print settings.  That's all that nsIWebBrowserPrint.globalPrintSettings does
anyway.  Making this change allows me to remove
nsIWebBrowserPrint.globalPrintSettings in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D83279
2020-07-13 00:30:00 +00:00
Mihai Alexandru Michis c6f6f8daa2 Backed out 2 changesets (bug 1652344) for causing failures in test_printpreview.xhtml
CLOSED TREE

Backed out changeset d2b66d810ab5 (bug 1652344)
Backed out changeset 075903436ef2 (bug 1652344)
2020-07-13 01:21:28 +03:00
Jonathan Watt 44ed5abb22 Bug 1652344 p2. Stop creating an nsIPrintSettings in nsGlobalWindowOuter::PrintOuter. r=bobowen
The fallback code in nsPrintJob::DoCommonPrint to create an nsIPrintSettings if
none is passed in is never used, since all callers pass a settings object.
However, to simplify future changes I'd like nsGlobalWindowOuter::PrintOuter to
stop creating and passing in its own default valued nsIPrintSettings object.

This patch makes the fallback code that DoCommonPrint calls do what
nsGlobalWindowOuter::PrintOuter does, and makes the latter stop passing in a
settings object.

This patch also removes nsIWebBrowserPrint.globalPrintSettings since
nsGlobalWindowOuter::PrintOuter was its only consumer.

Differential Revision: https://phabricator.services.mozilla.com/D83268
2020-07-12 19:33:49 +00:00
Jonathan Kew b56c4b385c Bug 1646639 - Don't recursively apply the line's start-offset and text-indent to children of a first-line frame. r=dholbert
But do apply any adjustment needed for text-align to the first-line frame itself.

Differential Revision: https://phabricator.services.mozilla.com/D82725
2020-07-11 22:52:41 +00:00
Razvan Maries d80f844cba Backed out 2 changesets (bug 1646639) for perma failures on first-line-bidi-002.html. CLOSED TREE
Backed out changeset e1d587422484 (bug 1646639)
Backed out changeset 5caaf51dac99 (bug 1646639)
2020-07-12 01:34:31 +03:00
Jonathan Kew 953fcef392 Bug 1646639 - Don't recursively apply the line's start-offset and text-indent to children of a first-line frame. r=dholbert
But do apply any adjustment needed for text-align to the first-line frame itself.

Differential Revision: https://phabricator.services.mozilla.com/D82725
2020-07-11 21:26:02 +00:00
Razvan Maries 10b6298357 Backed out 2 changesets (bug 1650886) for leakcheck failures.
Backed out changeset e2485d1bb142 (bug 1650886)
Backed out changeset ed8db2a54c61 (bug 1650886)
2020-07-12 00:01:04 +03:00
Erik Nordin 6a3156ccfa Bug 1650886 - Part 2 Expose Paper Sizes for macOS r=jwatt
- Add macOS-specific function to retrieve the paper list for a given printer.
- Add JS test to ensure papers are initialized with valid values.

Differential Revision: https://phabricator.services.mozilla.com/D82598
2020-07-11 18:20:53 +00:00
Jonathan Watt eee2d4c223 Bug 1557983. Significantly simplify and fix the 'beforeprint'/'afterprint' dispatching code.
This fixes two issue.

First, the code shouldn't be dispatching these events every time it gets a new
Print or PrintPreview call.  It only needs to dispatch the events to the
original document that we're going to clone from.  When cloning from existing
static clones any changes made by 'beforeprint' will be present in the existing
static clone.

Second, the code tries to delay the 'afterprint' event until after
mozPrintCallback callbacks have been invoked, but those callbacks are invoked
in the cloned document, whereas the events are sent to the original document!
So there is no reason to do this.

Differential Revision: https://phabricator.services.mozilla.com/D34280
2020-07-11 14:14:03 +00:00
Butkovits Atila ce77b8466f Backed out 2 changesets (bug 1557983) for failures at table-background-print.html. CLOSED TREE
Backed out changeset 249eede42e9f (bug 1557983)
Backed out changeset dfbaf61ce16a (bug 1557983)
2020-07-11 13:14:13 +03:00
Jonathan Watt 6e34e4dbdf Bug 1557983. Significantly simplify and fix the 'beforeprint'/'afterprint' dispatching code.
This fixes two issue.

First, the code shouldn't be dispatching these events every time it gets a new
Print or PrintPreview call.  It only needs to dispatch the events to the
original document that we're going to clone from.  When cloning from existing
static clones any changes made by 'beforeprint' will be present in the existing
static clone.

Second, the code tries to delay the 'afterprint' event until after
mozPrintCallback callbacks have been invoked, but those callbacks are invoked
in the cloned document, whereas the events are sent to the original document!
So there is no reason to do this.

Differential Revision: https://phabricator.services.mozilla.com/D34280
2020-07-11 09:06:25 +00:00