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

73519 Коммитов

Автор SHA1 Сообщение Дата
Brad Werth b38e6bdb3f Bug 1648774 Part 1: Make GetFlexFrameWithComputedInfo work for nsFieldSetFrame. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D84626
2020-07-23 19:29:37 +00:00
Erik Nordin c3ae749f62 Bug 1654406 - Fix Incorrect Ellipsis Offset When Printing Selections r=bobowen
- Fix double-counted ellipsis offset.
- Rename unselected to nonselected for consistency.

Differential Revision: https://phabricator.services.mozilla.com/D84448
2020-07-23 20:17:03 +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
Timothy Nikkel 8fd54dce2c Bug 1651332. Update scrollbar attrs to use visual viewport offset. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D82685
2020-07-19 10:04:17 +00:00
Jonathan Watt b7e932192e Bug 1652270. Convert nsFrameLoader::Print to return a Promise. r=farre,remote-protocol-reviewers,marionette-reviewers,jgraham,whimboo,mixedpuppy
(Instead of requiring callers to pass an nsIWebProgressListener.)

Differential Revision: https://phabricator.services.mozilla.com/D83249
2020-07-22 23:17:45 +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
Narcis Beleuzu ce05a24710 Backed out changeset 8323b7bb5e1a (bug 1652618) for mochitest failures on test_audiocontrols_dimensions.html . CLOSED TREE 2020-07-23 00:49:31 +03:00
Daniel Holbert 172b12cd5c Bug 1654452 part 3: Misc cleanup in nsPageSequenceFrame: reorder stray include, drop unused define, use 'auto', remove unnecessary 'rv' var. r=TYLin
Depends on D84534

Differential Revision: https://phabricator.services.mozilla.com/D84535
2020-07-22 18:40:51 +00:00
Daniel Holbert 6552a848b7 Bug 1654452 part 2: Use range-based for loops to iterate nsPageSequenceFrame children. r=TYLin
Depends on D84463

Differential Revision: https://phabricator.services.mozilla.com/D84534
2020-07-22 20:19:09 +00:00
Daniel Holbert cfdacd2573 Bug 1654452 part 1: Manage nsSharedPageData lifetime using UniquePtr instead of new/delete. r=TYLin
This makes its ownership a bit clearer - it's now encoded in the type system
that nsPageSequenceFrame is the owner of this object, and we can reason about
the implications of that for the other frames that retain a pointer to this
object.  (Fortunately all those other frames will be destroyed before the
nsPageSequenceFrame that owns their nsSharedPageData, because they're
descendants of that frame.)

Differential Revision: https://phabricator.services.mozilla.com/D84463
2020-07-22 18:37:44 +00:00
Narcis Beleuzu 37cb83a398 Backed out 2 changesets (bug 921504) for wpt failures on inert-retargeting-iframe.tentative.html . CLOSED TREE
Backed out changeset 8b75cd744e80 (bug 921504)
Backed out changeset a56b2d354613 (bug 921504)
2020-07-22 23:53:55 +03: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
Emilio Cobos Álvarez 312039fb70 Bug 1652618 - Ensure UA widgets are attached and detached synchronously. r=smaug
This changes the UA widget setup (again). What is going on in this
test-case is that we have a marquee inside a video, two things that have
their own UA widget. Given how the code is currently written, the
runnable to attach and set up the marquee's widget is posted before than
the video one (which is potentially reasonable).

However that means that the marquee one runs before and flushes layout,
and catches the video in an inconsistent state (in the composed doc, but
without a shadow root). That in turn messes up reflow because
nsVideoFrame assumes stuff.

Rather than putting the attach / detach logic in script runners, just
run that bit synchronously, and post only the event async. I audited the
consumers of those events and it seems fine to me, they either already
deal with the possibility of the shadow root being already detached or
they don't care.

For teardown, none of the destructors of the UA widgets rely on the
shadow root being still attached to the element.

Differential Revision: https://phabricator.services.mozilla.com/D84487
2020-07-22 19:42:37 +00:00
Kagami Sascha Rosylight 4ffb4f26c5 Bug 1652897 - Remove IS_DIRTY assertion as it currently happens r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D84553
2020-07-22 18:45:53 +00:00
Alexander Surkov 1c382cad65 Bug 921504 - implement HTML:inert r=emilio,heycam
Differential Revision: https://phabricator.services.mozilla.com/D81701
2020-07-22 04:26:08 +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
Emilio Cobos Álvarez f87a5320b9 Bug 1648064 - Remove some includes from nsPrintJob.h. r=jwatt
I had needed this before to export that header, and it's no longer
needed, but it seems useful anyways.

Depends on D81989

Differential Revision: https://phabricator.services.mozilla.com/D84252
2020-07-22 14:16:14 +00:00
Jonathan Kew a7538df0ce Bug 1631460 - Render margin-indicator guides on each page of print preview if the nsIPrintSettings.showMarginGuides flag is set. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D84159
2020-07-22 05:34:30 +00:00
Brian Birtles 029c6ab57b Bug 1637532 - Allow animations and transitions on ::marker; r=boris
As per the following change to the spec:

6b3d7240b5

The additional failure annotation is added because we don't currently treat
text-combine-upright as non-animatable and this patch exposes the existing bug
(bug 1654195).

Differential Revision: https://phabricator.services.mozilla.com/D84308
2020-07-22 00:44:18 +00:00
Brian Birtles 9159650f0b Bug 1636562 - Respect property restrictions on pseudo elements when animating; r=boris
Differential Revision: https://phabricator.services.mozilla.com/D84306
2020-07-21 23:12:35 +00:00
Emilio Cobos Álvarez 5adefab54c Bug 1449401 - Remove moz-math-anonymous ua-only pseudo. r=heycam
We do not expose it nor ever style it. Just use the parent style all the
time. This avoids problematic style resolution calls during reflow.

Differential Revision: https://phabricator.services.mozilla.com/D84358
2020-07-21 22:35:46 +00:00
Mats Palmgren 0a85300e43 Bug 1653052 - [css-grid] Make empty and all-whitespace strings in 'grid-template-areas' invalid. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D84398
2020-07-21 19:46:45 +00:00
Emilio Cobos Álvarez b280656a9e Bug 1651530 - Apply min/max-block-size to tables. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D84130
2020-07-21 19:12:39 +00:00
Emilio Cobos Álvarez 92a800607f Bug 1651530 - Skip a subtest in test_bug1642588.html that my changes trip on automation. r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D84414
2020-07-21 19:34:02 +00:00
Cosmin Sabou 3d099cd5a2 Backed out changeset 2d42454f13e1 (bug 1651530) for mochitest failures on test_bug1642588.html. CLOSED TREE 2020-07-21 19:59:51 +03:00
Emilio Cobos Álvarez 1a2268d278 Bug 1651530 - Apply min/max-block-size to tables. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D84130
2020-07-21 11:50:01 +00:00
Simon Giesecke 75e36d4ce3 Bug 1653193 - Hide complex template instance PrimitiveAttributes. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D83751
2020-07-21 08:39:35 +00:00
Hiroyuki Ikezoe ba018e2355 Bug 1638152 - Jank partial prerender transform animations and report the janked animations to the main-thread in each process on WebRender. r=botond,kats
Differential Revision: https://phabricator.services.mozilla.com/D83202
2020-07-21 10:03:34 +00:00
Hiroyuki Ikezoe c746275523 Bug 1638152 - Inform transform value in the clip rectangle and the offset from the reference frame for the partial pre-render check on WebRender. r=botond
On WebRender there is no layer tree structures so that we can't accumulate
transform values up to the nearest APZ's scroll layer by walking up the layer
tree, or we can't tell a given transform animation is inside a perspective layer
to decide whether we need to apply the offset from the reference frame or not
[1]. So we get the accumulated transform by using
nsLayoutUtils::GetTransformToAncestor on the main-thread and inform it to the
compositor thread, and also inform the offset which is set conditionally [2]
so that we don't need to tell whether the transform animation is inside a
perspective layer or not on the compositor thread.

I am not yet 100% sure that these values are same both on WebRender and non
WebRender in all cases, once after partial pre-rendering transforms have
been used in the wild well enough and any problem has not appeared, even if
there are problems we should fix them then the non WebRender version should
eventually use this same setup instead of walking up the layer tree.

[1] https://searchfox.org/mozilla-central/rev/85ae3b911d5fcabd38ef315725df32e25edef83b/gfx/layers/CompositorAnimationStorage.cpp#273-275
[2] https://searchfox.org/mozilla-central/rev/85ae3b911d5fcabd38ef315725df32e25edef83b/layout/painting/nsDisplayList.cpp#7879-7891

Differential Revision: https://phabricator.services.mozilla.com/D83201
2020-07-21 10:09:06 +00:00
Hiroyuki Ikezoe 61e3b7323f Bug 1638152 - Add a reftest to make sure that the offset from the reference frame is surely factored into the jank mechanism. r=botond
This is a test case which will fail if we didn't factor the position of the
transform from the reference frame in the jank mechanism in cases where the
transform is inside a perspective layer. In the case of non WebRender, we've
already factored it in FrameTransformToTransformInDevice() [1].

For WebRender we will need to factor it in a different way becase there is no
layer tree structures so that we can't tell whether the transform is inside
a perspective layer or not by looking at the parent layer.

Note that, as of now, this test doesn't fail on WebRender since there is no jank
mechanism on WebRender yet.

[1] https://searchfox.org/mozilla-central/rev/7ec7ee4a9bde171ba195ab46ed6077e4baaef34d/gfx/layers/CompositorAnimationStorage.cpp#276-282

Differential Revision: https://phabricator.services.mozilla.com/D83200
2020-07-21 10:02:56 +00:00
Timothy Nikkel 7260fcfeba Bug 1653905. Propagate the fix from bug 1645762 to nsDisplayMasksAndClipPaths::PaintMask. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D84126
2020-07-20 08:36:56 +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 bffd4f08c6 Bug 1647520 Part 4 - Stop binary search once the feasible and infeasible block-size is within one device pixel. r=heycam
The gist of this patch is: once the feasible and infeasible block-size
is within one device pixel, we choose nextGuess to be the greatest
multiple of one device pixel below or equal to the feasible block-size.
If this nextGuess is infeasible, we will reflow children one last time
by using the last feasible block-size and done with the balancing.

Differential Revision: https://phabricator.services.mozilla.com/D83732
2020-07-20 22:28:45 +00:00
Ting-Yu Lin e68bedf3c5 Bug 1647520 Part 3 - Improve some comments in FindBestBalanceBSize(). r=heycam
Here's an example that can break the loop at the first iteration.
<div style="column-count:2; height:100px"><img src="" style="height:500px">

Differential Revision: https://phabricator.services.mozilla.com/D83731
2020-07-20 22:27:44 +00:00
Ting-Yu Lin 07aaed8b60 Bug 1647520 Part 2 - Set font and line-height to make column reftests stable across all platforms. r=heycam
Without setting font and line-height, these reftests may yield different
results on different platforms because of the default font are
different. Also, their optimal column balancing height may not be an
integer in CSS pixels.

I discover this because they are failing due to 1px column height
difference after we stop searching optimal balancing height within a
certain threshold on either macOS, Windows, or Android.

Differential Revision: https://phabricator.services.mozilla.com/D83730
2020-07-20 22:27:42 +00:00
Ting-Yu Lin 8d402003a7 Bug 1647520 Part 1 - Adjust reftests so that the optimal column balancing height is on whole CSS pixels. r=heycam
* floats-clear-multicol-balancing-*:

Change border-width from "normal" to "5px" so that the optimal column
height is 85px. This also makes those reftests renders the same across
all browsers since each browser renders "normal" differently.

* column-balancing-overflow-005:

This test is already wrong as its height is 13px/3 = 4.3333px, so it can
pass with some fuzzy. This patch makes the target column height
4px (including the children's overflow). This is the same as the `<p>`'s
height 4px in reference file.

* box-decoration-break-border-image:

Add 1px to .vbreak so that the optimal column balancing height is a
integer. Also, remove a whitespace between two `<span>` in `<pos2>` to make the
test more robust because the width of the whitespace is not an integer.

Differential Revision: https://phabricator.services.mozilla.com/D83729
2020-07-20 22:27:35 +00:00
Ting-Yu Lin 1fa50acb6d Bug 1637130 - Update the comment for overflow areas in nsLineBox. r=dbaron
The combined overflow area has been split into ink and scrollable
overflow areas in bug 542595. Drop the sentence related to it, and
update the old comment.

Differential Revision: https://phabricator.services.mozilla.com/D84232
2020-07-20 22:07:09 +00:00