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

19367 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 6489b27741 Bug 1758564 - Allow rendering children of <img>'s shadow root. r=dholbert
This doesn't change behavior just yet, but seems worth doing separately.

With this patch, we can render content overlaid on top of an image
frame, by attaching a shadow root to it. The idea is to use this for
text recognition (OCR) of text inside images.

I chose to implement this using the DynamicLeaf stuff that I removed in
bug 1746310 (because nsMenuPopupFrame was its only user).

That seems simpler than either a new frame class, or more special cases
in the frame constructor, etc. But let me know if you disagree.

There are further changes that we want to do. For example, trying to
select the overlaid text with the mouse right now will start dragging
the image. For that, we might need to tweak our selection / mouse
dragging code. But those seem all changes that can go on top of this.

Differential Revision: https://phabricator.services.mozilla.com/D140638
2022-03-10 05:11:38 +00:00
Timothy Nikkel 209384a505 Bug 1757314. Use the current scroll origin to determine if we should update the main thread copy of the visual viewport offset. r=botond
This patch was originally posted to bug 1756762, however we found a better patch to fix that bug. This patch still seems like a good idea though so we want to land it in another bug.

I observed the following sequence of events when running gfx/layers/apz/test/mochitest/browser_test_background_tab_load_scroll.js in one of the cases that it fails for me locally.

-ScrollFrameHelper::NotifyApzTransaction is called after sending a transaction to webrender, this sets mAllowScrollOriginDowngrade = true.
-the scroll frame is destroyed and re-created (I'm not sure why this destroy and re-create happened, I didn't investigate), we call SaveState and RestoreState. So now mLastScrollOrigin == Other, and mAllowScrollOriginDowngrade == true.
-the test calls ScrollBy, so we get a call to ScrollToImpl with aOrigin == Relative
-aOrigin gets changed to Other here https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#2979
-the code just below that determines that it is not a downgrade, so we update mLastScrollOrigin to Other (not a change) and set mAllowScrollOriginDowngrade = false
-ScrollFrameHelper::NotifyApzTransaction is _not_ called (probably because we are in a background tab), so mAllowScrollOriginDowngrade remains false
-the scroll frame is now at position 20000 and the visual viewport offset (stored on the presshell) is also 20000.
-the scroll frame is destroyed and re-created (this one I investigated, it's because the font subsystem has finished loading and asks for a global reconstruct https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/base/PresShell.cpp#9830), we call SaveState and RestoreState. So mLastScrollOrigin == Other, and mAllowScrollOriginDowngrade == true (the same values.
-we get a call to ScrollToRestoredPosition for the newly re-created scroll frame, we are trying to scroll from the current layout scroll position of 0 to the one we had before destruction and re-creation (20000). The visual viewport offset that is stored on the presshell has not been affected, it is still 20000.
-this gets to ScrollToImpl and with aOrigin == Restore
-we arrive at https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#3000 and Restore is a downgrade from Other, and mAllowScrollOriginDowngrade is false so we do not change mLastScrollOrigin (still Other) and mAllowScrollOriginDowngrade remains false
-we arrive at the code in ScrollToImpl that updates the visual viewport offset on the presshell https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#3232
-mLastScrollOrigin is Other, which can clobber apz, so we enter the if and add the difference between the before/after layout scroll position from this ScrollToImpl call (20000-0 = 20000) to the visual viewport offset (20000), getting 40000, which gets clamped to the max ~38000.
-and now the layout scroll position and the visual viewport offset have been detached when they shouldn't be.

Whenever we are doing a Restore scroll we expect that there has been a ScrollToImpl call in the past that got us to the position we are restoring to, and that past ScrollToImpl call should have resulted in the visual viewport offset on the presshell getting updated. So if the origin is Restore then the visual viewport offset should have already incorporated this scroll, and so we don't need to update the visual viewport offset for this scroll. If our assumption that the visual viewport offset on the presshell is already up-to-date is wrong that is okay because after an apz transaction they will be reconciled: the main thread is only trying to make an effort to sync with apz in advance and it is better to be conservative here, only updating the visual viewport offset when we know its correct, because as we've seen if we incorrectly update it they can get out of sync and cause bugs.

Another way to think of it: mLastScrollOrigin is the accumulation of all scroll origins since sending the last apz transaction and tells apz if the main thread should take precedence over the apz scroll position, and similarly the layout scroll position that we sned to apz is the accumulation of all scrolls since the last apz transaction. Whereas aOrigin tells us about one scroll, and we want to treat each scroll in that accumulation separately for determining how to update the main thread copy of the visual viewport offset.

Previously in https://phabricator.services.mozilla.com/D137873 I had stated that bug 1753881 (have PresShell::GetVisualViewportOffset() either return a maybe or layout scroll offset if vv offset is not set) would fix these cases in the test but I didn't understand why. Now I understand why. The reason is that although there is an obvious patch for bug 1753881 (return the layout scroll offset if the visual viewport offset isn't set) that patch is not correct. The reason is that in PresShell::SetVisualViewportOffset https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/base/PresShell.cpp#11199 we compare the new offset to the old offset which we get by calling GetVisualViewportOffset. So in the common case where we are in ScrollToImpl and we update the layout scroll offset and then call SetVisualViewportOffset to update the visual viewport offset then GetVisualViewportOffset is going to return the already updated layout scroll offset (if the visual viewport offset hasn't been set on the presshell yet). So SetVisualViewportOffset will determine that we are already up to date and not end up setting any visual viewport offset on the presshell at all. And so no visual viewport offset gets set at all. And since the original bug comes about because of a disagreement between the visual viewport offset and the layout scroll offset, we avoid the bug entirely by never setting a visual viewport offset. This is not acceptable because we thus never send visual viewport offset change events (mozvisualscroll) which we have several tests depending on (browser/components/sessionstore/test/browser_scrollPositions.js is one in particular that I want to note).

The reason I wanted to note browser/components/sessionstore/test/browser_scrollPositions.js was that this patch causes that test to fail. What happens in the test is a scroll frame gets a non-zero layout scroll position (and the same visual viewport offset on the presshell), then the page is reloaded. The layout scroll position is restored via a call to ScrollToImpl with origin Restore, thus it does not touch the visual viewport offset on the presshell. Before this patch we would have looked at mLastScrollOrigin instead and touched the visual viewport offset. And because the page was reloaded we got a new presshell so it does not have a visual viewport offset. The test then gets the visual viewport offset and expects it to have the non-zero layout scroll offset, but it does not. So we can fix this by landing the (corrected) patch for bug 1753881 (have PresShell::GetVisualViewportOffset() either return a maybe or layout scroll offset if vv offset is not set).

Differential Revision: https://phabricator.services.mozilla.com/D139473
2022-03-09 10:16:56 +00:00
Mathew Hodson 1753bc7103 Bug 1751828 - Clamp the inline size when reflowing text. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D140447
2022-03-09 09:16:31 +00:00
Marian-Vasile Laza 6957b335a7 Backed out changeset d161da1543bc (bug 1751828) for causing crashtest failures on 459968.html. 2022-03-08 08:55:17 -08:00
Mathew Hodson 0049706b3b Bug 1751828 - Clamp the inline size when reflowing text. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D140447
2022-03-08 11:05:16 +00:00
Lee Salzman d22d724cc2 Bug 1511493 - Ensure PushGlyphs uses the current transaction's IpcResourceUpdateQueue. r=emilio
WebRenderBridgeChild::GetFontKeyForScaledFont can currently cause a IpcResourceUpdateQueue race.
If we're in the middle of a transaction building a blob image, GetFontKeyForScaledFont is called
in the blob image building code using the transaction's IpcResourceUpdateQueue as expected, such
that resource updates are sent out when the transaction is finalized.

However, TextDrawTarget calls into PushGlyphs without passing along its IpcResourceUpdateQueue,
calling GetFontKeyForScaledFont without it, and causing it to immediately send out the resource
update.

So if a blob image uses a font key and submits a resource update, but a display list is built
after that also using the font key within the transaction, the display list will fail to send
the resource update because it thinks the blob image already did, even though the blob image
transaction has not yet been finalized.

The simple fix is to just pass IpcResourceUpdateQueue from TextDrawTarget into PushGlyphs, thus
ensuring the resource updates are properly ordered.

Differential Revision: https://phabricator.services.mozilla.com/D140438
2022-03-05 23:35:16 +00:00
Ting-Yu Lin 7eb2cec4ea Bug 1377072 - Minor cleanup related to overflow areas. r=dholbert
None of these changes should change the behavior.

- In `ConsiderChildOverflow()`, replace the legacy term "visual" overflow.

- `GetOverflowAreasRelativeToSelf()`, `ScrollableOverflowRectRelativeToSelf()`,
  `InkOverflowRectRelativeToSelf()` can really be terser.

- Replace `mRect.TopLeft()` with `Position()`, and
  `nsRect(nsPoint(0, 0), GetSize())` with `GetRectRelativeToSelf()`, making them
  shorter and clearer.

- Move `GetOverflowRect()` to private section because it's an implementation
  detail of `InkOverflowRect()` and `ScrollableOverflowRect()`.

Differential Revision: https://phabricator.services.mozilla.com/D140437
2022-03-05 22:27:22 +00:00
Ting-Yu Lin 451290249c Bug 1377072 - Include child frame's overflow area locating at its normal position into parent's overflow. r=dholbert
When a position:sticky element "sticks" in the scroll container's scrollport, we
compute its containing block's overflow areas by including its overflow areas
located at its relative position. This makes the element's normal position
unreachable because its overflow areas located at its "normal position" might
not be within its containing block's overflow areas. Block frame doesn't have
this problem because `nsLineBox` always includes the element's normal position
rect in its own rect.

Therefore, when including a sticky child frame's overflow area into its parent's
overflow area, the overflow areas located at its normal position should be
included as well. This behavior is consistent with a relatively positioned child
frame. (A position:relative frame's normal position is always reachable when
scrolling, at least in both axes that grow positively.)

Differential Revision: https://phabricator.services.mozilla.com/D140373
2022-03-05 22:27:22 +00:00
Nika Layzell 05dc5e0d76 Bug 1754037 - Part 3c: Automatically update all ParamTraits implementations, r=ipc-reviewers,media-playback-reviewers,bryce,mccr8
Automatically generated rewrites of all ParamTraits and IPDLParamTraits
implementations in-tree to use IPC::Message{Reader,Writer}.

Differential Revision: https://phabricator.services.mozilla.com/D140004
2022-03-04 15:39:41 +00:00
Ting-Yu Lin b48196dcda Bug 1758018 Part 2 - Add helpers testing only "position:relative", and adapt them at some callsites. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D140274
2022-03-04 03:02:01 +00:00
Ting-Yu Lin 7e0c39f9b1 Bug 1758018 Part 1 - Rename the helpers testing "position:relative" or "position:sticky". r=emilio
`nsIFrame::IsRelativelyPositioned()` tests "position:relative" or
"position:sticky", but its naming is misleading until you've dug into the
underlying helper `nsStyleDisplay::IsRelativelyPositionedStyle()`.

Differential Revision: https://phabricator.services.mozilla.com/D140273
2022-03-04 03:02:00 +00:00
Emilio Cobos Álvarez 0547fa3491 Bug 1756750 - Add a missing null-check.
MANUAL PUSH: Trivial crashtest fix CLOSED TREE
2022-03-02 17:19:33 +01:00
Emilio Cobos Álvarez 676faeb637 Bug 1756750 - Ensure we observe SVG glyph changes inside <svg:text>. r=jfkthame
This gets done usually in BreakSink::Finish, but we don't do
line-breaking in SVG Text so we need to do this here instead.

Do you know where I could crib a test for this?

Depends on D139964

Differential Revision: https://phabricator.services.mozilla.com/D139965
2022-03-02 14:31:58 +00:00
Hector Zhao 1efb3c674c Bug 1700292 - Draw scroll marks on horizontal scrollbar as well. r=emilio,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D139001
2022-03-01 13:19:00 +00:00
Timothy Nikkel 22b5bfa1de Bug 1756762. When the root scroll frame is destroyed, reset the visual viewport offset on it's presshell. r=botond
The regular scroll position restoration code will restore it.

Specifically, in ScrollFrameHelper::SaveState

https://searchfox.org/mozilla-central/rev/44ae61c5eeb150cb77b6b8511ceee7ddd6892cb7/layout/generic/nsGfxScrollFrame.cpp#7376

we store the visual viewport offset. ScrollFrameHelper::ScrollToRestoredPosition will try to restore both the layout scroll offset and the visual viewport offset by calling ScrollToWithOrigin (which leads to ScrollToImpl) and PresShell::ScrollToVisual respectively.

I observed the following sequence of events when running gfx/layers/apz/test/mochitest/browser_test_background_tab_load_scroll.js in one of the cases that it fails for me locally.

-ScrollFrameHelper::NotifyApzTransaction is called after sending a transaction to webrender, this sets mAllowScrollOriginDowngrade = true.
-the scroll frame is destroyed and re-created (I'm not sure why this destroy and re-create happened, I didn't investigate), we call SaveState and RestoreState. So now mLastScrollOrigin == Other, and mAllowScrollOriginDowngrade == true.
-the test calls ScrollBy, so we get a call to ScrollToImpl with aOrigin == Relative
-aOrigin gets changed to Other here https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#2979
-the code just below that determines that it is not a downgrade, so we update mLastScrollOrigin to Other (not a change) and set mAllowScrollOriginDowngrade = false
-ScrollFrameHelper::NotifyApzTransaction is _not_ called (probably because we are in a background tab), so mAllowScrollOriginDowngrade remains false
-the scroll frame is now at position 20000 and the visual viewport offset (stored on the presshell) is also 20000.
-the scroll frame is destroyed and re-created (this one I investigated, it's because the font subsystem has finished loading and asks for a global reconstruct https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/base/PresShell.cpp#9830), we call SaveState and RestoreState. So mLastScrollOrigin == Other, and mAllowScrollOriginDowngrade == true (the same values.
-we get a call to ScrollToRestoredPosition for the newly re-created scroll frame, we are trying to scroll from the current layout scroll position of 0 to the one we had before destruction and re-creation (20000). The visual viewport offset that is stored on the presshell has not been affected, it is still 20000.
-this gets to ScrollToImpl and with aOrigin == Restore
-we arrive at https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#3000 and Restore is a downgrade from Other, and mAllowScrollOriginDowngrade is false so we do not change mLastScrollOrigin (still Other) and mAllowScrollOriginDowngrade remains false
-we arrive at the code in ScrollToImpl that updates the visual viewport offset on the presshell https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsGfxScrollFrame.cpp#3232
-mLastScrollOrigin is Other, which can clobber apz, so we enter the if and add the difference between the before/after layout scroll position from this ScrollToImpl call (20000-0 = 20000) to the visual viewport offset (20000), getting 40000, which gets clamped to the max ~38000.
-and now the layout scroll position and the visual viewport offset have been detached when they shouldn't be.

If we reset the visual viewport offset when the scroll frame is destroyed we avoid the problem here.

Differential Revision: https://phabricator.services.mozilla.com/D139792
2022-03-01 01:51:27 +00:00
Timothy Nikkel 4b48b3dd2d Bug 1753881. Simplify a few IsVisualViewportOffsetSet callers. r=botond
Depends on D139472

Differential Revision: https://phabricator.services.mozilla.com/D139683
2022-02-27 13:09:27 +00:00
Emilio Cobos Álvarez 89a8d46834 Bug 1757230 - Add missing includes elsewhere to unbust hybrid builds.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2022-02-26 01:08:16 +01:00
Emilio Cobos Álvarez 384bfcf2b6 Bug 1757230 - Avoid unneeded includes in nsTextFrame.h. r=longsonr
Move stuff to the C++ file where possible, and move ClipEdges to
nsTextFrame since it's the only thing using it (rather than keeping it
in nsDisplayText).

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

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

Differential Revision: https://phabricator.services.mozilla.com/D139759
2022-02-25 22:18:11 +00:00
Emilio Cobos Álvarez f7704d54d7 Bug 1756826 - Simplify nsBlockFrame abspos cb size code to account for scrollbars correctly. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D139513
2022-02-24 12:29:12 +00:00
Marian-Vasile Laza 95844c7b58 Backed out changeset 6739837be6a8 (bug 1756826) for causing build bustages on nsBlockFrame.cpp. CLOSED TREE 2022-02-23 18:48:43 -08:00
Emilio Cobos Álvarez 951295a660 Bug 1756826 - Simplify nsBlockFrame abspos cb size code to account for scrollbars correctly. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D139513
2022-02-23 23:15:26 +00:00
Ting-Yu Lin 017c34b54e Bug 1756008 Part 5 - Manual fix for comments and variables regarding BlockReflowState. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D139440
2022-02-23 21:22:44 +00:00
Ting-Yu Lin 4431acf2c3 Bug 1756008 Part 4 - Replace "BlockReflowInput" with "BlockReflowState". r=layout-reviewers,emilio
This patch is generated via:

```
rg -l 'BlockReflowInput' layout/ | xargs sed -i 's/BlockReflowInput/BlockReflowState/g'
```

Manual fixes are in the next part.

Differential Revision: https://phabricator.services.mozilla.com/D139439
2022-02-23 21:22:43 +00:00
Ting-Yu Lin da5c70356e Bug 1756008 Part 3 - Rename nsLineLayout::mBlockReflowInput. r=layout-reviewers,emilio
Its type is not `BlockReflowInput` but an ordinary `ReflowInput`. Rename it to
`mLineContainerRI` to match its accessor.

While I'm here, I change `mLineContainerRI` to be a reference since it cannot be
nullptr (see nsLineLayout's constructor); also, replace
`mLineContainerRI->mFrame` with `LineContainerFrame()`.

Differential Revision: https://phabricator.services.mozilla.com/D139438
2022-02-23 21:22:43 +00:00
Ting-Yu Lin 631b3a60a0 Bug 1756008 Part 2 - Fix a comment in nsColumnSetFrame. r=emilio
nsBlockFrame::ReflowBlockFrame() creates a ReflowInput for its block child, not
BlockReflowInput.

Differential Revision: https://phabricator.services.mozilla.com/D139437
2022-02-23 21:22:43 +00:00
Ting-Yu Lin a5d36f7958 Bug 1756008 Part 1 - Rename BlockReflowInput.{h,cpp} to BlockReflowState.{h,cpp}, and fix #includes. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D139436
2022-02-23 21:22:42 +00:00
Nicolas Silva 50ca258be2 Bug 1755747 - Add support for antialiased non-snapped rectangles. r=gfx-reviewers,aosmond
We need them for SVG primitives.

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

Differential Revision: https://phabricator.services.mozilla.com/D139024
2022-02-23 13:37:39 +00:00
Miko Mynttinen 017d02d0ff Bug 1714584 - Part 2: Remove nsDisplayList::RemoveBottom() r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D138153
2022-02-22 23:42:18 +00:00
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
Ting-Yu Lin 3285bbf67e Bug 1175509 Part 2 - Make TryLayout correctly consider ScrolledContentDependsOnBSize in vertical writing-mode. r=emilio
This patch potentially changes the behavior when the scrolled frame is in
vertical writing-mode, but it should be the correct way to handle the scrollbar
change.

Differential Revision: https://phabricator.services.mozilla.com/D130711
2021-11-15 18:51:29 +00:00
Ting-Yu Lin a1c0177324 Bug 1175509 Part 1 - Rename ScrolledContentDependsOnHeight to ScrolledContentDependsOnBSize. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D130710
2021-11-15 18:51:28 +00:00
Ting-Yu Lin 2c88da9b0e Bug 1740831 Part 2 - Replace LineBreaker::Strictness with LineBreakRule. r=m_kato
LineBreaker::Strictness is just an alias of LineBreakRule in Segmenter.h. This
is to reduce the dependency of the legacy LineBreaker.

Differential Revision: https://phabricator.services.mozilla.com/D131026
2021-11-15 17:20:36 +00:00
Ting-Yu Lin 638eb14439 Bug 1740831 Part 1 - Replace LineBreaker::WordBreak with WordBreakRule. r=m_kato
LineBreaker::WordBreak is just an alias of WordBreakRule in Segmenter.h. This is
to reduce the dependency of the legacy LineBreaker.

Differential Revision: https://phabricator.services.mozilla.com/D131025
2021-11-15 17:20:35 +00:00
Hiroyuki Ikezoe b11e8dcd33 Bug 1692708 - Transmogrify ScrollToCSSPixels to ScrollByCSSPixels if there's any on-going APZ animation and there's no on-going async scroll by script. r=botond
test_abort_smooth_scroll_by_instant_scroll.html in this comment is a test case
to make sure this change doesn't regress a case where a smoothe scrolling run
by an APZC is replaced by an instant scroll operation by script.

Some other mochitests for this change are in the next commit.

Differential Revision: https://phabricator.services.mozilla.com/D129594
2021-11-12 07:54:17 +00:00
Ting-Yu Lin 443c337fb4 Bug 1739048 - Propagate NS_FRAME_CONTAINS_RELATIVE_BSIZE from inner scrolled frame to outer scroll frame. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D130813
2021-11-11 18:23:55 +00:00
Emilio Cobos Álvarez 4d6ee249dc Bug 1739925 - Add a foreground color to attention selection. r=jfkthame
In some platforms (like macOS, windows dark mode, android, and some gtk
themes) the foreground selection color might be `currentcolor`, and that
doesn't generally guarantee enough contrast with the attention
background.

Remove HeadlessLookAndFeelGTK's handling of this color since it's
useless (always overridden by prefs in all.js)

Differential Revision: https://phabricator.services.mozilla.com/D130617
2021-11-11 11:14:13 +00:00
Emilio Cobos Álvarez 22f52bfe23 Bug 1739894 - Stop including overflowing descendants in outlines. r=jwatt
Keep old behavior behind a pref.

I've kept the tests that failed enabling the pref because they're
somewhat hard to rewrite and I'd rather avoid that until we know this
will stick, specially since they test the guts of the recursive function
that I'm basically ~disabling.

I've checked that the rendering on those is sensible / matches other
browsers.

Differential Revision: https://phabricator.services.mozilla.com/D130717
2021-11-10 20:00:13 +00:00
Sean Feng fc11ef0b3f Bug 1733978 - Don't overwrite the ISize of child frames when optimizing nested grid layout r=mats
The optimized code path for nested grid layout should only set the
BSize of the child frames, since this is what the optimization is
for.

Without the change, the ISize is always going to be set to 0 for
child frames which may break the layout. Sometimes, it is not
an issue because the ISize of the grid area gets updated, so
the cached measurement becomes invalid, and the ISize of the child
frame gets set to the correct one again.

Differential Revision: https://phabricator.services.mozilla.com/D130828
2021-11-10 16:18:11 +00:00
Cristian Tuns 6ccd260fb5 Backed out changeset 492b433034b3 (bug 1739894) for causing reftest failures. CLOSED TREE 2021-11-10 11:37:51 -05:00
Emilio Cobos Álvarez 6f02b18148 Bug 1739894 - Stop including overflowing descendants in outlines. r=jwatt
Keep old behavior behind a pref.

I've kept the tests that failed enabling the pref because they're
somewhat hard to rewrite and I'd rather avoid that until we know this
will stick, specially since they test the guts of the recursive function
that I'm basically ~disabling.

I've checked that the rendering on those is sensible / matches other
browsers.

Differential Revision: https://phabricator.services.mozilla.com/D130717
2021-11-10 15:24:30 +00:00
Ting-Yu Lin b738df1b25 Bug 1740175 - Convert NEEDS_REFLOW macro in nsHTMLScrollFrame::Reflow to lambda. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D130720
2021-11-09 22:41:15 +00:00
Emilio Cobos Álvarez 1d22fb4ae5 Bug 1732674 - Assert on tree mutations. r=jfkthame
This should hopefully help catch misuse. Fix an iterator that was living
for too long in ScrollIntoView.

Differential Revision: https://phabricator.services.mozilla.com/D128855
2021-11-09 15:55:55 +00:00
Jonathan Kew c77084245d Bug 1732674 - Make nsLineIterator a lightweight wrapper for an nsLineList_iterator instead of building a separate array. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D126671
2021-11-09 15:55:54 +00:00
Hiroyuki Ikezoe 9816dd2b16 Bug 1739541 - Introduce APZScrollAnimationType and use it in RepaintRequest and ScrollFrameHelopr instead of a boolean representing whether there's an animation or not. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D130421
2021-11-09 09:19:26 +00:00
Hiroyuki Ikezoe cd43013045 Bug 1739541 - Use `using` instead of `typedef` in nsGfxScrollFrame.h. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D130566
2021-11-09 09:19:26 +00:00
Hiroyuki Ikezoe 33d1f8ef64 Bug 1739541 - Set `TriggerByScript::Yes` for Element.scrollIntoView. r=botond
We'd want to differentiate Element.scrollIntoView call as `triggeredByScript`.

Differential Revision: https://phabricator.services.mozilla.com/D130419
2021-11-09 09:19:25 +00:00
Hiroyuki Ikezoe 1aea05dff0 Bug 1739541 - Introduce TriggeredByScript in ScrollPositionUpdate and set `Yes` for ScrollToCSSPixels and ScrollByCSSPixels. r=botond
Both ScrollToCSSPixels and ScrollByCSSPixels are called only from JS via
Element.scrollTo, Element.scrollTop, Element.scrollLeft, Window.scroll,
Window.scrollTo and Window.scrollBy.

Note that we don't target either Window.scrollByLines or Window.scrollByPages
(both end up calling ScrollFrameHelper::ScrollBy) because both are triggered by
user interactions for our XUL tree implementation, for example
Window.scrollByLines gets called in response to a DOMMouseScroll event in
tree.js [1].

[1] https://searchfox.org/mozilla-central/rev/a12c2c2e59c92d8f969d8f3f290ab16919449c9d/toolkit/content/widgets/tree.js#788

Differential Revision: https://phabricator.services.mozilla.com/D130418
2021-11-09 09:19:25 +00:00
Hiroyuki Ikezoe e1ac201baf Bug 1739541 - Drop ScrollOrigin argument from ScrollToCSSPixels. r=botond
There are 4 call sites of the function, Element::Scroll, Element::SetScrollTop,
Element::SetScrollLeft and nsGlobalWindowInner::ScrollTo. None of call sites
specifies ScrollOrigin.

Differential Revision: https://phabricator.services.mozilla.com/D130416
2021-11-09 09:19:24 +00:00
Hiroyuki Ikezoe fbdae21c47 Bug 1739541 - Drop ScrollOrigin argument from ScrollByCSSPixels. r=botond
All call sites of ScrollByCSSPixels specify ScrollOrigin::Relative.

Differential Revision: https://phabricator.services.mozilla.com/D130415
2021-11-09 09:19:24 +00:00
Daniel Holbert 0b51e59865 Bug 1707643 part 2: When computing static position of abspos grid child, perform alignment within content-box, rather than padding box. r=emilio
In the conditions where we hit this partiuclar codepath, the spec used to
require us to align within the grid's padding box (which is what we were trying
to do[1]), but now it requires us to align within the grid's content box.

This patch makes us start passing a bunch of WPT tests (whose .ini files I'm
removing here).

This patch also changes the reference case for some "last-baseline"-specific
tests in the same directory, by cribbing the "alignEnd" rule from the
neighboring non-"last-baseline" analog (since "last-baseline" falls back to end
alignment and is meant to be equivalent in these testcases).  Before this
patch, the affected reference cases were inadvertently depending on the Firefox
bug that I'm fixing here, and they were expecting the testcase's end-aligned
content to be at the wrong position as a result.  Chromium developers fixed
this issue in the neighboring non-"last-baseline" tests in [2], but they didn't
catch the files that I'm fixing here, because Chromium doesn't implement "last
baseline" alignment yet.

[1] Before this patch, we actually weren't quite aligning within the
padding-box, even though we were trying to. We were computing an alignment
offset based on the size of the padding box, and then we were using that offset
as a position within the *content box*.  This could result in us pushing
end-aligned content outside the grid entirely, as in the testcase on the bug
report for this bug.

[2] https://chromium-review.googlesource.com/c/chromium/src/+/2803842

Differential Revision: https://phabricator.services.mozilla.com/D130713
2021-11-09 06:14:21 +00:00
Ting-Yu Lin f32eaad379 Bug 1722484 Part 2 - Replace LineBreaker::Next() and WordBreaker::Next() with the new iterators. r=m_kato
With the rewrite, we reduce the dependency of lwbrk LineBreaker::Next(),
WordBreaker::Next(), and their `int32_t` sentinel values
NS_LINEBREAKER_NEED_MORE_TEXT and NS_WORDBREAKER_NEED_MORE_TEXT.

Differential Revision: https://phabricator.services.mozilla.com/D130392
2021-11-09 01:14:15 +00:00
Iulian Moraru 36283a9a3b Backed out 2 changesets (bug 1722484) for causing multiple build bustages. CLOSED TREE
Backed out changeset bef547b588ff (bug 1722484)
Backed out changeset e676fa1a0cb7 (bug 1722484)
2021-11-09 01:42:20 +02:00
Ting-Yu Lin 7310c93473 Bug 1722484 Part 2 - Replace LineBreaker::Next() and WordBreaker::Next() with the new iterators. r=m_kato
With the rewrite, we reduce the dependency of lwbrk LineBreaker::Next(),
WordBreaker::Next(), and their `int32_t` sentinel values
NS_LINEBREAKER_NEED_MORE_TEXT and NS_WORDBREAKER_NEED_MORE_TEXT.

Differential Revision: https://phabricator.services.mozilla.com/D130392
2021-11-08 22:24:19 +00:00
Emilio Cobos Álvarez c308704902 Bug 1738614 - Remove other Widget* colors. r=mstange
These are only used for frameset painting and the non-e10s <select>
dropdown focus codepath. We have other more appropriate standard
colors for this.

Differential Revision: https://phabricator.services.mozilla.com/D129992
2021-11-02 18:08:07 +00:00
Emilio Cobos Álvarez ac14d7e42d Bug 1738614 - Remove WindowBackground/Foreground system colors. r=mstange
There's no reason for these to be different to the CSS-exposed
Window/WindowText.

Differential Revision: https://phabricator.services.mozilla.com/D129990
2021-11-02 18:08:07 +00:00
Jonathan Kew a4983c6f2f Bug 1738560 - When text-transform is in effect, ensure we finish building the transformed textrun even if we would otherwise skip the line-break scan (in SVG text). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D130055
2021-11-02 11:47:01 +00:00
Emilio Cobos Álvarez d0295b6c6f Bug 1738781 - Invalidate anchor after layout if we can find a better one. r=dholbert
This is _very_ similar to code Blink has dealing with
content-visibility: auto:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/scroll_anchor.cc;l=658-659;drc=fd8802b593110ea18a97ef044f8a40dd24a622ec

They don't have this problem on the original test-case because they
incorrectly invalidate the anchor when focus changes regardless of
whether the focus is a "priority element" per spec.

So I think this is a better, more consistent behavior over all.

Differential Revision: https://phabricator.services.mozilla.com/D130130
2021-11-02 10:59:50 +00:00
Hiroyuki Ikezoe e5085ada71 Bug 1738839 - Drop layout.css.scroll-behavior.enabled. r=dholbert
It's been enabled by default for years since bug 1087559.

Differential Revision: https://phabricator.services.mozilla.com/D130147
2021-11-02 06:58:47 +00:00
Hiroyuki Ikezoe dd419fe544 Bug 1738811 - Drop ScrollSnapMode argument from nsIScrollableFrame::ScrollToCSSPixels and nsIScrollableFrame::ScrollByCSSPixels. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D130135
2021-11-02 05:08:03 +00:00
Miko Mynttinen 70489330ec Bug 1732921 - Part 1: Do not skip display list building when a replaced element is stacking context. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D129966
2021-11-01 20:22:33 +00:00
Sandor Molnar f5bbecdcc2 Backed out 13 changesets (bug 1711061) on devs request. CLOSED TREE
Backed out changeset c4f073f7e3a3 (bug 1711061)
Backed out changeset aced4b672fb4 (bug 1711061)
Backed out changeset 3687e798f665 (bug 1711061)
Backed out changeset 7b471990ea86 (bug 1711061)
Backed out changeset 1014a95f540e (bug 1711061)
Backed out changeset a37b3091281d (bug 1711061)
Backed out changeset 96a0ef35881b (bug 1711061)
Backed out changeset 38890cc266fb (bug 1711061)
Backed out changeset be73004c0850 (bug 1711061)
Backed out changeset b964576ae53d (bug 1711061)
Backed out changeset d453c5219255 (bug 1711061)
Backed out changeset 0145b538175b (bug 1711061)
Backed out changeset 41ba2e2a2d13 (bug 1711061)
2021-10-29 00:36:30 +03:00
Andrew Osmond c6eb106f04 Bug 1711061 - Part 12. Change the display list to use WebRenderImageProvider. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D126605
2021-10-27 01:24:35 +00:00
Jonathan Kew 7cda6fde19 Bug 1712780 - Skip running the line-breaker when scanning SVG text frames. r=emilio
As we don't support multi-line text in SVG, there's no point running the line-breaker and
collecting potential break positions for textframes that are part of an SVG text subtree.
Telling BuildTextRunsScanner to skip this makes it somewhat less expensive.

In my local build, this reduces the reflow time of the testcase from nearly 20s to about 4.5s.
Still much too long, but at least it's a step in the right direction.

Differential Revision: https://phabricator.services.mozilla.com/D129404
2021-10-26 16:54:01 +00:00
Sandor Molnar 6632079d8d Backed out 13 changesets (bug 1711061) for causing browser-chrome failures in test/performance/browser_startup_images. CLOSED TREE
Backed out changeset 5988220f56b8 (bug 1711061)
Backed out changeset cb7721d7ce49 (bug 1711061)
Backed out changeset 343746ffae73 (bug 1711061)
Backed out changeset 000940244dcf (bug 1711061)
Backed out changeset 27565d5ae08d (bug 1711061)
Backed out changeset f3b2379d971b (bug 1711061)
Backed out changeset d4b3d0fa1771 (bug 1711061)
Backed out changeset 9af5b3f2225f (bug 1711061)
Backed out changeset da992effeff1 (bug 1711061)
Backed out changeset 6b2bc6c16b9f (bug 1711061)
Backed out changeset ac2792d42be2 (bug 1711061)
Backed out changeset cb00177e655e (bug 1711061)
Backed out changeset 8d5261184226 (bug 1711061)
2021-10-26 18:04:34 +03:00
Andrew Osmond 0ac282d26a Bug 1711061 - Part 12. Change the display list to use WebRenderImageProvider. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D126605
2021-10-26 13:28:27 +00:00
Ting-Yu Lin 248b711736 Bug 1730570 - Clamp flex item's resolved min auto size if it's bogus. r=dholbert
This patch clamps the `resolvedMinSize` before the size is passed into
`UpdateMainMinSize`, which is where the assertion is triggered.

Also, tweak the MOZ_ASSERT a bit because it's best to test an nscoord is
not NS_UNCONSTRAINEDSIZE before invoking comparison operator.

Differential Revision: https://phabricator.services.mozilla.com/D129230
2021-10-26 00:01:58 +00:00
Ting-Yu Lin c2f6ef7a09 Bug 1736938 Part 3 - Make all WordBreaker's methods static, and adapt the callers. r=jfkthame
The motivation is the same as the previous part.

Differential Revision: https://phabricator.services.mozilla.com/D129109
2021-10-25 19:00:22 +00:00
Evgenia Kotovich 228e38a58c Bug 1576768 [eslint] Turn on JavaScript linting and formatting rules for .sjs files. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D128483
2021-10-25 11:12:41 +00:00
Emilio Cobos Alvarez 920a666c29 Bug 1736379 - Tweak selection contrast check to avoid totally-indistinguishable selection background. r=jfkthame
Windows on dark mode uses a semi-transparent selection background like macOS,
which is basically the proton accent color. Avoid totally indistinguishable
backgrounds by ensuring there's at least minimal background contrast when
NS_SAME_AS_FOREGROUND_COLOR is used.

Differential Revision: https://phabricator.services.mozilla.com/D128757
2021-10-22 15:55:54 +00:00
criss 152f71d4d3 Backed out changeset b60f98f26664 (bug 1576768) for causing mochitest failures. CLOSED TREE 2021-10-22 15:55:50 +03:00
Evgenia Kotovich e29e29aa5a Bug 1576768 [eslint] Turn on JavaScript linting and formatting rules for .sjs files. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D128483
2021-10-22 11:39:46 +00:00
Emilio Cobos Álvarez 54055aeca2 Bug 1737012 - Make nsIFrame::ListTag() include the content id. r=dholbert,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D129136
2021-10-21 17:36:27 +00:00
Greg Tatum ee2694c97d Bug 1719546 - Replace nsBidi with mozilla::intl::Bidi; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D128793
2021-10-20 14:01:21 +00:00
Norisz Fay 489e82dcc1 Backed out 2 changesets (bug 1732674) for line iterator crashes (bug 1733047) a=backout
Backed out changeset 730555699380 (bug 1732674)
Backed out changeset f529288a6dde (bug 1732674)
2021-10-20 12:24:14 +03:00
Emilio Cobos Álvarez cfc9af581b Bug 1732674 - Assert on tree mutations. r=jfkthame
This should hopefully help catch misuse. Fix an iterator that was living
for too long in ScrollIntoView.

Differential Revision: https://phabricator.services.mozilla.com/D128855
2021-10-19 09:29:13 +00:00
Jonathan Kew a6be3734b3 Bug 1732674 - Make nsLineIterator a lightweight wrapper for an nsLineList_iterator instead of building a separate array. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D126671
2021-10-19 09:29:13 +00:00
Emilio Cobos Álvarez 59c3527c15 Bug 1735797 - Fix scrollbar caching on macOS. r=mstange
For that:

 * Remove support for caching resizer styles, since they don't seem
   common enough to warrant it, unlike all other scrollbar parts.

 * Make scrollcorners have pointer-events: none with overlay scrollbars,
   so that the setup works / we can assert that if we have overlay
   scrollbars then we don't care about the pointer-events value on
   ancestors.

Differential Revision: https://phabricator.services.mozilla.com/D128772
2021-10-18 18:25:31 +00:00
Evgenia Kotovich 0d0980ee0d Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-18 09:26:33 +00:00
Jeff Muizelaar f76f41feb4 Bug 1736236 - Remove obsolete LayerManager.h. r=gfx-reviewers,lsalzman
This adds a bunch of #include "WindowRenderer.h" in places
that were getting it implicitly before.

Differential Revision: https://phabricator.services.mozilla.com/D128687
2021-10-17 23:00:47 +00:00
Noemi Erli 2bba3cec69 Backed out changeset 2ab6bb03dcc1 (bug 1576768) for causing failures in test_double_submit.html CLOSED TREE 2021-10-18 02:05:57 +03:00
Evgenia Kotovich 3e3dff109c Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-17 14:59:14 +00:00
criss 55677726ee Backed out changeset ce929d9e000a (bug 1732674) for causing nsLineIterator::FindLineContaining crashes (bug 1733047) . a=aryx 2021-10-16 12:46:38 +03:00
Alexandru Michis dac6815201 Backed out changeset 7c08aa027893 (bug 1576768) for causing multiple failures.
CLOSED TREE
2021-10-15 16:52:43 +03:00
Jonathan Kew a66831cb8c Bug 1732674 - Make nsLineIterator a lightweight wrapper for an nsLineList_iterator instead of building a separate array. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D126671
2021-10-15 13:13:04 +00:00
Evgenia Kotovich a8b32926fa Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-15 12:58:11 +00:00
Timothy Nikkel 3facb5123d Bug 1734356. Remove code in ScrollFrameHelper constructor that sets a displayport when apz is disabled. r=botond
This code was added in bug 1031107 back when we didn't have apz on desktop, and even on android apz was not reported as enabled because we were using the java pan zoom code (https://bugzilla.mozilla.org/show_bug.cgi?id=1031107#c20).

Looks like the goal of this code was to improve performance when tiling was enabled (splitting up layers into tiles). The code to actually do this tiling appears gone now, so we shouldn't need this.

We can further ask if something might be depending on this code even though it's not related to tiling. The layers.enable.tiles pref is enabled on mac and android, so we'd have bugs on Linux and mac if that were true. Further, the only places that apz is disabled now is popups that do not have remote content in them, and the only scroll frames that are IsAlwaysActive are root scroll frames of root content documents (in process). If addons put an iframe in a popup I think it has to be remote, and I don't think we have any content documents in popups, and if we did and there was a problem with removing that code we'd already have that problem on Linux and Windows. So this should be safe to remove.

Differential Revision: https://phabricator.services.mozilla.com/D127635
2021-10-15 09:41:56 +00:00
Emilio Cobos Álvarez 210f6001ae Bug 1590247 - Fix some pre-existing dynamic restyling issues with scrollbar-width. r=dholbert
This was pre-existing but caught by some scrollbar-width tests. A
test-case that reproduces on current nightly:

  data:text/html,<html style="overflow: scroll; scrollbar-color: red red; scrollbar-width: thin">

Toggling the `scrollbar-width` declaration in devtools doesn't change
the effective scrollbar width. Ensure we correctly reflow the scrollbars
in this case.

Differential Revision: https://phabricator.services.mozilla.com/D128515
2021-10-14 21:19:14 +00:00
Emilio Cobos Álvarez 7db332dc3d Bug 1590247 - Don't reframe scrollable frames if we already have all needed anonymous content. r=dholbert
This prevents jank when switching from overflow: auto -> hidden or such.

Differential Revision: https://phabricator.services.mozilla.com/D128367
2021-10-14 21:19:14 +00:00
Butkovits Atila 13f18064b3 Backed out 2 changesets (bug 1590247) for causing failures at scrollbar-width-paint-001.html. CLOSED TREE
Backed out changeset 9b1d970ca9c2 (bug 1590247)
Backed out changeset 57193e853f39 (bug 1590247)
2021-10-14 23:02:38 +03:00
Emilio Cobos Álvarez 45a7260acb Bug 1590247 - Don't reframe scrollable frames if we already have all needed anonymous content. r=dholbert
This prevents jank when switching from overflow: auto -> hidden or such.

Differential Revision: https://phabricator.services.mozilla.com/D128367
2021-10-14 15:42:06 +00:00
Masayuki Nakano 16f869402f Bug 1734771 - part 10: Make `ContentEventHandler::ExpandToClusterBoundary()` take `Text&` instead of `nsIContent*` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D128147
2021-10-13 06:52:04 +00:00
Timothy Nikkel 377995ccb8 Bug 1725569. Send visualViewport resize events for iframes. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D127941
2021-10-13 03:01:34 +00:00
Ting-Yu Lin ca7c388f7e Bug 1735251 - Use AxisTracker::MainComponent() to retrieve main max size. r=emilio
After Bug 1681849 Part 4 [1], accessing ComputedMaxSize() is trivial.
Note: MainComponent() expects its aSize argument in flex container's
writing mode, which matches aReflowInput's writing mode, so we don't
need any conversion.

[1] https://hg.mozilla.org/mozilla-central/rev/80ed365889fc

Differential Revision: https://phabricator.services.mozilla.com/D128151
2021-10-12 17:51:12 +00:00
Ting-Yu Lin 7ec49f975f Bug 1735251 - Set ReflowInput::mComputeSize in one operation. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D128150
2021-10-12 17:51:11 +00:00
Eitan Isaacson bc023a74f1 Bug 1733238 - P2: Make ImageAccessible an imgINotificationObserver. r=Jamie
Use imgINotificationObserver to get notified of size availability.
Layout uses an observer to wait for this too. Our observer is notified
after layout so we should have bounds by then.

We need to store the request status because we get a lot of "replayed"
status changes that would cause chatty and wrong state change events
when the accessible is first created and bound to parent.

We can use that status for both INVISIBLE and ANIMATED states in
NativeState.

Differential Revision: https://phabricator.services.mozilla.com/D127719
2021-10-12 15:46:38 +00:00
Emilio Cobos Álvarez 8ca969082f Bug 1674204 - Fix hyphenated text min-content size. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D128105
2021-10-12 13:06:02 +00:00
Emilio Cobos Álvarez 4f8856c545 Bug 1730503 - Make RDM force Android-style scrollbars better. r=mstange,devtools-backward-compat-reviewers,nchevobbe
There are a few bits that still don't work with this patch but will with the
following patches.

Differential Revision: https://phabricator.services.mozilla.com/D128083
2021-10-12 09:21:17 +00:00
Masayuki Nakano 1836c00470 Bug 1729170 - Make all methods of `nsTextFragment` take `uint32_t` for the offset and length of text r=smaug
`nsTextFragment` is a storage of data node and DOM offset is `uint32_t`, but
some methods of `nsTextFragment` takes `int32_t` for the offset/length in
its text.  Therefore, callers need to cast from `uint32_t` to `int32_t` if
the offset value is offset in a DOM node.  Therefore, all methods of it should
take `uint32_t` values as offset/length in its text.

Differential Revision: https://phabricator.services.mozilla.com/D127923
2021-10-12 05:05:12 +00:00
Narcis Beleuzu 908970e8a5 Backed out 3 changesets (bug 1733238) for Bp-hybrid bustages on ImageAccessible . CLOSED TREE
Backed out changeset af8436178a49 (bug 1733238)
Backed out changeset 910aebecda65 (bug 1733238)
Backed out changeset c5d218eb6acb (bug 1733238)
2021-10-12 00:53:23 +03:00
Eitan Isaacson 4bd2d11bcb Bug 1733238 - P2: Make ImageAccessible an imgINotificationObserver. r=Jamie
Use imgINotificationObserver to get notified of size availability.
Layout uses an observer to wait for this too. Our observer is notified
after layout so we should have bounds by then.

We need to store the request status because we get a lot of "replayed"
status changes that would cause chatty and wrong state change events
when the accessible is first created and bound to parent.

We can use that status for both INVISIBLE and ANIMATED states in
NativeState.

Differential Revision: https://phabricator.services.mozilla.com/D127719
2021-10-11 19:43:19 +00:00
Jonathan Kew 6a202b53cb Bug 1731120 - Make truly-empty textframes return true for IsEmpty even when WhiteSpaceIsSignificant, unless they're editable or in an <input> element. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D128009
2021-10-11 12:54:44 +00:00
Iulian Moraru 2c4b830b92 Backed out changeset 5500054be8d6 (bug 1731120) for causing android 4.1 shippable build bustages. CLOSED TREE 2021-10-10 23:08:49 +03:00