Commit graph

1758 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
bc989db245 Bug 1787623 - Make invalid and unsupported filters paint the unfiltered frame. r=botond
https://drafts.fxtf.org/filter-effects/#typedef-filter-url:

> A filter reference to a filter element. For example
> url(commonfilters.svg#filter). If the filter references a non-existent
> object or the referenced object is not a filter element, then the
> whole filter chain is ignored. No filter is applied to the object.

Differential Revision: https://phabricator.services.mozilla.com/D156074
2022-09-05 10:24:14 +00:00
criss
41e24fc43c Backed out changeset c3d6bd944022 (bug 1787623) for causing mochitest failures on test_filter_crossorigin.html . CLOSED TREE 2022-09-05 09:21:57 +03:00
Emilio Cobos Álvarez
8636e7bfbc Bug 1787623 - Make invalid and unsupported filters paint the unfiltered frame. r=botond
https://drafts.fxtf.org/filter-effects/#typedef-filter-url:

> A filter reference to a filter element. For example
> url(commonfilters.svg#filter). If the filter references a non-existent
> object or the referenced object is not a filter element, then the
> whole filter chain is ignored. No filter is applied to the object.

Differential Revision: https://phabricator.services.mozilla.com/D156074
2022-09-04 20:53:04 +00:00
Marian-Vasile Laza
5907792df1 Backed out changeset b134d587690d (bug 1787623) for causing reftest failures on filter-basic-01.svg. CLOSED TREE 2022-09-04 17:56:37 +03:00
Emilio Cobos Álvarez
07b3a81950 Bug 1787623 - Make invalid and unsupported filters paint the unfiltered frame. r=botond
https://drafts.fxtf.org/filter-effects/#typedef-filter-url:

> A filter reference to a filter element. For example
> url(commonfilters.svg#filter). If the filter references a non-existent
> object or the referenced object is not a filter element, then the
> whole filter chain is ignored. No filter is applied to the object.

Differential Revision: https://phabricator.services.mozilla.com/D156074
2022-09-04 07:43:56 +00:00
Emilio Cobos Álvarez
d6c13d0b23 Bug 1785903 - Use inset rect as the border area to compute shape radii. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D155072
2022-08-22 22:15:24 +00:00
Emilio Cobos Álvarez
3b6039fcf1 Bug 1780075 - Remove outline-style: auto pref. r=layout-reviewers,dholbert
All platforms support it, so just assert instead.

Differential Revision: https://phabricator.services.mozilla.com/D152109
2022-07-19 09:25:11 +00:00
Jeff Muizelaar
5cbce534c4 Bug 1779602 - Remove nsImageGeometryMixin. r=tnikkel
nsImageGeometryMixin was disabled in bug 1776198. No problems have shown up
so let's get rid of it.

Differential Revision: https://phabricator.services.mozilla.com/D151864
2022-07-18 21:20:50 +00:00
criss
5ea9694f10 Merge autoland to mozilla-central. a=merge 2022-07-15 00:43:42 +03:00
Jeff Muizelaar
d4b42e2000 Bug 1779580 - Use a nsRect instead of region for the visible area. r=mstange
The region could never be more complicated than a single rect anyways.

Differential Revision: https://phabricator.services.mozilla.com/D151831
2022-07-14 15:25:13 +00:00
Emilio Cobos Álvarez
bc6e066129 Bug 1778718 - Make filters on the root work when using fallback drawing. r=tnikkel
This code-path will be hit with the next patch.

Depends on D151473

Differential Revision: https://phabricator.services.mozilla.com/D151474
2022-07-12 09:46:01 +00:00
Dan Robertson
83ab6a777b Bug 1753019 - Adjust sticky position elements for the dynamic toolbar. r=botond
Use the animation id from the stacking context to find the hit-testing tree node
for hit tests of elements that are sticky positioned. Then use this hit-testing
tree node reference to apply APZ transforms if the sticky positioned element is
stuck to the root content.

Differential Revision: https://phabricator.services.mozilla.com/D150047
2022-07-04 18:14:59 +00:00
Dan Robertson
affccc0acb Bug 1753019 - Use the animation id to identify hit testing metadata. r=botond,gw
## Summary

Pass the fixed position element animation id through webrender, returning the
the animation id in the hit-test result if the element is a fixed position
element. This animation id then can be used to lookup the relevant Hit-Testing
Tree Node, which can be used to find the fixed (or sticky) position side bits.

## Motivation

Sticky content can be currently stuck to the root content or not, based on the
scroll position. As a result, when hit testing sticky content, APZ needs both
the sticky position side bits and additional information to determine if the
element is currently stuck to the root content. This is needed to fix the
hit-testing of sticky position content when a APZ transform is being applied,
such as overscroll and hiding the dynamic toolbar.

## Implementation

The information needed to determine if a element is currently stuck to the root
content and the fixed/sticky position side bits is already stored in the
hit-testing tree node. Any hit test result should have a corresponding
hit-testing tree node entry. When a hit-test result contains a animation id and
a hit-testing tree node is found, we can store a pointer to this node and use
this to check the fixed/sticky position side bits. Something similar is already
done for hit test results when a scrollbar is hit.

Differential Revision: https://phabricator.services.mozilla.com/D148648
2022-07-04 18:14:58 +00:00
Jeff Muizelaar
c2582e4fc1 Bug 1776112 - Stop temporarily setting the building rect to the paint rect. r=mstange
This doesn't seem to serve any purpose anymore. MOZ_RELEASE_ASSERTing
if mBuildingRect is read during ::Paint doesn't show it happening
anywhere.

Differential Revision: https://phabricator.services.mozilla.com/D150066
2022-06-23 15:04:27 +00:00
Glenn Watson
d784bfaee9 Bug 1775188 - Remove direct use of ClipId on stacking contexts r=gfx-reviewers,lsalzman
In future, stacking contexts, hit-tests and prims will all use
clip-chains rather than the old-style ClipId references.

Differential Revision: https://phabricator.services.mozilla.com/D149844
2022-06-21 20:23:59 +00:00
Daniel Holbert
94532509a5 Bug 1774879 part 5: Remove ComputedStyle* param from nsDisplayBackgroundImage::AppendBackgroundItemsToTop, since all callers pass nullptr (implicitly or explicitly). r=emilio
This patch doesn't change behavior.

I was initially going to promote this param to be const (which is an
improvement that's unlocked by earlier patches this series), but in doing so
I realized the param is entirely unnecessary. So, let's just remove it.

Differential Revision: https://phabricator.services.mozilla.com/D149678
2022-06-18 21:20:51 +00:00
Daniel Holbert
92b1de01bb Bug 1774879 part 3: Add 'const' to local var ComputedStyle pointers that we pass to DetermineBackgroundColor and IsTransparent (which now accept const). r=emilio
This patch does not affect behavior; it's just a const-correctness fix.

Differential Revision: https://phabricator.services.mozilla.com/D149676
2022-06-18 00:45:20 +00:00
Daniel Holbert
b99919ed77 Bug 1774879 part 2: Use const ComputedStyle* in various places for nsDisplayBackgroundImage and its InitData struct. r=emilio
This patch doesn't change behavior; it's just a const-correctness fix.

This patch doesn't have any directly relation to the previous patch in this
series, but it's required for the next patch in this series.

Differential Revision: https://phabricator.services.mozilla.com/D149675
2022-06-18 00:45:20 +00:00
Daniel Holbert
cdb88a2da1 Bug 1774261 part 2: Simplify nsCSSRendering::FindBackgroundFrame to directly return its result instead of using an outparam. r=emilio
This patch doesn't change behavior.

This is similar to the previous patch in this series, but now for
FindBackgroundFrame().

Differential Revision: https://phabricator.services.mozilla.com/D149338
2022-06-17 21:55:21 +00:00
Emilio Cobos Álvarez
cce6544a41 Bug 1770063 - Prevent fallback backdrop filters on root. r=gfx-reviewers,gw
Much like https://searchfox.org/mozilla-central/rev/4519912ada795963299e4ba84c324adba762eff3/layout/painting/nsDisplayList.cpp#8418

Differential Revision: https://phabricator.services.mozilla.com/D149236
2022-06-15 08:56:58 +00:00
Botond Ballo
2c303ddd7c Bug 1773256 - Use ProjectPoint when transforming coordinates from parent to child in BrowserParent. r=tnikkel
This patch also backs out the incorrect fix for bug 1745834
(see comment 12 on the bug for an explanation).

Differential Revision: https://phabricator.services.mozilla.com/D149321
2022-06-15 05:29:52 +00:00
Emilio Cobos Álvarez
255763ef57 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Nicolas Silva
0d0c66fe9e Bug 1773024 - Initialize mShouldFlatten. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D148506
2022-06-07 15:05:09 +00:00
Miko Mynttinen
b6d4fd1365 Bug 1771929 - Add methods to copy nsDisplayList and nsDisplayListSet r=tnikkel
Also adds nsDisplayListSet::IsEmpty() and moves the list pointers in an array.

Differential Revision: https://phabricator.services.mozilla.com/D147765
2022-06-01 15:37:12 +00:00
Miko Mynttinen
f551179ad1 Bug 1771754 - Improve display list logging r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D147665
2022-05-31 15:45:31 +00:00
Norisz Fay
de34316215 Backed out changeset b4f7e56bdfbb (bug 1771754) for causing build bustages CLOSED TREE 2022-05-31 16:11:37 +03:00
Miko Mynttinen
3a52c4b85b Bug 1771754 - Improve display list logging r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D147665
2022-05-31 12:46:22 +00:00
Miko Mynttinen
b72bc79cff Bug 1766650 - Store modified frames in display root frame RetainedDisplayListBuilder r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D144889
2022-05-30 14:20:58 +00:00
Emilio Cobos Álvarez
c8ac345ec7 Bug 1769774 - Stop tracking painted PresShells. r=mstange
After bug 1730284 we don't use it for throttling iframes, so the only
remaining use the test-only nsIDOMWindowUtils.paintCount. None of the
tests using it rely on the empty transaction case, so we should be able
to just remove this.

Differential Revision: https://phabricator.services.mozilla.com/D146589
2022-05-27 11:12:19 +00:00
Glenn Watson
5b096fbcd2 Bug 1769953 - Only force tile cache slice for root scroll bar. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D147370
2022-05-26 03:30:50 +00:00
Noemi Erli
71bfa628d4 Backed out changeset ce5bb779d929 (bug 1769953) for causing webrender failures in overflow-top-left.html CLOSED TREE 2022-05-26 06:14:14 +03:00
Glenn Watson
003c174717 Bug 1769953 - Only force tile cache slice for root scroll bar. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D147370
2022-05-25 22:06:40 +00:00
Cristian Tuns
a089bcae5b Backed out changeset ad9f67e4e822 (bug 1769774) for causing build bustages after backout of Bug 1730284 CLOSED TREE 2022-05-25 16:10:08 -04:00
Brad Werth
fc7d14a59a Bug 1752919: Make tiled images respect opacity applied as color. r=gw
This eliminates the need to determine when WebRender will apply opacity without a
filter, since it will now always apply opacity correctly for both tiled and untiled
images.

Differential Revision: https://phabricator.services.mozilla.com/D147102
2022-05-25 18:58:21 +00:00
Emilio Cobos Álvarez
7789efcab7 Bug 1769774 - Stop tracking painted PresShells. r=mstange
After bug 1730284 we don't use it for throttling iframes, so the only
remaining use the test-only nsIDOMWindowUtils.paintCount. None of the
tests using it rely on the empty transaction case, so we should be able
to just remove this.

Differential Revision: https://phabricator.services.mozilla.com/D146589
2022-05-25 17:55:17 +00:00
Glenn Watson
0c67406f3b Bug 1769682 - Add support for filters on backdrop-filter elements r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D146529
2022-05-17 19:51:24 +00:00
Glenn Watson
b96ac34916 Bug 1765525 - Fix gecko DL creation for backdrop-filters with clips r=gfx-reviewers,miko
Change to derive from nsDisplayEffectsBase, since the backdrop-filter
can still have a visual bounds (and effect) even if the child
stacking context has no items. Also use the same approach to get
the bounding rect and implement GetBounds as nsDisplayFilters uses.

Differential Revision: https://phabricator.services.mozilla.com/D145295
2022-05-17 01:53:33 +00:00
Glenn Watson
63d7dcbcd1 Bug 1768986 - Remove nsDisplayBackdropRoot r=gfx-reviewers,lsalzman
It's not possible to implement backdrop-filter with gecko adding
explicit boundaries for backdrop roots, since backdrop filters
can sample from a backdrop in a parent iframe. In this case, the
parent display list (in one process) doesn't see a backdrop filter,
so no root display item is added, even if there is a child display
list (in another process) that has a backdrop-filter.

This patch just removes the existing backdrop-filter root display
items from Gecko. A follow up patch will add implicit backdrop
root handling inside WR itself, where we have access to all of the
display lists.

Differential Revision: https://phabricator.services.mozilla.com/D146148
2022-05-15 22:42:22 +00:00
Glenn Watson
cebe610723 Bug 1768983 - Add prim flag for checkerboarding backgrounds r=gfx-reviewers,lsalzman
Although not needed right now (checkerboarding backgrounds get
a slice anyway due to being a different scroll root), this will
be important for the upcoming work to make backdrop filter
roots implicit. This allows WR to know when slicing up a content
slice if the prim is relevant to the backdrop root.

Differential Revision: https://phabricator.services.mozilla.com/D146145
2022-05-15 21:54:25 +00:00
Emilio Cobos Álvarez
5302cc0936 Bug 1423746 - Filter on root should not establish containing block for fixedpos elements. r=mstange
Teach nsDisplay{Filters,BackdropFilters} to use a style that doesn't
belong to mFrame for the root frame, and use it as needed.

Remove the BackdropFilters::CanCreateWebrenderCommands call because it
was testing for StyleSVGEffects::mFilters rather than mBackdropFilters,
so it was doing nothing.

Differential Revision: https://phabricator.services.mozilla.com/D146188
2022-05-13 10:02:58 +00:00
Emilio Cobos Álvarez
f260713835 Bug 1768846 - Don't compute transform matrix twice while untransforming dirty / visible rects. r=boris
This code can appear in profiles as seen in bug 1768766.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D146070
2022-05-11 19:20:04 +00:00
Razvan Cojocaru
9788952c5a Bug 1733313 - Change EffectsInfo::mScaleX/Y into a Scale2D and rename to mRasterScale. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D144274
2022-04-26 03:12:38 +00:00
Botond Ballo
93da7c69aa Bug 1745834 - When adding a 3D transform to WebRenderScrollData, project it to 2D when appropriate. r=tnikkel
The main-thread codepath projects 3D transforms to 2D in
nsLayoutUtils::GetTransformToAncestor() when the transformed frame
returns false for Combines3DTransformWithAncestors().

This patch makes the transforms sent to APZ behave the same way.

Differential Revision: https://phabricator.services.mozilla.com/D142522
2022-04-16 01:37:38 +00:00
Emilio Cobos Álvarez
1ce0975b8e Bug 1761493 - Make Gecko internally consistent wrt what a link is. r=smaug
This is mostly edge-casey, but see bug 1757156 for an example where it's
causing some issues (granted, they could use `href="#"` or something
instead of an empty href).

It feels weird if a link looks like a link (because the CSS definition
of a link matches, which is "has an href") but then mostly doesn't
behave as a link.

We can't navigate anywhere if we don't have a valid URI but maybe JS
handles the relevant events as in bug 1757156.

Use the CSS definition (has href) since that's interoperable across
browsers. This should also make some stuff much faster (since checking
'is link' is now just a bit check instead of a virtual call).

(Awaiting try results, if no tests need adjustments then I need to write
some)

Differential Revision: https://phabricator.services.mozilla.com/D142107
2022-03-30 17:34:31 +00:00
Emilio Cobos Álvarez
377390cc8a Bug 1759919 - Don't stop looking for intersecting frames too early in case there are fully-opaque transformed elements. r=miko,mconley
nsDisplayTransform::HitTest clips the rect it passes to its children,
and thus intersecting the whole area isn't relevant.

Depends on D141300

Differential Revision: https://phabricator.services.mozilla.com/D141301
2022-03-17 15:37:31 +00:00
Emilio Cobos Álvarez
1d365913dc Bug 1759749 - Avoid heap-allocating a rect property for most common outline case. r=dholbert
Now that we don't include overflow in outlines (bug 1739894) the
overwhelmingly common case is that innerRect == GetRectRelativeToSelf(),
except on a couple special cases.

Avoid storing the property in those cases. The test introduced in the
patch above still ensures we invalidate rendering correctly even without
the presence of the assert.

Depends on D141320

Differential Revision: https://phabricator.services.mozilla.com/D141321
2022-03-17 12:16:16 +00:00
Emilio Cobos Álvarez
384bfcf2b6 Bug 1757230 - Avoid unneeded includes in nsTextFrame.h. r=longsonr
Move stuff to the C++ file where possible, and move ClipEdges to
nsTextFrame since it's the only thing using it (rather than keeping it
in nsDisplayText).

Also avoids a RemoteBrowser.h include from nsDisplayList.h while at it.

This came up in https://phabricator.services.mozilla.com/D137271#inline-768125

Differential Revision: https://phabricator.services.mozilla.com/D139759
2022-02-25 22:18:11 +00:00
Jeff Muizelaar
ee8edce30e Bug 1755975 - Pass rect or path directly to Clip() instead of manually creating a path. r=gfx-reviewers,mstange
Differential Revision: https://phabricator.services.mozilla.com/D139038
2022-02-24 14:42:35 +00:00
Nicolas Silva
50ca258be2 Bug 1755747 - Add support for antialiased non-snapped rectangles. r=gfx-reviewers,aosmond
We need them for SVG primitives.

This patch adds a bit of plumbing to disable snapping some of the primitives and forcing the antialiasing shader feature where needed, and uses it for SVG solid rectangles and images.

Differential Revision: https://phabricator.services.mozilla.com/D139024
2022-02-23 13:37:39 +00:00
Miko Mynttinen
017d02d0ff Bug 1714584 - Part 2: Remove nsDisplayList::RemoveBottom() r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138153
2022-02-22 23:42:18 +00:00