As of the prior patch, these are no longer needed. I removed
these with a script, then ran clang-format on the files, then
manually reverted a few unrelated changed from the formatter.
Differential Revision: https://phabricator.services.mozilla.com/D164829
Previously it was only updated when the element didn't have size
containment, but this could result in non-stable size when combining
'content-visibility: auto' and 'contain: size'.
Test auto-012.html is still failing since 'content-visibility: auto' has
not been implemented yet.
Differential Revision: https://phabricator.services.mozilla.com/D162254
ResizeObserver only handles multiple fragments when the preference
dom.resize_observer.support_fragments is true.
That's because this experimental behavior may have compat problems.
But the last remembered size uses an internal ResizeObserver,
so changing the signature of the callback is not a problem.
Differential Revision: https://phabricator.services.mozilla.com/D158034
This will allow this function to eventually return an appropriate value
depending on whether or not content is skipped via `content-visibility:
auto`. This change also starts looking directly at whether
content-visibility is skipping content or not, which should make it
compatible with a future `content-visibility: auto` implementation.
Differential Revision: https://phabricator.services.mozilla.com/D157831
This is in preparation of supporting multiple fragments, since we should
track each fragment size separately.
This patch should have no observable effect.
Differential Revision: https://phabricator.services.mozilla.com/D157640
This is in preparation of supporting multiple fragments, since we want
to track the logical sizes, and fragments might potentially have
different writing modes (but not sure if it can happen in practice).
This patch should have no observable effect.
Differential Revision: https://phabricator.services.mozilla.com/D157639
The writing mode doesn't matter since mLastReportedSize is initialized
to the same value for both axes.
This patch should have no observable effect.
Differential Revision: https://phabricator.services.mozilla.com/D157633
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.
This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.
In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.
Differential Revision: https://phabricator.services.mozilla.com/D157306
Do not collect elements skipped via `content-visibility` when gathering
active ResizeObserverObservations. This will mean that these elements
will not trigger ResizeObserver callbacks until their content is no
longer skipped by `content-visibility`.
Differential Revision: https://phabricator.services.mozilla.com/D157244
As per the CSSWG resolution here: https://github.com/w3c/csswg-drafts/issues/4032
Previously, any and all SVG elements used its SVG object bounding box. Now, SVG
elements that have their own CSS layout box use them. These match the following
CSS rules: `svg:root, *:not(svg|*) > svg, svg|foreignObject > svg`
Differential Revision: https://phabricator.services.mozilla.com/D154246
unobserve() never throws. observe() only threw on a case which should
never be reached (an already unlinked observer). We can assert and
return instead.
Differential Revision: https://phabricator.services.mozilla.com/D152769
I don't really feel our behavior is particularly less correct than
Chromium since in our implementation an scrolling element has two boxes
rather than one, but in the interest of interop, and given developers
find it useful, it seems worth doing this.
Differential Revision: https://phabricator.services.mozilla.com/D139551
I don't really feel our behavior is particularly less correct than
Chromium since in our implementation an scrolling element has two boxes
rather than one, but in the interest of interop, and given developers
find it useful, it seems worth doing this.
Differential Revision: https://phabricator.services.mozilla.com/D139551
I don't really feel our behavior is particularly less correct than
Chromium since in our implementation an scrolling element has two boxes
rather than one, but in the interest of interop, and given developers
find it useful, it seems worth doing this.
Differential Revision: https://phabricator.services.mozilla.com/D139551
We keep the parent alive for wrapping. It's unnecessary to keep alive
the individual element / range / etc. Pass the relevant global /
document.
Differential Revision: https://phabricator.services.mozilla.com/D138357
This patch implements device-pixel-content-box for ResizeObserver.
GetTargetSize() returns CSS pixels for {border|content}-box, or device
pixels for device-pixel-content-box. We round the device pixel to
integral based on the spec,
https://drafts.csswg.org/resize-observer/#calculate-box-size.
And then we compare the current calculated box sizes and the last updated one
in IsActive().
Besides, the current wpts only use zoom property to verify this, but zoom
property is non-standard and we doesn't supports it, so now we only test the
getter functions for device-pixel-content-box and the subpixel snapping
algorithm (e.g. devicepixel.html) for Gecko in wpts.
Differential Revision: https://phabricator.services.mozilla.com/D120776
LogicalPixelSize is a variant of LogicalSize but it stores pixel values
in floating-point. Now we store LogicalPixelSize in ResizeObservation and
ResizeObserverSize. This makes us easier to introduce device-pixel-content-box.
Differential Revision: https://phabricator.services.mozilla.com/D121155
We will introduce device-pixel-content-box, which is in device-pixel
domain. Therefore, we convert the app units into CSS/device pixel when creating
ResizeObserverSize.
Differential Revision: https://phabricator.services.mozilla.com/D121016
It's possible to observe an element in the iframe while the
ResizeObserver object lives in the outer document, so we have to make
sure we also schedule the observer for all documents in the same
BrowsingContext tree.
Differential Revision: https://phabricator.services.mozilla.com/D119843
The observers take care of unregistering when they need to. Instead,
make the ResizeObservation keep the element alive just like
nsMutationReceiver keeps the mutation observer alive.
Differential Revision: https://phabricator.services.mozilla.com/D118477
The observers take care of unregistering when they need to. Instead,
make the ResizeObservation keep the element alive just like
nsMutationReceiver keeps the mutation observer alive.
Differential Revision: https://phabricator.services.mozilla.com/D118477
Also: adjust include paths to be consistent for usages of various SVG headers,
and remove unused SVG includes (mostly for "utils" classes),
and drop stray "ns" from already-renamed SVG classes in various code comments.
Differential Revision: https://phabricator.services.mozilla.com/D83140