mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update Stylo to 2023-10-16 (#31932)
* Update Stylo to 2023-10-16 * Fixup for https://phabricator.services.mozilla.com/D185154 * Fixup for https://phabricator.services.mozilla.com/D188216 * Fixup for https://phabricator.services.mozilla.com/D185677 * Fixup for https://phabricator.services.mozilla.com/D188566 * Fixup for https://phabricator.services.mozilla.com/D188727 * Fixup for https://phabricator.services.mozilla.com/D189475 * Fixup for https://phabricator.services.mozilla.com/D189521 * Fixup for https://phabricator.services.mozilla.com/D188812 * Fixup for https://phabricator.services.mozilla.com/D189484 * Update test expectations
This commit is contained in:
parent
a7ad92d9a3
commit
fff9ef87e6
48 changed files with 97 additions and 181 deletions
|
@ -12,7 +12,7 @@ use canvas_traits::canvas::{
|
|||
FillRule, LineCapStyle, LineJoinStyle, LinearGradientStyle, RadialGradientStyle,
|
||||
RepetitionStyle, TextAlign, TextBaseline,
|
||||
};
|
||||
use cssparser::{Parser, ParserInput, RgbaLegacy};
|
||||
use cssparser::{Parser, ParserInput};
|
||||
use euclid::default::{Point2D, Rect, Size2D, Transform2D};
|
||||
use euclid::vec2;
|
||||
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
|
||||
|
@ -22,6 +22,7 @@ use pixels::PixelFormat;
|
|||
use profile_traits::ipc as profiled_ipc;
|
||||
use script_traits::ScriptMsg;
|
||||
use servo_url::{ImmutableOrigin, ServoUrl};
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
use style::color::{AbsoluteColor, ColorSpace};
|
||||
use style::context::QuirksMode;
|
||||
use style::parser::ParserContext;
|
||||
|
|
|
@ -628,7 +628,7 @@ pub trait LayoutElementHelpers<'dom> {
|
|||
fn get_lang_for_layout(self) -> String;
|
||||
fn get_state_for_layout(self) -> ElementState;
|
||||
fn insert_selector_flags(self, flags: ElementSelectorFlags);
|
||||
fn has_selector_flags(self, flags: ElementSelectorFlags) -> bool;
|
||||
fn get_selector_flags(self) -> ElementSelectorFlags;
|
||||
/// The shadow root this element is a host of.
|
||||
fn get_shadow_root_for_layout(self) -> Option<LayoutDom<'dom, ShadowRoot>>;
|
||||
fn get_attr_for_layout(
|
||||
|
@ -708,7 +708,7 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> {
|
|||
};
|
||||
|
||||
if let Some(color) = bgcolor {
|
||||
use cssparser::FromParsedColor;
|
||||
use style::color::parsing::FromParsedColor;
|
||||
hints.push(from_declaration(
|
||||
shared_lock,
|
||||
PropertyDeclaration::BackgroundColor(specified::Color::from_rgba(
|
||||
|
@ -748,7 +748,7 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> {
|
|||
};
|
||||
|
||||
if let Some(color) = color {
|
||||
use cssparser::FromParsedColor;
|
||||
use style::color::parsing::FromParsedColor;
|
||||
hints.push(from_declaration(
|
||||
shared_lock,
|
||||
PropertyDeclaration::Color(longhands::color::SpecifiedValue(
|
||||
|
@ -1108,8 +1108,8 @@ impl<'dom> LayoutElementHelpers<'dom> for LayoutDom<'dom, Element> {
|
|||
|
||||
#[inline]
|
||||
#[allow(unsafe_code)]
|
||||
fn has_selector_flags(self, flags: ElementSelectorFlags) -> bool {
|
||||
unsafe { (self.unsafe_get()).selector_flags.get().contains(flags) }
|
||||
fn get_selector_flags(self) -> ElementSelectorFlags {
|
||||
unsafe { self.unsafe_get().selector_flags.get() }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::RgbaLegacy;
|
||||
use dom_struct::dom_struct;
|
||||
use embedder_traits::EmbedderMsg;
|
||||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use servo_url::ServoUrl;
|
||||
use style::attr::AttrValue;
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
|
||||
use crate::dom::attr::Attr;
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLBodyElementBinding::HTMLBodyElementMethods;
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::RgbaLegacy;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use servo_atoms::Atom;
|
||||
use style::attr::AttrValue;
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
use style::str::{read_numbers, HTML_SPACE_CHARACTERS};
|
||||
|
||||
use crate::dom::attr::Attr;
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::RgbaLegacy;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLHRElementBinding::HTMLHRElementMethods;
|
||||
use crate::dom::bindings::inheritance::Castable;
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::RgbaLegacy;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
use style::context::QuirksMode;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLTableCellElementBinding::HTMLTableCellElementMethods;
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
use std::cell::Cell;
|
||||
|
||||
use cssparser::RgbaLegacy;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use style::attr::{parse_unsigned_integer, AttrValue, LengthOrPercentageOrAuto};
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
|
||||
use crate::dom::attr::Attr;
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLCollectionBinding::HTMLCollectionMethods;
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::RgbaLegacy;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use style::attr::AttrValue;
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLTableElementBinding::HTMLTableElementMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLTableRowElementBinding::HTMLTableRowElementMethods;
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::RgbaLegacy;
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use style::attr::AttrValue;
|
||||
use style::color::parsing::RgbaLegacy;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLTableSectionElementBinding::HTMLTableSectionElementMethods;
|
||||
use crate::dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
|
||||
|
|
|
@ -453,6 +453,21 @@ impl<'dom, LayoutDataType: LayoutDataTrait> style::dom::TElement
|
|||
) -> euclid::default::Size2D<Option<app_units::Au>> {
|
||||
todo!();
|
||||
}
|
||||
|
||||
fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool {
|
||||
self.element.get_selector_flags().contains(flags)
|
||||
}
|
||||
|
||||
fn relative_selector_search_direction(&self) -> Option<ElementSelectorFlags> {
|
||||
let flags = self.element.get_selector_flags().intersection(
|
||||
ElementSelectorFlags::RELATIVE_SELECTOR_SEARCH_DIRECTION_ANCESTOR_SIBLING,
|
||||
);
|
||||
if flags.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'dom, LayoutDataType: LayoutDataTrait> ::selectors::Element
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue