mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #22086 - servo:2018-without-stylo, r=SimonSapin
Switch some crates to the 2018 edition This is the subset of https://github.com/servo/servo/pull/22083 that doesn’t affect Gecko at all, so it isn’t blocked. <!-- 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/22086) <!-- Reviewable:end -->
This commit is contained in:
commit
6878dbbbea
559 changed files with 5306 additions and 5238 deletions
|
@ -3,6 +3,7 @@ name = "servo_allocator"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#[global_allocator]
|
||||
static ALLOC: Allocator = Allocator;
|
||||
|
||||
pub use platform::*;
|
||||
pub use crate::platform::*;
|
||||
|
||||
#[cfg(not(windows))]
|
||||
mod platform {
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "servo_atoms"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
build = "build.rs"
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "bluetooth"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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 BluetoothManager;
|
||||
use crate::BluetoothManager;
|
||||
use device::bluetooth::{BluetoothAdapter, BluetoothDevice};
|
||||
use device::bluetooth::{BluetoothGATTCharacteristic, BluetoothGATTDescriptor, BluetoothGATTService};
|
||||
use std::borrow::ToOwned;
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "bluetooth_traits"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -11,8 +11,8 @@ extern crate serde;
|
|||
pub mod blocklist;
|
||||
pub mod scanfilter;
|
||||
|
||||
use crate::scanfilter::{BluetoothScanfilterSequence, RequestDeviceoptions};
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use scanfilter::{BluetoothScanfilterSequence, RequestDeviceoptions};
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum BluetoothError {
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "canvas"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use azure::azure_hl::AntialiasMode;
|
||||
use canvas_data::*;
|
||||
use canvas_traits::canvas::*;
|
||||
use crate::canvas_data::*;
|
||||
use euclid::Size2D;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use std::borrow::ToOwned;
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
* 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 ::gl_context::GLContextFactory;
|
||||
use canvas_traits::webgl::{WebGLChan, WebGLContextId, WebGLMsg, WebGLPipeline, WebGLReceiver};
|
||||
use canvas_traits::webgl::{WebGLSender, WebVRCommand, WebVRRenderHandler};
|
||||
use canvas_traits::webgl::DOMToTextureCommand;
|
||||
use canvas_traits::webgl::webgl_channel;
|
||||
use crate::gl_context::GLContextFactory;
|
||||
use crate::webgl_thread::{WebGLExternalImageApi, WebGLExternalImageHandler, WebGLThread};
|
||||
use euclid::Size2D;
|
||||
use fnv::FnvHashMap;
|
||||
use gleam::gl;
|
||||
use servo_config::prefs::PREFS;
|
||||
use std::rc::Rc;
|
||||
use webgl_thread::{WebGLExternalImageApi, WebGLExternalImageHandler, WebGLThread};
|
||||
use webrender;
|
||||
use webrender_api;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ use webrender_api;
|
|||
|
||||
/// WebGL Threading API entry point that lives in the constellation.
|
||||
/// It allows to get a WebGLThread handle for each script pipeline.
|
||||
pub use ::webgl_mode::WebGLThreads;
|
||||
pub use crate::webgl_mode::WebGLThreads;
|
||||
|
||||
struct GLContextData {
|
||||
ctx: GLContextWrapper,
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "canvas_traits"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -12,17 +12,17 @@ use std::num::NonZeroU32;
|
|||
use webrender_api::{DocumentId, ImageKey, PipelineId};
|
||||
|
||||
/// Sender type used in WebGLCommands.
|
||||
pub use ::webgl_channel::WebGLSender;
|
||||
pub use crate::webgl_channel::WebGLSender;
|
||||
/// Receiver type used in WebGLCommands.
|
||||
pub use ::webgl_channel::WebGLReceiver;
|
||||
pub use crate::webgl_channel::WebGLReceiver;
|
||||
/// Result type for send()/recv() calls in in WebGLCommands.
|
||||
pub use ::webgl_channel::WebGLSendResult;
|
||||
pub use crate::webgl_channel::WebGLSendResult;
|
||||
/// Helper function that creates a WebGL channel (WebGLSender, WebGLReceiver) to be used in WebGLCommands.
|
||||
pub use ::webgl_channel::webgl_channel;
|
||||
pub use crate::webgl_channel::webgl_channel;
|
||||
/// Entry point type used in a Script Pipeline to get the WebGLChan to be used in that thread.
|
||||
pub use ::webgl_channel::WebGLPipeline;
|
||||
pub use crate::webgl_channel::WebGLPipeline;
|
||||
/// Entry point channel type used for sending WebGLMsg messages to the WebGL renderer.
|
||||
pub use ::webgl_channel::WebGLChan;
|
||||
pub use crate::webgl_channel::WebGLChan;
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct WebGLCommandBacktrace {
|
||||
|
@ -342,7 +342,7 @@ macro_rules! define_resource_id {
|
|||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where D: ::serde::Deserializer<'de>
|
||||
{
|
||||
let id = try!(u32::deserialize(deserializer));
|
||||
let id = u32::deserialize(deserializer)?;
|
||||
if id == 0 {
|
||||
Err(::serde::de::Error::custom("expected a non-zero value"))
|
||||
} else {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
mod ipc;
|
||||
mod mpsc;
|
||||
|
||||
use ::webgl::WebGLMsg;
|
||||
use crate::webgl::WebGLMsg;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_config::opts;
|
||||
use std::fmt;
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "servo_channel"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "compositing"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
build = "build.rs"
|
||||
|
||||
|
|
|
@ -2,15 +2,17 @@
|
|||
* 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 CompositionPipeline;
|
||||
use SendableFrameTree;
|
||||
use compositor_thread::{CompositorProxy, CompositorReceiver};
|
||||
use compositor_thread::{InitialCompositorState, Msg};
|
||||
use crate::CompositionPipeline;
|
||||
use crate::SendableFrameTree;
|
||||
use crate::compositor_thread::{CompositorProxy, CompositorReceiver};
|
||||
use crate::compositor_thread::{InitialCompositorState, Msg};
|
||||
#[cfg(feature = "gleam")]
|
||||
use crate::gl;
|
||||
use crate::touch::{TouchHandler, TouchAction};
|
||||
use crate::windowing::{self, EmbedderCoordinates, MouseWindowEvent, WebRenderDebugOption, WindowMethods};
|
||||
use euclid::{TypedPoint2D, TypedVector2D, TypedScale};
|
||||
use gfx_traits::Epoch;
|
||||
#[cfg(feature = "gleam")]
|
||||
use gl;
|
||||
#[cfg(feature = "gleam")]
|
||||
use image::{DynamicImage, ImageFormat};
|
||||
use ipc_channel::ipc;
|
||||
use libc::c_void;
|
||||
|
@ -18,7 +20,7 @@ use msg::constellation_msg::{PipelineId, PipelineIndex, PipelineNamespaceId};
|
|||
use net_traits::image::base::Image;
|
||||
#[cfg(feature = "gleam")]
|
||||
use net_traits::image::base::PixelFormat;
|
||||
use profile_traits::time::{self, ProfilerCategory, profile};
|
||||
use profile_traits::time::{self as profile_time, ProfilerCategory, profile};
|
||||
use script_traits::{AnimationState, AnimationTickType, ConstellationMsg, LayoutControlMsg};
|
||||
use script_traits::{MouseButton, MouseEventType, ScrollState, TouchEventType, TouchId};
|
||||
use script_traits::{UntrustedNodeAddress, WindowSizeData, WindowSizeType};
|
||||
|
@ -36,11 +38,9 @@ use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor};
|
|||
use style_traits::cursor::CursorKind;
|
||||
use style_traits::viewport::ViewportConstraints;
|
||||
use time::{now, precise_time_ns, precise_time_s};
|
||||
use touch::{TouchHandler, TouchAction};
|
||||
use webrender;
|
||||
use webrender_api::{self, DeviceIntPoint, DevicePoint, HitTestFlags, HitTestResult};
|
||||
use webrender_api::{LayoutVector2D, ScrollLocation};
|
||||
use windowing::{self, EmbedderCoordinates, MouseWindowEvent, WebRenderDebugOption, WindowMethods};
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum UnableToComposite {
|
||||
|
@ -150,7 +150,7 @@ pub struct IOCompositor<Window: WindowMethods> {
|
|||
constellation_chan: Sender<ConstellationMsg>,
|
||||
|
||||
/// The channel on which messages can be sent to the time profiler.
|
||||
time_profiler_chan: time::ProfilerChan,
|
||||
time_profiler_chan: profile_time::ProfilerChan,
|
||||
|
||||
/// Touch input state machine
|
||||
touch_handler: TouchHandler,
|
||||
|
@ -366,7 +366,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
// Tell the profiler, memory profiler, and scrolling timer to shut down.
|
||||
if let Ok((sender, receiver)) = ipc::channel() {
|
||||
self.time_profiler_chan
|
||||
.send(time::ProfilerMsg::Exit(sender));
|
||||
.send(profile_time::ProfilerMsg::Exit(sender));
|
||||
let _ = receiver.recv();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
//! Communication with the compositor thread.
|
||||
|
||||
use SendableFrameTree;
|
||||
use compositor::CompositingReason;
|
||||
use crate::SendableFrameTree;
|
||||
use crate::compositor::CompositingReason;
|
||||
use embedder_traits::EventLoopWaker;
|
||||
use gfx_traits::Epoch;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
|
|
|
@ -29,10 +29,10 @@ extern crate time;
|
|||
extern crate webrender;
|
||||
extern crate webrender_api;
|
||||
|
||||
pub use compositor_thread::CompositorProxy;
|
||||
pub use compositor::IOCompositor;
|
||||
pub use compositor::RenderNotifier;
|
||||
pub use compositor::ShutdownState;
|
||||
pub use crate::compositor_thread::CompositorProxy;
|
||||
pub use crate::compositor::IOCompositor;
|
||||
pub use crate::compositor::RenderNotifier;
|
||||
pub use crate::compositor::ShutdownState;
|
||||
use euclid::TypedSize2D;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "servo_config"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
//! Configuration options for a single run of the servo application. Created
|
||||
//! from command line arguments.
|
||||
|
||||
use crate::prefs::{self, PrefValue, PREFS};
|
||||
use euclid::TypedSize2D;
|
||||
use getopts::Options;
|
||||
use num_cpus;
|
||||
use prefs::{self, PrefValue, PREFS};
|
||||
use servo_geometry::DeviceIndependentPixel;
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::Cow;
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* 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 basedir::default_config_dir;
|
||||
use crate::basedir::default_config_dir;
|
||||
use crate::opts;
|
||||
use embedder_traits::resources::{self, Resource};
|
||||
use num_cpus;
|
||||
use opts;
|
||||
use rustc_serialize::json::{Json, ToJson};
|
||||
use std::borrow::ToOwned;
|
||||
use std::cmp::max;
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "constellation"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* 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 crate::pipeline::Pipeline;
|
||||
use euclid::TypedSize2D;
|
||||
use msg::constellation_msg::{BrowsingContextId, PipelineId, TopLevelBrowsingContextId};
|
||||
use pipeline::Pipeline;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use style_traits::CSSPixel;
|
||||
|
||||
|
|
|
@ -91,8 +91,6 @@
|
|||
|
||||
use backtrace::Backtrace;
|
||||
use bluetooth_traits::BluetoothRequest;
|
||||
use browsingcontext::{AllBrowsingContextsIterator, BrowsingContext, FullyActiveBrowsingContextsIterator};
|
||||
use browsingcontext::NewBrowsingContextInfo;
|
||||
use canvas::canvas_paint_thread::CanvasPaintThread;
|
||||
use canvas::webgl_thread::WebGLThreads;
|
||||
use canvas_traits::canvas::CanvasId;
|
||||
|
@ -101,11 +99,17 @@ use clipboard::{ClipboardContext, ClipboardProvider};
|
|||
use compositing::SendableFrameTree;
|
||||
use compositing::compositor_thread::CompositorProxy;
|
||||
use compositing::compositor_thread::Msg as ToCompositorMsg;
|
||||
use crate::browsingcontext::{AllBrowsingContextsIterator, BrowsingContext, FullyActiveBrowsingContextsIterator};
|
||||
use crate::browsingcontext::NewBrowsingContextInfo;
|
||||
use crate::event_loop::EventLoop;
|
||||
use crate::network_listener::NetworkListener;
|
||||
use crate::pipeline::{InitialPipelineState, Pipeline};
|
||||
use crate::session_history::{JointSessionHistory, NeedsToReload, SessionHistoryChange, SessionHistoryDiff};
|
||||
use crate::timer_scheduler::TimerScheduler;
|
||||
use debugger;
|
||||
use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg};
|
||||
use embedder_traits::{EmbedderMsg, EmbedderProxy};
|
||||
use euclid::{Size2D, TypedSize2D, TypedScale};
|
||||
use event_loop::EventLoop;
|
||||
use gfx::font_cache_thread::FontCacheThread;
|
||||
use gfx_traits::Epoch;
|
||||
use ipc_channel::{Error as IpcError};
|
||||
|
@ -120,8 +124,6 @@ use net_traits::{self, IpcSend, FetchResponseMsg, ResourceThreads};
|
|||
use net_traits::pub_domains::reg_host;
|
||||
use net_traits::request::RequestInit;
|
||||
use net_traits::storage_thread::{StorageThreadMsg, StorageType};
|
||||
use network_listener::NetworkListener;
|
||||
use pipeline::{InitialPipelineState, Pipeline};
|
||||
use profile_traits::mem;
|
||||
use profile_traits::time;
|
||||
use script_traits::{AnimationState, AuxiliaryBrowsingContextLoadInfo, AnimationTickType, CompositorEvent};
|
||||
|
@ -139,7 +141,6 @@ use servo_config::prefs::PREFS;
|
|||
use servo_rand::{Rng, SeedableRng, ServoRng, random};
|
||||
use servo_remutex::ReentrantMutex;
|
||||
use servo_url::{Host, ImmutableOrigin, ServoUrl};
|
||||
use session_history::{JointSessionHistory, NeedsToReload, SessionHistoryChange, SessionHistoryDiff};
|
||||
use std::borrow::ToOwned;
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::marker::PhantomData;
|
||||
|
@ -151,7 +152,6 @@ use std::thread;
|
|||
use style_traits::CSSPixel;
|
||||
use style_traits::cursor::CursorKind;
|
||||
use style_traits::viewport::ViewportConstraints;
|
||||
use timer_scheduler::TimerScheduler;
|
||||
use webrender_api;
|
||||
use webvr_traits::{WebVREvent, WebVRMsg};
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ mod sandboxing;
|
|||
mod session_history;
|
||||
mod timer_scheduler;
|
||||
|
||||
pub use constellation::{Constellation, FromCompositorLogger, FromScriptLogger, InitialConstellationState};
|
||||
pub use pipeline::UnprivilegedPipelineContent;
|
||||
pub use crate::constellation::{Constellation, FromCompositorLogger, FromScriptLogger, InitialConstellationState};
|
||||
pub use crate::pipeline::UnprivilegedPipelineContent;
|
||||
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
|
||||
pub use sandboxing::content_process_sandbox_profile;
|
||||
pub use crate::sandboxing::content_process_sandbox_profile;
|
||||
|
|
|
@ -7,9 +7,9 @@ use canvas_traits::webgl::WebGLPipeline;
|
|||
use compositing::CompositionPipeline;
|
||||
use compositing::CompositorProxy;
|
||||
use compositing::compositor_thread::Msg as CompositorMsg;
|
||||
use crate::event_loop::EventLoop;
|
||||
use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg};
|
||||
use euclid::{TypedSize2D, TypedScale};
|
||||
use event_loop::EventLoop;
|
||||
use gfx::font_cache_thread::FontCacheThread;
|
||||
use ipc_channel::Error;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
|
@ -555,9 +555,9 @@ impl UnprivilegedPipelineContent {
|
|||
|
||||
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
|
||||
pub fn spawn_multiprocess(self) -> Result<(), Error> {
|
||||
use crate::sandboxing::content_process_sandbox_profile;
|
||||
use gaol::sandbox::{self, Sandbox, SandboxMethods};
|
||||
use ipc_channel::ipc::IpcOneShotServer;
|
||||
use sandboxing::content_process_sandbox_profile;
|
||||
|
||||
impl CommandMethods for sandbox::Command {
|
||||
fn arg<T>(&mut self, arg: T)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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 browsingcontext::NewBrowsingContextInfo;
|
||||
use crate::browsingcontext::NewBrowsingContextInfo;
|
||||
use msg::constellation_msg::{BrowsingContextId, HistoryStateId, PipelineId, TopLevelBrowsingContextId};
|
||||
use script_traits::LoadData;
|
||||
use servo_url::ServoUrl;
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "debugger"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "deny_public_fields"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "devtools"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
//! Connection point for remote devtools that wish to investigate a particular Browsing Context's contents.
|
||||
//! Supports dynamic attaching and detaching which control notifications of navigation, etc.
|
||||
|
||||
use actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use actors::console::ConsoleActor;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::console::ConsoleActor;
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use devtools_traits::DevtoolScriptControlMsg::{self, WantsLiveNotifications};
|
||||
use protocol::JsonPacketStream;
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
//! Mediates interaction between the remote web console and equivalent functionality (object
|
||||
//! inspection, JS evaluation, autocompletion) in Servo.
|
||||
|
||||
use actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use actors::object::ObjectActor;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::object::ObjectActor;
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use devtools_traits::{CachedConsoleMessageTypes, DevtoolScriptControlMsg};
|
||||
use devtools_traits::CachedConsoleMessage;
|
||||
use devtools_traits::EvaluateJSReply::{ActorValue, BooleanValue, StringValue};
|
||||
use devtools_traits::EvaluateJSReply::{NullValue, NumberValue, VoidValue};
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use protocol::JsonPacketStream;
|
||||
use serde_json::{self, Map, Number, Value};
|
||||
use std::cell::RefCell;
|
||||
use std::net::TcpStream;
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use protocol::{ActorDescription, Method};
|
||||
use protocol::JsonPacketStream;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::{ActorDescription, Method};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use actors::timeline::HighResolutionStamp;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::timeline::HighResolutionStamp;
|
||||
use devtools_traits::DevtoolScriptControlMsg;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
//! Liberally derived from the [Firefox JS implementation]
|
||||
//! (http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/inspector.js).
|
||||
|
||||
use actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use devtools_traits::{ComputedNodeLayout, DevtoolScriptControlMsg, NodeInfo};
|
||||
use devtools_traits::DevtoolScriptControlMsg::{GetChildren, GetDocumentElement, GetRootNode};
|
||||
use devtools_traits::DevtoolScriptControlMsg::{GetLayout, ModifyAttribute};
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use protocol::JsonPacketStream;
|
||||
use serde_json::{self, Map, Value};
|
||||
use std::cell::RefCell;
|
||||
use std::net::TcpStream;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
//! (http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/webconsole.js).
|
||||
//! Handles interaction with the remote web console on network events (HTTP requests, responses) in Servo.
|
||||
|
||||
use actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use devtools_traits::HttpRequest as DevtoolsHttpRequest;
|
||||
use devtools_traits::HttpResponse as DevtoolsHttpResponse;
|
||||
use headers_core::HeaderMapExt;
|
||||
use headers_ext::{ContentType, Cookie};
|
||||
use http::{header, HeaderMap};
|
||||
use hyper::{Method, StatusCode};
|
||||
use protocol::JsonPacketStream;
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
use time;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use protocol::{ActorDescription, JsonPacketStream, Method};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::{ActorDescription, JsonPacketStream, Method};
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
/// (http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/root.js).
|
||||
/// Connection point for all new remote devtools interactions, providing lists of know actors
|
||||
/// that perform more specific actions (targets, addons, browser chrome, etc.)
|
||||
use actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use actors::browsing_context::{BrowsingContextActor, BrowsingContextActorMsg};
|
||||
use actors::device::DeviceActor;
|
||||
use actors::performance::PerformanceActor;
|
||||
use protocol::{ActorDescription, JsonPacketStream};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::browsing_context::{BrowsingContextActor, BrowsingContextActorMsg};
|
||||
use crate::actors::device::DeviceActor;
|
||||
use crate::actors::performance::PerformanceActor;
|
||||
use crate::protocol::{ActorDescription, JsonPacketStream};
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use protocol::JsonPacketStream;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use actors::framerate::FramerateActor;
|
||||
use actors::memory::{MemoryActor, TimelineMemoryReply};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::framerate::FramerateActor;
|
||||
use crate::actors::memory::{MemoryActor, TimelineMemoryReply};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use devtools_traits::{PreciseTime, TimelineMarker, TimelineMarkerType};
|
||||
use devtools_traits::DevtoolScriptControlMsg;
|
||||
use devtools_traits::DevtoolScriptControlMsg::{DropTimelineMarkers, SetTimelineMarkers};
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use protocol::JsonPacketStream;
|
||||
use serde::{Serialize, Serializer};
|
||||
use serde_json::{Map, Value};
|
||||
use std::cell::RefCell;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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 actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use devtools_traits::WorkerId;
|
||||
use serde_json::{Map, Value};
|
||||
use std::net::TcpStream;
|
||||
|
|
|
@ -27,27 +27,27 @@ extern crate serde_json;
|
|||
extern crate servo_channel;
|
||||
extern crate time;
|
||||
|
||||
use actor::{Actor, ActorRegistry};
|
||||
use actors::browsing_context::BrowsingContextActor;
|
||||
use actors::console::ConsoleActor;
|
||||
use actors::device::DeviceActor;
|
||||
use actors::emulation::EmulationActor;
|
||||
use actors::framerate::FramerateActor;
|
||||
use actors::inspector::InspectorActor;
|
||||
use actors::network_event::{EventActor, NetworkEventActor, ResponseStartMsg};
|
||||
use actors::performance::PerformanceActor;
|
||||
use actors::profiler::ProfilerActor;
|
||||
use actors::root::RootActor;
|
||||
use actors::stylesheets::StyleSheetsActor;
|
||||
use actors::thread::ThreadActor;
|
||||
use actors::timeline::TimelineActor;
|
||||
use actors::worker::WorkerActor;
|
||||
use crate::actor::{Actor, ActorRegistry};
|
||||
use crate::actors::browsing_context::BrowsingContextActor;
|
||||
use crate::actors::console::ConsoleActor;
|
||||
use crate::actors::device::DeviceActor;
|
||||
use crate::actors::emulation::EmulationActor;
|
||||
use crate::actors::framerate::FramerateActor;
|
||||
use crate::actors::inspector::InspectorActor;
|
||||
use crate::actors::network_event::{EventActor, NetworkEventActor, ResponseStartMsg};
|
||||
use crate::actors::performance::PerformanceActor;
|
||||
use crate::actors::profiler::ProfilerActor;
|
||||
use crate::actors::root::RootActor;
|
||||
use crate::actors::stylesheets::StyleSheetsActor;
|
||||
use crate::actors::thread::ThreadActor;
|
||||
use crate::actors::timeline::TimelineActor;
|
||||
use crate::actors::worker::WorkerActor;
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use devtools_traits::{ChromeToDevtoolsControlMsg, ConsoleMessage, DevtoolsControlMsg};
|
||||
use devtools_traits::{DevtoolScriptControlMsg, DevtoolsPageInfo, LogLevel, NetworkEvent};
|
||||
use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId};
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use protocol::JsonPacketStream;
|
||||
use servo_channel::{Receiver, Sender, channel};
|
||||
use std::borrow::ToOwned;
|
||||
use std::cell::RefCell;
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "devtools_traits"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -47,7 +47,7 @@ pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
|
|||
quote! (
|
||||
#s2
|
||||
|
||||
impl ::dom::bindings::inheritance::HasParent for #name {
|
||||
impl crate::dom::bindings::inheritance::HasParent for #name {
|
||||
type Parent = #ty;
|
||||
/// This is used in a type assertion to ensure that
|
||||
/// the source and webidls agree as to what the parent type is
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "domobject_derive"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -41,22 +41,22 @@ fn expand_dom_object(input: syn::DeriveInput) -> quote::Tokens {
|
|||
impl #impl_generics ::js::conversions::ToJSValConvertible for #name #ty_generics #where_clause {
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn to_jsval(&self,
|
||||
cx: *mut ::js::jsapi::JSContext,
|
||||
rval: ::js::rust::MutableHandleValue) {
|
||||
let object = ::dom::bindings::reflector::DomObject::reflector(self).get_jsobject();
|
||||
cx: *mut js::jsapi::JSContext,
|
||||
rval: js::rust::MutableHandleValue) {
|
||||
let object = crate::dom::bindings::reflector::DomObject::reflector(self).get_jsobject();
|
||||
object.to_jsval(cx, rval)
|
||||
}
|
||||
}
|
||||
|
||||
impl #impl_generics ::dom::bindings::reflector::DomObject for #name #ty_generics #where_clause {
|
||||
impl #impl_generics crate::dom::bindings::reflector::DomObject for #name #ty_generics #where_clause {
|
||||
#[inline]
|
||||
fn reflector(&self) -> &::dom::bindings::reflector::Reflector {
|
||||
fn reflector(&self) -> &crate::dom::bindings::reflector::Reflector {
|
||||
self.#first_field_name.reflector()
|
||||
}
|
||||
}
|
||||
|
||||
impl #impl_generics ::dom::bindings::reflector::MutDomObject for #name #ty_generics #where_clause {
|
||||
fn init_reflector(&mut self, obj: *mut ::js::jsapi::JSObject) {
|
||||
impl #impl_generics crate::dom::bindings::reflector::MutDomObject for #name #ty_generics #where_clause {
|
||||
fn init_reflector(&mut self, obj: *mut js::jsapi::JSObject) {
|
||||
self.#first_field_name.init_reflector(obj);
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ fn expand_dom_object(input: syn::DeriveInput) -> quote::Tokens {
|
|||
let mut generics = input.generics.clone();
|
||||
generics
|
||||
.params
|
||||
.push(parse_quote!(__T: ::dom::bindings::reflector::DomObject));
|
||||
.push(parse_quote!(__T: crate::dom::bindings::reflector::DomObject));
|
||||
|
||||
let (impl_generics, _, where_clause) = generics.split_for_impl();
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "embedder_traits"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
@ -18,5 +19,5 @@ msg = {path = "../msg"}
|
|||
serde = "1.0"
|
||||
servo_channel = {path = "../channel"}
|
||||
servo_url = {path = "../url"}
|
||||
style_traits = {path = "../style_traits"}
|
||||
style_traits = {path = "../style_traits", features = ["servo"]}
|
||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "servo_geometry"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -4,6 +4,7 @@ name = "gfx"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
@ -37,7 +38,7 @@ servo_arc = {path = "../servo_arc"}
|
|||
servo_atoms = {path = "../atoms"}
|
||||
servo_url = {path = "../url"}
|
||||
smallvec = { version = "0.6", features = ["std", "union"] }
|
||||
style = {path = "../style"}
|
||||
style = {path = "../style", features = ["servo"]}
|
||||
time = "0.1.12"
|
||||
unicode-bidi = {version = "0.3", features = ["with_serde"]}
|
||||
unicode-script = {version = "0.2", features = ["harfbuzz"]}
|
||||
|
|
|
@ -3,14 +3,17 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use app_units::Au;
|
||||
use crate::font_context::{FontContext, FontSource};
|
||||
use crate::font_template::FontTemplateDescriptor;
|
||||
use crate::platform::font::{FontHandle, FontTable};
|
||||
use crate::platform::font_context::FontContextHandle;
|
||||
pub use crate::platform::font_list::fallback_font_families;
|
||||
use crate::platform::font_template::FontTemplateData;
|
||||
use crate::text::Shaper;
|
||||
use crate::text::glyph::{ByteIndex, GlyphData, GlyphId, GlyphStore};
|
||||
use crate::text::shaping::ShaperMethods;
|
||||
use euclid::{Point2D, Rect, Size2D};
|
||||
use font_context::{FontContext, FontSource};
|
||||
use font_template::FontTemplateDescriptor;
|
||||
use ordered_float::NotNan;
|
||||
use platform::font::{FontHandle, FontTable};
|
||||
use platform::font_context::FontContextHandle;
|
||||
pub use platform::font_list::fallback_font_families;
|
||||
use platform::font_template::FontTemplateData;
|
||||
use servo_atoms::Atom;
|
||||
use smallvec::SmallVec;
|
||||
use std::borrow::ToOwned;
|
||||
|
@ -24,9 +27,6 @@ use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize, Ordering};
|
|||
use style::computed_values::{font_stretch, font_style, font_variant_caps, font_weight};
|
||||
use style::properties::style_structs::Font as FontStyleStruct;
|
||||
use style::values::computed::font::SingleFontFamily;
|
||||
use text::Shaper;
|
||||
use text::glyph::{ByteIndex, GlyphData, GlyphId, GlyphStore};
|
||||
use text::shaping::ShaperMethods;
|
||||
use time;
|
||||
use unicode_script::Script;
|
||||
use webrender_api;
|
||||
|
@ -64,13 +64,13 @@ pub trait FontHandleMethods: Sized {
|
|||
fn stretchiness(&self) -> font_stretch::T;
|
||||
|
||||
fn glyph_index(&self, codepoint: char) -> Option<GlyphId>;
|
||||
fn glyph_h_advance(&self, GlyphId) -> Option<FractionalPixel>;
|
||||
fn glyph_h_advance(&self, _: GlyphId) -> Option<FractionalPixel>;
|
||||
fn glyph_h_kerning(&self, glyph0: GlyphId, glyph1: GlyphId) -> FractionalPixel;
|
||||
|
||||
/// Can this font do basic horizontal LTR shaping without Harfbuzz?
|
||||
fn can_do_fast_shaping(&self) -> bool;
|
||||
fn metrics(&self) -> FontMetrics;
|
||||
fn table_for_tag(&self, FontTableTag) -> Option<FontTable>;
|
||||
fn table_for_tag(&self, _: FontTableTag) -> Option<FontTable>;
|
||||
|
||||
/// A unique identifier for the font, allowing comparison.
|
||||
fn identifier(&self) -> Atom;
|
||||
|
|
|
@ -3,19 +3,19 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use app_units::Au;
|
||||
use font::{FontFamilyDescriptor, FontFamilyName, FontSearchScope};
|
||||
use font_context::FontSource;
|
||||
use font_template::{FontTemplate, FontTemplateDescriptor};
|
||||
use crate::font::{FontFamilyDescriptor, FontFamilyName, FontSearchScope};
|
||||
use crate::font_context::FontSource;
|
||||
use crate::font_template::{FontTemplate, FontTemplateDescriptor};
|
||||
use crate::platform::font_context::FontContextHandle;
|
||||
use crate::platform::font_list::SANS_SERIF_FONT_FAMILY;
|
||||
use crate::platform::font_list::for_each_available_family;
|
||||
use crate::platform::font_list::for_each_variation;
|
||||
use crate::platform::font_list::system_default_family;
|
||||
use crate::platform::font_template::FontTemplateData;
|
||||
use fontsan;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use net_traits::{CoreResourceThread, FetchResponseMsg, fetch_async};
|
||||
use net_traits::request::{Destination, RequestInit};
|
||||
use platform::font_context::FontContextHandle;
|
||||
use platform::font_list::SANS_SERIF_FONT_FAMILY;
|
||||
use platform::font_list::for_each_available_family;
|
||||
use platform::font_list::for_each_variation;
|
||||
use platform::font_list::system_default_family;
|
||||
use platform::font_template::FontTemplateData;
|
||||
use servo_atoms::Atom;
|
||||
use servo_url::ServoUrl;
|
||||
use std::{fmt, f32, mem, thread};
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use app_units::Au;
|
||||
use crate::font::{Font, FontDescriptor, FontFamilyDescriptor, FontGroup, FontHandleMethods, FontRef};
|
||||
use crate::font_cache_thread::FontTemplateInfo;
|
||||
use crate::font_template::FontTemplateDescriptor;
|
||||
use crate::platform::font::FontHandle;
|
||||
pub use crate::platform::font_context::FontContextHandle;
|
||||
use fnv::FnvHasher;
|
||||
use font::{Font, FontDescriptor, FontFamilyDescriptor, FontGroup, FontHandleMethods, FontRef};
|
||||
use font_cache_thread::FontTemplateInfo;
|
||||
use font_template::FontTemplateDescriptor;
|
||||
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
|
||||
use platform::font::FontHandle;
|
||||
pub use platform::font_context::FontContextHandle;
|
||||
use servo_arc::Arc;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* 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 font::FontHandleMethods;
|
||||
use platform::font::FontHandle;
|
||||
use platform::font_context::FontContextHandle;
|
||||
use platform::font_template::FontTemplateData;
|
||||
use crate::font::FontHandleMethods;
|
||||
use crate::platform::font::FontHandle;
|
||||
use crate::platform::font_context::FontContextHandle;
|
||||
use crate::platform::font_template::FontTemplateData;
|
||||
use servo_atoms::Atom;
|
||||
use std::fmt::{Debug, Error, Formatter};
|
||||
use std::io::Error as IoError;
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
* 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 crate::text::util::is_cjk;
|
||||
use std::cell::RefCell;
|
||||
use std::fs::File;
|
||||
use std::io::{self, Read};
|
||||
use std::path::Path;
|
||||
use text::util::is_cjk;
|
||||
use ucd::{Codepoint, UnicodeBlock};
|
||||
use xml5ever::Attribute;
|
||||
use xml5ever::driver::parse_document;
|
||||
|
|
|
@ -3,8 +3,12 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use app_units::Au;
|
||||
use font::{FontHandleMethods, FontMetrics, FontTableMethods};
|
||||
use font::{FontTableTag, FractionalPixel, GPOS, GSUB, KERN};
|
||||
use crate::font::{FontHandleMethods, FontMetrics, FontTableMethods};
|
||||
use crate::font::{FontTableTag, FractionalPixel, GPOS, GSUB, KERN};
|
||||
use crate::platform::font_context::FontContextHandle;
|
||||
use crate::platform::font_template::FontTemplateData;
|
||||
use crate::text::glyph::GlyphId;
|
||||
use crate::text::util::fixed_to_float;
|
||||
use freetype::freetype::{FT_Done_Face, FT_New_Face, FT_New_Memory_Face};
|
||||
use freetype::freetype::{FT_F26Dot6, FT_Face, FT_FaceRec};
|
||||
use freetype::freetype::{FT_Get_Char_Index, FT_Get_Postscript_Name};
|
||||
|
@ -16,8 +20,6 @@ use freetype::freetype::{FT_SizeRec, FT_Size_Metrics, FT_UInt, FT_Vector};
|
|||
use freetype::freetype::FT_Sfnt_Tag;
|
||||
use freetype::succeeded;
|
||||
use freetype::tt_os2::TT_OS2;
|
||||
use platform::font_context::FontContextHandle;
|
||||
use platform::font_template::FontTemplateData;
|
||||
use servo_atoms::Atom;
|
||||
use std::{mem, ptr};
|
||||
use std::ffi::CString;
|
||||
|
@ -27,8 +29,6 @@ use style::computed_values::font_stretch::T as FontStretch;
|
|||
use style::computed_values::font_weight::T as FontWeight;
|
||||
use style::values::computed::font::FontStyle;
|
||||
use super::c_str_to_string;
|
||||
use text::glyph::GlyphId;
|
||||
use text::util::fixed_to_float;
|
||||
|
||||
// This constant is not present in the freetype
|
||||
// bindings due to bindgen not handling the way
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* 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 crate::text::util::is_cjk;
|
||||
use fontconfig::fontconfig::{FcChar8, FcResultMatch, FcSetSystem};
|
||||
use fontconfig::fontconfig::{FcConfigGetCurrent, FcConfigGetFonts, FcConfigSubstitute};
|
||||
use fontconfig::fontconfig::{FcDefaultSubstitute, FcFontMatch, FcNameParse, FcPatternGetString};
|
||||
|
@ -13,7 +14,6 @@ use libc::{c_char, c_int};
|
|||
use std::ffi::CString;
|
||||
use std::ptr;
|
||||
use super::c_str_to_string;
|
||||
use text::util::is_cjk;
|
||||
|
||||
static FC_FAMILY: &'static [u8] = b"family\0";
|
||||
static FC_FILE: &'static [u8] = b"file\0";
|
||||
|
|
|
@ -13,16 +13,16 @@ use core_graphics::geometry::CGRect;
|
|||
use core_text::font::CTFont;
|
||||
use core_text::font_descriptor::{SymbolicTraitAccessors, TraitAccessors};
|
||||
use core_text::font_descriptor::kCTFontDefaultOrientation;
|
||||
use font::{FontHandleMethods, FontMetrics, FontTableMethods, FontTableTag, FractionalPixel};
|
||||
use font::{GPOS, GSUB, KERN};
|
||||
use platform::font_template::FontTemplateData;
|
||||
use platform::macos::font_context::FontContextHandle;
|
||||
use crate::font::{FontHandleMethods, FontMetrics, FontTableMethods, FontTableTag, FractionalPixel};
|
||||
use crate::font::{GPOS, GSUB, KERN};
|
||||
use crate::platform::font_template::FontTemplateData;
|
||||
use crate::platform::macos::font_context::FontContextHandle;
|
||||
use crate::text::glyph::GlyphId;
|
||||
use servo_atoms::Atom;
|
||||
use std::{fmt, ptr};
|
||||
use std::ops::Range;
|
||||
use std::sync::Arc;
|
||||
use style::values::computed::font::{FontStretch, FontStyle, FontWeight};
|
||||
use text::glyph::GlyphId;
|
||||
|
||||
const KERN_PAIR_LEN: usize = 6;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use core_text;
|
||||
use text::util::unicode_plane;
|
||||
use crate::text::util::unicode_plane;
|
||||
use ucd::{Codepoint, UnicodeBlock};
|
||||
|
||||
pub fn for_each_available_family<F>(mut callback: F)
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
pub use platform::freetype::{font, font_context};
|
||||
pub use crate::platform::freetype::{font, font_context};
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
pub use platform::freetype::{font_list, font_template};
|
||||
pub use crate::platform::freetype::{font_list, font_template};
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
pub use platform::windows::{font, font_context, font_list, font_template};
|
||||
pub use crate::platform::windows::{font, font_context, font_list, font_template};
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub use platform::macos::{font, font_context, font_list, font_template};
|
||||
pub use crate::platform::macos::{font, font_context, font_list, font_template};
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
mod freetype {
|
||||
|
|
|
@ -7,14 +7,15 @@
|
|||
// renderer moves to a sandboxed process.
|
||||
|
||||
use app_units::Au;
|
||||
use crate::font::{FontHandleMethods, FontMetrics, FontTableMethods};
|
||||
use crate::font::{FontTableTag, FractionalPixel};
|
||||
use crate::platform::font_template::FontTemplateData;
|
||||
use crate::platform::windows::font_context::FontContextHandle;
|
||||
use crate::platform::windows::font_list::font_from_atom;
|
||||
use crate::text::glyph::GlyphId;
|
||||
use dwrote;
|
||||
use dwrote::{Font, FontFace, FontFile};
|
||||
use dwrote::{FontStretch, FontStyle};
|
||||
use font::{FontHandleMethods, FontMetrics, FontTableMethods};
|
||||
use font::{FontTableTag, FractionalPixel};
|
||||
use platform::font_template::FontTemplateData;
|
||||
use platform::windows::font_context::FontContextHandle;
|
||||
use platform::windows::font_list::font_from_atom;
|
||||
use servo_atoms::Atom;
|
||||
use std::fmt;
|
||||
use std::ops::Deref;
|
||||
|
@ -25,7 +26,6 @@ use style::values::computed::font::FontStyle as StyleFontStyle;
|
|||
use style::values::generics::NonNegative;
|
||||
use style::values::generics::font::FontStyle as GenericFontStyle;
|
||||
use style::values::specified::font::FontStretchKeyword;
|
||||
use text::glyph::GlyphId;
|
||||
use truetype;
|
||||
|
||||
// 1em = 12pt = 16px, assuming 72 points per inch and 96 px per inch
|
||||
|
|
|
@ -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 crate::text::util::unicode_plane;
|
||||
use dwrote::{Font, FontDescriptor, FontCollection};
|
||||
use servo_atoms::Atom;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Mutex;
|
||||
use std::sync::atomic::{Ordering, AtomicUsize};
|
||||
use text::util::unicode_plane;
|
||||
use ucd::{Codepoint, UnicodeBlock};
|
||||
|
||||
lazy_static! {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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 platform::windows::font_list::{descriptor_from_atom, font_from_atom};
|
||||
use crate::platform::windows::font_list::{descriptor_from_atom, font_from_atom};
|
||||
use servo_atoms::Atom;
|
||||
use std::fmt;
|
||||
use std::io;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* 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/. */
|
||||
|
||||
pub use text::shaping::Shaper;
|
||||
pub use text::text_run::TextRun;
|
||||
pub use crate::text::shaping::Shaper;
|
||||
pub use crate::text::text_run::TextRun;
|
||||
|
||||
pub mod glyph;
|
||||
pub mod shaping;
|
||||
|
|
|
@ -5,40 +5,40 @@
|
|||
#![allow(unsafe_code)]
|
||||
|
||||
use app_units::Au;
|
||||
use crate::font::{ShapingFlags, Font, FontTableMethods, FontTableTag, ShapingOptions, KERN};
|
||||
use crate::harfbuzz::{HB_DIRECTION_LTR, HB_DIRECTION_RTL, HB_MEMORY_MODE_READONLY};
|
||||
use crate::harfbuzz::{hb_blob_create, hb_face_create_for_tables};
|
||||
use crate::harfbuzz::{hb_buffer_create, hb_font_destroy};
|
||||
use crate::harfbuzz::{hb_buffer_get_glyph_infos, hb_shape};
|
||||
use crate::harfbuzz::{hb_buffer_set_direction, hb_buffer_set_script};
|
||||
use crate::harfbuzz::{hb_buffer_t, hb_codepoint_t, hb_font_funcs_t};
|
||||
use crate::harfbuzz::{hb_face_t, hb_font_t};
|
||||
use crate::harfbuzz::{hb_position_t, hb_tag_t};
|
||||
use crate::harfbuzz::hb_blob_t;
|
||||
use crate::harfbuzz::hb_bool_t;
|
||||
use crate::harfbuzz::hb_buffer_add_utf8;
|
||||
use crate::harfbuzz::hb_buffer_destroy;
|
||||
use crate::harfbuzz::hb_buffer_get_glyph_positions;
|
||||
use crate::harfbuzz::hb_buffer_get_length;
|
||||
use crate::harfbuzz::hb_face_destroy;
|
||||
use crate::harfbuzz::hb_feature_t;
|
||||
use crate::harfbuzz::hb_font_create;
|
||||
use crate::harfbuzz::hb_font_funcs_create;
|
||||
use crate::harfbuzz::hb_font_funcs_set_glyph_h_advance_func;
|
||||
use crate::harfbuzz::hb_font_funcs_set_glyph_h_kerning_func;
|
||||
use crate::harfbuzz::hb_font_funcs_set_nominal_glyph_func;
|
||||
use crate::harfbuzz::hb_font_set_funcs;
|
||||
use crate::harfbuzz::hb_font_set_ppem;
|
||||
use crate::harfbuzz::hb_font_set_scale;
|
||||
use crate::harfbuzz::hb_glyph_info_t;
|
||||
use crate::harfbuzz::hb_glyph_position_t;
|
||||
use crate::platform::font::FontTable;
|
||||
use crate::text::glyph::{ByteIndex, GlyphData, GlyphId, GlyphStore};
|
||||
use crate::text::shaping::ShaperMethods;
|
||||
use crate::text::util::{fixed_to_float, float_to_fixed, is_bidi_control};
|
||||
use euclid::Point2D;
|
||||
use font::{ShapingFlags, Font, FontTableMethods, FontTableTag, ShapingOptions, KERN};
|
||||
use harfbuzz::{HB_DIRECTION_LTR, HB_DIRECTION_RTL, HB_MEMORY_MODE_READONLY};
|
||||
use harfbuzz::{hb_blob_create, hb_face_create_for_tables};
|
||||
use harfbuzz::{hb_buffer_create, hb_font_destroy};
|
||||
use harfbuzz::{hb_buffer_get_glyph_infos, hb_shape};
|
||||
use harfbuzz::{hb_buffer_set_direction, hb_buffer_set_script};
|
||||
use harfbuzz::{hb_buffer_t, hb_codepoint_t, hb_font_funcs_t};
|
||||
use harfbuzz::{hb_face_t, hb_font_t};
|
||||
use harfbuzz::{hb_position_t, hb_tag_t};
|
||||
use harfbuzz::hb_blob_t;
|
||||
use harfbuzz::hb_bool_t;
|
||||
use harfbuzz::hb_buffer_add_utf8;
|
||||
use harfbuzz::hb_buffer_destroy;
|
||||
use harfbuzz::hb_buffer_get_glyph_positions;
|
||||
use harfbuzz::hb_buffer_get_length;
|
||||
use harfbuzz::hb_face_destroy;
|
||||
use harfbuzz::hb_feature_t;
|
||||
use harfbuzz::hb_font_create;
|
||||
use harfbuzz::hb_font_funcs_create;
|
||||
use harfbuzz::hb_font_funcs_set_glyph_h_advance_func;
|
||||
use harfbuzz::hb_font_funcs_set_glyph_h_kerning_func;
|
||||
use harfbuzz::hb_font_funcs_set_nominal_glyph_func;
|
||||
use harfbuzz::hb_font_set_funcs;
|
||||
use harfbuzz::hb_font_set_ppem;
|
||||
use harfbuzz::hb_font_set_scale;
|
||||
use harfbuzz::hb_glyph_info_t;
|
||||
use harfbuzz::hb_glyph_position_t;
|
||||
use platform::font::FontTable;
|
||||
use std::{char, cmp, ptr};
|
||||
use std::os::raw::{c_char, c_int, c_uint, c_void};
|
||||
use text::glyph::{ByteIndex, GlyphData, GlyphId, GlyphStore};
|
||||
use text::shaping::ShaperMethods;
|
||||
use text::util::{fixed_to_float, float_to_fixed, is_bidi_control};
|
||||
|
||||
const NO_GLYPH: i32 = -1;
|
||||
const LIGA: u32 = ot_tag!('l', 'i', 'g', 'a');
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
//!
|
||||
//! Currently, only harfbuzz bindings are implemented.
|
||||
|
||||
use font::ShapingOptions;
|
||||
use text::glyph::GlyphStore;
|
||||
use crate::font::ShapingOptions;
|
||||
use crate::text::glyph::GlyphStore;
|
||||
|
||||
pub use text::shaping::harfbuzz::Shaper;
|
||||
pub use crate::text::shaping::harfbuzz::Shaper;
|
||||
|
||||
pub mod harfbuzz;
|
||||
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use app_units::Au;
|
||||
use font::{Font, FontHandleMethods, FontMetrics, ShapingFlags};
|
||||
use font::{RunMetrics, ShapingOptions};
|
||||
use platform::font_template::FontTemplateData;
|
||||
use crate::font::{Font, FontHandleMethods, FontMetrics, ShapingFlags};
|
||||
use crate::font::{RunMetrics, ShapingOptions};
|
||||
use crate::platform::font_template::FontTemplateData;
|
||||
use crate::text::glyph::{ByteIndex, GlyphStore};
|
||||
use range::Range;
|
||||
use std::cell::Cell;
|
||||
use std::cmp::{Ordering, max};
|
||||
use std::slice::Iter;
|
||||
use std::sync::Arc;
|
||||
use style::str::char_is_whitespace;
|
||||
use text::glyph::{ByteIndex, GlyphStore};
|
||||
use unicode_bidi as bidi;
|
||||
use webrender_api;
|
||||
use xi_unicode::LineBreakLeafIter;
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "gfx_traits"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "jstraceable_derive"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -21,16 +21,16 @@ fn js_traceable_derive(s: synstructure::Structure) -> quote::Tokens {
|
|||
let ident = param.ident;
|
||||
where_clause
|
||||
.predicates
|
||||
.push(parse_quote!(#ident: ::dom::bindings::trace::JSTraceable))
|
||||
.push(parse_quote!(#ident: crate::dom::bindings::trace::JSTraceable))
|
||||
}
|
||||
|
||||
let tokens = quote! {
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl #impl_generics ::dom::bindings::trace::JSTraceable for #name #ty_generics #where_clause {
|
||||
unsafe impl #impl_generics crate::dom::bindings::trace::JSTraceable for #name #ty_generics #where_clause {
|
||||
#[inline]
|
||||
#[allow(unused_variables, unused_imports)]
|
||||
unsafe fn trace(&self, tracer: *mut ::js::jsapi::JSTracer) {
|
||||
use ::dom::bindings::trace::JSTraceable;
|
||||
unsafe fn trace(&self, tracer: *mut js::jsapi::JSTracer) {
|
||||
use crate::dom::bindings::trace::JSTraceable;
|
||||
match *self {
|
||||
#match_body
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ name = "layout"
|
|||
version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
license = "MPL-2.0"
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
|
||||
//! CSS transitions and animations.
|
||||
|
||||
use context::LayoutContext;
|
||||
use display_list::items::OpaqueNode;
|
||||
use flow::{Flow, GetBaseFlow};
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::items::OpaqueNode;
|
||||
use crate::flow::{Flow, GetBaseFlow};
|
||||
use crate::opaque_node::OpaqueNodeMethods;
|
||||
use fxhash::FxHashMap;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use opaque_node::OpaqueNodeMethods;
|
||||
use script_traits::{AnimationState, ConstellationControlMsg, LayoutMsg as ConstellationMsg};
|
||||
use script_traits::UntrustedNodeAddress;
|
||||
use servo_channel::Receiver;
|
||||
|
|
|
@ -26,22 +26,23 @@
|
|||
//! http://dev.w3.org/csswg/css-sizing/
|
||||
|
||||
use app_units::{Au, MAX_AU};
|
||||
use context::LayoutContext;
|
||||
use display_list::{BlockFlowDisplayListBuilding, BorderPaintingMode};
|
||||
use display_list::{DisplayListBuildState, StackingContextCollectionFlags};
|
||||
use display_list::StackingContextCollectionState;
|
||||
use display_list::items::DisplayListSection;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::{BlockFlowDisplayListBuilding, BorderPaintingMode};
|
||||
use crate::display_list::{DisplayListBuildState, StackingContextCollectionFlags};
|
||||
use crate::display_list::StackingContextCollectionState;
|
||||
use crate::display_list::items::DisplayListSection;
|
||||
use crate::floats::{ClearType, FloatKind, Floats, PlacementInfo};
|
||||
use crate::flow::{BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonfloatedFlag, GetBaseFlow};
|
||||
use crate::flow::{ImmutableFlowUtils, LateAbsolutePositionInfo, OpaqueFlow, FragmentationContext, FlowFlags};
|
||||
use crate::flow_list::FlowList;
|
||||
use crate::fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow, FragmentFlags};
|
||||
use crate::incremental::RelayoutMode;
|
||||
use crate::layout_debug;
|
||||
use crate::model::{AdjoiningMargins, CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo, MaybeAuto};
|
||||
use crate::sequential;
|
||||
use crate::traversal::PreorderFlowTraversal;
|
||||
use euclid::{Point2D, Rect, SideOffsets2D, Size2D};
|
||||
use floats::{ClearType, FloatKind, Floats, PlacementInfo};
|
||||
use flow::{BaseFlow, EarlyAbsolutePositionInfo, Flow, FlowClass, ForceNonfloatedFlag, GetBaseFlow};
|
||||
use flow::{ImmutableFlowUtils, LateAbsolutePositionInfo, OpaqueFlow, FragmentationContext, FlowFlags};
|
||||
use flow_list::FlowList;
|
||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow, FragmentFlags};
|
||||
use gfx_traits::print_tree::PrintTree;
|
||||
use incremental::RelayoutMode;
|
||||
use layout_debug;
|
||||
use model::{AdjoiningMargins, CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo, MaybeAuto};
|
||||
use sequential;
|
||||
use serde::{Serialize, Serializer};
|
||||
use servo_geometry::MaxRect;
|
||||
use std::cmp::{max, min};
|
||||
|
@ -59,7 +60,6 @@ use style::properties::ComputedValues;
|
|||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
use style::values::computed::{LengthOrPercentageOrNone, LengthOrPercentage};
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use traversal::PreorderFlowTraversal;
|
||||
|
||||
/// Information specific to floated blocks.
|
||||
#[derive(Clone, Serialize)]
|
||||
|
@ -591,7 +591,7 @@ pub enum FormattingContextType {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl ::flow::HasBaseFlow for BlockFlow {}
|
||||
unsafe impl crate::flow::HasBaseFlow for BlockFlow {}
|
||||
|
||||
// A block formatting context.
|
||||
#[derive(Serialize)]
|
||||
|
@ -2585,7 +2585,7 @@ impl Flow for BlockFlow {
|
|||
self.build_display_list_for_block(state, BorderPaintingMode::Separate);
|
||||
}
|
||||
|
||||
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) {
|
||||
fn repair_style(&mut self, new_style: &crate::ServoArc<ComputedValues>) {
|
||||
self.fragment.repair_style(new_style)
|
||||
}
|
||||
|
||||
|
|
|
@ -11,25 +11,35 @@
|
|||
//! maybe it's an absolute or fixed position thing that hasn't found its containing block yet.
|
||||
//! Construction items bubble up the tree from children to parents until they find their homes.
|
||||
|
||||
use ServoArc;
|
||||
use block::BlockFlow;
|
||||
use context::{LayoutContext, with_thread_local_font_context};
|
||||
use data::{LayoutDataFlags, LayoutData};
|
||||
use display_list::items::OpaqueNode;
|
||||
use flex::FlexFlow;
|
||||
use floats::FloatKind;
|
||||
use flow::{AbsoluteDescendants, Flow, FlowClass, GetBaseFlow, ImmutableFlowUtils};
|
||||
use flow::{FlowFlags, MutableFlowUtils, MutableOwnedFlowUtils};
|
||||
use flow_ref::FlowRef;
|
||||
use fragment::{CanvasFragmentInfo, Fragment, FragmentFlags, GeneratedContentInfo, IframeFragmentInfo};
|
||||
use fragment::{ImageFragmentInfo, InlineAbsoluteFragmentInfo, InlineAbsoluteHypotheticalFragmentInfo};
|
||||
use fragment::{InlineBlockFragmentInfo, MediaFragmentInfo, SpecificFragmentInfo, SvgFragmentInfo};
|
||||
use fragment::{TableColumnFragmentInfo, UnscannedTextFragmentInfo, WhitespaceStrippingResult};
|
||||
use inline::{InlineFlow, InlineFragmentNodeInfo, InlineFragmentNodeFlags};
|
||||
use linked_list::prepend_from;
|
||||
use list_item::{ListItemFlow, ListStyleTypeContent};
|
||||
use multicol::{MulticolColumnFlow, MulticolFlow};
|
||||
use parallel;
|
||||
use crate::ServoArc;
|
||||
use crate::block::BlockFlow;
|
||||
use crate::context::{LayoutContext, with_thread_local_font_context};
|
||||
use crate::data::{LayoutDataFlags, LayoutData};
|
||||
use crate::display_list::items::OpaqueNode;
|
||||
use crate::flex::FlexFlow;
|
||||
use crate::floats::FloatKind;
|
||||
use crate::flow::{AbsoluteDescendants, Flow, FlowClass, GetBaseFlow, ImmutableFlowUtils};
|
||||
use crate::flow::{FlowFlags, MutableFlowUtils, MutableOwnedFlowUtils};
|
||||
use crate::flow_ref::FlowRef;
|
||||
use crate::fragment::{CanvasFragmentInfo, Fragment, FragmentFlags, GeneratedContentInfo, IframeFragmentInfo};
|
||||
use crate::fragment::{ImageFragmentInfo, InlineAbsoluteFragmentInfo, InlineAbsoluteHypotheticalFragmentInfo};
|
||||
use crate::fragment::{InlineBlockFragmentInfo, MediaFragmentInfo, SpecificFragmentInfo, SvgFragmentInfo};
|
||||
use crate::fragment::{TableColumnFragmentInfo, UnscannedTextFragmentInfo, WhitespaceStrippingResult};
|
||||
use crate::inline::{InlineFlow, InlineFragmentNodeInfo, InlineFragmentNodeFlags};
|
||||
use crate::linked_list::prepend_from;
|
||||
use crate::list_item::{ListItemFlow, ListStyleTypeContent};
|
||||
use crate::multicol::{MulticolColumnFlow, MulticolFlow};
|
||||
use crate::parallel;
|
||||
use crate::table::TableFlow;
|
||||
use crate::table_caption::TableCaptionFlow;
|
||||
use crate::table_cell::TableCellFlow;
|
||||
use crate::table_colgroup::TableColGroupFlow;
|
||||
use crate::table_row::TableRowFlow;
|
||||
use crate::table_rowgroup::TableRowGroupFlow;
|
||||
use crate::table_wrapper::TableWrapperFlow;
|
||||
use crate::text::TextRunScanner;
|
||||
use crate::traversal::PostorderNodeMutTraversal;
|
||||
use crate::wrapper::{LayoutNodeLayoutData, TextContent, ThreadSafeLayoutNodeHelpers};
|
||||
use script_layout_interface::{LayoutElementType, LayoutNodeType, is_image_data};
|
||||
use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
||||
use servo_config::opts;
|
||||
|
@ -53,16 +63,6 @@ use style::selector_parser::{PseudoElement, RestyleDamage};
|
|||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
use style::values::generics::counters::ContentItem;
|
||||
use style::values::generics::url::UrlOrNone as ImageUrlOrNone;
|
||||
use table::TableFlow;
|
||||
use table_caption::TableCaptionFlow;
|
||||
use table_cell::TableCellFlow;
|
||||
use table_colgroup::TableColGroupFlow;
|
||||
use table_row::TableRowFlow;
|
||||
use table_rowgroup::TableRowGroupFlow;
|
||||
use table_wrapper::TableWrapperFlow;
|
||||
use text::TextRunScanner;
|
||||
use traversal::PostorderNodeMutTraversal;
|
||||
use wrapper::{LayoutNodeLayoutData, TextContent, ThreadSafeLayoutNodeHelpers};
|
||||
|
||||
/// The results of flow construction for a DOM node.
|
||||
#[derive(Clone)]
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
//! Data needed by the layout thread.
|
||||
|
||||
use display_list::items::{WebRenderImageInfo, OpaqueNode};
|
||||
use crate::display_list::items::{WebRenderImageInfo, OpaqueNode};
|
||||
use crate::opaque_node::OpaqueNodeMethods;
|
||||
use fnv::FnvHasher;
|
||||
use gfx::font_cache_thread::FontCacheThread;
|
||||
use gfx::font_context::FontContext;
|
||||
|
@ -12,7 +13,6 @@ use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
|
|||
use msg::constellation_msg::PipelineId;
|
||||
use net_traits::image_cache::{CanRequestImages, ImageCache, ImageState};
|
||||
use net_traits::image_cache::{ImageOrMetadataAvailable, UsePlaceholder};
|
||||
use opaque_node::OpaqueNodeMethods;
|
||||
use parking_lot::RwLock;
|
||||
use script_layout_interface::{PendingImage, PendingImageState};
|
||||
use script_traits::Painter;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use atomic_refcell::AtomicRefCell;
|
||||
use construct::ConstructionResult;
|
||||
use crate::construct::ConstructionResult;
|
||||
use script_layout_interface::StyleData;
|
||||
|
||||
#[repr(C)]
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
// FIXME(rust-lang/rust#26264): Remove GenericBackgroundSize.
|
||||
|
||||
use app_units::Au;
|
||||
use display_list::border;
|
||||
use crate::display_list::border;
|
||||
use crate::model::MaybeAuto;
|
||||
use euclid::{Point2D, Rect, SideOffsets2D, Size2D};
|
||||
use model::MaybeAuto;
|
||||
use style::computed_values::background_attachment::single_value::T as BackgroundAttachment;
|
||||
use style::computed_values::background_clip::single_value::T as BackgroundClip;
|
||||
use style::computed_values::background_origin::single_value::T as BackgroundOrigin;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// FIXME(rust-lang/rust#26264): Remove GenericBorderImageSideWidth.
|
||||
|
||||
use app_units::Au;
|
||||
use display_list::ToLayout;
|
||||
use crate::display_list::ToLayout;
|
||||
use euclid::{Rect, SideOffsets2D, Size2D};
|
||||
use style::computed_values::border_image_outset::T as BorderImageOutset;
|
||||
use style::properties::style_structs::Border;
|
||||
|
|
|
@ -9,35 +9,36 @@
|
|||
//! paint.
|
||||
|
||||
use app_units::{Au, AU_PER_PX};
|
||||
use block::BlockFlow;
|
||||
use canvas_traits::canvas::{CanvasMsg, FromLayoutMsg};
|
||||
use context::LayoutContext;
|
||||
use display_list::ToLayout;
|
||||
use display_list::background::{self, get_cyclic};
|
||||
use display_list::border;
|
||||
use display_list::gradient;
|
||||
use display_list::items::{BaseDisplayItem, BLUR_INFLATION_FACTOR, ClipScrollNode};
|
||||
use display_list::items::{ClipScrollNodeIndex, ClipScrollNodeType, ClippingAndScrolling};
|
||||
use display_list::items::{ClippingRegion, DisplayItem, DisplayItemMetadata, DisplayList};
|
||||
use display_list::items::{DisplayListSection, CommonDisplayItem};
|
||||
use display_list::items::{IframeDisplayItem, OpaqueNode};
|
||||
use display_list::items::{PopAllTextShadowsDisplayItem, PushTextShadowDisplayItem};
|
||||
use display_list::items::{StackingContext, StackingContextType, StickyFrameData};
|
||||
use display_list::items::{TextOrientation, WebRenderImageInfo};
|
||||
use crate::block::BlockFlow;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::ToLayout;
|
||||
use crate::display_list::background::{self, get_cyclic};
|
||||
use crate::display_list::border;
|
||||
use crate::display_list::gradient;
|
||||
use crate::display_list::items::{BaseDisplayItem, BLUR_INFLATION_FACTOR, ClipScrollNode};
|
||||
use crate::display_list::items::{ClipScrollNodeIndex, ClipScrollNodeType, ClippingAndScrolling};
|
||||
use crate::display_list::items::{ClippingRegion, DisplayItem, DisplayItemMetadata, DisplayList};
|
||||
use crate::display_list::items::{DisplayListSection, CommonDisplayItem};
|
||||
use crate::display_list::items::{IframeDisplayItem, OpaqueNode};
|
||||
use crate::display_list::items::{PopAllTextShadowsDisplayItem, PushTextShadowDisplayItem};
|
||||
use crate::display_list::items::{StackingContext, StackingContextType, StickyFrameData};
|
||||
use crate::display_list::items::{TextOrientation, WebRenderImageInfo};
|
||||
use crate::flex::FlexFlow;
|
||||
use crate::flow::{BaseFlow, Flow, FlowFlags};
|
||||
use crate::flow_ref::FlowRef;
|
||||
use crate::fragment::{CanvasFragmentSource, CoordinateSystem, Fragment, ScannedTextFragmentInfo};
|
||||
use crate::fragment::SpecificFragmentInfo;
|
||||
use crate::inline::{InlineFlow, InlineFragmentNodeFlags};
|
||||
use crate::list_item::ListItemFlow;
|
||||
use crate::model::MaybeAuto;
|
||||
use crate::table_cell::CollapsedBordersForCell;
|
||||
use euclid::{rect, Point2D, Rect, SideOffsets2D, Size2D, TypedSize2D, Vector2D};
|
||||
use flex::FlexFlow;
|
||||
use flow::{BaseFlow, Flow, FlowFlags};
|
||||
use flow_ref::FlowRef;
|
||||
use fnv::FnvHashMap;
|
||||
use fragment::{CanvasFragmentSource, CoordinateSystem, Fragment, ScannedTextFragmentInfo};
|
||||
use fragment::SpecificFragmentInfo;
|
||||
use gfx::text::TextRun;
|
||||
use gfx::text::glyph::ByteIndex;
|
||||
use gfx_traits::{combine_id_with_fragment_type, FragmentType, StackingContextId};
|
||||
use inline::{InlineFlow, InlineFragmentNodeFlags};
|
||||
use ipc_channel::ipc;
|
||||
use list_item::ListItemFlow;
|
||||
use model::MaybeAuto;
|
||||
use msg::constellation_msg::{BrowsingContextId, PipelineId};
|
||||
use net_traits::image_cache::UsePlaceholder;
|
||||
use range::Range;
|
||||
|
@ -65,7 +66,6 @@ use style::values::generics::ui::Cursor;
|
|||
use style_traits::CSSPixel;
|
||||
use style_traits::ToCss;
|
||||
use style_traits::cursor::CursorKind;
|
||||
use table_cell::CollapsedBordersForCell;
|
||||
use webrender_api::{self, BorderDetails, BorderRadius, BorderSide, BoxShadowClipMode, ColorF};
|
||||
use webrender_api::{ExternalScrollId, FilterOp, GlyphInstance, ImageRendering, LayoutRect};
|
||||
use webrender_api::{LayoutSize, LayoutTransform, LayoutVector2D, LineStyle, NinePatchBorder};
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// FIXME(rust-lang/rust#26264): Remove GenericEndingShape and GenericGradientItem.
|
||||
|
||||
use app_units::Au;
|
||||
use display_list::ToLayout;
|
||||
use crate::display_list::ToLayout;
|
||||
use euclid::{Point2D, Size2D, Vector2D};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{Angle, GradientItem, LengthOrPercentage, Percentage, Position};
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
// This might be achieved by sharing types between WR and Servo display lists, or
|
||||
// completely converting layout to directly generate WebRender display lists, for example.
|
||||
|
||||
use display_list::items::{ClipScrollNode, ClipScrollNodeIndex, ClipScrollNodeType};
|
||||
use display_list::items::{DisplayItem, DisplayList, StackingContextType};
|
||||
use crate::display_list::items::{ClipScrollNode, ClipScrollNodeIndex, ClipScrollNodeType};
|
||||
use crate::display_list::items::{DisplayItem, DisplayList, StackingContextType};
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use webrender_api::{self, ClipAndScrollInfo, ClipId, DisplayListBuilder, RasterSpace};
|
||||
use webrender_api::{LayoutPoint, SpecificDisplayItem};
|
||||
|
|
|
@ -5,17 +5,18 @@
|
|||
//! Layout for elements with a CSS `display` property of `flex`.
|
||||
|
||||
use app_units::{Au, MAX_AU};
|
||||
use block::{AbsoluteAssignBSizesTraversal, BlockFlow, MarginsMayCollapseFlag};
|
||||
use context::LayoutContext;
|
||||
use display_list::{DisplayListBuildState, FlexFlowDisplayListBuilding};
|
||||
use display_list::StackingContextCollectionState;
|
||||
use crate::block::{AbsoluteAssignBSizesTraversal, BlockFlow, MarginsMayCollapseFlag};
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::{DisplayListBuildState, FlexFlowDisplayListBuilding};
|
||||
use crate::display_list::StackingContextCollectionState;
|
||||
use crate::floats::FloatKind;
|
||||
use crate::flow::{Flow, FlowClass, GetBaseFlow, ImmutableFlowUtils, OpaqueFlow, FlowFlags};
|
||||
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use crate::layout_debug;
|
||||
use crate::model::{AdjoiningMargins, CollapsibleMargins};
|
||||
use crate::model::{IntrinsicISizes, MaybeAuto, SizeConstraint};
|
||||
use crate::traversal::PreorderFlowTraversal;
|
||||
use euclid::Point2D;
|
||||
use floats::FloatKind;
|
||||
use flow::{Flow, FlowClass, GetBaseFlow, ImmutableFlowUtils, OpaqueFlow, FlowFlags};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use layout_debug;
|
||||
use model::{AdjoiningMargins, CollapsibleMargins};
|
||||
use model::{IntrinsicISizes, MaybeAuto, SizeConstraint};
|
||||
use std::cmp::{max, min};
|
||||
use std::ops::Range;
|
||||
use style::computed_values::align_content::T as AlignContent;
|
||||
|
@ -29,7 +30,6 @@ use style::servo::restyle_damage::ServoRestyleDamage;
|
|||
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
|
||||
use style::values::computed::flex::FlexBasis;
|
||||
use style::values::generics::flex::FlexBasis as GenericFlexBasis;
|
||||
use traversal::PreorderFlowTraversal;
|
||||
|
||||
/// The size of an axis. May be a specified size, a min/max
|
||||
/// constraint, or an unlimited size
|
||||
|
@ -348,7 +348,7 @@ impl FlexLine {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl ::flow::HasBaseFlow for FlexFlow {}
|
||||
unsafe impl crate::flow::HasBaseFlow for FlexFlow {}
|
||||
|
||||
/// A block with the CSS `display` property equal to `flex`.
|
||||
#[derive(Debug, Serialize)]
|
||||
|
@ -1099,7 +1099,7 @@ impl Flow for FlexFlow {
|
|||
self.block_flow.collect_stacking_contexts(state);
|
||||
}
|
||||
|
||||
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) {
|
||||
fn repair_style(&mut self, new_style: &crate::ServoArc<ComputedValues>) {
|
||||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use app_units::{Au, MAX_AU};
|
||||
use block::FormattingContextType;
|
||||
use flow::{Flow, FlowFlags, GetBaseFlow, ImmutableFlowUtils};
|
||||
use persistent_list::PersistentList;
|
||||
use crate::block::FormattingContextType;
|
||||
use crate::flow::{Flow, FlowFlags, GetBaseFlow, ImmutableFlowUtils};
|
||||
use crate::persistent_list::PersistentList;
|
||||
use std::cmp::{max, min};
|
||||
use std::fmt;
|
||||
use style::computed_values::float::T as StyleFloat;
|
||||
|
|
|
@ -26,22 +26,29 @@
|
|||
//! similar methods.
|
||||
|
||||
use app_units::Au;
|
||||
use block::{BlockFlow, FormattingContextType};
|
||||
use context::LayoutContext;
|
||||
use display_list::{DisplayListBuildState, StackingContextCollectionState};
|
||||
use display_list::items::ClippingAndScrolling;
|
||||
use crate::block::{BlockFlow, FormattingContextType};
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::{DisplayListBuildState, StackingContextCollectionState};
|
||||
use crate::display_list::items::ClippingAndScrolling;
|
||||
use crate::flex::FlexFlow;
|
||||
use crate::floats::{Floats, SpeculatedFloatPlacement};
|
||||
use crate::flow_list::{FlowList, FlowListIterator, MutFlowListIterator};
|
||||
use crate::flow_ref::{FlowRef, WeakFlowRef};
|
||||
use crate::fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use crate::inline::InlineFlow;
|
||||
use crate::model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo};
|
||||
use crate::multicol::MulticolFlow;
|
||||
use crate::parallel::FlowParallelInfo;
|
||||
use crate::table::TableFlow;
|
||||
use crate::table_caption::TableCaptionFlow;
|
||||
use crate::table_cell::TableCellFlow;
|
||||
use crate::table_colgroup::TableColGroupFlow;
|
||||
use crate::table_row::TableRowFlow;
|
||||
use crate::table_rowgroup::TableRowGroupFlow;
|
||||
use crate::table_wrapper::TableWrapperFlow;
|
||||
use euclid::{Point2D, Vector2D, Rect, Size2D};
|
||||
use flex::FlexFlow;
|
||||
use floats::{Floats, SpeculatedFloatPlacement};
|
||||
use flow_list::{FlowList, FlowListIterator, MutFlowListIterator};
|
||||
use flow_ref::{FlowRef, WeakFlowRef};
|
||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use gfx_traits::StackingContextId;
|
||||
use gfx_traits::print_tree::PrintTree;
|
||||
use inline::InlineFlow;
|
||||
use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo};
|
||||
use multicol::MulticolFlow;
|
||||
use parallel::FlowParallelInfo;
|
||||
use serde::ser::{Serialize, SerializeStruct, Serializer};
|
||||
use servo_geometry::{au_rect_to_f32_rect, f32_rect_to_au_rect, MaxRect};
|
||||
use std::fmt;
|
||||
|
@ -60,13 +67,6 @@ use style::properties::ComputedValues;
|
|||
use style::selector_parser::RestyleDamage;
|
||||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
use style::values::computed::LengthOrPercentageOrAuto;
|
||||
use table::TableFlow;
|
||||
use table_caption::TableCaptionFlow;
|
||||
use table_cell::TableCellFlow;
|
||||
use table_colgroup::TableColGroupFlow;
|
||||
use table_row::TableRowFlow;
|
||||
use table_rowgroup::TableRowGroupFlow;
|
||||
use table_wrapper::TableWrapperFlow;
|
||||
use webrender_api::LayoutTransform;
|
||||
|
||||
/// This marker trait indicates that a type is a struct with `#[repr(C)]` whose first field
|
||||
|
@ -502,7 +502,7 @@ pub trait Flow: HasBaseFlow + fmt::Debug + Sync + Send + 'static {
|
|||
|
||||
/// Attempts to perform incremental fixup of this flow by replacing its fragment's style with
|
||||
/// the new style. This can only succeed if the flow has exactly one fragment.
|
||||
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>);
|
||||
fn repair_style(&mut self, new_style: &crate::ServoArc<ComputedValues>);
|
||||
|
||||
/// Print any extra children (such as fragments) contained in this Flow
|
||||
/// for debugging purposes. Any items inserted into the tree will become
|
||||
|
@ -578,7 +578,7 @@ pub trait ImmutableFlowUtils {
|
|||
pub trait MutableFlowUtils {
|
||||
/// Calls `repair_style` and `bubble_inline_sizes`. You should use this method instead of
|
||||
/// calling them individually, since there is no reason not to perform both operations.
|
||||
fn repair_style_and_bubble_inline_sizes(self, style: &::ServoArc<ComputedValues>);
|
||||
fn repair_style_and_bubble_inline_sizes(self, style: &crate::ServoArc<ComputedValues>);
|
||||
}
|
||||
|
||||
pub trait MutableOwnedFlowUtils {
|
||||
|
@ -1422,7 +1422,7 @@ impl<'a> ImmutableFlowUtils for &'a Flow {
|
|||
impl<'a> MutableFlowUtils for &'a mut Flow {
|
||||
/// Calls `repair_style` and `bubble_inline_sizes`. You should use this method instead of
|
||||
/// calling them individually, since there is no reason not to perform both operations.
|
||||
fn repair_style_and_bubble_inline_sizes(self, style: &::ServoArc<ComputedValues>) {
|
||||
fn repair_style_and_bubble_inline_sizes(self, style: &crate::ServoArc<ComputedValues>) {
|
||||
self.repair_style(style);
|
||||
self.mut_base().update_flags_if_needed(style);
|
||||
self.bubble_inline_sizes();
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
* 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 flow::{Flow, FlowClass};
|
||||
use flow_ref::FlowRef;
|
||||
use crate::flow::{Flow, FlowClass};
|
||||
use crate::flow_ref::FlowRef;
|
||||
use serde::ser::{Serialize, SerializeSeq, Serializer};
|
||||
use serde_json::{Map, Value, to_value};
|
||||
use std::collections::{LinkedList, linked_list};
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//! be superfluous. This design is largely duplicating logic of Arc<T> and
|
||||
//! Weak<T>; please see comments there for details.
|
||||
|
||||
use flow::Flow;
|
||||
use crate::flow::Flow;
|
||||
use std::ops::Deref;
|
||||
use std::sync::{Arc, Weak};
|
||||
|
||||
|
|
|
@ -4,27 +4,30 @@
|
|||
|
||||
//! The `Fragment` type, which represents the leaves of the layout tree.
|
||||
|
||||
use ServoArc;
|
||||
use app_units::Au;
|
||||
use canvas_traits::canvas::{CanvasMsg, CanvasId};
|
||||
use context::{LayoutContext, with_thread_local_font_context};
|
||||
use display_list::ToLayout;
|
||||
use display_list::items::{BLUR_INFLATION_FACTOR, ClipScrollNodeIndex, OpaqueNode};
|
||||
use crate::ServoArc;
|
||||
use crate::context::{LayoutContext, with_thread_local_font_context};
|
||||
use crate::display_list::ToLayout;
|
||||
use crate::display_list::items::{BLUR_INFLATION_FACTOR, ClipScrollNodeIndex, OpaqueNode};
|
||||
use crate::floats::ClearType;
|
||||
use crate::flow::{GetBaseFlow, ImmutableFlowUtils};
|
||||
use crate::flow_ref::FlowRef;
|
||||
use crate::inline::{InlineFragmentNodeFlags, InlineFragmentContext, InlineFragmentNodeInfo};
|
||||
use crate::inline::{InlineMetrics, LineMetrics};
|
||||
#[cfg(debug_assertions)]
|
||||
use crate::layout_debug;
|
||||
use crate::model::{self, IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, SizeConstraint};
|
||||
use crate::model::style_length;
|
||||
use crate::text;
|
||||
use crate::text::TextRunScanner;
|
||||
use crate::wrapper::ThreadSafeLayoutNodeHelpers;
|
||||
use euclid::{Point2D, Vector2D, Rect, Size2D};
|
||||
use floats::ClearType;
|
||||
use flow::{GetBaseFlow, ImmutableFlowUtils};
|
||||
use flow_ref::FlowRef;
|
||||
use gfx;
|
||||
use gfx::text::glyph::ByteIndex;
|
||||
use gfx::text::text_run::{TextRun, TextRunSlice};
|
||||
use gfx_traits::StackingContextId;
|
||||
use inline::{InlineFragmentNodeFlags, InlineFragmentContext, InlineFragmentNodeInfo};
|
||||
use inline::{InlineMetrics, LineMetrics};
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
#[cfg(debug_assertions)]
|
||||
use layout_debug;
|
||||
use model::{self, IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, SizeConstraint};
|
||||
use model::style_length;
|
||||
use msg::constellation_msg::{BrowsingContextId, PipelineId};
|
||||
use net_traits::image::base::{Image, ImageMetadata};
|
||||
use net_traits::image_cache::{ImageOrMetadataAvailable, UsePlaceholder};
|
||||
|
@ -60,10 +63,7 @@ use style::values::computed::{Length, LengthOrPercentage, LengthOrPercentageOrAu
|
|||
use style::values::computed::counters::ContentItem;
|
||||
use style::values::generics::box_::{Perspective, VerticalAlign};
|
||||
use style::values::generics::transform;
|
||||
use text;
|
||||
use text::TextRunScanner;
|
||||
use webrender_api::{self, LayoutTransform};
|
||||
use wrapper::ThreadSafeLayoutNodeHelpers;
|
||||
|
||||
// From gfxFontConstants.h in Firefox.
|
||||
static FONT_SUBSCRIPT_OFFSET_RATIO: f32 = 0.20;
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
//! done in parallel and is therefore a sequential pass that runs on as little of the flow tree
|
||||
//! as possible.
|
||||
|
||||
use context::{LayoutContext, with_thread_local_font_context};
|
||||
use display_list::items::OpaqueNode;
|
||||
use flow::{Flow, FlowFlags, GetBaseFlow, ImmutableFlowUtils};
|
||||
use fragment::{Fragment, GeneratedContentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo};
|
||||
use crate::context::{LayoutContext, with_thread_local_font_context};
|
||||
use crate::display_list::items::OpaqueNode;
|
||||
use crate::flow::{Flow, FlowFlags, GetBaseFlow, ImmutableFlowUtils};
|
||||
use crate::fragment::{Fragment, GeneratedContentInfo, SpecificFragmentInfo, UnscannedTextFragmentInfo};
|
||||
use crate::text::TextRunScanner;
|
||||
use crate::traversal::InorderFlowTraversal;
|
||||
use script_layout_interface::wrapper_traits::PseudoElementType;
|
||||
use smallvec::SmallVec;
|
||||
use std::collections::{HashMap, LinkedList};
|
||||
|
@ -21,8 +23,6 @@ use style::properties::ComputedValues;
|
|||
use style::selector_parser::RestyleDamage;
|
||||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
use style::values::generics::counters::ContentItem;
|
||||
use text::TextRunScanner;
|
||||
use traversal::InorderFlowTraversal;
|
||||
|
||||
// Decimal styles per CSS-COUNTER-STYLES § 6.1:
|
||||
static DECIMAL: [char; 10] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
||||
|
@ -428,7 +428,7 @@ impl Counter {
|
|||
layout_context: &LayoutContext,
|
||||
node: OpaqueNode,
|
||||
pseudo: PseudoElementType,
|
||||
style: ::ServoArc<ComputedValues>,
|
||||
style: crate::ServoArc<ComputedValues>,
|
||||
list_style_type: ListStyleType,
|
||||
mode: RenderingMode,
|
||||
) -> Option<SpecificFragmentInfo> {
|
||||
|
@ -492,7 +492,7 @@ fn render_text(
|
|||
layout_context: &LayoutContext,
|
||||
node: OpaqueNode,
|
||||
pseudo: PseudoElementType,
|
||||
style: ::ServoArc<ComputedValues>,
|
||||
style: crate::ServoArc<ComputedValues>,
|
||||
string: String,
|
||||
) -> Option<SpecificFragmentInfo> {
|
||||
let mut fragments = LinkedList::new();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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 flow::{FlowFlags, Flow, GetBaseFlow};
|
||||
use crate::flow::{FlowFlags, Flow, GetBaseFlow};
|
||||
use style::computed_values::float::T as Float;
|
||||
use style::selector_parser::RestyleDamage;
|
||||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
|
|
|
@ -2,25 +2,27 @@
|
|||
* 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 ServoArc;
|
||||
use app_units::{Au, MIN_AU};
|
||||
use block::AbsoluteAssignBSizesTraversal;
|
||||
use context::{LayoutContext, LayoutFontContext};
|
||||
use display_list::{DisplayListBuildState, InlineFlowDisplayListBuilding};
|
||||
use display_list::StackingContextCollectionState;
|
||||
use display_list::items::OpaqueNode;
|
||||
use crate::ServoArc;
|
||||
use crate::block::AbsoluteAssignBSizesTraversal;
|
||||
use crate::context::{LayoutContext, LayoutFontContext};
|
||||
use crate::display_list::{DisplayListBuildState, InlineFlowDisplayListBuilding};
|
||||
use crate::display_list::StackingContextCollectionState;
|
||||
use crate::display_list::items::OpaqueNode;
|
||||
use crate::floats::{FloatKind, Floats, PlacementInfo};
|
||||
use crate::flow::{BaseFlow, Flow, FlowClass, ForceNonfloatedFlag};
|
||||
use crate::flow::{FlowFlags, EarlyAbsolutePositionInfo, GetBaseFlow, OpaqueFlow};
|
||||
use crate::flow_ref::FlowRef;
|
||||
use crate::fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use crate::fragment::FragmentFlags;
|
||||
use crate::fragment::SpecificFragmentInfo;
|
||||
use crate::layout_debug;
|
||||
use crate::model::IntrinsicISizesContribution;
|
||||
use crate::text;
|
||||
use crate::traversal::PreorderFlowTraversal;
|
||||
use euclid::{Point2D, Size2D};
|
||||
use floats::{FloatKind, Floats, PlacementInfo};
|
||||
use flow::{BaseFlow, Flow, FlowClass, ForceNonfloatedFlag};
|
||||
use flow::{FlowFlags, EarlyAbsolutePositionInfo, GetBaseFlow, OpaqueFlow};
|
||||
use flow_ref::FlowRef;
|
||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use fragment::FragmentFlags;
|
||||
use fragment::SpecificFragmentInfo;
|
||||
use gfx::font::FontMetrics;
|
||||
use gfx_traits::print_tree::PrintTree;
|
||||
use layout_debug;
|
||||
use model::IntrinsicISizesContribution;
|
||||
use range::{Range, RangeIndex};
|
||||
use script_layout_interface::wrapper_traits::PseudoElementType;
|
||||
use std::{fmt, i32, isize, mem};
|
||||
|
@ -39,8 +41,6 @@ use style::servo::restyle_damage::ServoRestyleDamage;
|
|||
use style::values::computed::box_::VerticalAlign;
|
||||
use style::values::generics::box_::VerticalAlign as GenericVerticalAlign;
|
||||
use style::values::specified::text::TextOverflowSide;
|
||||
use text;
|
||||
use traversal::PreorderFlowTraversal;
|
||||
use unicode_bidi as bidi;
|
||||
|
||||
/// `Line`s are represented as offsets into the child list, rather than
|
||||
|
@ -943,7 +943,7 @@ impl InlineFragments {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl ::flow::HasBaseFlow for InlineFlow {}
|
||||
unsafe impl crate::flow::HasBaseFlow for InlineFlow {}
|
||||
|
||||
/// Flows for inline layout.
|
||||
#[derive(Serialize)]
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
//! Supports writing a trace file created during each layout scope
|
||||
//! that can be viewed by an external tool to make layout debugging easier.
|
||||
|
||||
use flow::GetBaseFlow;
|
||||
use flow_ref::FlowRef;
|
||||
use crate::flow::GetBaseFlow;
|
||||
use crate::flow_ref::FlowRef;
|
||||
use serde_json::{to_string, to_value, Value};
|
||||
use std::borrow::ToOwned;
|
||||
use std::cell::RefCell;
|
||||
|
|
|
@ -87,8 +87,8 @@ pub mod traversal;
|
|||
pub mod wrapper;
|
||||
|
||||
// For unit tests:
|
||||
pub use fragment::Fragment;
|
||||
pub use fragment::SpecificFragmentInfo;
|
||||
pub use crate::fragment::Fragment;
|
||||
pub use crate::fragment::SpecificFragmentInfo;
|
||||
pub use self::data::LayoutData;
|
||||
|
||||
// We can't use servo_arc for everything in layout, because the Flow stuff uses
|
||||
|
|
|
@ -6,17 +6,17 @@
|
|||
//! block and an extra inline fragment for the marker.
|
||||
|
||||
use app_units::Au;
|
||||
use block::BlockFlow;
|
||||
use context::{LayoutContext, with_thread_local_font_context};
|
||||
use display_list::{DisplayListBuildState, ListItemFlowDisplayListBuilding};
|
||||
use display_list::StackingContextCollectionState;
|
||||
use crate::block::BlockFlow;
|
||||
use crate::context::{LayoutContext, with_thread_local_font_context};
|
||||
use crate::display_list::{DisplayListBuildState, ListItemFlowDisplayListBuilding};
|
||||
use crate::display_list::StackingContextCollectionState;
|
||||
use crate::floats::FloatKind;
|
||||
use crate::flow::{Flow, FlowClass, OpaqueFlow};
|
||||
use crate::fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, GeneratedContentInfo};
|
||||
use crate::fragment::Overflow;
|
||||
use crate::generated_content;
|
||||
use crate::inline::InlineFlow;
|
||||
use euclid::Point2D;
|
||||
use floats::FloatKind;
|
||||
use flow::{Flow, FlowClass, OpaqueFlow};
|
||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, GeneratedContentInfo};
|
||||
use fragment::Overflow;
|
||||
use generated_content;
|
||||
use inline::InlineFlow;
|
||||
use style::computed_values::list_style_type::T as ListStyleType;
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::logical_geometry::LogicalSize;
|
||||
|
@ -24,7 +24,7 @@ use style::properties::ComputedValues;
|
|||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl ::flow::HasBaseFlow for ListItemFlow {}
|
||||
unsafe impl crate::flow::HasBaseFlow for ListItemFlow {}
|
||||
|
||||
/// A block with the CSS `display` property equal to `list-item`.
|
||||
#[derive(Debug)]
|
||||
|
@ -194,7 +194,7 @@ impl Flow for ListItemFlow {
|
|||
self.block_flow.collect_stacking_contexts(state);
|
||||
}
|
||||
|
||||
fn repair_style(&mut self, new_style: &::ServoArc<ComputedValues>) {
|
||||
fn repair_style(&mut self, new_style: &crate::ServoArc<ComputedValues>) {
|
||||
self.block_flow.repair_style(new_style)
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
//! Borders, padding, and margins.
|
||||
|
||||
use app_units::Au;
|
||||
use crate::fragment::Fragment;
|
||||
use euclid::SideOffsets2D;
|
||||
use fragment::Fragment;
|
||||
use std::cmp::{max, min};
|
||||
use std::fmt;
|
||||
use style::logical_geometry::{LogicalMargin, WritingMode};
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
|
||||
//! CSS Multi-column layout http://dev.w3.org/csswg/css-multicol/
|
||||
|
||||
use ServoArc;
|
||||
use app_units::Au;
|
||||
use block::BlockFlow;
|
||||
use context::LayoutContext;
|
||||
use display_list::{DisplayListBuildState, StackingContextCollectionState};
|
||||
use crate::ServoArc;
|
||||
use crate::block::BlockFlow;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::{DisplayListBuildState, StackingContextCollectionState};
|
||||
use crate::floats::FloatKind;
|
||||
use crate::flow::{Flow, FlowClass, OpaqueFlow, FragmentationContext, GetBaseFlow};
|
||||
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use euclid::{Point2D, Vector2D};
|
||||
use floats::FloatKind;
|
||||
use flow::{Flow, FlowClass, OpaqueFlow, FragmentationContext, GetBaseFlow};
|
||||
use fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use gfx_traits::print_tree::PrintTree;
|
||||
use std::cmp::{min, max};
|
||||
use std::fmt;
|
||||
|
@ -24,7 +24,7 @@ use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone
|
|||
use style::values::generics::column::ColumnCount;
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl ::flow::HasBaseFlow for MulticolFlow {}
|
||||
unsafe impl crate::flow::HasBaseFlow for MulticolFlow {}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct MulticolFlow {
|
||||
|
@ -36,7 +36,7 @@ pub struct MulticolFlow {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl ::flow::HasBaseFlow for MulticolColumnFlow {}
|
||||
unsafe impl crate::flow::HasBaseFlow for MulticolColumnFlow {}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct MulticolColumnFlow {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue