mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Solving merge conficts related to the html5ever_atoms -> html5ever change
This commit is contained in:
commit
62821a6915
188 changed files with 1130 additions and 697 deletions
|
@ -31,10 +31,10 @@ macro_rules! sizeof_checker (
|
|||
// Update the sizes here
|
||||
sizeof_checker!(size_event_target, EventTarget, 40);
|
||||
sizeof_checker!(size_node, Node, 152);
|
||||
sizeof_checker!(size_element, Element, 312);
|
||||
sizeof_checker!(size_htmlelement, HTMLElement, 328);
|
||||
sizeof_checker!(size_div, HTMLDivElement, 328);
|
||||
sizeof_checker!(size_span, HTMLSpanElement, 328);
|
||||
sizeof_checker!(size_element, Element, 320);
|
||||
sizeof_checker!(size_htmlelement, HTMLElement, 336);
|
||||
sizeof_checker!(size_div, HTMLDivElement, 336);
|
||||
sizeof_checker!(size_span, HTMLSpanElement, 336);
|
||||
sizeof_checker!(size_text, Text, 184);
|
||||
sizeof_checker!(size_characterdata, CharacterData, 184);
|
||||
sizeof_checker!(size_servothreadsafelayoutnode, ServoThreadSafeLayoutNode, 16);
|
||||
|
|
|
@ -16,7 +16,7 @@ testing = ["style/testing"]
|
|||
app_units = "0.4"
|
||||
cssparser = "0.13"
|
||||
euclid = "0.11"
|
||||
html5ever-atoms = "0.3"
|
||||
html5ever = "0.16"
|
||||
parking_lot = "0.3"
|
||||
rayon = "0.6"
|
||||
rustc-serialize = "0.3"
|
||||
|
|
|
@ -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 http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::sync::Arc;
|
||||
use style::keyframes::{Keyframe, KeyframesAnimation, KeyframePercentage, KeyframeSelector};
|
||||
use style::keyframes::{KeyframesStep, KeyframesStepValue};
|
||||
use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, Importance};
|
||||
use style::properties::animated_properties::TransitionProperty;
|
||||
use style::shared_lock::SharedRwLock;
|
||||
use style::stylearc::Arc;
|
||||
use style::values::specified::{LengthOrPercentageOrAuto, NoCalcLength};
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
extern crate app_units;
|
||||
extern crate cssparser;
|
||||
extern crate euclid;
|
||||
#[macro_use] extern crate html5ever_atoms;
|
||||
#[macro_use] extern crate html5ever;
|
||||
extern crate parking_lot;
|
||||
extern crate rayon;
|
||||
extern crate rustc_serialize;
|
||||
|
@ -27,6 +27,7 @@ mod logical_geometry;
|
|||
mod media_queries;
|
||||
mod parsing;
|
||||
mod properties;
|
||||
mod restyle_hints;
|
||||
mod rule_tree;
|
||||
mod size_of;
|
||||
mod str;
|
||||
|
|
|
@ -6,13 +6,13 @@ use cssparser::{Parser, SourcePosition};
|
|||
use euclid::size::TypedSize2D;
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::ToOwned;
|
||||
use std::sync::Arc;
|
||||
use style::Atom;
|
||||
use style::context::QuirksMode;
|
||||
use style::error_reporting::ParseErrorReporter;
|
||||
use style::media_queries::*;
|
||||
use style::servo::media_queries::*;
|
||||
use style::shared_lock::{SharedRwLock, SharedRwLockReadGuard};
|
||||
use style::stylearc::Arc;
|
||||
use style::stylesheets::{Stylesheet, Origin, CssRule};
|
||||
use style::values::specified;
|
||||
use style_traits::ToCss;
|
||||
|
|
31
tests/unit/style/restyle_hints.rs
Normal file
31
tests/unit/style/restyle_hints.rs
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#[test]
|
||||
fn smoke_restyle_hints() {
|
||||
use cssparser::Parser;
|
||||
use selectors::parser::SelectorList;
|
||||
use style::restyle_hints::{DependencySet, RESTYLE_LATER_SIBLINGS};
|
||||
use style::selector_parser::SelectorParser;
|
||||
use style::stylesheets::{Origin, Namespaces};
|
||||
let namespaces = Namespaces::default();
|
||||
let parser = SelectorParser {
|
||||
stylesheet_origin: Origin::Author,
|
||||
namespaces: &namespaces,
|
||||
};
|
||||
|
||||
let mut dependencies = DependencySet::new();
|
||||
|
||||
let mut p = Parser::new(":not(:active) ~ label");
|
||||
let selectors = SelectorList::parse(&parser, &mut p).unwrap();
|
||||
assert_eq!((selectors.0).len(), 1);
|
||||
|
||||
let selector = (selectors.0).first().unwrap();
|
||||
dependencies.note_selector(selector);
|
||||
assert_eq!(dependencies.len(), 1);
|
||||
let state_deps = dependencies.get_state_deps();
|
||||
assert_eq!(state_deps.len(), 1);
|
||||
assert!(!state_deps[0].sensitivities.states.is_empty());
|
||||
assert!(state_deps[0].hint.contains(RESTYLE_LATER_SIBLINGS));
|
||||
}
|
|
@ -5,13 +5,13 @@
|
|||
use cssparser::{Parser, SourcePosition};
|
||||
use rayon;
|
||||
use servo_url::ServoUrl;
|
||||
use std::sync::Arc;
|
||||
use style::context::QuirksMode;
|
||||
use style::error_reporting::ParseErrorReporter;
|
||||
use style::media_queries::MediaList;
|
||||
use style::properties::{longhands, Importance, PropertyDeclaration, PropertyDeclarationBlock};
|
||||
use style::rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource};
|
||||
use style::shared_lock::SharedRwLock;
|
||||
use style::stylearc::Arc;
|
||||
use style::stylesheets::{Origin, Stylesheet, CssRule};
|
||||
use test::{self, Bencher};
|
||||
|
||||
|
|
|
@ -3,14 +3,13 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use cssparser::{self, Parser as CssParser, SourcePosition};
|
||||
use html5ever_atoms::{Namespace as NsAtom};
|
||||
use html5ever::{Namespace as NsAtom};
|
||||
use media_queries::CSSErrorReporterTest;
|
||||
use parking_lot::RwLock;
|
||||
use selectors::parser::*;
|
||||
use servo_atoms::Atom;
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::ToOwned;
|
||||
use std::sync::Arc;
|
||||
use std::sync::Mutex;
|
||||
use std::sync::atomic::AtomicBool;
|
||||
use style::context::QuirksMode;
|
||||
|
@ -22,6 +21,7 @@ use style::properties::{CSSWideKeyword, DeclaredValueOwned, PropertyDeclaration,
|
|||
use style::properties::longhands;
|
||||
use style::properties::longhands::animation_play_state;
|
||||
use style::shared_lock::SharedRwLock;
|
||||
use style::stylearc::Arc;
|
||||
use style::stylesheets::{Origin, Namespaces};
|
||||
use style::stylesheets::{Stylesheet, NamespaceRule, CssRule, CssRules, StyleRule, KeyframesRule};
|
||||
use style::values::{KeyframesName, CustomIdent};
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use html5ever_atoms::LocalName;
|
||||
use html5ever::LocalName;
|
||||
use selectors::parser::LocalName as LocalNameSelector;
|
||||
use selectors::parser::Selector;
|
||||
use servo_atoms::Atom;
|
||||
use std::sync::Arc;
|
||||
use style::properties::{PropertyDeclarationBlock, PropertyDeclaration};
|
||||
use style::properties::{longhands, Importance};
|
||||
use style::rule_tree::CascadeLevel;
|
||||
use style::selector_parser::{SelectorImpl, SelectorParser};
|
||||
use style::shared_lock::SharedRwLock;
|
||||
use style::stylearc::Arc;
|
||||
use style::stylesheets::StyleRule;
|
||||
use style::stylist::{Rule, SelectorMap};
|
||||
use style::stylist::needs_revalidation;
|
||||
|
|
|
@ -7,11 +7,11 @@ use euclid::size::TypedSize2D;
|
|||
use media_queries::CSSErrorReporterTest;
|
||||
use servo_config::prefs::{PREFS, PrefValue};
|
||||
use servo_url::ServoUrl;
|
||||
use std::sync::Arc;
|
||||
use style::context::QuirksMode;
|
||||
use style::media_queries::{Device, MediaList, MediaType};
|
||||
use style::parser::{LengthParsingMode, Parse, ParserContext};
|
||||
use style::shared_lock::SharedRwLock;
|
||||
use style::stylearc::Arc;
|
||||
use style::stylesheets::{CssRuleType, Stylesheet, Origin};
|
||||
use style::values::specified::LengthOrPercentageOrAuto::{self, Auto};
|
||||
use style::values::specified::NoCalcLength::{self, ViewportPercentage};
|
||||
|
|
|
@ -11369,6 +11369,12 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"mozilla/adopted_node_is_same_origin_domain.html": [
|
||||
[
|
||||
"/_mozilla/mozilla/adopted_node_is_same_origin_domain.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"mozilla/binding_keyword.html": [
|
||||
[
|
||||
"/_mozilla/mozilla/binding_keyword.html",
|
||||
|
@ -24492,6 +24498,10 @@
|
|||
"170d51460da58c16f5cf94ecda18f18a1c18c116",
|
||||
"support"
|
||||
],
|
||||
"mozilla/adopted_node_is_same_origin_domain.html": [
|
||||
"3f2e6af92f9391aa1892e485c61c9e92c7661194",
|
||||
"testharness"
|
||||
],
|
||||
"mozilla/binding_keyword.html": [
|
||||
"c79aa6d506fbabbed0f6f31d1b8600ea6ba8ff41",
|
||||
"testharness"
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[adopted_node_is_same_origin_domain.html]
|
||||
type: testharness
|
||||
[Adopting a node should make it same-origin-domain.]
|
||||
expected: FAIL
|
|
@ -0,0 +1,30 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Ensure that adopted nodes pass the same-origin-domain checks</title>
|
||||
<link rel=help href="https://dom.spec.whatwg.org/#dom-document-adoptnode">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
async_test(function(t) {
|
||||
// This tests that adopting a node changes its same-origin-domain checks.
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.src = "/common/blank.html";
|
||||
iframe.onload = t.step_func(function() {
|
||||
// Create two nodes in the iframe's content document.
|
||||
var nodeToAdopt = iframe.contentDocument.createElement("div");
|
||||
var nodeToLeaveUnadopted = iframe.contentDocument.createElement("div");
|
||||
document.adoptNode(nodeToAdopt);
|
||||
assert_equals(nodeToAdopt.ownerDocument, document);
|
||||
assert_equals(nodeToLeaveUnadopted.ownerDocument, iframe.contentDocument);
|
||||
// Setting the iframe's document.domain causes it not to be same-origin-domain
|
||||
iframe.contentDocument.domain = document.domain;
|
||||
// We can still access the adopted node, since it is still same-origin-domain,
|
||||
// but accessing the unadopted node throws a security exception.
|
||||
assert_equals(nodeToAdopt.ownerDocument, document);
|
||||
assert_throws(null, function() { nodeToLeaveUnadopted.ownerDocument; });
|
||||
t.done();
|
||||
});
|
||||
document.body.appendChild(iframe);
|
||||
}, "Adopting a node should make it same-origin-domain.")
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue