Skip to content

Commit

Permalink
Auto merge of #21109 - emilio:gecko-sync, r=SimonSapin
Browse files Browse the repository at this point in the history
style: sync changes from mozilla-central.

See each individual commit for details..

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21109)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Jul 1, 2018
2 parents 9c243a1 + 36495d6 commit c71c55e
Show file tree
Hide file tree
Showing 54 changed files with 872 additions and 1,077 deletions.
29 changes: 14 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/canvas/Cargo.toml
Expand Up @@ -13,7 +13,7 @@ path = "lib.rs"
azure = {git = "https://github.com/servo/rust-azure"}
canvas_traits = {path = "../canvas_traits"}
compositing = {path = "../compositing"}
cssparser = "0.23.0"
cssparser = "0.24"
euclid = "0.17"
fnv = "1.0"
gleam = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion components/canvas_traits/Cargo.toml
Expand Up @@ -10,7 +10,7 @@ name = "canvas_traits"
path = "lib.rs"

[dependencies]
cssparser = "0.23.0"
cssparser = "0.24.0"
euclid = "0.17"
ipc-channel = "0.10"
gleam = "0.5.1"
Expand Down
11 changes: 2 additions & 9 deletions components/layout/display_list/builder.rs
Expand Up @@ -1219,11 +1219,7 @@ impl FragmentDisplayListBuilding for Fragment {
state.add_display_item(DisplayItem::BoxShadow(Box::new(BoxShadowDisplayItem {
base: base,
box_bounds: absolute_bounds.to_layout(),
color: box_shadow
.base
.color
.unwrap_or(style.get_color().color)
.to_layout(),
color: style.resolve_color(box_shadow.base.color).to_layout(),
offset: LayoutVector2D::new(
box_shadow.base.horizontal.px(),
box_shadow.base.vertical.px(),
Expand Down Expand Up @@ -2038,10 +2034,7 @@ impl FragmentDisplayListBuilding for Fragment {
base: base.clone(),
shadow: webrender_api::Shadow {
offset: LayoutVector2D::new(shadow.horizontal.px(), shadow.vertical.px()),
color: shadow
.color
.unwrap_or(self.style().get_color().color)
.to_layout(),
color: self.style.resolve_color(shadow.color).to_layout(),
blur_radius: shadow.blur.px(),
},
},
Expand Down
2 changes: 1 addition & 1 deletion components/malloc_size_of/Cargo.toml
Expand Up @@ -24,7 +24,7 @@ servo = [

[dependencies]
app_units = "0.6"
cssparser = "0.23.0"
cssparser = "0.24.0"
euclid = "0.17"
hashglobe = { path = "../hashglobe" }
hyper = { version = "0.10", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion components/script/Cargo.toml
Expand Up @@ -37,7 +37,7 @@ canvas_traits = {path = "../canvas_traits"}
caseless = "0.2"
cookie = "0.10"
chrono = "0.4"
cssparser = "0.23.0"
cssparser = "0.24"
deny_public_fields = {path = "../deny_public_fields"}
devtools_traits = {path = "../devtools_traits"}
dom_struct = {path = "../dom_struct"}
Expand Down
70 changes: 0 additions & 70 deletions components/script/dom/htmlimageelement.rs
Expand Up @@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use app_units::{Au, AU_PER_PX};
use cssparser::{Parser, ParserInput};
use document_loader::{LoadType, LoadBlocker};
use dom::activation::Activatable;
use dom::attr::Attr;
Expand Down Expand Up @@ -58,13 +57,7 @@ use std::default::Default;
use std::i32;
use std::sync::{Arc, Mutex};
use style::attr::{AttrValue, LengthOrPercentageOrAuto, parse_double, parse_unsigned_integer};
use style::context::QuirksMode;
use style::media_queries::MediaQuery;
use style::parser::ParserContext;
use style::str::is_ascii_digit;
use style::values::specified::{Length, ViewportPercentageLength};
use style::values::specified::length::NoCalcLength;
use style_traits::ParsingMode;
use task_source::TaskSource;

enum ParseState {
Expand Down Expand Up @@ -94,12 +87,6 @@ enum State {
Broken,
}

#[derive(Debug, PartialEq)]
pub struct Size {
pub query: Option<MediaQuery>,
pub length: Length,
}

#[derive(Clone, Copy, JSTraceable, MallocSizeOf)]
enum ImageRequestPhase {
Pending,
Expand Down Expand Up @@ -758,63 +745,6 @@ impl LayoutHTMLImageElementHelpers for LayoutDom<HTMLImageElement> {
}
}

//https://html.spec.whatwg.org/multipage/#parse-a-sizes-attribute
pub fn parse_a_sizes_attribute(input: DOMString, width: Option<u32>) -> Vec<Size> {
let mut sizes = Vec::<Size>::new();
for unparsed_size in input.split(',') {
let whitespace = unparsed_size.chars().rev().take_while(|c| char::is_whitespace(*c)).count();
let trimmed: String = unparsed_size.chars().take(unparsed_size.chars().count() - whitespace).collect();

if trimmed.is_empty() {
continue;
}
let mut input = ParserInput::new(&trimmed);
let url = ServoUrl::parse("about:blank").unwrap();
let context = ParserContext::new_for_cssom(
&url,
None,
ParsingMode::empty(),
QuirksMode::NoQuirks,
None,
);
let mut parser = Parser::new(&mut input);
let length = parser.try(|i| Length::parse_non_negative(&context, i));
match length {
Ok(len) => sizes.push(Size {
length: len,
query: None
}),
Err(_) => {
let mut media_query_parser = parser;
let media_query = media_query_parser.try(|i| MediaQuery::parse(&context, i));
if let Ok(query) = media_query {
let length = Length::parse_non_negative(&context, &mut media_query_parser);
if let Ok(length) = length {
sizes.push(Size {
length: length,
query: Some(query)
})
}
}
},
}
}
if sizes.is_empty() {
let size = match width {
Some(w) => Size {
length: Length::from_px(w as f32),
query: None
},
None => Size {
length: Length::NoCalc(NoCalcLength::ViewportPercentage(ViewportPercentageLength::Vw(100.))),
query: None
},
};
sizes.push(size);
}
sizes
}

impl HTMLImageElementMethods for HTMLImageElement {
// https://html.spec.whatwg.org/multipage/#dom-img-alt
make_getter!(Alt, "alt");
Expand Down
8 changes: 8 additions & 0 deletions components/script/dom/webidls/CSSStyleDeclaration.webidl
Expand Up @@ -350,6 +350,14 @@ partial interface CSSStyleDeclaration {
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString offsetInlineStart;
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString offset-inline-end;
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString offsetInlineEnd;
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString inset-block-start;
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString insetBlockStart;
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString inset-block-end;
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString insetBlockEnd;
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString inset-inline-start;
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString insetInlineStart;
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString inset-inline-end;
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString insetInlineEnd;

[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString height;
[CEReactions, SetterThrows, TreatNullAs=EmptyString] attribute DOMString minHeight;
Expand Down
4 changes: 0 additions & 4 deletions components/script/test.rs
Expand Up @@ -15,10 +15,6 @@ pub mod area {
pub use dom::htmlareaelement::{Area, Shape};
}

pub mod sizes {
pub use dom::htmlimageelement::{parse_a_sizes_attribute, Size};
}

pub mod size_of {
use dom::characterdata::CharacterData;
use dom::element::Element;
Expand Down
2 changes: 1 addition & 1 deletion components/script_layout_interface/Cargo.toml
Expand Up @@ -13,7 +13,7 @@ path = "lib.rs"
app_units = "0.6"
atomic_refcell = "0.1"
canvas_traits = {path = "../canvas_traits"}
cssparser = "0.23.0"
cssparser = "0.24"
euclid = "0.17"
gfx_traits = {path = "../gfx_traits"}
html5ever = "0.22"
Expand Down
2 changes: 1 addition & 1 deletion components/selectors/Cargo.toml
Expand Up @@ -22,7 +22,7 @@ bench = []
[dependencies]
bitflags = "1.0"
matches = "0.1"
cssparser = "0.23.0"
cssparser = "0.24.0"
log = "0.4"
fnv = "1.0"
phf = "0.7.18"
Expand Down

0 comments on commit c71c55e

Please sign in to comment.