Commit graph

16155 commits

Author SHA1 Message Date
bors-servo
397d8138e7 auto merge of #3990 : pcwalton/servo/stacking-contexts, r=glennw
This implements the scheme described here:

    https://groups.google.com/forum/#!topic/mozilla.dev.servo/sZVPSfPVfkg

This commit changes Servo to generate one display list per stacking
context instead of one display list per layer. This is purely a
refactoring; there are no functional changes. Performance is essentially
the same as before. However, there should be numerous future benefits
that this is intended to allow for:

* It makes the code simpler to understand because the "new layer needed"
  vs. "no new layer needed" code paths are more consolidated.

* It makes it easy to support CSS properties that did not fit into our
  previous flat display list model (without unconditionally layerizing
  them):

  o `opacity` should be easy to support because the stacking context
    provides the higher-level grouping of display items to which opacity
    is to be applied.

  o `transform` can be easily supported because the stacking context
    provides a place to stash the transformation matrix. This has the side
    benefit of nicely separating the transformation matrix from the
    clipping regions.

* The `flatten` logic is now O(1) instead of O(n) and now only needs to
  be invoked for pseudo-stacking contexts (right now: just floats),
  instead of for every stacking context.

* Layers are now a proper tree instead of a flat list as far as layout
  is concerned, bringing us closer to a production-quality
  compositing/layers framework.

* This commit opens the door to incremental display list construction at
  the level of stacking contexts.

Future performance improvements could come from optimizing allocation of
display list items, and, of course, incremental display list
construction.

r? @glennw
f? @mrobinson @cgaebel
2014-11-16 16:39:27 -07:00
Ms2ger
859f14f38b Correct the checks in step 5 of Node::pre_insert. 2014-11-16 12:40:42 +01:00
bors-servo
561fab57d6 auto merge of #3998 : Hoverbear/servo/fix_table_caption, r=jdm
Fixed #3997.
2014-11-15 13:24:28 -07:00
bors-servo
43b452f3b8 auto merge of #3941 : mukilan/servo/timeout-arguments, r=Ms2ger 2014-11-15 11:09:32 -07:00
Andrew Hobden
a70543c2a3 Fix Table Caption infinite recursion. 2014-11-15 09:37:44 -08:00
bors-servo
796258114b auto merge of #3766 : t29/servo/mime-sniffing, r=jdm
Issue: #3144 

We created a sniffer task in components/net/, added a call in resource_task load function to create a new sniffer task (sending all the data), and sniffer_task currently sends all the data back to resource_task.

The purpose of this request is to get feedback from @jdm on our progress before moving forward and writing tests.
2014-11-15 10:36:31 -07:00
Mukilan Thiyagarajan
4b2b0d0723 Allow passing arguments to setTimeout/setInterval callbacks 2014-11-15 18:32:12 +05:30
Mukilan Thiyagarajan
05bd182538 Fix binding generation for Callback Functions and Callback Interfaces 2014-11-15 18:29:48 +05:30
Patrick Walton
a4a9a46a87 gfx: Rewrite display list construction to make stacking-contexts more
first-class.

This implements the scheme described here:

    https://groups.google.com/forum/#!topic/mozilla.dev.servo/sZVPSfPVfkg

This commit changes Servo to generate one display list per stacking
context instead of one display list per layer. This is purely a
refactoring; there are no functional changes. Performance is essentially
the same as before. However, there should be numerous future benefits
that this is intended to allow for:

* It makes the code simpler to understand because the "new layer needed"
  vs. "no new layer needed" code paths are more consolidated.

* It makes it easy to support CSS properties that did not fit into our
  previous flat display list model (without unconditionally layerizing
  them):

  o `opacity` should be easy to support because the stacking context
    provides the higher-level grouping of display items to which opacity
    is to be applied.

  o `transform` can be easily supported because the stacking context
    provides a place to stash the transformation matrix. This has the side
    benefit of nicely separating the transformation matrix from the
    clipping regions.

* The `flatten` logic is now O(1) instead of O(n) and now only needs to
  be invoked for pseudo-stacking contexts (right now: just floats),
  instead of for every stacking context.

* Layers are now a proper tree instead of a flat list as far as layout
  is concerned, bringing us closer to a production-quality
  compositing/layers framework.

* This commit opens the door to incremental display list construction at
  the level of stacking contexts.

Future performance improvements could come from optimizing allocation of
display list items, and, of course, incremental display list
construction.
2014-11-14 17:31:15 -08:00
Ms2ger
86d609abaf Use RefCell in DOMRefCell to reduce duplicated code. 2014-11-14 21:18:43 +01:00
Ms2ger
c0016c7438 Use Cell::as_unsafe_cell in Reflector::rootable. 2014-11-14 11:56:00 +01:00
bors-servo
85a2f0b66a auto merge of #3953 : neojski/servo/implement-HTMLIFrameElement.contentDocument, r=jdm
Because of #2122 I cannot write test for this right now because it will be failing randomly due to that iframe issue. However, if it doesn't fail due to that issue a test like this:

```html
<html>
  <head>
    <meta charset="utf8" />
    <script src="harness.js"></script>
    <title>Iframe contentDocument test.</title>
  </head>
  <body>
    <iframe src="test_iframe_contentDocument_inner.html" id="iframe"></iframe>
    <script>
      waitForExplicitFinish();

      var timeout = 100;
      var iframe = document.getElementById('iframe');
      function test_contentWindow() {
        if (!iframe.contentWindow) {
          // Iframe not loaded yet, try again.
          // No load event for iframe, insert bug number here.
          setTimeout(test_contentWindow, timeout);
          return;
        }
        is(iframe.contentDocument.getElementById('test').textContent, 'value');
        finish();
      }
      test_contentWindow();
    </script>
  </body>
</html>
```
where inner is simply:
```html
<html><body><div id="test">value</div></body></html>
```
passes.

I have added `SameOrigin` method to the `UrlHelper`. I wanted to reuse it in [`constellation.rs` same_script check](f0184a2d01/components/compositing/constellation.rs (L625)) but I it didn't want to compile saying

```
error: unresolved import `dom::urlhelper::UrlHelper`. Maybe a missing `extern crate dom`?
```

So I didn't include it in this PR for now.

There is more discussion about the cross origin iframes in [another issue](https://github.com/servo/servo/issues/3939). In this PR I just added same origin check.
2014-11-13 23:54:28 -07:00
Tomasz Kołodziejski
af30484f2a Add contentDocument support for HTMLIFrameElement. Fixes #3808. 2014-11-13 22:45:46 -08:00
Shanil Puri
fc7b3699ed Sending exit message to devtools to exit.
Accepted and closed incoming streams

Added header to for constant use.

Removed extra spaces.

Corrected spacing to conform to coding standards.

Corrected spacing to conform to coding standards.

Corrected spacing to conform with coding standards.

Moving new import next to old import for devtools_traits as specified in comment.

Removed method definition to include as inline code and changed to iter_mut.

Using loops to exit devtools on server exit message and disconnected message to simply break as suggested in the comment.

Removing TODO comment for completed functionality.

Moved the operation for exit of devtools on servo closing outside the match loop.

Removing trailing ';' and adding new line before connection closing loop.
2014-11-13 20:44:06 -05:00
Manish Goregaokar
cdddf6465c Remove unused arguments from LoadComplete and LoadCompleteMsg 2014-11-14 02:14:00 +05:30
Manish Goregaokar
d5f1bb2df5 Don't overwrite redirected URL in script_task (fixes #3970) 2014-11-14 02:10:04 +05:30
Kshitij Parajuli
7472564bf6 M1456, Implement MIME sniffing initial Step 2014-11-13 13:07:19 -05:00
Josh Matthews
c23edf6f5a Short-circuit initFooEvent while dispatching events. 2014-11-13 12:53:54 -05:00
Keegan McAllister
642a3592c7 Fix interfaces test 2014-11-13 12:53:54 -05:00
Josh Matthews
89a27dd11a More documentation. 2014-11-13 12:53:54 -05:00
Josh Matthews
cbed5da9fa Flush layout after executing timers. 2014-11-13 12:53:54 -05:00
Josh Matthews
80764f65e3 Add single-line text input with no visible cursor. 2014-11-13 12:53:54 -05:00
Josh Matthews
84bc17e7ad Implement document focus context and hook it up to click events. 2014-11-13 11:27:15 -05:00
Josh Matthews
329ba56fca Dispatch keydown, keyup, and keypress events at appropriate times. 2014-11-13 11:27:15 -05:00
Josh Matthews
e999843183 Fill in KeyboardEvent. 2014-11-13 11:24:14 -05:00
Josh Matthews
bb7074698a Add KeyboardEvent stub. 2014-11-13 11:24:14 -05:00
Josh Matthews
1c64dabb15 Pass all key events to the current constellation frame. 2014-11-13 11:24:14 -05:00
Glenn Watson
0a0b4c657c Rebase and fix up compile errors for rust upgrade. 2014-11-13 11:25:19 +10:00
Glenn Watson
f823186345 Fix unit test compile error. 2014-11-13 11:17:43 +10:00
Jack Moffitt
d1b433a3b3 Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
bors-servo
26045d7fcb auto merge of #3809 : mrobinson/servo/display-list-optimization, r=pcwalton
Instead of creating a display list for the entire page, only create one
for an area that expands around the viewport. On my machine this makes
incremental layout of http://timecube.com 50% faster.
2014-11-12 17:36:32 -07:00
bors-servo
668d9217d8 auto merge of #3938 : guillaumebort/servo/fix/3933, r=jdm
Implement HTMLOptionElement.{label,value}
2014-11-12 15:15:38 -07:00
bors-servo
88ff8c61f0 auto merge of #3955 : thiagopnts/servo/devtools-refactoring, r=jdm
I was messing around devtools code and saw some TODOs, is anyone working on it? I took one of them:

```// TODO: this really belongs in the protocol module.```

I would be glad to help with this if no one is on it already, just let me know.
2014-11-12 14:42:35 -07:00
Martin Robinson
4f1bda0c36 Remove some code duplication in the Compositor
It is possible to share the code which creates root layers.
2014-11-12 12:01:36 -08:00
Guillaume Bort
09766511b5 Fix #3933 2014-11-12 17:02:47 +01:00
thiagopnts
4c1a89544e Move code related to json packet reading to JsonPacketSender trait
fixup! Move code related to json packet reading to JsonPacketSender trait
2014-11-12 10:30:49 -02:00
bors-servo
ccdd2910a2 auto merge of #3951 : mrobinson/servo/iframes, r=jdm
This is the first step to allowing incremental iframe creation and destruction. This should eliminate task failures when an iframe is added to the frame tree lazily via script.
2014-11-11 18:48:34 -07:00
Martin Robinson
fbb1e0c6b8 Send incremental frame tree updates to the compositor
This allows the compositor to add frames after the call to SetIds,
where the initial frame tree is created. There are still some issues
preventing proper late frame creation, but this prevents crashes when
it happens.

Fixes #3738.
2014-11-11 17:36:19 -08:00
Martin Robinson
750bedab81 Add some factory methods for frame tree types 2014-11-11 17:36:19 -08:00
Martin Robinson
a10e261ffd Small fix to variable name
This is a more accurate name for the script pipeline.
2014-11-11 17:36:19 -08:00
Martin Robinson
6e06a1353c Rename LoadIframeUrlMsg to CreateIFrameAndLoadUrlMsg
This better reflects what the message does.
2014-11-11 17:36:18 -08:00
bors-servo
b94f20c7c1 auto merge of #3934 : guillaumebort/servo/fix/84, r=jdm
Actually `<img>` elements in `<noscript>` are not prefetched anymore.

Probably because html5ever already parses the `<noscript>` content as raw
text data if `scripting_enabled` is activated.

See https://github.com/servo/html5ever/blob/servo/src/tree_builder/rules.rs#L126

Also, added a test to the images cache.
2014-11-11 14:30:39 -07:00
Martin Robinson
c7327450ef Clip display list based on frame viewport
Instead of creating a display list for the entire page, only create one
for an area that expands around the viewport. On my machine this makes
incremental layout of http://timecube.com 50% faster.
2014-11-11 08:46:16 -08:00
Cameron Zwarich
91be7443df Remove unnecessary import of libgreen 2014-11-10 16:18:10 -08:00
Ms2ger
c2fa5f3b4f Fix the documentation comment for logical_geometry.rs. 2014-11-10 09:45:34 +01:00
bors-servo
fc62243f81 auto merge of #3915 : shinglyu/servo/bug3811, r=jdm
This is a fix for bug #3811 , thank you.
2014-11-09 20:24:31 -07:00
Shing Lyu
783c6703ca Bug #3811 - Extracted the script task handlers into methods 2014-11-10 10:38:12 +08:00
Ms2ger
aa83388f38 Remove VoidVal.
There are no undefined constants in IDL.
2014-11-08 18:00:04 +01:00
bors-servo
fe11a75f79 auto merge of #3937 : Ms2ger/servo/docs-bindings, r=jdm 2014-11-07 10:57:30 -07:00
Ms2ger
3ed3c9a978 Document bindings/conversions.rs. 2014-11-07 18:33:38 +01:00