Commit graph

72 commits

Author SHA1 Message Date
Ravi Shankar
6061985898 Prefer Servo-specific ToCss for all types 2016-11-07 09:14:22 +05:30
Simon Sapin
53b638c0e2 Update to string-cache 0.3 2016-11-03 16:23:05 +01:00
Bobby Holley
46e29184bd Move core pseudo-element handling to ThreadSafeLayoutElement. 2016-10-28 10:47:57 -07:00
Bobby Holley
2fce2fbb0c Move all *MatchMethods to TElement.
MozReview-Commit-ID: 3V6JIlOVVhw
2016-10-27 10:22:33 -07:00
Martin Robinson
ccb7ab926a Remove concept of Layers from Servo
Layers were a feature of the legacy drawing path. If we re-add them at
some point, it probably makes more sense to make them a product of
display list inspection.

This change also remove a bunch of dead painting code.
2016-10-21 08:38:34 +02:00
Bobby Holley
bfbbef6ecd Remove borrow_data and mutate_data from TNode.
The new restyle architecture doesn't store these things in consistent
places, so we need a more abstract API.
2016-10-10 20:36:31 -07:00
Ms2ger
12d31d2d70 Pass &mut Flow to query functions. 2016-08-25 09:40:20 +02:00
Ms2ger
67d6a02667 Pass a &mut Flow to iterate_through_flow_tree_fragment_border_boxes. 2016-08-25 09:21:33 +02:00
bors-servo
4cefbcc949 Auto merge of #12813 - emilio:hit-test, r=notriddle
dom: getElementsFromPoint does the hit testing on viewport coordinates.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [x] There are tests for these changes OR

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

We got this wrong (I think it wasn't my fault actually), I was just writing a test for #12777 when I found this.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12813)
<!-- Reviewable:end -->
2016-08-11 05:34:27 -05:00
Emilio Cobos Álvarez
f9c0f2df13
dom: getElementsFromPoint does the hit testing on viewport coordinates.
We got this wrong, I was just writing a test for #12777 when I found this.
2016-08-10 21:15:10 -07:00
bors-servo
1b2450339c Auto merge of #12757 - emilio:stylo, r=bholley,pcwalton
stylo: Stop restyling display: none elements, remove the has_changed hack that made us use ReconstructFrame unconditionally.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

r? @bholley

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12757)
<!-- Reviewable:end -->
2016-08-10 21:02:30 -05:00
Emilio Cobos Álvarez
477c3c8c5b
layout: Factor out the code to ensure a node data is initialized. 2016-08-10 18:26:27 -07:00
Emilio Cobos Álvarez
6b60383f24
layout: Ensure a element's style is up to date when processing queries. 2016-08-10 18:26:23 -07:00
Emilio Cobos Álvarez
28d7c2dca8
layout: Take into account the client point for fixed positioned stacking contexts. 2016-08-08 13:03:55 -07:00
Simon Sapin
6d0e48f6cc Remove some type aliases that are now just re-exports. 2016-07-20 08:42:47 +02:00
Simon Sapin
789807b7b0 Remove the ComputedValue traits and style_struct_traits 2016-07-20 08:42:40 +02:00
Ms2ger
6b981039d0 Avoid the Vec reversal in DisplayList::hit_test. 2016-06-29 09:46:45 +02:00
Ms2ger
f82cf3da12 Merge AuExtensionMethods and LocalToCss. 2016-06-23 15:39:56 +02:00
Ms2ger
55a93107ce Move LayoutThreadData to query.rs. 2016-06-20 21:23:42 +02:00
Ms2ger
86bfd2cc9f Move LayoutRPC to script_layout_interface. 2016-06-20 19:08:07 +02:00
Ms2ger
0d0b268138 Move LayoutNode and related traits to script_layout_interface. 2016-06-20 19:07:54 +02:00
Ms2ger
afc7118a67 Introduce a ThreadSafeLayoutNodeHelpers trait for methods to stay in layout. 2016-06-20 19:02:48 +02:00
mrmiywj
46cadfdd2c use less repetitive name 2016-06-12 12:28:07 +08:00
Patrick Walton
041cfe6d0a script: When using WebRender, keep the DOM-side scroll positions for
elements with `overflow: scroll` up to date, and take them into account
when doing hit testing.

Closes #11648.
2016-06-10 18:43:04 -07:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
Cullen Rhodes
40acd24e8f Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
Ms2ger
cc2b2b50a7 Remove ConstellationChan.
It's a pointless abstraction that propagates the obsolete chan terminology,
swaps the order in which the sender and receiver are returned, and hides a
source of panics.
2016-05-19 17:13:44 +02:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Emilio Cobos Álvarez
2a499d5a0b
layout: Stop storing PrecomputedStyleData in LayoutNode
Use the SharedStyleContext instead.
2016-04-29 22:54:48 +02:00
Zhen Zhang
fefdaf76de Implement ScrollTop and ScrollLeft getters:
Add new compositor message to get scroll_offset;
Add new layout query for computed value of overflow-x/y;
Implement layer_id method for ThreadSafeLayoutNode;
Add new layout query for layer_id;
Implement script interface for getting scrollTop and scrollLeft, as well as relavant helper functions.
2016-04-19 12:27:35 +08:00
Per Lundberg
96835c6d6f Renamed style structs.
The idea is to rename all style structs from Foo to ServoFoo, as described out in #10185.
2016-04-08 21:47:36 +03:00
Daniel Robertson
44832a87af Correct x and y input for origin_rect
Fix error in construction of the origin_rect for
UnioningFragmentBorderBoxIterator.
2016-04-06 18:11:59 -04:00
Rizky Luthfianto
07584b9f29 Implement Document#elementsFromPoint 2016-04-03 21:44:01 +07:00
Emilio Cobos Álvarez
92f39ea5cf Implement ::selection pseudo-element 2016-03-30 14:28:11 +02:00
Per Lundberg
4cb4cc93e4 Renamed TComputedValues to ComputedValues
This is a followup to #10210, and a continuation of #10185.
2016-03-29 23:30:13 +03:00
Bobby Holley
c2daea2c9c Parameterize the rest of the style system on TNode. 2016-03-24 11:50:57 -07:00
Michael Howell
9d9c5398a8 Get the fundamentals of the HTMLDetailsElement rendering stuff working.
Still need to implement the style invalidation.

Part of #9395
2016-03-19 16:02:11 -07:00
Bobby Holley
539f839958 Remove lifetimes from LayoutNode and friends. 2016-03-14 14:31:57 -07:00
Daniel Robertson
16d2778ece Add scrollWidth/Height to element interface
Add the scrollWidth and scrollHeight extensions to the element
interface.
2016-03-11 18:22:16 +00:00
Jack Moffitt
2507bfb2cf Suppress reflows before RefreshTick or FirstLoad
This fixes a bug where partially loaded content is displayed to the user
before it should be, usually before stylesheets have loaded. This commit
supresses reflows until either FirstLoad or RefreshTick, whichever comes
first.

Unfortunately, hit_test and mouse_over did not do reflows if they were
necessary, and so by suppressing the initial spurious reflows, these
methods started to panic without a display list to query. This patch
also transforms these into queries similar to the other existing
queries.
2016-03-03 15:17:46 -07:00
Emilio Cobos Álvarez
48dee6413d script/layout: Refactor mouse_over since it now basically uses hit_test 2016-03-02 20:14:15 +01:00
Emilio Cobos Álvarez
b1f0581637 script: Fix MouseOver handling
Now we only query for the topmost node, and apply the hover state to all
of the parent elements.

This fixes things like #9705, where the hover state was applied only to
the children.

This also makes us more conformant with other browsers in the case of
taking in account margins and paddings.

For example, prior to this PR, when your mouse was over the inner
element, in the bottom part, `hover` styles didn't apply to the parent.

```html
<style>
div {
  padding: 10px;
  margin: 10px;
  height: 15px;
  background: blue;
}

div:hover {
  background: red;
}
</style>

<div>
  <div></div>
</div>
```

Fixes #9705
2016-03-02 20:01:41 +01:00
Martin Robinson
e7019f2721 Flatten display list structure
Instead of producing a tree of stacking contexts, display list
generation now produces a flat list of display items and a tree of
stacking contexts. This will eventually allow display list construction
to produce and modify WebRender vertex buffers directly, removing the
overhead of display list conversion.  This change also moves
layerization of the display list to the paint thread, since it isn't
currently useful for WebRender.

To accomplish this, display list generation now takes three passes of
the flow tree:

        1. Calculation of absolute positions.
        2. Collection of a tree of stacking contexts.
        3. Creation of a list of display items.

After collection of display items, they are sorted based upon the index
of their parent stacking contexts and their position in CSS 2.1
Appendeix E stacking order.

This is a big change, but it actually simplifies display list generation.
2016-03-01 14:50:07 -08:00
benshu
0785d91ae4 Completed implementation of devtools' getLayout. 2016-02-24 13:51:47 -05:00
Anthony Ramine
db8d502f41 Move util::logical_geometry to style 2016-02-18 10:17:13 +01:00
Anthony Ramine
290694b27e Move util::cursor to style_traits 2016-02-16 00:50:01 +01:00
Emilio Cobos Álvarez
a1c830f1c1 Update rust-selectors
This commits updates rust-selectors to use the generic parser, and as
such it moves the element state into the style crate.
2016-02-03 02:11:31 +01:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
Johannes Linke
6b215f38ee Fix a bunch of clippy lints 2016-01-02 23:27:15 +01:00
bors-servo
0f5c614609 Auto merge of #9051 - bholley:split_style_and_layout_wrappers, r=SimonSapin
Split layout wrappers into style+layout and layout-only functionality

This is a step towards removing the dependency of stylo on layout/.

This PR depends on #9004.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9051)
<!-- Reviewable:end -->
2015-12-30 10:04:14 +05:30