Commit graph

3544 commits

Author SHA1 Message Date
Junyoung Cho
ab589403ed Fix: whitespace is considered as spaces(U+0020), tabs(U+0009), and line breaks(U+000D U+000A) 2014-02-21 21:20:48 +09:00
Junyoung Cho
327e1e20a9 Prevent '&nbsp' from stripping as whitespace 2014-02-21 17:30:15 +09:00
bors-servo
65191b0d63 auto merge of #1724 : SimonSapin/servo/pseudo-element-parsing, r=larsbergstrom 2014-02-20 11:08:01 -05:00
Simon Sapin
2b8abdd16c Fix #1723: Parsing of a compound selector made of only a pseudo-element 2014-02-20 13:13:38 +00:00
bors-servo
1f90716bc1 auto merge of #1664 : recrack/servo/object-element, r=jdm
Support for #1636

Now, we can see eyes in acid2.html :)
2014-02-20 04:28:55 -05:00
Youngmin Yoo
ed0c15a93a Add a reftest for object element 2014-02-20 17:31:21 +09:00
Youngmin Yoo
80cc71be8f Add object element test file 2014-02-20 17:31:21 +09:00
Youngmin Yoo
5ea247253e Support object element data. 2014-02-20 17:31:21 +09:00
Youngmin Yoo
13f9a66632 Impl Basic support for object element 2014-02-20 17:31:16 +09:00
bors-servo
ec4c31c214 auto merge of #1699 : kmcallister/servo/border-box, r=pcwalton
I think this is the only change necessary to make block and inline boxes consistent.  But I'm finding it hard to test due to other bugs (#1696, #1697, #1698).
2014-02-19 16:01:59 -05:00
Keegan McAllister
b7dea86283 Rename Box.position to border_box 2014-02-19 12:51:19 -08:00
Keegan McAllister
bad4f16c3a Add a simple iframe reftest (disabled for now)
Disabled due to iframe crashiness.
2014-02-19 12:51:19 -08:00
Keegan McAllister
0d8e2be92b Add a reftest for #1674 2014-02-19 12:51:19 -08:00
Keegan McAllister
e70bac19e6 reftest: Allow free-form comments 2014-02-19 12:49:49 -08:00
Keegan McAllister
f8f17cf475 Always use the border-box for Box.position.size
Fixes #1674.
2014-02-19 12:49:49 -08:00
Keegan McAllister
0523032afe box: Use macros to reduce code duplication 2014-02-19 12:49:48 -08:00
bors-servo
d10bbd5d47 auto merge of #1711 : SimonSapin/servo/background-image, r=pcwalton 2014-02-19 11:20:01 -05:00
Simon Sapin
330bab371b Add a test for the base URL of external stylesheets. 2014-02-19 10:53:37 +00:00
Simon Sapin
946e9f82da Reduce code duplication in CSS parsing by passing base_url everywhere. 2014-02-19 10:47:59 +00:00
bors-servo
dedecec0e3 auto merge of #1631 : recrack/servo/background-image, r=SimonSapin
for #777 #800

- support(http://www.w3.org/TR/CSS21/colors.html#background)
 - background: url(foo.png)
 - background: url(data:image/png;base64...)
 - background-image: url(foo.png)
 - background-image: url(data:image/png;base64...)

- not support(http://www.w3.org/TR/css3-background/)
2014-02-19 05:25:58 -05:00
Youngmin Yoo
7b56e75adb Support base_url in stylesheet 2014-02-19 17:23:50 +09:00
Youngmin Yoo
a12608d2e4 Add a reftest for background-image 2014-02-19 17:14:06 +09:00
Youngmin Yoo
49952241ad Add background test file 2014-02-19 17:14:06 +09:00
Youngmin Yoo
7eabcbb8fe Impl background-image support. 2014-02-19 17:14:00 +09:00
Youngmin Yoo
3b55a5fca0 Add background-image property 2014-02-19 09:23:24 +09:00
bors-servo
20bbf6a859 auto merge of #1693 : lpy/servo/issue1692, r=pcwalton
see #1692
2014-02-18 16:17:07 -05:00
bors-servo
8b9411270c auto merge of #1706 : SimonSapin/servo/refactor-cascade, r=pcwalton
* Expand the apply() and apply_cached() templates. Their two invocations each were different enough that this improves readability IMO.
* Create computed::Context from inherited and cascaded values rather than computed value, as much as possible.
* Centralize this creation rather than making it per-property, making 'needed_for_context' not needed anymore.
* Pass a context to cascade_with_cached_declarations() rather than duplicate the creation code.

@pcwalton r? Does this hurt the optimization introduced in 0fa0940ce9?

This is mostly about nicer-looking code. The only thing that was wrong ([`apply_cached(priority)` instead of `apply_cached(needed_for_context)`](https://github.com/mozilla/servo/pull/1644#discussion_r9772133)) could be fixed with a much shorted diff.
2014-02-18 15:50:08 -05:00
bors-servo
01fcf3c877 auto merge of #1710 : jdm/servo/idmap-in-doc, r=Ms2ger
...ent.
2014-02-18 15:23:11 -05:00
Josh Matthews
70e8a5e90f Ensure id attributes on elements only affect elements present in a document. 2014-02-18 15:12:00 -05:00
bors-servo
edd7e32fdb auto merge of #1602 : pcwalton/servo/more-inlines, r=jdm
9% improvement in style recalc on the rainbow page.

r? @jdm
2014-02-18 14:08:12 -05:00
bors-servo
8f63dff8f8 auto merge of #1667 : brunoabinader/servo/dom-element-refs, r=jdm
This is a sub-task for #1660.
2014-02-18 13:35:16 -05:00
Simon Sapin
83510ebbff Refactor cascade() and fix cascade_with_cached_declarations()
* Expand the apply() and apply_cached() templates.
  Their two invocations each were different enough
  that this improves readability IMO.
* Create computed::Context from inherited and cascaded values
  rather than computed value, as much as possible.
* Centralize this creation rather than making it per-property,
  making 'needed_for_context' not needed anymore.
* Pass a context to cascade_with_cached_declarations() rather than
  duplicate the creation code.
2014-02-16 21:03:53 +00:00
bors-servo
85ef67ef14 auto merge of #1705 : lpy/servo/issue1704, r=Ms2ger
see #1704
2014-02-16 11:44:04 -05:00
lpy
cc77c29265 Change <em> and <strong> to be HTMLElement (fixes #1704) 2014-02-17 00:37:26 +08:00
bors-servo
41f55059a8 auto merge of #1703 : Ms2ger/servo/strings-cleanup, r=jdm 2014-02-16 06:02:05 -05:00
Ms2ger
f556197567 Make some selector matching code a little more consistent. 2014-02-16 10:25:30 +01:00
Ms2ger
6681476713 Use push_str instead of operator + for efficiency. 2014-02-16 10:25:12 +01:00
Ms2ger
e45b7fa22d Use eq() and eq_slice() less, and map_default() more. 2014-02-16 10:24:24 +01:00
Ms2ger
ecc07e3b49 Use DOMString instead of ~str in a few places. 2014-02-16 10:22:47 +01:00
Ms2ger
68f534c45a Use DOMString in a few more places in utils.rs. 2014-02-16 09:50:29 +01:00
Ms2ger
6cc8a4dfba Simplify string construction in InterfaceObjectToString. 2014-02-16 09:50:10 +01:00
bors-servo
a0b55b4c6c auto merge of #1702 : quandrum/servo/element_to_characterdata, r=jdm
... to characterdata

All other node's parent type names reflect the actual type of the parent. This change extends that convention to the indicated nodes.

closes #1594
2014-02-15 22:05:04 -05:00
Adam Sinnett
ffcd3833de Change Text, Comment and ProcessingInstructions parent name from element to characterdata
All other node's parent type names reflect the actual type of the parent. This change extends that convention to the indicated nodes.

closes #1594
2014-02-15 13:52:33 -08:00
bors-servo
425210b9b4 auto merge of #1644 : pcwalton/servo/style-sharing, r=larsbergstrom
This series of patches implements style struct sharing as found in existing browser engines, as well as a bunch of related important optimizations. With them, we are faster than Blink, WebKit, and Gecko on the rainbow page for style recalc in sequential mode by at least 15%. Parallel gains are mixed—the rainbow page turns out to be a degenerate sequential case for the LRU cache used to track candidates for style sharing and so there is no improvement. For cases in which the cache is not hit, such as `perf-rainbow-hard.html`, we are around 25% slower than Blink sequentially, but have very large parallel wins so that we are around 2x faster at style recalc. (Note that parallel flow tree construction will improve this further.)

This patch series also fixes, as near as I can tell, some bugs related to ordering of properties that other properties depend on in selector matching.

r? @larsbergstrom
feedback? @SimonSapin (for selector matching changes)
feedback? @bzbarsky (for style sharing heuristics)
2014-02-14 20:47:01 -05:00
Patrick Walton
d3e56fa9cc layout: Aggressively try to share styles with the last few nodes seen.
This roughly implements the same cache found in Blink. 50% improvement
on the rainbow page, but at the cost of reducing parallel gains down to
nothing. I added a new page, `perf-rainbow-hard.html`, which disables
the optimizations in both Blink and Servo.
2014-02-14 17:37:51 -08:00
Patrick Walton
0b894113e9 style: Eliminate a temporary vector when performing selector matching.
26% improvement in style recalc on the rainbow page.
2014-02-14 17:37:50 -08:00
Patrick Walton
0fa0940ce9 layout: Cache applicable-declarations-to-computed-values mappings.
If the cache is hit, then we can only compute inherited properties. This
is a WebKit optimization.
2014-02-14 17:37:50 -08:00
Patrick Walton
1678cc9a88 layout: Implement basic style sharing.
No improvement on the rainbow page, but necessary for some other
optimizations we want to do.
2014-02-14 17:37:50 -08:00
Patrick Walton
cf8203848a layout: Stop storing intermediate applicable declarations inside layout
data.

9% improvement in style recalc on the rainbow page.
2014-02-14 17:37:12 -08:00
Patrick Walton
758f5ba755 style: Separate out style structs into inherited and initial structs.
This doesn't make much of a difference in performance, but will be
necessary for style struct sharing.
2014-02-14 17:37:12 -08:00