Commit Graph
55 Commits
Author SHA1 Message Date
NotAlexNoyleandClaude Opus 5.5 806f342676 widget: a GPU-path layer paint with nothing pending is skipped; a moved displayport base schedules a paint
T-527. JihadPaintLayers returns at once after the first paint when the widget has no invalid region,
no paint task pending and the refresh driver owes no view-manager flush: the layer tree is current
and a paint would only build the display list again (JIHAD_GPU_PAINT_ALWAYS=1 paints every time).
jihad_layout_set_displayport2 schedules a paint of the root scroll frame when the base moved
(SetDisplayPortMargins compares displayports computed with the new base on both sides).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 08:53:33 -05:00
NotAlexNoyleandClaude Opus 5.5 dd391a4b2a layout: the GPU path's root displayport base is the daemon's — no longer replaced on every paint
cavekit-gpu-rendering.md R6 / T-527. nsLayoutUtils::PaintFrame asks the root scroll frame's
DecideScrollableLayer with aAllowCreateDisplayPort, and for the root content document that set the
displayport base to the composition size at the origin, in CSS px, on every paint. So the base the
daemon sets with jihad_layout_set_displayport2 (what the card shows, at the compositor's shift, in
layout device px: patch 0059) never reached a paint: a zoomed-in card's displayport covered only
what the margins and the clamp into the scrollable rect happened to reach. With no margins (the
daemon's first paint after a zoom, what the card shows only) desktop Wikipedia at 2.33 painted 660
of the 531..861 CSS px the card showed and the rest of the view stayed white (frame dumps,
2026-10-25: the painted edge at 1536 screen px, the aligned width of a base 1116 px wide at
resolution 1). On the GPU path, once the daemon has set the root's base
(nsLayoutUtils::JihadKeepsDisplayPortBase: the frame carries the shown size), the paint keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 08:53:33 -05:00
NotAlexNoyleandClaude Fable 5.1 c3ea919c89 layout: the GPU path's root displayport and clip at a resolution — the base in layout device px at the card's shift (jihad_layout_set_displayport2), the scroll port as the root's display-list clip
T-524 (2026-10-24), found with the emulated finger on desktop Wikipedia (laid out 1116x1374, the card's
view 330 CSS px wide at a zoom of 2.33, 531 px from the engine's scroll, which has no sideways range):

1. GetDisplayPortFromMarginsData takes the root's base rect in layout device px: it scales it by the
   parent's resolution (1 for the root content document) and divides base + margins by the cumulative
   resolution. jihad_layout_set_displayport set the scroll port in CSS px as the base, so at 2.33 the
   1116 px base became 479 CSS px and the 165 px margins 71: the displayport ended 550 px from the
   engine's scroll, the card's right third was white at 2.33, two thirds at 2.71, all of it from 2.98.
   jihad_layout_set_displayport2 takes where the card's view sits (the compositor's shift) and makes
   the base what the card shows, at the shift, times the resolution, the margins times the resolution.
   The old entry calls it with no shift. The daemon passes the shift and sets the displayport again when
   the shift leaves the re-anchor margin or the zoom changes.

2. nsGfxScrollFrame divided the root content document's display-list clip by the resolution. Gecko's
   composition size for that root is the widget's device px; the GPU path's (CalculateCompositionSizeForFrame's
   Jihad branch) is the scroll port or what the card shows, in CSS px, so the clip became 479 CSS px wide
   at 2.33 and a tap on anything beyond it hit only <html> (the infobox's links). The port is the clip on
   the GPU path; the overscan rows are CSS px too.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-03 08:53:32 -05:00
NotAlexNoyle ea0652b2ab gpu diagnostics: off by default behind JIHAD_GPU_LOG; the page's transactions on the timeline
T-512: the GPU path's [jihad-gpu] diagnostics print only with JIHAD_GPU_LOG=1, or in a device round's
JIHAD_GPU_TIMELINE, JIHAD_GPU_VERIFY or JIHAD_GPU_DUMP_EVERY (one gate, gfx/2d/JihadGpuLog.h, exported
as mozilla/gfx/JihadGpuLog.h); failures and fallbacks print anyway. A daemon on the GPU path now logs
three startup lines from the engine instead of hundreds.

T-517: with JIHAD_GPU_TIMELINE a layer transaction that holds the compositor thread 3 ms or more is
logged with its parts (compositable ops and their tile uploads, layers updated, end), and every compose
job with its uploads: the express lane's frames queue behind the page's transactions.
2026-11-03 08:53:32 -05:00
NotAlexNoyle 3b3430dd03 gpu compositor: the root scroll frame's clip widened by the card's overscan
The GPU path's frame now carries rows above and below what the card shows, so the card has content
to pan into between frames and while the main thread is busy (it showed grey past a view-sized
frame's edges). jihad_layout_set_overscan(docshell, top, bottom) sets them (CSS px) as a frame
property on the root scroll frame; with JIHAD_GPU_COMPOSITOR its clip in BuildDisplayList is widened
by them (over the resolution, as the composition size is).
2026-11-03 08:53:31 -05:00
NotAlexNoyle 07bde00e35 gpu compositor: the card's scroll applied in the compositor; frame-sized surfaces; band frames on their own surface
T-502 (2026-10-18). Without APZ a scroll was a main-thread scroll: every step repainted the
newly exposed strip and re-uploaded the content layer. The daemon now sends the card's scroll
(jihad_offscreen_set_scroll) and AsyncCompositionManager applies it as an async transform on the
layer carrying the root content metrics, the way APZ would, with AlignFixedAndStickyLayers keeping
fixed and sticky layers still. For that, without APZ: root scroll metadata and the scrollport as a
scroll clip for a root scroll frame with a displayport (nsDisplayList, nsGfxScrollFrame), the
displayport set from layout (jihad_layout_set_displayport), and no intermediate surface for a
container under an axis-aligned scale+translate (Layers.cpp).

The Adreno 220 driver bins an FBO render by the current EGL surface's size: a 942-row frame in a
1400-row pbuffer lost its bottom 458 GL rows in some composites. The context's pbuffer is made the
frame's size (GLContextEGL::JihadUsePBufferOfSize) and the window targets with it. Scroll-only
frames (no composite request since the last composite) compose their bands stacked on their own
768x256 pbuffer and FBO, which stays current between band frames (the switch into it costs
11-13 ms); the rows kept are moved while the GPU works; one read takes the stack. A done-fd
(jihad_offscreen_set_done_fd) wakes the daemon the moment a job finishes. Nothing touches a job
after its hand-off.
2026-11-03 08:53:31 -05:00
Basilisk-Dev 8add755c81 Issue #2404 - Improvements to CSS aspect-ratio spec compliance 2026-07-25 00:57:58 -04:00
Jeremy Andrews d5e385dc73 Issue #190 - Remove UIKit conditional code. 2026-02-21 18:55:44 +01:00
Francis Dominic Fajardo 3aa8907d6a Issue #2765 - Follow-up: Avoid declaring RefPtr in the return statement 2025-06-28 16:15:37 +08:00
Francis Dominic Fajardo d4a327c694 Issue #2765 - Follow-up: Fix UAF when returning the non-NAC style context from a frameless node 2025-06-28 11:05:45 +08:00
Francis Dominic Fajardo cd32e19c91 Issue #2765 - Part 2: Create a helper function for resolving the non-NAC style context of a given NAC 2025-06-26 22:55:44 +08:00
Moonchild 11c9b60eba Issue #1925 - Convert half-corner index macros to an enum. 2024-08-02 08:01:01 +02:00
Moonchild f9d1e87756 Issue #1925 - Remove use of NS_CORNER_{TOP|BOTTOM}_{LEFT|RIGHT} macros. 2024-08-02 06:08:29 +02:00
Moonchild dc4316132b Issue #1925 - Remove use of NS_SIDE_* macros. 2024-08-01 17:28:01 +02:00
Moonchild 9b375ff678 Issue #1925 - Remove mozilla::css::Side typedef. 2024-08-01 16:46:27 +02:00
Moonchild 59796f3e9d Issue #2510 - Unprefix -moz-fit-content
No aliasing since this has been out for a while.
Devtools db regenerated with `mach devtools-css-db`

Resolves #2510
2024-05-06 22:09:18 +02:00
FranklinDM 1ed0fa9f83 Issue #2488 - Part 4: Remove the RestyleManagerHandle smart pointer class 2024-03-30 08:46:33 +08:00
FranklinDM 9eb661a899 Issue #2488 - Part 3: Remove the StyleSetHandle smart pointer class 2024-03-30 08:46:32 +08:00
FranklinDM 425dc7f02b Issue #2112 - Part 9: Remove handling for multiple style backends 2024-03-26 01:25:53 +08:00
FranklinDM a00ca6d871 Issue #2112 - Part 3: Remove --enable-stylo config and conditionals 2024-03-26 01:24:34 +08:00
athenian200 b787af5702 Issue #1638 - Part 1: Put NPAPI code behind MOZ_ENABLE_NPAPI.
Adds --disable-npapi as an additional build option. The default is still to build in NPAPI compatibility, but with this flag, it's finally possible to build without pulling in GTK2 on systems that don't have the package.

This essentially ifdefs everything associated with NPAPI, following various Mozilla removal bugs.

Ref: BZ 1682030, BZ 1251202, BZ 1217665, BZ 1687239
2024-01-10 04:03:35 -06:00
Moonchild 08406731e5 Issue #2346 - Remove MOZ_EME conditional code 2023-10-17 16:37:41 +02:00
Moonchild fcb74a0fb6 Issue #2316 - Part 3: Clarify comment 2023-09-26 15:21:34 +02:00
Moonchild 8b4aae99b4 Issue #2316 - Part 1: Use fallback element sizes for w/h-less SVG
Instead of completely failing the call, use the CSS specified intrinsic
default width/height of 300x150.
2023-09-26 15:15:31 +02:00
Martok 814fa6e3ba Issue #2030 - (chore) refactor event dispatch functions
Based on selected bits of M-C 1461708:
- EventStateManager::CheckForAndDispatchClick() to early-return style
- split EventStateManager::CheckForAndDispatchClick() into:
  EventCausesClickEvents, PostHandleMouseUp, DispatchClickEvents
- Move implementation of UIEvent::GetRangeParent() and UIEvent::RangeOffset() to nsLayoutUtils
2022-11-27 16:35:25 +01:00
Moonchild 9fea63c9d4 Issue #1992 - Part 1: Un-prefix -moz-{min|max}-content keywords. 2022-09-20 20:41:33 +00:00
FranklinDM 121ee9438c Issue #1838 - Part 1: Remove CSS grid preference
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1398492
2022-04-02 23:13:54 +08:00
Moonchild ddaee7c1be Issue #1830 - Remove --disable-xul config and conditionals. 2022-04-01 14:47:16 +02:00
Moonchild 0e6a9cc60a Issue #1705 - Part 3: Rename ScrollbarStyles to ScrollStyles.
ScrollbarStyles contains values of overflow, (over)scroll-behavior, etc.
The only one which is marginally related to scroll _bars_ is overflow, which can
be used to hide scrollbar (by making an element not scrollable) or enforce the
scrollbar to display.

It makes more sense to be called ScrollStyles as it's mainly concerning behavior
of scrolling, not scrollbars. Also, with the addition of scrollbar width
properties, the current name can be confusing.
2021-01-06 16:31:36 +00:00
Moonchild ae2a160348 Issue #1053 - Part 2a: Remove android from /layout (partial)
This removes android code from base, build, forms, generic, inspector, style,
printing, tools and xul.
2020-12-26 10:16:55 +00:00
Moonchild 528b88d704 Issue #1656 - Part 3: Nuke more vim config lines in the tree.
Another S&R run with some smarter matching.
2020-09-23 15:14:30 +00:00
athenian200 6b2c3b61b1 Issue #1641 - Implement CSS flow-root keyword
This is just a clean port of 1322191 and follow-up 1325970. It really seems to add create a new way to access existing code relating to block formatting and floating elements rather than implementing new functionality, and it is mercifully straightforwards.
2020-09-03 18:55:28 -05:00
Andy 232f987cf4 Issue #1619 - Convert Intrinsic Ratio to Float
https://bugzilla.mozilla.org/show_bug.cgi?id=1547792

Aspect Ratio handling simplified by using floating point integers:
- Multiplication of value (or inverse value) to a known side for Scaling
- No unequal equal values such as "4/3" vs "8/6" vs "20/15"
- Truly "Empty" aspect ratios, even if one dimension is not 0
2020-07-31 13:01:18 -07:00
win7-7 f102e7f80d Issue #1355 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList
Also fix build bustage for De-unified layout/xul in nsRootBoxFrame.cpp
2020-05-08 15:20:01 +03:00
Moonchild ad0a976f2d Issue #80 - De-unify layout/base 2020-04-29 12:36:53 +00:00
Matt A. Tobin ee4857f209 Bug 1413619 - Fix insertion point computation when display: contents pseudos are involved.
Tag #1375
2020-04-17 07:20:06 -04:00
Matt A. Tobin 0c99ad16fb Bug 1368547 - Remove nsFrameManagerBase::mPlaceholderMap and instead store the placeholder on a frame property on the out-of-flow
Tag #1375
2020-04-17 06:07:51 -04:00
Matt A. Tobin 7614fdb51b Bug 1355351 - Make pseudo-elements return the correct style via getComputedStyle
* Add a node property to access the ::before and ::after pseudo-elements
* Look for the frame for ::before and ::after pseudos
* Clean up pseudo-element props
* Simplify nsLayoutUtils callers, and make child iterators notice display: contents pseudos

Tag #1375
2020-04-17 05:10:25 -04:00
wolfbeast 793da7dd62 Revert "Issue #1355 - Better way to create display items for column backgrounds"
This reverts commit 44c47c5038.
2020-02-26 20:51:22 +01:00
win7-7 44c47c5038 Issue #1355 - Better way to create display items for column backgrounds
Part 1: Remove current table item, as it's never set.

Part 2: Get rid of generic table painting code, and handle each class separately.

Part 4: Hoist outline skipping into col(group) frame code.

Part 5: Skip box-shadow for table column and column groups.

Part 6: Store column and column group backgrounds separately, and then append them before the rest of the table contents.

Part 7: Pass rects in display list coordinates to AppendBackgroundItemsToTop.

Part 8: Create column and column group background display items as part of the cell's BuildDisplayList.

Part 9: Used cached values instead of calling nsDisplayListBuilder::ToReferenceFrame when possible, since it can be expensive when the requested frame isn't the builder's current frame.

Part 10: Make sure we build display items for table parts where only the normal position is visible, since we may need to create background items for ancestors at that position.

Part 11: Create an AutoBuildingDisplayList when we create background items for table columns and column groups, so that we initialize the invalidation state correctly.
2020-02-25 00:17:54 +02:00
Gaming4JC 8ff295747e Issue #1230 - Part 1: Fix Back-computing percentages for intrinsic sizing in Layout CSS-Grid
List of relevant patches applied:

1398537 part 2 - [css-multicol] Implement percentages for 'column-gap' (Gecko part).

1434478 part 1 - [css-grid] Stop back-computing percentage grid gaps when the percentage basis is indefinite. Treat them as zero sized instead.

1434478 part 2 - Stop back-computing percentage padding/margin when the percentage basis is indefinite. Treat them as zero sized instead.

1434478 part 3 - Remove IntrinsicISizeOffsetData::hPctPadding/hPctMargin members since they are now unused.

1434478 part 4 - Factor out constants like NS_UNCONSTRAINEDSIZE so they can be used in headers without needing nsIFrame.h (idempotent patch).

1434478 part 5 - Create nsLayoutUtils::ResolveToLength for resolving CSS <length-percentage> (idempotent patch).

1434478 part 6 - Propagate a percentage basis to nsIFrame::IntrinsicISizeOffsets for resolving padding/margin.

This is needed only for CSS Grid since in other cases we're only using IntrinsicISizeOffsets in the inline-axis and the percentage basis is always indefinite for *intrinsic sizing*. When calculating the intrinsic size of grid items in the grid container's block axis however, we do have a definite size for the grid area in the inline-axis and it should be used per: https://drafts.csswg.org/css-grid/#algo-overview "2. Next, the track sizing algorithm resolves the sizes of the grid rows, using the grid column sizes calculated in the previous step." (Percentage padding/margin for grid items is always resolved against the grid area's inline-size nowadays.)
2019-09-28 23:47:05 -04:00
win7-7 00812e30df Attach FrameProperties to each frame instead of using a shared hashtable
Dispense the shared hashtable and instead attach the frame property list directly to nsIFrame.
2019-06-26 01:51:45 +03:00
wolfbeast f47d45be4b Revert "Improve origin-clean algorithm"
This reverts commit e69b3f567c.
2019-06-04 23:58:47 +02:00
wolfbeast fb1b45e5fc Improve origin-clean algorithm 2019-05-27 19:19:27 +02:00
wolfbeast 3029dee77b Add nullcheck for frames in FindNearestCommonAncestorFrame
This resolves #978.
2019-02-18 22:24:29 +01:00
yami b241a84d88 issue #908 - implement missing parts of CSS mask 2019-02-02 18:06:10 +01:00
adeshkp 5335681cd2 Telemetry: Remove stubs and related code 2019-01-12 06:20:31 -05:00
wolfbeast 81b341a9b3 Clean up a number of unused variables.
Tag #21.
2018-09-29 23:20:36 +02:00
wolfbeast ab961aeb54 Remove all C++ Telemetry Accumulation calls.
This creates a number of stubs and leaves some surrounding code that may be irrelevant (eg. recorded time stamps, status variables).
Stub resolution/removal should be a follow-up to this.
2018-09-03 10:11:38 +02:00
janekptacijarabaci 71a1c47759 Fix Build Bustage - with "--enable-debug" 2018-07-12 12:34:59 +02:00