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

19240 Коммитов

Автор SHA1 Сообщение Дата
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
Miko Mynttinen ddec6eef59 Bug 1714584 - Part 1: Decouple nsDisplayList internal list from nsDisplayItems r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138152
2022-02-22 23:42:18 +00:00
Sebastian Hengst bdb9722e71 Bug 1756303 - Set tests for bug 1682686 to have layout.css.grid-item-baxis-measurement.enabled set as true. r=dholbert DONTBUILD
Bug 1682686 added the tests which need
layout.css.grid-item-baxis-measurement.enabled to be set to `true` independent
of the release channel.

Differential Revision: https://phabricator.services.mozilla.com/D139410
2022-02-22 19:06:19 +00:00
Norisz Fay 2121660ce9 Backed out 2 changesets (bug 1714584) per devs request for causing crashes a=backout
Backed out changeset 3baead3e079b (bug 1714584)
Backed out changeset a2da895a58ce (bug 1714584)
2022-02-22 16:41:57 +02:00
Miko Mynttinen 0bd7fc8c56 Bug 1714584 - Part 2: Remove nsDisplayList::RemoveBottom() r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138153
2022-02-22 00:44:25 +00:00
Miko Mynttinen 28474c7ad2 Bug 1714584 - Part 1: Decouple nsDisplayList internal list from nsDisplayItems r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138152
2022-02-22 00:44:25 +00:00
Miko Mynttinen ad4c9a454d Bug 1722346 - Only append to the end/top of the display list r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D137894
2022-02-21 16:50:22 +00:00
Ting-Yu Lin 5338d4d3a8 Bug 1754598 Part 2 - Fix block frame's block-size and reflow status in ComputeFinalBSize(). r=dholbert
The code at the end of ComputeFinalBSize() does not handle
"box-decoration-break:clone" and the cases where the block frame's reflow status
can change from incomplete to complete. This patch is an attempt to fix all the
possible scenarios.

Differential Revision: https://phabricator.services.mozilla.com/D138967
2022-02-19 02:15:56 +00:00
Ting-Yu Lin eb269e473c Bug 1754598 Part 1 - Pass BlockReflowInput into nsBlockFrame::ComputeFinalBSize(). r=dholbert
ComputeFinalBSize() gets most of its input parameters from BlockReflowInput's
members. Passing BlockReflowInput into it directly so that it can access more
precomputed data in BlockReflowInput such as `ContentBEnd()`.

This is a preparation for the next part that is going to rewrite a large portion
of ComputeFinalBSize().

Differential Revision: https://phabricator.services.mozilla.com/D138966
2022-02-19 02:15:56 +00:00
Sean Feng 2590fe3e7e Bug 1682686 - Fix grid-item measurement cache to actually update the cache when the old value is no longer suitable r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D139068
2022-02-18 20:27:39 +00:00
Andrew Osmond c18a944c15 Bug 1754978 - Part 2. Switch WebGPU to use async image pipelines for display. r=kvark
This patch removes more main thread dependencies from the content side
of WebGPU. Instead of issuing a resource update for an external image,
we now use an async image pipeline in conjunction with
CompositableInProcessManager from part 1. This allows us to update the
HTMLCanvasElement bound to the WebGPU device without having to go
through the main thread, or even the content process after the swap
chain update / readback has been requested.

Differential Revision: https://phabricator.services.mozilla.com/D138887
2022-02-18 15:59:13 +00:00
Iulian Moraru 3dbfe82835 Backed out 2 changesets (bug 1754978) for causing valgrind bustages.
Backed out changeset 491a985fc34a (bug 1754978)
Backed out changeset 98983bf9eaed (bug 1754978)
2022-02-18 00:36:31 +02:00
Markus Stange 9708c4a152 Bug 1724088 - Don't notify ScrollbarActivity in scroll frames without scrollbars. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D121784
2022-02-17 01:31:02 +00:00
Andrew Osmond a18bf8a50c Bug 1754978 - Part 2. Switch WebGPU to use async image pipelines for display. r=kvark
This patch removes more main thread dependencies from the content side
of WebGPU. Instead of issuing a resource update for an external image,
we now use an async image pipeline in conjunction with
CompositableInProcessManager from part 1. This allows us to update the
HTMLCanvasElement bound to the WebGPU device without having to go
through the main thread, or even the content process after the swap
chain update / readback has been requested.

Differential Revision: https://phabricator.services.mozilla.com/D138887
2022-02-16 22:23:20 +00:00
James Teh f68810ef92 Bug 1755229: Call MaybeQueueCacheUpdateForStyleChanges from PruneOrInsertSubtree to handle reconstructed frames. r=morgan,emilio
We already call MaybeQueueCacheUpdateForStyleChanges from DidSetComputedStyle for reconstructed frames.
However, at that point, nsIContent::GetPrimaryFrame (and thus LocalAccessible::GetFrame) returns null, which means we're unable to check for style changes.
Instead, we now handle style changes for reconstructed frames in PruneOrInsertSubtree, at which point the frame is definitely available.

Differential Revision: https://phabricator.services.mozilla.com/D138627
2022-02-16 02:11:57 +00:00
smolnar bb55d9849f Backed out changeset 9682c9f452e6 (bug 1724088) for causing android wr failures. 2022-02-16 01:43:24 +02:00
Markus Stange f49441e60a Bug 1724088 - Don't notify ScrollbarActivity in scroll frames without scrollbars. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D121784
2022-02-15 22:22:35 +00:00
Ting-Yu Lin 476a867c3b Bug 1564726 Part 2 - Fix available block-size for block children in block container with box-decoration-break:clone. r=dholbert,emilio
If a block container has box-decoration-break:clone, its block-end border and
padding (BP) are *usually* drawn at the block-end edge of the current
column/page. Thus, when computing the available block-size for its children, we
should subtract its block-end border BP from it.

When I claim the block-end BP are *usually* drawn at the block-end edge of the
column/page, the exception is when a block container with a definite block-size
runs out of its block-size in a column/page. In this case, the block-end BP is
drawn at the block-end edge of its content-box. This patch wires the effective
content-box block-size computed in nsBlockFrame::Reflow() into
BlockReflowInput's constructor, and we do not subtract its block-end border BP
from the `mContentArea.BSize(wm)` when this case happens.

`BlockReflowInput::ContentBSize()` is the correct available block-size to reflow
the children, precomputed in BlockReflowInput's constructor. See
https://searchfox.org/mozilla-central/rev/c12a59323ee46b29b90c9917a3a7a70ea714ffec/layout/generic/BlockReflowInput.cpp#118-126

The remove hunk was a hack, working only for ColumnSetWrapper with
`box-decoration-break:clone`. It's no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D138367
2022-02-12 02:56:17 +00:00
Ting-Yu Lin de2898b213 Bug 1564726 Part 1 - Make BlockReflowInput::ComputeBlockAvailSpace return the result rect. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D138366
2022-02-12 02:56:16 +00:00
Timothy Nikkel 4ea6801e49 Bug 1742241. Don't access the PresShell's visual viewport offset if we haven't set one. r=botond
If the visual viewport offset is not set on the presshell then calling GetVisualViewportOffset returns (0, 0). This then causes us to introduce an incorrect offset between the layout scroll offset and the visual viewport offset that didn't exist before.

Logically we want to treat an unset visual viewport offset as the layout scroll offset.

Other possible fixes:
-make PresShell::GetVisualViewportOffset return the layout scroll offset if a visual viewport offset is not set
-make this if conditional on a visual viewport offset already being set
-the combination of the two above
All of these fail some tests on try server. I haven't investigated why. If we want to go with any of those potential fixes in the future then this patch is a step on the way there

Differential Revision: https://phabricator.services.mozilla.com/D137873
2022-02-11 11:56:44 +00:00
Andrew Osmond 5e0eefe182 Bug 1754556 - Update WebGPU external image resource only after present is complete. r=kvark
This patch ensures that we only update the external image resource for
WebGPU when there has been an actual change for the resource. In order
to guarantee this, we wait for the present to complete, and only then
issue the update. WebRenderBridgeChild::SendResourceUpdates will also
trigger a frame generation if any resources were changed, which means we
don't need to trigger a paint on the frame itself anymore.

Note that we still have a race condition when we write into the
MemoryTextureHost while in PresentCallback, and the renderer thread may
be accessing the pixel data to upload to the GPU.

Differential Revision: https://phabricator.services.mozilla.com/D138349
2022-02-11 01:26:42 +00:00
Morgan Reschenberg 03a7882ef0 Bug 1744573: Maintain a reference to old ComputedStyle struct on LocalAccessibles r=Jamie,emilio
Differential Revision: https://phabricator.services.mozilla.com/D136435
2022-02-10 17:15:35 +00:00
Timothy Nikkel ed3f0bc491 Bug 1753374. Don't allow pending vv offset updates to become the vv offset purely on the content side without asking apz. r=botond
ScrollFrameHelper::GetVisualViewportOffset will return a pending vv offset if there is one. So if there is a pending vv offset this line will instantly turn it into the current vv offset. This is not how the pending vv offset is supposed to work. It should get sent over to apz, apz can then decide to accept or reject it based on whether it knows about user scrolling that overrides it.

I saw this while reading code for something else, so I don't know of anything specific this fixes.

Depends on D137720

Differential Revision: https://phabricator.services.mozilla.com/D137721
2022-02-09 09:50:31 +00:00
Ting-Yu Lin ae6fa4834c Bug 1752658 Part 7 - Generalize GenerateFlexLines to populate FlexLayoutResult. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D138101
2022-02-08 22:47:20 +00:00
Ting-Yu Lin 141dbba00c Bug 1752658 Part 6 - Pass FlexLayoutResult into ReflowChildren(). r=dholbert
Currently, we pass all the five fields in FlexLayoutResult separately into
ReflowChildren(), but we really should just pass FlexLayoutResult instead.

Differential Revision: https://phabricator.services.mozilla.com/D138100
2022-02-08 22:47:20 +00:00
Ting-Yu Lin 6191c0136b Bug 1752658 Part 5 - Pass flex container's tentative cross size into DoFlexLayout and others. r=dholbert
We've got the tentative cross size before calling DoFlexLayout() in Reflow(), so
we can just use that value in DoFlexLayout and a few other methods.

Also, add "ContentBox" to naming of the main size argument ComputeMainSize().

Differential Revision: https://phabricator.services.mozilla.com/D137365
2022-02-08 22:47:20 +00:00
Ting-Yu Lin 0db4093210 Bug 1752658 Part 4 - Aggregate DoFlexLayout's output data in a struct instead of output arguments. r=dholbert
I found in/out parameters confusing when reasoning the data flow. Aggregating
DoFlexLayout's output data in a struct also reduces DoFlexLayout's number of
arguments.

Differential Revision: https://phabricator.services.mozilla.com/D137364
2022-02-08 22:47:19 +00:00
Ting-Yu Lin f0a1413baf Bug 1752658 Part 3 - Reduce scope of the struts array in Reflow(). r=dholbert
The `struts` array is used only within DoFlexLayout, so we should move it into
`if (!GetPrevInFlow()) { ... }` branch.

Also, move `nsTArray<StrutInfo>&` argument on DoFlexLayout() to the second to
last place so that the output arguments are grouped together after applying Part
4.

Differential Revision: https://phabricator.services.mozilla.com/D137363
2022-02-08 22:47:19 +00:00
Ting-Yu Lin 2b61aa41a4 Bug 1752658 Part 2 - Remove aConsumedBSize from DoFlexLayout() and ComputeCrossSize(). r=dholbert
DoFlexLayout() and ComputeCrossSize() are only called in first-in-flow, so
aConsumedBSize are always 0.

Differential Revision: https://phabricator.services.mozilla.com/D137362
2022-02-08 22:47:19 +00:00
Ting-Yu Lin 6e68c19465 Bug 1752658 Part 1 - Compute gap sizes only in flex container's first-in-flow. r=dholbert
Move the assertion for unconstrained isize to the beginning of Reflow() because
we check it in all cases -- in GetMainSizeFromReflowInput when a flex container
is row-oriented, or in the old code computing gap size and ComputeCrossSize()
when a flex container is column-oriented.

Differential Revision: https://phabricator.services.mozilla.com/D137361
2022-02-08 22:47:18 +00:00
Emilio Cobos Álvarez 70d562520d Bug 1748181 - Provide a pref to make scrollbar-width: thin behave as auto. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D137898
2022-02-07 18:14:31 +00:00
Jeff Muizelaar 50d7560394 Bug 1753530 - Scale rects directly instead of going through a matrix. r=botond
This adds a round trip from double -> float -> double because
CSSRect is float but it should be ok because most users of gfxRect (RectDouble)
should be using Rect instead anyways.

Differential Revision: https://phabricator.services.mozilla.com/D137811
2022-02-04 21:09:19 +00:00
Timothy Nikkel e704102060 Bug 1753372. Don't potentially create a visual viewport offset during scroll frame reflow. r=botond
There's no need to create a visual viewport offset here, only if one already exists do we want to clamp it.

I noticed this while reading code for something else, so I'm not sure if it actually fixes anything.

Differential Revision: https://phabricator.services.mozilla.com/D137720
2022-02-04 05:05:32 +00:00
Emily McDonough ec738be96e Bug 1730091 - Do not apply the scaling factor that accounts for nsPageContentFrame scaling to headers/footers r=dholbert
This scaling factor is to account for ComputePagesPerSheetAndPageSizeTransform,
but that is not used when printing headers/footers, which resulted in the
reversed scale clipping the header/footer.

Differential Revision: https://phabricator.services.mozilla.com/D136830
2022-02-04 01:31:31 +00:00
Emilio Cobos Álvarez f06e26a2b8 Bug 1753516 - Honor sync-decoding hint on webrender. r=aosmond
We weren't doing it. I want to see if it helps with some flickering
intermittents with the patch of bug 1718220.

Not sure how to reliably test this.

Differential Revision: https://phabricator.services.mozilla.com/D137794
2022-02-03 22:28:59 +01:00
Csoregi Natalia 1fe904efad Backed out changeset 8c4414cc1e61 (bug 1730091) for failures on test_printpreview.xhtml. CLOSED TREE 2022-02-03 04:38:16 +02:00
Emily McDonough a4f5e2f581 Bug 1730091 - Do not apply the scaling factor that accounts for nsPageContentFrame scaling to headers/footers r=dholbert
This scaling factor is to account for ComputePagesPerSheetAndPageSizeTransform,
but that is not used when printing headers/footers, which resulted in the
reversed scale clipping the header/footer.

Differential Revision: https://phabricator.services.mozilla.com/D136830
2022-02-02 23:45:25 +00:00
Hiroyuki Ikezoe 860a49babe Bug 1571758 - Inform apz scroll generation to WebRender's ScrollFrame from the main-thread. r=botond
Also inform a flat representing whether the frame's document has scroll-linked
effect or not.

Differential Revision: https://phabricator.services.mozilla.com/D133442
2022-01-31 09:40:35 +00:00
Hiroyuki Ikezoe 562a98e9cc Bug 1571758 - Introduce scroll generation in APZC and SampledAPZCState and inform it to the scrollable frame on the main-thread via RepaintRequest. r=botond
The reason why the global ScrollGeneration::sCounter doesn't work for the APZ
case is the APZ sampler thread is per our top level browser window, so if
there are multiple browser windows at the same time, the sCounter will be muted
from different sampler threads.

Differential Revision: https://phabricator.services.mozilla.com/D133439
2022-01-31 09:40:33 +00:00
Hiroyuki Ikezoe 8aa8a32f2a Bug 1571758 - Split out ScrollGeneration into a new header. r=botond
We are going to use it in various places, APZC, SampledAPZState etc.

Differential Revision: https://phabricator.services.mozilla.com/D133437
2022-01-31 09:40:33 +00:00
Timothy Nikkel 433caa9ce3 Bug 1752720. Remove unused nsIScrollableFrame::IsScrollingActiveNotMinimalDisplayPort. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D137387
2022-01-30 03:47:27 +00:00
Paul Zuehlcke 9a5b3ef765 Bug 1749377 - Set color scheme on window widget to fix PBM dark theme issues on macOS. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D136933
2022-01-29 14:24:58 +00:00
Timothy Nikkel 0661a47e1c Bug 1751806. Remove active content tracking from ActiveLayerTracker as it is unused. r=mstange
Depends on D136816

Differential Revision: https://phabricator.services.mozilla.com/D136817
2022-01-26 11:39:13 +00:00
Nicklas Boman ff6b6326b3 Bug 1725363 - Replace PL_strcasecmp with nsCRT::strcasecmp layout/ r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D129075
2022-01-26 09:57:46 +00:00
Jonathan Kew c52f346619 Bug 1751738 - Check textframe writing mode when generating/drawing a soft-hyphen textrun. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D136910
2022-01-25 23:27:23 +00:00
Ting-Yu Lin 9a07ff37d5 Bug 1751471 - Add a diagnostic preference to always run flex item's final reflow. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D136764
2022-01-25 06:21:08 +00:00
Timothy Nikkel 24844705a8 Bug 1750850. Remove the code that tracks "active layers" from changes made in scroll handlers. r=mstange
This was added in bug 1201330 but with WR isn't really needed anymore and the code causes the expiration timer to fire until the scroll frame becomes inactive (the most common scroll frames stay active, ie root scroll frames).

Differential Revision: https://phabricator.services.mozilla.com/D136806
2022-01-24 23:39:07 +00:00
Miko Mynttinen 138ffc5f52 Bug 1751587 - Demote MOZ_RELEASE_ASSERT to MOZ_DIAGNOSTIC_ASSERT r=emilio
Depends on D136731

Differential Revision: https://phabricator.services.mozilla.com/D136732
2022-01-24 14:48:14 +00:00
Miko Mynttinen 978b3d9089 Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-22 02:37:31 +00:00
Ting-Yu Lin b5adb0a8d3 Bug 1751473 Part 4 - Delete nsHTMLCanvasFrame::mBorderPadding and unused code for handling fragmentation. r=emilio
In general, we don't need to store used border and padding in a derived frame
class, nsIFrame::GetLogicalUsedBorderAndPadding() already provides the data.

While auditing the consumer of `mBorderPadding`, I realize that
nsHTMLCanvasFrame's fragmentation never works because
nsCSSFrameConstructor::CreateContinuingFrame() never creates its continuation,
and nsHTMLCanvasFrame::Reflow() never returns an incomplete reflow status to its
parent.

This patch removes the code that pretended to handle fragmentation to avoid any
confusion. Luckily, with `layout.display-list.improve-fragmentation` enabled by
default, we can still print <canvas> without data loss.

Differential Revision: https://phabricator.services.mozilla.com/D136649
2022-01-22 01:07:19 +00:00
Ting-Yu Lin 0fb428cbcb Bug 1751473 Part 3 - Remove nsHTMLCanvasFrame::GetInnerArea(). r=emilio
The method is equivalent to GetContentRectRelativeToSelf().

Differential Revision: https://phabricator.services.mozilla.com/D136648
2022-01-22 01:07:19 +00:00
Ting-Yu Lin 03683daeeb Bug 1751473 Part 2 - Use CSSIntPoint instead of nsIntPoint in image event handling code. r=emilio
The old code operates in the CSS pixel coordinate, so we should use the type
system to express that. With this patch, nsImageControlFrame, nsImageFrame, and
nsImageMap now have no usage of nsIntPoint.

Differential Revision: https://phabricator.services.mozilla.com/D136647
2022-01-22 01:07:19 +00:00
Ting-Yu Lin 44c2677dcd Bug 1751473 Part 1 - Remove nsImageFrame::GetInnerArea(). r=emilio
The method is equivalent to GetContentRectRelativeToSelf().

Differential Revision: https://phabricator.services.mozilla.com/D136646
2022-01-22 01:07:18 +00:00
Alexandru Michis ae4456b8b6 Backed out 3 changesets (bug 1697979) for causing reftest failures in retained-dl-displayport-1.html
Backed out changeset e4248d811360 (bug 1697979)
Backed out changeset db3882cc536c (bug 1697979)
Backed out changeset ea7ce38abaab (bug 1697979)
2022-01-21 04:01:27 +02:00
Miko Mynttinen 07449db71e Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-21 00:43:34 +00:00
Noemi Erli 2bfdec7254 Backed out 3 changesets (bug 1697979) for causing reftest failures CLOSED TREE
Backed out changeset 4edb10a45d13 (bug 1697979)
Backed out changeset 456b57492294 (bug 1697979)
Backed out changeset 1cb3b14f2f6c (bug 1697979)
2022-01-20 22:25:00 +02:00
Miko Mynttinen 3882f995d9 Bug 1697979 - Part 1: Reuse previously built stacking context display items without merging r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D128413
2022-01-20 18:38:59 +00:00
Jonathan Kew df50ca26dd Bug 1751103 - Short-circuit AdvanceToNextTab when tab-size is zero. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D136480
2022-01-20 13:58:14 +00:00
Miko Mynttinen c1b142f453 Bug 1751018 - Change FrameFlags to EnumSet r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D136392
2022-01-20 00:21:15 +00:00
Dzmitry Malyshau d5354743fd Bug 1695318 - Pass the perspective association from CSS to WR r=gfx-reviewers,bradwerth
Depends on D136163

I have a feeling this isn't exactly the right way to pass this info, since the old WR code must have known about the perspective node without using my new flag.

Differential Revision: https://phabricator.services.mozilla.com/D136180
2022-01-19 22:41:12 +00:00
Timothy Nikkel 1bce68a06f Bug 1749661. Always fire visual viewport resize event even if first reflow. r=botond
I added this check in bug 1725569 because I said it matched other browsers. I'm not sure what testing I did there, or I made a mistake or what but the behaviour is not consistent between browsers.

For top level documents on initial load Safari sends a resize event, Chrome does not. Firefox sends a resize event.

For iframes Chrome and Safari send a resize event. Firefox usually sends a resize event.

Given the inconsistent behaviour here it seems better to err on the side of sending resize events because sites depend on it and might not work without it.

In the testcase from the bug I am able to reproduce about 20% of the time, and the problem is the first reflow check. So I'm removing that and I think it will fix the problem the user is seeing (which sounds to be more consistent).

Differential Revision: https://phabricator.services.mozilla.com/D135698
2022-01-18 08:37:52 +00:00
Emilio Cobos Álvarez b651bfe99a Bug 1744009 - Simplify combobox <select> code. r=mconley,dholbert
With this patch on its own we get some a11y tests failures, but those
are fixed on a later patch.

Combobox select no longer creates frames for its <options>, nor an
nsListControlFrame. Instead, it computes its right intrinsic size using
the largest size of the options. This is better, because we render the
option text using the select style so if the select and option styles
are mismatched it'd cause changes in the size of the select when text
changes. See the following in a build without the patch, for example:

  <select>
    <option>ABC</option>
    <option style="font-size: 1px">Something long</option>
  </select>

This seems like a rather obscure case, but it's important to get it
right, see bug 1741888.

With this patch we use the same setup in content and parent processes
(this needs bug 1596852 and bug 1744152). This means we can remove a
bunch of the native view and popup code in nsListControlFrame. A couple
browser_* tests are affected by this change and have been tweaked
appropriately (the changes there are trivial).

Not creating an nsListControlFrame for dropdown select means that we
need to move a bunch of the event handling code from nsListControlFrame
to a common place that nsComboboxControlFrame can also use. That place
is HTMLSelectEventListener, and I think the setup is much nicer than
having the code intertwined with nsListControlFrame. It should be
relatively straight-forward to review, mostly moving code from one part
to another.

Another thing that we need to do in HTMLSelectEventListener that we
didn't use to do is listening for DOM mutations on the dropdown. Before,
we were relying on changes like text mutations triggering a reflow of
the listcontrolframe, which also triggered a reflow of the
comboboxcontrolframe, which in turn updated the text of the anonymous
content. Now we need to trigger that reflow manually.

There are some further simplifications that can be done after this
lands (cleanup naming of openInParentProcess and so on, among others),
but I'd rather land this first (after the merge of course) and work on
them separately.

Differential Revision: https://phabricator.services.mozilla.com/D132719
2022-01-17 11:10:05 +00:00
Marian-Vasile Laza 35a88d897e Backed out 2 changesets (bug 1744009) for causing reftest failures on select-3.html.
Backed out changeset 3e44e31d3d12 (bug 1744009)
Backed out changeset 619389788775 (bug 1744009)
2022-01-17 11:14:27 +02:00
Emilio Cobos Álvarez a8d469a8d0 Bug 1744009 - Simplify combobox <select> code. r=mconley,dholbert
With this patch on its own we get some a11y tests failures, but those
are fixed on a later patch.

Combobox select no longer creates frames for its <options>, nor an
nsListControlFrame. Instead, it computes its right intrinsic size using
the largest size of the options. This is better, because we render the
option text using the select style so if the select and option styles
are mismatched it'd cause changes in the size of the select when text
changes. See the following in a build without the patch, for example:

  <select>
    <option>ABC</option>
    <option style="font-size: 1px">Something long</option>
  </select>

This seems like a rather obscure case, but it's important to get it
right, see bug 1741888.

With this patch we use the same setup in content and parent processes
(this needs bug 1596852 and bug 1744152). This means we can remove a
bunch of the native view and popup code in nsListControlFrame. A couple
browser_* tests are affected by this change and have been tweaked
appropriately (the changes there are trivial).

Not creating an nsListControlFrame for dropdown select means that we
need to move a bunch of the event handling code from nsListControlFrame
to a common place that nsComboboxControlFrame can also use. That place
is HTMLSelectEventListener, and I think the setup is much nicer than
having the code intertwined with nsListControlFrame. It should be
relatively straight-forward to review, mostly moving code from one part
to another.

Another thing that we need to do in HTMLSelectEventListener that we
didn't use to do is listening for DOM mutations on the dropdown. Before,
we were relying on changes like text mutations triggering a reflow of
the listcontrolframe, which also triggered a reflow of the
comboboxcontrolframe, which in turn updated the text of the anonymous
content. Now we need to trigger that reflow manually.

There are some further simplifications that can be done after this
lands (cleanup naming of openInParentProcess and so on, among others),
but I'd rather land this first (after the merge of course) and work on
them separately.

Differential Revision: https://phabricator.services.mozilla.com/D132719
2022-01-16 23:31:22 +00:00
Timothy Nikkel 9e235485ec Bug 1749286. Remove redundant calls marking remote browsers as hidden. r=miko
Remote browsers are fully hidden by default. The only place we mark them as visible is in nsDisplayRemote::CreateWebRenderCommands

https://searchfox.org/mozilla-central/rev/b3933df6e119bd6caf5d9e5868670348ec26dee3/layout/generic/nsSubDocumentFrame.cpp#1363

and we create a WebRenderUserData item there that marks the remote browser hidden in its destructor

https://searchfox.org/mozilla-central/rev/b3933df6e119bd6caf5d9e5868670348ec26dee3/gfx/layers/wr/WebRenderUserData.cpp#426

So that will mark it hidden when it's no longer visible. And in fact we destroy the WebRenderUserData table for the frame at both call sites that we are removing in this patch. So there shouldn't be any change with this patch.


I think the way this redundancy came about was because the code was first added for the layers backend in

https://hg.mozilla.org/integration/mozilla-inbound/rev/b81cf35a573e

and that of course doesn't user WebRenderUserdata so it needed to mark remote browsers hidden in its own way.

And then for webrender in

https://hg.mozilla.org/integration/mozilla-inbound/rev/ac0ad5d8e9a5

And then when FrameLayerBuilder was removed they got put together directly

https://hg.mozilla.org/mozilla-central/rev/a95f6a0cd9eb


The reason this is important is for bug 1737503. In that bug we destroy and recreate a remote iframe to handle a style change. If we mark a remote browser as hidden we will draw it as blank for one frame. So instead we want to delay this until the end of the next frame so we don't do that.

Differential Revision: https://phabricator.services.mozilla.com/D135575
2022-01-14 08:47:52 +00:00
Ting-Yu Lin e418a257b5 Bug 1745113 Part 3 - Change CountGraphemeClusters() to take a Span parameter. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D135641
2022-01-13 18:36:04 +00:00
Daniel Holbert 080e18fa47 Bug 1663722: Make nsPageSequenceFrame gracefully handle SizeToContent calls. r=emilio
nsPageSequenceFrame does a thing where it grows its desired size to fit the
AvailableISize and ComputedBSize (under the assumption that those are the
actual dimensions of our scrollport, which it wants to make maximal use of).

This behavior causes trouble when it's reflowed under the privileged
'sizeToContent' JS API.  That API makes us reflow with nscoord_MAX as the
viewport's ComputedBSize(), and this nscoord_MAX value gets passed down to be
the nsPageSequenceFrame's ComputedBSize as well.  When we reach the code in
question, we dutifully grow the desired size to that bogus huge value, which is
clearly wrong.

This patch addresses this issue by simply declining to grow the desired size in
the scenario where ComputedBSize() is unconstrained.  This leaves us with
reasonable values for our desired size (which are actually based on the
content, which makes it the right thing to do for the purpose of a
SizeToContent() call).

Differential Revision: https://phabricator.services.mozilla.com/D135762
2022-01-13 06:08:51 +00:00
Sean Feng e2805ac986 Bug 1740702 - Ensure grid's cached measurement won't prevent reflow from happending when its subtree is dirty r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D135611
2022-01-12 21:51:45 +00:00
Sean Feng f7f7f6ccba Bug 1740702 - Add some grid performance logging r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D135610
2022-01-12 21:51:45 +00:00
Ting-Yu Lin 6e286e149e Bug 1748574 - Rewrite the helper that computes scrollbar's intrinsic size. r=dholbert
This patch fixed the following:

1. Make the helper support the vertical writing modes since its callers
GetMinISize() and GetPrefISize() are fully aware of the vertical writing modes.
`overflow-scroll-intrinsic-001.html` verifies this scenario. This also fixed a
testcase with "writing-mode: vertical-lr" in flexbox's
cross-axis-scrollbar.html.

2. Treat scrollbar's intrinsic size "zero" if we have "scrollbar-width: none"
since no scrollbar is showing at all.
`overflow-auto-scrollbar-gutter-intrinsic-003.html` verifies this scenario.

3. Return the scrollbar size if we have "scrollbar-gutter: stable", or twice the
size if we have "scrollbar-gutter: stable both-edges".
`overflow-auto-scrollbar-gutter-intrinsic-{001,002}.html` verifies this
scenario.

Differential Revision: https://phabricator.services.mozilla.com/D135182
2022-01-07 04:13:42 +00:00
Andrew Osmond 99ecadd31a Bug 1748216 - Ensure that we invalidate previously decoded images without a surface ready. r=jrmuizel
Part of how invalidation works with WebRender is that we assume frames
with a WebRenderUserData object attached to them are in view. This means
for images that we must ensure we create an empty
WebRenderImageProviderData object even when we have no provider or
surface for display. This will allow us to invalidate properly when we
get the FRAME_COMPLETE notification from imagelib indicating that the
redecode has completed.

Differential Revision: https://phabricator.services.mozilla.com/D135077
2022-01-04 22:01:26 +00:00
Emilio Cobos Álvarez 17025d2d80 Bug 1748174 - Clean-up a bit touch-action code. r=hiro
This shouldn't change behavior but makes following the code a bit
easier. There's no point in using callbacks for touch-action as:

 * We return the computed flags anyways.
 * Each caller wants to do something different.
 * (more importantly) The callback gets called synchronously.

So move the relevant code to TouchActionHelper and make the callers deal
with the flags as they please. I've preserved the behavior of only doing
the thing if the flags array is non-empty.

Differential Revision: https://phabricator.services.mozilla.com/D134933
2022-01-04 13:31:34 +00:00
Jonathan Kew 982e1a6089 Bug 1734015 - Just return an error (without asserting) from PeekOffsetForLine if line is not found. r=layout-reviewers,emilio
The assertion here was added during the iterator refactoring in bug 1732349,
but is actually bogus. The old code would have returned via the MOZ_TRY_VAR
that wrapped the call to blockFrame->GetLineNumber(); that's replaced by
iter->FindLineContaining(), so we should now check for an error there and
similarly just return to the caller, not assert.

Differential Revision: https://phabricator.services.mozilla.com/D134950
2022-01-03 16:21:53 +00:00
Emilio Cobos Álvarez b975e781a1 Bug 1747922 - Rename StyleMathMLMathVariant -> StyleMathVariant.
MANUAL PUSH: Trivial rename.
2021-12-30 02:35:54 +01:00
Neia Finch b205467245 Bug 1747922 - Replace MathML font constants with enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D134802
2021-12-30 00:34:27 +00:00
Emilio Cobos Álvarez 6b5a53d800 Bug 1747595 - Make color-adjust an alias of print-color-adjust as per spec. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D134779
2021-12-29 21:52:25 +00:00
Ting-Yu Lin 32b84f3235 Bug 1747515 - Remove an obsolete comment in nsFlexContainerFrame.cpp. r=dholbert
We introduced this comment at the very beginning of the flexbox implementation.
Since then, WritingModes.h has obtained the utilities dealing with logical axis,
and CSSAlignUtils.h has supported CSS alignment for both flexbox and grid. All
the helper functions remaining in nsFlexContainerFrame.cpp are related to
flexbox, so I feel it's time we retire this comment.

NPOTB DONTBUILD because this patch changes only comments.

Differential Revision: https://phabricator.services.mozilla.com/D134652
2021-12-25 16:11:29 +00:00
Mike Hommey fce6eb7d83 Bug 1747165 - Replace TK_FLAGS/TK_LIBS with MOZ_GTK3_FLAGS/MOZ_GTK3_LIBS. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D134464
2021-12-23 20:29:07 +00:00
Kagami Sascha Rosylight 8df5508482 Bug 1539884 - Part 26: Mark ScrollFrameHelper::Fire*Event as CAN_RUN_SCRIPT r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D134404
2021-12-23 16:27:22 +00:00
Emilio Cobos Álvarez f80de802b1 Bug 1746310 - Remove nsMenuPopupFrame::GenerateFrames and related code. r=tnikkel
The root of the problem is that nsMenuPopupFrame::GenerateFrames calls
into frame construction without making sure that styles are clean. So it
was pretty much working by chance, sorta.

I was going to fix this by adding the necessary flushes before calling
GenerateFrames, but on closer inspection, the front-end has effectively
already implemented this optimization by only generating the relevant
DOM on popupShowing:

  https://searchfox.org/mozilla-central/rev/a11b63915bd7810a03635d733123448ab5bfcad3/toolkit/content/widgets/menupopup.js#87-91

And for menulists on creation:

  https://searchfox.org/mozilla-central/rev/a11b63915bd7810a03635d733123448ab5bfcad3/toolkit/content/widgets/menupopup.js#151

After bug 1714846 we even destroy frames as needed, for panels.

So I think all of this complexity is unwarranted, and if we need some of
it we should implement it in the front-end like bug 1714846 did, and I'd
rather do this than flushing styles and so on.

There's one tweak I had to do to an nsPlaceholderFrame assertion. The
reason is that now the nsMenuPopupFrames do get their
NS_FRAME_FIRST_REFLOW bit cleared here:

  https://searchfox.org/mozilla-central/rev/bd25b1ca76dd5d323ffc69557f6cf759ba76ba23/layout/xul/nsMenuPopupFrame.cpp#557

Because the IsLeaf() condition here is no longer true:

  https://searchfox.org/mozilla-central/rev/bd25b1ca76dd5d323ffc69557f6cf759ba76ba23/layout/xul/nsMenuPopupFrame.cpp#532

It doesn't change anything though, because this condition never holded
for popups consistently.

Differential Revision: https://phabricator.services.mozilla.com/D134331
2021-12-23 12:55:34 +00:00
Cristian Tuns e1e31e01f2 Backed out 2 changesets (bug 1747165) for causing nightly blockers(bustages) a=backout
Backed out changeset 4b1ab0915c94 (bug 1747165)
Backed out changeset 96043d814772 (bug 1747165)
2021-12-23 08:00:54 -05:00
Ting-Yu Lin 0ddbd1d7f7 Bug 1543267 Part 2 - Make 'space-between' fallback to 'flex-start' for flexbox's abspos children. r=dholbert
Per Alignment spec [1], the default fallback alignment for 'space-between' is
'flex-start'.

[1] https://drafts.csswg.org/css-align/#valdef-align-content-space-between

Differential Revision: https://phabricator.services.mozilla.com/D134544
2021-12-23 02:08:04 +00:00
Ting-Yu Lin 2d47a61355 Bug 1543267 Part 1 - Make 'stretch' fallback to 'flex-start' for flexbox's abspos children. r=dholbert
In Flexbox spec 4.1, Example 3 [1]:
   ... since the absolutely-positioned box is considered to be
   "fixed-size", a value of stretch is treated the same as flex-start.

Also, per Alignment 3 spec [2]:
  The default fallback alignment for 'stretch' is 'flex-start'.

Thus, when computing the alignment for flexbox's abspos children in
CSSAlignmentForAbsPosChild(), we convert 'stretch' to 'flex-start', and let the
subsequent logic convert 'flex-start' to either 'start' or 'end', because
nsAbsoluteContainingBlock don't know how to deal with the flex-relative axis.

This patch makes us behave the same as Google Chrome on the modified testcases.

[1] https://drafts.csswg.org/css-flexbox/#abspos-items
[2] https://drafts.csswg.org/css-align/#valdef-align-content-stretch

Differential Revision: https://phabricator.services.mozilla.com/D134543
2021-12-23 02:08:03 +00:00
Mike Hommey b55194a16f Bug 1747165 - Replace TK_FLAGS/TK_LIBS with MOZ_GTK3_FLAGS/MOZ_GTK3_LIBS. r=firefox-build-system-reviewers,andi
Differential Revision: https://phabricator.services.mozilla.com/D134464
2021-12-22 23:56:24 +00:00
Ting-Yu Lin d570e88e1f Bug 1746098 - Reflow scrolled inner frame in TryLayout() only when sizes of scrollbar gutter change. r=emilio
We now support scrollbar-gutter property. So for example, assume the scroll
container has "scrollbar-gutter:stable". When toggling the visibility of
inline-end scrollbar, we can skip the reflow for the scroll inner frame because
the available inline-size for it cannot change.

This patch teaches TryLayout() to consider the sizes of scrollbar gutter rather
than the (assumed) visibility of scrollbars when deciding the need to call
ReflowScrolledFrame().

Also, TryLayout() doesn't need to report an inconsistent layout unless
the (showHScrollbar, showVScrollbar) pair changes the sizes of scrollbar
gutters.

Differential Revision: https://phabricator.services.mozilla.com/D134373
2021-12-21 22:05:43 +00:00
Kagami Sascha Rosylight d5983682dd Bug 1746934 - Give default value for LineInfo::mIsWrapped r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D134340
2021-12-21 00:56:49 +00:00
Ryan VanderMeulen 13518cda3a bug 1123979 - Remove assertion annotation. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D134192
2021-12-17 21:21:39 +00:00
Ting-Yu Lin fecb1af272 Bug 1745435 - Make non-draggable & non-editable images easier to select. r=emilio
Bug 1550869 made all the non-editable images return a `FrameTarget` with
`userFrameEdge=true`. When the user moves the mouse pointer to select an image
from its left edge, the mouse pointer needs to reach the right edge of the image
in order to complete the selection. This makes it difficult to select an image
at the end of a line.

This patch restores the behavior to select a non-draggable & non-editable image
to it was before bug 1550869. That is, we recognize the image selection when the
mouse pointer moves passed the middle point of the image
width (`OffsetsForSingleFrame`). Both blink and webkit have the same behavior,
but no spec text dictates this behavior, so I mark the wpt test as "tentative".

Differential Revision: https://phabricator.services.mozilla.com/D133960
2021-12-16 22:27:48 +00:00
Jonathan Kew 828754d158 Bug 1746187 - Implement rendering support for hyphenate-character. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133890
2021-12-16 13:47:56 +00:00
Marian-Vasile Laza e3ec8630b1 Backed out 4 changesets (bug 1746187) for causing xpcshell failures on test_css-properties-db.js.
Backed out changeset fa4f889dd0d3 (bug 1746187)
Backed out changeset e3fce2273109 (bug 1746187)
Backed out changeset 6733677ad35d (bug 1746187)
Backed out changeset a4375ff93414 (bug 1746187)
2021-12-16 04:51:13 +02:00
Ting-Yu Lin f6eb41c0f0 Bug 1715112 Part 1 - Implement the rendering of scrollbar-gutter. r=emilio
Here are the ideas of the implementation.

1) When creating ScrollReflowInput, we compute and store the size of the
scrollbar-gutter in `mScrollbarGutterSizes.

2) Provide a ScrollReflowInput::ScrollbarGutter() API that returns the space
occupied by scrollbar gutters or scrollbars, and use it in ReflowScrolledFrame()
and TryLayout().

-----

For test changes:

- The existing scrollbar-gutter changes all assume classic scrollbars that can
create scrollbar gutters, so they won't pass on Android which uses overlay
scrollbars.

- Add scrollbar-gutter-002.html to test when the scrollbar and gutter
are both shown. The reference of this uses padding to simulate
scrollbar-gutter, so it's OK if the platform uses overlay scrollbars.
The next patch will add more variants.

- scrollbar-gutter-dynamic-001.html was never run. Fixed it by adding
`<link rel="match">`.

Differential Revision: https://phabricator.services.mozilla.com/D132664
2021-12-16 01:01:45 +00:00
Jonathan Kew 36031468e9 Bug 1746187 - Implement rendering support for hyphenate-character. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D133890
2021-12-15 23:16:49 +00:00
Marian-Vasile Laza cf9f173039 Backed out 3 changesets (bug 1715112) for causing xpcshell failures on test_css-properties-db.js.
Backed out changeset 6b91412c20e3 (bug 1715112)
Backed out changeset b7cbd5b59fc5 (bug 1715112)
Backed out changeset 9b7d73b6d81e (bug 1715112)
2021-12-16 02:06:25 +02:00
Ting-Yu Lin d37edf8af1 Bug 1715112 Part 1 - Implement the rendering of scrollbar-gutter. r=emilio
Here are the ideas of the implementation.

1) When creating ScrollReflowInput, we compute and store the size of the
scrollbar-gutter in `mScrollbarGutterSizes.

2) Provide a ScrollReflowInput::ScrollbarGutter() API that returns the space
occupied by scrollbar gutters or scrollbars, and use it in ReflowScrolledFrame()
and TryLayout().

-----

For test changes:

- The existing scrollbar-gutter changes all assume classic scrollbars that can
create scrollbar gutters, so they won't pass on Android which uses overlay
scrollbars.

- Add scrollbar-gutter-002.html to test when the scrollbar and gutter
are both shown. The reference of this uses padding to simulate
scrollbar-gutter, so it's OK if the platform uses overlay scrollbars.
The next patch will add more variants.

- scrollbar-gutter-dynamic-001.html was never run. Fixed it by adding
`<link rel="match">`.

Differential Revision: https://phabricator.services.mozilla.com/D132664
2021-12-15 22:40:56 +00:00
Ting-Yu Lin 83c32ae54f Bug 1745828 Part 4 - Revise the computation of mScrollCornerBox and mResizerBox's rects. r=emilio
Currently, mResizerBox's rect (variable `r`) partially depends on the result
of mScrollCornerBox's rect.

This patch makes mScrollCornerBox and mResizerBox compute their own rects (in
variable `r`) in separate if-statements because we can show resizer without
showing scroll corner (due to no scrollbar).

Differential Revision: https://phabricator.services.mozilla.com/D133694
2021-12-14 08:15:13 +00:00
Ting-Yu Lin 143ea4e3e4 Bug 1745828 Part 3 - Remove ScrollFrameHelper::HasResizer(). r=emilio
HasResizer() is equivalent to mResizerBox and is used only within
ScrollFrameHelper, so no need to expose it. Also, remove some unreachable
if-branches.

Differential Revision: https://phabricator.services.mozilla.com/D133693
2021-12-14 08:15:13 +00:00
Ting-Yu Lin bf69629542 Bug 1745828 Part 2 - Revise computation of scrollbars' rects. r=emilio
Revise vRect & hRect computation because the scrollbar gutter can be at both
inline start and inline end sides. For example, we can no longer use
`aInsideBorderArea.width - mScrollPort.width` to get the actual width of the
vertical scrollbar. We want to compute them in different ways.

Differential Revision: https://phabricator.services.mozilla.com/D133692
2021-12-14 08:15:12 +00:00
Ting-Yu Lin 06b8f84060 Bug 1745828 Part 1 - Compute scrollbar rects only if they are shown. r=emilio
Compute the actual vertical & horizontal scrollbars' rects (vRect & hRect) only
when we decide to show the scrollbars. The rationale is that after introducing
scrollbar-gutter in bug 1715112, `mScrollPort` is no longer equal to
`aInsideBorderArea` even if we don't show scrollbars, and we want scrollbar
rects remaining empty to avoid showing them.

Simplify `hasVisualOnlyScrollbarsOnBothDirections` and move it closer to its
first usage.

Differential Revision: https://phabricator.services.mozilla.com/D133691
2021-12-14 08:15:12 +00:00
Nika Layzell 7b2e6d4996 Bug 1741665 - Align nsCString's public size_type better with other C++ APIs, r=mccr8,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D131422
2021-12-13 21:47:56 +00:00
Ting-Yu Lin 5909d5b7f3 Bug 1744895 Part 3 - Fix justify-*:{left|right} mapping for abspos children of flex containers. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D133169
2021-12-10 17:42:23 +00:00
Ting-Yu Lin fd68e79da7 Bug 1744895 Part 2 - Fix justify-*:{left|right} mapping for vertical row-oriented flex containers. r=dholbert
Currently, we use IsPhysicalLTR() to query which is the start side of the
physical left <-> right axis. However, for vertical row-oriented flex
containers, physical left <-> right axis is its cross axis. We really should
query IsBidiLTR() instead because its main axis is parallel to line-left <->
line-right axis (i.e. inline axis).

flexbox-justify-content-wmvert-003.html is adapted from
flexbox-justify-content-wmvert-002.html.

Differential Revision: https://phabricator.services.mozilla.com/D133168
2021-12-10 17:42:22 +00:00
Ting-Yu Lin 06346bb565 Bug 1744895 Part 1 - Extract a helper mapping justify-*:{left|right} to {start|end}. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D133167
2021-12-10 17:42:22 +00:00
Andrew Osmond 878275c3b6 Bug 1736177 - Part 11. Plumb in OffscreenCanvasDisplayHelper. r=jgilbert
This patch integrates OffscreenCanvasDisplayHelper with
HTMLCanvasElement, OffscreenCanvas and nsDisplayCanvas to allow
asynchronous display of an OffscreenCanvas.

Differential Revision: https://phabricator.services.mozilla.com/D130787
2021-12-10 02:57:55 +00:00
Hiroyuki Ikezoe 29ec3a9389 Bug 1740289 - Notify onShowDynamicToolbar on overflow: hidden case. r=geckoview-reviewers,agi,emilio
The reason why we don't change GetOverflowState is that GetOverflowState is also
used for overflow/underflow event firing and our frontend code expects both
the events are fired on overflow:hidden elements [1]. And it looks like it's by
design as per one of test cases for overflow events has `overflow:hidden` style
in the first place.

[1] https://searchfox.org/mozilla-central/rev/df6434d2ebfdf2b5f89f205fc81d60d64a774fe1/devtools/client/shared/components/tabs/Tabs.css#38-39
[2] https://searchfox.org/mozilla-central/rev/df6434d2ebfdf2b5f89f205fc81d60d64a774fe1/layout/generic/test/test_overflow_event.html#46

Differential Revision: https://phabricator.services.mozilla.com/D131103
2021-12-10 01:12:56 +00:00
Csoregi Natalia 1c7cae16d7 Backed out 17 changesets (bug 1738971, bug 1736177) for bp-hybrid failures and others. CLOSED TREE
Backed out changeset 828633114de2 (bug 1736177)
Backed out changeset 5be8557c4721 (bug 1736177)
Backed out changeset 49f8b4205a46 (bug 1736177)
Backed out changeset 2610d4464ad5 (bug 1736177)
Backed out changeset 6d6c78c31c28 (bug 1736177)
Backed out changeset d55f1ee88bb9 (bug 1736177)
Backed out changeset bf588f8ffcf1 (bug 1736177)
Backed out changeset 86f6f6d86c6c (bug 1736177)
Backed out changeset f400c75c5829 (bug 1736177)
Backed out changeset 4a34124d5f4e (bug 1736177)
Backed out changeset 70aff7fcd001 (bug 1736177)
Backed out changeset db2347ee8147 (bug 1736177)
Backed out changeset 3dde5ddb65e5 (bug 1738971)
Backed out changeset 894ba6b7b68f (bug 1738971)
Backed out changeset dc4503052cf1 (bug 1738971)
Backed out changeset d9aef3e9797e (bug 1738971)
Backed out changeset 562a1e8e5ac3 (bug 1738971)
2021-12-10 01:13:23 +02:00
Andrew Osmond 8e0ebe8c37 Bug 1736177 - Part 11. Plumb in OffscreenCanvasDisplayHelper. r=jgilbert
This patch integrates OffscreenCanvasDisplayHelper with
HTMLCanvasElement, OffscreenCanvas and nsDisplayCanvas to allow
asynchronous display of an OffscreenCanvas.

Differential Revision: https://phabricator.services.mozilla.com/D130787
2021-12-09 19:25:28 +00:00
Masayuki Nakano 9adbf59c05 Bug 1740853 - part 3: Redesign `nsContentUtils::ComparePoints_Fix*()` as taking `int64_t` for the offset r=smaug
For reducing the legacy behavior emulator of `nsContentUtils::ComparePoints`
and make it simpler, this patch makes it take `int64_t` as the offset.
Additionally, it's named "ComparePoints_AllowNegativeOffsets`.

Differential Revision: https://phabricator.services.mozilla.com/D132549
2021-12-09 17:06:18 +00:00
Masayuki Nakano ae4dedab30 Bug 1741148 - part 10: Make `nsIFrame::ContentIndexInContainer()` return `Maybe<uint32_t>` for index of a DOM node r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131344
2021-12-09 16:20:43 +00:00
Masayuki Nakano 3816ca9546 Bug 1741148 - part 3: Make users of `nsINode::ComputeIndexOf_Deprecated()` use `nsINode::ComputeIndexOf()` if the result is not set to `int32_t` nor return as `int32_t` r=smaug
This patch fixes only the cases if the result of `ComputeIndexOf_Deprecated()`
is used as unsigned integer with implicit or explicit cast.

Differential Revision: https://phabricator.services.mozilla.com/D131336
2021-12-09 11:55:36 +00:00
Masayuki Nakano f2baf0d9ab Bug 1741148 - part 1: Rename `nsINode::ComputeIndexOf` to `ComputeIndexOf_Deprecated` r=smaug
It's hard to fix some callers.  Therefore, in this bug, we should fix only
simple cases.  Therefore, we should rename existing API first.

Differential Revision: https://phabricator.services.mozilla.com/D131334
2021-12-09 08:32:30 +00:00
Masayuki Nakano c19aa5aaa5 Bug 1740853 - part 1: Make `nsContentUtils::ComparePoints` take `uint32_t` for offset in DOM nodes r=smaug
They are defined as "unsigned long" by the standards.  So we should use
`uint32_t` rather than `int32_t` with the methods.  However, layout code
uses `int32_t` a lot for representing the offset.  Therefore, this patch
adds `*_FixOffset1` etc for the cases which cannot fix easily in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D131110
2021-12-09 07:51:45 +00:00
Masayuki Nakano 82e2013683 Bug 1735446 - part 4: Make `Selection::GetRangeAt()` take `uint32_t` instead of `int32_t` r=smaug
It's an internal API corresponding to `Selection.getRangeAt` DOM API.
I think that it should use `uint32_t` rather than `size_t` because of the
consistency with the DOM API and `Selection::RangeCount()`.

This patch fixes all callers of `GetRangeAt()`, and rewrites it with ranged-
loops unless original ones do not refer `RangeCount()` every time and may run
script in the loop.

Differential Revision: https://phabricator.services.mozilla.com/D128848
2021-12-09 07:35:09 +00:00
Masayuki Nakano 8213a63459 Bug 1735446 - part 1: Make `Selection` use `uint32_t` for handling offset in DOM nodes r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D128844
2021-12-09 00:45:19 +00:00
Mike Hommey 8e411675ac Bug 1744877 - Remove --disable-xul. r=Gijs
Building with --disable-xul has been busted since _at least_ bug
1082579, for more than 7 years (I didn't try to track that down
further). It's time to recognize that the option serves no purpose.

Differential Revision: https://phabricator.services.mozilla.com/D133161
2021-12-08 21:37:11 +00:00
Jonathan Kew 2927597ae0 Bug 1742626 - Attempt to improve Indic-script ::first-letter behavior by not allowing a boundary after a ligated virama in scripts that use half-consonant forms. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D132373
2021-12-08 15:42:55 +00:00
Boris Chiou 8604a51732 Bug 1676791 - Part 2: Implement the infrastructure of scroll-linked animations. r=emilio,hiro
The basic part of the infrastructure of scroll-linked animations. This is
designed based on scroll-linked animation generated by CSS. We will
implement the timing computation and hook the ScrollTimeline to the CSS
animations in the following patches.

All the tests are in the patch that hooks ScrollTimeline to CSS Animation.

Differential Revision: https://phabricator.services.mozilla.com/D129100
2021-12-08 01:16:28 +00:00
Ting-Yu Lin e9ca88e699 Bug 1743959 Part 2 - Simplify the computation regarding the space occupied by scrollbars in TryLayout. r=hiro
This patch is inspired by `ScrollFrameHelper::GetActualScrollbarSizes()` that
uses a nsMargin to represent the space occupied by scrollbar.

In bug 1715112, TryLayout is going to consider the space occupied by the
scrollbar gutter. Hence the variable name with gutter in it just to avoid change
the variable name again.

Differential Revision: https://phabricator.services.mozilla.com/D132663
2021-12-06 18:45:04 +00:00
Ting-Yu Lin 153e8dfe53 Bug 1743959 Part 1 - Make mScrollPort private, and add a getter and a setter for it. r=emilio
This patch ports the mScrollPort refactor Boris wrote in
https://phabricator.services.mozilla.com/D129100 with my tweaks.

Differential Revision: https://phabricator.services.mozilla.com/D132662
2021-12-06 18:45:04 +00:00
Ting-Yu Lin 2da77f16e4 Bug 1743959 Part 0 - Remove static nsXULScrollFrame::AddRemoveScrollbar helper. r=hiro
The static AddRemoveScrollbar() helper is meant to adjust the scroll port and
test whether the scrollbar fits, but its interface is obscure. By expanding the
helper in-place, the code should now become easy to follow, and we can also
remove the wordaround that sets the bool:1 bitfield.

Differential Revision: https://phabricator.services.mozilla.com/D132759
2021-12-06 18:45:03 +00:00
Dan Minor 522eefbe31 Bug 1719554 - Unify unicode::Script as intl::Script; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D132278
2021-12-06 18:15:50 +00:00
Miko Mynttinen a5e210a518 Bug 1743637 - Fix array out of bounds in nsTextFrame::ToCString r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D132498
2021-12-06 14:44:55 +00:00
Butkovits Atila 56c46d06a1 Backed out 3 changesets (bug 1719554) for causing bustages complaining about gfxTextRun.cpp.
Backed out changeset 6181e40d4da1 (bug 1719554)
Backed out changeset c261ede6ae81 (bug 1719554)
Backed out changeset 221ec418475c (bug 1719554)
2021-12-04 00:58:15 +02:00
Dan Minor 30ad309163 Bug 1719554 - Unify unicode::Script as intl::Script; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D132278
2021-12-03 20:49:32 +00:00
Emilio Cobos Álvarez 571e82c9f0 Bug 1744152 - Make the aAllUpperCase parameter of TransformString more generic. r=jfkthame
Bug 1744009 will stop creating frames for <option>s, but will need to
support text-transform on the option strings to calculate the right
intrinsic size for the <select> element.

The reason why we want to calculate the intrinsic size without having
into account the option styles is so that changing the selected option
doesn't change the width of the combobox, which is something that can
happen now.

This is similar to:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/layout_box.cc;l=307;drc=32f574f6df1d37b0d9ed765fe138270414d79e49

This patch will allow to achieve this (and not regress tests like
html/rendering/non-replaced-elements/form-controls/text-transform.html.ini).

Differential Revision: https://phabricator.services.mozilla.com/D132746
2021-12-03 11:45:48 +00:00
Andrew Osmond 33641307ec Bug 1743761 - Ensure we invalidate substituted images when the preferred size is ready. r=tnikkel
Previously with ImageContainers, we would put the new preferred surface
into the ImageContainer. When we check if we should invalidate, it would
have a different image key, and hence invalidate the image frame and
schedule a paint.

With ImageProviders, it returns the same key in this case, because the
ImageProvider represents a particular surface. As such, we need to
actually track when we get a substituted ImageProvider, and invalidate
the image frame more aggressively to ensure we get the preferred size.

Differential Revision: https://phabricator.services.mozilla.com/D132583
2021-12-03 03:14:01 +00:00
Noemi Erli cc6683ef9e Backed out changeset 7af79a49bf5f (bug 1743637) for causing perma geckoview failures 2021-12-02 13:31:34 +02:00
Miko Mynttinen a3bddeeb94 Bug 1743637 - Fix array out of bounds in nsTextFrame::ToCString r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D132498
2021-12-01 23:59:37 +00:00
Sandor Molnar 3d64c3bcca Backed out changeset e86bd6c22ef7 (bug 1743637) for causing android failures. CLOSED TREE 2021-12-01 19:59:31 +02:00
Greg Tatum d642b72ac3 Bug 1715892 - Unify locale/DateTimeFormat to mozilla::intl::AppDateTimeFormat; r=platform-i18n-reviewers,dminor
I considered removing this class initially, but it's actually a pretty
useful abstraction over the DateTimeFormat interface when used
specifically with Gecko. It applies the OS preferences and provides some
caching behavior.

Differential Revision: https://phabricator.services.mozilla.com/D131671
2021-12-01 17:41:37 +00:00
Miko Mynttinen b27a53abad Bug 1743637 - Fix array out of bounds in nsTextFrame::ToCString r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D132498
2021-12-01 16:32:59 +00:00
Chris Peterson f6fdbf028a Bug 1738401 - Remove -Wno-shadow warning suppressions. r=firefox-build-system-reviewers,glandium
-Wshadow warnings are not enabled globally, so these -Wno-shadow suppressions have no effect. I had intended to enable -Wshadow globally along with these suppressions in some directories (in bug 1272513), but that was blocked by other issues.

There are too many -Wshadow warnings (now over 2000) to realistically fix them all. We should remove all these unnecessary -Wno-shadow flags cluttering many moz.build files.

Differential Revision: https://phabricator.services.mozilla.com/D132289
2021-12-01 06:40:04 +00:00
Ting-Yu Lin 5addb144e4 Bug 1743537 Part 6 - Rename arguments of ScrollFrameHelper::LayoutScrollbars(). r=emilio
Technically, `aContentArea` is not 100% wrong; its the content area of the outer
scroll frame, which contains the content area of the inner scrolled frame, the
padding, and the scrollbars. However, it should really be named
`aInsideBorderArea` as the caller names it. Otherwise, it is easy to cause
confusion with the content area of the inner scrolled frame.

Also, rename `aOldScrollArea` as well so that we use the term "scroll port"
consistently.

Differential Revision: https://phabricator.services.mozilla.com/D132445
2021-11-30 23:25:22 +00:00
Ting-Yu Lin cd368a47f6 Bug 1743537 Part 5 - Rename variables names storing mScrollPort. r=emilio
Make these variables more distinguishable from `oldScrolledAreaBounds` and
`newScrolledAreaBounds`.

Differential Revision: https://phabricator.services.mozilla.com/D132444
2021-11-30 23:25:22 +00:00
Ting-Yu Lin b5de753621 Bug 1743537 Part 4 - Cache scrollbar sizes in ScrollReflowInput. r=layout-reviewers,emilio
Scrollbar's min and pref sizes won't change during reflow, so we can cache them
in ScrollReflowInput to save some repetitive computation in multiple
ReflowScrolledFrame() and TryLayout() calls.

This is also a preparation for Bug 1715112 because we can use the pref sizes to
compute the scrollbar-gutter size in ScrollReflowInput.

Differential Revision: https://phabricator.services.mozilla.com/D132443
2021-11-30 23:25:22 +00:00
Ting-Yu Lin 9a7c5736d5 Bug 1743537 Part 3 - Call SetScrollbarMediatorContent in ScrollReflowInput's constructor. r=emilio
It should be sufficient to call `SetScrollbarMediatorContent` once in
ScrollReflowInput's constructor, which is created in the beginning of
nsHTMLScrollFrame::Reflow(), instead of calling it repeatedly in multiple
TryLayout() calls.

Differential Revision: https://phabricator.services.mozilla.com/D132442
2021-11-30 23:25:21 +00:00
Ting-Yu Lin 3495f5356d Bug 1743537 Part 2 - Pass ScrollReflowInput argument by reference. r=emilio
We've had some APIs passing ScrollReflowInput by reference while some others
using pointer. Let's unify them by using reference everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D132441
2021-11-30 23:25:21 +00:00
Ting-Yu Lin 33bd4df6d2 Bug 1743537 Part 1 - Move ScrollReflowInput members' initialization into its constructor. r=layout-reviewers,emilio
They shouldn't be scattered in nsHTMLScrollFrame::Reflow(). Also, reorder these
assignment operations according to the member variables' appearance order in
ScrollReflowInput.

I also moved the constructor out of the class definition because it becomes a
large method, and I'm going to add `private:` section after the methods section
in a later patch.

Differential Revision: https://phabricator.services.mozilla.com/D132440
2021-11-30 23:25:21 +00:00
Marian-Vasile Laza 3bfa529b3e Backed out 6 changesets (bug 1715892, bug 1719735) for causing bc test failures. CLOSED TREE
Backed out changeset 196952bd8c9c (bug 1715892)
Backed out changeset 9105fe01c025 (bug 1715892)
Backed out changeset 4c15d1a24ccd (bug 1715892)
Backed out changeset 2c328b84285f (bug 1715892)
Backed out changeset 8fcdcdf44b62 (bug 1719735)
Backed out changeset c48f398e301f (bug 1719735)
2021-11-30 23:30:59 +02:00
Greg Tatum 9b5497020e Bug 1715892 - Unify locale/DateTimeFormat to mozilla::intl::AppDateTimeFormat; r=platform-i18n-reviewers,dminor
I considered removing this class initially, but it's actually a pretty
useful abstraction over the DateTimeFormat interface when used
specifically with Gecko. It applies the OS preferences and provides some
caching behavior.

Differential Revision: https://phabricator.services.mozilla.com/D131671
2021-11-30 19:05:58 +00:00
Miko Mynttinen 6edc3c9c20 Bug 1742850 - Add logging for display list building r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D132065
2021-11-29 14:50:53 +00:00
Andrew Osmond af4570762c Bug 1711061 - Part 12. Change the display list to use WebRenderImageProvider. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D126605
2021-11-27 11:47:40 +00:00
Emilio Cobos Álvarez 2dca36cb25 Bug 502258 - Add a Show Password button to <input type=password> controls. r=Gijs
It's controlled by the pref:
layout.forms.input-type-show-password-button.enabled

Differential Revision: https://phabricator.services.mozilla.com/D130407
2021-11-25 20:12:05 +00:00
Emilio Cobos Álvarez 534a2657be Bug 1741124 - Don't apply CSS perspective to non-CSS-transformed frames. r=miko
Applying it to SVG-transformed frames is wrong, and causes us to
rasterize rather massive SVGs. This is consistent with the other CSS
3d transforms code, and our rendering of the test-case matches other
browsers.

Differential Revision: https://phabricator.services.mozilla.com/D132040
2021-11-24 16:33:12 +00:00
Emilio Cobos Álvarez 4fc02f6f53 Bug 1742411 - Prefer content property to img src on image elements. r=dholbert
Given the compat reports in bug 1484928, I don't think it's worth
keeping the current behavior.

Our behavior should match other browsers now. Rather than making
content: url() work everywhere even for otherwise-replaced elements,
just special-case this since that's what other browsers seem to do.

Differential Revision: https://phabricator.services.mozilla.com/D131797
2021-11-23 11:36:21 +00:00
Hiroyuki Ikezoe 26f550200e Bug 1742495 - Drop ScrollOrigin argument from ScrollToCSSPixelsApproximate. r=botond
And rename the function to ScrollToCSSPixelsForApz.

Differential Revision: https://phabricator.services.mozilla.com/D131854
2021-11-23 02:05:33 +00:00
Ting-Yu Lin 9eaf55eae1 Bug 1741773 - Document some state bits in ScrollReflowInput and ScrollFrameHelper. r=emilio
NPOTB DONTBUILD because this patch changes only comments.

Differential Revision: https://phabricator.services.mozilla.com/D131459
2021-11-18 18:23:34 +00:00
Emilio Cobos Álvarez 446bae08de Bug 1741495 - Make ThemeDrawsFocusForWidget return the right thing when drawing non-native widgets on Linux and Windows. r=spohl
Noticed this while digging into bug 1741359.

Differential Revision: https://phabricator.services.mozilla.com/D131277
2021-11-17 00:55:26 +00:00
Emilio Cobos Álvarez 2d8ab09b73 Bug 1739699 - Use preferred color scheme when forcing colors with system colors (except windows HCM). r=morgan
This causes (among other things) pages to be dark when using regular
windows system colors and forcing colors to "always", which is nice.

Differential Revision: https://phabricator.services.mozilla.com/D131165
2021-11-16 22:30:26 +00:00
Greg Tatum ec908112f4 Bug 1738057 - Split out BidiEmbeddingLevel into its own file; r=platform-i18n-reviewers,dminor
This should speed up re-compile times, as mozilla/intl/Bidi.h will only
be included in a few places.

Differential Revision: https://phabricator.services.mozilla.com/D129662
2021-11-16 15:11:58 +00:00
Andi-Bogdan Postelnicu c8e0f87391 Bug 1519636 - First reformat with clang-format 13.0.0. r=firefox-build-system-reviewers,sylvestre,mhentges
Updated with clang-format version 13.0.0 (taskcluster-OgjH5lasS5K_fvefdRcJVg)

Depends on D131114

Differential Revision: https://phabricator.services.mozilla.com/D129119
2021-11-16 08:07:30 +00:00