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

68 Коммитов

Автор SHA1 Сообщение Дата
Andrew McCreight ce28c41da0 Bug 1805931, part 2 - Automated removal of uses of ROOT and UNROOT CC macros. r=smaug
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
2022-12-15 19:45:01 +00:00
Oriol Brufau 557844ab0b Bug 1800955 - Update last remembered size when element is not skipping contents. r=emilio
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
2022-11-17 14:54:43 +00:00
Oriol Brufau 70bc1e8b84 Bug 1792217 - Let last remembered size take all fragments into account regardless of pref. r=emilio
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
2022-09-23 23:41:34 +00:00
Oriol Brufau 3e1fc9be3a Bug 1792210 - Use for loop in ResizeObserver's CalculateBoxSize. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D158029
2022-09-23 18:14:09 +00:00
Martin Robinson 3b0ff9fae9 Bug 1791760 - Move GetContainSizeAxes to nsIFrame r=emilio
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
2022-09-22 12:11:09 +00:00
Oriol Brufau 1708933e21 Bug 1791402 - Take all fragments into account for last remembered size. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157659
2022-09-21 20:19:56 +00:00
Oriol Brufau 9ce845742c Bug 1791375 - Handle multiple fragments in ResizeObserver. r=emilio
As per CSSWG resolution: https://github.com/w3c/csswg-drafts/issues/3673

Some details are not clear, so implement it behind a pref, disabled by
default.

Differential Revision: https://phabricator.services.mozilla.com/D157641
2022-09-21 20:19:55 +00:00
Oriol Brufau 13f2137f7d Bug 1791375 - Switch ResizeObserver APIs to using an array of sizes. r=emilio
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
2022-09-21 20:19:55 +00:00
Oriol Brufau 0b1bad6f6b Bug 1791375 - Switch ResizeObserver APIs from gfx::Size to LogicalPixelSize. r=emilio
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
2022-09-21 20:19:54 +00:00
Oriol Brufau 6649142cb7 Bug 1791371 - Remove unnecessary WritingMode parameter for ResizeObservation. r=emilio
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
2022-09-19 16:36:44 +00:00
Martin Robinson f943c5f18d Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
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
2022-09-15 20:32:27 +00:00
Martin Robinson c5c0573fff Bug 1790631: Elements skipped via `content-visibility` should not trigger ResizeObserver r=emilio
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
2022-09-14 21:52:50 +00:00
Oriol Brufau 9ec08402a1 Bug 1789754 - Don't record last remembered size for non-replaced inlines. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157020
2022-09-10 13:26:12 +00:00
Olli Pettay 93acdfad59 Bug 1777574, automate CC zone handling, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D155084
2022-09-07 11:22:51 +00:00
David Shin feca6731ff Bug 1785305: Set Resize Observer's last reported size to -1x-1 initially. r=emilio
It used to be 0x0, but changed per the CSSWG resolution:
https://github.com/w3c/csswg-drafts/issues/3664
Sits behind pref `dom.resize_observer.last_reported_size_invalid`.

Differential Revision: https://phabricator.services.mozilla.com/D155710
2022-08-30 17:05:56 +00:00
Oriol Brufau 53cf586b7a Bug 1784577 - Add logic for updating the last remembered size. r=emilio
Depends on D154575

Differential Revision: https://phabricator.services.mozilla.com/D152642
2022-08-21 23:27:22 +00:00
Oriol Brufau bea6d0d822 Bug 1781046 - Add internal ResizeObserver for last remembered size. r=emilio
In a follow-up, it will take care of updating the last remembered size
as described in https://drafts.csswg.org/css-sizing-4/#last-remembered

Differential Revision: https://phabricator.services.mozilla.com/D154325
2022-08-12 15:06:43 +00:00
Oriol Brufau 285f6f3ee9 Bug 1781046 - Make ResizeObserver::mCallback Variant. r=emilio
So that it can accept a callback function implemented in C++.

Analogous to what D61436 did for DOMIntersectionObserver.

Differential Revision: https://phabricator.services.mozilla.com/D154324
2022-08-12 15:06:42 +00:00
Cosmin Sabou eef1e137ae Backed out 6 changesets (bug 1781046, bug 1784575) for pressumably causing Bug 1784591 and Bug 1784625. a=backout
Backed out changeset 84e0f04d939c (bug 1781046)
Backed out changeset 84228a1b82da (bug 1781046)
Backed out changeset a0574f6e88e1 (bug 1781046)
Backed out changeset 6dc8a407aa1f (bug 1781046)
Backed out changeset a3724891b9c9 (bug 1781046)
Backed out changeset 617f9a8b7512 (bug 1784575)
2022-08-19 23:37:15 +03:00
Oriol Brufau cf76dc495f Bug 1781046 - Add internal ResizeObserver for last remembered size. r=emilio
In a follow-up, it will take care of updating the last remembered size
as described in https://drafts.csswg.org/css-sizing-4/#last-remembered

Differential Revision: https://phabricator.services.mozilla.com/D154325
2022-08-12 15:06:43 +00:00
Oriol Brufau 52c73d8329 Bug 1781046 - Make ResizeObserver::mCallback Variant. r=emilio
So that it can accept a callback function implemented in C++.

Analogous to what D61436 did for DOMIntersectionObserver.

Differential Revision: https://phabricator.services.mozilla.com/D154324
2022-08-12 15:06:42 +00:00
David Shin 2ba3e10fe2 Bug 1565557: ResizeObserver for SVG elements with CSS layout boxes use the layout boxes. r=emilio
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
2022-08-11 15:45:34 +00:00
Emilio Cobos Álvarez d3bd8e444d Bug 1781268 - Clean up ResizeObserver error handling. r=Oriol
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
2022-07-26 15:30:19 +00:00
David Shin 3fa1dd240a Bug 1774135 - `ResizeObserver`: Take subpixel snapping into account when reporting `devicePixelContentBoxSize`. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D151549
2022-07-15 17:45:36 +00:00
Emilio Cobos Álvarez 0e84325b5d Bug 1764977 - Downgrade an assertion that can break with very large sizes.
Differential Revision: https://phabricator.services.mozilla.com/D144005
2022-04-19 13:47:55 +00:00
Emilio Cobos Álvarez aa6eb5ceb7 Bug 1757443 - Correctly account for padding in ResizeObserver content-box size for scrollable frames. r=boris,layout-reviewers
See test.

Differential Revision: https://phabricator.services.mozilla.com/D141398
2022-03-18 02:20:01 +00:00
Emilio Cobos Álvarez 8b12bb4530 Bug 1733042 - Use scrollport size rather than content-box size of scrollframes. r=boris
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
2022-02-24 17:00:35 +00:00
Butkovits Atila 1f27e66762 Backed out changeset 9784a06a9b54 (bug 1733042) for causing Android wpt failures at scrollbars.html. CLOSED TREE 2022-02-24 17:08:44 +02:00
Emilio Cobos Álvarez c939c657eb Bug 1733042 - Use scrollport size rather than content-box size of scrollframes. r=boris
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
2022-02-24 12:13:08 +00:00
Butkovits Atila f669c536bb Backed out changeset 623c4391875a (bug 1733042) for causing wpt failures at scrollbars.html. CLOSED TREE 2022-02-24 09:07:26 +02:00
Emilio Cobos Álvarez 68e9cb0ad5 Bug 1733042 - Use scrollport size rather than content-box size of scrollframes. r=boris
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
2022-02-23 23:58:41 +00:00
Emilio Cobos Álvarez 6fb72d4a3f Bug 1754579 - Don't keep so much alive when returning DOMRects & co. r=smaug
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
2022-02-10 00:38:45 +00:00
Boris Chiou a282364f3e Bug 1587973 - Part 4: Rename GetTargetSize with CalculateBoxSize. r=emilio
Use the same name as the spec title for better readability:
https://www.w3.org/TR/resize-observer-1/#calculate-box-size

Differential Revision: https://phabricator.services.mozilla.com/D121158
2021-08-10 21:03:31 +00:00
Boris Chiou 6b574c5928 Bug 1587973 - Part 3: Support device-pixel-content-box for ResizeObserver. r=emilio
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
2021-08-10 21:03:31 +00:00
Boris Chiou 64e925cdb0 Bug 1587973 - Part 2: Introduce LogicalPixelSize for ResizeObserver. r=emilio
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
2021-08-10 21:03:31 +00:00
Boris Chiou a2b8e058de Bug 1587973 - Part 1: Use CSS pixels or device pixels in ResizeObserverSize. r=emilio
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
2021-08-10 21:03:30 +00:00
Boris Chiou f5ebaf749a Bug 1689099 - Schedule resize observers for the whole browsing context tree. r=emilio
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
2021-08-09 19:48:13 +00:00
Boris Chiou e1c99a968b Bug 1599176 - Use sequence for borderBoxSize and contentBoxSize in ResizeObserverEntry. r=smaug,dholbert
Based on the spec, we should use FrozenArray for these two attributes.
However, we don't support FrozenArray in Gecko now, so use sequence.

spec: https://drafts.csswg.org/resize-observer/#resize-observer-entry-interface

Differential Revision: https://phabricator.services.mozilla.com/D120276
2021-07-20 20:45:17 +00:00
Emilio Cobos Álvarez a7273a0cfc Bug 1717620 - ResizeObserverController shouldn't need to keep observers alive. r=smaug
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
2021-07-09 09:29:18 +00:00
Marian-Vasile Laza 62e5bd4ede Backed out changeset 5a4f865e6d5d (bug 1717620) for causing crashes in Bug 1718286. a=backout DONTBUILD 2021-06-26 00:37:43 +03:00
Emilio Cobos Álvarez e19569fbb1 Bug 1717620 - ResizeObserverController shouldn't need to keep observers alive. r=smaug
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
2021-06-24 15:01:05 +00:00
Simon Giesecke 4f75368dcb Bug 1691913 - Rename nsBaseHashtable::GetOrInsert(With) to LookupOrInsert(With). r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
The functions should be called "Lookup" rather than "Get" because they return
a DataType& (rather than UserDataType).

Differential Revision: https://phabricator.services.mozilla.com/D105472
2021-02-26 09:11:45 +00:00
Simon Giesecke d2caea36fa Bug 1691894 - Simplify uses of WithEntryHandle that only use OrInsert(With) by using GetOrInsertWith. r=xpcom-reviewers,necko-reviewers,jgilbert,nika
Differential Revision: https://phabricator.services.mozilla.com/D104676
2021-02-22 12:07:46 +00:00
Simon Giesecke d4f7649e81 Bug 1688833 - Migrate LookupForAdd to WithEntryHandle in dom/base. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D104203
2021-02-09 18:19:39 +00:00
Sylvestre Ledru fde06f6d21 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 17:04:01 +00:00
Butkovits Atila 964cca3198 Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru 5f29324f60 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 08:29:00 +00:00
longsonr 875f5e88ac Bug 1259861 - Move everything else into the mozilla namespace in layout/svg r=dholbert
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
2020-07-11 02:20:20 +00:00
Simon Giesecke b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
shindli 91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00