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

73794 Коммитов

Автор SHA1 Сообщение Дата
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
Glenn Watson 7aba1426fd Bug 1659676 - Simplify WR hit-test API. r=kats,kvark,nical
Specifically:
 - Remove hit test tag from common display item properties.
 - Simplify WR bindings to use hit-test items exclusively.
 - Remove support for transparent rectangles to be hit-test items.
 - Remove support for any primitive to be a hit-test item.

Differential Revision: https://phabricator.services.mozilla.com/D87421
2020-08-19 15:05:30 +00:00
Emilio Cobos Álvarez 325d955f89 Bug 1660048 - Remove dom.forms.color and dom.forms.datetime. r=smaug,marionette-reviewers,whimboo
They're enabled in all configurations and there's no plan to change
this. With it, dom.experimental_forms is also useless, so we can remove
it too.

Differential Revision: https://phabricator.services.mozilla.com/D87623
2020-08-19 18:24:06 +00:00
longsonr e3b924526e Bug 1659783 - Fix use pointing to image elements r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D87571
2020-08-19 15:25:39 +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
Sonia Singla 5f5c9fd7f2 Bug 1659267 - Remove usages of -moz-user-select across the Firefox codebase. r=emilio,marionette-reviewers,geckoview-reviewers,preferences-reviewers,whimboo,agi
Differential Revision: https://phabricator.services.mozilla.com/D87499
2020-08-18 23:37:51 +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
Nika Layzell 482d731e3a Bug 1614524 - Part 1: Add support for process-switching object/embed loads, r=mattwoodrow,smaug,kamidphish
By passing a weak reference back to the DocumentChannelParent into
DocumentLoadListener for object loads, we are able to handle process switching
loads by asking the content process to create a BrowsingContext, and delaying
the real process switch until it becomes available.

The load then completes as it would before, acting as a normal process-switching
subframe load.

Differential Revision: https://phabricator.services.mozilla.com/D86580
2020-08-18 16:49:34 +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 4e78d2ce23 Bug 1658173 part 2: Scale down print-preview so that every sheet fits into the scrollport, in both dimensions (not just the inline axis). r=emilio
Note: Previously we were scaling based on the available ISize (and we were
ignoring the BSize for scaling purposes).  Now we want to consider the BSize as
well, so the obvious next step would be to scale based on the available BSize -
but that doesn't work, because the available BSize is unconstrained here. (It's
unconstrained, even though we're fragmenting, because thankfully we don't
attempt to fragment the nsPageSequenceFrame itself -- we only fragment at a
level further down in the frame tree.)

So: this patch changes us to instead scale down based on the *computed* size
(rather than the available size), such that both dimensions fit.  The computed
size here is the size of the scrollport; and, importantly, it has a finite
value in the block axis (unlike the *available* BSize which is unconstrained
here).

Note that the available ISize and the computed ISize are the same in this case
(they're both the ISize of the scrollport), so there's no behavior-change here
for the computation of the inline-axis-based scale factor.

Differential Revision: https://phabricator.services.mozilla.com/D87021
2020-08-17 21:08:37 +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
Zeke Medley a591e69aa0 Bug 1591204 - Support forced colors media feature r=emilio
Enabled behind layout.css.forced-colors.enabled pending finalization
of the spec:

<https://drafts.csswg.org/mediaqueries-5/#forced-colors>

Differential Revision: https://phabricator.services.mozilla.com/D87147
2020-08-17 20:50:49 +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
Sean Feng 85bfe3d376 Bug 1200896 - Make the document blocked by the topmost element in the top layer r=emilio
Spec: https://html.spec.whatwg.org/multipage/#blocked-by-a-modal-dialog

Depends on D86392

Differential Revision: https://phabricator.services.mozilla.com/D86227
2020-08-17 15:41:19 +00:00
Shinichi Morimoto bc916f4b16 Bug 1659265 - remove layout.css.offset-logical-properties.enabled. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D87297
2020-08-17 17:51:31 +00:00
Boris Chiou b9153cdc94 Bug 1639963 - Support aspect-ratio for HTML canvas. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D79570
2020-08-17 07:14:21 +00:00
Boris Chiou 33a43f7fc9 Bug 1639963 - Support aspect-ratio for svg frames. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D79363
2020-08-17 07:14:19 +00:00
Boris Chiou 0b7ae2d7e9 Bug 1639963 - Support aspect-ratio for svg object and iframe (i.e. nsSubDocumentFrame). r=emilio
When <object> targets to a svg image, we use nsSubDocumentFrame. The
intrinsic ratio should be overridden by aspect-ratio while computing
its size on this frame.

This update in nsSubDocumentFrame also works in iframe.

Differential Revision: https://phabricator.services.mozilla.com/D79362
2020-08-17 07:07:38 +00:00
Boris Chiou 10e1d0f620 Bug 1639963 - Support aspect-ratio for video element. r=dholbert
This includes a update of the ini file. I noticed the color
of the video is not equal to "rgb(0, 128, 0)" (i.e. background-color: green).
It is "rgb(1, 128. 1)" on Mac (without WebRender),
"rgb(0, 125, 0)" on Mac (with WebRender), and "rgb(1, 128, 2)" on Linux.
Perhaps it is a bug of our video rendering or video scaling. Therefore,
I added fuzzy into the ini file with max 0-3 difference per channel.

(Note: The size of this video is 50x50, so the max number of pixels is 2500.)

Differential Revision: https://phabricator.services.mozilla.com/D79337
2020-08-17 08:28:37 +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
Boris Chiou cb69cd917a Bug 1639963 - Drop redundant check of auto in nsImageFrame. r=emilio
Appearally, we don't have to check mAspectRatio.auto_ because we checked it
already in the same function.

Differential Revision: https://phabricator.services.mozilla.com/D79336
2020-08-17 07:08:16 +00:00
Boris Chiou 38a854f9b9 Bug 1639963 - Apply Automatic content-based minimum sizes for aspect-ratio. r=emilio
Basically, if the overflow is visible and its min-height/min-width is
auto, we have to get the maximal value between the content size and
the size of the ratio-depentent axis.

https://drafts.csswg.org/css-sizing-4/#aspect-ratio-minimum

Differential Revision: https://phabricator.services.mozilla.com/D78965
2020-08-17 07:02:25 +00:00
Boris Chiou dd3c20ccd8 Bug 1639963 - Update the API of nsIFrame::ComputeSize for aspect-ratio. r=emilio
In order to apply Automatic content-based minimum sizes, we have to know
the content size on the block axis. We cannot get the content size until
we finish the reflow of the child frames. So we have to keep a flag
which indicates the size of the ratio-dependent axis is overrideen by
aspect-ratio in ReflowInput.

We will set the correct return value in the next patch, For now, we
always return AspectRatioUsage::None.

Differential Revision: https://phabricator.services.mozilla.com/D79335
2020-08-17 06:57:56 +00:00
Boris Chiou 4e7c9bc450 Bug 1639963 - Fix margin collapsing with aspect-ratio. r=emilio
Basically, we treat aspect-ratio (together with inline size) as a
non-auto block size. This means the block is not empty when using
aspect-ratio.

Also, add 2 tentative wpts for this, based on the current spec issue
examples.

https://github.com/w3c/csswg-drafts/issues/5328

Differential Revision: https://phabricator.services.mozilla.com/D84452
2020-08-17 06:26:19 +00:00
Boris Chiou b425a6022b Bug 1639963 - Calculate inline size and block size based on aspect-ratio. r=emilio
We calculate the size of ratio-dependent axis by aspect-ratio while
initializing its ReflowInput, for most of the basic block cases.

This patch doesn't include "Automatic content-based minimum sizes",
which will be handled later. Besides, replaced elements will be handled
later as well.

We don't pass abspos-004.tentative.html because there is still a
spec issue: https://github.com/w3c/csswg-drafts/issues/5151.
For other tests we didn't pass (e.g. block-aspect-ratio-009.tentative.html,
or replaced-element-00x.tentative.html), we fix them later.

Besides, in this patch, we don't handle the case if the size of
ratio-determining axis uses intrinsic size keywords (which needs to be
calculated by its content size). We will fix this in the following bug
(Bug 1646100).

Differential Revision: https://phabricator.services.mozilla.com/D78964
2020-08-17 06:26:19 +00:00
Narcis Beleuzu 28a919e715 Backed out changeset 6d71d0556c40 (bug 1568130) for mochitest failures on test_focus_menu.xhtml 2020-08-17 05:43:25 +03:00
Zeke Medley d1653ccb9a Bug 1658780 - Update the prefers-contrast media query to use the new more/less keywords r=emilio
Per the resolution here:
https://github.com/w3c/csswg-drafts/issues/2943#issuecomment-672994920

Differential Revision: https://phabricator.services.mozilla.com/D86848
2020-08-17 01:41:16 +00:00
Jared Wein b119a66052 Bug 1568130 - Stop consuming key events on keyup since webpages may be listening for them. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D86861
2020-08-16 23:45:36 +00:00
Emilio Cobos Álvarez 6f85f8c453 Bug 1656081 - Cleanup iframe sizing so that it does the same as every other replaced element. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D85386
2020-08-16 18:45:39 +00:00
Emilio Cobos Álvarez 268af41f18 Bug 1600635 - Fix two minor issues with scrollbar style caching. r=heycam
Add -moz-inert and -moz-script-level to the set of internal properties
that aren't included in "all".

-moz-inert may need to be uncacheable in the future if we make it not
change the pointer-events computed value. Left a comment to that effect.

Differential Revision: https://phabricator.services.mozilla.com/D87115
2020-08-16 00:43:48 +00:00
Ting-Yu Lin a9328a86bf Bug 1658198 - Provide a minimum starting value for extraBlockSize in FindBestBalanceBSize. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D87131
2020-08-16 00:46:30 +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
Bogdan Tara a773454b8e Backed out changeset b21c793d9d52 (bug 1658173) for test_printpreview.xhtml failures CLOSED TREE 2020-08-15 04:25:23 +03:00