Shing Lyu
89586ed3d8
Bug #10181 - Implement *-reverse flex-directions
2016-05-11 10:30:02 +08:00
Patrick Walton
b6bed345f5
layout: Take margins in the inline direction into account when
...
guessing the inline-size of block formatting contexts.
Fixes the layout on reddit.com.
Partially addresses #10571 .
2016-05-10 17:11:28 -07:00
Ulf Nilsson
0f983cd11f
Make text-align: justify
incremental layout safe
2016-05-10 15:46:22 +02:00
Ms2ger
a5be5a82c1
Move some code from ServoThreadSafeLayoutNode::text_content into script.
2016-05-09 14:26:30 +02:00
Kosov Eugene
8b6a609764
move trait ConvertPipelineIdToWebRender to a better place
2016-05-09 01:20:24 +03:00
bors-servo
df8008cfe6
Auto merge of #11032 - mbrubeck:no-whitespace, r=pcwalton
...
Filter out whitespace glyphs from display list
Fixes #10244 . r? @glennw
<!-- 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/11032 )
<!-- Reviewable:end -->
2016-05-07 11:05:14 -07:00
bors-servo
f80641e7a1
Auto merge of #11039 - mbrubeck:strip-trailing, r=pcwalton
...
Remove redundant code in whitespace stripping
LineBreaker calls Fragment::strip_trailing_whitespace_if_necessary and then recalculates the fragment's inline size. But this isn't necessary because strip_trailing_whitespace_if_necessary already recalculates the size.
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/11039 )
<!-- Reviewable:end -->
2016-05-06 21:53:27 -07:00
Matt Brubeck
887f0e6454
Remove redundant code in whitespace stripping
...
LineBreaker calls Fragment::strip_trailing_whitespace_if_necessary and then
recalculates the fragment's inline size. But this isn't necessary because
strip_trailing_whitespace_if_necessary already recalculates the size.
2016-05-05 16:46:31 -07:00
Matt Brubeck
dff1de46b2
Don't let restyle damage infect siblings
...
Currently `compute_layout_damage` does the following for each child of the
node it's processing.
1. Update the child with damage from the parent.
2. Update the parent with damage from the child.
When these steps are repeated for the next child, the parent's damage may
include flags that came from its previous sibling(s). This means that damage
ends up propagating to later siblings, and not just between parents and
children as indended.
This patch propagates the same damage to all children, not including any
damage from their siblings.
2016-05-05 16:06:27 -07:00
Matt Brubeck
0f221521ab
Filter out whitespace glyphs from display list
...
Fixes #10244 .
2016-05-05 09:30:28 -07:00
bors-servo
8bc4785bed
Auto merge of #10999 - heycam:move-width-height, r=SimonSapin
...
Move width and height from Box to Position.
This helps with style struct alignment between Servo and Gecko.
<!-- 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/10999 )
<!-- Reviewable:end -->
2016-05-04 19:52:25 -07:00
Patrick Walton
2bef5606bd
layout: Minor whitespace cleanup.
2016-05-04 13:20:24 -07:00
Patrick Walton
d2511e33c6
layout: When printing out debug info for the float list, include
...
information about each float.
2016-05-04 13:20:23 -07:00
Patrick Walton
4ae6a68e35
layout: Fix non-vertical-align-correct wording in a comment.
2016-05-04 13:20:23 -07:00
Patrick Walton
0198a9dda8
layout: Include float information in flows' debug output.
2016-05-04 13:20:22 -07:00
Patrick Walton
9e1935c2ed
layout: Make the hypothetical box for display: inline-block
with
...
`position: absolute` inline per CSS 2.1 § 10.3.7.
2016-05-04 13:20:22 -07:00
Patrick Walton
b7c9674044
layout: Consider vertical alignment of fragments during line breaking.
...
This makes the line breaker determine the final block positions of each
line rather than doing it in a separate pass afterward. Not only does
this simplify the code, it makes `vertical-align` and float placement
interact properly.
2016-05-04 13:20:21 -07:00
Patrick Walton
04f05349b1
layout: Check flow descendants of inline block fragments to find their
...
baselines when aligning inline fragments per CSS 2.1 § 10.8.1.
2016-05-04 13:20:21 -07:00
Patrick Walton
8823f87276
layout: Don't pretend inline fragment sizes are zero when placing them
...
between floats.
2016-05-04 13:19:52 -07:00
Patrick Walton
94306cd183
layout: Speculate that the inline sizes of floats with percentage
...
inline sizes are nonzero.
This is a bit of a hack.
2016-05-04 13:19:51 -07:00
Cameron McCormack
550d780e17
Move width and height from Box to Position.
...
This helps with style struct alignment between Servo and Gecko.
2016-05-04 11:06:42 +10:00
Emilio Cobos Álvarez
aacf67afcd
layout: use debug!
instead of warn!
for the expected ThreadSafeLayoutElement methods
2016-05-04 00:34:05 +02:00
Emilio Cobos Álvarez
a87bf7c776
style: Minor documentation tweaks about lazy pseudo-elements
2016-05-04 00:34:00 +02:00
Emilio Cobos Álvarez
028f9b6cd2
style: layout: Allow a lazy pseudo-element implementation in Servo.
2016-05-04 00:33:58 +02:00
Emilio Cobos Álvarez
9caaa6004e
style: Support lazy pseudo-elements
...
These can't be supported in Servo as of right now, because I'm not
totally sure the accesses that should be done in layout would be
thread-safe.
It can be revisited later though.
2016-05-03 19:01:54 +02:00
Ben Striegel
08987c6f5a
Fix unused mut warning
2016-05-02 21:02:20 -04:00
bors-servo
8db0367301
Auto merge of #10944 - mbrubeck:bitflags-0.6, r=frewsxcv
...
Upgrade a bunch of dependencies
<!-- 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/10944 )
<!-- Reviewable:end -->
2016-04-30 15:21:22 -07:00
Matt Brubeck
1e23d90631
Upgrade to bitflags 0.6.0 and selectors 0.5.6
...
Types generated by `bitflags!` are now private by default. This PR marks them
`pub` where necessary.
2016-04-30 10:14:03 -07:00
bors-servo
b5a23a16be
Auto merge of #10941 - samlh:patch-2, r=mbrubeck
...
Remove dead code left over from #10085
cc @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/10941 )
<!-- Reviewable:end -->
2016-04-30 09:44:25 -07:00
bors-servo
0f1a921ba6
Auto merge of #10928 - servo:warnings, r=mbrubeck
...
Fix some warnings
<!-- 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/10928 )
<!-- Reviewable:end -->
2016-04-30 05:16:46 -07:00
Samuel Harrington
4691dc0c6e
Remove dead code from block.rs
2016-04-29 20:13:42 -07:00
Samuel Harrington
b2cd35da47
Delete dead code from flow.rs
2016-04-29 20:12:22 -07:00
Emilio Cobos Álvarez
9c44062836
layout: be clearer about resolved_style
2016-04-29 22:54:52 +02:00
Emilio Cobos Álvarez
5577a083ec
layout: Simplify ThreadSafeLayout::text_content
2016-04-29 22:54:50 +02:00
Emilio Cobos Álvarez
2e05190e68
layout: Add test for size of ServoThreadSafeLayoutNode
2016-04-29 22:54:50 +02:00
Emilio Cobos Álvarez
cf5c090576
layout: Don't force to overwrite display for pseudo-elements.
2016-04-29 22:54:49 +02:00
Emilio Cobos Álvarez
2a499d5a0b
layout: Stop storing PrecomputedStyleData in LayoutNode
...
Use the SharedStyleContext instead.
2016-04-29 22:54:48 +02:00
Emilio Cobos Álvarez
979c3a54b9
layout: Tidy a bit style pseudo-elements stuff
2016-04-29 22:54:47 +02:00
Emilio Cobos Álvarez
5a43c7e3cd
style: Allow inheritance when computing anonymous box styles
...
This is used a lot by Gecko, not still for servo though.
2016-04-29 22:54:46 +02:00
Emilio Cobos Álvarez
3563ecb770
style: Use precomputation for the -servo-details-content pseudo-element
2016-04-29 22:54:45 +02:00
Emilio Cobos Álvarez
b6402a81d0
style: Add infrastructure for non-eagerly-cascaded pseudo-elements
...
This commit also removes StylistWrapper and uses Arc::get_mut instead.
2016-04-29 22:54:45 +02:00
Simon Sapin
756a34e93d
Fix some warnings
2016-04-29 19:14:46 +02:00
bors-servo
ac8406f4ae
Auto merge of #10834 - yoava333:master, r=SimonSapin
...
added support for :read-only and :read-write pseudo-classes
partial fix for https://github.com/servo/servo/issues/10732
It's not a full fix because:
1. there's a bug in wpt-test https://github.com/w3c/web-platform-tests/issues/2889#issuecomment-214144420
2. we don't fully support all input types (namely image, color, hidden and range), which are defaulted to input text. this means that :read-write which is applicable to input text is mis-handled in those cases.
3. we don't support contenteditable, which is also possibly :read-write
<!-- 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/10834 )
<!-- Reviewable:end -->
2016-04-29 08:12:18 -07:00
bors-servo
cf121ad8df
Auto merge of #10895 - mbrubeck:byteindex, r=pcwalton
...
Use byte indices instead of char indices for text runs
Replace character indices with UTF-8 byte offsets throughout all code dealing with text runs. This eliminates a lot of complexity when converting from one to the other, and interoperates better with the rest of the Rust ecosystem.
For most code this is just a simple replacement of char indices with byte indices. In a few places like glyph storage and text fragment scanning, it also lets us get rid of code that existed only to map between bytes and chars.
Also includes some related fixes to text shaping, discovered while working on this conversion. See the commit messages for details.
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/10895 )
<!-- Reviewable:end -->
2016-04-28 20:22:09 -07:00
Matt Brubeck
c4872d9544
Replace range::Range with std::ops::Range in script
2016-04-28 14:54:07 -07:00
Matt Brubeck
659305fe0a
Use byte indices instead of char indices for text runs
...
Replace character indices with UTF-8 byte offsets throughout the code dealing
with text shaping and breaking. This eliminates a lot of complexity when
converting from one to the other, and interoperates better with the rest of
the Rust ecosystem.
2016-04-28 14:32:14 -07:00
Patrick Walton
6b6587a73b
layout: Translate floats flowing out of blocks to compensate for inline
...
direction margins.
Improves Reddit /r/rust.
2016-04-28 10:25:49 -07:00
Patrick Walton
97de2c2afa
layout: Reset the speculated inline size of floats out to compensate for
...
margins for all blocks, not just block formatting contexts.
Partial fix for Reddit /r/rust.
2016-04-28 10:25:49 -07:00
Daosheng Mu
b7e05b4a9d
Avoid drawing while canvases without contexts.
2016-04-28 07:03:45 +08:00
bors-servo
2729864af7
Auto merge of #10857 - servo:toml, r=nox
...
Simplify TOML syntax
* Sections like `[dependencies.foo]` can be entries in a `[dependencies]` section with the `{key = value}` syntax.
* Per-target dependencies can be expressed with more general `cfg(…)` conditions instead of exact target triples: https://github.com/rust-lang/cargo/pull/2328
<!-- 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/10857 )
<!-- Reviewable:end -->
2016-04-26 15:46:37 -07:00