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

style: Sync changes from mozilla-central. #22641

Merged
merged 27 commits into from Jan 7, 2019
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4799e83
style: Enable CSS containment for frontend code.
dholbert Dec 15, 2018
31838b1
style: The 'all' property is not animatable.
emilio Dec 15, 2018
b59ec2e
style: Make <use> shadow trees lookup keyframe rules in the containin…
emilio Dec 17, 2018
1903559
style: Cleanup some conversion code dealing with NonNegative.
emilio Dec 16, 2018
ca1ad00
style: Use NonNegative more in the border code.
emilio Dec 17, 2018
3ed525f
style: Use cbindgen for ExtremumLength.
BorisChiou Dec 18, 2018
b7e728a
style: Support unprefixed min-content and max-content.
BorisChiou Dec 18, 2018
6275595
style: Let logical height, block-size, accept keywords.
BorisChiou Dec 18, 2018
f0f3eb3
style: Clamp to non-negative value after doing interpolation for circ…
BorisChiou Dec 19, 2018
7b44418
style: Bump smallvec and smallbitvec.
heycam Dec 20, 2018
8a6230e
style: changes to implement enum class for #define NS_STYLE_COLOR_ADJ…
sharath29 Dec 24, 2018
8929087
style: Update the Rust target version for bindgen.
emilio Dec 25, 2018
81a07b4
style: Implement the 'overflow-block' media query.
quasicomputational Dec 27, 2018
274845f
style: Implement the 'overflow-inline' media query.
quasicomputational Dec 22, 2018
a454f62
Rename nsIDocument to mozilla::dom::Document.
emilio Jan 2, 2019
d5bee57
style: Drop layout.css.box-decoration-break.enabled pref.
Jan 4, 2019
529ff36
style: Drop layout.css.color-adjust.enabled pref.
Jan 4, 2019
d862dae
style: Drop layout.css.image-orientation.enabled pref.
Jan 4, 2019
0488f81
style: Drop layout.css.isolation.enabled pref.
Jan 4, 2019
a0d1a03
style: Drop layout.css.mix-blend-mode.enabled pref.
Jan 4, 2019
48e4433
style: Drop layout.css.scroll-behavior.property-enabled pref.
Jan 4, 2019
152ef2e
style: Drop layout.css.background-blend-mode.enabled pref.
Jan 4, 2019
5f173c4
style: Rustfmt recent changes.
emilio Jan 6, 2019
d0eb20c
Update lockfile.
emilio Jan 6, 2019
4c1076a
style: Fix gecko build.
emilio Jan 6, 2019
97bd8fc
Fix Servo build.
emilio Jan 6, 2019
ecd9794
style: Remove a bunch of unit tests that are not very useful.
emilio Jan 7, 2019
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

style: Update the Rust target version for bindgen.

This brings us alignas support and also associated constants for bitfield enums.

Differential Revision: https://phabricator.services.mozilla.com/D15334
  • Loading branch information
emilio committed Jan 6, 2019
commit 8929087d8365d2e57dc446f25ee18ac4139c4e99
@@ -139,7 +139,9 @@ mod bindings {

// Disable rust unions, because we replace some types inside of
// them.
let mut builder = Builder::default().rust_target(RustTarget::Stable_1_0);
let mut builder = Builder::default()
.rust_target(RustTarget::Stable_1_25)
.disable_untagged_union();

let rustfmt_path = env::var_os("RUSTFMT")
// This can be replaced with
@@ -156,16 +156,14 @@ impl PseudoElement {
/// Construct a `CSSPseudoElementType` from a pseudo-element
#[inline]
fn pseudo_type(&self) -> CSSPseudoElementType {
use crate::gecko_bindings::structs::CSSPseudoElementType_InheritingAnonBox;

match *self {
% for pseudo in PSEUDOS:
% if not pseudo.is_anon_box():
PseudoElement::${pseudo.capitalized_pseudo()} => CSSPseudoElementType::${pseudo.pseudo_ident},
% elif pseudo.is_tree_pseudo_element():
PseudoElement::${pseudo.capitalized_pseudo()}(..) => CSSPseudoElementType::XULTree,
% elif pseudo.is_inheriting_anon_box():
PseudoElement::${pseudo.capitalized_pseudo()} => CSSPseudoElementType_InheritingAnonBox,
PseudoElement::${pseudo.capitalized_pseudo()} => CSSPseudoElementType::InheritingAnonBox,
% else:
PseudoElement::${pseudo.capitalized_pseudo()} => CSSPseudoElementType::NonInheritingAnonBox,
% endif
@@ -83,7 +83,7 @@ impl GeckoRestyleDamage {
/// Gets restyle damage to reconstruct the entire frame, subsuming all
/// other damage.
pub fn reconstruct() -> Self {
GeckoRestyleDamage(structs::nsChangeHint_nsChangeHint_ReconstructFrame)
GeckoRestyleDamage(structs::nsChangeHint::nsChangeHint_ReconstructFrame)
}
}

@@ -1501,9 +1501,6 @@ impl<'le> TElement for GeckoElement<'le> {

/// Process various tasks that are a result of animation-only restyle.
fn process_post_animation(&self, tasks: PostAnimationTasks) {
use crate::gecko_bindings::structs::nsChangeHint_nsChangeHint_Empty;
use crate::gecko_bindings::structs::nsRestyleHint_eRestyle_Subtree;

debug_assert!(!tasks.is_empty(), "Should be involved a task");

// If display style was changed from none to other, we need to resolve
@@ -1519,8 +1516,8 @@ impl<'le> TElement for GeckoElement<'le> {
);
unsafe {
self.note_explicit_hints(
nsRestyleHint_eRestyle_Subtree,
nsChangeHint_nsChangeHint_Empty,
nsRestyleHint::eRestyle_Subtree,
nsChangeHint::nsChangeHint_Empty,
);
}
}
@@ -5,17 +5,14 @@
//! Helper to iterate over `OriginFlags` bits.

use crate::gecko_bindings::structs::OriginFlags;
use crate::gecko_bindings::structs::OriginFlags_Author;
use crate::gecko_bindings::structs::OriginFlags_User;
use crate::gecko_bindings::structs::OriginFlags_UserAgent;
use crate::stylesheets::OriginSet;

/// Checks that the values for OriginFlags are the ones we expect.
pub fn assert_flags_match() {
use crate::stylesheets::origin::*;
debug_assert_eq!(OriginFlags_UserAgent.0, OriginSet::ORIGIN_USER_AGENT.bits());
debug_assert_eq!(OriginFlags_Author.0, OriginSet::ORIGIN_AUTHOR.bits());
debug_assert_eq!(OriginFlags_User.0, OriginSet::ORIGIN_USER.bits());
debug_assert_eq!(OriginFlags::UserAgent.0, OriginSet::ORIGIN_USER_AGENT.bits());
debug_assert_eq!(OriginFlags::Author.0, OriginSet::ORIGIN_AUTHOR.bits());
debug_assert_eq!(OriginFlags::User.0, OriginSet::ORIGIN_USER.bits());
}

impl From<OriginFlags> for OriginSet {
@@ -193,38 +193,31 @@ impl Default for RestyleHint {
#[cfg(feature = "gecko")]
impl From<nsRestyleHint> for RestyleHint {
fn from(mut raw: nsRestyleHint) -> Self {
use crate::gecko_bindings::structs::nsRestyleHint_eRestyle_Force as eRestyle_Force;
use crate::gecko_bindings::structs::nsRestyleHint_eRestyle_ForceDescendants as eRestyle_ForceDescendants;
use crate::gecko_bindings::structs::nsRestyleHint_eRestyle_LaterSiblings as eRestyle_LaterSiblings;
use crate::gecko_bindings::structs::nsRestyleHint_eRestyle_Self as eRestyle_Self;
use crate::gecko_bindings::structs::nsRestyleHint_eRestyle_SomeDescendants as eRestyle_SomeDescendants;
use crate::gecko_bindings::structs::nsRestyleHint_eRestyle_Subtree as eRestyle_Subtree;

let mut hint = RestyleHint::empty();

debug_assert!(
raw.0 & eRestyle_LaterSiblings.0 == 0,
raw.0 & nsRestyleHint::eRestyle_LaterSiblings.0 == 0,
"Handle later siblings manually if necessary plz."
);

if (raw.0 & (eRestyle_Self.0 | eRestyle_Subtree.0)) != 0 {
raw.0 &= !eRestyle_Self.0;
if (raw.0 & (nsRestyleHint::eRestyle_Self.0 | nsRestyleHint::eRestyle_Subtree.0)) != 0 {
raw.0 &= !nsRestyleHint::eRestyle_Self.0;
hint.insert(RestyleHint::RESTYLE_SELF);
}

if (raw.0 & (eRestyle_Subtree.0 | eRestyle_SomeDescendants.0)) != 0 {
raw.0 &= !eRestyle_Subtree.0;
raw.0 &= !eRestyle_SomeDescendants.0;
if (raw.0 & (nsRestyleHint::eRestyle_Subtree.0 | nsRestyleHint::eRestyle_SomeDescendants.0)) != 0 {
raw.0 &= !nsRestyleHint::eRestyle_Subtree.0;
raw.0 &= !nsRestyleHint::eRestyle_SomeDescendants.0;
hint.insert(RestyleHint::RESTYLE_DESCENDANTS);
}

if (raw.0 & (eRestyle_ForceDescendants.0 | eRestyle_Force.0)) != 0 {
raw.0 &= !eRestyle_Force.0;
if (raw.0 & (nsRestyleHint::eRestyle_ForceDescendants.0 | nsRestyleHint::eRestyle_Force.0)) != 0 {
raw.0 &= !nsRestyleHint::eRestyle_Force.0;
hint.insert(RestyleHint::RECASCADE_SELF);
}

if (raw.0 & eRestyle_ForceDescendants.0) != 0 {
raw.0 &= !eRestyle_ForceDescendants.0;
if (raw.0 & nsRestyleHint::eRestyle_ForceDescendants.0) != 0 {
raw.0 &= !nsRestyleHint::eRestyle_ForceDescendants.0;
hint.insert(RestyleHint::RECASCADE_DESCENDANTS);
}

@@ -248,7 +241,7 @@ pub fn assert_restyle_hints_match() {
if cfg!(debug_assertions) {
let mut replacements = RestyleHint::replacements();
$(
assert_eq!(structs::$a.0 as usize, $b.bits() as usize, stringify!($b));
assert_eq!(structs::nsRestyleHint::$a.0 as usize, $b.bits() as usize, stringify!($b));
replacements.remove($b);
)*
assert_eq!(replacements, RestyleHint::empty(),
@@ -259,9 +252,9 @@ pub fn assert_restyle_hints_match() {
}

check_restyle_hints! {
nsRestyleHint_eRestyle_CSSTransitions => RestyleHint::RESTYLE_CSS_TRANSITIONS,
nsRestyleHint_eRestyle_CSSAnimations => RestyleHint::RESTYLE_CSS_ANIMATIONS,
nsRestyleHint_eRestyle_StyleAttribute => RestyleHint::RESTYLE_STYLE_ATTRIBUTE,
nsRestyleHint_eRestyle_StyleAttribute_Animations => RestyleHint::RESTYLE_SMIL,
eRestyle_CSSTransitions => RestyleHint::RESTYLE_CSS_TRANSITIONS,
eRestyle_CSSAnimations => RestyleHint::RESTYLE_CSS_ANIMATIONS,
eRestyle_StyleAttribute => RestyleHint::RESTYLE_STYLE_ATTRIBUTE,
eRestyle_StyleAttribute_Animations => RestyleHint::RESTYLE_SMIL,
}
}
@@ -39,7 +39,6 @@ use crate::gecko_bindings::bindings::RawGeckoPresContextBorrowed;
use crate::gecko_bindings::structs;
use crate::gecko_bindings::structs::nsCSSPropertyID;
use crate::gecko_bindings::structs::mozilla::CSSPseudoElementType;
use crate::gecko_bindings::structs::mozilla::CSSPseudoElementType_InheritingAnonBox;
use crate::gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordData, CoordDataMut};
use crate::gecko_bindings::sugar::refptr::RefPtr;
use crate::gecko::values::convert_nscolor_to_rgba;
@@ -138,7 +137,7 @@ impl ComputedValues {
#[inline]
pub fn is_anon_box(&self) -> bool {
let our_type = self.get_pseudo_type();
return our_type == CSSPseudoElementType_InheritingAnonBox ||
return our_type == CSSPseudoElementType::InheritingAnonBox ||
our_type == CSSPseudoElementType::NonInheritingAnonBox;
}

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