Commit graph

583 commits

Author SHA1 Message Date
bors-servo
57fe27a4ef
Auto merge of #26110 - servo:layout-2020-rm-note-dirty-descendant, r=emilio
Kill ServoLayoutElement::note_dirty_descendant
2020-04-04 09:51:19 -04:00
Anthony Ramine
8a0775fc89 Kill ServoLayoutElement::note_dirty_descendant
There is no need to set the dirty descendants flag unsafely from the layout side
for elements with pending restyles, we can do that on the DOM side when draining
the restyles from the Document.
2020-04-04 15:00:04 +02:00
Anthony Ramine
185a402d9c Make DOM own the style and layout data, in an UnsafeCell
The previous Cell was a lie.
2020-04-04 13:10:19 +02:00
Anthony Ramine
516e8e0aa6 Don't expose any AtomicRefCell directly from style traits
This lets us experiment with how we store this data on the DOM side.
2020-04-04 13:08:51 +02:00
Anthony Ramine
4c61baee30 Make OpaqueLayoutAndStyleData just a bit less opaque
It now stores a NonNull<dyn Any>.
2020-04-04 13:08:51 +02:00
Anthony Ramine
295f120425 Make LayoutShadowRootHelpers::get_style_data_for_layout return a &CascadeData
That return type is Sync, which thus means that the method can be safe.
2020-04-01 11:40:55 +02:00
Anthony Ramine
ebd2892158 Make synthesize_presentational_hints_for_legacy_attributes be safe 2020-04-01 11:40:55 +02:00
Anthony Ramine
0c0027ecfd Make LayoutDocumentHelpers::style_shared_lock be safe
StyleSharedRwLock is Sync.
2020-04-01 11:40:55 +02:00
Anthony Ramine
fc07a5147c Make LayoutNodeHelpers::composed_parent_node_ref be safe
For clarity, I introduce <LayoutDom<Element>>::parent_node_ref to contain
the remaining unsafety bits out of composed_parent_node_ref which is more
complex than just a field access.
2020-04-01 11:40:34 +02:00
Anthony Ramine
f712b0bcf8 Make LayoutShadowRootHelpers::get_host_for_layout be safe 2020-03-31 22:30:42 +02:00
Anthony Ramine
68d5cfffd5 Make a bunch of LayoutNodeHelpers be safe 2020-03-31 22:30:34 +02:00
Anthony Ramine
f014da9565 Introduce LayoutDom::is
Just like Castable::is.
2020-03-31 22:06:40 +02:00
Anthony Ramine
9c8540af5c Make layout methods accessing rare data be safe
They don't do anything fancy so there is no additional unsafety calling them
compared to using LayoutDom in the first place, the usual story of all
those changes.
2020-03-31 22:04:35 +02:00
Anthony Ramine
72c0771299 Make a bunch of LayoutDocumentHelpers be safe
The other methods are actually unsafe.
2020-03-31 21:39:45 +02:00
Anthony Ramine
fbc3e430ab Make a bunch or trivial LayoutElementHelpers safe 2020-03-31 20:37:57 +02:00
Anthony Ramine
5ff931d171 Introduce <LayoutDom<Element>>::attrs()
This safe method is the basic block to access element attributes from layout.
We reuse it in the other attr-related layout methods to remove a pretty big
source of rampant unsafe code between script and layout.
2020-03-31 18:46:49 +02:00
Anthony Ramine
0bda174823 Merge RawLayoutElementHelpers into LayoutElementHelpers 2020-03-31 18:30:42 +02:00
Anthony Ramine
6fe294fa5b Make LayoutNodeHelpers::text_content return a cow 2020-03-31 15:02:13 +02:00
Anthony Ramine
409bd3d989 Make LayoutCharacterDataHelpers::data_for_layout be safe 2020-03-31 14:57:44 +02:00
Anthony Ramine
86296b84ff Clean up LayoutShadowRootHelpers::get_style_data_for_layout
Parameter E is unused and the result should be bound by 'dom.
2020-03-30 13:07:25 +02:00
Anthony Ramine
dba6a635e5 Give a lifetime parameter to LayoutDom 2020-03-28 15:37:57 +01:00
Anthony Ramine
60ca98b753 Pass pending restyles instead of draining them from layout 2020-03-28 15:37:56 +01:00
Anthony Ramine
400c7012b1 Make ServoLayoutNode::new return a free lifetime value
Binding the scope of the ServoLayoutNode value to the originating
TrustedNodeAddress is just theater.
2020-03-28 14:06:08 +01:00
Anthony Ramine
df0118dd10 Move PendingRestyle to the style_layout_interface crate 2020-03-28 14:00:53 +01:00
Anthony Ramine
04af32128c Add a 'dom lifetime to GetLayoutData 2020-03-26 13:17:46 +01:00
Iulian Gabriel Radu
68c40da64a Remove unnecessary .clone() calls 2020-03-04 20:09:56 +02:00
Kunal Mohan
a05553f188
Make Background Hang Monitor Optional
This is done by wrapping all channels of communication
and related objects inside Option which are configured
using flag inside servo_config.
2020-02-23 01:45:52 +05:30
Josh Matthews
3fd3c23e17 Update ipc-channel and crossbeam-channel. 2020-02-20 11:15:13 -05:00
Kunal Mohan
4a3bf52a7c
remove option for origin and mirror changes to layout_thread_2020 2020-02-18 00:57:33 +05:30
Kunal Mohan
a5b43b7df1
Take origin from window instead of creating a new one in case of reflow
Everytime a new LayoutContext was created, it created a new origin which
caused endless stream of image loads to occur in case of reflow. The reason
for this was that the existing image, although cached successfully, was not
used because the entry in hashmap did not match because of different(new)
origin.
This is solved by storing the origin of a window in enum ScriptReflow and
used in creating new LayoutContext in case of reflow.
2020-02-15 23:51:26 +05:30
Martin Robinson
740211d191 Improve the name the NodeGeometryQuery
This query is used to get the clientTop, clientWidth, clientHeight,
clientLeft properties of DOM objects. "NodeGeometry" doesn't really
capture what these properties do as they often are returning the width
of element border.
2020-02-05 15:25:52 +01:00
Patrick Shaughnessy
8ca4db2cd6 :defined works 2020-01-30 10:09:51 -05:00
Emilio Cobos Álvarez
226c9807df
style: Fix servo build. 2019-11-30 20:45:08 +01:00
Josh Matthews
564c16d754 Use non-IPC webrender API over explicit IPC channels. 2019-11-27 20:47:53 -05:00
Josh Matthews
edcdcf7c13 layout: Inform webrender about new pipeline as early as possible. 2019-11-13 11:54:51 -05:00
Josh Matthews
91dfa354b1 Ensure layout/script always have a correct viewport size when a new pipeline is created. 2019-11-06 16:13:55 -05:00
Josh Matthews
fd260f78c8 dom: Calculate the viewport size of iframes when they are first added to the tree. 2019-11-06 16:13:55 -05:00
Anthony Ramine
785a344e32 Update rand to 0.7 (fixes #24448) 2019-10-23 15:34:48 +02:00
Josh Matthews
81a67aed9e Double key image cache by requesting origin, and store CORS status with cached images. 2019-10-04 09:22:21 -04:00
Anthony Ramine
bceecddb64 Update html5ever to 0.24 2019-09-27 17:43:37 +02:00
Emilio Cobos Álvarez
cd3b0c23fa
style: Fix Servo build, and rustfmt recent changes. 2019-09-12 23:04:56 +02:00
Simon Sapin
e9f7079c70 Replace DisplayList::is_contentful with tracking during conversion to WR display lists 2019-09-06 17:15:53 +02:00
Simon Sapin
526619a78a Replace the WebRenderDisplayItemConverter trait with an inherent method 2019-09-06 16:59:11 +02:00
Bastien Orivel
b6cddbebaa Deduplicate parking_lot and friends by updating it to 0.9 2019-09-05 10:47:39 +02:00
Bastien Orivel
92161ecfbc Update ipc-channel and related dependencies 2019-08-27 23:44:04 +02:00
Gregory Terzian
8482d2e781 restructure content process shutdown ack with threaded sender, without layout 2019-08-17 16:03:07 +02:00
Emilio Cobos Álvarez
3d57c22e9c Update euclid.
There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.

Given the size of this patch, I think it's useful to get this landed as-is.
2019-07-23 23:09:55 +02:00
Fernando Jiménez Moreno
a3d0d95b61 Moar detach shadow improvements 2019-07-22 17:40:17 +02:00
Fernando Jiménez Moreno
1f3c879a85 Detach shadow clean up 2019-07-22 17:40:16 +02:00
Fernando Jiménez Moreno
e344203c11 Only allow UA widgets as children of media elements
Do not allow pseudo-elements for replaced elements
2019-07-22 17:40:15 +02:00