Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to the new cssparser. #4684

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -46,8 +46,8 @@ use servo_util::opts;
use std::default::Default;
use std::iter::repeat;
use std::num::FloatMath;
use style::computed::{AngleOrCorner, LengthOrPercentage, HorizontalDirection, VerticalDirection};
use style::computed::{Image, LinearGradient};
use style::values::specified::{AngleOrCorner, HorizontalDirection, VerticalDirection};
use style::computed::{Image, LinearGradient, LengthOrPercentage};
use style::computed_values::filter::Filter;
use style::computed_values::{background_attachment, background_repeat, border_style, overflow};
use style::computed_values::{position, visibility};
@@ -222,13 +222,13 @@ fn build_border_radius(abs_bounds: &Rect<Au>, border_style: &Border) -> BorderRa
// radii will be relative to the width.

BorderRadii {
top_left: model::specified(border_style.border_top_left_radius.radius,
top_left: model::specified(border_style.border_top_left_radius,
abs_bounds.size.width),
top_right: model::specified(border_style.border_top_right_radius.radius,
top_right: model::specified(border_style.border_top_right_radius,
abs_bounds.size.width),
bottom_right: model::specified(border_style.border_bottom_right_radius.radius,
bottom_right: model::specified(border_style.border_bottom_right_radius,
abs_bounds.size.width),
bottom_left: model::specified(border_style.border_bottom_left_radius.radius,
bottom_left: model::specified(border_style.border_bottom_left_radius,
abs_bounds.size.width),
}
}
@@ -50,8 +50,8 @@ use dom::node::{window_from_node};
use dom::nodelist::NodeList;
use dom::virtualmethods::{VirtualMethods, vtable_for};
use devtools_traits::AttrInfo;
use style::{mod, StylesheetOrigin, SimpleColorAttribute, UnsignedIntegerAttribute};
use style::{IntegerAttribute, LengthAttribute, ParserContext, matches};
use style::{mod, SimpleColorAttribute, UnsignedIntegerAttribute};
use style::{IntegerAttribute, LengthAttribute, matches};
use servo_util::namespace;
use servo_util::str::{DOMString, LengthOrPercentageOrAuto};

@@ -1111,10 +1111,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> {

// http://dom.spec.whatwg.org/#dom-element-matches
fn Matches(self, selectors: DOMString) -> Fallible<bool> {
let parser_context = ParserContext {
origin: StylesheetOrigin::Author,
};
match style::parse_selector_list_from_str(&parser_context, selectors.as_slice()) {
match style::parse_author_origin_selector_list_from_str(selectors.as_slice()) {
Err(()) => Err(Syntax),
Ok(ref selectors) => {
let root: JSRef<Node> = NodeCast::from_ref(self);
@@ -1125,10 +1122,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> {

// https://dom.spec.whatwg.org/#dom-element-closest
fn Closest(self, selectors: DOMString) -> Fallible<Option<Temporary<Element>>> {
let parser_context = ParserContext {
origin: StylesheetOrigin::Author,
};
match style::parse_selector_list_from_str(&parser_context, selectors.as_slice()) {
match style::parse_author_origin_selector_list_from_str(selectors.as_slice()) {
Err(()) => Err(Syntax),
Ok(ref selectors) => {
let root: JSRef<Node> = NodeCast::from_ref(self);
@@ -48,7 +48,7 @@ use devtools_traits::NodeInfo;
use script_traits::UntrustedNodeAddress;
use servo_util::geometry::Au;
use servo_util::str::{DOMString, null_str_as_empty};
use style::{matches, StylesheetOrigin, ParserContext, SelectorList};
use style::{matches, SelectorList};

use js::jsapi::{JSContext, JSObject, JSTracer, JSRuntime};
use js::jsfriendapi;
@@ -741,10 +741,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
// http://dom.spec.whatwg.org/#dom-parentnode-queryselector
fn query_selector(self, selectors: DOMString) -> Fallible<Option<Temporary<Element>>> {
// Step 1.
let parser_context = ParserContext {
origin: StylesheetOrigin::Author,
};
match style::parse_selector_list_from_str(&parser_context, selectors.as_slice()) {
match style::parse_author_origin_selector_list_from_str(selectors.as_slice()) {
// Step 2.
Err(()) => return Err(Syntax),
// Step 3.
@@ -766,10 +763,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
// Step 1.
let nodes;
let root = self.ancestors().last().unwrap_or(self.clone());
let parser_context = ParserContext {
origin: StylesheetOrigin::Author,
};
match style::parse_selector_list_from_str(&parser_context, selectors.as_slice()) {
match style::parse_author_origin_selector_list_from_str(selectors.as_slice()) {
// Step 2.
Err(()) => return Err(Syntax),
// Step 3.

Some generated files are not rendered by default. Learn more.

@@ -36,3 +36,4 @@ git = "https://github.com/servo/string-cache"
[dependencies]
text_writer = "0.1.1"
encoding = "0.2"
matches = "0.1"

This file was deleted.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.