Commit graph

165 commits

Author SHA1 Message Date
Simon Sapin
a0656c9a6b servo: Merge #7237 - Replace FlowRef with Arc<Flow>, now that Arc supports DST (from servo:arc-flow); r=pcwalton
… and `WeakFlowRef` with `Weak<Flow>`.

r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 1f9778fad90e41ec70e8f54d61e168172635d925
2015-08-21 15:29:35 -06:00
Johann Tuffe
5c3a5a67f5 servo: Merge #7265 - Add alphabetical order check for use statements (from tafia:tidy-use); r=Ms2ger
close #7112

Source-Repo: https://github.com/servo/servo
Source-Revision: a5fbb2f2a6fa79755f975feff2435abb6a5dd0e9
2015-08-20 07:43:56 -06:00
Patrick Walton
4c157f9324 servo: Merge #7276 - layout: Make inline absolute hypothetical boxes not clip their contents (from pcwalton:inline-absolute-hypothetical-clip); r=mbrubeck
Improves the logo on ebay.com.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 195d267e2311d1723f9a70ba9d40db04c557606a
2015-08-19 03:54:10 -06:00
Corey Farwell
871003a8b5 servo: Merge #7178 - flow::Flow should follow *_mut naming conventions (from frewsxcv:flow-api-mut); r=nox
Fixes #7148

Source-Repo: https://github.com/servo/servo
Source-Revision: 014608f60c45574e6a347f39a96aa33b8eab02e1
2015-08-18 07:31:57 -06:00
João Oliveira
3436fe7092 servo: Merge #7257 - Replace uses of for foo in bar.iter(), (from jxs:master); r=Ms2ger
and `for foo in bar.iter_mut(), and for foo in bar.into_iter()
(continuation of #7197)

Source-Repo: https://github.com/servo/servo
Source-Revision: 0d6d6a05009606dfbbfc9765d7dc2c745c18f6a5
2015-08-18 02:46:46 -06:00
Patrick Walton
11e563caec servo: Merge #7177 - layout: Improve our handling of inline absolute containing blocks (from pcwalton:intervening-inline-block); r=mbrubeck
Several issues are addressed in this commit:

* Inline flows now bubble up their absolute descendants instead of
  making the inline flow the containing block for them. (In the future,
  we will need to make the inline flow *sometimes* be the containing
  block for them, but for now it improves sites to unconditionally
  bubble up.)

* Fragments now look at their inline fragment context to determine
  whether they are positioned.

* Inline flows now push the stacking-relative position of the absolute
  containing block down to their inline-block fragments.

* Inline absolute hypothetical fragments can be containing blocks.

* Fixes the logic in
  `containing_block_range_for_flow_surrounding_fragment_at_index`. The
  condition to determine whether fragments are positioned was inverted!

* `Descendants`/`AbsDescendants` has been refactored in order to become
  more friendly to inline absolute containing blocks in the future.

Improves the inline position of the green drop-down arrow in the Google
SERPs. (The block position is still wrong.)

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: d654841288ad6c7d4f8d7da3c68d04ef7df2c241
2015-08-17 13:56:53 -06:00
João Oliveira
8410286b02 servo: Merge #7225 - Replace uses of for foo in bar.iter() and for foo in bar.iter_mut() (from jxs:master); r=nox
closes #7197

Source-Repo: https://github.com/servo/servo
Source-Revision: a1b3f477aa541fda4d1b6ccb02c3e56143f4d217
2015-08-15 03:03:21 -06:00
João Oliveira
f0a3f70810 servo: Merge #7208 - replace .len() == 0 with is_empty() (from jxs:master); r=Ms2ger
closes #7198

Source-Repo: https://github.com/servo/servo
Source-Revision: 85022a4c347dca3f5d28cec3010f7e9410217df4
2015-08-14 00:51:59 -06:00
Patrick Walton
9f2164d29e servo: Merge #7181 - layout: Stop double-counting inline margins on <input type=button> and friends (from pcwalton:input-button-margins); r=mbrubeck
Improves the Google home page.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 94c8dcd575a5187e02ec043c686b1cdfa6b30ba6
2015-08-13 11:45:20 -06:00
Patrick Walton
65059b8539 servo: Merge #7150 - layout: Take relative position offsets for inlines and inline-blocks into account only once (from pcwalton:position-relative-inline-block); r=mbrubeck
There were two bugs here: (1) relative position applied to
scanned/unscanned text fragments independently of the container element
that applied that relative position, causing double-counting; (2)
relative position applied to inline block fragments independently of the
wrapped block itself, causing double-counting.

Closes #7067.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 0bfde427e6a77d09d75b5a6e228c7b25f063395f
2015-08-12 09:34:26 -06:00
Patrick Walton
05e3c47b79 servo: Merge #7024 - layout: Rewrite whitespace stripping (from pcwalton:whitespace-stripping); r=mbrubeck
This patch makes Servo unconditionally strip whitespace before text run
scanning (assuming that the `white-space` property allows it). Whitespace
stripping during reflow is now only used for handling whitespace at the ends of
lines; reflow now never attempts to handle ignorable whitespace.

Many CSS tests pass now. There are some new failures, however.

The following reference tests now fail due to a pre-existing bug whereby
whitespace is used to calculate the position of inline hypothetical boxes for
elements with `display: inline; position: absolute`:

* `absolute-replaced-height-036.htm`
* `vertical-align-sub-001.htm`
* `vertical-align-super-001.htm`

The following reference tests fail due to a pre-existing bug whereby we don't
handle `font-size: 0` properly in inline reflow:

* `font-size-zero-1.htm`
* `font-size-zero-2.htm`

The following reference test fails due to the fact that it relied on our
incorrect insertion of whitespace to make room for the black background:

* `inline-formatting-context-007.htm`

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 7dc83e7820df43b1b617ae8dcf661398b0bd0842
2015-08-11 12:57:02 -06:00
Matt Brubeck
eff608633f servo: Merge #7041 - Allow list markers to contain multiple fragments (from mbrubeck:marker_fragments); r=pcwalton
Fixes #6913. r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 568bd92236e6eee0a3dfc077dccf74e4fdc79582
2015-08-07 08:55:24 -06:00
Patrick Walton
feefd8fa17 servo: Merge #6977 - layout: Make sure anonymous table flows are statically positioned (from pcwalton:containing-block-link-crash); r=mbrubeck
The failing `float-applies-to-*` CSS 2.1 tests never really should have
been passing in the first place; they depend on floats inside
fixed-layout tables working properly, which they don't.

Closes #6078.
Closes #6709.
Closes #6858.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 1ddef2997abf51716835017225b282f8a9077cce
2015-08-06 22:11:04 -06:00
Patrick Walton
4ecaa5ce11 servo: Merge #6940 - layout: When repairing styles for incremental reflow, only repair styles of nodes that represent the dirty node, *including its pseudo-element* (from pcwalton:inline-pseudo-repair-jumpiness); r=mbrubeck
r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 56d3426431d98a6f43698f33bb7ce4d3ad67adeb
2015-08-04 12:53:26 -06:00
Patrick Walton
85f65924cf servo: Merge #6938 - construct: When repairing styles for incremental reflow, only repair styles of nodes that represent the dirty node (from pcwalton:inline-repair-jumpiness); r=mbrubeck
Fixes jumpiness on many pages; e.g. the WPT results pages.

For some reason, this would not reproduce with an automated test.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 94cd76df61c1ea14199c9683603b548377aced3b
2015-08-03 23:37:47 -06:00
Matt Brubeck
9312160d09 servo: Merge #6721 - Implement the unicode-bidi CSS property (from mbrubeck:unicode-bidi); r=pcwalton
r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 5922ac606c63b91fdbd8c84fd0abb35450bee547
2015-08-03 15:37:12 -06:00
David Zbarsky
c4655740ea servo: Merge #6798 - Implement getComputedStyle (from dzbarsky:gCS); r=pcwalton
It's not quite done but can probably be reviewed anyway.
I still need to finish up a few of the ToCss impls, I just got lazy and wanted to make sure things worked.

The computation of the used values is definitely not right, I'm going to investigate that.

Source-Repo: https://github.com/servo/servo
Source-Revision: acbca7b3aaf18866f7a1a79d9684149897bf4305
2015-07-29 18:48:45 -06:00
Ms2ger
487f354031 servo: Merge #6794 - Remove StyledNode (from Ms2ger:StyledNode); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 0b447651e4e5309c057f2cf2af58b3aa733bb4c4
2015-07-28 17:26:42 -06:00
Ms2ger
b552054f96 servo: Merge #6650 - Various layout cleanup (from Ms2ger:layout-cleanup); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: e6538c0f2d887bfb244313009490ca67bc1c2298
2015-07-17 09:17:41 -06:00
Patrick Walton
973311f4cb servo: Merge #6492 - layout: Modify styles for replaced content as appropriate during incremental flow construction (from pcwalton:even-more-jumpiness); r=mbrubeck
Fixes jumpiness on lots of Web sites.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: bbcd42773342a587a8515f34bdc3ca69a380c0a8
2015-07-07 10:28:04 -06:00
David Winslow
e1fe3acd66 servo: Merge #6565 - Fix for #6542 - <img> top-padding adds margin (from dwins:issue_6452_image_padding); r=pcwalton
I wrote this patch that makes the test from #6542 render as expected but I am not confident it is actually the right fix.  Should the padding be included in the 'ascent' metric for images, or am I just introducing a bug that happens to offset the one I'm trying to fix?

Source-Repo: https://github.com/servo/servo
Source-Revision: 0688488a7fd3caee423968b33d6c19d79f94d29a
2015-07-07 06:27:13 -06:00
Ms2ger
2cdcbb096b servo: Merge #6454 - Make {ThreadSafe,}LayoutNode::get_jsmanaged private (from Ms2ger:opaque); r=metajack
Source-Repo: https://github.com/servo/servo
Source-Revision: e02e7c517c30e87adcb61ef408d1ecddc7fb1458
2015-06-24 14:27:11 -06:00
Ms2ger
e448407e4d servo: Merge #6443 - Various layout cleanup (from Ms2ger:cleanup-layout); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 469b9550f6feec56d87ea5c772cb76453c13036a
2015-06-24 03:00:32 -06:00
Nicholas Nethercote
2b915bbedc servo: Merge #6289 - Make LOCAL_CONTEXT_KEY safe and non-leaky (from nnethercote:unleak-LOCAL_CONTEXT_KEY); r=pcwalton
`LOCAL_CONTEXT_KEY` is currently a `Cell<*mut LocalLayoutContext>`. The use
of the raw pointer means that the `LocalLayoutContext` is not dropped when
the thread dies; this leaks FreeType instances and probably other
things. There are also some unsafe getter functions in `LayoutContext`
(`font_context`, `applicable_declarations_cache` and
`style_sharing_candidate_cache`) that @eddyb says involve undefined
behaviour.

This changeset changes `LOCAL_CONTEXT_KEY` to
`RefCell<Option<Rc<LocalLayoutContext>>>`. This fixes the leak and also
results in safe getters.

(Fixes #6282.)

Source-Repo: https://github.com/servo/servo
Source-Revision: 0dec64caf01c98d10e72b73e35b994127c23e81f
2015-06-09 15:52:45 -06:00
Corey Farwell
2196fc505a servo: Merge #6230 - Remove get_ prefix on getters (from frewsxcv:getters-get); r=nox
Part of #6224

I certainly didn't remove all of them; I avoided `unsafe` areas and also `components/script`

Source-Repo: https://github.com/servo/servo
Source-Revision: f6fe1953343a417b62fb310a380af7c6973849b0
2015-06-02 08:17:03 -05:00
Corey Farwell
333cc6c59d servo: Merge #6174 - Reduce max line length from 150 to 120 characters (from frewsxcv:cleanup-long-lines); r=SimonSapin
Part of https://github.com/servo/servo/issues/6041

Source-Repo: https://github.com/servo/servo
Source-Revision: 542519ebfd073662bc9421ac5fa0aa01ebc0d6fe
2015-05-24 18:27:26 -05:00
Patrick Walton
5f40a54beb servo: Merge #5577 - script: Implement the width and height attributes for iframes per HTML5 § 4.8.6 (from pcwalton:iframe-size-attributes); r=jdm
Improves Amazon and Ars Technica.

r? @jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: ee147c164a8a13743dec2def60b13997145e7a55
2015-05-20 13:51:05 -05:00
Patrick Walton
5d9538d101 servo: Merge #6124 - layout: Support inline incremental reflow, and stop reconstructing all flows when mousing over the document (from pcwalton:inline-incremental-reflow); r=mbrubeck
r?

Source-Repo: https://github.com/servo/servo
Source-Revision: 16793d0e24ed49245e5777bc282839e4c157a091
2015-05-19 13:51:30 -05:00
Patrick Walton
c918f5d92e servo: Merge #5911 - layout: Allow inline elements to be containing blocks for absolutely-positioned elements (from pcwalton:absolute-inline-containing-blocks); r=mbrubeck
r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: c0ee952a2a7054dcc7e97990a625c281322dd526
2015-05-13 14:27:21 -05:00
Patrick Walton
51dc51f686 servo: Merge #5940 - layout: Implement inline margins (from pcwalton:inline-margins); r=glennw
Improves the Google SERPs.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: 0872ed922ff49d28e0183ea1407e07a9cbe338a8
2015-05-07 19:10:31 -05:00
Simon Sapin
95c8716656 servo: Merge #5935 - Upgrade Rust (from servo:rustup_2015-04-25); r=Ms2ger
r? everybody

Source-Repo: https://github.com/servo/servo
Source-Revision: 49aed6555dbc008c1a378c5cbb303f5467232b6b
2015-05-05 09:11:30 -05:00
Patrick Walton
bbef2182e3 servo: Merge #5919 - layout: Fix a couple of issues relating to intrinsic widths of inline blocks (from pcwalton:inline-block-intrinsic-widths); r=mbrubeck
* Stop double-counting border and padding for inline-block fragments.
  (Test case: `inline_block_border_intrinsic_size_a.html`.)

* Take clearance into account when determining intrinsic widths of
  blocks containing floats.

Improves the Amazon headers.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 7b87085c1880c60aa3be5b3ec4572a0d93fd5537
2015-05-04 13:37:24 -05:00
Glenn Watson
44de6bcde1 servo: Merge #5913 - Various fixes to getClientBoundingRect() (from glennw:bounding-rect); r=pcwalton
* Fix queries involving stacking contexts
 * The code was double accumulating stacking context origins.
* Handle queries of inline elements.
 * The node addresses being compared were incorrect (CharacterData vs. Span)
* Handle ScriptQuery reflows correctly.
 * The layout task was skipping the compute absolute positions traversal, so failed before window.onload.

Source-Repo: https://github.com/servo/servo
Source-Revision: 5f6a740190e1e5912d84162c92c6b79365df165a
2015-05-01 13:15:23 -05:00
Jinwoo Song
689e86231d servo: Merge #5879 - Make NodeTypeId include CharacterData variant (from Jinwoo-Song:character_data); r=jdm
NodeTypeId is supposed to reflect the WebIDL inheritance hierarchy.
All of Text/ProcessingInstruction/Comment inherit from CharacterData,
which inherits from Node. There should be a CharacterDataTypeId value
that differentiates between those, instead.

r? @jdm
cc @yichoi

Source-Repo: https://github.com/servo/servo
Source-Revision: 5b0c6c9d31973aabdb820f16237e1a7c2a6524ad
2015-04-29 02:35:26 -05:00
Simon Sapin
5d6d967ea0 servo: Merge #5480 - Preliminary steps for CSS Multi-column Layout (from SimonSapin:multicol); r=pcwalton
This add some properties to the style system and a new flow type, but the larger issues of dealing with fragmentation in the flow tree is still an open question.

Source-Repo: https://github.com/servo/servo
Source-Revision: 1e150140bd12624ad357e3168fb496079fb8ec7c

--HG--
rename : servo/components/layout/table_caption.rs => servo/components/layout/multicol.rs
2015-04-28 19:48:45 -05:00
Patrick Walton
b0e909be0c servo: Merge #5694 - layout: Generate anonymous table objects as necessary per CSS 2.1 § 17.2.1 (from pcwalton:anonymous-table-objects); r=mbrubeck
Improves Facebook Timeline.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 2fd5ecf3d7b93addb42d42d46e440451043a2f43
2015-04-28 07:13:53 -05:00
Glenn Watson
835b3be20c servo: Merge #5767 - Refactored image cache task - details below (from glennw:image-cache); r=larsbergstrom,jdm
* Simpler image cache API for clients to use.
 * Significantly fewer threads.
   * One thread for image cache task (multiplexes commands, decoder threads and async resource requests).
   * 4 threads for decoder worker tasks.
 * Removed ReflowEvent hacks in script and layout tasks.
   * Image elements pass a Trusted<T> to image cache, which is used to dirty nodes via script task. Previous use of Untrusted addresses was unsafe.
   * Image requests such as background-image on layout / paint threads trigger repaint only rather than full reflow.
 * Add reflow batching for when multiple images load quickly.
   * Reduces the number of paints loading wikipedia from ~95 to ~35.
 * Reasonably simple to add proper prefetch support in a follow up PR.
 * Async loaded images always construct Image fragments now, instead of generic.
   * Image fragments support the image not being present.
 * Simpler implementation of synchronous image loading for reftests.
 * Removed image holder.
 * image.onload support.
 * image NaturalWidth and NaturalHeight support.
 * Updated WPT expectations.

Source-Repo: https://github.com/servo/servo
Source-Revision: ac0645c2363b5a6ea3930b0857b3a27f1b6d033f
2015-04-22 19:16:46 -05:00
Patrick Walton
00dbcacce1 servo: Merge #5623 - layout: Lay out nested inline elements with different vertical-align values properly in simple cases (from pcwalton:nested-inline-vertical-align); r=glennw
This allows things like `<sup><span>Foo</span></sup>` to work and
improves Wikipedia.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: d7b6961104b517a22e01c192d4bb6a7ad5934ce8
2015-04-09 17:20:23 -05:00
Ms2ger
c64ea30626 servo: Merge #5486 - Stop using int/uint in layout (from Ms2ger:int); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: d999fb9db0d572f63165fa8aa2e24023903b6332
2015-04-02 08:06:41 -06:00
Patrick Walton
ccaf7a5276 servo: Merge #5429 - layout: Stop rebuilding all inline-block flows unconditionally, and bubble intrinsic inline sizes as necessary when doing incremental reflow (from pcwalton:inline-block-incremental-reflow); r=mbrubeck
r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: dd3a58b92427bfd6e33903042272b372b49e9193
2015-04-01 12:03:45 -06:00
Ms2ger
6e049e2b87 servo: Merge #5437 - Remove some int/uints (from Ms2ger:int); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 7d0d8514565d898123411ece56bfb09e578dbe1c
2015-03-29 03:49:01 -06:00
Manish Goregaokar
5dbe6eb389 servo: Merge #5296 - Replace unsafe_blocks by unsafe_code (from servo:unsafe_code); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 29a36adbe7d87fb38ba9bef3a718c6c823fb5977
2015-03-21 05:12:45 -06:00
Ms2ger
66cb126a50 servo: Merge #5256 - Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-de (from servo:rustup_20150311); r=jdm
...v.

Relies on:
* https://github.com/servo/rust-geom/pull/72
* https://github.com/servo/rust-glx/pull/10
* https://github.com/servo/gleam/pull/15
* https://github.com/servo/rust-mozjs/pull/137
* https://github.com/servo/rust-core-text/pull/35
* https://github.com/servo/rust-io-surface/pull/28

Source-Repo: https://github.com/servo/servo
Source-Revision: 99cf9dbfc107bacb84dfe5afa9539a0ede3beac2
2015-03-18 11:25:00 -06:00
Glenn Watson
cec75140fa servo: Merge #5226 - Fixes for compositor layers being removed and reftest timeouts (from glennw:fix-compositor-layers); r=larsbergstrom
Source-Repo: https://github.com/servo/servo
Source-Revision: 0888a3a16d4f5eafe4f8008ec060764645f3bee5
2015-03-16 16:57:50 -06:00
Patrick Walton
c4615436ae servo: Merge #5160 - layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1 § 12.3-12.5 (from pcwalton:counters-redux); r=SimonSapin
Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.

Reconstructed from #5138 via raw diffing.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: fd1bb49a65dd998c8ef9890a1576aaf62ddfdba1
2015-03-09 23:24:47 -06:00
Dan Fox
f6711c6464 servo: Merge #5135 - Fix 5120 rename layout util (from iamdanfox:fix-5120-rename-layout-util); r=jdm
A simple rename/refactor (https://github.com/servo/servo/issues/5120)

My first servo contribution!

Source-Repo: https://github.com/servo/servo
Source-Revision: 7fc37dfaa76c9265e6d2145fe5ef2fba5f6bd013
2015-03-05 11:09:58 -07:00
Glenn Watson
4fbf5e6588 servo: Merge #5125 - Remove compositor layers when iframes are removed from doc or display:none (from glennw:remove-iframe-layers); r=larsbergstrom
Source-Repo: https://github.com/servo/servo
Source-Revision: e19fbc686cd10d59c9e02593f0b6ab68aabe02fc
2015-03-03 15:12:45 -07:00
Simon Sapin
9d0586a22d servo: Revert "layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1"
This reverts commit 30fd28d1077fbb3f47140f6ab1252c0d24f44d23.

Source-Repo: https://github.com/servo/servo
Source-Revision: 4c1d778ced267eeef790d4166e361d9348b933d3
2015-03-03 21:16:24 +01:00
Simon Sapin
73082d1626 servo: Merge #5067 - layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1 § 12.3-12.5 (from servo:counters); r=SimonSapin
Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.

Moved from #4544, because Critic.

Fixes #4544.

Source-Repo: https://github.com/servo/servo
Source-Revision: 5cd6316addc1acf145ed3220719387ef6ef08d2f
2015-03-03 10:42:52 -07:00
Glenn Watson
91294b5a71 servo: Merge #5086 - Reap layout data whenever a node is removed from the tree (from glennw:reap-more-stuff); r=jdm
Also introduce a clear() function to layout data which will be used to clear items such as compositor layouts.

Clear the layout data when a node becomes display:none.

Source-Repo: https://github.com/servo/servo
Source-Revision: 65454e51c806c7d91c869a7b4afce872b4eeea57
2015-03-02 16:45:51 -07:00
Bryan Bell
195b198cde servo: Merge #4952 - Dont draw interior borders for text run fragments (from bjwbell:borders-txt-nodes); r=pcwalton
Inline fragments that are part of a text run don't have interior borders.
So don't draw interior borders or include them when calculating positioning.

Fixes https://github.com/servo/servo/issues/4658, where multiple text nodes that are adjacent have distinct borders.

r? @Ms2ger, @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: b2f099026a8c649daf063dc7e119a514c2680697
2015-02-27 16:57:53 -07:00
Glenn Watson
1f9816fcf2 servo: Merge #5064 - Fix setting display:none after a layout where the element was visible (from glennw:hide-after-layout); r=pcwalton
Prior to incremental layout, the code would remove the existing
construction result. However, with incremental layout the construction result
is cloned rather than removed. This change ensures that the previous
construction result is cleared when an element's display type
changes to none.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8ad3c5aeb65e473a4c099b12e9439dfc556024f8
2015-02-26 14:46:10 -07:00
Simon Sapin
da87abc762 servo: Merge #4893 - Upgrade to rustc ba2f13ef0 2015-02-04 (from servo:rustup_2015-01-31); r=Ms2ger,glennw
Ready for review.

Final link step on android fails, but we know how to fix it and will add it to this branch soon.

Source-Repo: https://github.com/servo/servo
Source-Revision: 2cc08f289ab909de44fa09a07b2c43b70ce379b9

--HG--
rename : servo/ports/gonk/build.rs => servo/support/rust-task_info/build.rs
2015-02-11 17:24:45 -07:00
Simon Sapin
f19ec826ce servo: Merge #4757 - Bring CSS parse error reporting back (from servo:newnewnewcss); r=mbrubeck
(Still off by default. Enable with `RUST_LOG=style`.)

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 172aed535be3c34775824dac64ad2b91fc379ad5

--HG--
rename : servo/components/style/properties/mod.rs.mako => servo/components/style/properties.mako.rs
2015-01-30 15:27:53 -07:00
Glenn Watson
ef71a99664 servo: Merge #4764 - Add layout support and tests for inline iframes. Fixes #1697 (from glennw:inline-iframes); r=pcwalton
Source-Repo: https://github.com/servo/servo
Source-Revision: 7f9256e87b44125779002719a734ca412444e40e
2015-01-29 08:24:48 -07:00
Patrick Walton
d668ccc421 servo: Merge #4458 - layout: Implement floated list items (from pcwalton:floated-lists); r=mbrubeck
This patch also makes Servo not crash when
`generated_containing_block_rect()` is called on a list item (as, for
example, GitHub does), and for good measure I added the fix to other
flows as well.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 221a343883f510c7743908136438f5ed40bd17ed
2015-01-28 21:18:53 -07:00
Patrick Walton
06265455a5 servo: Merge #4592 - layout: Implement text-overflow: ellipsis per CSS-UI-3 § 6.2 (from pcwalton:text-overflow); r=mbrubeck
Only the one-value syntax is supported for now.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: c8e68fa45c43856f7ffbdde25b6e68571ad288bf
2015-01-28 17:24:50 -07:00
Ms2ger
1274f3918a servo: Merge #4751 - Don't shadow lifetimes in layout (from Ms2ger:shadowing-layout); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 0f81e7088225d03b363e337a9d1da5ab36c44064
2015-01-28 06:51:53 -07:00
Manish Goregaokar
0baa68ddf8 servo: Merge #4739 - Fix some warnings (from Manishearth:warning-patrol); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: d373f8dc26239310dec8d2fd66ed72385548cf6f
2015-01-28 02:27:50 -07:00
Josh Matthews
78741af324 servo: Merge #4719 - Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev (from servo:rustup_20150109); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 3f9012864a2cd927cf17a8e11dfa6922add1b7df
2015-01-27 18:15:50 -07:00
Ms2ger
7363fc6372 servo: Merge #4708 - Prepare for the rust upgrade (from Ms2ger:rustup-prepare); r=SimonSapin
Source-Repo: https://github.com/servo/servo
Source-Revision: 55fbf1f2b6924c50cff6e4ddf359289654f4858a
2015-01-22 08:06:50 -07:00
Ms2ger
190438fa42 servo: Merge #4682 - Move to to_owned rather than into_string (from servo:to_owned); r=jdm
into_string has been removed from Rust.

Source-Repo: https://github.com/servo/servo
Source-Revision: 94ebc7c32d5ce58ada3f9d8ffdb60cc025eb5997
2015-01-20 07:54:46 -07:00
Edit Balint
8eb66707e6 servo: Merge #4137 - CanvasRenderTask connected to Layout (from ebalint:canvas); r=jdm
Content of the canvas is drawn, tests/html/test_canvas.html now works.

Source-Repo: https://github.com/servo/servo
Source-Revision: da400a7a453eacf6f3089cc07e5dc61f385a0909
2015-01-09 12:06:47 -07:00
Ms2ger
e5578c14fd servo: Merge #4554 - Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19 (from servo:rustup_20141221); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: 1d7148c79f9124779a910fd5291c5fa0543b2dae
2015-01-08 08:00:57 -07:00
Patrick Walton
707d7cd93e servo: Merge #4460 - layout: Paint stacking contexts' overflow areas properly (from pcwalton:stacking-context-overflow); r=glennw
This was making `box-shadow` not show up in many cases, in particular,
but the effects were not limited to that.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: 499d17f564d699e5e290e8a3859f64e7536827a7
2015-01-04 18:51:48 -07:00
Megha Gupta
aa260a7580 servo: Merge #4495 - Add HTMLElementTypeId enum (fixes #3625) (from MeghaGupta:typeid); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 2e17cae5d080db72d5f89733d19e0304857cfd34
2015-01-04 12:12:48 -07:00
Manish Goregaokar
905ce805f5 servo: Merge #4485 - Replace most to_string calls by into_string calls (from servo:into_string); r=Ms2ger
`str::to_string()` goes through a `Formatter`, `str::into_string()` is a direct copy and is apparently 5× faster.

This is a rebase of the boring and bitrot-prone parts of #4366.

Source-Repo: https://github.com/servo/servo
Source-Revision: 9857ea26cb9ee262654bee97322dbbf373486bff
2014-12-27 06:51:44 -07:00
Patrick Walton
ccf77f9b53 servo: Merge #4404 - layout: Implement caption-side per CSS 2.1 § 17.4.1 (from pcwalton:caption-side); r=mbrubeck
`caption-side` is used by 4% of pages by number of loads.

r? @mbrubeck

Source-Repo: https://github.com/servo/servo
Source-Revision: 6eb9ae1eff2d26c52ad2ac59eec703bd7e8ae867
2014-12-17 23:57:52 -07:00
Patrick Walton
2ba8079a6a servo: Merge #4400 - layout: Implement empty-cells per CSS 2.1 § 17.6.1.1 (from pcwalton:empty-cells); r=SimonSapin
r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 636641f90533c941a3580b5caee1ae1fef953841
2014-12-17 22:33:51 -07:00
Glenn Watson
b185394a0f servo: Merge #4405 - Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d (from servo:rustup_20141124); r=jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: fbf42c951b2f53d91e2f32f8035484a07ea83493
2014-12-17 18:45:49 -07:00
Patrick Walton
59d35b5a90 servo: Merge #4310 - layout: Implement basic lists and the CSS1 list properties (from pcwalton:lists); r=SimonSapin
The exact rendering is ill-spec'd. Some things are ugly (especially the
width and height of list style images) but they are infrequently used
and I believe this implementation matches the spec. Numeric lists are
not supported yet, since they will require a separate layout pass.

The implementation is a subclass of `BlockFlow`, on advice from Robert
O'Callahan.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: 112ef5c484e821aa4869aeaf12a12146f2424fe0
2014-12-15 17:42:48 -07:00
Matthew Rasmus
a343b1461d servo: Merge #4152 - Implements multi line text input for TextArea (from mttr:textview); r=jdm
Fixes #3918

Can be tested in `tests/html/textarea.html`. Also implemented some content reflecting IDL attributes for HTMLTextAreaElement while I was in there.

There are some major problems with TextInput when Multiple is enabled that I haven't addressed here, but I'm prepared to open up a follow-up issue.

Source-Repo: https://github.com/servo/servo
Source-Revision: a369dcfa01f5ad7634469f3a3b652d7f650129a0
2014-12-05 16:25:07 -07:00
Corey Richardson
934ea851d8 servo: Merge #4217 - Don't categorize HTMLInputElement as a TableCellFragment (from cmr:issue/4196); r=jdm
Closes  #4196.

r? @jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: 90b0369cdfbd62b6c6fa745beffdfd206c825543
2014-12-04 00:06:55 -07:00
Claes 'Letharion' Gyllensvärd
91a5610f1a servo: Merge #4015 - Bitfield to bitflags (from letharion:Bitfield-to-bitflags); r=mbrubeck
Attempt to solve #3690

I've re-rolled the changes from https://github.com/servo/servo/pull/2610, and then doen the necessary updates to get this to compile with the current snapshot of rust.

The documentation for values I've added in the bitflag are missing, because I don't know what is the appropriate text.

Source-Repo: https://github.com/servo/servo
Source-Revision: e13873bba1782580db4abe46e883b08da829cbb6
2014-11-18 11:42:32 -07:00
Glenn Watson
22c4035692 servo: Merge #3948 - Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a (from servo:rustup-20141105_2); r=Manishearth
Source-Repo: https://github.com/servo/servo
Source-Revision: c5e1b0d32e17fad29799023c85e2e73ac89c3af7
2014-11-12 20:48:31 -07:00
Cameron Zwarich
78d3a818e9 servo: Merge #3878 - Remove InputFragment (from zwarich:remove-input-fragment); r=jdm
Fixes #3724.

Source-Repo: https://github.com/servo/servo
Source-Revision: 39960f32e49c69977b185f91e587c9947b0b9a25
2014-11-03 16:54:31 -07:00
Patrick Walton
c0e4f093a6 servo: Merge #3860 - layout: Make incremental reflow more fine-grained by introducing "reflow out-of-flow" and "reconstruct flow" damage bits (from pcwalton:reflow-out-of-flow); r=glennw
This is the last PR and most of the work for the maze solver and RoboHornet.

r? @glennw
cc @cgaebel

Source-Repo: https://github.com/servo/servo
Source-Revision: 035ff19e4a5995989c5fd34928af2a6690bb8062
2014-10-31 14:39:34 -06:00
Patrick Walton
0c42946603 servo: Merge #3843 - layout: Promote absolute positioning, floatedness, and clearance into flags to avoid virtual calls (from pcwalton:flagify-display-and-position); r=glennw
These were showing up really high in the maze solver profile.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: 9f248378f06d4de7c0df01b64e93edcc4de208cf
2014-10-28 20:42:38 -06:00
Patrick Walton
86838c5e59 servo: Merge #3841 - layout: Stop adding damage when removing whitespace (from pcwalton:removing-whitespace-damage); r=cgaebel
Avoids total reflow of the entire document on the maze solver.

I have tested Wikipedia reflow and it still works.

r? @cgaebel

Source-Repo: https://github.com/servo/servo
Source-Revision: c20bb66aef28e922c46aa69c9faaa94d83269e73
2014-10-28 19:12:39 -06:00
Patrick Walton
865204bc34 servo: Merge #3840 - layout: Put {ib} splits into a linked list so we stop copying them all the time (from pcwalton:ib-splits-linked-list); r=glennw
r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: 08288fea411e001da9b35204ccf66f29c1d7dae6
2014-10-28 18:36:41 -06:00
Patrick Walton
05f1388463 servo: Merge #3837 - layout: Make some formatting cleanups (from pcwalton:layout-formatting-cleanups); r=metajack
These should have no effect on functionality.

r? @metajack

Source-Repo: https://github.com/servo/servo
Source-Revision: 4bdd9a5ec02526b9a407b23dcbf95cc570e6fa56
2014-10-28 17:21:48 -06:00
Patrick Walton
2b445f723e servo: Merge #3772 - layout: Shrink fragments down from 448 bytes to 128 bytes (from pcwalton:slim-down-fragment); r=metajack
16% performance improvement in layout (!)

r? @metajack (or whoever)

Source-Repo: https://github.com/servo/servo
Source-Revision: 012a80cc182ea9773f82696bf36f05820ab994b3
2014-10-23 12:18:34 -06:00
Patrick Walton
daafd66ee8 servo: Merge #3722 - Overhaul flow construction with several performance improvements (from pcwalton:flow-construction-overhaul); r=glennw
This is a grab bag of performance improvements that significantly improve style recalculation, layout, and painting on a few static pages.

Let me know if you'd like me to split this PR up.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: 156ca98236a57ee52ff5b68741bc7783ba073612
2014-10-21 10:06:37 -06:00
Clark Gaebel
81a95caa86 servo: Merge #3715 - Fixes the table_percentage_width_a.html reftest with incremental reflow turned on (from cgaebel:fix-table-percentage-width); r=pcwalton
This also enables incremental reflow by default. \o/

r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: f6941b35e3b945f4a6dcd2cf03daa345ad2bcaed
2014-10-20 12:54:34 -06:00
Glenn Watson
feabe3b678 servo: Merge #3729 - Use opts as a global, to avoid cloning and passing the struct all over the code base (from glennw:opts-cleanup); r=mbrubeck
Source-Repo: https://github.com/servo/servo
Source-Revision: 852378209badb936e8929c31501cb8cabeea6bc5
2014-10-19 21:33:25 -06:00
Clark Gaebel
aaa4f1720f servo: Merge #3706 - Fix image_dynamic_remove reftest with incremental layout turned out (from cgaebel:fix-image-dynamic-remove); r=pcwalton
This also adds some extra debugging infrastructure which I found useful tracking
this bug down. A regression in the br reftests is also uncovered by this patch,
which I'll work on fixing next.

EDIT: nevermind. no regression, I just tested that before a rebase.

r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: b86344b697f814b982e52f4a72c26d58c915c37b
2014-10-17 12:15:23 -06:00
Clark Gaebel
b4c8eab1f2 servo: Merge #3689 - Fix whitespace_pre with incremental reflow turned on (from cgaebel:working-incremental-flow-construction); r=pcwalton
This implements fragment merging, in order to incrementally reflow linebroken
text. This makes the `whitespace_pre.html` reftest pass with incremental reflow
turned on with `-i`.

Source-Repo: https://github.com/servo/servo
Source-Revision: f3066c70da80306f68833814025deb589d6eeb2a
2014-10-15 21:27:20 -06:00
Clark Gaebel
39c7ff714e servo: Merge #3686 - Use the Deref traits for FlowRefs (from cgaebel:deref-flows); r=pcwalton
This patch switches FlowRefs to using the Deref and DerefMut traits, instead of
the custom `get` and `get_mut` functions.

Source-Repo: https://github.com/servo/servo
Source-Revision: 6a11ee89de82abae9d6607a6c2890692df5259eb
2014-10-15 16:18:23 -06:00
Clark Gaebel
3443a24780 servo: Merge #3640 - Try to reset flows which need reflow, since reflow isn't yet idempotent (from cgaebel:incremental-flow-construction); r=pcwalton
This also hides the not-yet-working parts of incremental reflow behind a runtime
flag. As I get the failing reftests passing, I'll send pull requests for them one
by one.

Source-Repo: https://github.com/servo/servo
Source-Revision: 56989b8dec4aa95a3b484d45f15b23f9b3daaf13
2014-10-14 16:51:30 -06:00
Patrick Walton
77c47e9d1a servo: Merge #3609 - layout: Rewrite intrinsic inline-size and automatic table layout to match L. David Baron's work-in-progress specification (from pcwalton:tables); r=SimonSapin
http://dbaron.org/css/intrinsic/

Column spans are not yet supported.

This effectively adds support for percentage widths, and it also fixes
many bugs, improving the layout of Google and Wikipedia.

r? @SimonSapin

Source-Repo: https://github.com/servo/servo
Source-Revision: e2d7777c41135b71293c195d2a9d7a1bc2afd0ca
2014-10-14 15:42:32 -06:00
Patrick Walton
0aeca90f2d servo: Merge #3622 - layout: Introduce support for legacy presentational attributes to selector matching, and use it for <input size> and <td width> (from pcwalton:html4ever); r=jdm
This implements a general framework for legacy presentational attributes
to the DOM and style calculation, so that adding more of them later will
be straightforward.

Source-Repo: https://github.com/servo/servo
Source-Revision: 0aeecfc41d5f0c637960fcddf87cc2db3e5efeea
2014-10-14 14:06:36 -06:00
Patrick Walton
7495bb838a servo: Merge #3623 - script: Use atom comparison in more places, especially for attributes (from pcwalton:use-atoms-2); r=jdm
75% improvement in style recalc for Guardians of the Galaxy.

Source-Repo: https://github.com/servo/servo
Source-Revision: 8077edc0622b04aeb26d42ced86ea285c9cac0e7
2014-10-14 12:42:35 -06:00
Patrick Walton
46685905bb servo: Merge #3654 - layout: Rewrite clipping to be per-display-item instead of having a separate ClipDisplayItem (from pcwalton:clip-reform); r=mrobinson
We push down clipping areas during absolute position calculation. This
makes display items into a flat list, improving cache locality. It
dramatically simplifies the code all around.

Because we need to push down clip rects even for absolutely-positioned
children of non-absolutely-positioned flows, this patch alters the
parallel traversal to compute absolute positions for
absolutely-positioned children at the same time it computes absolute
positions for other children. This doesn't seem to break anything either
in theory (since the overall order remains correct) or in practice. It
simplifies the parallel traversal code quite a bit.

See the relevant Gecko bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=615734

r? @mrobinson

Source-Repo: https://github.com/servo/servo
Source-Revision: fd70b366aeada7f8cb4b2457c04fd07f0ea9b143
2014-10-14 00:42:35 -06:00
Clark Gaebel
e1fa32f008 servo: Merge #3590 - Incremental Style Recalc (from cgaebel:slow-incremental-reflow-rebase); r=pcwalton
This patch puts in the initial framework for incremental reflow. Nodes' styles
are no longer recalculated unless the node has changed.

I've been hacking on the general problem of incremental reflow for the past
couple weeks, and I've yet to get a full implementation that actually passes all
the reftests + wikipedia + cnn. Therefore, I'm going to try to land the different
parts of it one by one.

This patch only does incremental style recalc, without incremental flow
construction, inline-size bubbling, reflow, or display lists. Those will be coming
in that order as I finish them.

At least with this strategy, I can land a working version of incremental reflow,
even if not yet complete.

r? @pcwalton

Source-Repo: https://github.com/servo/servo
Source-Revision: 85b277655f07db1cb99c4d3dee93804735ed0470
2014-10-09 11:21:32 -06:00
Patrick Walton
1d89e44b97 servo: Merge #3599 - layout: Implement z-index (from pcwalton:z-index); r=glennw
r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: c4ac93b315f058d9a061b20ce64cacbead339f86
2014-10-08 23:33:33 -06:00
Patrick Walton
c3a687251b servo: Merge #3546 - layout: Implement the correct hypothetical box behavior for absolutely-positioned elements declared with display: inline (from pcwalton:absolute-inline); r=glennw
Although the computed `display` property of elements with `position:
absolute` is `block`, `position: absolute; display: inline` can still
behave differently from `position: absolute; display: block`. This is
because the hypothetical box for `position: absolute` can be at the
position it would have been if it had `display: inline`. CSS 2.1 §
10.3.7 describes this case in a parenthetical:

"The static-position containing block is the containing block of a
hypothetical box that would have been the first box of the element if
its specified 'position' value had been 'static' and its specified
'float' had been 'none'. (Note that due to the rules in section 9.7 this
hypothetical calculation might require also assuming a different
computed value for 'display'.)"

To handle this, I had to change both style computation and layout. For
the former, I added an internal property
`-servo-display-for-hypothetical-box`, which stores the `display` value
supplied by the author, before the computed value is calculated. Flow
construction now uses this value.

As for layout, implementing the proper behavior is tricky because the
position of an inline fragment in the inline direction cannot be
determined until height assignment, which is a parallelism hazard
because in parallel layout widths are computed before heights. However,
in this particular case we can avoid the parallelism hazard because the
inline direction of a hypothetical box only affects the layout if an
absolutely-positioned element is unconstrained in the inline direction.
Therefore, we can just lay out such absolutely-positioned elements with
a bogus inline position and fix it up once the true inline position of
the hypothetical box is computed. The name for this fix-up process is
"late computation of inline position" (and the corresponding fix-up for
the block position is called "late computation of block position").

This improves the header on /r/rust.

r? @glennw

Source-Repo: https://github.com/servo/servo
Source-Revision: f7d2fb6ff86afff7a5b674f751af9370a5a6b142
2014-10-01 19:36:25 -06:00
Josh Matthews
5b0373348c servo: Merge #3520 - Implement basic form control support (from jdm:formcontrols); r=pcwalton
So far the changes to layout seem fairly well-contained; I think this is worth integrating to give us a browser that is easier to dogfood (and allows us to work on things like form submission much easier), especially since the long-term viability of WebComponents-as-forms is not assured.

Source-Repo: https://github.com/servo/servo
Source-Revision: f80096069592b864221abe112eaf2ecb6c444fda
2014-10-01 16:45:29 -06:00
Keegan McAllister
2e5e961694 servo: Merge #3530 - Use string-cache's Namespace type, backed by Atom (from kmcallister:namespace-atom); r=Ms2ger
Source-Repo: https://github.com/servo/servo
Source-Revision: 698b916c097ae0272a31a680cba7fc6dbd03ca3d
2014-09-30 02:42:23 -06:00
Cameron Zwarich
686b31d2f4 servo: Merge #3501 - Remove the 'static lifetime parameters from TElement methods (from zwarich:telement-lifetimes)
Reviewed-by: jdm
Source-Repo: https://github.com/servo/servo
Source-Revision: c9c8d63727560ab88a8b739f5ac305b8a02410d2
2014-09-27 17:09:28 -06:00
Patrick Walton
6e2d06b989 servo: Merge #3492 - layout: Support any display property in generated content, and allow (from pcwalton:clear-generated-content-table)
Reviewed-by: glennw
Source-Repo: https://github.com/servo/servo
Source-Revision: 33e2a7b3625c82e83c7767e81266c2a23f509bed
2014-09-26 22:24:32 -06:00