Commit Graph

487 Commits

Author SHA1 Message Date
Matt Woodrow
93fd0e91fb Bug 1720152 - Recurse into replay for dependencies, rather than using a temp surface. r=jrmuizel,bobowen,emilio
Differential Revision: https://phabricator.services.mozilla.com/D120050
2021-08-09 22:07:36 +00:00
Emilio Cobos Álvarez
9bb330a9b6 Bug 1677324 - Add the ability for subdocuments to keep painting another remote subdoc. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D121197
2021-08-01 21:45:56 +00:00
Miko Mynttinen
8df6649834 Bug 1720804 - Part 1: Move majority of the display list code inside mozilla namespace r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120041
2021-07-19 11:28:20 +00:00
Alexandru Michis
9b9c5fe24e Backed out 2 changesets (bug 1720804) for causing bustages.
CLOSED TREE

Backed out changeset 5278e88c6d34 (bug 1720804)
Backed out changeset 1acb4ed79b6b (bug 1720804)
2021-07-16 18:10:11 +03:00
Miko Mynttinen
397ffc88e1 Bug 1720804 - Part 1: Move majority of the display list code inside mozilla namespace r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120041
2021-07-16 14:36:34 +00:00
Miko Mynttinen
89816c07cd Bug 1720803 - Merge nsDisplayItemBase and nsDisplayItem r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120039
2021-07-16 13:11:40 +00:00
Emilio Cobos Álvarez
f088ac79f1 Bug 1716537 - Allow updating viewport dimensions on paginated subdocuments. r=mattwoodrow
As those don't have the same incremental reflow issues as root paginated
documents, and we do need this for remote iframes to update their
viewport.

Differential Revision: https://phabricator.services.mozilla.com/D119104
2021-07-08 13:21:50 +00:00
Timothy Nikkel
1570c7f606 Bug 1715187. Factor out the resolution from the transform we set on the WebRenderLayerScrollData in nsDisplayRemote::UpdateScrollData. r=botond,hiro
The resolutio needs to be applied on top of any other transforms on that WebRenderLayerScrollData.

Differential Revision: https://phabricator.services.mozilla.com/D118326
2021-07-08 09:48:20 +00:00
Narcis Beleuzu
ea843eb725 Backed out 2 changesets (bug 1716537) for WP failures on iframe-cross-origin-print.sub.html
Backed out changeset aa3e3f80bd68 (bug 1716537)
Backed out changeset 3226bc23c713 (bug 1716537)
2021-07-07 23:20:47 +03:00
Emilio Cobos Álvarez
ac59befbbe Bug 1716537 - Allow updating viewport dimensions on paginated subdocuments. r=mattwoodrow
As those don't have the same incremental reflow issues as root paginated
documents, and we do need this for remote iframes to update their
viewport.

Differential Revision: https://phabricator.services.mozilla.com/D119104
2021-07-07 18:40:11 +00:00
Edgar Chen
c8e0351b70 Bug 1716762 - Don't allow focus to move to remote iframe which is display: none; r=emilio
Make it behave the same as in-process iframe.

Differential Revision: https://phabricator.services.mozilla.com/D118002
2021-07-07 12:08:18 +00:00
Butkovits Atila
15ebcbe33d Backed out 2 changesets (bug 1716537) for causing failures at iframe-cross-origin-print.sub.html. CLOSED TREE
Backed out changeset ddc93b2746df (bug 1716537)
Backed out changeset 7086ac4e5818 (bug 1716537)
2021-07-06 21:42:14 +03:00
Emilio Cobos Álvarez
db987c56f6 Bug 1716537 - Allow updating viewport dimensions on paginated subdocuments. r=mattwoodrow
As those don't have the same incremental reflow issues as root paginated
documents, and we do need this for remote iframes to update their
viewport.

Depends on D119103

Differential Revision: https://phabricator.services.mozilla.com/D119104
2021-07-06 16:54:41 +00:00
Dorel Luca
f9f2388e52 Backed out 2 changesets (bug 1716537) for Build bustages. CLOSED TREE
Backed out changeset 0b5bfe85b344 (bug 1716537)
Backed out changeset c6561b266910 (bug 1716537)
2021-07-06 18:53:22 +03:00
Emilio Cobos Álvarez
86bc587a47 Bug 1716537 - Allow updating viewport dimensions on paginated subdocuments. r=mattwoodrow
As those don't have the same incremental reflow issues as root paginated
documents, and we do need this for remote iframes to update their
viewport.

Depends on D119103

Differential Revision: https://phabricator.services.mozilla.com/D119104
2021-07-06 15:17:44 +00:00
Miko Mynttinen
0b3496b0c7 Bug 1494676 - Always consider scrollframes with will-change: scroll active r=tnikkel
This bypasses will-change budgeting for frames will-change: scroll.

Differential Revision: https://phabricator.services.mozilla.com/D118373
2021-06-23 13:10:15 +00:00
Daniel Holbert
876ec88459 Bug 1698987: Use GetCrossDocParentFrameInProcess() in nsSubDocumentFrame. r=tnikkel
This patch doesn't change behavior; GetCrossDocParentFrameInProcess() is just a
wrapper for GetCrossDocParentFrame(), which is what we were calling before.

The "InProcess" version of this API (which we're migrating to in this patch) is
used to annotate GetCrossDocParentFrame() callsites that have been vetted as
being OK with the fact that this API returns null at the boundary of a
cross-origin iframe, if fission is enabled.

In this patch, the two calls that I'm migrating are inside of
EndSwapDocShellsForViews, which gets called when a tab is dragged between
windows.  I'm annotating these two calls as OK, because:

- the first call is about maintaining the NS_FRAME_IN_POPUP state, which is
  used for things like the menulist-dropdown popup.  This bit doesn't need to
  be propagated across process boundaries.
- the second call is about propagating a "needs-paint" notification up to
  ancestor documents. I think we already handle paint invalidation for
  cross-process iframes properly, independent of the explicit invalidation that
  we're doing here.

Differential Revision: https://phabricator.services.mozilla.com/D108704
2021-03-16 23:54:09 +00:00
Miko Mynttinen
84e1171509 Bug 1526970 - Part 1: Store the list of display items the frame has as a member variable instead of frame property r=mattwoodrow,emilio
Differential Revision: https://phabricator.services.mozilla.com/D104059
2021-02-24 22:22:17 +00:00
Gerald Squelart
f25e1c0093 Bug 1691589 - Reduce reliance on GeckoProfiler.h when only labels (and maybe markers) are needed - r=necko-reviewers,geckoview-reviewers,sg,agi,florian
There are no code changes, only #include changes.
It was a fairly mechanical process: Search for all "AUTO_PROFILER_LABEL", and in each file, if only labels are used, convert "GeckoProfiler.h" into "ProfilerLabels.h" (or just add that last one where needed).
In some files, there were also some marker calls but no other profiler-related calls, in these cases "GeckoProfiler.h" was replaced with both "ProfilerLabels.h" and "ProfilerMarkers.h", which still helps in reducing the use of the all-encompassing "GeckoProfiler.h".

Differential Revision: https://phabricator.services.mozilla.com/D104588
2021-02-16 04:44:19 +00:00
Ting-Yu Lin
4212852170 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-26 02:47:40 +00:00
Csoregi Natalia
c578110922 Backed out 8 changesets (bug 1686603) for causing crashtest failures. CLOSED TREE
Backed out changeset 94b5d0986d27 (bug 1686603)
Backed out changeset e7edf6fcc41d (bug 1686603)
Backed out changeset 4c9271f07178 (bug 1686603)
Backed out changeset 7013b95266ae (bug 1686603)
Backed out changeset cf7a55638aef (bug 1686603)
Backed out changeset 7717a0f2a37b (bug 1686603)
Backed out changeset c82593b13a61 (bug 1686603)
Backed out changeset fd1d95a1e706 (bug 1686603)
2021-01-26 04:32:13 +02:00
Ting-Yu Lin
e938d6265e Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-25 22:29:31 +00:00
Mats Palmgren
35a8dbdbd9 Bug 1687239 part 2 - Remove plugin support from layout/. r=emilio
Note that there's still a little plugin related code in
widget/ and gfx/ etc after this.  That can be removed
once we remove plugin support from dom/ etc.
The removal from layout/ should be pretty complete though.

Differential Revision: https://phabricator.services.mozilla.com/D102140
2021-01-25 11:53:49 +00:00
Mihai Alexandru Michis
0f4955060c Backed out 7 changesets (bug 1686603) for causing crashtest assertion failures.
CLOSED TREE

Backed out changeset 19cba7d34a7f (bug 1686603)
Backed out changeset 3a0d0155ea5e (bug 1686603)
Backed out changeset f1f672cdd0c6 (bug 1686603)
Backed out changeset 63020922e2fd (bug 1686603)
Backed out changeset 8766ce79ba5e (bug 1686603)
Backed out changeset 965dbe8de1e1 (bug 1686603)
Backed out changeset b1328ee45f43 (bug 1686603)
2021-01-21 09:21:12 +02:00
Ting-Yu Lin
f8c6caafee Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-21 04:17:59 +00:00
Hiroyuki Ikezoe
0561259a69 Bug 1682200 - Apply the top level resolution for iframes in the same process of the top level document. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D100280
2021-01-11 23:52:09 +00:00
Hiroyuki Ikezoe
38a499c778 Bug 1682197 - Scale the offset to remote iframe in nsDisplayRemote::BuildLayer. r=mattwoodrow
When the iframe is inside a scaled container, the offset to the reference frame
needs to be scaled.

This change fixes both a rendering issue (bug 1682197) and a hit-testing issue
(bug 1682200) altogether for non WebRender.

Differential Revision: https://phabricator.services.mozilla.com/D100218
2021-01-11 23:52:09 +00:00
Cameron McCormack
5b77a97340 Bug 1668106 - Store subdocument intrinsic size and ratio on content rather than frame. r=dholbert
This avoids a problem where we receive the IPC message from the child
with updated intrinsics before an <embed> or <object> has had its frame
constructed in the parent, and drop the update.

Differential Revision: https://phabricator.services.mozilla.com/D99304
2020-12-10 21:34:38 +00:00
Emilio Cobos Álvarez
2697d7f4e6 Bug 1676188 - Send position/size updates to remote print documents at paint time. r=mattwoodrow
As there's no incremental reflow for non-print documents, we can't rely
on FinishReflow getting called.

Not ultra-pretty, better ideas welcome.

Differential Revision: https://phabricator.services.mozilla.com/D96790
2020-11-12 03:31:07 +00:00
Ting-Yu Lin
e49625f040 Bug 1675852 Part 2 - Define extra fallback intrinsic sizes in app units. r=emilio
CSSPixel::ToAppUnits() requires computation at runtime. Since most of
the layout computations require `nscoord`, this patch defines extra
intrinsic sizes in app units.

Differential Revision: https://phabricator.services.mozilla.com/D96258
2020-11-09 20:31:57 +00:00
Ting-Yu Lin
5d700958b5 Bug 1674931 Part 5 - Remove zero-argument ReflowInput::ComputedSizeWithBorderPadding(). r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D95665
2020-11-03 20:07:18 +00:00
Ting-Yu Lin
fba3337e6a Bug 1674863 Part 2 - Use strong types to define fallback intrinsic width, height, and size. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95578
2020-11-03 19:54:44 +00:00
Ting-Yu Lin
75199f4507 Bug 1660122 Part 7 - Implement GetAspectRatio(). r=emilio
This patch moves the preferred aspect-ratio calculation from each
replaced elements' GetIntrinicRatio() into GetAspectRatio(), because
they share the same logic.

For nsImageFrame, the cached mIntrinsicRatio now stores only the image's
intrinsic ratio, not considering the aspect-ratio property.

This patch fixed "object-fit:contain" for canvas, image because
GetIntrinicRatio() no longer considers aspect-ratio. This also fixed
replaced elements' size when both "aspect-ratio:<ratio>" and
"contain:size" is specified.

This also makes us pass some of the aspect-ratio tests because we change
GetIntrinicRatio() into GetAspectRatio() in
nsLayoutUtils::IntrinsicForAxis() in Part5, which is used by nsBlockFrame
(via nsLayoutUtils::IntrinsicForContainer) to implement GetMinISize().

Differential Revision: https://phabricator.services.mozilla.com/D91229
2020-09-29 22:33:05 +00:00
Ting-Yu Lin
41e2882093 Bug 1660122 Part 5 - Add nsIFrame::GetAspectRatio() skeleton, and adapt existing callers. r=emilio
For now, GetAspectRatio() is just an alias for GetIntrinicRatio(). In
Part 7, we're going to have GetAspectRatio() consider aspect-ratio
property so that each replaced elements only need to report their
intrinsic ratio via GetIntrinicRatio(). Non-replaced element can also
call GetAspectRatio() to get the ratio suitable to calculate layout
size.

As of this patch, all the replaced elements'
GetIntrinsicRatio() (including nsImageFrame::mIntrinsicRatio) consider
aspect-ratio properties (added in bug 1639963). This is wrong, because
it affects replaced element's content ratio. So we adapt only callers
[1] involving the computation of the frame's external sizes to retain
the behavior after Part 7.

This change shouldn't change behavior.

[1] Exceptions include 1) a caller in nsIFrame::ComputeSize() checking
the frame has no intrinsic ratio; 2) other frame classes implementing
nsIFrame::GetIntrinsicRatio() by calling their parent's
GetIntrinicRatio(). nsSubDocumentFrame::GetIntrinicRatio() is an
example.

Differential Revision: https://phabricator.services.mozilla.com/D91227
2020-09-29 22:32:50 +00:00
Ting-Yu Lin
fdb20bee5c Bug 1660122 Part 3 - Make nsIFrame::GetIntrinsicRatio() a const method. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D91225
2020-09-29 22:32:40 +00:00
Ting-Yu Lin
ee5c720efd Bug 1660122 Part 2 - Mark more methods in nsHTMLCanvasFrame and nsSubDocumentFrame 'const'. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D91224
2020-09-29 22:32:33 +00:00
Emilio Cobos Álvarez
cb233b8098 Bug 1557645 - Clone OOP iframes in the right process. r=nika
This works, though probably we want to do some follow-up tweaks, like
the adding of the onload blocker and so on, so that we can avoid the
UpdateDimensions hack.

We may also want a PrintObject in the nsPrintJob tree, perhaps...

Differential Revision: https://phabricator.services.mozilla.com/D90310
2020-09-22 09:57:27 +00:00
Cameron McCormack
3d926b97e1 Bug 1658343 - Propagate intrinsic sizes from SVG documents in embed/object to parent using IPC. r=kmag,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D90055
2020-09-21 02:09:57 +00:00
Ting-Yu Lin
6fa8436245 Bug 1168478 Part 2 - Combine the border and padding arguments for nsIFrame::ComputeSize(). r=dholbert
Also combine the border and padding arguments for
nsContainerFrame::ComputeSizeWithIntrinsicDimensions(), too. This method
is used as a helper to implement ComputeSize() for various replaced
elements. Its callers are all within nsIFrame's derived classes'
overridden methods, so I'm not bothering to convert them in a separate
patch.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D90064
2020-09-14 20:42:22 +00:00
Ting-Yu Lin
7a4abb32a3 Bug 1168478 Part 1 - Combine the border and padding argument for nsIFrame::ComputeAutoSize(). r=dholbert
Also, revise the nsIFrame::ComputeAutoSize()'s documentation.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D90063
2020-09-14 20:39:17 +00:00
Boris Chiou
dc9a75f0f8 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
bdcea722ae 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
05c0dadd44 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
Emilio Cobos Álvarez
bf3e5da2a7 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
Glenn Watson
ae75e4c3b2 Bug 1655376 - Fix early rounding of iframe origin for WR. r=kats,aosmond
WR handles snapping of primitives and clips, and prefers the input
data to be exact floats. This fixes an inconsistency between the
clip and bounds of iframes in WR when there is a fractional
device-pixel ratio set.

Differential Revision: https://phabricator.services.mozilla.com/D85219
2020-07-29 13:09:53 +00:00
Kagami Sascha Rosylight
93741338a8 Bug 1630704 - Part 27: Remove nsFrame from inheritance chain r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81864
2020-07-06 22:29:42 +00:00
Simon Giesecke
a69d79b6db Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Kagami Sascha Rosylight
feacae630a Bug 1647525 - Use HasAnyStateBits() in nsSubDocumentFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81208
2020-06-27 13:17:36 +00:00
Kartikaya Gupta
fe51eee117 Bug 1641246 - Remove nsDisplayResolution. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D77111
2020-05-27 22:17:09 +00:00
Nika Layzell
6940e0c427 Bug 1637088 - Delay creating BrowserBridgeChild until after new PBrowser has been created, r=farre,emilio
Differential Revision: https://phabricator.services.mozilla.com/D75614
2020-05-25 06:06:30 +00:00