Commit graph

1471 commits

Author SHA1 Message Date
bors-servo
639fdd6b12 Auto merge of #10210 - perlun:rename-computedvalues-to-servocomputedvalues, r=SimonSapin
ComputedValues is now ServoComputedValues

This is the first part of #10185. More to follow. I have built this locally with both servo and geckolib without errors; let's see if it succeeds on all platforms as well.

<!-- 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/10210)
<!-- Reviewable:end -->
2016-03-29 18:25:40 +05:30
bors-servo
3f73321710 Auto merge of #10248 - pcwalton:float-speculation-with-negative-margins, r=mbrubeck
layout: Only take nonnegative margins into account when estimating inline placement of floats.

Otherwise, the heuristics can pass even when there are no floats,
causing block formatting contexts to be speculated to be flowing around
floats that don't exist!

Closes #10237.

r? @mbrubeck

<!-- 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/10248)
<!-- Reviewable:end -->
2016-03-29 16:04:01 +05:30
bors-servo
159be44193 Auto merge of #10246 - mbrubeck:strip-leading, r=pcwalton
Restore stripped whitespace before reflowing text fragments

Fixes #10200. r? @pcwalton

Note: The reftest uses a transition of non-zero duration, because I couldn't find any other way to reproduce the bug.  Unfortunately this makes it unreliable in debug builds. I tried to fix this using reftest-wait with setTimeout and requestAnimationFrame, but it still wouldn't complete the animation consistently.  To make the test work in debug builds we may need `transitionend` events (#10245) or a different way to reproduce the bug.

<!-- 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/10246)
<!-- Reviewable:end -->
2016-03-29 14:30:40 +05:30
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
6eb58e2c54 layout: Only take nonnegative margins into account when estimating
inline placement of floats.

Otherwise, the heuristics can pass even when there are no floats,
causing block formatting contexts to be speculated to be flowing around
floats that don't exist!

Closes #10237.
2016-03-28 17:37:57 -07:00
Matt Brubeck
99885b1950 Restore stripped whitespace before reflowing text fragments
Fixes #10200.
2016-03-28 14:04:35 -07:00
Paul Rouget
2bbf35f2aa Use black on blue color for default selection color 2016-03-28 18:26:17 +08:00
Paul Rouget
63a0851b94 Selection is blue on Windows and Mac, orange on Linux 2016-03-28 11:11:24 +02:00
faineance
418842faf9 use self.0 instead of destructing single item tuple structs 2016-03-27 11:50:08 +01:00
Per Lundberg
c2ad084713 ComputedValues is now ServoComputedValues
This is the first part of #10185. More to follow. I have built this locally with both servo and geckolib without errors; let's see if it succeeds on all platforms as well.
2016-03-27 10:55:43 +03:00
bors-servo
bed91b3334 Auto merge of #10176 - mbrubeck:selection-range, r=pcwalton
Highlight selected text in input fields

Fixes #9993.  This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground.

r? @pcwalton

<!-- 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/10176)
<!-- Reviewable:end -->
2016-03-26 08:16:20 +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
bors-servo
9b2ae3a62f Auto merge of #10198 - pcwalton:negative-ceiling, r=mbrubeck
layout: Allow floats to have negative ceilings due to negative margins.

This fixes `margin-collapse-104.htm`, which is currently accidentally
passing due to lack of #10085. When that PR lands, then that will become
a representative test case.

r? @mbrubeck

<!-- 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/10198)
<!-- Reviewable:end -->
2016-03-26 05:48:25 +05:30
Patrick Walton
aee0c44509 layout: Minor whitespace cleanup. 2016-03-25 15:29:18 -07:00
Patrick Walton
24d81e95b4 layout: Allow floats to have negative ceilings due to negative margins.
This fixes `margin-collapse-104.htm`, which is currently accidentally
passing due to lack of #10085. When that PR lands, then that will become
a representative test case.
2016-03-25 15:29:17 -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
Matt Brubeck
08caf7412f Convert ScannedTextFragment fields into bitflags 2016-03-24 18:33:27 -07:00
Matt Brubeck
6171000875 Highlight selected text in input fields
Fixes #9993.  This does not yet allow stylesheets to set the selection colors;
instead it uses a hard-coded orange background and white foreground.
2016-03-24 18:33:26 -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
bors-servo
2887623c4a Auto merge of #10150 - emilio:canvas-cleanup, r=jdm
Canvas cleanup

This PR cleans up the layerization infrastructure for canvas, which was unused, and removes unused dependencies.

It also takes in account my recent username change to update angle's dependency (offscreen_gl_context requires extra work due to webrender depending on it).

r? @jdm

<!-- 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/10150)
<!-- Reviewable:end -->
2016-03-24 08:44:40 +05:30
Emilio Cobos Álvarez
35ce58ef98 layout: Drop "canvas" dependency 2016-03-23 18:12:38 +01: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
Ms2ger
dadba1fa22 Remove unused import. 2016-03-23 11:31:21 +01:00
Ms2ger
900583056b Remove outdated unsafe_code allowance. 2016-03-23 11:31:11 +01:00
Patrick Walton
0006c1923a gfx: Allow images to be shipped to the WebRender thread without shipping
over the data as well.

WebRender doesn't need the data, as it acquires it separately.

About a 50%-100% improvement in display list building time on
browser.html.
2016-03-22 14:49:47 -07:00
Patrick Walton
9fcf9215d0 layout: Flatten display list transfer into a separately-transferred byte
array, and consolidate the multitude of display list messages into one.

Improves display list building performance by 50%-100% for small display
lists.
2016-03-22 10:51:25 -07:00
bors-servo
41060dbdd7 Auto merge of #10105 - mbrubeck:dirty-viewport-percentages, r=SimonSapin
Don't re-add stylesheets to recompute vw/vh lengths

This is a follow-up to #9876.  It avoids clearing and rebuilding SelectorMaps
when vh and vw units need to be recomputed. Instead it just dirties all nodes,
to force elements to be re-cascaded.

Filed #10104 for later follow-up work to dirty only affected nodes.

r? @SimonSapin

<!-- 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/10105)
<!-- Reviewable:end -->
2016-03-22 18:58:47 +05:30
bors-servo
d1e27eb4f4 Auto merge of #10109 - mbrubeck:compute_damage_short_circuit, r=pcwalton
Fixes for compute_damage

A few changes:

* Make `compute_damage` short-circuit more, by skipping comparisons if they will only set flags that are already set.

* Update some obsolete comments.

* Add a bunch of missing properties to `compute_damage`.

* Set `RECONSTRUCT_FLOW` when `text-decoration` changes, because it can affect text fragment splitting/merging.

I believe this is all of the computed properties except for the animation properties. (I wasn't sure what to do with those.)  After this lands I'd like to work on moving this information into `properties.mako.rs` so that this function can be auto-generated, and so that newly-added properties can default to setting all flags instead of none.

<!-- 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/10109)
<!-- Reviewable:end -->
2016-03-22 10:29:48 +05:30
bors-servo
767b11cd67 Auto merge of #10106 - Ms2ger:renderer-id, r=ecoal95
Remove renderer ids.

<!-- 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/10106)
<!-- Reviewable:end -->
2016-03-22 08:50:28 +05:30
bors-servo
9a8ba23a76 Auto merge of #10088 - pkondzior:7038-report-memory-usage-in-layout-thread-data-stylist, r=ecoal95
Report memory usage from LayoutThreadData Stylist [#7038]

@jdm PTAL I'm not sure what is the approach of updating cargo components here, I've made a pull request https://github.com/servo/heapsize/pull/54 but it has to be landed first before merge and version bump.

<!-- 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/10088)
<!-- Reviewable:end -->
2016-03-22 06:54:11 +05:30
Matt Brubeck
f7d490a7e7 Add missing properties to compute_damage 2016-03-21 16:28:07 -07:00
Matt Brubeck
c2c3b30f87 Short-circuit more of compute_damage 2016-03-21 16:28:07 -07:00
Matt Brubeck
37636e8377 Don't re-add stylesheets to recompute vw/vh lengths
This is a follow-up to #9876.  It avoids clearing and rebuilding SelectorMaps
when vh and vw units need to be recomputed. Instead it just dirties all nodes,
to force elements to be re-cascaded.

Filed #10104 for later follow-up work to dirty only affected nodes.
2016-03-21 10:05:17 -07:00
Ms2ger
1c1e55792f Remove CanvasFragmentInfo::renderer_id. 2016-03-21 17:34:30 +01:00
Patrick Walton
7a131ba104 layout: Minor whitespace cleanup. 2016-03-21 08:39:47 -07:00
Patrick Walton
7cb9429a0f layout: Don't start the reflow pass unless some node needs to be
reflowed.

Reduces CPU usage when mousing over simple pages.

Part of #9999.
2016-03-21 08:39:45 -07:00
Patrick Walton
acfd8e448c layout: Don't rebuild display lists at all unless restyling tells us
some object needs to be repainted.

Reduces CPU usage when mousing over simple documents. (More complex
documents tend to trigger unnecessary reflow bugs and so still have high
CPU.)

Part of #9999.
2016-03-21 08:39:44 -07:00
Patrick Walton
5dca005920 layout: Repaint when z-index is modified. 2016-03-21 08:39:42 -07:00
Patrick Walton
21ea8eef19 layout: Make transform changes require incremental repaint.
The progress bar in browser.html was only accidentally working before,
so actually making use of `REPAINT` makes it stop working without this
change.
2016-03-21 08:38:00 -07:00
bors-servo
090da52913 Auto merge of #9586 - notriddle:details_ui, r=SimonSapin
Details ui

Requires a patch to rust-selectors, and doesn't currently recalculate the styles correctly (which is needed to make actual toggling work correctly).

Still trying to figure out what it takes to get style recalc to do what this needs.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9586)
<!-- Reviewable:end -->
2016-03-20 13:27:59 +05:30
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
Pawel Kondzior
db2e10a70f Report memory usage from LayoutThreadData Stylist [#7038] 2016-03-19 11:53:13 -07:00
Patrick Walton
5ea8c34276 layout: Move overflow calculation to be a separate, sequential,
bottom-up pass.

Right now, the only reason that overflow calculation works is that we
rely on script inducing extra reflows that are sent for display. This
was preventing #10021 from landing.

This change regresses layout performance by about 1% in my tests.

Fixes #7797 properly.
2016-03-18 22:11:51 -07:00
David Bonet
57df260f9d Removed overflow references on AssignBSizesAndStoreOverflow code 2016-03-17 21:14:50 +01:00
Anthony Ramine
46c505e47b Bump serde to 0.7 2016-03-17 13:52:39 +01:00
Anthony Ramine
f7af675861 Update log to 0.3.5 2016-03-16 23:36:04 -07:00
Patrick Walton
28a71c4820 Make border radii clip their contents.
Needed for browser.html rounded corners.
2016-03-14 18:32:55 -07:00
Bobby Holley
539f839958 Remove lifetimes from LayoutNode and friends. 2016-03-14 14:31:57 -07:00