| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of the tricky `LayoutRPC` interface, query layout using the
`Layout` trait. This means that now queries will requires calling layout
and then running the query. During layout an enum is used to indicate
what kind of layout is necessary.
This change also removes the mutex-locked `rw_data` from both layout
threads. It's no longer necessary since layout runs synchronously. The
one downside here is that for resolved style queries, we now have to
create two StyleContexts. One for layout and one for the query itself.
The creation of this context should not be very expensive though.
`LayoutRPC` used to be necessary because layout used to run
asynchronously from script, but that no longer happens. With this
change, it becomes possible to safely pass nodes to layout from script
-- a cleanup that can happen in a followup change.
|
|
|
| |
It was being treated like `pre`, but it allows wrapping lines.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* change ResolvedMargins to use Au instead of length
* made suggested changes
removed whitespace changes
made suggested changes
* Update components/layout_2020/flexbox/layout.rs
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Update components/layout_2020/flow/mod.rs
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* fixed errors
fixed errors
fixed formatting
fixed errors
* modified changes
made suggested changes
* Update components/layout_2020/fragment_tree/fragment.rs
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
updated components/layout_2020/fragment_tree/fragment.rs
* Update components/layout_2020/flow/mod.rs
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* Update components/layout_2020/flow/mod.rs
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
* updated changes
updated changes
* unified all the suggested changes here
* fixed formatting
* reverted unnecessary changes
* fixed unnecessary warnings
---------
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Ignore spaces before atomic inline for the min-content size
For the min-content size we should wrap lines wherever is possible,
so wrappable spaces shouldn't increase the length of the line,
they will just be removed or hang at the end of the line.
* Add a clarifying comment
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
---------
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
| |
This requires passing through information about whether or not the
element in question is replaced when checking to see if it's
transformable and transitively all functions that make decisions about
containing blocks. A new FragmentFlag is added to help track this -- it
will be set on both the replaced items BoxFragment container as well as
the Fragment for the replaced item itself.
Fixes #31806.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix table with rows but no column
We weren't generating any fragment for the rows, which meant that JS
APIs like clientWidth would be 0, and also outlines weren't painted.
This aligns Servo with Blink and WebKit. Gecko is broken, it distributes
twice the table height among the rows.
* Feedback
* Avoid conflict with #31874
|
|
|
|
|
|
|
| |
The old logic was always picking the last baseline, but this should only
happen for inline-blocks.
Since replaced elements and flex containers aren't currently setting
their baselines, this is only an improvement for inline-tables.
|
|
|
|
|
|
|
|
| |
Gecko, Blink and WebKit agree that the if a row only has empty cells,
its baseline should be at the bottom, not at the top.
There isn't interoperability when the cells are just empty-ish, so this
patch takes the simplest approach, aligning with Blink: any out-of-flow
or in-flow content other than collapsed whitespace counts as not empty.
|
| |
|
|
|
|
|
| |
* use au in BoxFragement
* review fix
|
|
|
|
|
|
| |
This change makes it so that when calculating the space added between
words for justification, text-indent is taken into account.
Fixes #31775.
|
|
|
|
|
|
| |
A sequence of whitespace shouldn't generate an anonymous table row/cell,
but we can't just throw away the leading whitespace, because afterwards
we may encounter some other content, and then the leading whitespace
should appear in the cell (noticeable with e.g. `white-space: pre`).
|
|
|
|
|
| |
* fix: fixed rustdoc warnings caused by private intra-doc links
* fix: fixed private link warning by allowing private intra doc links
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is now platform-specific way to get metrics for `line-through` on
MacOS and currently striking through simply does not work. The correct
approach here is likely to first search for these metrics in font tables
and then falling back to deriving them. Searching the font tables is a
larger change, so this change adds the fallback mechanism first. This at
least makes sure that strike through renders at all on Mac.
In a followup change we can add support for getting metrics via HarfBuzz
in a platform-independent way, which is what Gecko does.
Fixes #942.
|
|
|
|
| |
`text-shadow` is enabled for legacy layout, so this just extends support
to the modern layout system.
|
| |
|
|
|
| |
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Update Stylo to 2023-09-01
* Fixup for https://phabricator.services.mozilla.com/D184929
* Fixup for https://phabricator.services.mozilla.com/D184526
* Fixup for https://phabricator.services.mozilla.com/D184525
* Fixup for https://phabricator.services.mozilla.com/D185154
* Fixup for https://phabricator.services.mozilla.com/D184685
* Fixup for https://phabricator.services.mozilla.com/D185916
* Fixup for https://phabricator.services.mozilla.com/D185492
* Fixup for https://phabricator.services.mozilla.com/D186626
* Update test expectations
|
|
|
| |
Signed-off-by: RustAndMetal <111676747+RustAndMetal@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix BoxFragment reference.
Signed-off-by: Rhea Karty <rheakarty@gmail.com>
* Fix reference to InlineFormattingContext.
Signed-off-by: Rhea Karty <rheakarty@gmail.com>
* Rewrap lines to avoid long length
* Remove trailing whitesapce
---------
Signed-off-by: Rhea Karty <rheakarty@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
| |
|
|
|
|
|
|
| |
This adds basic support for `getClientRects()` by sharing code with the
implementation of `getBoundingClientRect()`. In addition to sharing
code, it also shares all of the bugs. Primarily, scrolilng positions are
not taken into account when return boundary rectangles.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fixed warnings in components/gfx/text/shaping/harfbuzz-rs components/layout_2020/fragment_tree ports/servoshell/minibrowser.rs
* Fixed warnings in components/gfx/text/shaping/harfbuzz-rs components/layout_2020/fragment_tree ports/servoshell/minibrowser.rs.
* Update minibrowser.rs
Returned "if" back to "iff"
* Update minibrowser.rs
Changed ```BrowserManager``` to ```WebViewManager```
* Update fragment.rs
Changed ```[SequentialLayoutState]``` to ```[crate::flow::float::SequentialLayoutState]```
* Update fragment.rs
Balanced the length of paragraph lines in fragment.rs
* Fix tidy errors
---------
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
|
|
|
|
|
| |
* Allow pre-wrap whitespace to hang at the end of the line
* Use bitflags
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old logic was assuming that all whitespace was a break opportunity,
and that no newlines would be preserved.
Note that text shaping considers the advance of a newline to be the same
as a space. This was problematic because if we have a segment with a
preserved space and newline, only the advance of the space should
contrinute to the size of the block container. Therefore, I'm changing
the breaker logic in other to have newline characters in their own
segment.
Then glyph_run_is_whitespace_ending_with_preserved_newline can just be
renamed to glyph_run_is_preserved_newline.
This patch is still not perfect because it doesn't check allow_wrap(),
so `nowrap` is treated like `normal`, and `pre-wrap` like `pre`.
|
|
|
|
|
|
|
|
|
| |
This brings the version of WebRender used in Servo up-to-date with Gecko
upstream. The big change here is that HiDPI is no longer handled via
WebRender. Instead this happens via a scale applied to the root layer in
the compositor. In addition to this change, various changes are made to
Servo to adapt to the new WebRender API.
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
|
|
|
|
|
|
|
|
| |
Put table cell content fragments into a hieararchy of fragments that
include their table row and table row group fragments. This ensures that
things like relative positioning and transforms set on rows and row
groups properly affect cells and cell content.
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
| |
This avoids inserting it outside of its parent.
|
|
|
|
|
|
|
| |
Marking all IFCs as containing floats shouldn't change layout results,
but does prevent parallel layout in some cases. This change fixes an
issue where we were marking all IFCs as containing floats.
Fixes #31540.
|
|
|
|
| |
So that the table appears after preceding inline-level contents.
Fixes #31603.
|
|
|
|
|
| |
* Added a : to make it a clickable link
* changed block_offset_of_parent to parent_offset , to make it a clickable link.
|
|
|
|
|
| |
* Changed LineItems to LineItem to make it a clickable link
* No variant named Anonymous is present in Fragment.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the root of an inline formatting context, we used its vertical-align
in order to compute the strut. That was wrong, since vertical-align
on a block container shouldn't affect the contents, it should only
affect the alignment of the block container (if it's inline-level)
within the parent IFC.
This was only working well if the block container was block-level, since
effective_vertical_align_for_inline_layout returned `baseline` for
block-level boxes.
Instead of the outer display type, this patch changes the logic to check
whether we are at the root of the IFC.
|
|
|
|
|
|
|
| |
The specification gives instructions for how these values should be
propagated. The other big changs here is that they aren't applied to the
`<body>`.
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
* make margin in pbm use app unit
* Simplification
* Consistently resolve inline margins as Au, like block margins
---------
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
|
| |
|
|
|
|
|
| |
* clippy: fix warnings in components/layout_2020
* fix: review comments
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`repeating-conical-gradient` (#31597)
This also ignores a clippy warning for a new function (and a similar
existing one), until this code can be refactored to use temporary Rust
strutures to carry display list building state.
There are a few new test failures here:
- FAIL [expected PASS] /css/css-images/image-set/image-set-conic-gradient-rendering.html
- FAIL [expected PASS] /css/css-images/image-set/image-set-repeating-conic-gradient-rendering.html
These fail because Servo does not yet support `image-set()`.
- FAIL [expected PASS] /css/filter-effects/filter-function/filter-function-conic-gradient.html
- FAIL [expected PASS] /css/filter-effects/filter-function/filter-function-repeating-conic-gradient.html
These fail because Servo does not support the very early filter effects
specification.
- FAIL [expected PASS] /html/canvas/element/manual/fill-and-stroke-styles/conic-gradient-rotation.html
- FAIL [expected PASS] /html/canvas/element/manual/fill-and-stroke-styles/conic-gradient.html
These fail because this change only adds support for CSS conical
gradients. Another set of changes will be necessary to support this for
Canvas.
|
|
|
|
|
|
| |
They were only considered in min-content sizes.
Also avoid some pointless conversions from Au to Length.
Fixes #31605.
|
| |
|
|
|
|
|
|
|
| |
This doesn't really have observable behavior right now, as much as I
tried to trigger some kind of bug. On the other hand, it's just wrong
and is very obvious when you dump the Fragment tree. If you create a
`display: table-cell` that is a child of the `<body>` all parts of the
anonymous table are flagged as if they are the `<body>` element.
|
|
|
| |
Signed-off-by: Wepngong Maureen <maureenwepngong@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fixed typo in PositioningContext
Signed-off-by: Wepngong Maureen <maureenwepngong@gmail.com>
* fixed unresolved link to unresolved link to adjust_static_position_of_hoisted_fragments function
Signed-off-by: Wepngong Maureen <maureenwepngong@gmail.com>
* fixed unresolved link to unresolved link to len() function of PositioningContext
Signed-off-by: Wepngong Maureen <maureenwepngong@gmail.com>
---------
Signed-off-by: Wepngong Maureen <maureenwepngong@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix rustdoc warnings in components/layout_2020
Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
* made suggested changes
Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
---------
Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
Co-authored-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
|
|
|
| |
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
|
|
|
| |
Instead of assuming `box-sizing: content-box`.
|
|
|
|
|
|
|
| |
Anonymous tables should not use legacy pseudos, as the legacy layout
engine had them inherit lots of random properites that lead to bad
layout in the new layout engine.
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
|
| |
|
|
|
| |
And remove the pref `layout.tables.enabled`.
|
|
|
| |
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
|