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

18042 Коммитов

Автор SHA1 Сообщение Дата
Ting-Yu Lin e96689b1e9 Bug 1316534 Part 8 - Update the comment in ResolveAutoFlexBasisFromRatio(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D90622
2020-09-22 17:44:54 +00:00
Ting-Yu Lin 64d0bd8ec6 Bug 1316534 Part 7 - Removed the unused aMinSizeFallback in CrossSizeToUseWithRatio(). r=dholbert
This doesn't change the behavior because we remove the
`aMinSizeFallback=true` use case in the previous part.

Differential Revision: https://phabricator.services.mozilla.com/D90621
2020-09-22 17:29:28 +00:00
Ting-Yu Lin 6f3acf551c Bug 1316534 Part 6 - Update flex item's transferred size suggestion implementation to match the spec. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D90620
2020-09-22 17:31:28 +00:00
Ting-Yu Lin 1e9812ecfd Bug 1316534 Part 5 - Update flex item's specified / content size suggestion implementation to match the spec. r=dholbert
Spec reference:
https://drafts.csswg.org/css-flexbox-1/#min-size-auto

Differential Revision: https://phabricator.services.mozilla.com/D90454
2020-09-22 21:00:57 +00:00
Ting-Yu Lin 67b8f275d9 Bug 1316534 Part 4 - Fix some incorrect flexbox tests. r=dholbert
test_dynamic_reflow_root_disallowal.html: in the next part, we can calculate
`min-size:auto` as the minimum of specified size and content size correctly
regardless of the value of `flex-basis`. If we do not reset the `inline-size`
(or `block-size`) to `auto`, the flex item's min-width (or min-height) will
always be its specified size (`width:10px` or `height:10px` set in
`gReflowRootCandidateStyles`), and changing `inner` to the content size from
`width:20px` to `width:40px` will have no effect.

flex-minimum-{width,height}-flex-items-005.xht: To make the flex item
resolve min-height:auto as the specified size, the content (image) size
must be larger than it. So here we change the image size to 200x200.
Google Chrome can also pass this test after this patch.

Differential Revision: https://phabricator.services.mozilla.com/D90619
2020-09-22 17:22:08 +00:00
Ting-Yu Lin 564bb2b2b9 Bug 1316534 Part 3 - Make ComputeSizeWithIntrinsicDimensions() respect ComputeSizeFlag::UseAutoBSize. r=dholbert
nsIFrame::ComputeSize() respects UseAutoBSize, and so should
ComputeSizeWithIntrinsicDimensions(). This is essential in order to pass
layout/reftests/w3c-css/submitted/flexbox/flexbox-min-height-auto-002{a,c}.html
and flex-aspect-ratio-img-column-011.html [.flexbox 7] after updating
specified / content size suggestion in a later part.

Differential Revision: https://phabricator.services.mozilla.com/D90618
2020-09-22 17:19:16 +00:00
Ting-Yu Lin 435cf413a5 Bug 1316534 Part 2 - Mark image flex item's size depending on the its intrinsic size. r=dholbert
Flex item's intrinsic size can affect the content size suggestion in the
automatic minimum size resolution, so we shouldn't optimize the reflow
away. https://drafts.csswg.org/css-flexbox-1/#min-size-auto

Add `IsFlexItem()` condition to the methods to avoid set
`IMAGE_SIZECONSTRAINED` bit in `nsImageFrame::Reflow()`. So after
decoding the image and updating its intrinsic size, we'll reflow the
flex item again.

This is needed to pass
testing/web-platform/tests/css/css-flexbox/flex-minimum-width-flex-items-013.html
after updating specified / content size suggestion in a later part.

Differential Revision: https://phabricator.services.mozilla.com/D90453
2020-09-22 17:17:13 +00:00
Ting-Yu Lin 2337811879 Bug 1316534 Part 1 - Removed unused arguments to nsIFrame::ComputeISizeValue() computing LengthPercentage ISize(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D90452
2020-09-22 21:51:39 +00:00
Emilio Cobos Álvarez a4e300194a 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
Razvan Maries 3c91b4555b Backed out changeset bb1437fa93d0 (bug 1665332) for perma failures on ClipManager.cpp. CLOSED TREE 2020-09-22 14:10:37 +03:00
Timothy Nikkel 5039021d77 Bug 1665332. Fetch the value of mZoomableByAPZ in the ScrollFrameHelper constructor so it is always correct. r=kats
Otherwise the only time it gets set is when the ZoomConstraintsClient specifically sets it in response to one of the things that can change it. But if the scroll frame gets reconstructed and one of those things don't happen it will be wrong.

This shows up with desktop zooming scrollbars because we check mZoomableByAPZ (or WantAsyncScroll()) before we use the apz scroll path in ScrollFrameHelper::ScrollBy().

Differential Revision: https://phabricator.services.mozilla.com/D90384
2020-09-22 04:52:18 +00:00
Boris Chiou 51ee1b55f9 Bug 1646096 - Mark bug number for the incorrect calculation of the cross size for column-oriented flex container. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D88686
2020-09-21 15:20:58 +00:00
Boris Chiou 20eecc6085 Bug 1646096 - Fix the calculation of the flex item's cross size with respect to aspect-ratio. r=dholbert
Address aspect-ratio cases for non-replaced elements, for
https://drafts.csswg.org/css-flexbox-1/#cross-sizing.

Differential Revision: https://phabricator.services.mozilla.com/D88195
2020-09-21 15:20:56 +00:00
Boris Chiou 332f0ffe0e Bug 1646096 - Take aspect-ratio into account in FlexItem::mIntrinsicRatio. r=dholbert,TYLin
This patch is just refactoring and is not intended to change behavior.
Basically, we make mIntrinsicRatio also accept the value from
aspect-ratio, so it works for both replaced elements and non-replaced
elements now.

Differential Revision: https://phabricator.services.mozilla.com/D88194
2020-09-21 15:20:53 +00:00
Boris Chiou 05d1002d3a Bug 1646096 - Handle aspect-ratio for Automatic Minimum Size of Flex items. r=dholbert
This tweaks the retrieval of aspect-ratio for Automatic Minimum Size of
Flex Items.

https://drafts.csswg.org/css-flexbox/#min-size-auto

Differential Revision: https://phabricator.services.mozilla.com/D86635
2020-09-21 15:20:49 +00:00
Boris Chiou 42dfbb75a3 Bug 1646096 - Support aspect-ratio for flex items when computing their sizes for ReflowInput. r=dholbert
For flex items with used 'flex-basis:content', normally we resolve that
(to get the 'flex base size') by behaving as if their main-size property
had the value 'max-content'.

But if the flex item has an aspect ratio and a definite cross size, then
'flex-basis:content' is instead supposed to use those values (the ratio
& cross size) to produce the flex base size. So in that scenario, we need
to behave as if the main-size property were 'auto', *not* 'max-content'.
This lets us get past an IsAuto() check & reach the codepath that calls
`Compute{Inline,Block}SizeFromAspectRatio` which does what we want.

Reference:
https://drafts.csswg.org/css-flexbox-1/#valdef-flex-basis-content
https://drafts.csswg.org/css-flexbox-1/#algo-main-item

Differential Revision: https://phabricator.services.mozilla.com/D86633
2020-09-21 15:20:41 +00:00
Cameron McCormack a9b6211496 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
Sylvestre Ledru ec8859e69e Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D90793
2020-09-20 10:14:09 +00:00
Kartikaya Gupta 2273097f9e Bug 1664638 - Replace the ScrollPositionUpdate from scrollframe construction with one that has the scroll position. r=tnikkel
In some cases (in this scenario, with a RTL XUL scrollframe), the scrollframe
can have a nonzero scroll position upon construction or reconstruction, without
having executed the scrolling code in ScrollFrameHelper::RestoreState or
ScrollFrameHelper::ScrollToRestoredPosition. In such cases APZ is not properly
notified of the scroll position, and it can get into a state where it is out of
sync with the main thread scroll position (until a subsequent scroll).

To correct this, we replace the ScrollPositionUpdate that is created during
scrollframe construction with a new ScrollPositionUpdate that holds the correct
scroll position, so that APZ is properly notified of the scroll position.

Differential Revision: https://phabricator.services.mozilla.com/D90674
2020-09-19 00:30:22 +00:00
Kartikaya Gupta ff619cad8f Bug 1654836 - Add a bunch of verbose-level displayport logging. r=nical
Differential Revision: https://phabricator.services.mozilla.com/D90499
2020-09-18 08:05:50 +00:00
Timothy Nikkel bcd2f907ad Bug 1665326. Make the APZ pure relative scroll path in ScrollFrameHelper::ScrollBy handle ScrollUnit::WHOLE scrolls as well. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D90371
2020-09-17 12:34:49 +00:00
Hiroyuki Ikezoe 79b4b86322 Bug 1661316 - Use `visibleRect` for partial pre-render check instead of `dirtyRect`. r=mattwoodrow
With RDL the dirty rect might be empty if the target transformed frame is
marked as `mForceDescendIntoIfVisible`.

Differential Revision: https://phabricator.services.mozilla.com/D90497
2020-09-17 00:52:16 +00:00
Dorel Luca 72ef712fd0 Backed out 10 changesets (bug 1518999) for GeckoView failures in PanZoomControllerTest.scroll. CLOSED TREE
Backed out changeset 7b5bdd071d05 (bug 1518999)
Backed out changeset 401e488734dd (bug 1518999)
Backed out changeset c13e51e17329 (bug 1518999)
Backed out changeset 2a2d67ba15b8 (bug 1518999)
Backed out changeset 3d4d84003227 (bug 1518999)
Backed out changeset 972731762965 (bug 1518999)
Backed out changeset f21b13582dad (bug 1518999)
Backed out changeset 13a4c749a802 (bug 1518999)
Backed out changeset 5a6cea5fd344 (bug 1518999)
Backed out changeset c3bb552e76a3 (bug 1518999)
2020-09-17 02:58:34 +03:00
Sean Feng 11a2849f32 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-09-14 15:13:18 +00:00
Emilio Cobos Álvarez ba7373413f Bug 1665064 - Honor print background image settings on WebRender too. r=kats,jwatt CLOSED TREE
We usually suppress background images in
nsCSSRendering::PaintStyleImageLayerWithSC, but that codepath isn't hit
by WebRender, so instead do it during display list building, the same
way we suppress background colors.

Differential Revision: https://phabricator.services.mozilla.com/D90278
2020-09-15 16:26:05 +00:00
Narcis Beleuzu 746b4430d0 Backed out changeset a572a639204f (bug 1665064) for reftest failures. CLOSED TREE 2020-09-15 21:33:06 +03:00
Emilio Cobos Álvarez f8330284c5 Bug 1665064 - Honor print background image settings on WebRender too. r=kats,jwatt
We usually suppress background images in
nsCSSRendering::PaintStyleImageLayerWithSC, but that codepath isn't hit
by WebRender, so instead do it during display list building, the same
way we suppress background colors.

Differential Revision: https://phabricator.services.mozilla.com/D90278
2020-09-15 16:26:05 +00:00
Emilio Cobos Álvarez c9c8915c30 Bug 1665001 - Don't allow custom page margins to go under the unwriteable margin. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D90231
2020-09-15 14:15:43 +00:00
Emilio Cobos Álvarez edd6eea1f1 Bug 1664691 - Remove nsImageLoadingContent.imageBlockingStatus. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D90037
2020-09-15 11:59:28 +00:00
Timothy Nikkel 0dabf9ce91 Bug 1664419. Need to suppress scrollbar repaint when seting visual viewport offset. r=kats,botond
In ScrollFrameHelper::ScrollToImpl we suppress repainting scrollbars when calling UpdateScrollbarPosition if we've decided not to schedule a paint (because we are sending a pending scroll update instead). Otherwise we repaint which is what we are trying to avoid.

The desktop zooming scrollbars code added a call to UpdateScrollbarPosition in SetVisualViewportOffset because the vv offset is what determines the scrollbar position, no longer the layout scroll position. This means that we can trigger a repaint via that path, and there is a test that checks that we don't.

This patch moves the SetVisualViewportOffset call to just after the code that determines if we need to schedule a paint (it was just before it), and then add the AutoScrollbarRepaintSuppression class.

Differential Revision: https://phabricator.services.mozilla.com/D89902
2020-09-14 21:38:25 +00:00
Ting-Yu Lin ecca275fc4 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 ff5d92f454 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
Ting-Yu Lin d85303971b Bug 1664738 - Add a space to break words in a flex log. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90062
2020-09-14 16:26:37 +00:00
Ting-Yu Lin 64602251d8 Bug 1664738 - Fix ComputeSizeWithIntrinsicDimensions()'s class name in comments and descriptions. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90061
2020-09-14 16:26:09 +00:00
Ting-Yu Lin 3b98b8696e Bug 1664738 - Remove unused ReflowInput::GetDisplay(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90060
2020-09-14 07:09:26 +00:00
Timothy Nikkel 0fd2537d8e Bug 1664661. Make ScrollFrameHelper::UpdateScrollbarPosition use the same calculation for scrollbar attributes as ScrollFrameHelper::ReflowFinished. r=kats
UpdateScrollbarPosition should have been using scroll range and not scrolled rect for a long time. It didn't matter because we only used the top left of the rect which matched until bug 1654933 made GetScrollRangeForUserInputEvents return a rect that wasn't located at 0,0.

Differential Revision: https://phabricator.services.mozilla.com/D90031
2020-09-13 15:27:34 +00:00
Timothy Nikkel 30f528e804 Bug 1664446. Properly wait to make sure any potential scroll events get fired in several tests. r=kats
Doing rAF rAF flushApzRepaints is not enough to make sure that any potential scroll events are sent to content. The reason is that if the apz repaint request causes us to do scrolling on the main thread then the scrolling will be finished after flushApzRepaints, and the scroll event will be pending, but it's not sent until the next refresh driver tick. So we need to do at least one rAF after flushApzRepaints.

Differential Revision: https://phabricator.services.mozilla.com/D90035
2020-09-13 20:21:11 +00:00
Emilio Cobos Álvarez 948fa5c6d2 Bug 1664156 - Remove -moz-suppressed. r=edgar
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2020-09-13 11:33:13 +00:00
Noemi Erli 733e3b440c Backed out changeset 64eb902728bc (bug 1664156) for causing mochitest failures in test_meta_csp_self.html CLOSED TREE 2020-09-12 22:56:18 +03:00
Emilio Cobos Álvarez 4b18c556e4 Bug 1664156 - Remove -moz-suppressed. r=edgar
Per spec we shouldn't behave differently depending on how we blocked the
image/object/etc.

This may have made sense in the past when ad blockers were implemented
via nsIContentPolicy, but I think nowadays it doesn't make sense, and
showing fallback is preferred.

There's a couple extra cleanups we can do after this lands, like
removing HTMLImageElement.imageBlockingStatus and simplifying a bit that
code. But I'll do that in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D89912
2020-09-12 17:39:18 +00:00
Kartikaya Gupta 6ea98dfe88 Bug 1658169 - Move the origin-based physics computation to APZPublicUtils. r=tnikkel
This is just moving code to make it reusable in APZ. As part of this, I replace
use of Preferences::* with the StaticPrefs::* API, because we can't use
Preferences:: in the GPU process and we'll want to be able to invoke this code
from there.

Differential Revision: https://phabricator.services.mozilla.com/D89665
2020-09-12 14:08:10 +00:00
Kartikaya Gupta 3621cb5408 Bug 1662014 - Drop mRelativeOffset and mLastSmoothScrollOrigin. r=tnikkel,botond
The only place these fields are still read are for detecting if an APZ animation
is pending (not yet submitted in a transaction) and we can replace that code
with something slightly simpler. And then delete the unused fields.

Differential Revision: https://phabricator.services.mozilla.com/D88751
2020-09-12 13:06:41 +00:00
Kartikaya Gupta 8b10d15d15 Bug 1662014 - Remove unused fields/APIs. r=botond,tnikkel
These things are all unused now.

Differential Revision: https://phabricator.services.mozilla.com/D88750
2020-09-12 13:06:39 +00:00
Kartikaya Gupta 0863c04a4d Bug 1662013 - Move some function bodies into .cpp files. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D88746
2020-09-12 13:06:20 +00:00
Kartikaya Gupta 9b69abb395 Bug 1662013 - Make the scroll-behavior-element WPT test pass. r=tnikkel
The previous patches caused the scroll-behavior-element WPT to fail, specificallly
the subtest that does a no-op instant scroll immediately following an APZ smooth
scroll, within the same transaction. In this subtest, the APZ smooth scroll
request gets added to mScrollUpdates but then the instant scroll is a no-op
(destination is same as current position) so we early return and don't add a
scroll update for it. This patch adds a bit of code to the early-exit path to
detect this scenario and let APZ know to cancel the animation. By itself this
causes a different test to fail, because we also hit this codepath when the
main thread internally does a no-op instant scroll to reclamp the scroll offset
after a reflow. That requires further refining the condition with a new scroll
origin used for the clamping call.

This ain't the prettiest thing but I'm hopeful that after untangling more of
the surrounding code in the future we can replace this with something more
elegant.

Differential Revision: https://phabricator.services.mozilla.com/D88745
2020-09-12 13:06:12 +00:00
Kartikaya Gupta c942c614e3 Bug 1662013 - Update NotifyLayersUpdated to use the ScrollPositionUpdates. r=tnikkel,botond
This rewrites a big chunk of the NotifyLayersUpdated code (most of the code that
deals with incoming scroll requests from the main-thread) to instead iterate
through the list of ScrollPositionUpdates on the metadata and apply them in
order. A bunch of the ApplyXXXUpdateFrom functions on FrameMetrics have their
innards deduplicated and boil down to a single line, which is then inlined, so
those functions get removed entirely.

Note that this rewrite doesn't yet handle all the possible types of
ScrollPositionUpdate instances, just the ones that the old code handled. In the
future this support will be fleshed out with tests to exercise the relevant
codepaths.

There is also a change to nsGfxScrollFrame which slightly modifies the semantics
of mApzScrollPos to handle the case where multiple relative scrolls happen in a
single transaction. As the implementation now requires multiple relative
ScrollPositionUpdates rather than a single "unified" relative scroll in the
FrameMetrics, we need to update mApzScrollPos for each relative
ScrollPositionUpdate we generate.

Differential Revision: https://phabricator.services.mozilla.com/D88744
2020-09-12 13:06:10 +00:00
Kartikaya Gupta f334f15463 Bug 1662013 - Replace ScrollUpdateInfo with ScrollPositionUpdate. r=botond
The existing ScrollUpdateInfo that is used to store a "paint-skipped scroll" for
empty transactions is very similar to the new ScrollPositionUpdate class, so
we can delete the former and use the latter instead.

The important part of this change is that when applying the pending info to
a FrameMetrics, we now also append the ScrollUpdateInfo to the mScrollUpdates
list on the ScrollMetadata. This aligns the code with the previous few patches,
where we duplicate the scroll information in both the regular FrameMetrics
fields and the ScrollMetadata::mScrollUpdates array.

Note that the existing code may have a defect when multiple paint-skip scrolls
occur in a single transaction; only the newest one is kept. In the case where
the last paint-skip is an absolute scroll, this is fine, but a relative scroll
may end up clobbering a previous absolute scroll. This patch explicitly detects
the scenario with multiple paint-skip scrolls and bails out to a full paint
transaction. As a followup it should be possible to relax this restriction by
storing an array of pending ScrollPositionUpdate instances.

Differential Revision: https://phabricator.services.mozilla.com/D88743
2020-09-12 13:06:02 +00:00
Kartikaya Gupta 378887e276 Bug 1662013 - Introduce a ScrollPositionUpdate and plumb it in. r=tnikkel,botond
This adds a ScrollPositionUpdate class. Code in nsGfxScrollFrame creates
instances of these classes every time the scroll generation is incremented,
and saves them to an array. The array is sent in the scroll metadata to the
compositor as part of a paint transaction.

Currently this data is not used at all on the APZ side, and exists alongside
(independently of) the existing scroll fields, so this patch should not have
any functional effects.

Differential Revision: https://phabricator.services.mozilla.com/D88741
2020-09-12 13:05:53 +00:00
Emilio Cobos Álvarez 1ef2a5628a Bug 1664432 - Remove -moz-user-disabled. r=edgar
We treat it exactly the same as -moz-broken. The pseudo-class is not
exposed to content, so I don't think we have a reason to keep it around.

Differential Revision: https://phabricator.services.mozilla.com/D89904
2020-09-11 19:26:40 +00:00
Ting-Yu Lin b34bab609c Bug 1657345 - Make grid container aware that its available block-size can be unconstrained in paginated context. r=mats
This happens when nsColumnSetFrame reflows its last column in an
unconstrained available block-size.

The wpt test can trigger the bug in a debug build easily. In opt builds like
Nightly, if one wants to load the test manually, additional incremental reflow
(such as opening devtools) may be needed to trigger the bug.

Co-authored-by: Mats Palmgren <mats@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D86672
2020-09-12 00:54:10 +00:00