mirror of
https://github.com/servo/servo.git
synced 2025-06-02 15:25:31 +00:00
Update rustfmt to the 2024 style edition (#35764)
* Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
6300e820b4
commit
3d320fa96a
603 changed files with 1739 additions and 1648 deletions
|
@ -13,7 +13,7 @@ use background_hang_monitor_api::{
|
|||
BackgroundHangMonitorExitSignal, BackgroundHangMonitorRegister, HangAlert, HangAnnotation,
|
||||
HangMonitorAlert, MonitoredComponentId,
|
||||
};
|
||||
use crossbeam_channel::{after, never, select, unbounded, Receiver, Sender};
|
||||
use crossbeam_channel::{Receiver, Sender, after, never, select, unbounded};
|
||||
use ipc_channel::ipc::{IpcReceiver, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use log::warn;
|
||||
|
|
|
@ -8,9 +8,9 @@ use std::cell::UnsafeCell;
|
|||
use std::sync::atomic::{AtomicPtr, Ordering};
|
||||
use std::{cmp, io, mem, process, ptr, thread};
|
||||
|
||||
use nix::sys::signal::{sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal};
|
||||
use nix::sys::signal::{SaFlags, SigAction, SigHandler, SigSet, Signal, sigaction};
|
||||
use unwind_sys::{
|
||||
unw_cursor_t, unw_get_reg, unw_init_local, unw_step, UNW_ESUCCESS, UNW_REG_IP, UNW_REG_SP,
|
||||
UNW_ESUCCESS, UNW_REG_IP, UNW_REG_SP, unw_cursor_t, unw_get_reg, unw_init_local, unw_step,
|
||||
};
|
||||
|
||||
use crate::sampler::{NativeStack, Sampler};
|
||||
|
|
|
@ -21,7 +21,7 @@ use std::time::Duration;
|
|||
|
||||
use base::id::WebViewId;
|
||||
use bitflags::bitflags;
|
||||
use bluetooth_traits::blocklist::{uuid_is_blocklisted, Blocklist};
|
||||
use bluetooth_traits::blocklist::{Blocklist, uuid_is_blocklisted};
|
||||
use bluetooth_traits::scanfilter::{
|
||||
BluetoothScanfilter, BluetoothScanfilterSequence, RequestDeviceoptions,
|
||||
};
|
||||
|
|
|
@ -10,11 +10,11 @@ use std::string::String;
|
|||
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::BluetoothManager;
|
||||
use crate::bluetooth::{
|
||||
BluetoothAdapter, BluetoothDevice, BluetoothGATTCharacteristic, BluetoothGATTDescriptor,
|
||||
BluetoothGATTService,
|
||||
};
|
||||
use crate::BluetoothManager;
|
||||
|
||||
thread_local!(pub static CACHED_IDS: RefCell<HashSet<Uuid>> = RefCell::new(HashSet::new()));
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ use euclid::default::{Box2D, Point2D, Rect, Size2D, Transform2D, Vector2D};
|
|||
use euclid::point2;
|
||||
use fonts::{
|
||||
ByteIndex, FontBaseline, FontContext, FontGroup, FontMetrics, FontRef, GlyphInfo, GlyphStore,
|
||||
ShapingFlags, ShapingOptions, LAST_RESORT_GLYPH_ADVANCE,
|
||||
LAST_RESORT_GLYPH_ADVANCE, ShapingFlags, ShapingOptions,
|
||||
};
|
||||
use ipc_channel::ipc::{IpcSender, IpcSharedMemory};
|
||||
use log::warn;
|
||||
|
|
|
@ -7,9 +7,9 @@ use std::collections::HashMap;
|
|||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
|
||||
use canvas_traits::canvas::*;
|
||||
use canvas_traits::ConstellationCanvasMsg;
|
||||
use crossbeam_channel::{select, unbounded, Sender};
|
||||
use canvas_traits::canvas::*;
|
||||
use crossbeam_channel::{Sender, select, unbounded};
|
||||
use euclid::default::Size2D;
|
||||
use fonts::{FontContext, SystemFontServiceProxy};
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
|
|
|
@ -7,8 +7,8 @@ use std::collections::HashMap;
|
|||
|
||||
use canvas_traits::canvas::*;
|
||||
use cssparser::color::clamp_unit_f32;
|
||||
use euclid::default::{Point2D, Rect, Size2D, Transform2D, Vector2D};
|
||||
use euclid::Angle;
|
||||
use euclid::default::{Point2D, Rect, Size2D, Transform2D, Vector2D};
|
||||
use font_kit::font::Font;
|
||||
use fonts::{ByteIndex, FontIdentifier, FontTemplateRefMethods};
|
||||
use log::warn;
|
||||
|
|
|
@ -6,7 +6,7 @@ use std::default::Default;
|
|||
use std::rc::Rc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use canvas_traits::webgl::{webgl_channel, GlType, WebGLContextId, WebGLMsg, WebGLThreads};
|
||||
use canvas_traits::webgl::{GlType, WebGLContextId, WebGLMsg, WebGLThreads, webgl_channel};
|
||||
use euclid::default::Size2D;
|
||||
use fnv::FnvHashMap;
|
||||
use log::debug;
|
||||
|
|
|
@ -25,13 +25,13 @@ use canvas_traits::webgl::{
|
|||
use euclid::default::Size2D;
|
||||
use fnv::FnvHashMap;
|
||||
use glow::{
|
||||
self as gl, bytes_per_type, components_per_format, ActiveTransformFeedback, Context as Gl,
|
||||
HasContext, NativeTransformFeedback, NativeUniformLocation, NativeVertexArray, PixelUnpackData,
|
||||
ShaderPrecisionFormat,
|
||||
self as gl, ActiveTransformFeedback, Context as Gl, HasContext, NativeTransformFeedback,
|
||||
NativeUniformLocation, NativeVertexArray, PixelUnpackData, ShaderPrecisionFormat,
|
||||
bytes_per_type, components_per_format,
|
||||
};
|
||||
use half::f16;
|
||||
use log::{debug, error, trace, warn};
|
||||
use pixels::{self, unmultiply_inplace, PixelFormat};
|
||||
use pixels::{self, PixelFormat, unmultiply_inplace};
|
||||
use surfman::chains::{PreserveBuffer, SwapChains, SwapChainsAPI};
|
||||
use surfman::{
|
||||
self, Adapter, Connection, Context, ContextAttributeFlags, ContextAttributes, Device,
|
||||
|
|
|
@ -6,7 +6,7 @@ use std::collections::HashMap;
|
|||
use std::num::NonZeroU32;
|
||||
|
||||
use canvas_traits::webgl::{
|
||||
webgl_channel, WebGLContextId, WebGLMsg, WebGLSender, WebXRCommand, WebXRLayerManagerId,
|
||||
WebGLContextId, WebGLMsg, WebGLSender, WebXRCommand, WebXRLayerManagerId, webgl_channel,
|
||||
};
|
||||
use fnv::FnvHashMap;
|
||||
use surfman::{Context, Device};
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
use std::cell::Cell;
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::fs::{create_dir_all, File};
|
||||
use std::fs::{File, create_dir_all};
|
||||
use std::io::Write;
|
||||
use std::iter::once;
|
||||
use std::rc::Rc;
|
||||
|
@ -58,10 +58,10 @@ use webrender_traits::{
|
|||
CompositorHitTestResult, CrossProcessCompositorMessage, ImageUpdate, UntrustedNodeAddress,
|
||||
};
|
||||
|
||||
use crate::InitialCompositorState;
|
||||
use crate::touch::{TouchHandler, TouchMoveAction, TouchMoveAllowed, TouchSequenceState};
|
||||
use crate::webview::{UnknownWebView, WebView, WebViewManager};
|
||||
use crate::windowing::{self, EmbedderCoordinates, WebRenderDebugOption, WindowMethods};
|
||||
use crate::InitialCompositorState;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum UnableToComposite {
|
||||
|
@ -599,7 +599,7 @@ impl IOCompositor {
|
|||
Err(error) => {
|
||||
return warn!(
|
||||
"Could not receive WebRender display list items data: {error}"
|
||||
)
|
||||
);
|
||||
},
|
||||
};
|
||||
let cache_data = match display_list_receiver.recv() {
|
||||
|
@ -607,7 +607,7 @@ impl IOCompositor {
|
|||
Err(error) => {
|
||||
return warn!(
|
||||
"Could not receive WebRender display list cache data: {error}"
|
||||
)
|
||||
);
|
||||
},
|
||||
};
|
||||
let spatial_tree = match display_list_receiver.recv() {
|
||||
|
@ -615,7 +615,7 @@ impl IOCompositor {
|
|||
Err(error) => {
|
||||
return warn!(
|
||||
"Could not receive WebRender display list spatial tree: {error}."
|
||||
)
|
||||
);
|
||||
},
|
||||
};
|
||||
let built_display_list = BuiltDisplayList::from_data(
|
||||
|
|
|
@ -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 https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hash_map::Entry;
|
||||
|
||||
use base::id::{PipelineId, WebViewId};
|
||||
use webrender_api::units::DeviceRect;
|
||||
|
|
|
@ -97,21 +97,21 @@ use background_hang_monitor::HangMonitorRegister;
|
|||
use background_hang_monitor_api::{
|
||||
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, HangMonitorAlert,
|
||||
};
|
||||
use base::Epoch;
|
||||
use base::id::{
|
||||
BroadcastChannelRouterId, BrowsingContextGroupId, BrowsingContextId, HistoryStateId,
|
||||
MessagePortId, MessagePortRouterId, PipelineId, PipelineNamespace, PipelineNamespaceId,
|
||||
PipelineNamespaceRequest, TopLevelBrowsingContextId, WebViewId,
|
||||
};
|
||||
use base::Epoch;
|
||||
#[cfg(feature = "bluetooth")]
|
||||
use bluetooth_traits::BluetoothRequest;
|
||||
use canvas_traits::ConstellationCanvasMsg;
|
||||
use canvas_traits::canvas::{CanvasId, CanvasMsg};
|
||||
use canvas_traits::webgl::WebGLThreads;
|
||||
use canvas_traits::ConstellationCanvasMsg;
|
||||
use compositing_traits::{
|
||||
CompositorMsg, CompositorProxy, ConstellationMsg as FromCompositorMsg, SendableFrameTree,
|
||||
};
|
||||
use crossbeam_channel::{select, unbounded, Receiver, Sender};
|
||||
use crossbeam_channel::{Receiver, Sender, select, unbounded};
|
||||
use devtools_traits::{
|
||||
ChromeToDevtoolsControlMsg, DevtoolsControlMsg, DevtoolsPageInfo, NavigationState,
|
||||
ScriptToDevtoolsControlMsg,
|
||||
|
@ -122,12 +122,12 @@ use embedder_traits::{
|
|||
MediaSessionEvent, MediaSessionPlaybackState, MouseButton, MouseButtonAction, MouseButtonEvent,
|
||||
Theme, TraversalDirection, WebDriverCommandMsg, WebDriverLoadStatus,
|
||||
};
|
||||
use euclid::default::Size2D as UntypedSize2D;
|
||||
use euclid::Size2D;
|
||||
use euclid::default::Size2D as UntypedSize2D;
|
||||
use fonts::SystemFontServiceProxy;
|
||||
use ipc_channel::Error as IpcError;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use ipc_channel::Error as IpcError;
|
||||
use keyboard_types::webdriver::Event as WebDriverInputEvent;
|
||||
use log::{debug, error, info, trace, warn};
|
||||
use media::WindowGLContext;
|
||||
|
@ -149,7 +149,7 @@ use script_traits::{
|
|||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use servo_config::{opts, pref};
|
||||
use servo_rand::{random, Rng, ServoRng, SliceRandom};
|
||||
use servo_rand::{Rng, ServoRng, SliceRandom, random};
|
||||
use servo_url::{Host, ImmutableOrigin, ServoUrl};
|
||||
use style_traits::CSSPixel;
|
||||
#[cfg(feature = "webgpu")]
|
||||
|
@ -2027,7 +2027,9 @@ where
|
|||
Some(router_id) => router_id,
|
||||
None => {
|
||||
if !ports.is_empty() {
|
||||
warn!("Constellation unable to process port transfer successes, since no router id was received");
|
||||
warn!(
|
||||
"Constellation unable to process port transfer successes, since no router id was received"
|
||||
);
|
||||
}
|
||||
return;
|
||||
},
|
||||
|
@ -2251,7 +2253,7 @@ where
|
|||
return warn!(
|
||||
"Constellation asked to re-route msg to unknown messageport {:?}",
|
||||
port_id
|
||||
)
|
||||
);
|
||||
},
|
||||
};
|
||||
match &mut info.state {
|
||||
|
@ -2357,14 +2359,16 @@ where
|
|||
return warn!(
|
||||
"Constellation asked to remove unknown entangled messageport {:?}",
|
||||
entangled_id
|
||||
)
|
||||
);
|
||||
},
|
||||
};
|
||||
let router_id = match info.state {
|
||||
TransferState::EntangledRemoved => return warn!(
|
||||
"Constellation asked to remove entangled messageport by a port that was already removed {:?}",
|
||||
port_id
|
||||
),
|
||||
TransferState::EntangledRemoved => {
|
||||
return warn!(
|
||||
"Constellation asked to remove entangled messageport by a port that was already removed {:?}",
|
||||
port_id
|
||||
);
|
||||
},
|
||||
TransferState::TransferInProgress(_) |
|
||||
TransferState::CompletionInProgress(_) |
|
||||
TransferState::CompletionFailed(_) |
|
||||
|
@ -2826,7 +2830,9 @@ where
|
|||
)]
|
||||
fn handle_focus_web_view(&mut self, top_level_browsing_context_id: TopLevelBrowsingContextId) {
|
||||
if self.webviews.get(top_level_browsing_context_id).is_none() {
|
||||
return warn!("{top_level_browsing_context_id}: FocusWebView on unknown top-level browsing context");
|
||||
return warn!(
|
||||
"{top_level_browsing_context_id}: FocusWebView on unknown top-level browsing context"
|
||||
);
|
||||
}
|
||||
self.webviews.focus(top_level_browsing_context_id);
|
||||
self.embedder_proxy
|
||||
|
@ -3223,7 +3229,9 @@ where
|
|||
// TODO(servo#30571) revert to debug_assert_eq!() once underlying bug is fixed
|
||||
#[cfg(debug_assertions)]
|
||||
if !(browsing_context_size == load_info.window_size.initial_viewport) {
|
||||
log::warn!("debug assertion failed! browsing_context_size == load_info.window_size.initial_viewport");
|
||||
log::warn!(
|
||||
"debug assertion failed! browsing_context_size == load_info.window_size.initial_viewport"
|
||||
);
|
||||
}
|
||||
|
||||
// Create the new pipeline, attached to the parent and push to pending changes
|
||||
|
@ -3271,7 +3279,7 @@ where
|
|||
return warn!(
|
||||
"{}: Script loaded url in closed iframe pipeline",
|
||||
parent_pipeline_id
|
||||
)
|
||||
);
|
||||
},
|
||||
};
|
||||
let (is_parent_private, is_parent_throttled, is_parent_secure) =
|
||||
|
@ -4356,7 +4364,7 @@ where
|
|||
return warn!(
|
||||
"{}: Visibility change for closed browsing context",
|
||||
pipeline_id
|
||||
)
|
||||
);
|
||||
},
|
||||
};
|
||||
let parent_pipeline_id = match self.browsing_contexts.get(&browsing_context_id) {
|
||||
|
@ -5118,8 +5126,7 @@ where
|
|||
let pipeline_id = browsing_context.pipeline_id;
|
||||
trace!(
|
||||
"{}: Checking readiness of {}",
|
||||
browsing_context.id,
|
||||
pipeline_id
|
||||
browsing_context.id, pipeline_id
|
||||
);
|
||||
|
||||
let pipeline = match self.pipelines.get(&pipeline_id) {
|
||||
|
@ -5319,7 +5326,7 @@ where
|
|||
return warn!(
|
||||
"{}: Switched from fullscreen mode after closing",
|
||||
pipeline_id
|
||||
)
|
||||
);
|
||||
},
|
||||
Some(pipeline) => pipeline,
|
||||
};
|
||||
|
@ -5637,7 +5644,7 @@ where
|
|||
return warn!(
|
||||
"{}: Got media session action request after closure",
|
||||
media_session_pipeline_id,
|
||||
)
|
||||
);
|
||||
},
|
||||
Some(pipeline) => {
|
||||
let msg =
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
use std::marker::PhantomData;
|
||||
use std::rc::Rc;
|
||||
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use ipc_channel::Error;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use script_traits::ScriptThreadMessage;
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#event-loop>
|
||||
|
|
|
@ -20,4 +20,4 @@ mod webview;
|
|||
pub use crate::constellation::{Constellation, InitialConstellationState};
|
||||
pub use crate::logging::{FromCompositorLogger, FromScriptLogger};
|
||||
pub use crate::pipeline::UnprivilegedPipelineContent;
|
||||
pub use crate::sandboxing::{content_process_sandbox_profile, UnprivilegedContent};
|
||||
pub use crate::sandboxing::{UnprivilegedContent, content_process_sandbox_profile};
|
||||
|
|
|
@ -11,26 +11,26 @@ use background_hang_monitor::HangMonitorRegister;
|
|||
use background_hang_monitor_api::{
|
||||
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, HangMonitorAlert,
|
||||
};
|
||||
use base::Epoch;
|
||||
use base::id::{
|
||||
BrowsingContextId, HistoryStateId, PipelineId, PipelineNamespace, PipelineNamespaceId,
|
||||
PipelineNamespaceRequest, TopLevelBrowsingContextId,
|
||||
};
|
||||
use base::Epoch;
|
||||
#[cfg(feature = "bluetooth")]
|
||||
use bluetooth_traits::BluetoothRequest;
|
||||
use canvas_traits::webgl::WebGLPipeline;
|
||||
use compositing_traits::{CompositionPipeline, CompositorMsg, CompositorProxy};
|
||||
use crossbeam_channel::{unbounded, Sender};
|
||||
use crossbeam_channel::{Sender, unbounded};
|
||||
use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg};
|
||||
use fonts::{SystemFontServiceProxy, SystemFontServiceProxySender};
|
||||
use ipc_channel::Error;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use ipc_channel::Error;
|
||||
use log::{debug, error, warn};
|
||||
use media::WindowGLContext;
|
||||
use net::image_cache::ImageCacheImpl;
|
||||
use net_traits::image_cache::ImageCache;
|
||||
use net_traits::ResourceThreads;
|
||||
use net_traits::image_cache::ImageCache;
|
||||
use profile_traits::{mem as profile_mem, time};
|
||||
use script_layout_interface::{LayoutFactory, ScriptThreadFactory};
|
||||
use script_traits::{
|
||||
|
@ -46,7 +46,7 @@ use webrender_api::DocumentId;
|
|||
use webrender_traits::CrossProcessCompositorApi;
|
||||
|
||||
use crate::event_loop::EventLoop;
|
||||
use crate::sandboxing::{spawn_multiprocess, UnprivilegedContent};
|
||||
use crate::sandboxing::{UnprivilegedContent, spawn_multiprocess};
|
||||
|
||||
/// A `Pipeline` is the constellation's view of a `Window`. Each pipeline has an event loop
|
||||
/// (executed by a script thread). A script thread may be responsible for many pipelines.
|
||||
|
|
|
@ -10,7 +10,7 @@ use servo_config::prefs;
|
|||
use servo_config::prefs::Preferences;
|
||||
use servo_url::ImmutableOrigin;
|
||||
|
||||
use crate::sandboxing::{spawn_multiprocess, UnprivilegedContent};
|
||||
use crate::sandboxing::{UnprivilegedContent, spawn_multiprocess};
|
||||
|
||||
/// Conceptually, this is glue to start an agent-cluster for a service worker agent.
|
||||
/// <https://html.spec.whatwg.org/multipage/#obtain-a-service-worker-agent>
|
||||
|
|
|
@ -18,9 +18,9 @@ use serde::Serialize;
|
|||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::inspector::InspectorActor;
|
||||
use crate::actors::inspector::accessibility::AccessibilityActor;
|
||||
use crate::actors::inspector::css_properties::CssPropertiesActor;
|
||||
use crate::actors::inspector::InspectorActor;
|
||||
use crate::actors::reflow::ReflowActor;
|
||||
use crate::actors::stylesheets::StyleSheetsActor;
|
||||
use crate::actors::tab::TabDescriptorActor;
|
||||
|
|
|
@ -7,9 +7,9 @@ use std::net::TcpStream;
|
|||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::{ActorDescription, JsonPacketStream, Method};
|
||||
use crate::StreamId;
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct GetDescriptionReply {
|
||||
|
|
|
@ -10,9 +10,9 @@ use devtools_traits::DevtoolScriptControlMsg;
|
|||
use ipc_channel::ipc::IpcSender;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::timeline::HighResolutionStamp;
|
||||
use crate::StreamId;
|
||||
|
||||
pub struct FramerateActor {
|
||||
name: String,
|
||||
|
|
|
@ -14,6 +14,7 @@ use ipc_channel::ipc::{self, IpcSender};
|
|||
use serde::Serialize;
|
||||
use serde_json::{self, Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::browsing_context::BrowsingContextActor;
|
||||
use crate::actors::inspector::highlighter::{HighlighterActor, HighlighterMsg};
|
||||
|
@ -21,7 +22,6 @@ use crate::actors::inspector::node::NodeInfoToProtocol;
|
|||
use crate::actors::inspector::page_style::{PageStyleActor, PageStyleMsg};
|
||||
use crate::actors::inspector::walker::{WalkerActor, WalkerMsg};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
pub mod accessibility;
|
||||
pub mod css_properties;
|
||||
|
|
|
@ -10,9 +10,9 @@ use std::net::TcpStream;
|
|||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct BootstrapState {
|
||||
|
|
|
@ -12,9 +12,9 @@ use devtools_traits::CssDatabaseProperty;
|
|||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
pub struct CssPropertiesActor {
|
||||
name: String,
|
||||
|
|
|
@ -10,9 +10,9 @@ use std::net::TcpStream;
|
|||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct LayoutInspectorActorMsg {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
//! The page style actor is responsible of informing the DevTools client of the different style
|
||||
//! properties applied, including the attributes and layout of each element.
|
||||
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::iter::once;
|
||||
use std::net::TcpStream;
|
||||
|
||||
|
@ -17,12 +17,12 @@ use ipc_channel::ipc::{self, IpcSender};
|
|||
use serde::Serialize;
|
||||
use serde_json::{self, Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::inspector::node::NodeActor;
|
||||
use crate::actors::inspector::style_rule::{AppliedRule, ComputedDeclaration, StyleRuleActor};
|
||||
use crate::actors::inspector::walker::{find_child, WalkerActor};
|
||||
use crate::actors::inspector::walker::{WalkerActor, find_child};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct GetAppliedReply {
|
||||
|
|
|
@ -16,11 +16,11 @@ use ipc_channel::ipc;
|
|||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::inspector::node::NodeActor;
|
||||
use crate::actors::inspector::walker::WalkerActor;
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
const ELEMENT_STYLE_TYPE: u32 = 100;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ use std::net::TcpStream;
|
|||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
|
|
@ -11,14 +11,14 @@ use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
|||
use chrono::{Local, LocalResult, TimeZone};
|
||||
use devtools_traits::{HttpRequest as DevtoolsHttpRequest, HttpResponse as DevtoolsHttpResponse};
|
||||
use headers::{ContentType, Cookie, HeaderMapExt};
|
||||
use http::{header, HeaderMap, Method};
|
||||
use http::{HeaderMap, Method, header};
|
||||
use net_traits::http_status::HttpStatus;
|
||||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
struct HttpRequest {
|
||||
url: String,
|
||||
|
|
|
@ -6,8 +6,8 @@ use std::net::TcpStream;
|
|||
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
|
||||
pub struct ObjectActor {
|
||||
pub name: String,
|
||||
|
|
|
@ -10,9 +10,9 @@ use std::net::TcpStream;
|
|||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::{ActorDescription, JsonPacketStream, Method};
|
||||
use crate::StreamId;
|
||||
|
||||
pub struct PerformanceActor {
|
||||
name: String,
|
||||
|
|
|
@ -9,9 +9,9 @@ use serde::Serialize;
|
|||
use serde_json::{Map, Value};
|
||||
use servo_config::pref;
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
pub struct PreferenceActor {
|
||||
name: String,
|
||||
|
|
|
@ -11,10 +11,10 @@ use std::net::TcpStream;
|
|||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::root::DescriptorTraits;
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct ListWorkersReply {
|
||||
|
|
|
@ -8,8 +8,8 @@ use std::net::TcpStream;
|
|||
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
|
||||
pub struct ReflowActor {
|
||||
name: String,
|
||||
|
|
|
@ -12,8 +12,9 @@
|
|||
use std::net::TcpStream;
|
||||
|
||||
use serde::Serialize;
|
||||
use serde_json::{json, Map, Value};
|
||||
use serde_json::{Map, Value, json};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::device::DeviceActor;
|
||||
use crate::actors::performance::PerformanceActor;
|
||||
|
@ -21,7 +22,6 @@ use crate::actors::process::{ProcessActor, ProcessActorMsg};
|
|||
use crate::actors::tab::{TabDescriptorActor, TabDescriptorActorMsg};
|
||||
use crate::actors::worker::{WorkerActor, WorkerMsg};
|
||||
use crate::protocol::{ActorDescription, JsonPacketStream};
|
||||
use crate::StreamId;
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
|
|
@ -7,9 +7,9 @@ use std::net::TcpStream;
|
|||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
|
|
@ -14,12 +14,12 @@ use std::net::TcpStream;
|
|||
use serde::Serialize;
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::browsing_context::{BrowsingContextActor, BrowsingContextActorMsg};
|
||||
use crate::actors::root::{DescriptorTraits, RootActor};
|
||||
use crate::actors::watcher::{WatcherActor, WatcherActorMsg};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
|
|
@ -20,11 +20,11 @@ use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
|||
use serde::{Serialize, Serializer};
|
||||
use serde_json::{Map, Value};
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::actors::framerate::FramerateActor;
|
||||
use crate::actors::memory::{MemoryActor, TimelineMemoryReply};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
pub struct TimelineActor {
|
||||
name: String,
|
||||
|
@ -163,20 +163,22 @@ impl TimelineActor {
|
|||
|
||||
thread::Builder::new()
|
||||
.name("PullTimelineData".to_owned())
|
||||
.spawn(move || loop {
|
||||
if !*is_recording.lock().unwrap() {
|
||||
break;
|
||||
}
|
||||
.spawn(move || {
|
||||
loop {
|
||||
if !*is_recording.lock().unwrap() {
|
||||
break;
|
||||
}
|
||||
|
||||
let mut markers = vec![];
|
||||
while let Ok(Some(marker)) = receiver.try_recv() {
|
||||
markers.push(emitter.marker(marker));
|
||||
}
|
||||
if emitter.send(markers).is_err() {
|
||||
break;
|
||||
}
|
||||
let mut markers = vec![];
|
||||
while let Ok(Some(marker)) = receiver.try_recv() {
|
||||
markers.push(emitter.marker(marker));
|
||||
}
|
||||
if emitter.send(markers).is_err() {
|
||||
break;
|
||||
}
|
||||
|
||||
thread::sleep(Duration::from_millis(DEFAULT_TIMELINE_DATA_PULL_TIMEOUT));
|
||||
thread::sleep(Duration::from_millis(DEFAULT_TIMELINE_DATA_PULL_TIMEOUT));
|
||||
}
|
||||
})
|
||||
.expect("Thread spawning failed");
|
||||
}
|
||||
|
|
|
@ -14,9 +14,9 @@ use serde::Serialize;
|
|||
use serde_json::{Map, Value};
|
||||
use servo_url::ServoUrl;
|
||||
|
||||
use crate::StreamId;
|
||||
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
|
||||
use crate::protocol::JsonPacketStream;
|
||||
use crate::StreamId;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[allow(dead_code)]
|
||||
|
|
|
@ -12,15 +12,15 @@
|
|||
#![deny(unsafe_code)]
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::collections::hash_map::Entry::{Occupied, Vacant};
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hash_map::Entry::{Occupied, Vacant};
|
||||
use std::io::Read;
|
||||
use std::net::{Shutdown, TcpListener, TcpStream};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::thread;
|
||||
|
||||
use base::id::{BrowsingContextId, PipelineId};
|
||||
use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use crossbeam_channel::{Receiver, Sender, unbounded};
|
||||
use devtools_traits::{
|
||||
ChromeToDevtoolsControlMsg, ConsoleMessage, ConsoleMessageBuilder, DevtoolScriptControlMsg,
|
||||
DevtoolsControlMsg, DevtoolsPageInfo, LogLevel, NavigationState, NetworkEvent, PageError,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#![recursion_limit = "128"]
|
||||
|
||||
use quote::{quote, TokenStreamExt};
|
||||
use quote::{TokenStreamExt, quote};
|
||||
|
||||
/// First field of DomObject must be either reflector or another dom_struct,
|
||||
/// all other fields must not implement DomObject
|
||||
|
|
|
@ -619,10 +619,10 @@ impl FontGroup {
|
|||
// Do not select this font if it goes against our emoji preference.
|
||||
match options.presentation_preference {
|
||||
EmojiPresentationPreference::Text if font.has_color_bitmap_or_colr_table() => {
|
||||
return false
|
||||
return false;
|
||||
},
|
||||
EmojiPresentationPreference::Emoji if !font.has_color_bitmap_or_colr_table() => {
|
||||
return false
|
||||
return false;
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
use std::collections::{HashMap, HashSet};
|
||||
use std::default::Default;
|
||||
use std::hash::{BuildHasherDefault, Hash, Hasher};
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
|
||||
use app_units::Au;
|
||||
use base::id::WebViewId;
|
||||
|
@ -16,10 +16,11 @@ use log::{debug, trace};
|
|||
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use net_traits::request::{Destination, Referrer, RequestBuilder};
|
||||
use net_traits::{fetch_async, CoreResourceThread, FetchResponseMsg, ResourceThreads};
|
||||
use net_traits::{CoreResourceThread, FetchResponseMsg, ResourceThreads, fetch_async};
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use servo_url::ServoUrl;
|
||||
use style::Atom;
|
||||
use style::computed_values::font_variant_caps::T as FontVariantCaps;
|
||||
use style::font_face::{
|
||||
FontFaceSourceFormat, FontFaceSourceFormatKeyword, Source, SourceList, UrlSource,
|
||||
|
@ -29,7 +30,6 @@ use style::properties::style_structs::Font as FontStyleStruct;
|
|||
use style::shared_lock::SharedRwLockReadGuard;
|
||||
use style::stylesheets::{CssRule, DocumentStyleSheet, FontFaceRule, StylesheetInDocument};
|
||||
use style::values::computed::font::{FamilyName, FontFamilyNameSyntax, SingleFontFamily};
|
||||
use style::Atom;
|
||||
use url::Url;
|
||||
use webrender_api::{FontInstanceFlags, FontInstanceKey, FontKey};
|
||||
use webrender_traits::CrossProcessCompositorApi;
|
||||
|
@ -502,7 +502,7 @@ pub trait FontContextWebFontMethods {
|
|||
);
|
||||
fn remove_all_web_fonts_from_stylesheet(&self, stylesheet: &DocumentStyleSheet);
|
||||
fn collect_unused_webrender_resources(&self, all: bool)
|
||||
-> (Vec<FontKey>, Vec<FontInstanceKey>);
|
||||
-> (Vec<FontKey>, Vec<FontInstanceKey>);
|
||||
}
|
||||
|
||||
impl FontContextWebFontMethods for Arc<FontContext> {
|
||||
|
@ -915,8 +915,7 @@ impl RemoteWebFontDownloader {
|
|||
FetchResponseMsg::ProcessResponseChunk(_, new_bytes) => {
|
||||
trace!(
|
||||
"@font-face {} chunk={:?}",
|
||||
self.web_font_family_name,
|
||||
new_bytes
|
||||
self.web_font_family_name, new_bytes
|
||||
);
|
||||
if self.response_valid {
|
||||
self.response_data.extend(new_bytes)
|
||||
|
@ -926,8 +925,7 @@ impl RemoteWebFontDownloader {
|
|||
FetchResponseMsg::ProcessResponseEOF(_, response) => {
|
||||
trace!(
|
||||
"@font-face {} EOF={:?}",
|
||||
self.web_font_family_name,
|
||||
response
|
||||
self.web_font_family_name, response
|
||||
);
|
||||
if response.is_err() || !self.response_valid {
|
||||
return DownloaderResponseResult::Failure;
|
||||
|
|
|
@ -25,7 +25,7 @@ use ipc_channel::ipc::IpcSharedMemory;
|
|||
pub use platform::LocalFontIdentifier;
|
||||
pub use shaper::*;
|
||||
pub use system_font_service::*;
|
||||
use unicode_properties::{emoji, EmojiStatus, UnicodeEmoji};
|
||||
use unicode_properties::{EmojiStatus, UnicodeEmoji, emoji};
|
||||
|
||||
/// A data structure to store data for fonts. Data is stored internally in an
|
||||
/// [`IpcSharedMemory`] handle, so that it can be send without serialization
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
use std::path::Path;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use base::text::{is_cjk, UnicodeBlock, UnicodeBlockMethod};
|
||||
use base::text::{UnicodeBlock, UnicodeBlockMethod, is_cjk};
|
||||
use log::warn;
|
||||
use style::Atom;
|
||||
use style::values::computed::font::GenericFontFamily;
|
||||
use style::values::computed::{
|
||||
FontStretch as StyleFontStretch, FontStyle as StyleFontStyle, FontWeight as StyleFontWeight,
|
||||
};
|
||||
use style::Atom;
|
||||
|
||||
use super::xml::{Attribute, Node};
|
||||
use crate::{
|
||||
|
|
|
@ -9,30 +9,30 @@ use std::{mem, ptr};
|
|||
use app_units::Au;
|
||||
use euclid::default::{Point2D, Rect, Size2D};
|
||||
use freetype_sys::{
|
||||
ft_sfnt_head, ft_sfnt_os2, FT_Byte, FT_Done_Face, FT_Error, FT_F26Dot6, FT_Face, FT_Fixed,
|
||||
FT_Get_Char_Index, FT_Get_Kerning, FT_Get_Sfnt_Table, FT_GlyphSlot, FT_Int32, FT_Load_Glyph,
|
||||
FT_Long, FT_MulFix, FT_New_Face, FT_New_Memory_Face, FT_Pos, FT_Select_Size, FT_Set_Char_Size,
|
||||
FT_Short, FT_SizeRec, FT_Size_Metrics, FT_UInt, FT_ULong, FT_UShort, FT_Vector,
|
||||
FT_FACE_FLAG_COLOR, FT_FACE_FLAG_FIXED_SIZES, FT_FACE_FLAG_SCALABLE, FT_KERNING_DEFAULT,
|
||||
FT_LOAD_COLOR, FT_LOAD_DEFAULT, FT_LOAD_NO_HINTING, FT_STYLE_FLAG_ITALIC, TT_OS2,
|
||||
FT_Byte, FT_Done_Face, FT_Error, FT_F26Dot6, FT_FACE_FLAG_COLOR, FT_FACE_FLAG_FIXED_SIZES,
|
||||
FT_FACE_FLAG_SCALABLE, FT_Face, FT_Fixed, FT_Get_Char_Index, FT_Get_Kerning, FT_Get_Sfnt_Table,
|
||||
FT_GlyphSlot, FT_Int32, FT_KERNING_DEFAULT, FT_LOAD_COLOR, FT_LOAD_DEFAULT, FT_LOAD_NO_HINTING,
|
||||
FT_Load_Glyph, FT_Long, FT_MulFix, FT_New_Face, FT_New_Memory_Face, FT_Pos,
|
||||
FT_STYLE_FLAG_ITALIC, FT_Select_Size, FT_Set_Char_Size, FT_Short, FT_Size_Metrics, FT_SizeRec,
|
||||
FT_UInt, FT_ULong, FT_UShort, FT_Vector, TT_OS2, ft_sfnt_head, ft_sfnt_os2,
|
||||
};
|
||||
use log::debug;
|
||||
use parking_lot::ReentrantMutex;
|
||||
use style::Zero;
|
||||
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 style::Zero;
|
||||
use webrender_api::FontInstanceFlags;
|
||||
|
||||
use super::library_handle::FreeTypeLibraryHandle;
|
||||
use super::LocalFontIdentifier;
|
||||
use super::library_handle::FreeTypeLibraryHandle;
|
||||
use crate::FontData;
|
||||
use crate::font::{
|
||||
FontMetrics, FontTableMethods, FontTableTag, FractionalPixel, PlatformFontMethods,
|
||||
};
|
||||
use crate::font_template::FontTemplateDescriptor;
|
||||
use crate::glyph::GlyphId;
|
||||
use crate::system_font_service::FontIdentifier;
|
||||
use crate::FontData;
|
||||
|
||||
// This constant is not present in the freetype
|
||||
// bindings due to bindgen not handling the way
|
||||
|
|
|
@ -21,9 +21,9 @@ use fontconfig_sys::{
|
|||
};
|
||||
use libc::{c_char, c_int};
|
||||
use log::debug;
|
||||
use style::Atom;
|
||||
use style::values::computed::font::GenericFontFamily;
|
||||
use style::values::computed::{FontStretch, FontStyle, FontWeight};
|
||||
use style::Atom;
|
||||
use unicode_script::Script;
|
||||
|
||||
use super::LocalFontIdentifier;
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
use std::os::raw::{c_long, c_void};
|
||||
use std::ptr;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::OnceLock;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
||||
use freetype_sys::{
|
||||
FT_Add_Default_Modules, FT_Done_Library, FT_Library, FT_Memory, FT_MemoryRec, FT_New_Library,
|
||||
|
|
|
@ -10,11 +10,11 @@ use std::{fs, io};
|
|||
|
||||
use base::text::{UnicodeBlock, UnicodeBlockMethod};
|
||||
use log::{debug, error, warn};
|
||||
use style::Atom;
|
||||
use style::values::computed::font::GenericFontFamily;
|
||||
use style::values::computed::{
|
||||
FontStretch as StyleFontStretch, FontStyle as StyleFontStyle, FontWeight as StyleFontWeight,
|
||||
};
|
||||
use style::Atom;
|
||||
use unicode_script::Script;
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -8,7 +8,7 @@ use std::sync::{Arc, OnceLock};
|
|||
use app_units::Au;
|
||||
use core_foundation::base::TCFType;
|
||||
use core_foundation::string::CFString;
|
||||
use core_foundation::url::{kCFURLPOSIXPathStyle, CFURL};
|
||||
use core_foundation::url::{CFURL, kCFURLPOSIXPathStyle};
|
||||
use core_graphics::data_provider::CGDataProvider;
|
||||
use core_graphics::display::CFDictionary;
|
||||
use core_graphics::font::CGFont;
|
||||
|
@ -16,8 +16,8 @@ use core_text::font::CTFont;
|
|||
use core_text::font_descriptor::kCTFontURLAttribute;
|
||||
use parking_lot::RwLock;
|
||||
|
||||
use crate::system_font_service::FontIdentifier;
|
||||
use crate::FontData;
|
||||
use crate::system_font_service::FontIdentifier;
|
||||
|
||||
/// A cache of `CTFont` to avoid having to create `CTFont` instances over and over. It is
|
||||
/// always possible to create a `CTFont` using a `FontTemplate` even if it isn't in this
|
||||
|
|
|
@ -14,7 +14,7 @@ use core_foundation::string::UniChar;
|
|||
use core_graphics::font::CGGlyph;
|
||||
use core_text::font::CTFont;
|
||||
use core_text::font_descriptor::{
|
||||
kCTFontDefaultOrientation, CTFontTraits, SymbolicTraitAccessors, TraitAccessors,
|
||||
CTFontTraits, SymbolicTraitAccessors, TraitAccessors, kCTFontDefaultOrientation,
|
||||
};
|
||||
use euclid::default::{Point2D, Rect, Size2D};
|
||||
use log::debug;
|
||||
|
@ -24,9 +24,9 @@ use webrender_api::FontInstanceFlags;
|
|||
use super::core_text_font_cache::CoreTextFontCache;
|
||||
use super::font_list::LocalFontIdentifier;
|
||||
use crate::{
|
||||
map_platform_values_to_style_values, FontData, FontIdentifier, FontMetrics, FontTableMethods,
|
||||
FontTableTag, FontTemplateDescriptor, FractionalPixel, GlyphId, PlatformFontMethods, CBDT,
|
||||
COLR, KERN, SBIX,
|
||||
CBDT, COLR, FontData, FontIdentifier, FontMetrics, FontTableMethods, FontTableTag,
|
||||
FontTemplateDescriptor, FractionalPixel, GlyphId, KERN, PlatformFontMethods, SBIX,
|
||||
map_platform_values_to_style_values,
|
||||
};
|
||||
|
||||
const KERN_PAIR_LEN: usize = 6;
|
||||
|
@ -149,7 +149,7 @@ impl CachedKernTable {
|
|||
match key.cmp(&query) {
|
||||
Ordering::Less => start = i + 1,
|
||||
Ordering::Equal => {
|
||||
return Some(BigEndian::read_i16(&pairs[i * KERN_PAIR_LEN + 4..]))
|
||||
return Some(BigEndian::read_i16(&pairs[i * KERN_PAIR_LEN + 4..]));
|
||||
},
|
||||
Ordering::Greater => end = i,
|
||||
}
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
use std::fs::File;
|
||||
use std::path::Path;
|
||||
|
||||
use base::text::{unicode_plane, UnicodeBlock, UnicodeBlockMethod};
|
||||
use base::text::{UnicodeBlock, UnicodeBlockMethod, unicode_plane};
|
||||
use log::debug;
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use memmap2::Mmap;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use style::values::computed::font::GenericFontFamily;
|
||||
use style::Atom;
|
||||
use style::values::computed::font::GenericFontFamily;
|
||||
use unicode_script::Script;
|
||||
use webrender_api::NativeFontHandle;
|
||||
|
||||
|
|
|
@ -15,20 +15,20 @@ use base::text::{UnicodeBlock, UnicodeBlockMethod};
|
|||
))]
|
||||
use unicode_script::Script;
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
pub use crate::platform::freetype::{font, font_list, LocalFontIdentifier};
|
||||
#[cfg(target_os = "macos")]
|
||||
pub use crate::platform::macos::{
|
||||
core_text_font_cache, font, font_list, font_list::LocalFontIdentifier,
|
||||
};
|
||||
#[cfg(target_os = "windows")]
|
||||
pub use crate::platform::windows::{font, font_list, font_list::LocalFontIdentifier};
|
||||
#[cfg(all(
|
||||
any(target_os = "linux", target_os = "macos"),
|
||||
not(target_os = "android"),
|
||||
not(target_env = "ohos")
|
||||
))]
|
||||
use crate::FallbackFontSelectionOptions;
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
pub use crate::platform::freetype::{LocalFontIdentifier, font, font_list};
|
||||
#[cfg(target_os = "macos")]
|
||||
pub use crate::platform::macos::{
|
||||
core_text_font_cache, font, font_list, font_list::LocalFontIdentifier,
|
||||
};
|
||||
#[cfg(target_os = "windows")]
|
||||
pub use crate::platform::windows::{font, font_list, font_list::LocalFontIdentifier};
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
pub mod freetype;
|
||||
|
|
|
@ -15,18 +15,18 @@ use app_units::Au;
|
|||
use dwrote::{FontCollection, FontFace, FontFile};
|
||||
use euclid::default::{Point2D, Rect, Size2D};
|
||||
use log::{debug, warn};
|
||||
use style::Zero;
|
||||
use style::computed_values::font_stretch::T as StyleFontStretch;
|
||||
use style::computed_values::font_weight::T as StyleFontWeight;
|
||||
use style::values::computed::font::FontStyle as StyleFontStyle;
|
||||
use style::Zero;
|
||||
use truetype::tables::WindowsMetrics;
|
||||
use truetype::value::Read;
|
||||
use webrender_api::FontInstanceFlags;
|
||||
|
||||
use super::font_list::LocalFontIdentifier;
|
||||
use crate::{
|
||||
ot_tag, FontData, FontIdentifier, FontMetrics, FontTableMethods, FontTableTag,
|
||||
FontTemplateDescriptor, FractionalPixel, GlyphId, PlatformFontMethods,
|
||||
FontData, FontIdentifier, FontMetrics, FontTableMethods, FontTableTag, FontTemplateDescriptor,
|
||||
FractionalPixel, GlyphId, PlatformFontMethods, ot_tag,
|
||||
};
|
||||
|
||||
// 1em = 12pt = 16px, assuming 72 points per inch and 96 px per inch
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
use std::hash::Hash;
|
||||
use std::sync::Arc;
|
||||
|
||||
use base::text::{unicode_plane, UnicodeBlock, UnicodeBlockMethod};
|
||||
use base::text::{UnicodeBlock, UnicodeBlockMethod, unicode_plane};
|
||||
use dwrote::{Font, FontCollection, FontDescriptor, FontStretch, FontStyle};
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
|
@ -14,6 +14,8 @@ use euclid::default::Point2D;
|
|||
// Eventually we would like the shaper to be pluggable, as many operating systems have their own
|
||||
// shapers. For now, however, HarfBuzz is a hard dependency.
|
||||
use harfbuzz_sys::{
|
||||
HB_DIRECTION_LTR, HB_DIRECTION_RTL, HB_MEMORY_MODE_READONLY, HB_OT_LAYOUT_BASELINE_TAG_HANGING,
|
||||
HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT, HB_OT_LAYOUT_BASELINE_TAG_ROMAN,
|
||||
hb_blob_create, hb_blob_t, hb_bool_t, hb_buffer_add_utf8, hb_buffer_create, hb_buffer_destroy,
|
||||
hb_buffer_get_glyph_infos, hb_buffer_get_glyph_positions, hb_buffer_get_length,
|
||||
hb_buffer_set_direction, hb_buffer_set_script, hb_buffer_t, hb_codepoint_t,
|
||||
|
@ -21,17 +23,15 @@ use harfbuzz_sys::{
|
|||
hb_font_destroy, hb_font_funcs_create, hb_font_funcs_set_glyph_h_advance_func,
|
||||
hb_font_funcs_set_nominal_glyph_func, hb_font_funcs_t, hb_font_set_funcs, hb_font_set_ppem,
|
||||
hb_font_set_scale, hb_font_t, hb_glyph_info_t, hb_glyph_position_t, hb_ot_layout_get_baseline,
|
||||
hb_position_t, hb_shape, hb_tag_t, HB_DIRECTION_LTR, HB_DIRECTION_RTL, HB_MEMORY_MODE_READONLY,
|
||||
HB_OT_LAYOUT_BASELINE_TAG_HANGING, HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT,
|
||||
HB_OT_LAYOUT_BASELINE_TAG_ROMAN,
|
||||
hb_position_t, hb_shape, hb_tag_t,
|
||||
};
|
||||
use log::debug;
|
||||
use num_traits::Zero;
|
||||
|
||||
use crate::platform::font::FontTable;
|
||||
use crate::{
|
||||
fixed_to_float, float_to_fixed, ot_tag, ByteIndex, Font, FontBaseline, FontTableMethods,
|
||||
FontTableTag, GlyphData, GlyphId, GlyphStore, ShapingFlags, ShapingOptions, BASE, KERN,
|
||||
BASE, ByteIndex, Font, FontBaseline, FontTableMethods, FontTableTag, GlyphData, GlyphId,
|
||||
GlyphStore, KERN, ShapingFlags, ShapingOptions, fixed_to_float, float_to_fixed, ot_tag,
|
||||
};
|
||||
|
||||
const NO_GLYPH: i32 = -1;
|
||||
|
|
|
@ -30,10 +30,10 @@ use webrender_traits::CrossProcessCompositorApi;
|
|||
use crate::font::FontDescriptor;
|
||||
use crate::font_store::FontStore;
|
||||
use crate::font_template::{FontTemplate, FontTemplateRef};
|
||||
use crate::platform::LocalFontIdentifier;
|
||||
use crate::platform::font_list::{
|
||||
default_system_generic_font_family, for_each_available_family, for_each_variation,
|
||||
};
|
||||
use crate::platform::LocalFontIdentifier;
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize)]
|
||||
pub enum FontIdentifier {
|
||||
|
|
|
@ -9,23 +9,24 @@ mod font_context {
|
|||
use std::collections::HashMap;
|
||||
use std::ffi::OsStr;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::atomic::{AtomicI32, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicI32, Ordering};
|
||||
use std::thread;
|
||||
|
||||
use app_units::Au;
|
||||
use fonts::platform::font::PlatformFont;
|
||||
use fonts::{
|
||||
fallback_font_families, FallbackFontSelectionOptions, FontContext, FontDescriptor,
|
||||
FontFamilyDescriptor, FontIdentifier, FontSearchScope, FontTemplate, FontTemplates,
|
||||
LocalFontIdentifier, PlatformFontMethods, SystemFontServiceMessage, SystemFontServiceProxy,
|
||||
SystemFontServiceProxySender,
|
||||
FallbackFontSelectionOptions, FontContext, FontDescriptor, FontFamilyDescriptor,
|
||||
FontIdentifier, FontSearchScope, FontTemplate, FontTemplates, LocalFontIdentifier,
|
||||
PlatformFontMethods, SystemFontServiceMessage, SystemFontServiceProxy,
|
||||
SystemFontServiceProxySender, fallback_font_families,
|
||||
};
|
||||
use ipc_channel::ipc::{self, IpcReceiver};
|
||||
use net_traits::ResourceThreads;
|
||||
use parking_lot::Mutex;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use servo_atoms::Atom;
|
||||
use style::ArcSlice;
|
||||
use style::properties::longhands::font_variant_caps::computed_value::T as FontVariantCaps;
|
||||
use style::properties::style_structs::Font as FontStyleStruct;
|
||||
use style::values::computed::font::{
|
||||
|
@ -34,7 +35,6 @@ mod font_context {
|
|||
};
|
||||
use style::values::computed::{FontLanguageOverride, XLang};
|
||||
use style::values::generics::font::LineHeight;
|
||||
use style::ArcSlice;
|
||||
use webrender_api::{FontInstanceKey, FontKey, IdNamespace};
|
||||
use webrender_traits::CrossProcessCompositorApi;
|
||||
|
||||
|
|
|
@ -12,11 +12,11 @@ use std::time::Duration;
|
|||
|
||||
use cookie::{Cookie, CookieBuilder};
|
||||
use headers::ContentType;
|
||||
use http::header::{self, HeaderMap, HeaderValue};
|
||||
use http::StatusCode;
|
||||
use http::header::{self, HeaderMap, HeaderValue};
|
||||
use hyper::{Method, Uri};
|
||||
use hyper_serde::{De, Ser};
|
||||
use serde_test::{assert_de_tokens, assert_ser_tokens, Token};
|
||||
use serde_test::{Token, assert_de_tokens, assert_ser_tokens};
|
||||
|
||||
#[test]
|
||||
fn test_content_type() {
|
||||
|
|
|
@ -793,10 +793,11 @@ impl BlockFlow {
|
|||
viewport_size: &Size2D<Au>,
|
||||
descendant: OpaqueFlow,
|
||||
) -> LogicalSize<Au> {
|
||||
debug_assert!(self
|
||||
.base
|
||||
.flags
|
||||
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED));
|
||||
debug_assert!(
|
||||
self.base
|
||||
.flags
|
||||
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED)
|
||||
);
|
||||
if self.is_fixed() || self.is_root() {
|
||||
// Initial containing block is the CB for the root
|
||||
LogicalSize::from_physical(self.base.writing_mode, *viewport_size)
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
use std::collections::LinkedList;
|
||||
use std::marker::PhantomData;
|
||||
use std::mem;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use html5ever::{local_name, namespace_url, ns};
|
||||
use log::debug;
|
||||
|
@ -24,6 +24,7 @@ use script_layout_interface::wrapper_traits::{
|
|||
};
|
||||
use script_layout_interface::{LayoutElementType, LayoutNodeType};
|
||||
use servo_url::ServoUrl;
|
||||
use style::LocalName;
|
||||
use style::computed_values::caption_side::T as CaptionSide;
|
||||
use style::computed_values::display::T as Display;
|
||||
use style::computed_values::empty_cells::T as EmptyCells;
|
||||
|
@ -38,7 +39,6 @@ use style::selector_parser::{PseudoElement, RestyleDamage};
|
|||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
use style::values::computed::Image;
|
||||
use style::values::generics::counters::ContentItem;
|
||||
use style::LocalName;
|
||||
|
||||
use crate::block::BlockFlow;
|
||||
use crate::context::LayoutContext;
|
||||
|
@ -71,7 +71,7 @@ use crate::table_wrapper::TableWrapperFlow;
|
|||
use crate::text::TextRunScanner;
|
||||
use crate::traversal::PostorderNodeMutTraversal;
|
||||
use crate::wrapper::{TextContent, ThreadSafeLayoutNodeHelpers};
|
||||
use crate::{parallel, ServoArc};
|
||||
use crate::{ServoArc, parallel};
|
||||
|
||||
/// The results of flow construction for a DOM node.
|
||||
#[derive(Clone, Default)]
|
||||
|
|
|
@ -11,8 +11,8 @@ use style::values::computed::{
|
|||
BorderCornerRadius, BorderImageSideWidth, BorderImageWidth, NonNegativeLengthOrNumber,
|
||||
NumberOrPercentage,
|
||||
};
|
||||
use style::values::generics::rect::Rect as StyleRect;
|
||||
use style::values::generics::NonNegative;
|
||||
use style::values::generics::rect::Rect as StyleRect;
|
||||
use webrender_api::units::{LayoutSideOffsets, LayoutSize};
|
||||
use webrender_api::{BorderRadius, BorderSide, BorderStyle, ColorF, NormalBorder};
|
||||
|
||||
|
|
|
@ -12,13 +12,13 @@ use std::default::Default;
|
|||
use std::sync::Arc;
|
||||
use std::{f32, mem};
|
||||
|
||||
use app_units::{Au, AU_PER_PX};
|
||||
use app_units::{AU_PER_PX, Au};
|
||||
use base::id::PipelineId;
|
||||
use bitflags::bitflags;
|
||||
use canvas_traits::canvas::{CanvasMsg, FromLayoutMsg};
|
||||
use embedder_traits::Cursor;
|
||||
use euclid::default::{Point2D, Rect, SideOffsets2D as UntypedSideOffsets2D, Size2D};
|
||||
use euclid::{rect, Scale, SideOffsets2D};
|
||||
use euclid::{Scale, SideOffsets2D, rect};
|
||||
use fnv::FnvHashMap;
|
||||
use fonts::ByteIndex;
|
||||
use ipc_channel::ipc;
|
||||
|
@ -26,7 +26,7 @@ use log::{debug, warn};
|
|||
use net_traits::image_cache::UsePlaceholder;
|
||||
use range::Range;
|
||||
use script_layout_interface::{
|
||||
combine_id_with_fragment_type, FragmentType, IFrameSize, IFrameSizes,
|
||||
FragmentType, IFrameSize, IFrameSizes, combine_id_with_fragment_type,
|
||||
};
|
||||
use servo_geometry::{self, MaxRect};
|
||||
use style::color::AbsoluteColor;
|
||||
|
@ -36,7 +36,7 @@ use style::computed_values::pointer_events::T as PointerEvents;
|
|||
use style::computed_values::position::T as StylePosition;
|
||||
use style::computed_values::visibility::T as Visibility;
|
||||
use style::logical_geometry::{LogicalMargin, LogicalPoint, LogicalRect};
|
||||
use style::properties::{style_structs, ComputedValues};
|
||||
use style::properties::{ComputedValues, style_structs};
|
||||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
use style::values::computed::effects::SimpleShadow;
|
||||
use style::values::computed::image::Image;
|
||||
|
@ -64,7 +64,7 @@ use crate::display_list::items::{
|
|||
PushTextShadowDisplayItem, StackingContext, StackingContextType, StickyFrameData,
|
||||
TextOrientation, WebRenderImageInfo,
|
||||
};
|
||||
use crate::display_list::{border, gradient, FilterToLayout, ToLayout};
|
||||
use crate::display_list::{FilterToLayout, ToLayout, border, gradient};
|
||||
use crate::flow::{BaseFlow, Flow, FlowFlags};
|
||||
use crate::flow_ref::FlowRef;
|
||||
use crate::fragment::{
|
||||
|
|
|
@ -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 base::id::PipelineId;
|
||||
use base::WebRenderEpochToU16;
|
||||
use base::id::PipelineId;
|
||||
use log::trace;
|
||||
use webrender_api::units::{LayoutPoint, LayoutSize, LayoutVector2D};
|
||||
use webrender_api::{
|
||||
|
|
|
@ -847,14 +847,7 @@ impl FlexFlow {
|
|||
}
|
||||
|
||||
let self_align = {
|
||||
let self_align = block
|
||||
.fragment
|
||||
.style()
|
||||
.get_position()
|
||||
.align_self
|
||||
.0
|
||||
.0
|
||||
.value();
|
||||
let self_align = block.fragment.style().get_position().align_self.0.0.value();
|
||||
|
||||
match self_align {
|
||||
AlignFlags::AUTO | AlignFlags::NORMAL => align_items,
|
||||
|
|
|
@ -27,17 +27,17 @@
|
|||
|
||||
use std::fmt;
|
||||
use std::slice::IterMut;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use app_units::Au;
|
||||
use base::print_tree::PrintTree;
|
||||
use bitflags::bitflags;
|
||||
use euclid::default::{Point2D, Rect, Size2D, Vector2D};
|
||||
use log::debug;
|
||||
use serde::ser::{SerializeStruct, Serializer};
|
||||
use serde::Serialize;
|
||||
use servo_geometry::{au_rect_to_f32_rect, f32_rect_to_au_rect, MaxRect};
|
||||
use serde::ser::{SerializeStruct, Serializer};
|
||||
use servo_geometry::{MaxRect, au_rect_to_f32_rect, f32_rect_to_au_rect};
|
||||
use style::computed_values::overflow_x::T as StyleOverflow;
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::computed_values::text_align::T as TextAlign;
|
||||
|
|
|
@ -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 https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::collections::{linked_list, LinkedList};
|
||||
use std::collections::{LinkedList, linked_list};
|
||||
use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
|
||||
use serde::ser::{Serialize, SerializeSeq, Serializer};
|
||||
use serde_json::{to_value, Map, Value};
|
||||
use serde_json::{Map, Value, to_value};
|
||||
|
||||
use crate::flow::{Flow, FlowClass};
|
||||
use crate::flow_ref::FlowRef;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
//! The `Fragment` type, which represents the leaves of the layout tree.
|
||||
|
||||
use std::borrow::ToOwned;
|
||||
use std::cmp::{max, min, Ordering};
|
||||
use std::cmp::{Ordering, max, min};
|
||||
use std::collections::LinkedList;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::{f32, fmt};
|
||||
|
@ -57,7 +57,7 @@ use webrender_api::units::LayoutTransform;
|
|||
use webrender_api::{self, ImageKey};
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::items::{ClipScrollNodeIndex, OpaqueNode, BLUR_INFLATION_FACTOR};
|
||||
use crate::display_list::items::{BLUR_INFLATION_FACTOR, ClipScrollNodeIndex, OpaqueNode};
|
||||
use crate::display_list::{StackingContextId, ToLayout};
|
||||
use crate::floats::ClearType;
|
||||
use crate::flow::{GetBaseFlow, ImmutableFlowUtils};
|
||||
|
@ -67,12 +67,12 @@ use crate::inline::{
|
|||
LineMetrics,
|
||||
};
|
||||
use crate::model::{
|
||||
self, style_length, IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, SizeConstraint,
|
||||
self, IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, SizeConstraint, style_length,
|
||||
};
|
||||
use crate::text::TextRunScanner;
|
||||
use crate::text_run::{TextRun, TextRunSlice};
|
||||
use crate::wrapper::ThreadSafeLayoutNodeHelpers;
|
||||
use crate::{text, ServoArc};
|
||||
use crate::{ServoArc, text};
|
||||
|
||||
// From gfxFontConstants.h in Firefox.
|
||||
static FONT_SUBSCRIPT_OFFSET_RATIO: f32 = 0.20;
|
||||
|
@ -1649,7 +1649,7 @@ impl Fragment {
|
|||
},
|
||||
|
||||
SpecificFragmentInfo::TruncatedFragment(_) => {
|
||||
return IntrinsicISizesContribution::new()
|
||||
return IntrinsicISizesContribution::new();
|
||||
},
|
||||
|
||||
SpecificFragmentInfo::UnscannedText(..) => {
|
||||
|
|
|
@ -13,7 +13,7 @@ use bitflags::bitflags;
|
|||
use euclid::default::{Point2D, Rect, Size2D};
|
||||
use fonts::{FontContext, FontMetrics};
|
||||
use log::debug;
|
||||
use range::{int_range_index, Range, RangeIndex};
|
||||
use range::{Range, RangeIndex, int_range_index};
|
||||
use script_layout_interface::wrapper_traits::PseudoElementType;
|
||||
use serde::Serialize;
|
||||
use servo_geometry::MaxRect;
|
||||
|
@ -50,7 +50,7 @@ use crate::fragment::{
|
|||
};
|
||||
use crate::model::IntrinsicISizesContribution;
|
||||
use crate::traversal::PreorderFlowTraversal;
|
||||
use crate::{text, ServoArc};
|
||||
use crate::{ServoArc, text};
|
||||
|
||||
/// `Line`s are represented as offsets into the child list, rather than
|
||||
/// as an object that "owns" fragments. Choosing a different set of line
|
||||
|
|
|
@ -19,13 +19,13 @@ use style::values::computed::length::{
|
|||
};
|
||||
use style::values::generics::column::ColumnCount;
|
||||
|
||||
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, FragmentationContext, GetBaseFlow, OpaqueFlow};
|
||||
use crate::fragment::{Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use crate::ServoArc;
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
unsafe impl crate::flow::HasBaseFlow for MulticolFlow {}
|
||||
|
|
|
@ -23,8 +23,8 @@ use style::dom::TElement;
|
|||
use style::logical_geometry::{BlockFlowDirection, InlineBaseDirection, WritingMode};
|
||||
use style::properties::style_structs::{self, Font};
|
||||
use style::properties::{
|
||||
parse_one_declaration_into, ComputedValues, Importance, LonghandId, PropertyDeclarationBlock,
|
||||
PropertyDeclarationId, PropertyId, ShorthandId, SourcePropertyDeclaration,
|
||||
ComputedValues, Importance, LonghandId, PropertyDeclarationBlock, PropertyDeclarationId,
|
||||
PropertyId, ShorthandId, SourcePropertyDeclaration, parse_one_declaration_into,
|
||||
};
|
||||
use style::selector_parser::PseudoElement;
|
||||
use style::shared_lock::SharedRwLock;
|
||||
|
@ -32,8 +32,8 @@ use style::stylesheets::{CssRuleType, Origin, UrlExtraData};
|
|||
use style_traits::{ParsingMode, ToCss};
|
||||
|
||||
use crate::construct::ConstructionResult;
|
||||
use crate::display_list::items::OpaqueNode;
|
||||
use crate::display_list::IndexableText;
|
||||
use crate::display_list::items::OpaqueNode;
|
||||
use crate::flow::{Flow, GetBaseFlow};
|
||||
use crate::fragment::{Fragment, FragmentBorderBoxIterator, FragmentFlags, SpecificFragmentInfo};
|
||||
use crate::inline::InlineFragmentNodeFlags;
|
||||
|
|
|
@ -16,8 +16,8 @@ use style::context::SharedStyleContext;
|
|||
use style::logical_geometry::LogicalSize;
|
||||
use style::properties::ComputedValues;
|
||||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
use style::values::computed::Size;
|
||||
use style::values::CSSFloat;
|
||||
use style::values::computed::Size;
|
||||
|
||||
use crate::block::{
|
||||
BlockFlow, CandidateBSizeIterator, ISizeAndMarginsComputer, ISizeConstraintInput,
|
||||
|
|
|
@ -24,8 +24,8 @@ use style::computed_values::{position, table_layout};
|
|||
use style::context::SharedStyleContext;
|
||||
use style::logical_geometry::{LogicalRect, LogicalSize};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::Size;
|
||||
use style::values::CSSFloat;
|
||||
use style::values::computed::Size;
|
||||
|
||||
use crate::block::{
|
||||
AbsoluteNonReplaced, BlockFlow, FloatNonReplaced, ISizeAndMarginsComputer,
|
||||
|
|
|
@ -11,8 +11,8 @@ use std::sync::Arc;
|
|||
use app_units::Au;
|
||||
use base::text::is_bidi_control;
|
||||
use fonts::{
|
||||
self, ByteIndex, FontContext, FontIdentifier, FontMetrics, FontRef, RunMetrics, ShapingFlags,
|
||||
ShapingOptions, LAST_RESORT_GLYPH_ADVANCE,
|
||||
self, ByteIndex, FontContext, FontIdentifier, FontMetrics, FontRef, LAST_RESORT_GLYPH_ADVANCE,
|
||||
RunMetrics, ShapingFlags, ShapingOptions,
|
||||
};
|
||||
use log::{debug, warn};
|
||||
use range::Range;
|
||||
|
@ -20,8 +20,8 @@ use style::computed_values::text_rendering::T as TextRendering;
|
|||
use style::computed_values::white_space_collapse::T as WhiteSpaceCollapse;
|
||||
use style::computed_values::word_break::T as WordBreak;
|
||||
use style::logical_geometry::{LogicalSize, WritingMode};
|
||||
use style::properties::style_structs::Font as FontStyleStruct;
|
||||
use style::properties::ComputedValues;
|
||||
use style::properties::style_structs::Font as FontStyleStruct;
|
||||
use style::values::generics::font::LineHeight;
|
||||
use style::values::specified::text::{TextTransform, TextTransformCase};
|
||||
use unicode_bidi as bidi;
|
||||
|
|
|
@ -12,14 +12,14 @@ use style::data::ElementData;
|
|||
use style::dom::{NodeInfo, TElement, TNode};
|
||||
use style::selector_parser::RestyleDamage;
|
||||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
use style::traversal::{recalc_style_at, DomTraversal, PerLevelTraversalData};
|
||||
use style::traversal::{DomTraversal, PerLevelTraversalData, recalc_style_at};
|
||||
|
||||
use crate::LayoutData;
|
||||
use crate::construct::FlowConstructor;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::DisplayListBuildState;
|
||||
use crate::flow::{Flow, FlowFlags, GetBaseFlow, ImmutableFlowUtils};
|
||||
use crate::wrapper::ThreadSafeLayoutNodeHelpers;
|
||||
use crate::LayoutData;
|
||||
|
||||
pub struct RecalcStyleAndConstructFlows<'a> {
|
||||
context: LayoutContext<'a>,
|
||||
|
|
|
@ -8,6 +8,7 @@ use std::borrow::Cow;
|
|||
|
||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||
|
||||
use crate::PropagatedBoxTreeData;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::{BoxSlot, NodeExt};
|
||||
use crate::dom_traversal::{Contents, NodeAndStyleInfo, TraversalHandler};
|
||||
|
@ -19,7 +20,6 @@ use crate::formatting_contexts::{
|
|||
};
|
||||
use crate::layout_box_base::LayoutBoxBase;
|
||||
use crate::style_ext::DisplayGeneratingBox;
|
||||
use crate::PropagatedBoxTreeData;
|
||||
|
||||
/// A builder used for both flex and grid containers.
|
||||
pub(crate) struct ModernContainerBuilder<'a, 'dom, Node> {
|
||||
|
|
|
@ -8,14 +8,14 @@ use style::computed_values::background_attachment::SingleComputedValue as Backgr
|
|||
use style::computed_values::background_clip::single_value::T as Clip;
|
||||
use style::computed_values::background_origin::single_value::T as Origin;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::background::BackgroundSize as Size;
|
||||
use style::values::computed::LengthPercentage;
|
||||
use style::values::computed::background::BackgroundSize as Size;
|
||||
use style::values::specified::background::{
|
||||
BackgroundRepeat as RepeatXY, BackgroundRepeatKeyword as Repeat,
|
||||
};
|
||||
use webrender_api::{self as wr, units};
|
||||
use wr::units::LayoutSize;
|
||||
use wr::ClipChainId;
|
||||
use wr::units::LayoutSize;
|
||||
|
||||
use crate::replaced::NaturalSizes;
|
||||
|
||||
|
|
|
@ -8,11 +8,11 @@ use style::values::computed::length_percentage::NonNegativeLengthPercentage;
|
|||
use style::values::computed::position::Position;
|
||||
use style::values::generics::basic_shape::{GenericShapeRadius, ShapeBox, ShapeGeometryBox};
|
||||
use style::values::generics::position::GenericPositionOrAuto;
|
||||
use webrender_api::units::{LayoutRect, LayoutSideOffsets, LayoutSize};
|
||||
use webrender_api::ClipChainId;
|
||||
use webrender_api::units::{LayoutRect, LayoutSideOffsets, LayoutSize};
|
||||
use webrender_traits::display_list::ScrollTreeNodeId;
|
||||
|
||||
use super::{compute_margin_box_radius, normalize_radii, BuilderForBoxFragment, DisplayList};
|
||||
use super::{BuilderForBoxFragment, DisplayList, compute_margin_box_radius, normalize_radii};
|
||||
|
||||
pub(super) fn build_clip_path_clip_chain_if_necessary(
|
||||
clip_path: ClipPath,
|
||||
|
|
|
@ -11,7 +11,7 @@ use style::computed_values::transform_style::T as ComputedTransformStyle;
|
|||
use style::values::computed::Filter as ComputedFilter;
|
||||
use style::values::specified::border::BorderImageRepeatKeyword;
|
||||
use webrender_api::{
|
||||
units, FilterOp, ImageRendering, LineStyle, MixBlendMode, RepeatMode, Shadow, TransformStyle,
|
||||
FilterOp, ImageRendering, LineStyle, MixBlendMode, RepeatMode, Shadow, TransformStyle, units,
|
||||
};
|
||||
|
||||
use crate::geom::{PhysicalPoint, PhysicalRect, PhysicalSides, PhysicalSize};
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
use app_units::Au;
|
||||
use euclid::Size2D;
|
||||
use style::Zero;
|
||||
use style::color::mix::ColorInterpolationMethod;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::image::{EndingShape, Gradient, LineDirection};
|
||||
|
@ -11,11 +12,10 @@ use style::values::computed::{Angle, AngleOrPercentage, Color, LengthPercentage,
|
|||
use style::values::generics::image::{
|
||||
Circle, ColorStop, Ellipse, GradientFlags, GradientItem, ShapeExtent,
|
||||
};
|
||||
use style::Zero;
|
||||
use webrender_api::units::LayoutPixel;
|
||||
use webrender_api::{
|
||||
self as wr, units, ConicGradient as WebRenderConicGradient,
|
||||
Gradient as WebRenderLinearGradient, RadialGradient as WebRenderRadialGradient,
|
||||
self as wr, ConicGradient as WebRenderConicGradient, Gradient as WebRenderLinearGradient,
|
||||
RadialGradient as WebRenderRadialGradient, units,
|
||||
};
|
||||
use wr::ColorF;
|
||||
|
||||
|
|
|
@ -13,27 +13,27 @@ use fonts::GlyphStore;
|
|||
use gradient::WebRenderGradient;
|
||||
use net_traits::image_cache::UsePlaceholder;
|
||||
use servo_geometry::MaxRect;
|
||||
use style::Zero;
|
||||
use style::color::{AbsoluteColor, ColorSpace};
|
||||
use style::computed_values::border_image_outset::T as BorderImageOutset;
|
||||
use style::computed_values::text_decoration_style::T as ComputedTextDecorationStyle;
|
||||
use style::dom::OpaqueNode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::properties::longhands::visibility::computed_value::T as Visibility;
|
||||
use style::properties::style_structs::Border;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::image::Image;
|
||||
use style::values::computed::{
|
||||
BorderImageSideWidth, BorderImageWidth, BorderStyle, LengthPercentage,
|
||||
NonNegativeLengthOrNumber, NumberOrPercentage, OutlineStyle,
|
||||
};
|
||||
use style::values::generics::rect::Rect;
|
||||
use style::values::generics::NonNegative;
|
||||
use style::values::generics::rect::Rect;
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
use style::values::specified::ui::CursorKind;
|
||||
use style::Zero;
|
||||
use webrender_api::units::{DevicePixel, LayoutPixel, LayoutRect, LayoutSize};
|
||||
use webrender_api::{
|
||||
self as wr, units, BorderDetails, BoxShadowClipMode, ClipChainId, CommonItemProperties,
|
||||
ImageRendering, NinePatchBorder, NinePatchBorderSource,
|
||||
self as wr, BorderDetails, BoxShadowClipMode, ClipChainId, CommonItemProperties,
|
||||
ImageRendering, NinePatchBorder, NinePatchBorderSource, units,
|
||||
};
|
||||
use webrender_traits::display_list::{
|
||||
AxesScrollSensitivity, CompositorDisplayListInfo, ScrollTreeNodeId,
|
||||
|
@ -1074,7 +1074,7 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
}
|
||||
},
|
||||
Image::CrossFade(_) | Image::ImageSet(_) | Image::None | Image::PaintWorklet(_) => {
|
||||
return false
|
||||
return false;
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -8,11 +8,12 @@ use std::mem;
|
|||
|
||||
use app_units::Au;
|
||||
use base::print_tree::PrintTree;
|
||||
use euclid::default::{Point2D, Rect, Size2D};
|
||||
use euclid::SideOffsets2D;
|
||||
use euclid::default::{Point2D, Rect, Size2D};
|
||||
use log::warn;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use servo_config::opts::DebugOptions;
|
||||
use style::Zero;
|
||||
use style::computed_values::float::T as ComputedFloat;
|
||||
use style::computed_values::mix_blend_mode::T as ComputedMixBlendMode;
|
||||
use style::computed_values::overflow_x::T as ComputedOverflow;
|
||||
|
@ -23,17 +24,16 @@ use style::values::computed::{ClipRectOrAuto, Length};
|
|||
use style::values::generics::box_::Perspective;
|
||||
use style::values::generics::transform;
|
||||
use style::values::specified::box_::DisplayOutside;
|
||||
use style::Zero;
|
||||
use webrender_api::units::{LayoutPoint, LayoutRect, LayoutTransform, LayoutVector2D};
|
||||
use webrender_api::{self as wr, BorderRadius};
|
||||
use webrender_traits::display_list::{AxesScrollSensitivity, ScrollTreeNodeId, ScrollableNodeInfo};
|
||||
use wr::units::{LayoutPixel, LayoutSize};
|
||||
use wr::{ClipChainId, SpatialTreeItemKey, StickyOffsetBounds};
|
||||
|
||||
use super::clip_path::build_clip_path_clip_chain_if_necessary;
|
||||
use super::DisplayList;
|
||||
use super::clip_path::build_clip_path_clip_chain_if_necessary;
|
||||
use crate::display_list::conversions::{FilterToWebRender, ToWebRender};
|
||||
use crate::display_list::{offset_radii, BuilderForBoxFragment, DisplayListBuilder};
|
||||
use crate::display_list::{BuilderForBoxFragment, DisplayListBuilder, offset_radii};
|
||||
use crate::fragment_tree::{
|
||||
BoxFragment, ContainingBlockManager, Fragment, FragmentFlags, FragmentTree,
|
||||
PositioningFragment, SpecificLayoutInfo,
|
||||
|
@ -486,28 +486,31 @@ impl StackingContext {
|
|||
self.real_stacking_contexts_and_positioned_stacking_containers
|
||||
.sort_by_key(|a| a.z_index());
|
||||
|
||||
debug_assert!(self
|
||||
.real_stacking_contexts_and_positioned_stacking_containers
|
||||
.iter()
|
||||
.all(|c| matches!(
|
||||
c.context_type,
|
||||
StackingContextType::RealStackingContext |
|
||||
StackingContextType::PositionedStackingContainer
|
||||
)));
|
||||
debug_assert!(self
|
||||
.float_stacking_containers
|
||||
.iter()
|
||||
.all(
|
||||
|c| c.context_type == StackingContextType::FloatStackingContainer &&
|
||||
c.z_index() == 0
|
||||
));
|
||||
debug_assert!(self
|
||||
.atomic_inline_stacking_containers
|
||||
.iter()
|
||||
.all(
|
||||
|c| c.context_type == StackingContextType::AtomicInlineStackingContainer &&
|
||||
c.z_index() == 0
|
||||
));
|
||||
debug_assert!(
|
||||
self.real_stacking_contexts_and_positioned_stacking_containers
|
||||
.iter()
|
||||
.all(|c| matches!(
|
||||
c.context_type,
|
||||
StackingContextType::RealStackingContext |
|
||||
StackingContextType::PositionedStackingContainer
|
||||
))
|
||||
);
|
||||
debug_assert!(
|
||||
self.float_stacking_containers
|
||||
.iter()
|
||||
.all(
|
||||
|c| c.context_type == StackingContextType::FloatStackingContainer &&
|
||||
c.z_index() == 0
|
||||
)
|
||||
);
|
||||
debug_assert!(
|
||||
self.atomic_inline_stacking_containers
|
||||
.iter()
|
||||
.all(
|
||||
|c| c.context_type == StackingContextType::AtomicInlineStackingContainer &&
|
||||
c.z_index() == 0
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
fn push_webrender_stacking_context_if_necessary(
|
||||
|
@ -1056,9 +1059,10 @@ impl BoxFragment {
|
|||
// but all fragments that establish reference frames also establish
|
||||
// containing blocks for absolute and fixed descendants, so those
|
||||
// properties will be replaced before recursing into children.
|
||||
assert!(self
|
||||
.style
|
||||
.establishes_containing_block_for_all_descendants(self.base.flags));
|
||||
assert!(
|
||||
self.style
|
||||
.establishes_containing_block_for_all_descendants(self.base.flags)
|
||||
);
|
||||
let adjusted_containing_block = ContainingBlock::new(
|
||||
containing_block
|
||||
.rect
|
||||
|
|
|
@ -22,8 +22,8 @@ use crate::cell::ArcRefCell;
|
|||
use crate::context::LayoutContext;
|
||||
use crate::dom_traversal::WhichPseudoElement;
|
||||
use crate::flexbox::FlexLevelBox;
|
||||
use crate::flow::inline::InlineItem;
|
||||
use crate::flow::BlockLevelBox;
|
||||
use crate::flow::inline::InlineItem;
|
||||
use crate::geom::PhysicalSize;
|
||||
use crate::replaced::{CanvasInfo, CanvasSource};
|
||||
use crate::taffy::TaffyItemBox;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
use std::borrow::Cow;
|
||||
use std::iter::FusedIterator;
|
||||
|
||||
use html5ever::{local_name, LocalName};
|
||||
use html5ever::{LocalName, local_name};
|
||||
use log::warn;
|
||||
use script_layout_interface::wrapper_traits::{ThreadSafeLayoutElement, ThreadSafeLayoutNode};
|
||||
use script_layout_interface::{LayoutElementType, LayoutNodeType};
|
||||
|
|
|
@ -11,18 +11,18 @@ use itertools::izip;
|
|||
use rayon::iter::{
|
||||
IndexedParallelIterator, IntoParallelRefIterator, ParallelDrainRange, ParallelIterator,
|
||||
};
|
||||
use style::Zero;
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::logical_geometry::Direction;
|
||||
use style::properties::ComputedValues;
|
||||
use style::properties::longhands::align_items::computed_value::T as AlignItems;
|
||||
use style::properties::longhands::box_sizing::computed_value::T as BoxSizing;
|
||||
use style::properties::longhands::flex_direction::computed_value::T as FlexDirection;
|
||||
use style::properties::longhands::flex_wrap::computed_value::T as FlexWrap;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::LengthPercentage;
|
||||
use style::values::generics::flex::GenericFlexBasis as FlexBasis;
|
||||
use style::values::generics::length::{GenericLengthPercentageOrAuto, LengthPercentageOrNormal};
|
||||
use style::values::specified::align::AlignFlags;
|
||||
use style::Zero;
|
||||
|
||||
use super::geom::{FlexAxis, FlexRelativeRect, FlexRelativeSides, FlexRelativeVec2};
|
||||
use super::{
|
||||
|
@ -36,7 +36,7 @@ use crate::formatting_contexts::{
|
|||
use crate::fragment_tree::{BoxFragment, CollapsedBlockMargins, Fragment, FragmentFlags};
|
||||
use crate::geom::{AuOrAuto, LogicalRect, LogicalSides, LogicalVec2, Size, Sizes};
|
||||
use crate::positioned::{
|
||||
relative_adjustement, AbsolutelyPositionedBox, PositioningContext, PositioningContextLength,
|
||||
AbsolutelyPositionedBox, PositioningContext, PositioningContextLength, relative_adjustement,
|
||||
};
|
||||
use crate::sizing::{
|
||||
ComputeInlineContentSizes, ContentSizes, InlineContentSizesResult, IntrinsicSizingMode,
|
||||
|
@ -2160,7 +2160,7 @@ impl FlexItem<'_> {
|
|||
cross_end,
|
||||
main_start,
|
||||
main_end,
|
||||
}
|
||||
};
|
||||
},
|
||||
(AuOrAuto::Auto, AuOrAuto::Auto) => 2,
|
||||
_ => 1,
|
||||
|
|
|
@ -6,10 +6,10 @@ use app_units::Au;
|
|||
use geom::{FlexAxis, MainStartCrossStart};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::properties::longhands::align_items::computed_value::T as AlignItems;
|
||||
use style::properties::longhands::flex_direction::computed_value::T as FlexDirection;
|
||||
use style::properties::longhands::flex_wrap::computed_value::T as FlexWrap;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{AlignContent, JustifyContent};
|
||||
use style::values::specified::align::AlignFlags;
|
||||
|
||||
|
|
|
@ -7,15 +7,16 @@ use std::convert::TryFrom;
|
|||
|
||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||
use servo_arc::Arc;
|
||||
use style::properties::longhands::list_style_position::computed_value::T as ListStylePosition;
|
||||
use style::properties::ComputedValues;
|
||||
use style::properties::longhands::list_style_position::computed_value::T as ListStylePosition;
|
||||
use style::selector_parser::PseudoElement;
|
||||
use style::str::char_is_whitespace;
|
||||
|
||||
use super::OutsideMarker;
|
||||
use super::inline::InlineFormattingContext;
|
||||
use super::inline::construct::InlineFormattingContextBuilder;
|
||||
use super::inline::inline_box::InlineBox;
|
||||
use super::inline::InlineFormattingContext;
|
||||
use super::OutsideMarker;
|
||||
use crate::PropagatedBoxTreeData;
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::{BoxSlot, LayoutBox, NodeExt};
|
||||
|
@ -30,7 +31,6 @@ use crate::layout_box_base::LayoutBoxBase;
|
|||
use crate::positioned::AbsolutelyPositionedBox;
|
||||
use crate::style_ext::{ComputedValuesExt, DisplayGeneratingBox, DisplayInside, DisplayOutside};
|
||||
use crate::table::{AnonymousTableContent, Table};
|
||||
use crate::PropagatedBoxTreeData;
|
||||
|
||||
impl BlockFormattingContext {
|
||||
pub(crate) fn construct<'dom, Node>(
|
||||
|
@ -204,9 +204,11 @@ where
|
|||
}
|
||||
|
||||
pub(crate) fn finish(mut self) -> BlockContainer {
|
||||
debug_assert!(!self
|
||||
.inline_formatting_context_builder
|
||||
.currently_processing_inline_box());
|
||||
debug_assert!(
|
||||
!self
|
||||
.inline_formatting_context_builder
|
||||
.currently_processing_inline_box()
|
||||
);
|
||||
|
||||
self.finish_anonymous_table_if_needed();
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ use crate::dom_traversal::{Contents, NodeAndStyleInfo};
|
|||
use crate::formatting_contexts::IndependentFormattingContext;
|
||||
use crate::fragment_tree::{BoxFragment, CollapsedMargin};
|
||||
use crate::geom::{LogicalRect, LogicalVec2, ToLogical};
|
||||
use crate::positioned::{relative_adjustement, PositioningContext};
|
||||
use crate::positioned::{PositioningContext, relative_adjustement};
|
||||
use crate::style_ext::{DisplayInside, PaddingBorderMargin};
|
||||
use crate::{ContainingBlock, PropagatedBoxTreeData};
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ use unicode_bidi::Level;
|
|||
|
||||
use super::text_run::TextRun;
|
||||
use super::{InlineBox, InlineBoxIdentifier, InlineBoxes, InlineFormattingContext, InlineItem};
|
||||
use crate::PropagatedBoxTreeData;
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::NodeExt;
|
||||
|
@ -21,7 +22,6 @@ use crate::flow::float::FloatBox;
|
|||
use crate::formatting_contexts::IndependentFormattingContext;
|
||||
use crate::positioned::AbsolutelyPositionedBox;
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use crate::PropagatedBoxTreeData;
|
||||
|
||||
#[derive(Default)]
|
||||
pub(crate) struct InlineFormattingContextBuilder {
|
||||
|
|
|
@ -9,14 +9,14 @@ use fonts::FontMetrics;
|
|||
use servo_arc::Arc;
|
||||
use style::properties::ComputedValues;
|
||||
|
||||
use super::{inline_container_needs_strut, InlineContainerState, InlineContainerStateFlags};
|
||||
use super::{InlineContainerState, InlineContainerStateFlags, inline_container_needs_strut};
|
||||
use crate::ContainingBlock;
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::NodeExt;
|
||||
use crate::dom_traversal::NodeAndStyleInfo;
|
||||
use crate::fragment_tree::BaseFragmentInfo;
|
||||
use crate::style_ext::{LayoutStyle, PaddingBorderMargin};
|
||||
use crate::ContainingBlock;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct InlineBox {
|
||||
|
|
|
@ -7,6 +7,7 @@ use bitflags::bitflags;
|
|||
use fonts::{FontMetrics, GlyphStore};
|
||||
use itertools::Either;
|
||||
use servo_arc::Arc;
|
||||
use style::Zero;
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::computed_values::white_space_collapse::T as WhiteSpaceCollapse;
|
||||
use style::properties::ComputedValues;
|
||||
|
@ -15,7 +16,6 @@ use style::values::generics::font::LineHeight;
|
|||
use style::values::specified::align::AlignFlags;
|
||||
use style::values::specified::box_::DisplayOutside;
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
use style::Zero;
|
||||
use unicode_bidi::{BidiInfo, Level};
|
||||
use webrender_api::FontInstanceKey;
|
||||
|
||||
|
@ -27,7 +27,7 @@ use crate::fragment_tree::{
|
|||
};
|
||||
use crate::geom::{LogicalRect, LogicalVec2, PhysicalRect, ToLogical};
|
||||
use crate::positioned::{
|
||||
relative_adjustement, AbsolutelyPositionedBox, PositioningContext, PositioningContextLength,
|
||||
AbsolutelyPositionedBox, PositioningContext, PositioningContextLength, relative_adjustement,
|
||||
};
|
||||
use crate::{ContainingBlock, ContainingBlockSize};
|
||||
|
||||
|
|
|
@ -89,28 +89,28 @@ use line::{
|
|||
};
|
||||
use line_breaker::LineBreaker;
|
||||
use servo_arc::Arc;
|
||||
use style::Zero;
|
||||
use style::computed_values::text_wrap_mode::T as TextWrapMode;
|
||||
use style::computed_values::vertical_align::T as VerticalAlign;
|
||||
use style::computed_values::white_space_collapse::T as WhiteSpaceCollapse;
|
||||
use style::context::QuirksMode;
|
||||
use style::properties::style_structs::InheritedText;
|
||||
use style::properties::ComputedValues;
|
||||
use style::properties::style_structs::InheritedText;
|
||||
use style::values::generics::box_::VerticalAlignKeyword;
|
||||
use style::values::generics::font::LineHeight;
|
||||
use style::values::specified::box_::BaselineSource;
|
||||
use style::values::specified::text::{TextAlignKeyword, TextDecorationLine};
|
||||
use style::values::specified::{TextAlignLast, TextJustify};
|
||||
use style::Zero;
|
||||
use text_run::{
|
||||
add_or_get_font, get_font_for_first_font_for_style, TextRun, XI_LINE_BREAKING_CLASS_GL,
|
||||
XI_LINE_BREAKING_CLASS_WJ, XI_LINE_BREAKING_CLASS_ZWJ,
|
||||
TextRun, XI_LINE_BREAKING_CLASS_GL, XI_LINE_BREAKING_CLASS_WJ, XI_LINE_BREAKING_CLASS_ZWJ,
|
||||
add_or_get_font, get_font_for_first_font_for_style,
|
||||
};
|
||||
use unicode_bidi::{BidiInfo, Level};
|
||||
use webrender_api::FontInstanceKey;
|
||||
use xi_unicode::linebreak_property;
|
||||
|
||||
use super::float::{Clear, PlacementAmongFloats};
|
||||
use super::IndependentFormattingContextContents;
|
||||
use super::float::{Clear, PlacementAmongFloats};
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::flow::float::{FloatBox, SequentialLayoutState};
|
||||
|
|
|
@ -8,7 +8,7 @@ use std::ops::Range;
|
|||
use app_units::Au;
|
||||
use base::text::is_bidi_control;
|
||||
use fonts::{
|
||||
FontContext, FontRef, GlyphRun, ShapingFlags, ShapingOptions, LAST_RESORT_GLYPH_ADVANCE,
|
||||
FontContext, FontRef, GlyphRun, LAST_RESORT_GLYPH_ADVANCE, ShapingFlags, ShapingOptions,
|
||||
};
|
||||
use fonts_traits::ByteIndex;
|
||||
use log::warn;
|
||||
|
|
|
@ -9,6 +9,7 @@ use app_units::{Au, MAX_AU};
|
|||
use inline::InlineFormattingContext;
|
||||
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
|
||||
use servo_arc::Arc;
|
||||
use style::Zero;
|
||||
use style::computed_values::clear::T as StyleClear;
|
||||
use style::logical_geometry::Direction;
|
||||
use style::properties::ComputedValues;
|
||||
|
@ -16,7 +17,6 @@ use style::servo::selector_parser::PseudoElement;
|
|||
use style::values::computed::Size as StyleSize;
|
||||
use style::values::specified::align::AlignFlags;
|
||||
use style::values::specified::{Display, TextAlignKeyword};
|
||||
use style::Zero;
|
||||
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
|
@ -815,10 +815,10 @@ impl BlockLevelBox {
|
|||
BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(box_) => &box_.borrow().context,
|
||||
BlockLevelBox::OutOfFlowFloatBox(float_box) => &float_box.contents,
|
||||
BlockLevelBox::OutsideMarker(outside_marker) => {
|
||||
return outside_marker.inline_content_sizes(layout_context, constraint_space)
|
||||
return outside_marker.inline_content_sizes(layout_context, constraint_space);
|
||||
},
|
||||
BlockLevelBox::SameFormattingContextBlock { base, contents, .. } => {
|
||||
return base.inline_content_sizes(layout_context, constraint_space, contents)
|
||||
return base.inline_content_sizes(layout_context, constraint_space, contents);
|
||||
},
|
||||
};
|
||||
independent_formatting_context.inline_content_sizes(layout_context, constraint_space)
|
||||
|
|
|
@ -18,7 +18,7 @@ use webrender_traits::display_list::AxesScrollSensitivity;
|
|||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::dom::{LayoutBox, NodeExt};
|
||||
use crate::dom_traversal::{iter_child_nodes, Contents, NodeAndStyleInfo, NonReplacedContents};
|
||||
use crate::dom_traversal::{Contents, NodeAndStyleInfo, NonReplacedContents, iter_child_nodes};
|
||||
use crate::flexbox::FlexLevelBox;
|
||||
use crate::flow::float::FloatBox;
|
||||
use crate::flow::inline::InlineItem;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use bitflags::bitflags;
|
||||
use script_layout_interface::{combine_id_with_fragment_type, FragmentType};
|
||||
use script_layout_interface::{FragmentType, combine_id_with_fragment_type};
|
||||
use style::dom::OpaqueNode;
|
||||
use style::selector_parser::PseudoElement;
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@ use app_units::Au;
|
|||
use atomic_refcell::AtomicRefCell;
|
||||
use base::print_tree::PrintTree;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::Zero;
|
||||
use style::computed_values::border_collapse::T as BorderCollapse;
|
||||
use style::computed_values::overflow_x::T as ComputedOverflow;
|
||||
use style::computed_values::position::T as ComputedPosition;
|
||||
use style::logical_geometry::WritingMode;
|
||||
use style::properties::ComputedValues;
|
||||
use style::Zero;
|
||||
|
||||
use super::{BaseFragment, BaseFragmentInfo, CollapsedBlockMargins, Fragment};
|
||||
use crate::formatting_contexts::Baselines;
|
||||
|
|
|
@ -9,9 +9,9 @@ use base::id::PipelineId;
|
|||
use base::print_tree::PrintTree;
|
||||
use fonts::{FontMetrics, GlyphStore};
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::Zero;
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
use style::Zero;
|
||||
use webrender_api::{FontInstanceKey, ImageKey};
|
||||
|
||||
use super::{
|
||||
|
|
|
@ -8,17 +8,17 @@ use std::fmt;
|
|||
use std::ops::{Add, AddAssign, Neg, Sub, SubAssign};
|
||||
|
||||
use app_units::{Au, MAX_AU};
|
||||
use style::Zero;
|
||||
use style::logical_geometry::{BlockFlowDirection, Direction, InlineBaseDirection, WritingMode};
|
||||
use style::values::computed::{
|
||||
CSSPixelLength, LengthPercentage, MaxSize as StyleMaxSize, Percentage, Size as StyleSize,
|
||||
};
|
||||
use style::values::generics::length::GenericLengthPercentageOrAuto as AutoOr;
|
||||
use style::Zero;
|
||||
use style_traits::CSSPixel;
|
||||
|
||||
use crate::ContainingBlock;
|
||||
use crate::sizing::ContentSizes;
|
||||
use crate::style_ext::Clamp;
|
||||
use crate::ContainingBlock;
|
||||
|
||||
pub type PhysicalPoint<U> = euclid::Point2D<U, CSSPixel>;
|
||||
pub type PhysicalSize<U> = euclid::Size2D<U, CSSPixel>;
|
||||
|
|
|
@ -6,11 +6,11 @@ use atomic_refcell::AtomicRefCell;
|
|||
use servo_arc::Arc;
|
||||
use style::properties::ComputedValues;
|
||||
|
||||
use crate::ConstraintSpace;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::fragment_tree::BaseFragmentInfo;
|
||||
use crate::geom::SizeConstraint;
|
||||
use crate::sizing::{ComputeInlineContentSizes, InlineContentSizesResult};
|
||||
use crate::ConstraintSpace;
|
||||
|
||||
/// A box tree node that handles containing information about style and the original DOM
|
||||
/// node or pseudo-element that it is based on. This also handles caching of layout values
|
||||
|
|
|
@ -7,11 +7,11 @@ use std::mem;
|
|||
use app_units::Au;
|
||||
use rayon::iter::IntoParallelRefMutIterator;
|
||||
use rayon::prelude::{IndexedParallelIterator, ParallelIterator};
|
||||
use style::Zero;
|
||||
use style::computed_values::position::T as Position;
|
||||
use style::logical_geometry::{Direction, WritingMode};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::specified::align::AlignFlags;
|
||||
use style::Zero;
|
||||
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
|
@ -488,7 +488,7 @@ impl HoistedAbsolutelyPositionedBox {
|
|||
end: box_offset.inline_end,
|
||||
};
|
||||
let inline_alignment = match inline_box_offsets.either_specified() {
|
||||
true => style.clone_justify_self().0 .0,
|
||||
true => style.clone_justify_self().0.0,
|
||||
false => shared_fragment.resolved_alignment.inline,
|
||||
};
|
||||
|
||||
|
@ -515,7 +515,7 @@ impl HoistedAbsolutelyPositionedBox {
|
|||
end: box_offset.block_end,
|
||||
};
|
||||
let block_alignment = match block_box_offsets.either_specified() {
|
||||
true => style.clone_align_self().0 .0,
|
||||
true => style.clone_align_self().0.0,
|
||||
false => shared_fragment.resolved_alignment.block,
|
||||
};
|
||||
let mut block_axis_solver = AbsoluteAxisSolver {
|
||||
|
@ -938,7 +938,7 @@ impl AbsoluteAxisSolver<'_> {
|
|||
// Therefore the free space is zero and the alignment value is irrelevant.
|
||||
(Some(start), None) => return start.to_used_value(self.containing_size),
|
||||
(None, Some(end)) => {
|
||||
return self.containing_size - size - end.to_used_value(self.containing_size)
|
||||
return self.containing_size - size - end.to_used_value(self.containing_size);
|
||||
},
|
||||
};
|
||||
|
||||
|
|
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