mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Upgrade Stylo to 2025-02-03 (#35289)
* Upgrade Stylo to 2025-02-03 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D233218 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D233758 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Fixup for https://phabricator.services.mozilla.com/D231255 Signed-off-by: Oriol Brufau <obrufau@igalia.com> * Update test expectations Signed-off-by: Oriol Brufau <obrufau@igalia.com> --------- Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
e2bb772669
commit
fdbfecf7dd
16 changed files with 44 additions and 197 deletions
|
@ -106,7 +106,7 @@ fn convert_gradient_stops(
|
|||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
assert!(stop_items.len() >= 2);
|
||||
assert!(!stop_items.is_empty());
|
||||
|
||||
// Run the algorithm from
|
||||
// https://drafts.csswg.org/css-images-3/#color-stop-syntax
|
||||
|
@ -198,6 +198,9 @@ fn convert_gradient_stops(
|
|||
color: style.resolve_color(stop.color).to_layout(),
|
||||
})
|
||||
}
|
||||
if stop_items.len() == 1 {
|
||||
stops.push(stops.stops()[0])
|
||||
}
|
||||
stops
|
||||
}
|
||||
|
||||
|
|
|
@ -408,7 +408,7 @@ fn gradient_items_to_color_stops(
|
|||
|
||||
/// <https://drafts.csswg.org/css-images-4/#color-stop-fixup>
|
||||
fn fixup_stops(stops: &mut [ColorStop<ColorF, f32>]) -> Vec<wr::GradientStop> {
|
||||
assert!(stops.len() >= 2);
|
||||
assert!(!stops.is_empty());
|
||||
|
||||
// https://drafts.csswg.org/css-images-4/#color-stop-fixup
|
||||
if let first_position @ None = &mut stops.first_mut().unwrap().position {
|
||||
|
@ -438,6 +438,9 @@ fn fixup_stops(stops: &mut [ColorStop<ColorF, f32>]) -> Vec<wr::GradientStop> {
|
|||
offset: first_stop_position,
|
||||
color: first.color,
|
||||
});
|
||||
if stops.len() == 1 {
|
||||
wr_stops.push(wr_stops[0]);
|
||||
}
|
||||
|
||||
let mut last_positioned_stop_index = 0;
|
||||
let mut last_positioned_stop_position = first_stop_position;
|
||||
|
|
|
@ -7,6 +7,7 @@ use bitflags::bitflags;
|
|||
use fonts::{FontMetrics, GlyphStore};
|
||||
use itertools::Either;
|
||||
use servo_arc::Arc;
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::computed_values::white_space_collapse::T as WhiteSpaceCollapse;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::generics::box_::{GenericVerticalAlign, VerticalAlignKeyword};
|
||||
|
@ -419,7 +420,7 @@ impl LineItemLayout<'_, '_> {
|
|||
// Relative adjustment should not affect the rest of line layout, so we can
|
||||
// do it right before creating the Fragment.
|
||||
let style = &inline_box.style;
|
||||
if style.clone_position().is_relative() {
|
||||
if style.get_box().position == Position::Relative {
|
||||
content_rect.start_corner += relative_adjustement(style, self.layout.containing_block);
|
||||
}
|
||||
|
||||
|
@ -598,7 +599,7 @@ impl LineItemLayout<'_, '_> {
|
|||
padding_border_margin_sides.block_start,
|
||||
};
|
||||
|
||||
if atomic.fragment.style.clone_position().is_relative() {
|
||||
if atomic.fragment.style.get_box().position == Position::Relative {
|
||||
atomic_offset +=
|
||||
relative_adjustement(&atomic.fragment.style, self.layout.containing_block);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ use style::selector_parser::{
|
|||
SelectorImpl,
|
||||
};
|
||||
use style::shared_lock::Locked as StyleLocked;
|
||||
use style::stylesheets::scope_rule::ImplicitScopeRoot;
|
||||
use style::values::computed::Display;
|
||||
use style::values::{AtomIdent, AtomString};
|
||||
use style::CaseSensitivityExt;
|
||||
|
@ -498,16 +499,22 @@ impl<'dom> style::dom::TElement for ServoLayoutElement<'dom> {
|
|||
{
|
||||
}
|
||||
|
||||
/// Convert an opaque element back into the element.
|
||||
fn unopaque(opaque: ::selectors::OpaqueElement) -> Self {
|
||||
unsafe {
|
||||
let ptr = opaque.as_const_ptr::<JSObject>();
|
||||
/// Returns the implicit scope root for given sheet index and host.
|
||||
fn implicit_scope_for_sheet_in_shadow_root(
|
||||
opaque_host: ::selectors::OpaqueElement,
|
||||
sheet_index: usize,
|
||||
) -> Option<ImplicitScopeRoot> {
|
||||
// As long as this "unopaqued" element does not escape this function, we're not leaking
|
||||
// potentially-mutable elements from opaque elements.
|
||||
let host = unsafe {
|
||||
let ptr = opaque_host.as_const_ptr::<JSObject>();
|
||||
let untrusted_address = UntrustedNodeAddress::from_id(ptr as usize);
|
||||
let node = Node::from_untrusted_node_address(untrusted_address);
|
||||
let trusted_address = node.to_trusted_node_address();
|
||||
let servo_layout_node = ServoLayoutNode::new(&trusted_address);
|
||||
servo_layout_node.as_element().unwrap()
|
||||
}
|
||||
};
|
||||
host.shadow_root()?.implicit_scope_for_sheet(sheet_index)
|
||||
}
|
||||
|
||||
fn slotted_nodes(&self) -> &[Self::ConcreteNode] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue