Commit graph

25943 commits

Author SHA1 Message Date
atbrakhi
01b30e1552
Cleanup: rename to top_level_browsing_context_id for consistency (#30663)
* rename to top_level_browsing_context_id for consistency

* fmt
2023-11-01 20:00:55 +00:00
Martin Robinson
27527142bd
Update rust version to "nightly-2023-03-18" (#30630)
This is necessary to update the network stack.
2023-11-01 13:28:26 +00:00
Varun Dhand
364d11f15f
Update textinput.rs (#30643) 2023-11-01 13:27:32 +00:00
Martin Robinson
6c4f098d41
Add better support for line breaking across inline box boundaries (#30628)
Earlier versions of inline layout in the new layout system did not
properly support line breaking when unbreakable segments spanned
multiple inline boxes. This change updates inline layout to add support
for that. Now items are added to an unbreakable segment before being
committed to a line.

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2023-11-01 13:27:14 +00:00
Ennui Langeweile
a6ceca6d9f
Clean up a bit of the canvas backend abstractions (#30637)
* Clean up a bit of the canvas backend abstractions

* Remove unused import
Sneaky, sneaky little hecker
2023-10-27 23:06:43 +00:00
Reid Swan
e4fc4fa3f5
Replace the time crate with std::time in components/compositing (#30613)
* Replace the time crate with std::time in components/compositing

Signed-off-by: Reid Swan <reidswan@outlook.com>

* Remove elapsed_since_epoch function

---------

Signed-off-by: Reid Swan <reidswan@outlook.com>
2023-10-26 14:14:43 +00:00
Ennui Langeweile
26a3dffd95
Clean up and merge some canvas-related WebIDLs (#30606)
* Clean up and merge some canvas-related WebIDLs

* Apply `./mach fmt`

* WebIDL has `test-tidy` support???
2023-10-26 12:45:53 +00:00
Delan Azabani
a3d2f0c586
Enable debug assertions for all builds other than official releases (#30509)
* Run main and try jobs with debug assertions

* use single quotes in workflow expressions

* set force-debug-assertions in main.yml

* set force-debug-assertions as part of decision job

* fix typo in MachCommands.build

* fix more hardcoded profile names

* fix tidy

* split cargo_profile_option on windows

* Fix running servoshell and unit tests through a symlink

* rename steps to make them less confusing

* fix more hardcoded cargo profile options

* fix missing inputs in linux-wpt and mac-wpt

* make filename an inherent method of Resource

* rework release-with-debug-assertions profile to production profile

* rework resource logic to eliminate std_test_override

* set production flag in nightly release builds

* clean up servobuild.example and windows.yml

* oops forgot to check in embedder_traits/build.rs

* fix mach test-unit behaviour through symlink

* unit tests only need current_dir and ancestors

* fix macOS package smoketest breakage

* expect css/css-color/currentcolor-003 to crash under layout 2013

* fix more references to {force,release-with}-debug-assertions

* fix local build failures under --profile production
2023-10-26 08:22:14 +00:00
Martin Robinson
95e32f8372
Make LineItems a token stream on the root (#30608)
Flattening the LineItem tree into a token stream will allow for handling
the case where an unbreakable line segment spans multiple inline boxes
which might have different hierarchies. This change also fixes the
handling of the second anonymous fragment of a block-in-inline-split.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2023-10-25 15:54:44 +00:00
Oriol Brufau
111716d458
Stop transitioning properties with a discrete animation type (#30565)
They are not transitionable:
https://drafts.csswg.org/css-transitions-1/#transitionable

There are some new failures in background-image-interpolation.html,
but I think the test is wrong, because it expects background-image
to be transitionable, even though the spec defines it with a discrete
animation type.
2023-10-20 12:55:33 +00:00
Oriol Brufau
9af3495d8a
Consider trailing_whitespace_advance when calling place_line_among_floats() (#30586)
After placing a float, FloatBox's layout_into_line_items() was calling
place_line_among_floats() with ifc.current_line.inline_position as the
width of needed by the contents of the line.

The problem is that this amount includes the trailing whitespace advance
and thus it could seem that the in-flow contents wouldn't fit next to
the float.

That's not the case, since collapsible whitespace at the end of the line
is removed, and preserved whitespace hangs.

So this patch subtracts ifc.current_line.trailing_whitespace_advance
when calling place_line_among_floats(), like it was already happening
when computing the available_inline_size.

Fixes #30561
2023-10-20 11:47:23 +00:00
Delan Azabani
e95de5d858
Temporarily convert more cfg(debug_assertions) crashes to warnings (#30590) 2023-10-20 10:19:41 +00:00
Martin Robinson
d7207122c0
Don't panic when no font is found for a TextRun (#30581)
Instead of panicking when no found is found for a TextRun, instead print
a warning. This prevents panics on pages with very large font sizes.
2023-10-19 16:59:54 +00:00
Martin Robinson
fd31da9102
Anonymous boxes that wrap inlines should not inherit overflow (#30579)
In legacy layout, anonymous text wrappers were inheriting the `overflow`
and `text-overflow` properties. This results in the creation of extra
clipping for these anonymous wrappers which could clip away floats. We
will likely implement `text-overflow` differently in non-legacy layout.

This change marks all legacy layout pseudo elements as "legacy" and also
adds a new pseudo element for non-legacy layout that does not inherit
`overflow`.

Fixes #30562.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2023-10-19 13:43:55 +00:00
Ennui Langeweile
2d7dfb06c0
Use IpcSharedMemory for Canvas2dMsg::DrawImage (#30544)
* Use `IpcSharedMemory` for `Canvas2DMsg::DrawImage`

* Fix `Canvas2dMsg::DrawEmptyImage` crashes

* Do not premultiply canvas image data

* Move `image_data` back to its original position
2023-10-18 13:39:58 +00:00
Delan Azabani
66258bfbbd
Temporarily convert existing cfg(debug_assertions) crashes to warnings (#30578) 2023-10-18 13:16:11 +00:00
Delan Azabani
351b5036bf
Fix running servoshell and unit tests through a symlink (#30537)
* Fix running servoshell and unit tests through a symlink

* make filename an inherent method of Resource

* fix mach test-unit behaviour through symlink

* unit tests only need current_dir and ancestors

* fix macOS package smoketest breakage
2023-10-18 10:33:51 +00:00
Martin Robinson
8a12b4c957
Improve line box block size calculation (#30519)
Improve the calculation of the block size of line boxes and all their
component elements. Even empty spans can increase the size of the line
based on their font-size. Elements that have a line-height should
increase the block size of the line, but that setting should not effect
their own size.

In addition to the new passes there are some new failures

Failing because a progression exposes the real issue these tests are
testing:

- css/css-color/t32-opacity-offscreen-multiple-boxes-1-c.xht
- css/css-color/t32-opacity-offscreen-multiple-boxes-2-c.xht

Likely failing because of vertical-align and another sizing issue:

- css/css-transforms/perspective-untransformable-no-stacking-context.html

Failing because a progression reveals another failure:

 - html/rendering/non-replaced-elements/hidden-elements.html

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2023-10-18 09:35:19 +00:00
Martin Robinson
2c341d9e69
Allow raising FloatContext ceiling after processing box with overflow (#30539)
When a box has overflow, any floats placed in that box will lower the
float ceiling into the overflow. If no float is placed in the box
though, the ceiling should be the block position where the overflow
starts. We already know where this is, because we might be passing a
negative value for the new block position after processing a box
(content_size - actual_size would be negative). This negative value
never raises the ceiling though since a maximum is used.

In the case that there is overflow, this change allows raising the
ceiling, but never passed the lowest float. This necessitates keeping
two values for the ceiling: one for floats and one for non-floats.

Fixes #30304.
2023-10-17 07:53:57 +00:00
Ngo Iok Ui (Wu Yu Wei)
a2f8dcfb8a
Add documentation to a few pref configs (#30548)
* Add documentation to a few pref configs

* Update components/config/prefs.rs

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-10-16 13:07:41 +00:00
Ennui Langeweile
84dd447d9d
Fix filter clipping caused by overflow: hidden (#30517)
* Partially fix filter clipping

* Clean up the logic

* Update components/layout_2020/display_list/stacking_context.rs

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-10-09 12:51:51 +00:00
Delan Azabani
afe4faa09a
Fix painting order of atomic inline stacking containers (#30458)
* Sort stacking contexts and stacking containers by painting order

* fix stealing of stacking containers; fix interleaving with fragments

* actually positioned stacking containers should be stolen too

* update expectations and clean up panic changes

* rework naming and docs

* rename s_c_a_p_s_c to real_s_c_a_p_s_c; fix docs

* rename InlineStackingContainer to AtomicInlineStackingContainer

* rework debug logging to use PrintTree

* clean up docs and PrintTree output

* don't panic unless cfg!(debug_assertions) is true

* update expectations
2023-10-06 16:00:00 +00:00
Samson
92defbb4ef
Enable streams feature in mozjs (#30503)
* Update mozjs

* Enable streams feature

* Switch to servo/mozjs
2023-10-06 00:51:23 +00:00
Martin Robinson
28315ba48a
Rename messages forwarded from the constellation to the compositor (#30496)
The constellation forwards messages from other tasks to the compositor.
Mainly, these are passed to WebRender. This change updates the names of
these messages so it is clearer where they are coming from and where
they are going.
2023-10-05 16:40:44 +00:00
Martin Robinson
ce183d8581
Only access hit test items for the current epoch in the compositor (#30491)
When display lists update quickly, a hit test result might be returned
for a previous display list / list of hit test items. When that happens,
ignore the hit test result.

This fixes a crash, but there might be situations where we can do
something better, such as wait for display list processing to finish
before performing the hit test. A future change might do this for events
like mouse clicks and touch events that should never be thrown away.
Ultimately, the best thing is likely moving hit testing back to layout
or script so a valid hit test can always be performed against the
current DOM.

Fixes #29796.
2023-10-04 16:33:18 +00:00
Ngo Iok Ui (Wu Yu Wei)
38a325cc1c
Add shell.background-color.rgba to prefs (#30488)
* Add shell.transparent-background.enabled to prefs

* Rename config to background_color

* Rename to background-color and.rgba add PrefValue::Array variant
2023-10-04 13:16:16 +00:00
Ennui Langeweile
f7c340f881
Implement support for the drop-shadow filter (#30439)
* Implement support for `drop-shadow`

* Clean up remnant from early attempts

* Fix misleading comments on GenericSimpleShadow
If Servo-specific `style` changes will need to be upstreamed anyway, I might as well fix a thing that had thrown me off!

* Revert "Fix misleading comments on GenericSimpleShadow"

This reverts commit cdc810b826ac082041adc212c24649ee3b86ca0a.

* Clean up an import

* Update test expectations

* Fix missing expectation on Layout 2013
2023-10-04 11:32:45 +00:00
Samson
8436002383
Support Namespace const in webidl (#30492)
* Add TestNS with const

* Implement namespace const in codegen
2023-10-04 11:29:54 +00:00
Ngo Iok Ui (Wu Yu Wei)
a31e2ea576
Fix macOS's sameple isn't used in background_hang_monitor (#30490) 2023-10-04 06:59:45 +00:00
Samson
bd9c17234c
fix handle_wgpu_msg crash (#30479)
* Enter realm before handle_wgpu_msg

fix https://github.com/servo/servo/issues/30419

* Update expectations
2023-10-03 15:16:42 +00:00
Martin Robinson
dfd14aabef
Fix pinch zoom and enable it for TouchpadMagnify events (#30459)
Pinch zoom was broken because pinch zoom events were triggered at -1, -1
in the compositor. This change:

1. Differentiates between magnify and scroll events in the compositor to
   remove the question of where to trigger them.
2. Converts winit TouchpadMagnify events into pinch zoom events so that
   this works properly on MacOS.
2023-10-03 12:49:36 +00:00
Oriol Brufau
601de9049c Further changes required by Servo 2023-10-02 14:37:19 +00:00
Jonathan Kew
2fb319ede2 style: Implement CSS @supports font-format(...) and font-tech(...) functions
These are gated by the same layout.css.font-tech.enabled pref as the
closely-related `tech()` function for the @font-face src descriptor;
once the spec questions are settled, we should enable them all together.

Differential Revision: https://phabricator.services.mozilla.com/D155359
2023-10-02 14:37:19 +00:00
Oriol Brufau
6f2861e466 Further changes required by Servo 2023-10-02 14:37:19 +00:00
Jonathan Kew
0cdf97c881 style: Put the @font-face src tech() function behind a pref, enabled only on Nightly for now
There are a couple of current issues/discussions that may lead to a change in the set of supported keywords, so we may want to hold back a little on actually shipping this.

- In https://github.com/w3c/IFT/pull/113, the WebFonts WG proposes several new incremental-* keywords (and maybe implies dropping the currently-defined incremental?)

- In https://github.com/w3c/csswg-drafts/issues/7633, I just proposed renaming the feature-* keywords to features-* (plural) for better readability; I'd like to see a decision on that before we ship this to release.

Differential Revision: https://phabricator.services.mozilla.com/D155458
2023-10-02 14:37:19 +00:00
Connor Pearson
c8e3dc4d19 style: When serializing background shorthand skip initial values and order values according to grammar
Differential Revision: https://phabricator.services.mozilla.com/D155077
2023-10-02 14:37:19 +00:00
Oriol Brufau
76192031d3 Further changes required by Servo 2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
cc09c2ffb1 style: Add basic support for nan / infinity in calc()
Fix some tests to:

  * Not assume `double` precision.
  * Account for recent working group resolution with regards to NaN: https://github.com/w3c/csswg-drafts/issues/7067#issuecomment-1111211295

Not sure I caught all, but normalizing to 0 was already our existing
behavior. This feature needs more work before it can be enabled more
generally, so make it nightly-only, for now.

Also, it's unclear per spec what the serialization for infinity*1s or so
should be. Right now we serialize to <very-big-number>s, which seems
reasonable, but some tests (but not others!) expect different behavior.

I left those untouched for now.

Differential Revision: https://phabricator.services.mozilla.com/D154883
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
dd849de9d9 style: Implement atan2(), and enable calc() trigonometric functions by default on nightly
We now have test coverage, so let's do this.

The remaining failures are just about infinity/nan, which is a
completely different feature.

Differential Revision: https://phabricator.services.mozilla.com/D154831
2023-10-02 14:37:19 +00:00
Oriol Brufau
03e84754cc Further changes required by Servo 2023-10-02 14:37:19 +00:00
Jonathan Kew
fa8b5f17e3 style: Add support for the @font-face src descriptor's tech() function
WPT tests to be added in a following patch.

Differential Revision: https://phabricator.services.mozilla.com/D154399
2023-10-02 14:37:19 +00:00
Jonathan Kew
52d1e07ee2 style: Use the style-system format hint directly in gfx, instead of mapping to a separate internal enum
Now that the style system has keywords for this, we don't need to define them in gfx
but can just use the enum directly. (No functional change, just code simplification.)

Depends on D154237

Differential Revision: https://phabricator.services.mozilla.com/D154238
2023-10-02 14:37:19 +00:00
Oriol Brufau
87bee1710c Further changes required by Servo 2023-10-02 14:37:19 +00:00
Jonathan Kew
31b2a54164 style: Accept keywords in addition to strings in the @font-face format() hint function
The CSS Fonts 4 spec requires this, and Safari (at least) has long supported it.

Depends on D154277

Differential Revision: https://phabricator.services.mozilla.com/D154237
2023-10-02 14:37:19 +00:00
Jonathan Kew
65e6e072ea style: Do not allow a list of strings in the @font-face src descriptor's format() function, only a single format string
This aligns with CSS Fonts 4 (rather than Fonts 3) and with behavior in other browsers;
I don't expect any significant breakage, given that specifying multiple format strings
was never supported in other engines AFAIK, and never served any useful purpose.

Depends on D154234

Differential Revision: https://phabricator.services.mozilla.com/D154235
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
b43ac59344 style: Don't use -moz-bool-pref for flexbox -moz-box emulation
Use a bool pref media query which allows dynamic changes to get
reflected instantly.

Differential Revision: https://phabricator.services.mozilla.com/D154449
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
648a6c14cf style: Add a chrome-only -moz-box-layout: legacy | flex, and use that to implement flexbox emulation
Differential Revision: https://phabricator.services.mozilla.com/D154153
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
4947dd027d style: Remove -moz-* display values enabled-in-content prefs
We have unshipped these since forever, no point in keeping the pref
around. Move the relevant tests to chrome ref/mochitests.

Differential Revision: https://phabricator.services.mozilla.com/D154152
2023-10-02 14:37:19 +00:00
Boris Chiou
deeb5efd84 style: Remove aspect-ratio preference
We shipped this in Firefox 89, one year ago. It should be okay to drop
this preference now.

Differential Revision: https://phabricator.services.mozilla.com/D153680
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
befb407057 style: Make color-scheme affect Windows' non-native menus
This matches what Linux and macOS do, and that allows the fix for bug 1782623
to work on Windows for unstyled selects.

This also simplifies the CSS (though it adds a new system color which is a bit
more annoying). I filed https://github.com/w3c/csswg-drafts/issues/7561 to
propose adding a more generic way to do this in the future (not just for
Firefox).

Differential Revision: https://phabricator.services.mozilla.com/D153549
2023-10-02 14:37:19 +00:00