Commit Graph
70 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez efe881929b Bug 1907868 - Optimize nsQueryFrame for all final frame types and ScrollContainerFrame. r=tnikkel,layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D216682
2024-07-18 11:51:13 +00:00
Stanca Serban 20161e50a8 Backed out changeset c635f67339a5 (bug 1907868) for causing build bustages in nsQueryFrame.h. CLOSED TREE 2024-07-18 05:10:29 +03:00
Emilio Cobos Álvarez f7d89ea24a Bug 1907868 - Optimize nsQueryFrame for all final frame types and ScrollContainerFrame. r=tnikkel,layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D216682
2024-07-17 21:51:45 +00:00
Ting-Yu Lin 5cdee429ce Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-30 06:32:22 +00:00
Sebastian Hengst bf4dfe53f8 Backed out 15 changesets (bug 1896516) for causing scrolling crashes on macOS. a=backout
Backed out changeset fd6904338812 (bug 1896516)
Backed out changeset 2977ff81a23e (bug 1896516)
Backed out changeset c8a6b0e526d6 (bug 1896516)
Backed out changeset 3c06f22da72b (bug 1896516)
Backed out changeset f63b0c4335fe (bug 1896516)
Backed out changeset 6f7ab8adfa6e (bug 1896516)
Backed out changeset 997c9249dbed (bug 1896516)
Backed out changeset c964fccd5180 (bug 1896516)
Backed out changeset 7b481b747b7a (bug 1896516)
Backed out changeset 42e1bbe0ecb6 (bug 1896516)
Backed out changeset 717dac08b607 (bug 1896516)
Backed out changeset 2f0817331dbe (bug 1896516)
Backed out changeset b765169a7a8f (bug 1896516)
Backed out changeset a2d37b98273c (bug 1896516)
Backed out changeset ea9ecb543e66 (bug 1896516)
2024-05-29 11:22:52 +02:00
Ting-Yu Lin 37e9b779f9 Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-28 04:46:20 +00:00
Emilio Cobos Álvarez 2d88db4c74 Bug 1867201 - Minor non-functional clean-ups to ScrollbarActivity. r=jwatt
This doesn't change behavior but I made them while debugging and they
seem worth it.

Differential Revision: https://phabricator.services.mozilla.com/D195083
2023-12-01 13:59:01 +00:00
Emilio Cobos Álvarez 3781654af4 Bug 1867201 - Fix ScrollbarActivity's behavior on macOS. r=mstange
This is the actual fix. The way this code works, mousemove events
trigger zero-duration activity periods.

So checking IsActive is not the right thing to do, because that means we
bail out too early from HandleEvent once we've stopped scrolling.
Instead track the effective visibility of the scrollbar, which is what
the previous code did.

This allows mousemoves and so on to keep the scrollbar active on macOS.

Differential Revision: https://phabricator.services.mozilla.com/D195012
2023-11-30 11:32:39 +00:00
Emilio Cobos Álvarez 47599caca6 Bug 1863620 - Use an accelerated animation for overlay scrollbar. r=hiro
This also simplifies ScrollbarActivity, and removes some attributes that
aren't looked up while at it.

Differential Revision: https://phabricator.services.mozilla.com/D193049
2023-11-20 21:47:50 +00:00
Sandor Molnar afac38ae76 Backed out 2 changesets (bug 1863620) for causing multiple failure CLOSED TREE
Backed out changeset 298c668b4347 (bug 1863620)
Backed out changeset e34670e74c31 (bug 1863620)
2023-11-20 14:02:26 +02:00
Emilio Cobos Álvarez 4b1fb498f0 Bug 1863620 - Use an accelerated animation for overlay scrollbar. r=hiro
This also simplifies ScrollbarActivity, and removes some attributes that
aren't looked up while at it.

Differential Revision: https://phabricator.services.mozilla.com/D193049
2023-11-20 09:32:00 +00:00
Emilio Cobos Álvarez 529c9ee321 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Emilio Cobos Álvarez f9e7ddcde4 Bug 1824236 - Stop using XUL layout for scrollbars. r=jwatt
This rewrites scrollbar layout to work with regular reflow rather than
box layout.

Overall it's about the same amount of code (mostly because
nsScrollbarFrame::Reflow is sorta hand-rolled), but it cleans up a bit
and it is progress towards removing XUL layout altogether, without
getting into much deeper refactoring.

This also blocks some other performance improvements and refactorings I
want to make in this code.

We make some assumptions to simplify the code that to some extent were
made already before, both explicitly and by virtue of using XUL layout.

In particular, we assume that scrollbar / slider / thumb has no border or
padding and that the writing-mode is horizontal ltr.

Differential Revision: https://phabricator.services.mozilla.com/D173489
2023-03-27 20:54:53 +00:00
Sandor Molnar 7944d7404c Backed out changeset 7da2469ac949 (bug 1824236) for causing assertion failures in layout/generic/crashtests/369038-1.xhtml CLOSED TREE 2023-03-27 23:20:35 +03:00
Emilio Cobos Álvarez 5cf2decf1e Bug 1824236 - Stop using XUL layout for scrollbars. r=jwatt
This rewrites scrollbar layout to work with regular reflow rather than
box layout.

Overall it's about the same amount of code (mostly because
nsScrollbarFrame::Reflow is sorta hand-rolled), but it cleans up a bit
and it is progress towards removing XUL layout altogether, without
getting into much deeper refactoring.

This also blocks some other performance improvements and refactorings I
want to make in this code.

We make some assumptions to simplify the code that to some extent were
made already before, both explicitly and by virtue of using XUL layout.

In particular, we assume that scrollbar / slider / thumb has no border or
padding and that the writing-mode is horizontal ltr.

Differential Revision: https://phabricator.services.mozilla.com/D173489
2023-03-27 19:12:52 +00:00
Timothy Nikkel 3e370345d5 Bug 1756831. When considering mousemoves over scroll frames to show overlay scrollbars rejects mousemove over content descendants that aren't frame descandants. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D140931
2022-03-22 15:31:45 +00:00
Daniel Holbert c65f3cb6d2 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 39f360d967 Backed out changeset 007ff7f371c9 (bug 1730774) for causing bustages on Bp-hybrid. CLOSED TREE 2021-09-15 09:14:41 +03:00
Daniel Holbert 1fe146ec2e 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
Emilio Cobos Álvarez fe2b95e111 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
Markus Stange 2af8f742d6 Bug 1666617 - Add an observer description argument to AddRefreshObserver. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D91082
2020-09-25 02:36:29 +00:00
Simon Giesecke ab6f0a7137 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Masayuki Nakano 622e0d1a98 Bug 1660378 - part 9: Avoid QI for getting nsStyledElement pointer r=smaug
The editor modules does QI too many times when it sets or removes some style
with `execCommand` or XPCOM API.  Therefore, there should be an API to
retrieve `nsStyledElement` pointer from `nsINode*`.

Differential Revision: https://phabricator.services.mozilla.com/D87990
2020-08-26 05:29:06 +00:00
Simon Giesecke a69d79b6db Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Emilio Cobos Álvarez f998ecc386 Bug 1640623 - Use enum classes for LookAndFeel int and float IDs. r=jmathies,geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D76694
2020-06-11 11:27:43 +00:00
Kristen Wright 8da094c776 Bug 1626388 - Convert layout.testing.overlay-scrollbars.always-visible to static pref. r=njn
Converts `layout.testing.overlay-scrollbars.always-visible` to a static pref.

Differential Revision: https://phabricator.services.mozilla.com/D69611
2020-04-06 20:18:58 +00:00
Boris Zbarsky e100afa969 Bug 1612444. Improve some error messages for exceptions in layout. r=emilio
I used ThrowNotSupportedError for the not-implemented case.

Differential Revision: https://phabricator.services.mozilla.com/D61324
2020-02-03 20:35:54 +00:00
Emilio Cobos Álvarez 4847c60fa0 Bug 1449861 - Use UTF8String for some CSSOM APIs. r=bzbarsky
In particular, the ones where we transcode unconditionally atm (property names
and such).

There are others like cssText getters and setters which are a bit harder,
because I either need to rewrite all our serialization code to work with UTF8
(which is fine, but a lot of work), or teach webidl to have a setter that takes
UTF8String as input but returns DOMString as output (which is at best hacky).

Differential Revision: https://phabricator.services.mozilla.com/D58631
2020-01-04 10:36:49 +00:00
Emilio Cobos Álvarez 1cf22c6021 Bug 1600362 - Cleanup IntersectionObserver. r=smaug
Initially this was going to be a simple cleanup: Remove some useless namespaces
here and there and so on, remove `using` statements from the header and so on.

But unfortunately, DOMIntersectionObserver.h (which is included in Element.h,
unnecessarily) ended up exposing `Element` unnamespaced to a lot of code, so I
had to fix that.

Differential Revision: https://phabricator.services.mozilla.com/D55316
2019-11-29 20:39:36 +00:00
Timothy Nikkel 1c7158039c Bug 1576746. Invalidate scrollbars when hover changes on them. r=mstange
At

https://searchfox.org/mozilla-central/rev/2f29d53865cb895bf16c91336cc575aecd996a17/layout/generic/nsGfxScrollFrame.cpp#3166

we sort the scrollbar parts based on hovered state so that the hovered scrollbar is on top of a non-hovered scrollbar. This means that changing the hover state of a scrollbar can change the ordering of the scrollbar display items in the display list. So when the hover state changes we need to mark the frames modified.

I'm guessing the reason this didn't come up before is because we needed a combination of scrollbars that don't have any style changes on hover and a platform that has hover events. I'm guessing GeckoView scrollbars don't have a style change on hover, and we don't commonly have a mouse or mouse like cursor device hooked up to GeckoView devies to have hover events. Except Firefox Reality has a cursor thingy so we see the problem there.

Differential Revision: https://phabricator.services.mozilla.com/D48234
2019-10-10 21:11:33 +00:00
Andreea Pavel 223c6eaa6f Backed out changeset f32bb97d3acf (bug 1576746) for android crashes on a CLOSED TREE 2019-10-10 23:43:44 +03:00
Timothy Nikkel dbdaca79b3 Bug 1576746. Invalidate scrollbars when hover changes on them. r=mstange
At

https://searchfox.org/mozilla-central/rev/2f29d53865cb895bf16c91336cc575aecd996a17/layout/generic/nsGfxScrollFrame.cpp#3166

we sort the scrollbar parts based on hovered state so that the hovered scrollbar is on top of a non-hovered scrollbar. This means that changing the hover state of a scrollbar can change the ordering of the scrollbar display items in the display list. So when the hover state changes we need to mark the frames modified.

I'm guessing the reason this didn't come up before is because we needed a combination of scrollbars that don't have any style changes on hover and a platform that has hover events. I'm guessing GeckoView scrollbars don't have a style change on hover, and we don't commonly have a mouse or mouse like cursor device hooked up to GeckoView devies to have hover events. Except Firefox Reality has a cursor thingy so we see the problem there.

Differential Revision: https://phabricator.services.mozilla.com/D48234
2019-10-10 19:13:02 +00:00
Mirko Brodesser 090d7efc5e Bug 1565584: move nsIContentUtils::ContentIsDescendantOf to nsINode::IsInclusiveDescendantOf. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D37880
2019-07-15 10:02:21 +02:00
Sylvestre Ledru e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Boris Zbarsky 7cd02511ad Bug 1455055 part 3. Clean up HandleEvent implementations in layout. r=masayuki
MozReview-Commit-ID: 7Irm8aAmeIt
2018-04-20 00:49:29 -04:00
Boris Zbarsky 65759d684b Bug 1455055 part 1. Convert nsIDOMEventListener to taking an Event, not an nsIDOMEvent. r=masayuki
This does no cleanup other than what's needed to compile.  Cleanup coming up in
later patches.

MozReview-Commit-ID: 3sOnkj71n09
2018-04-20 00:49:29 -04:00
Boris Zbarsky 238fc00322 Bug 1449631 part 9. Remove nsIDOMEventTarget::AddEventListener. r=smaug
Also switch the XPCOM-y version of EventTarget::AddEventListner to a
Nullable<bool> for aWantsUntrusted.

The three-arg overload of AddEventListener in ContentFrameMessageManager was
never called, so all the AddEventListener overloads there are not needed.

MozReview-Commit-ID: 4IhqHmPVWzE
2018-04-05 13:42:42 -04:00
Boris Zbarsky 51e653f001 Bug 1449631 part 2. Remove nsIDOMEventTarget::RemoveEventListener. r=smaug
We can't have a null content in
ScrollbarActivity::StopListeningForScrollAreaEvents, because only viewport
frames have a null GetContent().

MozReview-Commit-ID: 9iAg0ivVqqG
2018-04-05 13:42:40 -04:00
Cameron McCormack 6f67ab6348 Bug 1427512 - Part 29: Remove nsIDOMCSSDeclaration. r=xidorn,jryans,bz
This removes the .style attribute from nsIDOMSVGElement, but there
shouldn't be any users of that.

MozReview-Commit-ID: LOBSFo85Utn
2018-01-11 16:17:57 +08:00
Emilio Cobos Álvarez c10ea9ea04 Bug 1423167: Move most attribute-related methods from nsIContent to Element. r=bz
MozReview-Commit-ID: 6WXqNiODttD
2017-12-06 16:05:59 +01:00
Daniel Holbert 8fea3c215f Bug 1412346 part 5: (automated patch) Switch a bunch of C++ files in layout to use our standard mode lines. r=jfkthame
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py

For every file that is modified in this patch, the changes are as follows:
 (1) The patch changes the file to use the exact C++ mode lines from the
     Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

 (2) The patch deletes any blank lines between the mode line & the MPL
     boilerplate comment.

 (3) If the file previously had the mode lines and MPL boilerplate in a
     single contiguous C++ comment, then the patch splits them into
     separate C++ comments, to match the boilerplate in the coding style.

MozReview-Commit-ID: EuRsDue63tK
2017-10-27 10:33:53 -07:00
Kris Maglione 1895b2d74a Bug 1404198: Part 2e - Switch to NS_NewTimer* in layout. r=njn
MozReview-Commit-ID: 2WxyAXpJ3Fg
2017-10-15 23:13:31 -07:00
Nicholas Nethercote 7dbfdaf890 Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP
2017-10-03 09:05:19 +11:00
Mats Palmgren 7c43dcf986 Bug 1340771 part 1 - Rename nsWeakFrame to AutoWeakFrame (automated change). r=tn
MozReview-Commit-ID: 8pl4nyeGEkr
2017-03-01 18:03:14 +01:00
Cameron McCormack 5f9911da79 Bug 1328832 - Part 2: Rename mozFlushType to mozilla::FlushType and make it an enum class. r=bzbarsky
MozReview-Commit-ID: D3fIngSHSsl
2017-01-05 15:31:56 +08:00
David Zbarsky b748a9b137 Bug 824592 part 3. Get rid of nsIDOMElementCSSInlineStyle. r=peterv 2016-08-02 11:05:38 -07:00
Kartikaya Gupta f8d669437a Bug 1247050 - Avoid tripping an NS_ASSERTION that can legitimately fire. r=mstange
MozReview-Commit-ID: JpfBWiP3BeL
2016-06-15 01:27:21 +01:00
Kartikaya Gupta fe702ad3ca Bug 1225137 - Avoid crash on some platforms if scrollbar fading is enabled and the duration is set to zero. r=spohl 2015-11-16 10:44:45 -05:00
Nicholas Nethercote 3ddf3a726a Bug 1203427 (part 5) - Add logging of timer firings. r=froydnj. 2015-09-10 00:50:51 -07:00
Miranda Emery 874dede8fb Bug 957445: Part 3 - combines nsIScrollbarOwner with nsIScrollbarMediator, r=mats 2014-02-14 19:40:53 +13:00