Commit graph

231 commits

Author SHA1 Message Date
Johannes Linke
38405ee47e servo: Merge #9123 - Fix a bunch of clippy lints (from karyon:clippy_cleanup); r=Manishearth
This fixes about 130 clippy lints. Let me know if i should split up the commit.

I wasn't sure about some of the changes, especially map_or instead of map(...).unwrap_or(...) and if let instead of single arm match were not always a strict improvement in my opinion, but i'll leave that decision to the reviewer :)

There are about 150 lints left which i thought were clippy bugs or i didn't know how to fix.

cc @Manishearth

Source-Repo: https://github.com/servo/servo
Source-Revision: 9da739acefc7d1776bf727c8bf782eb79f241028
2016-01-03 08:47:34 +05:01
Ms2ger
1eb51e6f2b servo: Merge #9090 - Don't copy the list of stylesheets in LayoutTask::handle_reflow (from Ms2ger:stylesheets-vec); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 3791447de860816b43ba6f7bd746d40c267362f7
2015-12-31 21:21:22 +05:01
Bobby Holley
7f8dfa2fbf servo: Merge #9077 - Split the style-related bits out of LayoutContext and hoist more stuff into style/ (from bholley:split_layout_context_etc); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 3f407ea3d620e381b3adf6352cc09f9912db26b3
2015-12-30 10:32:23 +05:01
Bobby Holley
a5868c1c28 servo: Merge #9051 - Split layout wrappers into style+layout and layout-only functionality (from bholley:split_style_and_layout_wrappers); r=SimonSapin
This is a step towards removing the dependency of stylo on layout/.

This PR depends on #9004.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0f5c614609fd8867a9e7c27b8a398ea7d877c714
2015-12-30 09:35:14 +05:01
Joe Kachmar
1e4deb0868 servo: Merge #8958 - Separate script and layout messages, issue #8843 (from jkachmar:separate-layout-msg); r=KiChjang
Separated layout-specific messages to the constellation out from the `ScriptMsg` enum into a `LayoutMsg` enum within `script_traits/script_msg.rs`, addresses [#8843](https://github.com/servo/servo/issues/8843).

I initially tried to move `LayoutMsg` into `layout_traits/lib.rs`, but this introduced a cyclic dependency: `layout_traits` depends on `script_traits` for the `LayoutTaskFactory` implementation, and `script_traits/script_task.rs` now depends on `LayoutMsg` for new layout channels in `InitialScriptState` and `ScriptTask`.

Source-Repo: https://github.com/servo/servo
Source-Revision: 941653da653a1925ade35597e97f61a6a8a0018d
2015-12-27 02:55:38 +05:01
Brandon Fairchild
845411a627 servo: Merge #8938 - Move LayerKind and ScrollPolicy enums to gfx_traits (from nerith:gfx); r=Ms2ger
Fixes #8836.

Source-Repo: https://github.com/servo/servo
Source-Revision: 68c4f290c7c9ad7ea45fcea66e3c6b172e42be62
2015-12-23 18:09:51 +05:01
Patrick Walton
9964a8693a servo: Merge #8995 - gfx: Measure text shaping time in the time profiler (from pcwalton:measure-text-shaping); r=mbrubeck
r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 338f66003e78250ce141584e87190661249c5589
2015-12-17 10:28:29 +05:01
Keith Yeung
774fcbd5e2 servo: Merge #8903 - fix for Layout memory reporter uses pre-redirect url (from KiChjang:layout-reporter-redirect); r=nox
Rebase of #7612.

Fixes #6872.

Source-Repo: https://github.com/servo/servo
Source-Revision: bc7158310ce8abf6605840f1c23013640703e285
2015-12-16 22:49:30 +05:01
GauriGNaik
5be1a03fb2 servo: Merge #8971 - Add pipeline information to CSS error reporting (from jdm:expose-css-errors-1); r=jdm
Rebase of #8838.

Source-Repo: https://github.com/servo/servo
Source-Revision: d11f96e27074b0130760a02d39d2da4e003c820e
2015-12-14 21:22:41 +05:01
Tomas Cernaj
18632570cd servo: Merge #8909 - Move ScriptMsg to script_traits crate, Fixes #8833 (from cnaj:msg_refactoring); r=jdm
Review of documentation that was missing needed.

Fixes #8833.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7438bc0425749989b8aab084a34ff3fff2ea6679
2015-12-10 10:55:44 +05:01
Bobby Holley
4a9f5d05c0 servo: Merge #8669 - Generalize layout to operate on arbitrary DOMs (from bholley:generalize_layout); r=pcwalton
This gets us to where we need to be in order to write a Gecko implementation of the layout wrapper and have things Just Work.

Note that this is somewhat more than we need for just running the style system. But there wasn't a clean place to cut, and I thought it was a good idea to just do a complete job on it now, which may save us effort and mismatches in the long run.

Source-Repo: https://github.com/servo/servo
Source-Revision: 1f732cfbb404bfd96c3ed3f71c4b9900b7ffbba2
2015-11-29 07:18:33 +05:01
GauriGNaik
5b0ca679ad servo: Merge #8682 - Defined new trait ParseErrorReporter and added error_reporter member … (from jdm:css-error-reporter); r=jdm
…to ParserContext.

Rebase of #8210.

Source-Repo: https://github.com/servo/servo
Source-Revision: f5ef2f4f75cd58a3c6f1f123e413dc9d3a24f841
2015-11-27 03:27:08 +05:01
Patrick Walton
270cc716a0 servo: Merge #8670 - Write animated values into the ComputedValues structures when animations complete or are interrupted (from pcwalton:animation-expiration); r=glennw
This adds a new pair of reader-writer locks. I measured the performance
of style recalculation on Wikipedia and the overhead of the locks was
not measurable.

Closes #7816.

cc @paulrouget

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: 4f625d3ab67bc14b1563f90c48cf97ca59dc1a28
2015-11-25 07:31:14 +05:01
Martin Robinson
acc0f49daf servo: Merge #8632 - Improve readability of flow tree dump (from mrobinson:flow-tree-dump); r=pcwalton
Use the PrintTree utility to improve the readability of flow tree
dumps. Blocks and fragments are now split over two dump levels, because
otherwise they are impenetrable. Also start printing the restyle damage of
fragments.

Source-Repo: https://github.com/servo/servo
Source-Revision: a2330f494316926dca9f64431d8357a093143d7d
2015-11-24 07:20:07 +05:01
Bobby Holley
e74fa4f2d3 servo: Merge #8639 - Use associated types for layout wrapper trait, and generalized ThreadSafeLayoutFoo (from bholley:generalize_wrappers2); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 711f516d80c9c0026744cd373d398dc294f14d2a
2015-11-24 03:32:32 +05:01
Ms2ger
cc365bc20a servo: Merge #8624 - Pass ServoLayoutNode to query functions (from Ms2ger:node); r=pcwalton
This means we only deal with TrustedNodeAddress in LayoutTask::handle_reflow,
which is where the safety of this usage is guaranteed (by the ScriptReflow
destructor).

Source-Repo: https://github.com/servo/servo
Source-Revision: fc54534898c9ce4cc443e6155e0004ec4edfbb1f
2015-11-21 01:10:11 +05:01
Patrick Walton
8c7de61738 servo: Merge #8599 - compositing: Split Servo up into multiple sandboxed processes (from jdm:e10s-redux); r=metajack
Multiprocess mode is enabled with the `-M` switch, and sandboxing is
enabled with the `-S` switch.

Rebase of #6884.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8b39b9afed6ef8a3d7d3e6609fd301a37825d3e1
2015-11-20 03:30:48 +05:01
Rizky Luthfianto
081936fd7a servo: Merge #8606 - refactor(layout_task.rs): move some functions to query.rs (from rilut:refactor-layout-task); r=Ms2ger
Should fixes #8470

Source-Repo: https://github.com/servo/servo
Source-Revision: ff4171170dba925b9036bf59af7dc17202273af1
2015-11-19 23:19:17 +05:01
Bobby Holley
c5e27f41ed servo: Merge #8595 - Generalize the layout wrapper layer (from bholley:generalize_wrappers); r=pcwalton
There's still more refactoring to do, but this is the core stuff that's most likely to bitrot.

Source-Repo: https://github.com/servo/servo
Source-Revision: a5babb89a02b9b84a8cd62554a5ceef9efb0d481
2015-11-19 06:43:40 +05:01
Keith Yeung
5b3f4b220a servo: Merge #8530 - Split ConstellationMsg into ScriptMsg and CompositorMsg (from KiChjang:split-constellation-msg); r=jdm
Fixes #8356.

Source-Repo: https://github.com/servo/servo
Source-Revision: acbe41305230a926458596444ca955eff063d9dd
2015-11-19 04:10:20 +05:01
Ms2ger
8888e8b49a servo: Merge #8545 - Remove AutoJoinScriptTask (from Ms2ger:AutoJoinScriptTask); r=pcwalton
I don't believe there is a case where it would make sense to drop the
ScriptReflow struct without joining the script thread. This approach should
be somewhat more robust, and avoids the code smell of a RAII guard in an
otherwise unused variable.

Source-Repo: https://github.com/servo/servo
Source-Revision: db94fda10e3351c96a0df61099d2fdfa481cc62b
2015-11-17 00:49:45 +05:01
Ms2ger
6abb894296 servo: Merge #8529 - Remove unused lifetime parameters from LayoutTask methods (from Ms2ger:unused-lifetime); r=eefriedman
Source-Repo: https://github.com/servo/servo
Source-Revision: 33c97b2ebbd7b77177b3e3874dc91dc487e64bad
2015-11-15 01:03:35 +05:01
Hayden Faulds
6635d2416a servo: Merge #8485 - Make layout task fields private (from hfaulds:make-layout-task-fields-private); r=Ms2ger
For https://github.com/servo/servo/issues/8471

The second commit I'm slightly less sure about but with `chan` made private this warning was shown:

```
components/layout/layout_task.rs:152:5: 152:21 warning: struct field is never used: `chan`, #[warn(dead_code)] on by default
```

There might be some cleanup around `layout_chan` in https://github.com/hfaulds/servo/blob/make-layout-task-fields-private/components/layout/layout_task.rs#L244-L261 as well but that was a bit beyond me.

Source-Repo: https://github.com/servo/servo
Source-Revision: 1e10b67b1806a481d3080d243e5d64022cee51a0
2015-11-13 01:57:12 +05:01
Michael Howell
68e9519794 servo: Merge #8256 - Write reflow results, even with no root node (from notriddle:master); r=eefriedman
Fixes #8240

Test in w3c/csswg-test#928.

Source-Repo: https://github.com/servo/servo
Source-Revision: 532f9a053a318fc3022de8bd5cd8b853ff27b37e
2015-11-11 04:20:49 +05:01
Bobby Holley
6c48a45939 servo: Merge #8381 - Implement attribute restyle hints (from bholley:attr_restyle_hints); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 13226f847234cd0130820338d5a272277780d278
2015-11-11 00:58:45 +05:01
Ms2ger
ffd1877846 servo: Merge #8378 - Reduce LayoutTaskData to the fields used for RPC (from Ms2ger:rwdata); r=eefriedman
Source-Repo: https://github.com/servo/servo
Source-Revision: 0d21158eb3bc8cb64a1953ab77b57e813bd429ed
2015-11-10 07:18:45 +05:01
Till Schneidereit
6b102412c1 servo: Merge #8039 - Move Stylesheet loading and ownership from the layout task into HTML elements (from tschneidereit:script-owns-stylesheets); r=jdm
Stylesheets for `HTMLLinkElement`s are now loaded by the resource task, triggered by the element in question. Stylesheets are owned by the elements they're associated with, which can be `HTMLStyleElement`, `HTMLLinkElement`, and `HTMLMetaElement` (for `<meta name="viewport">).

Additionally, the quirks mode stylesheet (just as the user and user agent stylesheets a couple of commits ago), is implemented as a lazy static, loaded once per process and shared between all documents.

This all has various nice consequences:
 - Stylesheet loading becomes a non-blocking operation.
 - Stylesheets are removed when the element they're associated with is removed from the document.
 - It'll be possible to implement the CSSOM APIs that require direct access to the stylesheets (i.e., ~ all of them).
 - Various subtle correctness issues are fixed.

One piece of interesting follow-up work would be to move parsing of external stylesheets to the resource task, too. Right now, it happens in the link element once loading is complete, so blocks the script task. Moving it to the resource task would probably be fairly straight-forward as it doesn't require access to any external state.

Depends on #7979 because without that loading stylesheets asynchronously breaks lots of content.

Source-Repo: https://github.com/servo/servo
Source-Revision: 7ff3a17524e0e703e3ac279441729c185444be24
2015-11-08 00:42:54 +05:01
Ms2ger
d1fefa91f1 servo: Merge #8355 - Cleanup exit messages and related code (from Ms2ger:Exit); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 9a465c58429547b59b8a6e1258eaaea46bf7e5a2
2015-11-07 22:05:45 +05:01
Ms2ger
a2f2801118 servo: Merge #8382 - Remove the unsafe Sync implementation for SharedLayoutContext (from Ms2ger:SharedLayoutContext-sync); r=eefriedman
Source-Repo: https://github.com/servo/servo
Source-Revision: 36cd1866086c97d6612289c9fd10f559d23304cf
2015-11-07 15:50:43 +05:01
Bobby Holley
577687c224 servo: Merge #8341 - Fix restyle hints to handle non-last psuedo-selectors, and track pristine state values rather than changesets (from bholley:state_hint_selector_ordering); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 65c3185b202b8dd57a39e1d84872d7528723b191
2015-11-07 09:24:19 +05:01
Ms2ger
833725666b servo: Merge #8330 - Remove unused LayoutTaskData::screen_size (from Ms2ger:rm-screen_size); r=larsbergstrom
Source-Repo: https://github.com/servo/servo
Source-Revision: a0221b91268307b1c2690241a4d24816471c915e
2015-11-07 02:34:44 +05:01
Martin Robinson
3d6034f11c servo: Merge #8337 - Remove DisplayListBuildingResult (from mrobinson:remove-display-list-result); r=pcwalton
Always produce a DisplayList when processing nodes for display list
construction. StackingContexts are now added to the positioned content
section of DisplayLists. This makes the code a bit simpler and opens up
the possibility of producing a StackingContext in another section of
the DisplayList. This doesn't change behavior, but is a cleanup
prerequisite for proper inline stacking context support.

Source-Repo: https://github.com/servo/servo
Source-Revision: da25b8c848886d2fc875008de5adcaf13d7c9e99
2015-11-06 05:07:35 +05:01
David Zbarsky
075284e51a servo: Merge #8202 - Allow retrieving width/height for non-positioned elements (from dzbarsky:getComputedStyle); r=pcwalton
This was causing a bunch of tests in tests/wpt/web-platform-tests/html/semantics/embedded-content/the-canvas-element/size.attributes* to fail.  They were returning "auto" instead of the correct size. They still fail because the returned size is off by a few pixels, not sure why yet. But this is more correct and may fix other failing tests.

Source-Repo: https://github.com/servo/servo
Source-Revision: b6850853da5fc677ecfa15d273159371a909ac6c
2015-11-04 13:03:15 +05:01
Patrick Walton
9ddbcb6897 servo: Merge #8299 - Fix several bugs causing the page to reflow on every mouse move event (from pcwalton:dont-reflow-on-hover); r=mbrubeck
After all these changes are applied, Hacker News and GitHub only repaint and reflow nodes that actually have hover styles applied when the mouse moves over them.

r? @mbrubeck

cc @bholley

Source-Repo: https://github.com/servo/servo
Source-Revision: 36c5dd4c8c543ed6767fe9dd367281b292d68dba
2015-11-04 05:59:46 +05:01
Olivia Nordquist
5a05de931c servo: Merge #8290 - Un-boxed ScriptReflow (from itsmeolivia:store-script-reflow); r=Ms2ger
As per #8238 I changed `layout_interface::Msg::Reflow` to store `ScriptReflow` rather than `Box<ScriptReflow>`

I ran the tests and believe everything passed but this is my first commit to the project so sorry if I messed up the protocol!

Source-Repo: https://github.com/servo/servo
Source-Revision: 601169c0e5b0207805bb316b21e556f5ab67df9b
2015-11-01 14:21:17 +05:01
Bobby Holley
767285b863 servo: Merge #8274 - Implement state-based restyle hints (from bholley:state_restyle_hints); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 959ae86bd0435bf67626d3203a220c0e9f2eea40
2015-11-01 06:54:51 +05:01
Bobby Holley
5db6816cd0 servo: Merge #8162 - Centralize event states in rust-selectors (from bholley:centralize_event_states); r=pcwalton
This still needs a rev bump on rust-selectors once https://github.com/servo/rust-selectors/pull/55 gets merged.

Source-Repo: https://github.com/servo/servo
Source-Revision: 521a87180a85709f8f704df33537f79bd131bf71
2015-10-31 09:36:45 +05:01
Ms2ger
84e4adc0d4 servo: Merge #8187 - Introduce a Layoutnode::new function and use it (from Ms2ger:layoutnode-new); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 6cc8186481110370205e7979f3942ad005889a30
2015-10-30 13:14:17 +05:01
Ms2ger
fad7f9bff1 servo: Merge #8212 - Remove SharedLayoutContext::reflow_root (from Ms2ger:reflow-root); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: b6bcccb204f710665482fa8098084a30126a3bac
2015-10-30 04:53:54 +05:01
Bobby Holley
b3fb877c87 servo: Merge #8098 - Track event state changes on Document and do the dirtying from layout (from bholley:dirty_from_layout); r=jdm
This is a first step in fixing #6942.

Source-Repo: https://github.com/servo/servo
Source-Revision: 285e29c06637f31a8b8a27c2e454468717924ebd
2015-10-28 23:55:53 +05:01
Ms2ger
1b418c9475 servo: Merge #8205 - Return the result from query functions (from Ms2ger:query); r=jdm
This reduces some unnecessarily tight coupling, makes it clearer what these functions do, and may help avoid bugs where we would return from such a function without updating the relevant field.

It is also a precondition for some future experimentation I'm thinking of doing with this querying design.

Source-Repo: https://github.com/servo/servo
Source-Revision: 3a254b7e20c37e4ce7b614abea9ebd4687c65f98
2015-10-26 09:00:30 -05:00
Ms2ger
8e835efaa7 servo: Merge #8196 - Remove a pointless clone() from add_font_face_rules (from Ms2ger:clone-font-cache-task); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 64cae0c5905d1069e40c94c4ef61d50b30bc8196
2015-10-25 17:58:11 -05:00
Ms2ger
7912b9e110 servo: Merge #8186 - Remove an unnecessary Atom::clone() call (from Ms2ger:rm-clone); r=nox
Source-Repo: https://github.com/servo/servo
Source-Revision: 4b5bc4f9a95aa8aa1497ff2545ff7ed018d3c650
2015-10-25 05:09:11 -05:00
Ms2ger
ce05956312 servo: Merge #8155 - Remove Window::layout_join_port (from Ms2ger:join); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 4d737b51bb2053e9bb970b31b0516ac8810a061b
2015-10-23 04:50:38 -06:00
Ms2ger
5e771be0e4 servo: Merge #8150 - Use the select!{} macro in LayoutTask::handle_request (from Ms2ger:select-layout); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: e05999ea9f4883c85939b209f811ae20e9e9e89c
2015-10-22 11:14:52 -06:00
Bobby Holley
80d425c0ca servo: Merge #8042 - Remove HAS_DIRTY_SIBLINGS (from bholley:dirty_siblings); r=pcwalton
This isn't doing anything right now, and we're not even setting it properly
in dirty_impl the |dirty_subtree(self)| was causing us to hit the skip case
for step 3.

Source-Repo: https://github.com/servo/servo
Source-Revision: 50ec2353845bf2a3971d5b01db37d2c3741d3912
2015-10-21 12:18:02 -06:00
Corey Farwell
7ef53c6ece servo: Merge #7987 - Fix issues found by rust-clippy (from frewsxcv:clippy); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: eb7039d04d4c83800ba9d92dc251222f79b83040
2015-10-12 18:33:30 -06:00
Glenn Watson
5130b51a6c servo: Merge #7807 - Make it possible for iframes to create their own pipeline ID (from glennw:pid); r=jdm
This doesn't change any functionality, but it's the first step towards removing SubpageId.

Adding this change now will allow us to gradually change over code referencing subpage id rather than in one massive PR.

Introduces a namespace for pipeline ID generation - there is a namespace for the constellation thread, and one per script thread.

Source-Repo: https://github.com/servo/servo
Source-Revision: 098bdb5f22500a6e856b085a1140090f63ef8645
2015-10-06 01:08:32 -06:00
Martin Robinson
7845aaf33f servo: Merge #7822 - Rework how StackingContexts are dynamically added to layers (from mrobinson:layer-info); r=pcwalton
StackingContexts are added to layers when it is necessary to maintain
their ordering on top of other layered StackingContexts. Instead of
tracking the information about a layer scattered around into different
structs, combine it all into LayerInfo. LayerInfo will be used in the
future to hold layer information for DisplayItems that are layerized
independently of StackingContexts.

Source-Repo: https://github.com/servo/servo
Source-Revision: 27d468b6674b81c396aa0a13d8fe9eb410c12d6e
2015-10-05 23:05:21 -06:00
James Gilbertson
1cfb1baefb servo: Merge #6185 - Implement <meta name=viewport> handling (from luniv:viewport-meta); r=mbrubeck
Translate <meta name=viewport> as according to [CSS Device Adaption § 9](http://dev.w3.org/csswg/css-device-adapt/#viewport-meta)

Note: as the PR currently stands, handling `<meta name=viewport>` elements always occurs. This is probably not desired for some contexts (e.g. desktop), but I'm unsure of how to conditionally handle elements based on that.

Source-Repo: https://github.com/servo/servo
Source-Revision: a7743052cad0387733c90940fa91733ede32772c
2015-09-30 22:49:41 -06:00