Commit graph

569 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
ce985f9f3c Bug 1769034 - Remove ContainerTracker. r=miko
We don't use the stored container anymore, this can just be a boolean.

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

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D146070
2022-05-11 19:20:04 +00:00
Narcis Beleuzu
1298f7b978 Merge autoland to Mozilla-Central. a=merge 2022-05-07 12:41:16 +03:00
Emilio Cobos Álvarez
c9e3177022 Bug 1768157 - Remove kSelectPopupList. r=jwatt
It's unused since bug 1744009 at least, so no behavior change.

Depends on D145714

Differential Revision: https://phabricator.services.mozilla.com/D145715
2022-05-06 15:46:49 +00:00
Glenn Watson
4626506ead Bug 1765862 - Skip backdrop-filter if nsIFrame reports not visible for painting r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D145526
2022-05-06 01:12:05 +00:00
Narcis Beleuzu
609a0387b8 Backed out changeset bcc1a29ee9c8 (bug 1765525) for wr failure on backdrop-filter-svg-foreignObject.html 2022-05-05 03:42:35 +03:00
Glenn Watson
7dfd66fe8a Bug 1765525 - Fix gecko DL creation for backdrop-filters with clips r=gfx-reviewers,lsalzman
Change to derive from nsDisplayEffectsBase, since the backdrop-filter
can still have a visual bounds (and effect) even if the child
stacking context has no items. Also use the same approach to get
the bounding rect and implement GetBounds as nsDisplayFilters uses.

Differential Revision: https://phabricator.services.mozilla.com/D145295
2022-05-04 19:08:31 +00:00
Emily McDonough
f7af34aa62 Bug 1740366 - Implement paginated fragmentation on page-name boundaries r=dholbert
This has a TODO about empty page names on previous sibling frames, to match
Chrome's behavior of page break coalescing we should be looking to the frame
before that sibling and check for page breaks there instead.

Differential Revision: https://phabricator.services.mozilla.com/D140423
2022-04-28 00:03:19 +00:00
Boris Chiou
a3949a5f7a Bug 1696560 - Apply transferred min & max sizes for flex base size if main is the inline axis. r=dholbert
Basically, the transferred min & max sizes shouldn't override the min &
max sizing properties, so applying it earlier than these properties
should be identical. This just makes the flex base size and main size be
more correct at the beginning (and so other adjustments of sizes
in flex algorithm can override the transferred min/max sizes), for
non-replaced elements.

Note:
In Chromium code, it clamps the flex items' base size by transferred min &
max sizes, but the computation of items' used min & used max sizes doesn't
include the transferred min & max sizes.

So in this patch, I'm trying to make this patch simple: we let minimum &
maximum sizes only taken into account for flex base size and only for
non-replaced elements for now. So the behavior should be similar to other
browsers.

And we may have to update this tentative solution once these spec words get
updated.

Differential Revision: https://phabricator.services.mozilla.com/D144499
2022-04-26 19:31:25 +00:00
Martin Robinson
3df3e47b53 Bug 1764721 - Content skipped via content-visibility should not be focusable r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D143723
2022-04-26 08:35:53 +00:00
David Shin
ec93876623 Bug 1755565 - Implement contain: inline-size. r=emilio,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D143501
2022-04-19 17:44:16 +00:00
Martin Robinson
2893cfed87 Bug 1762407 - Do not scroll content with content-visibility: hidden ancestors into view r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142563
2022-04-07 10:38:27 +00:00
Martin Robinson
b24fd95192 Bug 1761995 - Skip content-visibility: hidden content in display lists r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D142341
2022-04-05 09:10:42 +00:00
Emilio Cobos Álvarez
bf2d51b0a5 Bug 1761839 - Allow user-select: none to override modal dialog selectability. r=sefeng
Instead of enforcing it in C++ use a UA rule instead, so that authors
can override it if needed.

Depends on D142582

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

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

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

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

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

Differential Revision: https://phabricator.services.mozilla.com/D142107
2022-03-30 17:34:31 +00:00
Miko Mynttinen
f617868c63 Bug 1736069 - Unconditionally create nsDisplayStickyPosition items r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D141925
2022-03-24 17:40:32 +00:00
Emilio Cobos Álvarez
1d365913dc Bug 1759749 - Avoid heap-allocating a rect property for most common outline case. r=dholbert
Now that we don't include overflow in outlines (bug 1739894) the
overwhelmingly common case is that innerRect == GetRectRelativeToSelf(),
except on a couple special cases.

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

Depends on D141320

Differential Revision: https://phabricator.services.mozilla.com/D141321
2022-03-17 12:16:16 +00:00
Emilio Cobos Álvarez
cadac0bf3d Bug 1754459 - Improve caret position selection for images. r=dholbert
What saves us in the non-pointer-events: none case is silly, and is
this loop that hits the draggable image:

  https://searchfox.org/mozilla-central/rev/fa69d8b248e6c1df670aa6b019e30ec37e6672be/layout/generic/nsIFrame.cpp#4752

Needs tests (if it doesn't affect existing ones), but uploading for some
initial feedback. I think this makes a lot more sense than the existing
code, and works for editing and dragging the same way, so it's nice to
have less special-cases.

Differential Revision: https://phabricator.services.mozilla.com/D141242
2022-03-16 23:32:44 +00:00
Emilio Cobos Álvarez
6e94231e2d Bug 1759866 - Minor clean-up to the selection frame-edge code. r=dholbert
This doesn't change behavior but makes some code a bit nicer to read and
documents some of the code that wasn't obvious otherwise.

Differential Revision: https://phabricator.services.mozilla.com/D141236
2022-03-16 18:55:01 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Timothy Nikkel
61363a9e97 Bug 1731575. Don't use nsIScrollableFrame::IsScrollingActive when making decisions about what to send to the compositor about sticky position content. r=mattwoodrow,botond
nsIScrollableFrame::IsScrollingActive basically means "has this scroll frame been scrolled recently or is this the root scroll frame". Neither of which is relevant when we are async scrolling a scrollframe on the compositor.

What determines if we can scroll a scroll frame async is ScrollFrameHelper::mWillBuildScrollableLayer, aka nsIScrollableFrame::IsMaybeAsynchronouslyScrolled.

The code in nsDisplayStickyPosition::GetStickyScrollContainer already mostly neuters nsDisplayStickyPosition is this isn't the case, this just takes it one step further.

This also removes one more user of nsIScrollableFrame::IsScrollingActive, there are only a handful left.

Differential Revision: https://phabricator.services.mozilla.com/D126427
2021-10-10 09:07:54 +00:00
Emilio Cobos Álvarez
9fbc18ca4c Bug 1733384 - Make inert not modify the computed style. r=sefeng,layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D127422
2021-10-07 17:00:36 +00:00
Butkovits Atila
4d927c1fb4 Backed out 4 changesets (bug 1733384) for causing failures at browser_windowPrompt.js. CLOSED TREE
Backed out changeset fa609fadac26 (bug 1733384)
Backed out changeset dd1936d9fe17 (bug 1733384)
Backed out changeset 1a073e40ab1a (bug 1733384)
Backed out changeset 65708a4c708f (bug 1733384)
2021-10-07 17:52:51 +03:00
Emilio Cobos Álvarez
bfdd0fcc77 Bug 1733384 - Make inert not modify the computed style. r=sefeng,layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D127422
2021-10-07 11:47:34 +00:00
Morgan Reschenberg
8ec999d32d Bug 1726227: Cache parent-relative accessible bounds, resolution in parent process r=Jamie,eeejay
Differential Revision: https://phabricator.services.mozilla.com/D123399
2021-10-05 20:44:46 +00:00
Tetsuharu Ohzeki
5edbcffacb Bug 1733971 - Make nsIFrame::InvalidateLayer() return void. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D127460
2021-10-04 22:17:23 +00:00
Butkovits Atila
0db4640a28 Backed out 2 changesets (bug 1732154, bug 1726227) for causing build bustages complaining about RemoteAccessible. CLOSED TREE
Backed out changeset 4fd72f9ca327 (bug 1732154)
Backed out changeset 6591f14bbc71 (bug 1726227)
2021-10-05 00:19:09 +03:00
Morgan Reschenberg
c2cac47ff1 Bug 1726227: Cache parent-relative accessible bounds, resolution in parent process r=Jamie,eeejay
Differential Revision: https://phabricator.services.mozilla.com/D123399
2021-10-04 19:46:54 +00:00
Daniel Holbert
ed93bd5007 Bug 1733465 part 2: Modernize nsViewManager::GetRootWidget() to use already_AddRefed return value, instead of requiring getter_AddRefs at callsite. r=tnikkel
This patch shouldn't change behavior at all.

This patch replaces a manual NS_ADDREF call with typesafe code that manages the
reference count for us.  This reduces repeated boilerplate code, in the
implementation as well as the callsites.

Differential Revision: https://phabricator.services.mozilla.com/D127179
2021-10-01 20:38:09 +00:00
Sandor Molnar
325902a5b7 Backed out 5 changesets (bug 1733465) for causing android build bustages in android/SessionAccessibility.cpp. CLOSED TREE
Backed out changeset 4c5b28b66740 (bug 1733465)
Backed out changeset 3db0452b185c (bug 1733465)
Backed out changeset d7460c9c6acb (bug 1733465)
Backed out changeset 3cee3f595e45 (bug 1733465)
Backed out changeset 267d5fc92f12 (bug 1733465)
2021-10-01 19:13:59 +03:00
Daniel Holbert
5b203843bc Bug 1733465 part 2: Modernize nsViewManager::GetWidget() to use already_AddRefed return value, instead of requiring getter_AddRefs at callsite. r=tnikkel
This patch shouldn't change behavior at all.

This patch replaces a manual NS_ADDREF call with typesafe code that manages the
reference count for us.  This reduces repeated boilerplate code, in the
implementation as well as the callsites.

Differential Revision: https://phabricator.services.mozilla.com/D127179
2021-10-01 14:37:05 +00:00
Alexandru Michis
e912fb2466 Backed out changeset a4ebb978f792 (bug 1732674) for causing layout crashes (bug 1733047). a=backout 2021-09-30 17:38:15 +03:00
Jonathan Kew
6d191d1715 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-09-29 17:55:44 +00:00
Cristian Tuns
9285106fbd Backed out changeset 43d9f690a94f (bug 1732674) to fix nsLineIterator crashes (bug 1733047). CLOSED TREE 2021-09-29 03:45:51 -04:00
Ting-Yu Lin
8492d801e8 Bug 1731653 - Record padding change in a frame bit, and use it to detect inline resize. r=dholbert
We store this new bit in nsIFrame instead of in ReflowInput to record a
change to padding (inspired by the mHasBSizeChange bit). That is because
we may construct a ReflowInput more than one time before reflowing the
frame. The first construction of ReflowInput (in
SizeComputationInput::InitOffsets) will update
nsIFrame::UsedPaddingProperty() using the latest style data, so
we *cannot* determine the padding change in any of the subsequent
construction of ReflowInput.

dynamic-change-inline-size-001.html is the scenario fixed by
bug 1307853. We've already passed this test without this patch.

dynamic-change-inline-size-002.html is equivalent to 001.html except
it's written with "box-sizing:content".
dynamic-change-inline-size-003.html is adapted from testcase 2 in bug
1729122 comment 4. Both tests pass after this patch.

Differential Revision: https://phabricator.services.mozilla.com/D126422
2021-09-28 20:59:38 +00:00
Emilio Cobos Álvarez
e5a8824eaf Bug 1732759 - Unprefix -moz-fit-content. r=dholbert
I'm not aware of any reason we shouldn't do this, as it is interoperable
with other browsers, and it causes compat issues from sites that forget
to use the prefixed version.

Note this removes some #[parse(aliases)]. These only affect devtools
autocomplete behavior, and we avoid autocompleting -moz-prefixed
keywords when possible, so even though it's a slight behavior change,
it's worth it.

Differential Revision: https://phabricator.services.mozilla.com/D126718
2021-09-28 11:44:33 +00:00
Jonathan Kew
7fe40d2b21 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-09-28 11:34:02 +00:00
Jonathan Kew
1989dbf0ca Bug 1732463 - Make nsIFrame::GetContainingBlockForLine return a pair of nsIFrame*s instead of using an outparam for one of them. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D126587
2021-09-25 09:13:02 +00:00
Jonathan Kew
e8d5080a53 Bug 1732355 - Eliminate the nsILineIterator::GetNextSiblingOnLine virtual method, whose only implementations are trivial. r=layout-reviewers,emilio
Depends on D126532

Differential Revision: https://phabricator.services.mozilla.com/D126533
2021-09-24 14:20:07 +00:00
Jonathan Kew
8fcc9dd8a0 Bug 1732349 - patch 3 - Avoid getting line iterators that are not actually needed in nsIFrame::PeekOffsetForLine. r=emilio
We only need the actual iterator once, to get the line number; subsequently, we can use
the new CanProvideLineIterator method to check if we've found a block frame without
paying the cost of actually initializing it.

This eliminates the last remaining caller of nsIFrame::GetLineNumber, so that method
(which is prone to inefficient usage) can be removed altogether.

Differential Revision: https://phabricator.services.mozilla.com/D126532
2021-09-24 14:20:06 +00:00
Jonathan Kew
41e86438dd Bug 1732349 - patch 2 - Avoid redundant creation of a line-iterator in nsIFrame::GetFrameFromDirection. r=emilio
Depends on D126530

Differential Revision: https://phabricator.services.mozilla.com/D126531
2021-09-24 14:20:06 +00:00
Jonathan Kew
028c0f859f Bug 1732349 - patch 1 - Avoid redundant creation of a line-iterator in nsIFrame::PeekOffsetForLineEdge. r=emilio
Depends on D126470

Differential Revision: https://phabricator.services.mozilla.com/D126530
2021-09-24 14:20:05 +00:00
Jonathan Kew
fb9588e175 Bug 1732268 - Remove redundant failure-checks from nsLineIterator initialization, as it uses infallible allocation. r=dholbert
This means nsBlockFrame::GetLineIterator is also infallible, so callers that know
they're dealing with an nsBlockFrame (not an arbitrary nsIFrame) don't need to
check for null.

Differential Revision: https://phabricator.services.mozilla.com/D126470
2021-09-24 14:20:05 +00:00
James Teh
7caf3d0624 Bug 1729412: Add nsIFrame::GetContainingBlockForLine to facilitate checking whether two frames are on the same line. r=jfkthame
Previously, to check whether two frames were on the same line, you had to call nsIFrame::GetLineNumber on both of them.
If the lines were in a different containing block, this wastefully created line iterators.
With this new method, you can get the containing blocks for both frames and only create a single line iterator if the blocks are the same.
To achieve this, nsIFrame::CanProvideLineIterator was also added and is used by GetContainingBlockForLine.
Accessibility will use this new functionality in its new text boundary implementation.

Differential Revision: https://phabricator.services.mozilla.com/D126433
2021-09-23 11:38:09 +00:00
Matt Woodrow
5d982b06d4 Bug 1725267 - Remove paint compression. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D125799
2021-09-22 03:36:51 +00:00
Hiroyuki Ikezoe
e0d7cca528 Bug 1727674 - Replace nsLayoutUtils::GetCrossDocParentFrame with nsLayoutUtils::GetCrossDocParentFrameInProcess in nsIFrame::UpdateVisibilitySynchronously. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D125126
2021-09-22 00:57:14 +00:00
Daniel Holbert
b7cb22a3af Bug 1731359 part 1: Change the "NormalPositionProperty" frame property to use the "small value" method of storage. r=emilio
This frame property's type is small enough to fit directly in the property
table's 64-byte slot; so, this patch makes us store the data directly there
(rather than allocating it externally and storing a pointer in the table).

This patch shouldn't impact behavior at all.

Differential Revision: https://phabricator.services.mozilla.com/D126031
2021-09-20 22:26:14 +00:00
Sean Feng
fc3b778ccf Bug 1591366 - Improve nested grid layout performance r=mats
This patch improves nested grid layout performance by caching the grid
items' block axis measurement to avoid potentially doing exponential
reflows.

Differential Revision: https://phabricator.services.mozilla.com/D115711
2021-09-20 19:52:45 +00:00
Andrew Osmond
3a98545701 Bug 1728903 - Remove plumbing for CanvasLayer and ImageLayer. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D124406
2021-09-18 11:44:51 +00:00
Noemi Erli
bb5d736641 Backed out 2 changesets (bug 1591366) for causing failures in table-grid-item-dynamic-004.html CLOSED TREE
Backed out changeset 19be43686dc0 (bug 1591366)
Backed out changeset a2b6f6abda6e (bug 1591366)
2021-09-18 02:42:58 +03:00
Sean Feng
586a33d2b9 Bug 1591366 - Improve nested grid layout performance r=mats
This patch improves nested grid layout performance by caching the grid
items' block axis measurement to avoid potentially doing exponential
reflows.

Differential Revision: https://phabricator.services.mozilla.com/D115711
2021-09-17 21:06:52 +00:00
Daniel Holbert
86064ad618 Bug 1730774 part 3: Add includes for Inlines headers, to fix non-unified-build linking issues in layout/generic (and remove REQUIRES_UNIFIED_BUILD decl). r=TYLin
After the fixes in this patch, the REQUIRES_UNIFIED_BUILD declaration is no
longer needed, so I'm removing it here.  This directory now builds successfully
with that removed and with ac_add_options --disable-unified-build in the
mozconfig.

Differential Revision: https://phabricator.services.mozilla.com/D125738
2021-09-15 22:43:24 +00:00
Daniel Holbert
d05867cc4e Bug 1730774 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/generic. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D125611
2021-09-15 16:15:02 +00:00
criss
196daa1700 Backed out changeset 007ff7f371c9 (bug 1730774) for causing bustages on Bp-hybrid. CLOSED TREE 2021-09-15 09:14:41 +03:00
Daniel Holbert
522de8e4d7 Bug 1730774 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/generic, and remove REQUIRES_UNIFIED_BUILD declaration. r=TYLin
After the fixes in this patch, the REQUIRES_UNIFIED_BUILD declaration is no
longer needed, so I'm removing it here.  This directory now builds successfully
with that removed and with ac_add_options --disable-unified-build in the
mozconfig.

Depends on D125610

Differential Revision: https://phabricator.services.mozilla.com/D125611
2021-09-15 00:04:16 +00:00
Matt Woodrow
d41e38aec0 Bug 1727682 - Make WebRenderLayerManager not inherit LayerManager. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D124433
2021-09-05 22:36:45 +00:00
Iulian Moraru
d7a06601a0 Backed out changeset 089962073382 (bug 1728903) for causing Bp-hybrid bustages on ImageBitmapRenderingContext.cpp. CLOSED TREE 2021-09-03 18:49:32 +03:00
Andrew Osmond
472ab1dfc3 Bug 1728903 - Remove plumbing for CanvasLayer and ImageLayer. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D124406
2021-09-03 12:52:05 +00:00
Emilio Cobos Álvarez
70f53c85d4 Bug 856337 - Implement image-rendering: smooth and image-rendering: pixelated. r=jrmuizel,dholbert,longsonr
Also, more directly go from StyleImageRendering to wr::ImageRendering.

 * image-rendering: smooth the non-deprecated version of
   OptimizeQuality, which maps to SamplingFilter::LINEAR /
   wr::ImageRendering::Auto (which uses gl::LINEAR).

 * image-rendering: pixelated maps to wr::ImageRendering::Pixelated /
   SamplingFilter::POINT which is the same crisp-edges does.

Note that this uncovers that we were mapping image-rendering:
crisp-edges to wr::ImageRendering::Pixelated.

I'm going to preserve behavior on this patch but we should consider
switching that to map to wr::ImageRendering::CrispEdges on a
follow-up (filed bug 1728831 for this).

Differential Revision: https://phabricator.services.mozilla.com/D124378
2021-09-03 08:56:43 +00:00
Noemi Erli
e5f5e8d032 Backed out changeset f12c6a6cd1a5 (bug 1728903) for causing build bustage in TestTextures.cpp CLOSED TREE 2021-09-03 05:16:59 +03:00
Andrew Osmond
4219d92daf Bug 1728903 - Remove plumbing for CanvasLayer and ImageLayer. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D124406
2021-09-03 01:48:17 +00:00
Noemi Erli
f3a236c514 Backed out 2 changesets (bug 856337) for causing xpcshell failures in test_css-properties-db.js CLOSED TREE
Backed out changeset 7070c7cea8ec (bug 856337)
Backed out changeset edc12b36439f (bug 856337)
2021-09-03 01:36:17 +03:00
Emilio Cobos Álvarez
1602724fa9 Bug 856337 - Implement image-rendering: smooth and image-rendering: pixelated. r=jrmuizel,dholbert,longsonr
Also, more directly go from StyleImageRendering to wr::ImageRendering.

 * image-rendering: smooth the non-deprecated version of
   OptimizeQuality, which maps to SamplingFilter::LINEAR /
   wr::ImageRendering::Auto (which uses gl::LINEAR).

 * image-rendering: pixelated maps to wr::ImageRendering::Pixelated /
   SamplingFilter::POINT which is the same crisp-edges does.

Note that this uncovers that we were mapping image-rendering:
crisp-edges to wr::ImageRendering::Pixelated.

I'm going to preserve behavior on this patch but we should consider
switching that to map to wr::ImageRendering::CrispEdges on a
follow-up (filed bug 1728831 for this).

Differential Revision: https://phabricator.services.mozilla.com/D124378
2021-09-02 20:28:39 +00:00
Hiroyuki Ikezoe
dad8fcb8a2 Bug 1727431 - Replace GetCrossDocParentFrame in nsIFrame::GetOffsetToCrossDoc with GetCrossDocParentFrameInProcess. r=tnikkel
GetOffsetToCrossDoc takes a valid non null pointer of nsIFrame, so it will not
walk up the frame tree across process boundaries.

If the call site needed the offset up to a frame in a different process, which
means the function call used for obtaining the nsIFrame needs to be audited such
as bug 1727229, which is for auditing GetReferenceFrame call sites
(GetOffsetToCrossDoc is often used with GetReferenceFrame, something like
 `GetOffsetToCrossDoc(GetReferenceFrame())`.

FWIW, I did skim all GetOffsetToCrossDoc call sites [1], all look okay to me,
they are in auto scrolling, event handling, display list building, in the parent
process (i.e. XUL), etc. etc. Those features have been addressed in Fission.

[1] https://searchfox.org/mozilla-central/search?q=nsIFrame%3A%3AGetOffsetToCrossDoc&path=&case=true&regexp=false

Differential Revision: https://phabricator.services.mozilla.com/D123553
2021-08-25 10:23:32 +00:00
Hiroyuki Ikezoe
99412d3e2c Bug 1727434 - Replace GetCrossDocParentFrame nsIFrame::IsVisibleConsideringAncestors with GetCrossDocParentFrameInProcess. r=tnikkel
IsVisibleConsideringAncestors has a PresShell::IsUnderHiddenEmbedderElement which
is representing ancestor's visibility state in different process (but only for
contents processes). so it doesn't need to walk up the frame tree across process
boundaries.

Differential Revision: https://phabricator.services.mozilla.com/D123556
2021-08-24 23:33:07 +00:00
Matt Woodrow
0ee96e3fa5 Bug 1726291 - Remove FrameLayerBuilder. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D122930
2021-08-23 03:07:31 +00:00
Cosmin Sabou
b53abb88e7 Backed out changeset e111894317cc (bug 1726291) for causing assertion failures on WebRenderCommandBuilder.cpp. CLOSED TREE 2021-08-20 06:22:40 +03:00
Matt Woodrow
94015526e1 Bug 1726291 - Remove FrameLayerBuilder. r=miko
Differential Revision: https://phabricator.services.mozilla.com/D122930
2021-08-20 02:20:39 +00:00
Masayuki Nakano
19fc844cdb Bug 1714810 - Add a hidden pref to prevent to collapse selection at trying to start autoscroll r=edgar
Collapsing selection with middle click is compatible behavior with Chrome.
However, some Firefox users don't like this behavior, and we have not done it
before.  Therefore, this patch adds a hidden pref to prevent the new Chrome
compatible behavior.

Keeping compatible behavior is important and middle click is mainly used for
autoscroll.  Therefore, if auto scroll is disabled, we should ignore the new
pref for better compatibility.

Unfortunately, we collapse selection before `AutoScrollChild` handles
`mousedown` event with the listener in the system group (
 `nsIFrame::HandleEvent()` is called before that).  Therefore, we cannot prevent
 the selection change from `AutoScrollChild` only when it starts scroll.
 For solving this issue, we need a lot of big changes.  Therefore, for now,
 this patch just checks whether the pref is enabled or not.

 And also the new pref is ignored when middle click paste is enabled because
 it may be followed by "paste" event even when user clicks non-editable nodes.
 Then, if web apps handle "paste" event, the new selection range may be
 important.  Therefore, we should ignore the new pref in this case.

Differential Revision: https://phabricator.services.mozilla.com/D122931
2021-08-19 10:39:11 +00:00
Hiroyuki Ikezoe
85efe18337 Bug 1725893 - Replace GetCrossDocParentFrame with GetCrossDocParentFrameInProcess in nsIFrame::GetScreenRectInAppUnits. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D122675
2021-08-16 02:20:29 +00:00
Jonathan Kew
9c97d0c7bc Bug 1722300 - patch 4 - Implement internal destinations when generating PDF output through cairo. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120960
2021-08-04 12:52:38 +00:00
Alexandru Michis
326297bd47 Backed out changeset e41bfdf79fb8 (bug 1665476) for causing windows mochitest failures in test_windowminmaxsize.xhtml
CLOSED TREE
2021-08-02 02:14:52 +03:00
Emilio Cobos Álvarez
275707a51b Bug 1665476 - Remove nsRootBoxFrame to unify background propagation between XUL and non-XUL documents. r=layout-reviewers,mats
It's unused on mozilla-central, and Thunderbird can just use the canvas
frame as regular (X)HTML documents, so just use a canvas frame instead
of an nsRootBoxFrame for XUL as well.

nsRootBoxFrame was needed because of various XUL-specific things like
tooltips and so on lived there. But with the move away from XUL, that
functionality has been added to nsCanvasFrame already, behind a
principal check instead.

This also allows simplifying our background propagation setup, which was
only half-working for XUL documents (this bug is a consequence of that).

With this, most of the callers of nsCSSRendering::IsCanvasFrame can go.
They're only two of the frames that would return true for that that
actually paint backgrounds (nsCanvasFrame and nsRootBoxFrame), so the
codepaths in display list building and painting can just check
frame->IsCanvasFrame() instead.

The remaining caller to that function is
nsContainerFrame::SyncWindowProperties, and the change is also legit, in
the sense that the only thing SyncWindowProperties() really cares about
is propagating the max/min-width constraints from the root element's
style to the view/widget, and the only frame that would return true from
IsCanvasFrame and have a view is the viewport frame which is the root of
the frame tree.

Differential Revision: https://phabricator.services.mozilla.com/D90846
2021-08-01 21:57:28 +00:00
Kagami Sascha Rosylight
38acfa9c75 Bug 1712339 - Remove mouse event default action and revert bug 1674658 r=annevk
Differential Revision: https://phabricator.services.mozilla.com/D120854
2021-07-26 17:34:07 +00:00
Miko Mynttinen
f1d35170a6 Bug 1720803 - Merge nsDisplayItemBase and nsDisplayItem r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D120039
2021-07-16 13:11:40 +00:00
Miko Mynttinen
746fe9865a Bug 1720711 - Remove most nsDisplayItem::GetAbove() calls r=mattwoodrow
Replaces direct linked list traversals with iterators.

Differential Revision: https://phabricator.services.mozilla.com/D119985
2021-07-16 10:55:03 +00:00
Masayuki Nakano
1125b625c3 Bug 1715603 - part 1: Don't extend selection into a link r=edgar
If middle button click with `Shift` key occurs, Chrome and Safari extend the
selection in most cases.  However, if the clicked position is in a link,
Chrome does:
* If editable, collapse selection into the link instead of extending selection.
* If not editable, not extending selection and open tabs.

We should follow this behavior for both backward compatibility and web-compat.

Differential Revision: https://phabricator.services.mozilla.com/D119252
2021-07-13 08:15:55 +00:00
Botond Ballo
cdcdf984e4 Bug 1698693 - Convert audited calls to GetCrossDocParentFrame() to GetCrossDocParentFrameInProcess(). r=tnikkel
See bug 1698693 comment 6 and subsequent comments for the audit.

Depends on D117388

Differential Revision: https://phabricator.services.mozilla.com/D117389
2021-06-23 22:05:31 +00:00
Miko Mynttinen
c948d7c6a9 Bug 1494676 - Always consider scrollframes with will-change: scroll active r=tnikkel
This bypasses will-change budgeting for frames will-change: scroll.

Differential Revision: https://phabricator.services.mozilla.com/D118373
2021-06-23 13:10:15 +00:00
Matt Woodrow
ab659be5a3 Bug 1716904 - Make css perspective use DOM parent instead of containing block. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D118103
2021-06-18 03:35:10 +00:00
Alexandru Michis
459d907670 Backed out changeset add5e42aef7e (bug 1716904) for causing multiple failures.
CLOSED TREE
2021-06-18 01:47:14 +03:00
Matt Woodrow
ca62537bc3 Bug 1716904 - Make css perspective use DOM parent instead of containing block. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D118103
2021-06-17 20:28:12 +00:00
Mats Palmgren
19f1737894 Bug 1542807 part 2 - Remove (now unused) nsBulletFrame. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D111692
2021-06-14 01:22:05 +00:00
Boris Chiou
b9038da640 Bug 1681958 - Use eReplacedSizing to assert replaced elements for aspect-ratio. r=TYLin
It seems `eReplacedSizing` is much closer to the definition of replaced
elements (defined in [1]), and we override ComputeSize() for those
frames which are set eReplacedSizing or inline/table frames.

Perhaps we have to update the comments for the frame type bits later.

[1] https://html.spec.whatwg.org/multipage/rendering.html#replaced-elements

Differential Revision: https://phabricator.services.mozilla.com/D117372
2021-06-12 00:32:40 +00:00
Kagami Sascha Rosylight
55dbc99e55 Bug 1713491 - Return std::pair from nsIFrame::GetOffsets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117520
2021-06-11 23:54:06 +00:00
Butkovits Atila
ed3da455ae Backed out 7 changesets (bug 1542807) for causing failures at inert-retargeting-iframe.tentative.html. CLOSED TREE
Backed out changeset e9ef32fa2f2e (bug 1542807)
Backed out changeset 8fa0cb199975 (bug 1542807)
Backed out changeset 38daf64afe59 (bug 1542807)
Backed out changeset e3aee052c495 (bug 1542807)
Backed out changeset a71056d4c7cc (bug 1542807)
Backed out changeset cf91e7d0a37f (bug 1542807)
Backed out changeset eee949e5fd67 (bug 1542807)
2021-06-12 01:38:25 +03:00
Butkovits Atila
53cb932555 Backed out changeset aa6c7477c4d2 (bug 1713491) for causing build bustages on nsIFrame.cpp. CLOSED TREE 2021-06-12 00:12:06 +03:00
Kagami Sascha Rosylight
9d0b659349 Bug 1713491 - Return std::pair from nsIFrame::GetOffsets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117520
2021-06-11 18:53:28 +00:00
Mats Palmgren
1a3fc95ee3 Bug 1542807 part 2 - Remove (now unused) nsBulletFrame. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D111692
2021-06-11 18:10:38 +00:00
Dorel Luca
e1f4d9bb38 Backed out changeset 17e7b969b830 (bug 1713491) for Linux build bustage in gecko/dom/events/ContentEventHandler.cpp. CLOSED TREE 2021-06-11 17:52:10 +03:00
Kagami Sascha Rosylight
74760a9a0e Bug 1713491 - Return std::pair from nsIFrame::GetOffsets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117520
2021-06-11 11:37:11 +00:00
Marian-Vasile Laza
1710dd4296 Backed out changeset a722491ae6b3 (bug 1713491) on devs request
CLOSED TREE
2021-06-11 14:31:46 +03:00
Kagami Sascha Rosylight
2d398fce26 Bug 1713491 - Remove return type of nsIFrame::GetOffsets r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D117485
2021-06-11 10:59:12 +00:00
Boris Chiou
c0f286b1f5 Bug 1312588 - Part 5: Implement the intrinsic size contribution for fit-content(). r=TYLin,emilio
We simplified to just rely on the behavior of the plain argument. That is,
width: fit-content(50%) behaves the same as width: 50%; in all circumstances,
just clamped by min/max-content.

Note: for block axis, we treat fit-content() as initial value its minimal
and maximal value are identical and equal to the initial value in block axis.

From: https://github.com/w3c/csswg-drafts/issues/3731#issuecomment-661408877

Note: this patch doesn't include any update on flex and grid layout. We
may have to come back to check it.

Differential Revision: https://phabricator.services.mozilla.com/D113199
2021-06-08 05:05:51 +00:00
Boris Chiou
5c493e9341 Bug 1312588 - Part 3: Implement the layout part of fit-content() without the intrinsic contribution. r=emilio
This implements fit-content() for basic layout support. For intrinsic
contribution, we will do that in the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D111506
2021-06-08 05:05:50 +00:00
Boris Chiou
b65c4b45ec Bug 1312588 - Part 2: Support fit-content() in style. r=emilio
Support fit-content for preferred size, min size, and max size. This
patch only implement the style system. For layout part, we will do that
in the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D107161
2021-06-08 05:05:50 +00:00
Hiroyuki Ikezoe
9e52f5ce78 Bug 1699890 - Forcibly create a display item for backgroud-color animations even if it's transparent at the moment. r=boris,miko
Otherwise we keep restyling for the animations on the main thread and trying
to create display items for them.

Differential Revision: https://phabricator.services.mozilla.com/D115441
2021-05-26 00:17:39 +00:00
Butkovits Atila
202250ee59 Backed out 2 changesets (bug 1699890) for causing failures on background-color-animation-with-table2.html. CLOSED TREE
Backed out changeset 38bfba07a1ac (bug 1699890)
Backed out changeset 69826920340d (bug 1699890)
2021-05-25 15:30:01 +03:00
Hiroyuki Ikezoe
6b494767d9 Bug 1699890 - Forcibly create a display item for backgroud-color animations even if it's transparent at the moment. r=boris,miko
Otherwise we keep restyling for the animations on the main thread and trying
to create display items for them.

Differential Revision: https://phabricator.services.mozilla.com/D115441
2021-05-25 01:58:19 +00:00
Iulian Moraru
8887e460a5 Backed out changeset c5ce83934eac (bug 1699890) for causing dt assertion failures on nsDisplayList.h. CLOSED TREE 2021-05-21 14:25:37 +03:00
Hiroyuki Ikezoe
c8c37c4c3c Bug 1699890 - Forcibly create a display item for backgroud-color animations even if it's transparent at the moment. r=boris,miko
Otherwise we keep restyling for the animations on the main thread and trying
to create display items for them.

Differential Revision: https://phabricator.services.mozilla.com/D115441
2021-05-21 06:09:38 +00:00
Noemi Erli
15e72db6a4 Backed out changeset 1c7f2486a0e9 (bug 1699890) for causing multiple failures CLOSED TREE 2021-05-21 06:43:14 +03:00
Hiroyuki Ikezoe
7cceb18c82 Bug 1699890 - Forcibly create a display item for backgroud-color animations even if it's transparent at the moment. r=boris,miko
Otherwise we keep restyling for the animations on the main thread and trying
to create display items for them.

Differential Revision: https://phabricator.services.mozilla.com/D115441
2021-05-20 23:46:10 +00:00
Jonathan Kew
5e9a828adc Bug 1711064 - patch 1 - Add a pref to control whether linkifying Save-as-PDF output is enabled. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D115514
2021-05-20 08:25:44 +00:00
Jonathan Kew
d4614f8d3f Bug 454059 - Generate hyperlinks in PDF output for HTML link elements. r=mstange,mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D114208
2021-05-11 17:00:30 +00:00
Miko Mynttinen
a1d3ef4a17 Bug 1709452 - Do not store display list building rect in frames with continuations r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D114290
2021-05-10 14:37:49 +00:00
Emilio Cobos Álvarez
c8aa59aaae Bug 1707170 - Will-change should only create stacking contexts / containing blocks / etc if the property it'd change would apply. r=miko
As per https://drafts.csswg.org/css-will-change/#will-change.

> If any non-initial value of a property would cause the element to
> generate a containing block for absolutely positioned elements,
> specifying that property in will-change must cause the element to
> generate a containing block for absolutely positioned elements.

But in this case the transform property wouldn't apply to the element so
there's no reason to create a stacking-context.

Differential Revision: https://phabricator.services.mozilla.com/D114121
2021-05-10 13:09:42 +00:00
Kagami Sascha Rosylight
84d84038b4 Bug 1623717 - Make sure selection offset remains within inline editing host r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107120
2021-04-13 23:02:41 +00:00
Boris Chiou
98ea39687f Bug 1690423 - Part 2: Unified auto block-size behavior with UseAutoBSize flag in nsIFrame::ComputeSize(). r=mats
For grid layout, we set UseAutoBSize flag during measuring reflow to
resolve the grid track sizing. We still have to respect aspect ratio
for the calculation of the content contribution.

Differential Revision: https://phabricator.services.mozilla.com/D104936
2021-04-12 21:06:55 +00:00
Boris Chiou
20211d237b Bug 1690423 - Part 1: Fix stretched grid items with aspect-ratio. r=mats
Based on https://drafts.csswg.org/css-grid/#grid-item-sizing, the grid
items should ignore aspect-ratio if it's stretched in that axis.
1. If the alignment value is stretch: don't apply aspect ratio.
2. If the alignment value is normal: apply aspect ratio if we have one.
3. Other values: apply aspect ratio if we have one.

Note:
We also clamp margin block min size in nsBlockFrame::ComputeFinalSize(), so
grid-aspect-ratio-021.html is still passed without this patch. However, we
add this test case just in case and let other browsers catch this.

Differential Revision: https://phabricator.services.mozilla.com/D105082
2021-04-12 21:06:55 +00:00
Cosmin Sabou
99c461b614 Backed out changeset d5b874ccd877 (bug 1526970) as requested by miko.
CLOSED TREE
2021-04-09 19:12:38 +03:00
Boris Chiou
9a8efaa32e Bug 1699468 - Pass StyleSizeOverrides into ComputeISizeValue(). r=TYLin
The inconsistent usage of block size and aspect ratio in ComputeSize() and
ComputeISizeValue() cause this assertion.

We use StyleSizeOverrides when measuring the content block sizes of flex
items, and the expected computed value of block size is auto.

And so in ComputeISizeValue(), we should use any field in StyleSizeOverrides
that having an override rather than fetching it from the style system.

Differential Revision: https://phabricator.services.mozilla.com/D111031
2021-04-07 23:55:38 +00:00
Boris Chiou
d1b5874cdb Bug 1702835 - Min/Max size transfers should work only when inline size is not specified. r=TYLin,emilio
We have to apply min/max transferred size if inline size is auto or intrinsic
size keywords.

The basic principle is that sizing constraints transfer through the
aspect-ratio to the other side to preserve the aspect ratio to the extent
that they can without violating any sizes specified explicitly on that
affected axis.

Note: block-aspect-ratio-021.html tests the similar case with the non-zero
content size. However we don't have the similar tests for intrinsic size
keywords, so I add them in this patch as well.

Differential Revision: https://phabricator.services.mozilla.com/D110725
2021-04-05 21:34:49 +00:00
Timothy Nikkel
6420ad52a1 Bug 1700535. Make textareas inline block by default. r=emilio
This matches Chrome and Safari, as well as what we do for all other <input>s.

<input>s were changed to inline block in 1539469 with a couple of font inflation reftests marked as failing to follow up on. https://hg.mozilla.org/mozilla-central/rev/a1201db1b8cc is the follow up which made inputs not be font inflation containers. The same change for textarea fixes similar reftest failures for textarea. I read through the commit message for the change and doing the same for textareas seems to make sense but I don't understand it in detail.

Differential Revision: https://phabricator.services.mozilla.com/D109603
2021-04-02 23:34:47 +00:00
Emilio Cobos Álvarez
e7d8e6bfae Bug 1702216 - Paint auto-style outline with webrender if possible. r=mstange
I noticed we weren't doing this when looking at bug 1701910.

We remove support for auto style outlines in trees, which is unused
(checked that thunderbird and FF trees don't use outline: auto) and for
some mathml debugging code, which seems ok.

Differential Revision: https://phabricator.services.mozilla.com/D110399
2021-04-02 12:21:25 +00:00
Bogdan Tara
be061ee475 Backed out changeset 96866f6d4543 (bug 1702216) for css-ui/outline-*, 375508-1.html, z-index-1.html failures CLOSED TREE 2021-04-02 04:43:22 +03:00
Emilio Cobos Álvarez
70c869cd11 Bug 1702216 - Paint auto-style outline with webrender if possible. r=mstange
I noticed we weren't doing this when looking at bug 1701910.

We remove support for auto style outlines in trees, which is unused
(checked that thunderbird and FF trees don't use outline: auto) and for
some mathml debugging code, which seems ok.

Differential Revision: https://phabricator.services.mozilla.com/D110399
2021-04-02 00:18:29 +00:00
Simon Giesecke
613e20d136 Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D108587
2021-03-24 17:56:49 +00:00
Simon Giesecke
628cc55f22 Bug 708901 - Migrate to nsTHashSet in layout. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D108597
2021-03-24 17:56:46 +00:00
Csoregi Natalia
f54ee076ae Backed out 13 changesets (bug 708901, bug 1184468) for causing build bustage on GeckoViewHistory.cpp. CLOSED TREE
Backed out changeset b1e4c01e63b8 (bug 708901)
Backed out changeset 37b52cce83c0 (bug 708901)
Backed out changeset eee75f33f060 (bug 708901)
Backed out changeset 479bf64c7986 (bug 708901)
Backed out changeset 15a8fb94d15d (bug 708901)
Backed out changeset be31ccd9a61d (bug 708901)
Backed out changeset fc54f4eaedd5 (bug 708901)
Backed out changeset 03c3a56c3d13 (bug 708901)
Backed out changeset 73f11d3c1298 (bug 708901)
Backed out changeset aed22fd80893 (bug 708901)
Backed out changeset 74d8249fbe7e (bug 708901)
Backed out changeset acb725eb3c1d (bug 1184468)
Backed out changeset 70f3ea6efec4 (bug 1184468)
2021-03-24 19:26:20 +02:00
Simon Giesecke
c73f87b72b Bug 708901 - Migrate to nsTHashSet in layout. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D108597
2021-03-24 16:58:58 +00:00
Emilio Cobos Álvarez
5a6212f1ce Bug 1700478 - Make IsTransformed cheaper for non-transformed frames. r=longsonr
Remove a bit of the aStyleDisplay gunk that shouldn't be needed because
of two reasons:

 * Stylo is faster / has the style display one pointer-chase away, as
   opposed to the old style system.

 * We now check the MAY_BE_TRANSFORMED bit first now, and we deal with
   SVG-transformed frames, so for non-transformed frames IsTransformed
   should just be a bit-check now.

Differential Revision: https://phabricator.services.mozilla.com/D109511
2021-03-23 22:01:25 +00:00
Masayuki Nakano
2ad57f8fae Bug 1528289 - part 1: Move selection at middle button down rather than middle button up r=edgar
Chrome and Safari move selection at middle button down and does not modify the
range at middle button up.  However, they handle middle button down with
`Shift` key is "continue selection".  So, we should handle selection in
nsIFrame when `mousedown` event for middle mouse button is fired, but ignore
multiple selection, drag and drop and maintaining selection for aligning the
behavior to the other browsers.

This patch splits `nsIFrame::HandlePress()` and calls new method which
moves selection from `nsIFrame::HandleEvent()` when middle button is pressed.
(Note that this patch does not check whether middle click paste is enabled
because Chrome moves selection even on Windows which Chrome always disable
middle click paste on.)

With this change, "paste" event target is changed.  Previously, we used target
of the preceding `mouseup` event, but we start to use the target of the
preceding `mousedown` event.

Note that even with this patch, we still behave differently from Chrome even
in the following cases:
- middle mouse button down in selected range, we collapse it, but Chrome keeps
  the selection.
- middle mouse button click in selected range, we dispatch "paste" event, but
  Chrome collapse selection and not dispatch "paste" event.
- middle mouse button down in selected range and up in different element,
  Chrome does not modify the range nor dispatch "paste" event.
- Shift + middle mouse button in editable `<table>` works as non-editable
  in Chrome, but our editor handles it with special path.  Therefore, we
  don't modify the range but dispatch "paste" event in the selected range.

Changing them requires bigger change and probably requires some other features'
behavior changes.  Therefore, we shouldn't touch these issues until they are
actually reported as web-compat issues.

Differential Revision: https://phabricator.services.mozilla.com/D103997
2021-03-23 19:22:48 +00:00
Ting-Yu Lin
8c90a87873 Bug 1699327 - Add nsIFrame::GetMarginRect(), and comparison operators for LogicalMargin. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D107935
2021-03-18 01:06:03 +00:00
Daniel Holbert
3a2795a286 Bug 1699302 part 2: Use "InProcess" version of GetCrossDocParentFrame(), in a few other callsites in nsIFrame.cpp. r=hiro
This patch doesn't change behavior; it's just switching us between two
functions that do the same thing. (One is literally a trivial wrapper for the
other.)

We're using the new "InProcess" version of this API as a way of annotating
callsites that have been vetted as behaving properly in out-of-process iframes.

This patch fixes two callsites:
- The first callsite is an assertion whose condition becomes slightly stricter
  but should still be valid, in a scenario where we are at an oop-iframe
  boundary.

- The second is in IsFrameScrolledOutOfView(), which is part of an API that we
  use to optimize away animations if we can tell they're in an invisible
  subtree (see calls to IsScrolledOutOfView() in KeyframeEffect.cpp).  If we
  run up against an out-of-process iframe boundary when calling
  GetCrossDocParentFrame() here, we'll still be OK -- we should still be able
  to figure out whether the animation is invisible, via our call to
  nsLayoutUtils::FrameIsScrolledOutOfViewInCrossProcess() a few lines further
  down.  (Also: worst-case, we'll just run the animation even though it's not
  visible; so there's no loss of correctness.)

Differential Revision: https://phabricator.services.mozilla.com/D108878
2021-03-18 00:55:52 +00:00
Daniel Holbert
ad62a2c0e8 Bug 1699302 part 1: Use "InProcess" version of GetCrossDocParentFrame(), when propagating invalidation up the ancestor chain, in nsIFrame.cpp. r=hiro
This patch doesn't change behavior; it's just switching us between two
functions that do the same thing. (One is literally a trivial wrapper for the
other.)

We're using the new "InProcess" version of this API as a way of annotating
callsites that have been vetted as behaving properly in out-of-process iframes.

This patch is focusing on some callsites where we've got a frame that needs a
repaint, and we're propagate that information up its ancestor chain. It's OK
for these notifications to stop when we hit the edge of of an out-of-process
iframe, because painting/compositing at that granularity is handled separately.

Differential Revision: https://phabricator.services.mozilla.com/D108877
2021-03-18 00:55:51 +00:00
Emilio Cobos Álvarez
e315df01ba Bug 1698705 - Fix bogus block-frame check in GetRangeForFrame. r=saschanaz
What the rest of the selection code uses is IsBlockOutside, which is the
right thing to do here.

Differential Revision: https://phabricator.services.mozilla.com/D108619
2021-03-16 16:03:13 +00:00
Matt Woodrow
11304ea59b Bug 1685888 - Use the correct offset to reference frame for items wrapping a transform item. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D107941
2021-03-15 03:44:57 +00:00
Alexandru Michis
317bdfe06a Backed out changeset b63a8619b481 (bug 1685888) for causing crashtest assertion failures in 1507961-1.html
CLOSED TREE
2021-03-12 13:49:36 +02:00
Matt Woodrow
1d7840d8f7 Bug 1685888 - Use the correct offset to reference frame for items wrapping a transform item. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D107941
2021-03-12 00:27:30 +00:00
Jonathan Kew
989931f032 Bug 1696176 - Fix nsIFrame::PeekBackwardAndForward so that selectAtPoint correctly selects a single character or cluster rather than two adjacent characters. r=dholbert,emilio
This also prevents incorrectly selecting two words when double-clicking at
the end of the first word (before the inter-word space).

We also update the selectAtPoint testcase to target more widely-spread glyphs,
to check that it is behaving accurately across a larger distance.

Differential Revision: https://phabricator.services.mozilla.com/D107309
2021-03-11 16:34:23 +00:00
Brindusan Cristian
17a66efa77 Backed out changeset d7e50a94db5b (bug 1696176) for bc failures in browser_edit.js. CLOSED TREE 2021-03-11 04:30:00 +02:00
Boris Chiou
f448377232 Bug 1682032 - aspect-ratio should be applied for auto block-size by default. r=emilio
Based on the discussion in
https://github.com/w3c/csswg-drafts/issues/5721#issuecomment-781702159,
the default ratio-dependent axis is block axis (though the spec issue is
for replaced elements, but I think the behavior should be consistent).
So we should apply aspect-ratio not matter what the inline size is (e.g.
nscoord_MAX, auto or other values).

In the test case, the min-block-size is 1073741823, and its transferred
min-inline-size is also 1073741823, so we get a 1073741823 (i.e. nscoord_MAX)
preferred inline size (i.e. result.ISize(aWM) == NS_UNCONSTRAINEDSIZE).
However, we still have to apply aspect-ratio because the style of block-size is
auto, and so mFlags.mBSizeIsSetByAspectRatio should be set unconditionally here.

I still keep this assertion because it helps me catch this potential
issue. (Just reword it anyway.)

Differential Revision: https://phabricator.services.mozilla.com/D107764
2021-03-10 23:20:49 +00:00
Jonathan Kew
3efd86825e Bug 1696176 - Fix nsIFrame::PeekBackwardAndForward so that selectAtPoint correctly selects a single character or cluster rather than two adjacent characters. r=dholbert,emilio
This also prevents incorrectly selecting two words when double-clicking at
the end of the first word (before the inter-word space).

We also update the selectAtPoint testcase to target more widely-spread glyphs,
to check that it is behaving accurately across a larger distance.

Differential Revision: https://phabricator.services.mozilla.com/D107309
2021-03-10 22:48:16 +00:00
Bogdan Tara
446173458c Backed out 3 changesets (bug 1696176, bug 1342741) for test_nsIHTMLEditor_getSelectedElement.html and inert-retargeting-iframe.tentative.html failures CLOSED TREE
Backed out changeset 1154df798888 (bug 1342741)
Backed out changeset 02b69c938fbe (bug 1342741)
Backed out changeset a7ceef946175 (bug 1696176)
2021-03-10 17:06:26 +02:00
Jonathan Kew
b906335684 Bug 1696176 - Fix nsIFrame::PeekBackwardAndForward so that selectAtPoint correctly selects a single character or cluster rather than two adjacent characters. r=dholbert,emilio
This also prevents incorrectly selecting two words when double-clicking at
the end of the first word (before the inter-word space).

We also update the selectAtPoint testcase to target more widely-spread glyphs,
to check that it is behaving accurately across a larger distance.

Differential Revision: https://phabricator.services.mozilla.com/D107309
2021-03-10 13:48:46 +00:00
Ting-Yu Lin
e1b891089b Bug 1697325 Part 5 - Add GetOverflowAreasRelativeToParent(), and simplify all the call sites. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107740
2021-03-10 05:59:49 +00:00
Ting-Yu Lin
9cb2451f17 Bug 1697325 Part 4 - Change two overflow type #defines to values in an enum class, and revise documentation. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107738
2021-03-10 05:59:49 +00:00
Ting-Yu Lin
143e2c0f97 Bug 1697325 Part 3 - Change NS_FRAME_OVERFLOW_DELTA_MAX to a constexpr in InkOverflowDeltas. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107737
2021-03-10 05:59:48 +00:00
Ting-Yu Lin
0bd8f3a6d6 Bug 1697325 Part 2 - Merge SetOverflowAreas() documentation in nsIFrame.cpp into nsIFrame.h. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D107736
2021-03-10 05:59:48 +00:00
Ting-Yu Lin
61b6f3db62 Bug 1697325 Part 1 - Rename VisualDeltas to InkOverflowDeltas. r=emilio
Bug 1637130 renamed visual overflow to ink overflow to match the spec
terms. This is a follow-up to rename the struct that stores small ink
overflow in nsIFrame.

Differential Revision: https://phabricator.services.mozilla.com/D107735
2021-03-10 05:59:47 +00:00
Ting-Yu Lin
23ed4bcff6 Bug 1696584 - Remove UnionRectEdges() and replace the callers with the equivalent UnionEdges(). r=emilio
UnionRectEdges() and UnionEdges() are equivalent, and the later has a
modern interface with a shorter name. Let's remove the former.

Differential Revision: https://phabricator.services.mozilla.com/D107315
2021-03-07 23:07:08 +00:00
Emilio Cobos Álvarez
dc59483894 Bug 941356 - Fix start offset of transformed drag images. r=botond
I'm not sure whether we should deal with ancestor scales and such. There
seemed to be a discussion about that in D77436 but dealing with
partially-3d-transformed content sounds like a massive pain. For now
this fixes the start point, which is a progression.

Differential Revision: https://phabricator.services.mozilla.com/D106896
2021-03-04 10:56:22 +00:00
Ting-Yu Lin
7e74c47006 Bug 1690701 Part 2 - Check NS_FRAME_OUT_OF_FLOW bit in nsIFrame::IsAbsolutelyPositioned(). r=emilio
I assume nsIFrame::IsAbsolutelyPositioned()'s callers really want to
check whether a frame is a real abspos frame, not just check a frame has
a abspos style. This could potentially change the behavior, but I feel
its the right thing to do.

Differential Revision: https://phabricator.services.mozilla.com/D106580
2021-03-04 00:34:03 +00:00
Ting-Yu Lin
a0be0aea13 Bug 1690701 Part 1 - Check floating style when determining whether it is a floating first letter. r=layout-reviewers,emilio
IsFontSizeInflationContainer() is a helper of nsIFrame::Init(). That is,
when it is called from a caller like
nsCSSFrameConstructor::CreateFloatingLetterFrame(), the
`NS_FRAME_OUT_OF_FLOW` bit is not set yet. There is also a hint at the
call site
https://searchfox.org/mozilla-central/rev/362676fcadac37f9f585141a244a9a640948794a/layout/generic/nsIFrame.cpp#770

To fix it, we need to change the condition to check only the
floating style.

layout/reftests/bidi/with-first-letter-2b.html is one of the testcases
that can trigger the following assertion without this patch.

  ###!!! ASSERTION: should not be container for font size inflation

Differential Revision: https://phabricator.services.mozilla.com/D106579
2021-03-04 00:34:03 +00:00
Sebastian Hengst
7916a12f4f Backed out 2 changesets (bug 1528289) for breaking navigation with clicks after user scrolled by clicking with middle mouse button. a=backout
Backed out changeset 33c7b633ada2 (bug 1528289)
Backed out changeset be5cf87707f9 (bug 1528289)
2021-03-03 14:29:12 +01:00
Emilio Cobos Álvarez
c17b1c2e53 Bug 1695390 - Move extremum lengths to the individual Size / MaxSize types. r=boris
This will prevent growing them when introducing fit-content(<length>).

This can _almost_ be derived, if it wasn't because of the quirky stuff.
I think the macro is probably good enough for now but let me know if you
disagree.

Differential Revision: https://phabricator.services.mozilla.com/D106713
2021-03-02 12:11:35 +00:00
Brindusan Cristian
82efbb80e1 Backed out changeset be6d9849825d (bug 1695390) for wr failures in col-definite-max-size-001.html. CLOSED TREE 2021-03-02 13:41:40 +02:00
Emilio Cobos Álvarez
b5686164be Bug 1695390 - Move extremum lengths to the individual Size / MaxSize types. r=boris
This will prevent growing them when introducing fit-content(<length>).

This can _almost_ be derived, if it wasn't because of the quirky stuff.
I think the macro is probably good enough for now but let me know if you
disagree.

Differential Revision: https://phabricator.services.mozilla.com/D106713
2021-03-02 10:34:39 +00:00
Masayuki Nakano
246163150b Bug 1528289 - part 1: Move selection at middle button down rather than middle button up r=edgar
Chrome and Safari move selection at middle button down and does not modify the
range at middle button up.  However, they handle middle button down with
`Shift` key is "continue selection".  So, we should handle selection in
nsIFrame when `mousedown` event for middle mouse button is fired, but ignore
multiple selection, drag and drop and maintaining selection for aligning the
behavior to the other browsers.

This patch splits `nsIFrame::HandlePress()` and calls new method which
moves selection from `nsIFrame::HandleEvent()` when middle button is pressed.
(Note that this patch does not check whether middle click paste is enabled
because Chrome moves selection even on Windows which Chrome always disable
middle click paste on.)

With this change, "paste" event target is changed.  Previously, we used target
of the preceding `mouseup` event, but we start to use the target of the
preceding `mousedown` event.

Note that even with this patch, we still behave differently from Chrome even
in the following cases:
- middle mouse button down in selected range, we collapse it, but Chrome keeps
  the selection.
- middle mouse button click in selected range, we dispatch "paste" event, but
  Chrome collapse selection and not dispatch "paste" event.
- middle mouse button down in selected range and up in different element,
  Chrome does not modify the range nor dispatch "paste" event.
- Shift + middle mouse button in editable `<table>` works as non-editable
  in Chrome, but our editor handles it with special path.  Therefore, we
  don't modify the range but dispatch "paste" event in the selected range.

Changing them requires bigger change and probably requires some other features'
behavior changes.  Therefore, we shouldn't touch these issues until they are
actually reported as web-compat issues.

Differential Revision: https://phabricator.services.mozilla.com/D103997
2021-03-01 22:57:06 +00:00
Ting-Yu Lin
7a72791226 Bug 799725 Part 1 - Support AspectRatio in StyleSizeOverrides. r=dholbert
This is a preparation patch for Part 2 -- We need a way to ignore
aspect-ratio when measuring a flex item's content block-size, because we
don't want the stretched inline-size transferring through aspect-ratio
to set block-size.

This patch hasn't changed the behavior yet. Part 2 is going to utilize
mAspectRatio.

Differential Revision: https://phabricator.services.mozilla.com/D106383
2021-02-25 20:06:11 +00:00
Miko Mynttinen
af400aad8a Bug 1526970 - Part 4: Check the frame for display items rather than DisplayItemData or WebRenderFallbackData in InvalidateFrame() r=mattwoodrow
Depends on D106165

Differential Revision: https://phabricator.services.mozilla.com/D106166
2021-02-24 22:22:19 +00:00
Miko Mynttinen
87ae7c68c4 Bug 1526970 - Part 2: Convert nsIFrame::mDisplayItemData to frame property r=mattwoodrow
Depends on D104059

Differential Revision: https://phabricator.services.mozilla.com/D106164
2021-02-24 22:22:18 +00:00
Miko Mynttinen
285b2844a7 Bug 1526970 - Part 1: Store the list of display items the frame has as a member variable instead of frame property r=mattwoodrow,emilio
Differential Revision: https://phabricator.services.mozilla.com/D104059
2021-02-24 22:22:17 +00:00
Tim Nguyen
159428759d Bug 1590884 - Move XUL accesskey handling to DOM and remove nsXULLabelFrame. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D106233
2021-02-24 14:46:28 +00:00
Mirko Brodesser
67f65b4320 Bug 1674658: part 2) Don't peform the default action for mousemove events when it should be prevented. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D106083
2021-02-23 13:27:41 +00:00
Ting-Yu Lin
cf926779e7 Bug 1674302 Part 2 - Use StyleSizeOverrides to replace ComputeSizeFlag::UseAutoISize. r=dholbert
`UseAutoISize` flag is buggy when used on table flex items because it
never propagates to inner table frame.

Luckily, we can fix it by replacing the flag with StyleSizeOverrides
emplacing an 'auto' mStyleISize, because when computing the size, the
size overrides already propagates from table wrapper to inner table via
the following path:

  `nsTableWrapperFrame::ComputeSize()` [1] ->
  `nsTableWrapperFrame::ComputeAutoSize()` ->
  `nsTableWrapperFrame::InnerTableShrinkWrapISize()` ->
  `nsTableFrame::ComputeSize()`.

Part 3 is going to propagate the size overrides to inner table in
`nsTableWrapperFrame::CreateReflowInputForInnerTable()` during reflow.

This patch fixes the content size suggestion for table flex items.
Combining this patch with Part 3, we can fix those reftests in Part 4.

[1] In this patch, the table wrapper is still using nsContainerFrame's
ComputeSize(), but Part 3 is going to override it.

Differential Revision: https://phabricator.services.mozilla.com/D103438
2021-02-18 05:45:24 +00:00
Boris Chiou
156c710d50 Bug 1667501 - Add an nsIFrame::IsFrameOfType bit to say whether frames support aspect-ratio. r=TYLin
aspect-ratio applies to all elements except inline boxes and internal ruby or
table boxes. So we should return false for inline frames, table internal frames
(i.e. except nsTableFrame and nsTableWrapperFrame), and ruby internal frames.

Also, we can drop ComputeSizeFlags::SkipAspectRatio because this frame
bit can replace this flag.

Note: it seems nsRubyBaseContainerFrame and nsRubyTextContainerFrame are
inline, so we return false for them.

This will be very useful when computing the intrinsic size because
IntrinsicForAxis() computes the intrinsic size for all descendant frames and
some of descendants may not support aspect-ratio. It's pretty hard to achieve
this by just adding a flag for this function.

Differential Revision: https://phabricator.services.mozilla.com/D104296
2021-02-11 00:19:58 +00:00
Kagami Sascha Rosylight
5eb5bd857e Bug 1690502 - Do not ignore the newline followed by <br> in <pre> r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D104523
2021-02-10 05:23:16 +00:00
Miko Mynttinen
cf0c7ae9e3 Bug 1534549 - Part 2: Allow all display items to carry hit testing information r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D102515
2021-02-06 22:30:37 +00:00
Miko Mynttinen
d481341bf4 Bug 1534549 - Part 1: Remove old FLB hit test info optimization r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D102514
2021-02-06 22:30:29 +00:00
Noemi Erli
1ea87269a8 Backed out 4 changesets (bug 1534549) for causing mochitest failures in test_group_wheelevents.html CLOSED TREE
Backed out changeset a03c745620d6 (bug 1534549)
Backed out changeset 2ac9c5dbe9f5 (bug 1534549)
Backed out changeset dabd0c5d21cf (bug 1534549)
Backed out changeset f1b390459263 (bug 1534549)
2021-02-05 02:41:19 +02:00
Miko Mynttinen
63a9dd596a Bug 1534549 - Part 2: Allow all display items to carry hit testing information r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D102515
2021-02-04 22:19:56 +00:00
Miko Mynttinen
a32145a4c8 Bug 1534549 - Part 1: Remove old FLB hit test info optimization r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D102514
2021-02-02 14:30:13 +00:00
Kagami Sascha Rosylight
40f2b82d3e Bug 1676970 - Always consider text controls has independent selection r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D97720
2021-02-02 00:09:59 +00:00
Mats Palmgren
f6ef0ea044 Bug 1683748 - Support Grid/Flex/Table/Column layout for the rendered legend of a fieldset. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D101555
2021-01-30 13:47:10 +00:00
Dorel Luca
689a7c82d0 Backed out changeset 2d16e9e90401 (bug 1683748) for WPT failures in html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-grid-flex-multicol.html. CLOSED TREE 2021-01-29 22:07:09 +02:00
Mats Palmgren
ca5460eda2 Bug 1683748 - Support Grid/Flex/Table/Column layout for the rendered legend of a fieldset. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D101555
2021-01-29 15:45:42 +00:00
Ting-Yu Lin
49a8e69d8a Bug 1686603 Part 7 - Change two StyleSize variables from pointers to references, and rename them. r=emilio
After Part 5 & Part 6, we don't need to override flex item's flex-basis
proprety or preferred main size in ComputeSize() and
ComputeSizeWithIntrinsicDimensions(), we can change the two style sizes
to references, and give both of them to shorter names.

Differential Revision: https://phabricator.services.mozilla.com/D102475
2021-01-26 02:47:43 +00:00
Ting-Yu Lin
312f1e800f Bug 1686603 Part 5 - Use StyleSizeOverrides to override flex main size when main size can influence cross size. r=dholbert
FlexItem::StyleCrossSize() hasn't been used in this patch, but it will
be used in a later patch that revises size overrides in flex item's
final reflow.

Differential Revision: https://phabricator.services.mozilla.com/D101796
2021-01-26 02:47:33 +00:00
Ting-Yu Lin
4a76528949 Bug 1686603 Part 4 - Use StyleSizeOverrides to revise flex base size resolution. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D101795
2021-01-26 02:47:36 +00:00
Ting-Yu Lin
a43cae175a Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

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

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

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-26 02:47:40 +00:00
Csoregi Natalia
0492d8333a Backed out 8 changesets (bug 1686603) for causing crashtest failures. CLOSED TREE
Backed out changeset 94b5d0986d27 (bug 1686603)
Backed out changeset e7edf6fcc41d (bug 1686603)
Backed out changeset 4c9271f07178 (bug 1686603)
Backed out changeset 7013b95266ae (bug 1686603)
Backed out changeset cf7a55638aef (bug 1686603)
Backed out changeset 7717a0f2a37b (bug 1686603)
Backed out changeset c82593b13a61 (bug 1686603)
Backed out changeset fd1d95a1e706 (bug 1686603)
2021-01-26 04:32:13 +02:00
Ting-Yu Lin
5716640fe2 Bug 1686603 Part 7 - Change two StyleSize variables from pointers to references, and rename them. r=emilio
After Part 5 & Part 6, we don't need to override flex item's flex-basis
proprety or preferred main size in ComputeSize() and
ComputeSizeWithIntrinsicDimensions(), we can change the two style sizes
to references, and give both of them to shorter names.

Differential Revision: https://phabricator.services.mozilla.com/D102475
2021-01-25 22:25:44 +00:00
Ting-Yu Lin
56af7d6040 Bug 1686603 Part 5 - Use StyleSizeOverrides to override flex main size when main size can influence cross size. r=dholbert
FlexItem::StyleCrossSize() hasn't been used in this patch, but it will
be used in a later patch that revises size overrides in flex item's
final reflow.

Differential Revision: https://phabricator.services.mozilla.com/D101796
2021-01-25 22:27:46 +00:00
Ting-Yu Lin
902b99ce81 Bug 1686603 Part 4 - Use StyleSizeOverrides to revise flex base size resolution. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D101795
2021-01-25 22:25:57 +00:00
Ting-Yu Lin
ffce5ed7d6 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

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

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

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

Differential Revision: https://phabricator.services.mozilla.com/D102140
2021-01-25 11:53:49 +00:00
Ting-Yu Lin
896140a354 Bug 1688141 - Use AspectRatio instead of StyleAspectRatio in ComputeSize() and ComputeTransferredMinMaxInlineSize(). r=boris
Differential Revision: https://phabricator.services.mozilla.com/D102686
2021-01-22 19:52:30 +00:00
Mihai Alexandru Michis
b6b2f1e5f4 Backed out 7 changesets (bug 1686603) for causing crashtest assertion failures.
CLOSED TREE

Backed out changeset 19cba7d34a7f (bug 1686603)
Backed out changeset 3a0d0155ea5e (bug 1686603)
Backed out changeset f1f672cdd0c6 (bug 1686603)
Backed out changeset 63020922e2fd (bug 1686603)
Backed out changeset 8766ce79ba5e (bug 1686603)
Backed out changeset 965dbe8de1e1 (bug 1686603)
Backed out changeset b1328ee45f43 (bug 1686603)
2021-01-21 09:21:12 +02:00
Ting-Yu Lin
403afe657d Bug 1686603 Part 7 - Change two StyleSize variables from pointers to references, and rename them. r=emilio
After Part 5 & Part 6, we don't need to override flex item's flex-basis
proprety or preferred main size in ComputeSize() and
ComputeSizeWithIntrinsicDimensions(), we can change the two style sizes
to references, and give both of them to shorter names.

Differential Revision: https://phabricator.services.mozilla.com/D102475
2021-01-21 04:34:25 +00:00
Ting-Yu Lin
02e1874759 Bug 1686603 Part 5 - Use StyleSizeOverrides to override flex main size when main size can influence cross size. r=dholbert
FlexItem::StyleCrossSize() hasn't been used in this patch, but it will
be used in a later patch that revises size overrides in flex item's
final reflow.

Differential Revision: https://phabricator.services.mozilla.com/D101796
2021-01-21 04:35:54 +00:00
Ting-Yu Lin
d1b6d1f716 Bug 1686603 Part 4 - Use StyleSizeOverrides to revise flex base size resolution. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D101795
2021-01-21 04:22:08 +00:00
Ting-Yu Lin
d0c462cb81 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

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

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

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-21 04:17:59 +00:00
Boris Chiou
33c0c70a2b Bug 1646100 - min-width:auto together with apect-ratio should take the intrinsic content size into account when width is {min|max|fit}-content or auto. r=TYLin
We have to set the flag, AspectRatioUsage::ToComputedISize if we
resolve the min-content/max-content/fit-content by aspect-ratio, so that
we can handle min-width:auto well.

Differential Revision: https://phabricator.services.mozilla.com/D99406
2021-01-19 21:47:55 +00:00
Boris Chiou
eff538f500 Bug 1646100 - Compute {min|max|fit}-content from the definite block-size and aspect-ratio. r=TYLin,emilio
ComputeISizeValue() takes aspect-ratio into account. Also, add a
ComputeSizeFlag which skips aspect-ratio in ComputeISizeValue(), so
internal table boxes can use this flag to skip aspect-ratio.

Differential Revision: https://phabricator.services.mozilla.com/D99290
2021-01-19 21:44:44 +00:00
Boris Chiou
8d1403f488 Bug 1646100 - Take LogicalSize type for containing block and boxing size adjustment for ComputeISizeValue. r=TYLin
We may use the block size to compute the inline size if there is a
non-auto finite aspect-ratio and definite block size, so we need more
information on the block axis. Therefore, we have to pass LogicalSize
for containing block and boxing size adjustment.

Differential Revision: https://phabricator.services.mozilla.com/D99289
2021-01-19 21:51:04 +00:00
Mirko Brodesser
70265dd25d Bug 1685303: part 13) Move documentation of SelectByTypeAtPoint. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101761
2021-01-15 09:28:40 +00:00
Mirko Brodesser
0114f7f280 Bug 1685303: part 11) Add some const-correctness to frame code. r=smaug
Helps distinguishing what modifies frames and what doesn't.

Differential Revision: https://phabricator.services.mozilla.com/D101751
2021-01-14 14:45:01 +00:00
Mirko Brodesser
c0d32bffc5 Bug 1685303: part 10) Annotate nsFrameSelection::HandleClick with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101598
2021-01-14 13:24:36 +00:00
Mirko Brodesser
f6f7a6f1aa Bug 1685303: part 8) Annotate nsFrameSelection::SetDragState with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101467
2021-01-14 13:24:16 +00:00
Bogdan Tara
0700454a9e Backed out 4 changesets (bug 1685303) for bustage complaining about offsets CLOSED TREE
Backed out changeset a4640aac6619 (bug 1685303)
Backed out changeset bd2020c26531 (bug 1685303)
Backed out changeset 3f2e96b93f19 (bug 1685303)
Backed out changeset 8cf49a7677c9 (bug 1685303)
2021-01-14 12:58:25 +02:00
Mirko Brodesser
353996bf27 Bug 1685303: part 8) Annotate nsFrameSelection::SetDragState with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101467
2021-01-14 10:20:30 +00:00
Mats Palmgren
51ff79f7fa Bug 1686310 part 7 - Remove ReflowInput::mFrameType and associated code, which is now dead code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D101554
2021-01-14 03:23:40 +00:00
Mats Palmgren
cd4d90de10 Bug 1686310 part 2 - Replace NS_FRAME_IS_REPLACED* with a bit that caches the corresponding IsFrameOfType result. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D101549
2021-01-14 03:15:31 +00:00
Emilio Cobos Álvarez
dbf895e4c3 Bug 1685078 - Use enum classes and more explicit names for ImageLoader flags. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D101070
2021-01-08 09:44:47 +00:00
Emilio Cobos Álvarez
8558796b8d Bug 1351248 - nsFieldSetFrame should claim to be focusable if its inner scrollframe is. r=smaug
Otherwise we stop moving focus because, when we find the scrollable
area, we determine that we need to focus the fieldset, but then the
focus manager early-returns in `nsFocusManager::SetFocusInner`.

Depends on D100423

Differential Revision: https://phabricator.services.mozilla.com/D100424
2020-12-29 22:28:42 +00:00
Emilio Cobos Álvarez
bd8cffdd58 Bug 1351248 - Simplify nsIFrame::IsFocusable API. r=layout-reviewers,mats
We always compute the tabindex value, so just return it to the caller
all the time. This allows us to use early-returns which makes the code a
bit easier to follow.

This patch shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D100423
2021-01-03 23:30:51 +00:00
Boris Chiou
361f923f82 Bug 1683424 - Add UseBoxSizing for AspectRatio class, and fix non-replaced element usage. r=TYLin
Based on the spec, if the aspect-ratio property value is:
1) auto: we should always use content-box dimensions.
2) <ratio>: the aspect-ratio works with box sizing dimensions.
3) auto && <ratio>: we use content-box dimensions in all cases.

So we need an extra flag to address that we should use box-sizing or
always use content-box dimensions while computing the size in
ratio-dependent axis.

This also updates some wpts for non-replaced elements because we should
use content-box if aspect-ratio is 'auto && <ratio>'.

Differential Revision: https://phabricator.services.mozilla.com/D100072
2020-12-23 22:42:55 +00:00
Edgar Chen
2b16b12d46 Bug 1680405 - Make mouse capture working on OOP iframe; r=smaug
This patch add a way to track remote target for mouse capturing. The tracking
remote target will be reset when capturing content is changed or
ReleaseCapturingContent() is called.

In order to make `mouseup` would also be dispatched to correct remote target, we
do ReleaseCapturingContent in EventSetateManager::PostHandleEvent, instead of
in nsIFrame::HandleRelease.

Differential Revision: https://phabricator.services.mozilla.com/D98592
2020-12-18 18:21:23 +00:00
Ting-Yu Lin
378bde9842 Bug 1585485 Part 2 - Move IsReplacedBoxResolvedAgainstZero() into nsIFrame, and rename it. r=dholbert
We want to call it in nsFlexContainerFrame in the next part.

The method also tests form control elements via the helper
FormControlShrinksForPercentISize, not just replaced boxes, so rename it
for accuracy. We also rename the helper by dropping "I" from the
"PercentISize" because the axis the element contributingx to isn't
necessarily its inline-axis.

Differential Revision: https://phabricator.services.mozilla.com/D99951
2020-12-17 20:01:58 +00:00
Emilio Cobos Álvarez
039592f4d8 Bug 1682003 - Avoid UTF-8 -> UTF-16 conversion during CSSOM serialization. r=heycam
This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).

It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).

Differential Revision: https://phabricator.services.mozilla.com/D99590
2020-12-17 14:04:35 +00:00
Razvan Maries
a7af908f30 Backed out changeset 5e9006d8c218 (bug 1680405) for perma failures on PresShell.cpp and browser_mouse_enterleave_switch_tab.js. CLOSED TREE 2020-12-17 13:24:39 +02:00
Edgar Chen
45ea02297b Bug 1680405 - Make mouse capture working on OOP iframe; r=smaug
This patch add a way to track remote target for mouse capturing. The tracking
remote target will be reset when capturing content is changed or
ReleaseCapturingContent() is called.

In order to make `mouseup` would also be dispatched to correct remote target, we
do ReleaseCapturingContent in EventSetateManager::PostHandleEvent, instead of
in nsIFrame::HandleRelease.

Differential Revision: https://phabricator.services.mozilla.com/D98592
2020-12-17 09:28:00 +00:00
Dorel Luca
c7cf087b6e Backed out changeset 7253a9d881d0 (bug 1680405) for assertion failures in worker/checkouts/gecko/layout/base/PresShell.cpp. CLOSED TREE 2020-12-16 07:19:44 +02:00