Commit graph

93 commits

Author SHA1 Message Date
Ms2ger
6528bee84f Introduce a layout_thread crate; drop the dependency of layout on script. 2016-06-20 21:23:44 +02:00
Ms2ger
7414edab05 Move DISPLAY_PORT_SIZE_FACTOR to block.rs. 2016-06-20 21:23:43 +02:00
Ms2ger
55a93107ce Move LayoutThreadData to query.rs. 2016-06-20 21:23:42 +02:00
Ms2ger
b56821a01f Move CSSErrorReporter to script_layout_interface. 2016-06-20 19:08:13 +02:00
Ms2ger
9e2e0ff98c Move the remainder of layout_interface into script_layout_interface. 2016-06-20 19:08:12 +02:00
Ms2ger
65b93c20b7 Remove the layout_wrapper re-exports from layout::wrapper. 2016-06-20 19:08:10 +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
c910ef2072 Introduce a LayoutNodeLayoutData trait for methods to stay in layout. 2016-06-20 19:02:44 +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
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
Anthony Ramine
b97c7a8c4d Don't load all font faces sources
We stop at the first one we manage to load.
2016-06-10 21:51:06 +02:00
bors-servo
1e3edf3ca4 Auto merge of #11656 - Ms2ger:reduce-dom-exposure, r=nox
Reduce the amount of dom code used outside the script crate.

<!-- 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/11656)
<!-- Reviewable:end -->
2016-06-07 11:09:14 -05:00
Ms2ger
6a1722e18d Make layout only depend on script::layout_interface. 2016-06-07 13:46:49 +02:00
bors-servo
b64b21ace0 Auto merge of #11565 - nox:fonts, r=metajack
Introduce FontFaceRules::effective_sources()

<!-- 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/11565)
<!-- Reviewable:end -->
2016-06-07 03:50:18 -05:00
Anthony Ramine
64b34d5162 Introduce FontFaceRules::effective_sources()
This avoids downloading fonts in formats we don't support.
2016-06-06 23:43:09 +02:00
Ms2ger
021b9e3239 Remove the layout shutdown channel.
Nobody is listening.
2016-06-04 13:24:32 +02:00
Anthony Ramine
1621e0679e Do not create a channel for each source in add_font_face_rules 2016-06-03 11:37:25 +02:00
Patrick Walton
a86f77e36d script: Keep the DOM-side viewport up to date when scrolling happens in
WebRender.

This happens asynchronously, just as it does in non-WebRender mode.

This functionality is a prerequisite for doing proper display-list-based
hit testing in WebRender, since it moves the scroll offsets into Servo
(and, specifically, into the script thread, enabling iframe event
forwarding) instead of keeping them private to WebRender.

Requires servo/webrender_traits#55 and servo/webrender#277.

Partially addresses #11108.
2016-05-31 14:12:51 -07:00
Ms2ger
dc41c671e2 Remove SharedLayoutContext::url.
It is unused.
2016-05-31 14:47:17 +02:00
Ms2ger
f0ca775c80 Remove the ConvertPipelineIdToWebRender trait. 2016-05-28 14:10:32 +02:00
Cullen Rhodes
40acd24e8f Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
bors-servo
86e583fbed Auto merge of #11408 - Ms2ger:layoutthread-url, r=Manishearth
Take LayoutThread::url out of its RefCell.

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 --faster` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

Either:
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because refactoring

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

<!-- 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/11408)
<!-- Reviewable:end -->
2016-05-26 22:37:23 -05:00
Ms2ger
2d9248dc36 Take LayoutThread::url out of its RefCell. 2016-05-25 09:25:17 +02:00
Ms2ger
49d244d39c Use associated types to improve LayoutThreadFactory and ScriptThreadFactory. 2016-05-24 17:50:06 +02:00
bors-servo
5bfebd4a99 Auto merge of #11294 - kilobtye:fix-resize, r=mbrubeck
Compute overflow when viewport size changed

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 --faster` does not report any errors
- [X] These changes fix #11120 (github issue number if applicable).

Either:
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

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

<!-- 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/11294)
<!-- Reviewable:end -->
2016-05-20 11:18:25 -07:00
kilobtye
166e35a4c7 Compute overflow when viewport size changed 2016-05-20 18:55:36 +08:00
Ms2ger
9ee8c33a8d Remove pointless phantom arguments to ScriptThreadFactory and LayoutThreadFactory. 2016-05-20 10:20:58 +02: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
Kosov Eugene
8b6a609764 move trait ConvertPipelineIdToWebRender to a better place 2016-05-09 01:20:24 +03: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
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02:00
bors-servo
8d988f20c1 Auto merge of #9968 - izgzhen:scroll, r=asajeffrey
Implement scroll, scrollLeft, scrollTop and friends, addressing issue #9650

This is a work in progress to solve https://github.com/servo/servo/issues/9650. Thanks a lot for helping the review.

- [x] scroll
- [x] scrollTo
- [x] scrollBy
- [x] scrollTop (setter and getter)
- [x] scrollLeft (setter and getter)

The setters will be implemented in another PR after this is merged.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9968)
<!-- Reviewable:end -->
2016-04-20 18:40:26 +05:30
Patrick Walton
63279c316b layout: Implement support for overflow: scroll in WebRender.
Includes a WebRender upgrade.

Improves Twitter.
2016-04-19 14:13:13 -07:00
Alan Jeffrey
cfb066ef20 Added a dedicated panic channel. 2016-04-19 09:08:44 -05: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
Peter
b0ad3ddf5b Updated euclid to version 0.6.5
And updated existing usages of Matrix4 to use Matrix4D<T>
2016-04-17 18:39:49 +01:00
Alan Jeffrey
8c0fa01884 Added panic message to failures. 2016-04-13 16:09:48 -05:00
malayaleecoder
d4dcaf3167 Rename imm_child_iter() and child_iter(). Fixes #10286 2016-04-09 01:18:00 +05:30
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
bors-servo
aac2da75f4 Auto merge of #8641 - notriddle:no_headless, r=glennw
No more headless compositor. Just the normal one.

Fixes #8573

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8641)
<!-- Reviewable:end -->
2016-03-29 12:42:01 +05:30
Patrick Walton
b29719e36b layout: Rewrite the block formatting context/float inline-size
speculation code.

The old code tried to do the speculation as a single bottom-up pass
after intrinsic inline-size calculation, which was unable to handle
cases like this:

    <div>
        <div style="float: left">Foo</div>
    </div>
    <div>
        <div style="overflow: hidden">Bar</div>
    </div>

No single bottom-up pass could possibly handle this case, because the
inline-size of the float flowing out of the "Foo" block could never make
it down to the "Bar" block, where it is needed for speculation.

On the pages I tried, this regresses layout performance by 1%-2%.

I first noticed this breaking some pages, like the Google SERPs, several
months ago.
2016-03-25 18:39:16 -07:00
Matt Brubeck
afb36ec8de Fix forced repaint on image load
After #10021, `LayoutThread::repaint` no longer forced a repaint because of
the `restyle_damage` check.  This patch adds the correct restyle damage and
fixes #10163.
2016-03-25 14:54:00 -07:00
bors-servo
605842f193 Auto merge of #10155 - bholley:generalize_style_structs, r=SimonSapin
Generalize the style structs

This allows geckolib to pass gecko style structs and have the style system write to them directly, provided we implement all the traits.

<!-- 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/10155)
<!-- Reviewable:end -->
2016-03-25 03:27:33 +05:30
Bobby Holley
c2daea2c9c Parameterize the rest of the style system on TNode. 2016-03-24 11:50:57 -07:00
Michael Howell
c9cb4839e4 No more headless compositor. Just the normal one.
This changes headless operation to strictly be a runtime option, rather
than a compile-time one. Note that the old headless version still relied
on a display server to support WebGL, while it now requires one all the
time.

Fixes #8573
2016-03-24 11:18:54 -07:00
Emilio Cobos Álvarez
a02daf7144 canvas: Remove all the canvas layerization infrastructure
It was never complete, and with webrender as a backend the way we render
WebGL contexts has changed a bit.

This should remove quite a bit of overhead.
2016-03-23 18:12:37 +01:00