Commit graph

1419 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
Simon Sapin
2b8abdd16c Fix #1723: Parsing of a compound selector made of only a pseudo-element 2014-02-20 13:13:38 +00: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
Keegan McAllister
b7dea86283 Rename Box.position to border_box 2014-02-19 12:51:19 -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
Simon Sapin
946e9f82da Reduce code duplication in CSS parsing by passing base_url everywhere. 2014-02-19 10:47:59 +00:00
Youngmin Yoo
7b56e75adb Support base_url in stylesheet 2014-02-19 17:23:50 +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
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
lpy
cc77c29265 Change <em> and <strong> to be HTMLElement (fixes #1704) 2014-02-17 00:37:26 +08: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
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
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
Ms2ger
951d35902c Add str.rs. 2014-02-14 13:20:48 +01:00
Ms2ger
59184bf6e1 Move DOMString into servo_util. 2014-02-14 12:48:51 +01:00
lpy
280b109733 Rename starts_*_flow to is_*_flow 2014-02-14 17:02:03 +08:00
bors-servo
f1de0b7381 auto merge of #1691 : kmcallister/servo/linked-failure, r=pcwalton
We probably leak some threads and resources, e.g. when the script task crashes and doesn't get a chance to send layout data back to layout to be deallocated.

Not tested with iframes yet.
2014-02-13 18:08:07 -05:00
Ms2ger
0f5c9a35b9 Use DOMString more consistently. 2014-02-13 19:32:59 +01:00
Keegan McAllister
2a1c450cdf Find failure.html relative to exe path, not cwd 2014-02-12 18:07:32 -08:00
Keegan McAllister
ce603a06b7 Restore hard-fail mode 2014-02-12 18:07:32 -08:00
Keegan McAllister
36b8f63984 Restore failure handling
We probably leak some threads and resources, e.g. when the script task crashes
and doesn't get a chance to send layout data back to layout to be deallocated.

Not tested with iframes yet.
2014-02-12 18:07:32 -08:00
Keegan McAllister
68cc30c1df Add a helper for sending a message on task failure 2014-02-12 18:07:32 -08:00
Keegan McAllister
73e2e57535 Move FailureMsg contents into a cloneable struct 2014-02-12 18:07:32 -08:00
Keegan McAllister
e7aa445e52 Change the mechanism behind summit-crash.html 2014-02-12 18:07:32 -08:00
bors-servo
a0a61fe976 auto merge of #1668 : larsbergstrom/servo/windowing_android_fixups, r=metajack
When I was doing my earlier PR for @mut-removal in windowing, I failed to add/commit/fetch/merge/push the changes in my Android-targeting copy of the repo and only just noticed.

r? @metajack
2014-02-12 11:58:51 -05:00
Keegan McAllister
0a8ada86c5 Accept data: URLs on the command line without URL encoding
This facilitates quick testing, e.g.

    ./servo 'data:,<div style="color: red;">hi</div>'
2014-02-11 15:38:20 -08:00
Keegan McAllister
8a7cc86aa9 Provide an error message for URL parse failure 2014-02-11 15:33:08 -08:00
Keegan McAllister
d723798298 Eliminate string match allocation in url.rs 2014-02-11 12:43:28 -08:00
bors-servo
1662e7a02f auto merge of #1666 : ozten/servo/issue-506-add-basic-console, r=Ms2ger
Here is an attempt to fix Issue#506.

I couldn't figure out how to do variadic arguments to `console.log`, but I did test calling `console.log('foo', 'bar', 'baz')` and it prints the first argument and doesn't error out, which is nice.

window.console is not a web standards. I did the popular functions, but not some of the newer ones documented [on MDN](https://developer.mozilla.org/en-US/docs/Web/API/console).

This PR will allow more pages to load properly, where developers have left in window.console calls.
2014-02-11 13:01:50 -05:00
Austin King
b1b481f3f3 Adding most commonly used parts of window.console. Fixes Issue#506. r=Ms2ger 2014-02-11 09:55:29 -08:00
Lars Bergstrom
f89eec140b Fix GLUT build for Android 2014-02-11 10:44:37 -06:00