Commit graph

645 commits

Author SHA1 Message Date
Cathie Chen
e88b28e248 Bug 1866566 - If there is change in over-all relevancy, update HiddenByContentVisibility for animations, r=emilio,hiro
Differential Revision: https://phabricator.services.mozilla.com/D195009
2023-12-06 13:36:59 +00:00
Cosmin Sabou
5c95548994 Backed out changeset d9e8e468a2f2 (bug 1866566) for wpt failures on content-visibility-animation-with-scroll-timeline-in-hidden-subtree.html. 2023-12-05 18:59:19 +02:00
Cathie Chen
4395752c23 Bug 1866566 - If there is change in over-all relevancy, update HiddenByContentVisibility for animations, r=emilio,hiro
Differential Revision: https://phabricator.services.mozilla.com/D195009
2023-12-05 15:57:51 +00:00
Masayuki Nakano
4bb761eb3e Bug 1863759 - Make IMEStateManager recreate IMEContentObserver if the active one is not observing editable content of focused element r=smaug,m_kato
The test case is a special case that changes focused element from a text control
to an editing host.  Therefore, without a focus change, focused editor is
changed from a `TextEditor` to `HTMLEditor`.  At this time, `IMEContentObserver`
needs to switch the observing target from the anonymous content if `<input>` to
children of it.

However, the editable content becomes completely changed without a focus change
in the DOM.  Therefore, `IMEStateManager` needs to synthesize a fake focus move
for IME.  Therefore, this patch make `IMEStateManager` recreate
`IMEContentObserver` if active one is not observing editable content for the
focused element under "current" conditions at checking it.  (When
`IMEContentObserver` is being destroyed, it sends "blur" notification to IME
and the new `IMEContentObserver` instance posts "focus" notification with
all editable content data.  I.e., recreating `IMEContentObserver` generates
a fake focus move from IME point of view.)

Additionally, there is the opposite case, that is, editing host of an `<input>`
whose type is not a text control may become a text control.  Therefore, this
adds new WPTs to check the handler is the text editor for the text control or
the HTML editor.  The tests passed on Firefox and Chrome at least.

FYI: I guess that in this case, we need to kick `focus` event listener of the
`HTMLEditor`, but anyway, users cannot change the content because it's the
case that an atomic content is the editing host.  Therefore, I don't touch
about that in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D193262
2023-12-05 02:33:18 +00:00
Timothy Nikkel
68b1b0041a Bug 1862277. Call InvalidateRenderingObservers in nsIFrame::Init for frames that won't get a reflow. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D194067
2023-12-03 05:02:16 +00:00
Frederic Wang
e7e16e453b Bug 1807253 - unreliable timing for content-visibility:auto, r=emilio
Rewrite implementation of content-visibility: auto as defined in
https://github.com/w3c/csswg-drafts/issues/8542

Differential Revision: https://phabricator.services.mozilla.com/D170394
2023-11-27 08:26:46 +00:00
Emilio Cobos Álvarez
5730ee0ca5 Bug 1364813 - Remove IsFrameOfType, use non-virtual checks. r=jwatt
Extend the per-frame-class bit we have to devirtualize IsLeaf to also
devirtualize IsFrameOfType. That is, move this data to FrameClasses.py.

This was done by going through all the frame classes, trying to preserve
behavior.

The only quirky thing is that I had to add two more trivial frame
classes, `nsAudioFrame` for audio elements, and
`nsFloatingFirstLetterFrame`. That's because these frame classes were
returning different answers at runtime, but they do this only on
conditions that trigger frame reconstruction (floating, and being an
audio element, respectively).

Differential Revision: https://phabricator.services.mozilla.com/D194703
2023-11-26 22:17:28 +00:00
Natalia Csoregi
17befdb121 Backed out changeset 20a5c1f3b35e (bug 1807253) for causing failures on content-visibility-continuations-crash.html. CLOSED TREE 2023-11-22 16:12:27 +02:00
Frederic Wang
cb0618baf3 Bug 1807253 - unreliable timing for content-visibility:auto, r=emilio
Rewrite implementation of content-visibility: auto as defined in
https://github.com/w3c/csswg-drafts/issues/8542

Differential Revision: https://phabricator.services.mozilla.com/D170394
2023-11-22 13:00:36 +00:00
Masayuki Nakano
02ee2a0c6f Bug 1820290 - Rename PeekOffsetOption::ScrollViewStop for consistency r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D193622
2023-11-21 08:05:19 +00:00
Masayuki Nakano
42ea41445c Bug 1820290 - Make nsIFrame treat out-of-flow things as word separators r=emilio
Out-of-flow creates `nsPlaceholderFrame`, and `nsIFrame::PeekOffset` related
methods treat words can cross its boundaries.  However, it looks odd that a
sequence of content split by `nsPlaceholderFrame` is treated as a word.

Therefore, I think that `nsIFrame::IsLogicallyAtLineEdge` and
`nsIFrame::IsVisuallyAtLineEdge` should ignore placeholder to check whether the
frame is first/last of the line.

Additionally, I think that `nsIFrame::PeekOffsetForWord` should not allow
`nsIFrame::GetFrameFromDirection` to cross `nsPlaceholderFrame` boundaries
if it's already found some characters.

Differential Revision: https://phabricator.services.mozilla.com/D176250
2023-11-21 08:05:18 +00:00
Masayuki Nakano
1a62550191 Bug 1864334 - Make nsIFrame::MovingCaretToEventPointAllowedIfSecondaryButtonEvent check whether the right click point is in a selection range first r=emilio
This is a simple mistake of the previous patch. The code path is originally for
a left click handling.  Therefore, there is no check whether the click point is
in a selection range because in that case, left click should collapse selection.
However, the selection should not be collapse when it's a right click in a
selection range because the context menu target is the selection range.

The `ui.mouse.right_click.collapse_selection.stop_if_non_collapsed_selection`
pref is set to `true` by default.  Therefore, the existence of a non-collapsed
selection has hidden this bug.  However, if it's set to `false`, this always
happens.  Additionally, editor does not set ancestor limiter of selection if the
root element is editable [1].  I think that we can now remove this special path,
but it's risky.  Therefore, this patch just adds the new check into the method.

1. https://searchfox.org/mozilla-central/rev/ce4599d3d4e20e34cb6db68f255c3dff1aec246b/editor/libeditor/EditorBase.cpp#5448,5450-5451

Differential Revision: https://phabricator.services.mozilla.com/D193529
2023-11-16 01:26:24 +00:00
Cathie Chen
1a3d0bd724 Bug 1668136 - Set visible the content relevancy of an element with content-visibility:auto if its descendant is called scrollIntoView, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186943
2023-11-03 15:37:29 +00:00
Norisz Fay
37cbcfe9be Backed out changeset 6e5782df6da1 (bug 1668136) for causing wpt failures on content-visibility-vs-scrollIntoView-003.html CLOSED TREE 2023-11-01 18:02:54 +02:00
Cathie Chen
eeb53397a8 Bug 1668136 - Set visible the content relevancy of an element with content-visibility:auto if its descendant is called scrollIntoView, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186943
2023-11-01 12:01:51 +00:00
Natalia Csoregi
f62ca31731 Backed out changeset aa66fda02aac (bug 1668136) for causing failures on content-visibility. CLOSED TREE 2023-10-31 06:49:20 +02:00
Cathie Chen
5046f7ee73 Bug 1668136 - Set visible the content relevancy of an element with content-visibility:auto if its descendant is called scrollIntoView, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186943
2023-10-31 01:38:16 +00:00
Robert Longson
b07eea6fdb Bug 1765202 part 3 - ignore clip-path and mask properties that don't point to clipPath and mask elements r=emilio
This refactors the logic for testing whether something has a clip-path or mask and what to do about it in one place rather than using many overlapping functions.

Differential Revision: https://phabricator.services.mozilla.com/D190767
2023-10-23 20:32:37 +00:00
Robert Longson
38ecc4b5c4 Bug 1765202 part 2 - refactor MaskUsage so that its members are private r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D191513
2023-10-23 20:11:11 +00:00
Robert Longson
a7a361f3ce Bug 1765202 part 1 - Have determineMaskUsage return its result r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D190766
2023-10-23 20:11:10 +00:00
Emilio Cobos Álvarez
a823c5fc0a Bug 1859186 - Simplify some frame property usage. r=TYLin
The border property is just useless, we only use it to store stuff
across border style changes, which makes zero sense because we clear it
when we start reflowing.

Differential Revision: https://phabricator.services.mozilla.com/D191177
2023-10-18 23:18:58 +00:00
Morgan Rae Reschenberg
b9c3ac64fe Bug 1853468: NotifyOfPossibleBoundsChange when display list items are added r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D189850
2023-10-18 19:07:20 +00:00
Timothy Nikkel
ce078b9839 Bug 1859281. Optimize a couple IsRootContentDocument calls. r=dholbert
Although small, these show up in TodoMVC-React-Complex-DOM.

Differential Revision: https://phabricator.services.mozilla.com/D191075
2023-10-16 22:52:54 +00:00
Masayuki Nakano
bccbdc8b58 Bug 1845241 - Make nsIFrame::HandleEvent move caret when secondary mouse button down r=edgar,emilio,dom-core
The other browsers move focus and `Selection` whe right click even if the
clicked element is not editable and even if there is a non-collapsed selection.
Fortunately, we already have similar code for the middle button press.
Therefore, we can make it run when the pressed button is the secondary button.

This also fixes bug 416546 and does not resurrect bug 709476.

However, this patch adds 2 prefs for making users customizable.  Our traditional
behavior is, we never collapse non-collapses selection with a right click even
if clicked outside the selection.  This allows users to open context menu for
selected text much easier.  Therefore, even though the behavior is different
from the others, we should keep the traditional behavior, but some users may
want the other browsers' behavior instead.  For them, this should be switchable
by a pref.

Additionally, I'm still not sure collapsing selection with a right click in
non-editable content especially for users using the caret browsing mode.
Therefore, for making things safer, this adds a pref to disable the new behavior
in the non-editable content.

Differential Revision: https://phabricator.services.mozilla.com/D189991
2023-10-10 03:20:21 +00:00
Emilio Cobos Álvarez
50daad8922 Bug 1817122 - Make AsyncEventDispatcher(Event) take ownership of the event. r=smaug,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D190059
2023-10-04 19:37:39 +00:00
Jan Varga
c458754592 Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D189226
2023-09-28 20:46:07 +00:00
Emily McDonough
88868de1be Bug 1853455 - Fix nsIFrame::ComputePageValue to check for page style values, rather than checking the start page value. r=dholbert
Because we use NULL to indicate the auto value, once a page contributes a
non-auto page value then that will be all that is seen by ComputePageValue
when a later page doesn't have a page-name at all.

Actually checking for the page-name value will fix page-name values when
an empty/auto page-name follows pages with a non-auto value. It is also
slightly more efficient, as it avoids a frame property lookup and instead
just looks at the computed style.

While we are here, remove an assert that is clearly not possible to occur
anymore, and add a short explanation of the code in ComputePageValue.

Differential Revision: https://phabricator.services.mozilla.com/D188544
2023-09-27 19:06:17 +00:00
Cathie Chen
9546151d91 Bug 1853406 - [Content-visibility] Add the content-visibility status to DumpFrameTree logs, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D188353
2023-09-25 11:56:09 +00:00
Gregory Pappas
9bb4fdbbd5 Bug 1851094 - Remove layout.css.grid-item-baxis-measurement.enabled pref r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D187250
2023-09-19 22:06:03 +00:00
Timothy Nikkel
e4ebc53486 Bug 1853487. Microoptimize nsIFrame::Combines3DTransformWithAncestors. r=emilio
On 50 runs of TodoMVC-React-Complex-DOM a profile without this patch had 113 samples in Combines3DTransformWithAncestors. A profile with this patch had 40 samples.

Differential Revision: https://phabricator.services.mozilla.com/D188402
2023-09-16 13:47:36 +00:00
Emilio Cobos Álvarez
aefd1ddb30 Bug 1851787 - Plumb a DestroyContext through all functions that can destroy frames. r=dholbert
This prevents anonymous content getting destroyed at weird times
during frame destruction.

Differential Revision: https://phabricator.services.mozilla.com/D187693
2023-09-08 15:11:17 +00:00
Emilio Cobos Álvarez
52d097c513 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-07 11:46:30 +00:00
Narcis Beleuzu
77ba6cde90 Backed out changeset 55052ae7d067 (bug 1851868) for reftest failure on 1153695.html . CLOSED TREE 2023-09-07 02:42:25 +03:00
Emilio Cobos Álvarez
59766eeba4 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-06 22:34:35 +00:00
Narcis Beleuzu
1b73f006e1 Backed out changeset 69bb261fbdce (bug 1851094) for bustages on nsGridContainerFrame.cpp . CLOSED TREE 2023-09-02 05:57:52 +03:00
Gregory Pappas
664645011b Bug 1851094 - Remove layout.css.grid-item-baxis-measurement.enabled pref r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D187250
2023-09-02 02:19:04 +00:00
CanadaHonk
e115104963 Bug 1846853 - Clamp negative outline-offset per spec r=emilio
A negative outline-offset value should be clamped per spec as to stop it
from becoming invisible with large negative values.

Spec ref: https://www.w3.org/TR/css-ui-4/#outline-offset

Also added a new WPT reftest for this case as no tests existed prior,
updated related WPT expectations, and updated a few old layout reftests.

Differential Revision: https://phabricator.services.mozilla.com/D185357
2023-08-23 11:35:01 +00:00
Stanca Serban
add4a8a76d Backed out changeset 337531b04603 (bug 1846853) for causing reftests failures. CLOSED TREE 2023-08-23 05:01:39 +03:00
CanadaHonk
3abfdd94e9 Bug 1846853 - Clamp negative outline-offset per spec r=emilio
A negative outline-offset value should be clamped per spec as to stop it
from becoming invisible with large negative values.

Spec ref: https://www.w3.org/TR/css-ui-4/#outline-offset

Also added a new WPT reftest for this case as no tests existed prior,
updated related WPT expectations, and updated an old layout reftest.

Differential Revision: https://phabricator.services.mozilla.com/D185357
2023-08-23 00:59:43 +00:00
Narcis Beleuzu
f1e33ff941 Backed out changeset 959c2f0abc19 (bug 1846853) for reftest failures on outline-013.html & 424236-5.html . CLOSED TREE 2023-08-23 02:16:13 +03:00
CanadaHonk
58f43c26c7 Bug 1846853 - Clamp negative outline-offset per spec r=emilio
A negative outline-offset value should be clamped per spec as to stop it
from becoming invisible with large negative values.

Spec ref: https://www.w3.org/TR/css-ui-4/#outline-offset

Also added a new WPT reftest for this case as no tests existed prior.

Differential Revision: https://phabricator.services.mozilla.com/D185357
2023-08-22 22:07:43 +00:00
Cathie Chen
ab3d8905aa Bug 1829016 - The size of content-visibility auto does not refresh when its content changes, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183414
2023-08-08 18:19:18 +00:00
Jan-Niklas Jaeschke
12f5099c54 Bug 1838262, part 3: Removed ServoStyleSet::ProbeHighlightPseudoElementStyle(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D184709
2023-07-31 13:47:55 +00:00
Jan-Niklas Jaeschke
c84288a36d Bug 1838262, part 2: Implemented getComputedStyle() for custom highlight api. r=emilio
This patch introduces functional pseudo parameters, i.e. `::highlight(foo)`,
for `getComputedStyle()`. This required adapting the parse algorithm (`nsCSSPseudoElements::ParsePseudoElement()`) and forwarding the functional pseudo parameter into the style engine.

Differential Revision: https://phabricator.services.mozilla.com/D183773
2023-07-31 13:47:54 +00:00
Emilio Cobos Álvarez
7bf3b0e527 Bug 1844195 - Avoid duplicating rust and C++ display definitions. r=layout-reviewers,jfkthame
We need to inline Self::new() so cbindgen generates the constants, which
is kinda lame, but seems better than duplicating the values and type
definitions.

Differential Revision: https://phabricator.services.mozilla.com/D183921
2023-07-26 06:46:32 +00:00
Iulian Moraru
251fc5e9ee Backed out changeset a86390266ae9 (bug 1829016) for causing wr failures on content-visibility-085.html. 2023-07-26 04:01:42 +03:00
Iulian Moraru
0c0945174b Backed out changeset f3394bd0f554 (bug 1844195) for causing conflicts with another backout. 2023-07-26 04:00:57 +03:00
Emilio Cobos Álvarez
e56bda6fd8 Bug 1844195 - Avoid duplicating rust and C++ display definitions. r=layout-reviewers,jfkthame
We need to inline Self::new() so cbindgen generates the constants, which
is kinda lame, but seems better than duplicating the values and type
definitions.

Differential Revision: https://phabricator.services.mozilla.com/D183921
2023-07-25 21:14:39 +00:00
Morgan Rae Reschenberg
dc7d564db1 Bug 1837496: NotifyOfPossibleBoundsChange when display list changes are observed, instead of during reflow/in SetPosition r=Jamie,emilio
Differential Revision: https://phabricator.services.mozilla.com/D184275
2023-07-25 20:42:21 +00:00
Iulian Moraru
da43d00caa Backed out changeset 3a3f2d5937c4 (bug 1844195) for causing mass failures. CLOSED TREE 2023-07-25 23:07:30 +03:00