Most event targets an element node even if the input occurs on a `Text`.
`EventStateManager`, `PresShell`, `PresShell::EventHandler`, etc use
the result of `nsIFrame::GetContentForEvent` result as-is or looking
for proper ancestor element by the caller selves.
So, I think there should be `GetEventTargetContent()` which solves the
target node kind automatically and in the same way. And also this patch
renames `nsIFrame::GetContentForEvent` to
`nsIFrame::GetEventTargetExplicitContent` for consistency with
`Event::mExplicitOriginalTarget`.
Finally, this patch changes the callers which retrieves a parent
`Element` if the result of `GetContentForEvent` is not an `Element` to
use the new `GetEventTargetContent`.
The following patches make each caller of `GetContentForEvent` marked
with "FIXME" comment fix one by one.
Differential Revision: https://phabricator.services.mozilla.com/D297848
Most event targets an element node even if the input occurs on a `Text`.
`EventStateManager`, `PresShell`, `PresShell::EventHandler`, etc use
the result of `nsIFrame::GetContentForEvent` result as-is or looking
for proper ancestor element by the caller selves.
So, I think there should be `GetEventTargetContent()` which solves the
target node kind automatically and in the same way. And also this patch
renames `nsIFrame::GetContentForEvent` to
`nsIFrame::GetEventTargetExplicitContent` for consistency with
`Event::mExplicitOriginalTarget`.
Finally, this patch changes the callers which retrieves a parent
`Element` if the result of `GetContentForEvent` is not an `Element` to
use the new `GetEventTargetContent`.
The following patches make each caller of `GetContentForEvent` marked
with "FIXME" comment fix one by one.
Differential Revision: https://phabricator.services.mozilla.com/D297848
Removed the Reflow Input in nsIFrame. Added includes for ReflowInput as
necessary in cpp files. Also Forward Declared nsLineLayout in 3 header
files.
Differential Revision: https://phabricator.services.mozilla.com/D298203
Add exceptions for a few elements that do rely on their frame tree
size (mostly text controls). These are fixable but separate bug at the
very least.
Add reftests for <iframe> and <img>. Also, test all HTML elements in all
writing modes to ensure that they don't trigger assertions.
The <svg> case can't be easily reftested, afaict, because fullscreen
will change the size of the reftest window and <svg> doesn't support
popover.
Differential Revision: https://phabricator.services.mozilla.com/D282451
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.
This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.
But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.
Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.
Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.
This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.
Differential Revision: https://phabricator.services.mozilla.com/D282076
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.
This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.
But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.
Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.
Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.
This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.
Differential Revision: https://phabricator.services.mozilla.com/D282076
The patch in the regressing bug should have updated the overflow areas
of the replaced elements when overflowing.
Factor the dest rect computation for canvas and video as well so that
it's easier to manage.
Note that for object-fit computation purposes we need to ignore size
containment so that also required a minor refactor.
Differential Revision: https://phabricator.services.mozilla.com/D275762
The patch in the regressing bug should have updated the overflow areas
of the replaced elements when overflowing.
Factor the dest rect computation for canvas and video as well so that
it's easier to manage.
Note that for object-fit computation purposes we need to ignore size
containment so that also required a minor refactor.
Differential Revision: https://phabricator.services.mozilla.com/D275762
As per the resolution in
https://github.com/w3c/csswg-drafts/issues/11494.
We need to move the resolved value stuff for border properties to style
to avoid regressing shorthand serialization tests. Note we no longer
have layout-dependent borders tho.
Fix a few tests related to inheritance which I think chromium just gets
wrong for border-width, see the issue discussion. What you inherit is
the computed value.
Differential Revision: https://phabricator.services.mozilla.com/D271314
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
`MutationEvent_Bindings::MODIFICATION`,
`MutationEvent_Bindings::ADDITION` and `MutationEvent_Bindings::REMOVAL`
will be removed. Therefore, we need alternative `enum class` for that.
This patch makes `nsIFrame` and subclasses use the new one.
Differential Revision: https://phabricator.services.mozilla.com/D263053
This reverts commit c7950c03d7.
Revert "Bug 1984859 - Use a common type for layout rounded corners and graphics rounded corners. r=layout-reviewers,gfx-reviewers,jfkthame,jnicol"
This reverts commit 2991156989.
Revert "Bug 1984859 - Use Margin to represent border widths in nsCSSRendering. r=layout-reviewers,gfx-reviewers,jfkthame,jnicol"
This reverts commit 446150abe6.
This patch introduces a heuristic to determine whether a snapshot is large and if so, restrict it to the most suitable subset of the captured rect.
The idea is to compare the captured rect with the visual viewport. If the captured rect is larger than the viewport, then it is known to cover more than what is currently visible and likely to be very large. To avoid raserizing a very large snapshot and possibly having to do so at a low resolution, we use only a portion of the captured rect that is closest to the visual viewport and at most as large as the latter.
Differential Revision: https://phabricator.services.mozilla.com/D259964
This reverts commit 958226a7a0.
Revert "Bug 1964101 - Update test expectations. r=emilio"
This reverts commit 03518b36cd.
Revert "Bug 1964101 - Restrict the captured area of very large snapshots. r=emilio,layout-reviewers"
This reverts commit 0d20663349.
This patch introduces a heuristic to determine whether a snapshot is large and if so, restrict it to the most suitable subset of the captured rect.
The idea is to compare the captured rect with the visual viewport. If the captured rect is larger than the viewport, then it is known to cover more than what is currently visible and likely to be very large. To avoid raserizing a very large snapshot and possibly having to do so at a low resolution, we use only a portion of the captured rect that is closest to the visual viewport and at most as large as the latter.
Differential Revision: https://phabricator.services.mozilla.com/D259964