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

17930 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 5bca4199fb Bug 1660378 - part 9: Avoid QI for getting `nsStyledElement` pointer r=smaug
The editor modules does QI too many times when it sets or removes some style
with `execCommand` or XPCOM API.  Therefore, there should be an API to
retrieve `nsStyledElement` pointer from `nsINode*`.

Differential Revision: https://phabricator.services.mozilla.com/D87990
2020-08-26 05:29:06 +00:00
Mihai Alexandru Michis 6d6f67bc0b Backed out changeset 44d25518ea20 (bug 1660363) for causing bc failures in browser_modal_print.js
CLOSED TREE
2020-08-26 09:07:18 +03:00
James Teh f30d80c39a Bug 1660363: Don't treat elements inside print preview documents as focusable. r=emilio,mstriemer
Previously, IsFocusable returned true on elements in print preview documents, but the element wouldn't accept focus.
This meant that when you tried to tab, focus would get stuck on the document.
Now, IsFocusable returns false.
Thus, tab doesn't try to stop on these elements and can move out of the document.

Differential Revision: https://phabricator.services.mozilla.com/D88000
2020-08-26 04:59:27 +00:00
Daniel Holbert b8192a4fc2 Bug 1660502 part 2: Rename nsSharedPageData::mTotNumPages to mRawNumPages, for consistency. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D87887
2020-08-24 23:53:27 +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
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
Botond Ballo a621152a3c Bug 1543485 - Also update the code in ScrollToImpl() that proactively updates the callback transform and main thread visual viewport offset. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D87692
2020-08-21 01:24:59 +00:00
Botond Ballo 27cd351633 Bug 1543485 - Back out the hacky fix for bug 1549625. r=kats
Now that main thread scroll updates preserve the relative scroll offset
in APZ, this hacky fix is no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D87687
2020-08-20 23:30:13 +00:00
Ting-Yu Lin b91e219fd9 Bug 1412687 Part 2 - Consider an overflow container's scrollable overflow when deciding whether to reflow it. r=dholbert
This patch is similar to Bug 1559961 Part 2 [1]. That is, we want to reflow
an overflow container again if its scrollable overflow block-end exceeds
the available block-size constraint.

[1] https://hg.mozilla.org/mozilla-central/rev/d377ce300d0349c1b7dc562bcf5343851d36c6ed

Differential Revision: https://phabricator.services.mozilla.com/D87630
2020-08-20 22:29:59 +00:00
Daniel Holbert 8d972cd5cd Bug 1660294 part 0: Directly initialize nsSharedPageData member-var, and adjust its documentation. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D86797
2020-08-20 17:57:45 +00:00
Emilio Cobos Álvarez b17bb7ed34 Bug 1660251 - After bug 1658173 we need to re-center pages if any dimensions change, not just if width changes. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D87757
2020-08-20 16:23:48 +00:00
Daniel Holbert e90fd447e6 Bug 1660166 followup: Mark nsPageFrame::GetPageNum as 'const'. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D87753
2020-08-20 15:05:54 +00:00
Daniel Holbert 335b4750cb Bug 1660166 part 3: Remove a redundant member-variable that represents the total number of pages. r=hiro
Before this patch stack, nsPageSequenceFrame and every nsPageFrame each
individually tracked the number of pages.

As of the previous patch, we've coalesced the nsPageFrame variables into a
single variable that lives on nsSharedPageData.  This patch here replaces
nsPageSequenceFrame's member-var with that nsSharedPageData variable, too.

Depends on D87696

Differential Revision: https://phabricator.services.mozilla.com/D87697
2020-08-20 06:16:04 +00:00
Daniel Holbert b39ca4f982 Bug 1660166 part 2: Let nsPageFrame determine its own page number, and store total number of pages in one central spot. r=hiro
Depends on D87695

Differential Revision: https://phabricator.services.mozilla.com/D87696
2020-08-20 06:12:33 +00:00
Daniel Holbert 16dd33822d Bug 1660166 part 1: In PrintedSheetFrame's reflow loop, cast the child frame to nsPageFrame (which is the concrete type that we know it has). r=hiro
We already do this static_cast'ing before this patch, for a single
nsPageFrame-specific method call.  This patch just captures the result of that
static_cast in a reusable variable, so that I can easily add another
nsPageFrame-specific function call in the next patch of this patch series.

(We can be confident this casting is valid, because we only ever give
PrintedSheetFrame this one type of child frame.)

Differential Revision: https://phabricator.services.mozilla.com/D87695
2020-08-20 06:12:32 +00:00
Ting-Yu Lin a594ed407c Bug 1633031 Part 3 - Remove unused parameters from DoFlexLayout(), ComputeMainSize(), and ComputeCrossSize(). r=dholbert
We do the flex algorithm by assuming the available block-size is
unconstrained. Thus, we can remove `availableBSizeForContent` and
`aStatus` passing to DoFlexLayout(), ComputeMainSize(), and
ComputeCrossSize().

Differential Revision: https://phabricator.services.mozilla.com/D87109
2020-08-19 21:10:48 +00:00
Ting-Yu Lin 7cb8492735 Bug 1633031 Part 1 - Stop considering available block-size when wrapping flex lines in multi-line column-oriented flex container. r=dholbert
Although this goes against the suggestion of the sample algorithm in the
spec, this brings the layout of the multi-line column-oriented flex
container in paginated context closer to the layout with no
fragmentation. This also matches Google Chrome's behavior.

Tweak flexbox-unbreakable-child-2.html so that it matches the rendering
as of this patch. Change the height of `.muticol` and the removal of
border in `flexContainer` to let two flex items fit exactly into the
flex container's height, making reference easier to write.

Differential Revision: https://phabricator.services.mozilla.com/D87107
2020-08-19 21:10:01 +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
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 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
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
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 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
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
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
Bogdan Tara a773454b8e Backed out changeset b21c793d9d52 (bug 1658173) for test_printpreview.xhtml failures CLOSED TREE 2020-08-15 04:25:23 +03:00
Daniel Holbert 3609cf24bc Bug 1658173: 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-14 22:10:48 +00:00
Emilio Cobos Álvarez e462454933 Bug 1386418 - Fix two issues in nsIFrame::HandleRelease. r=dholbert
The frame selection changes can run script, so we need to check for the
frame itself getting destroyed. This fixes the crash as reported.

Additionally, the document check it does for pointer capture is
incorrect, it should use the composed, not uncomposed doc, so that it
works in shadow dom.

Differential Revision: https://phabricator.services.mozilla.com/D87097
2020-08-14 17:36:03 +00:00
Emilio Cobos Álvarez 31a5cfa91b Bug 1659084 - Clean up some nsPageSequenceFrame. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D87061
2020-08-14 12:23:39 +00:00
Ting-Yu Lin 924f2d9957 No bug - Fix a typo in nsFlexContainerFrame.cpp. r=emilio DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D86655
2020-08-11 00:45:54 +00:00
Dorel Luca c243829674 Backed out 5 changesets (bug 1623764) for WPT failures in /editing/run/forwarddelete.html. CLOSED TREE
Backed out changeset 838b1a256f25 (bug 1623764)
Backed out changeset 00911e3c92c3 (bug 1623764)
Backed out changeset 5f7d278953d7 (bug 1623764)
Backed out changeset 0059379a3c29 (bug 1623764)
Backed out changeset 6e3a9276ec41 (bug 1623764)
2020-08-10 09:07:48 +03:00
Kagami Sascha Rosylight ddbb369d71 Bug 1623764 - Part 4: Stop at hard linebreaks when eat_space_to_next_word r=emilio,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D85923
2020-08-09 12:58:27 +00:00
Kagami Sascha Rosylight 96a85f4c16 Bug 1623764 - Part 3: Expose IsLineWrapped via LineInfo r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D85922
2020-08-09 12:58:13 +00:00
Kagami Sascha Rosylight 00633d6b49 Bug 1623764 - Part 2: Add mSawInlineCharacter to PeekWordState r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D85921
2020-08-09 12:58:05 +00:00
Kagami Sascha Rosylight dfdf849335 Bug 1623764 - Part 1: Destruct ILineIterator from where it's initialized r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D85920
2020-08-09 12:57:58 +00:00
Emilio Cobos Álvarez e07d5eb564 Bug 1657437 - Don't treat lone CRs as segment breaks. r=jfkthame
That prevents preceding whitespace from getting collapsed.

When there's a single lone CR (so `a\rb`) our behavior here diverges
from Chrome's but matches Safari's. We treat it as ZWSP.

That matches the initial resolution of [1], but then there have been
various doing and undoings of that resolution, so it's not totally clear
to me what the correct behavior per spec should be. I think "treat it as
other control character"? But I haven't dug into what that implies, so
for now I've just kept behavior there as-is.

[1]: https://github.com/w3c/csswg-drafts/issues/855

Differential Revision: https://phabricator.services.mozilla.com/D86188
2020-08-08 16:21:35 +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
Timothy Nikkel 345de90fa2 Bug 1656802. If both scrollbars are layout and present and only for the visual viewport they need to be adjusted to not overlap. r=emilio
The existing calculation will make them overlap. The AdjustOverlappingScrollbars code was written with overlay scrollbars in mind but it looks like it will work just fine for this case.

Differential Revision: https://phabricator.services.mozilla.com/D85707
2020-08-07 11:40:55 +00:00
Timothy Nikkel a5c2284d8d Bug 1656802. Position the scrollcorner if we have both layout scrollbars and they are both for the visual viewport only. r=emilio
Otherwise the calculation above would lead to an empty rect for the scroll corner.

The scrollbar rects as computed now still overlap each other and the scroll corner, the next patch fixes that.

Differential Revision: https://phabricator.services.mozilla.com/D85706
2020-08-07 11:40:57 +00:00