Remove (now unused) NetSurf’s libcss and libwapcaplet.

This removes four submodules (two C libraries and their Rust bindings.)
This commit is contained in:
Simon Sapin 2013-10-23 13:14:25 +02:00
parent 86da932927
commit 2045f6a068
15 changed files with 2 additions and 242 deletions

15
.gitmodules vendored
View file

@ -46,18 +46,6 @@
[submodule "src/support/sharegl/sharegl"]
path = src/support/sharegl/sharegl
url = https://github.com/mozilla-servo/sharegl.git
[submodule "src/support/wapcaplet/libwapcaplet"]
path = src/support/wapcaplet/libwapcaplet
url = https://github.com/mozilla-servo/libwapcaplet.git
[submodule "src/support/netsurfcss/libcss"]
path = src/support/netsurfcss/libcss
url = https://github.com/mozilla-servo/libcss.git
[submodule "src/support/netsurfcss/rust-netsurfcss"]
path = src/support/netsurfcss/rust-netsurfcss
url = https://github.com/mozilla-servo/rust-netsurfcss.git
[submodule "src/support/wapcaplet/rust-wapcaplet"]
path = src/support/wapcaplet/rust-wapcaplet
url = https://github.com/mozilla-servo/rust-wapcaplet.git
[submodule "src/platform/macos/rust-core-graphics"]
path = src/platform/macos/rust-core-graphics
url = https://github.com/mozilla-servo/rust-core-graphics.git
@ -73,9 +61,6 @@
[submodule "src/platform/linux/rust-xlib"]
path = src/platform/linux/rust-xlib
url = https://github.com/mozilla-servo/rust-xlib.git
[submodule "src/support/css/rust-css"]
path = src/support/css/rust-css
url = https://github.com/mozilla-servo/rust-css.git
[submodule "src/support/skia/skia"]
path = src/support/skia/skia
url = https://github.com/mozilla-servo/skia.git

7
configure vendored
View file

@ -480,7 +480,6 @@ fi
CFG_SUBMODULES="\
support/alert/rust-alert \
support/azure/rust-azure \
support/css/rust-css \
support/css/rust-cssparser \
support/geom/rust-geom \
support/harfbuzz/rust-harfbuzz \
@ -489,8 +488,6 @@ CFG_SUBMODULES="\
support/hubbub/rust-hubbub \
support/layers/rust-layers \
support/libparserutils/libparserutils \
support/netsurfcss/libcss \
support/netsurfcss/rust-netsurfcss \
support/nss/nspr \
support/nss/nss \
support/opengles/rust-opengles \
@ -500,9 +497,7 @@ CFG_SUBMODULES="\
support/spidermonkey/rust-mozjs \
support/stb-image/rust-stb-image \
support/png/libpng \
support/png/rust-png \
support/wapcaplet/libwapcaplet \
support/wapcaplet/rust-wapcaplet"
support/png/rust-png"
if [ $CFG_OSTYPE = "apple-darwin" ]
then

View file

@ -15,7 +15,6 @@ NO_TESTS += \
SLOW_BUILDS += \
libcss \
libparserutils \
libwapcaplet \
mozjs \
sharegl \
skia \
@ -26,7 +25,6 @@ NATIVE_BUILDS += \
libcss \
libhubbub \
libparserutils \
libwapcaplet \
mozjs \
skia \
nss \
@ -72,27 +70,6 @@ DEPS_rust-hubbub += \
rust \
$(NULL)
DEPS_rust-netsurfcss += \
libcss \
rust-wapcaplet \
rust \
$(NULL)
DEPS_rust-wapcaplet += \
libwapcaplet \
rust \
$(NULL)
CFLAGS_rust-wapcaplet += \
"-I$(S)src/libwapcaplet/include" \
$(NULL)
DEPS_rust-css += \
rust-netsurfcss \
rust-wapcaplet \
rust \
$(NULL)
DEPS_rust-mozjs += \
mozjs \
rust \
@ -102,11 +79,6 @@ CFLAGS_rust-mozjs += \
"-I../mozjs/dist/include" \
$(NULL)
DEPS_libcss += \
libwapcaplet \
libparserutils \
$(NULL)
DEPS_rust-png += \
libpng \
$(NULL)

View file

@ -19,8 +19,7 @@ they are designed to be useful in other Rust projects.
* `support/azure`: A cross-platform 2D drawing library from the Mozilla project. Azure can render
with Direct2D, Core Graphics (Quartz), Skia, and Cairo.
* `support/css`: A general CSS parsing and selector matching library. This abstraction layer
exists to prevent `libcss` internals from leaking into Servo.
* `support/css`: A low-level CSS parsing library for Rust.
* `support/geom`: A simple Euclidean geometry and linear algebra library.
* `support/glut`: Bindings to the GLUT windowing framework. This bare-bones windowing framework is
useful for testing the engine without browser chrome.
@ -32,8 +31,6 @@ they are designed to be useful in other Rust projects.
* `support/layers`: A simple GPU-accelerated 2D scene graph library, somewhat similar to libraries
like Clutter.
* `support/libparserutils`: A parsing library used by `hubbub` and `netsurfcss`.
* `support/netsurfcss`: The CSS library from the NetSurf project. This is a temporary stopgap for
CSS parsing until a pure-Rust solution is available.
* `support/opengles`: Bindings to OpenGL ES 2.0.
* `support/png`: Bindings to libpng.
* `support/sharegl`: A library for sharing OpenGL or Direct3D textures between processes.
@ -41,7 +38,6 @@ they are designed to be useful in other Rust projects.
* `support/spidermonkey`: Mozilla's JavaScript engine.
* `support/stb-image`: A minimalist image decoding library. This is a temporary stopgap for image
decoding until a higher-performance solution is available.
* `support/wapcaplet`: A string storage library used by `hubbub` and `netsurfcss`.
## Platform-specfic bindings

View file

@ -12,7 +12,6 @@
extern mod azure;
extern mod geom;
extern mod newcss (name = "css");
extern mod stb_image;
extern mod extra;
extern mod servo_net (name = "net");

View file

@ -3,11 +3,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use extra::url::Url;
use std::cell::Cell;
use style::Stylesheet;
use style::Stylist;
use style::selector_matching::UserAgentOrigin;
use newcss::util::DataStream;
pub fn new_stylist() -> Stylist {
let mut stylist = Stylist::new();
@ -28,26 +26,6 @@ fn default_url(name: &str) -> Url {
FromStr::from_str(fmt!("http://%s", name)).unwrap()
}
fn style_stream(style: &str) -> @mut DataStream {
let style = Cell::new(style.as_bytes().to_owned());
struct StyleDataStream {
style: Cell<~[u8]>,
}
impl DataStream for StyleDataStream {
fn read(&mut self) -> Option<~[u8]> {
if !self.style.is_empty() {
Some(self.style.take())
} else {
None
}
}
}
let stream = @mut StyleDataStream {
style: style,
};
stream as @mut DataStream
}
fn html4_default_style_str() -> &'static str {
include_str!("user-agent.css")
}

View file

@ -1,137 +0,0 @@
/* 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/. */
///
/// Implementation of the callbacks that the CSS selector engine uses to query the DOM.
///
use std::str::eq_slice;
use newcss::select::SelectHandler;
use script::dom::node::{AbstractNode, LayoutView};
use servo_util::tree::{TreeNodeRef, ElementLike};
pub struct NodeSelectHandler {
node: AbstractNode<LayoutView>,
}
fn with_node_name<R>(node: AbstractNode<LayoutView>, f: &fn(&str) -> R) -> R {
if !node.is_element() {
fail!(~"attempting to style non-element node");
}
do node.with_imm_element |element_n| {
f(element_n.tag_name)
}
}
impl SelectHandler<AbstractNode<LayoutView>> for NodeSelectHandler {
fn with_node_name<R>(&self, node: &AbstractNode<LayoutView>, f: &fn(&str) -> R) -> R {
with_node_name(*node, f)
}
fn named_parent_node(&self, node: &AbstractNode<LayoutView>, name: &str)
-> Option<AbstractNode<LayoutView>> {
do node.parent_node().and_then |parent| {
do with_node_name(parent) |node_name| {
if eq_slice(name, node_name) {
Some(parent)
} else {
None
}
}
}
}
fn parent_node(&self, node: &AbstractNode<LayoutView>) -> Option<AbstractNode<LayoutView>> {
node.parent_node()
}
// TODO: Use a Bloom filter.
fn named_ancestor_node(&self, node: &AbstractNode<LayoutView>, name: &str)
-> Option<AbstractNode<LayoutView>> {
let mut node = *node;
loop {
let parent = node.parent_node();
match parent {
Some(parent) => {
let mut found = false;
do with_node_name(parent) |node_name| {
if eq_slice(name, node_name) {
found = true;
}
}
if found {
return Some(parent);
}
node = parent;
}
None => return None
}
}
}
fn node_is_root(&self, node: &AbstractNode<LayoutView>) -> bool {
self.parent_node(node).is_none()
}
fn node_is_link(&self, node: &AbstractNode<LayoutView>) -> bool {
if node.is_element() {
do node.with_imm_element |element| {
"a" == element.tag_name
}
} else {
false
}
}
fn with_node_classes<R>(&self, node: &AbstractNode<LayoutView>, f: &fn(Option<&str>) -> R) -> R {
if !node.is_element() {
fail!(~"attempting to style non-element node");
}
do node.with_imm_element() |element_n| {
f(element_n.get_attr("class"))
}
}
fn node_has_class(&self, node: &AbstractNode<LayoutView>, class: &str) -> bool {
if !node.is_element() {
fail!(~"attempting to style non-element node");
}
do node.with_imm_element |element_n| {
match element_n.get_attr("class") {
None => false,
Some(existing_classes) => {
let mut ret = false;
for s in existing_classes.split_iter(' ') {
if s == class {
ret = true;
break;
}
}
ret
}
}
}
}
fn with_node_id<R>(&self, node: &AbstractNode<LayoutView>, f: &fn(Option<&str>) -> R) -> R {
if !node.is_element() {
fail!(~"attempting to style non-element node");
}
do node.with_imm_element() |element_n| {
f(element_n.get_attr("id"))
}
}
fn node_has_id(&self, node: &AbstractNode<LayoutView>, id: &str) -> bool {
if !node.is_element() {
fail!(~"attempting to style non-element node");
}
do node.with_imm_element |element_n| {
match element_n.get_attr("id") {
None => false,
Some(existing_id) => id == existing_id
}
}
}
}

View file

@ -24,7 +24,6 @@ extern mod glfw;
extern mod glut;
extern mod js;
extern mod layers;
extern mod newcss (name = "css");
extern mod opengles;
extern mod png;
extern mod script;
@ -66,7 +65,6 @@ pub mod compositing;
pub mod macros;
pub mod css {
mod select_handler;
mod node_util;
pub mod select;

View file

@ -20,11 +20,9 @@ use dom::text::Text;
use std::cast;
use std::cast::transmute;
use std::libc::c_void;
use std::unstable::raw::Box;
use extra::arc::Arc;
use js::jsapi::{JSObject, JSContext};
use netsurfcss::util::VoidPtrLike;
use style::ComputedValues;
use style::properties::PropertyDeclaration;
use servo_util::tree::{TreeNode, TreeNodeRef, TreeNodeRefAsElement};
@ -857,23 +855,6 @@ impl Node<ScriptView> {
}
}
/// The CSS library requires that DOM nodes be convertible to `*c_void` via the `VoidPtrLike`
/// trait.
impl VoidPtrLike for AbstractNode<LayoutView> {
fn from_void_ptr(node: *c_void) -> AbstractNode<LayoutView> {
assert!(node.is_not_null());
unsafe {
cast::transmute(node)
}
}
fn to_void_ptr(&self) -> *c_void {
unsafe {
cast::transmute(*self)
}
}
}
impl Reflectable for Node<ScriptView> {
fn reflector<'a>(&'a self) -> &'a Reflector {
&self.reflector_

View file

@ -17,8 +17,6 @@ extern mod geom;
extern mod gfx (name = "gfx");
extern mod hubbub;
extern mod js;
extern mod netsurfcss;
extern mod newcss (name = "css");
extern mod servo_net (name = "net");
extern mod servo_util (name = "util");
extern mod style;

@ -1 +0,0 @@
Subproject commit f385f19b847a394abffb76875d84f960496f01dd

@ -1 +0,0 @@
Subproject commit 720128629f3395e8836e64887d2c105d94603746

@ -1 +0,0 @@
Subproject commit d94c0ab178fa06e7f270ea8c3a1d1202f4e23e14

@ -1 +0,0 @@
Subproject commit 1c3343639571d65bc0c45cab8253dabe33aace9e

@ -1 +0,0 @@
Subproject commit fa32f481eade263241c54bd3212f50466c802eac