mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Further changes required by Servo
This commit is contained in:
parent
1c3aafd9d2
commit
4da83f238a
5 changed files with 10 additions and 10 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1171,7 +1171,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cssparser"
|
name = "cssparser"
|
||||||
version = "0.30.0"
|
version = "0.30.0"
|
||||||
source = "git+https://github.com/servo/rust-cssparser?rev=d3670a89bae26ba3a8db4758eb7976616113987d#d3670a89bae26ba3a8db4758eb7976616113987d"
|
source = "git+https://github.com/servo/rust-cssparser?rev=b196a164dcbb317016d4aa6c58c13147e6045ebb#b196a164dcbb317016d4aa6c58c13147e6045ebb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cssparser-macros",
|
"cssparser-macros",
|
||||||
"dtoa-short",
|
"dtoa-short",
|
||||||
|
@ -1187,7 +1187,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cssparser-macros"
|
name = "cssparser-macros"
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
source = "git+https://github.com/servo/rust-cssparser?rev=d3670a89bae26ba3a8db4758eb7976616113987d#d3670a89bae26ba3a8db4758eb7976616113987d"
|
source = "git+https://github.com/servo/rust-cssparser?rev=b196a164dcbb317016d4aa6c58c13147e6045ebb#b196a164dcbb317016d4aa6c58c13147e6045ebb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn 1.0.103",
|
"syn 1.0.103",
|
||||||
|
|
|
@ -27,7 +27,7 @@ compositing_traits = { path = "components/shared/compositing" }
|
||||||
content-security-policy = { version = "0.5", features = ["serde"] }
|
content-security-policy = { version = "0.5", features = ["serde"] }
|
||||||
cookie = "0.12"
|
cookie = "0.12"
|
||||||
crossbeam-channel = "0.5"
|
crossbeam-channel = "0.5"
|
||||||
cssparser = { version = "0.30", git = "https://github.com/servo/rust-cssparser", rev = "d3670a89bae26ba3a8db4758eb7976616113987d" }
|
cssparser = { version = "0.30", git = "https://github.com/servo/rust-cssparser", rev = "b196a164dcbb317016d4aa6c58c13147e6045ebb" }
|
||||||
darling = { version = "0.14", default-features = false }
|
darling = { version = "0.14", default-features = false }
|
||||||
data-url = "0.1.0"
|
data-url = "0.1.0"
|
||||||
devtools_traits = { path = "components/shared/devtools" }
|
devtools_traits = { path = "components/shared/devtools" }
|
||||||
|
|
|
@ -12,7 +12,7 @@ use canvas_traits::canvas::{
|
||||||
FillRule, LineCapStyle, LineJoinStyle, LinearGradientStyle, RadialGradientStyle,
|
FillRule, LineCapStyle, LineJoinStyle, LinearGradientStyle, RadialGradientStyle,
|
||||||
RepetitionStyle, TextAlign, TextBaseline,
|
RepetitionStyle, TextAlign, TextBaseline,
|
||||||
};
|
};
|
||||||
use cssparser::{AbsoluteColor, Color as CSSColor, Parser, ParserInput, RGBA};
|
use cssparser::{Color as CSSColor, Parser, ParserInput, RGBA};
|
||||||
use euclid::default::{Point2D, Rect, Size2D, Transform2D};
|
use euclid::default::{Point2D, Rect, Size2D, Transform2D};
|
||||||
use euclid::vec2;
|
use euclid::vec2;
|
||||||
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
|
use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
|
||||||
|
@ -302,7 +302,7 @@ impl CanvasState {
|
||||||
let color = CSSColor::parse(&mut parser);
|
let color = CSSColor::parse(&mut parser);
|
||||||
if parser.is_exhausted() {
|
if parser.is_exhausted() {
|
||||||
match color {
|
match color {
|
||||||
Ok(CSSColor::Absolute(AbsoluteColor::Rgba(rgba))) => Ok(rgba),
|
Ok(CSSColor::Rgba(rgba)) => Ok(rgba),
|
||||||
Ok(CSSColor::CurrentColor) => {
|
Ok(CSSColor::CurrentColor) => {
|
||||||
// TODO: https://github.com/whatwg/html/issues/1099
|
// TODO: https://github.com/whatwg/html/issues/1099
|
||||||
// Reconsider how to calculate currentColor in a display:none canvas
|
// Reconsider how to calculate currentColor in a display:none canvas
|
||||||
|
@ -1706,7 +1706,7 @@ pub fn parse_color(string: &str) -> Result<RGBA, ()> {
|
||||||
let mut input = ParserInput::new(string);
|
let mut input = ParserInput::new(string);
|
||||||
let mut parser = Parser::new(&mut input);
|
let mut parser = Parser::new(&mut input);
|
||||||
match CSSColor::parse(&mut parser) {
|
match CSSColor::parse(&mut parser) {
|
||||||
Ok(CSSColor::Absolute(AbsoluteColor::Rgba(rgba))) => {
|
Ok(CSSColor::Rgba(rgba)) => {
|
||||||
if parser.is_exhausted() {
|
if parser.is_exhausted() {
|
||||||
Ok(rgba)
|
Ok(rgba)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use canvas_traits::canvas::{
|
use canvas_traits::canvas::{
|
||||||
CanvasGradientStop, FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle,
|
CanvasGradientStop, FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle,
|
||||||
};
|
};
|
||||||
use cssparser::{AbsoluteColor, Color as CSSColor, Parser, ParserInput, RGBA};
|
use cssparser::{Color as CSSColor, Parser, ParserInput, RGBA};
|
||||||
use dom_struct::dom_struct;
|
use dom_struct::dom_struct;
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
|
@ -58,7 +58,7 @@ impl CanvasGradientMethods for CanvasGradient {
|
||||||
let color = CSSColor::parse(&mut parser);
|
let color = CSSColor::parse(&mut parser);
|
||||||
let color = if parser.is_exhausted() {
|
let color = if parser.is_exhausted() {
|
||||||
match color {
|
match color {
|
||||||
Ok(CSSColor::Absolute(AbsoluteColor::Rgba(rgba))) => rgba,
|
Ok(CSSColor::Rgba(rgba)) => rgba,
|
||||||
Ok(CSSColor::CurrentColor) => RGBA::new(0, 0, 0, 1.0),
|
Ok(CSSColor::CurrentColor) => RGBA::new(0, 0, 0, 1.0),
|
||||||
_ => return Err(Error::Syntax),
|
_ => return Err(Error::Syntax),
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ use crate::values::specified::Length;
|
||||||
use crate::values::AtomString;
|
use crate::values::AtomString;
|
||||||
use crate::{Atom, LocalName, Namespace, Prefix};
|
use crate::{Atom, LocalName, Namespace, Prefix};
|
||||||
use app_units::Au;
|
use app_units::Au;
|
||||||
use cssparser::{self, AbsoluteColor, Color, RGBA};
|
use cssparser::{self, Color, RGBA};
|
||||||
use euclid::num::Zero;
|
use euclid::num::Zero;
|
||||||
use num_traits::ToPrimitive;
|
use num_traits::ToPrimitive;
|
||||||
use selectors::attr::AttrSelectorOperation;
|
use selectors::attr::AttrSelectorOperation;
|
||||||
|
@ -419,7 +419,7 @@ pub fn parse_legacy_color(mut input: &str) -> Result<RGBA, ()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 5.
|
// Step 5.
|
||||||
if let Ok(Color::Absolute(AbsoluteColor::Rgba(rgba))) = cssparser::parse_color_keyword(input) {
|
if let Ok(Color::Rgba(rgba)) = cssparser::parse_color_keyword(input) {
|
||||||
return Ok(rgba);
|
return Ok(rgba);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue