Commit graph

319 commits

Author SHA1 Message Date
Simon Sapin
789807b7b0 Remove the ComputedValue traits and style_struct_traits 2016-07-20 08:42:40 +02:00
Simon Sapin
f7f81e0ed0 Use our copy of RefCell for style data.
This allows removing `#![feature(as_unsafe_cell)]` in geckolib
and make progress towards #11815.
2016-06-23 16:13:49 +02:00
Ms2ger
65b93c20b7 Remove the layout_wrapper re-exports from layout::wrapper. 2016-06-20 19:08:10 +02:00
Ms2ger
0616a60fd9 Move ServoLayoutNode and related structs to script. 2016-06-20 19:08:05 +02:00
Ms2ger
a8bb3d8d22 Make ServoLayoutNode::debug_id() less convoluted. 2016-06-20 19:08:03 +02:00
Ms2ger
7de3d165ad Introduce LayoutJS<Node>::opaque() to replace OpaqueNodeMethods::from_jsmanaged(). 2016-06-20 19:08:02 +02:00
Ms2ger
0d0b268138 Move LayoutNode and related traits to script_layout_interface. 2016-06-20 19:07:54 +02:00
Ms2ger
000e2de57a Move HTMLCanvasData to script_layout_interface. 2016-06-20 19:04:41 +02:00
Ms2ger
6b847eb93a Introduce LayoutNodeType and LayoutElementType enums. 2016-06-20 19:02:49 +02:00
Ms2ger
afc7118a67 Introduce a ThreadSafeLayoutNodeHelpers trait for methods to stay in layout. 2016-06-20 19:02:48 +02:00
Ms2ger
dac8878467 Introduce ThreadSafeLayoutNode::borrow_layout_data_unchecked. 2016-06-20 19:02:47 +02:00
Ms2ger
1039de8e7d Introduce a node_text_content method. 2016-06-20 19:02:46 +02:00
Ms2ger
16d6555f4d Move some more methods into the LayoutNodeLayoutData trait. 2016-06-20 19:02:45 +02:00
Ms2ger
c910ef2072 Introduce a LayoutNodeLayoutData trait for methods to stay in layout. 2016-06-20 19:02:44 +02:00
Ms2ger
310cb5a326 Introduce get_style_and_layout_data() methods. 2016-06-20 19:02:43 +02:00
Ms2ger
8b05833e52 Split initialize_data into two.
The first one handles the layout-specific part, and calls the second one to
handle the script-specific part.
2016-06-20 19:02:42 +02:00
Ms2ger
d50c166786 Use get_style_data() where possible. 2016-06-20 19:02:41 +02:00
Ms2ger
72632ac16d Implement get_style_data() methods. 2016-06-20 19:02:40 +02:00
Ms2ger
bea96f60e3 Introduce PartialStyleAndLayoutData. 2016-06-20 19:02:39 +02:00
Ms2ger
6aaf3e6a01 Move OpaqueStyleAndLayoutData to script_layout_interface. 2016-06-20 19:02:38 +02:00
Ms2ger
5c03dd8eb1 Introduce a script_layout_interface crate and move RestyleDamage to it. 2016-06-20 19:02:36 +02:00
Ms2ger
e723d72570 Move the initialize_data method out of the TNode trait.
This reduces the dependency of TNode implementations on layout types.
2016-06-13 15:21:29 +01:00
Ms2ger
172aa226cc Use Ref/RefMut::map rather than transmute for ServoLayoutNode. 2016-06-13 12:29:14 +01:00
Ms2ger
6a1722e18d Make layout only depend on script::layout_interface. 2016-06-07 13:46:49 +02:00
Ms2ger
684510bc94 Stop re-exporting AttrValue. 2016-06-07 13:15:23 +02:00
Ms2ger
858ea2eb9a Move the definition of ServoThreadSafeLayoutNode::iframe_pipeline_id to script. 2016-06-07 11:39:28 +02:00
Ms2ger
5859109197 Move the definition of ServoThreadSafeLayoutNode::canvas_data to script. 2016-06-07 11:10:40 +02:00
Ms2ger
ef3c6a7773 Move the definition of ServoThreadSafeLayoutNode::image_url to script. 2016-06-07 10:57:20 +02:00
Ms2ger
093b7b7710 Move the definition of ServoThreadSafeLayoutNode::selection to script. 2016-06-07 10:30:52 +02:00
Anthony Ramine
ff899dc703 Implement :placeholder-shown (fixes #10561) 2016-06-03 14:45:14 +02:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
Bobby Holley
b521c293dc Add string_cache override for geckolib based on gecko atoms.
The work in these patches is based on Ms2ger's gecko-atom crate.
2016-05-18 11:33:38 -07:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Ms2ger
a5be5a82c1 Move some code from ServoThreadSafeLayoutNode::text_content into script. 2016-05-09 14:26:30 +02:00
Emilio Cobos Álvarez
aacf67afcd
layout: use debug! instead of warn! for the expected ThreadSafeLayoutElement methods 2016-05-04 00:34:05 +02:00
Emilio Cobos Álvarez
a87bf7c776
style: Minor documentation tweaks about lazy pseudo-elements 2016-05-04 00:34:00 +02:00
Emilio Cobos Álvarez
028f9b6cd2
style: layout: Allow a lazy pseudo-element implementation in Servo. 2016-05-04 00:33:58 +02:00
Emilio Cobos Álvarez
9caaa6004e
style: Support lazy pseudo-elements
These can't be supported in Servo as of right now, because I'm not
totally sure the accesses that should be done in layout would be
thread-safe.

It can be revisited later though.
2016-05-03 19:01:54 +02:00
Emilio Cobos Álvarez
9c44062836
layout: be clearer about resolved_style 2016-04-29 22:54:52 +02:00
Emilio Cobos Álvarez
5577a083ec
layout: Simplify ThreadSafeLayout::text_content 2016-04-29 22:54:50 +02:00
Emilio Cobos Álvarez
cf5c090576
layout: Don't force to overwrite display for pseudo-elements. 2016-04-29 22:54:49 +02:00
Emilio Cobos Álvarez
2a499d5a0b
layout: Stop storing PrecomputedStyleData in LayoutNode
Use the SharedStyleContext instead.
2016-04-29 22:54:48 +02:00
Emilio Cobos Álvarez
979c3a54b9
layout: Tidy a bit style pseudo-elements stuff 2016-04-29 22:54:47 +02:00
Emilio Cobos Álvarez
5a43c7e3cd
style: Allow inheritance when computing anonymous box styles
This is used a lot by Gecko, not still for servo though.
2016-04-29 22:54:46 +02:00
Emilio Cobos Álvarez
3563ecb770
style: Use precomputation for the -servo-details-content pseudo-element 2016-04-29 22:54:45 +02:00
Emilio Cobos Álvarez
b6402a81d0
style: Add infrastructure for non-eagerly-cascaded pseudo-elements
This commit also removes StylistWrapper and uses Arc::get_mut instead.
2016-04-29 22:54:45 +02:00
bors-servo
ac8406f4ae Auto merge of #10834 - yoava333:master, r=SimonSapin
added support for :read-only and :read-write pseudo-classes

partial fix for https://github.com/servo/servo/issues/10732

It's not a full fix because:
1. there's a bug in wpt-test https://github.com/w3c/web-platform-tests/issues/2889#issuecomment-214144420
2. we don't fully support all input types (namely image, color, hidden and range), which are defaulted to input text. this means that :read-write which is applicable to input text is mis-handled in those cases.
3. we don't support contenteditable, which is also possibly :read-write

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10834)
<!-- Reviewable:end -->
2016-04-29 08:12:18 -07:00
Matt Brubeck
c4872d9544 Replace range::Range with std::ops::Range in script 2016-04-28 14:54:07 -07:00
Matt Brubeck
659305fe0a Use byte indices instead of char indices for text runs
Replace character indices with UTF-8 byte offsets throughout the code dealing
with text shaping and breaking.  This eliminates a lot of complexity when
converting from one to the other, and interoperates better with the rest of
the Rust ecosystem.
2016-04-28 14:32:14 -07:00
Yoav Alon
9bf909ac2f added support for :read-only and :read-write pseudo-classes
partial fix for https://github.com/servo/servo/issues/10732
2016-04-27 01:38:58 +03:00