Commit graph

951 commits

Author SHA1 Message Date
Matt McCoy
bfa4fe762b #4508 Fixing issues related to dispatching input event at HTMLTextareaElement 2015-03-17 17:05:41 -04:00
Matt McCoy
7cb851dda1 Fixes #4508 dispatching input event at HTMLTextareaElement 2015-03-17 17:05:21 -04:00
Patrick Walton
d10627a2b3 layout: Implement 2D CSS transforms per CSS-TRANSFORMS § 5, 6, 7, and 8. 2015-03-17 11:30:55 -07:00
Glenn Watson
939a89568e First part of refactoring constellation to support iframe navigation.
The history is now recorded per frame, but needs to be exposed in a followup PR.

Also fixes a race condition that occurs loading iframes under heavy CPU load.

This ensures that iframes never do a reflow / layout until they have a valid
window size set from their parent frame.
2015-03-17 09:35:41 +10:00
bors-servo
b8e87ea020 auto merge of #5217 : zslayton/servo/master, r=jdm
@jdm This initial version has a few outstanding issues that I wanted to invite input on. Specifically:

1. I had some difficulty finding a home for the `StorageType` enum. Structs defined outside of the `script` module don't seem to be able to use the `#[jstraceable]` annotation and the `net` module (where `StorageTask` lives) doesn't have access to `script`. Per Simon Sapin's suggestion, I worked around this temporarily by creating a `TraceableStorageType` stand-in struct that was traceable and which could be translated into a regular `StorageType` when being sent to the `StorageTask`. Unsure of the best way to resolve this hack. Thoughts?

2. Apart from the `Storage` constructor used in `Window::SessionStorage` and the new `Window::LocalStorage`, there's also a method called `Storage::Constructor`. I'm unclear on what (if anything) will actually invoke this, so I'm not sure which variant of `StorageType` to use here. I've temporarily created an `Unknown` variant of `StorageType` as a placeholder.

3. I discovered that the web platform tests directory's localStorage tests. Many of them now pass despite the configured expectation that they fail. However, several do not pass. Is there a good way for me to add debug logging or otherwise get a sense of which assertion failed / what went wrong?

Thanks for your continued help!
2015-03-16 14:48:51 -06:00
Zack Slayton
323baf92db localStorage shim, fixes #5195 2015-03-16 13:33:55 -07:00
bors-servo
ccc6faa147 auto merge of #5169 : mschroeder/servo/issue-4981, r=saneyuki
Fixes #4981
2015-03-16 11:03:58 -06:00
Martin Schröder
5c8b617715 Refactored optional argument "last_modified" for Document
Fixes #4981
2015-03-16 17:53:19 +01:00
Mikko Perttunen
e7a06cd241 Consider media attribute on link and style tags
Don't add a stylesheet if the current device does not match the media
query specified in a link or style tag.
2015-03-16 17:19:26 +02:00
bors-servo
f30faeadd0 auto merge of #5218 : wenderen/servo/enums-for-mouse-ui-event-constructors, r=Ms2ger
... cancelable arguments

for #4807
2015-03-15 03:18:49 -06:00
Rohan Prinja
5651ea06c6 make MouseEvent::new() and UIEvent::new() take enums for the bubbles and cancelable arguments 2015-03-15 10:05:36 +05:30
Ms2ger
347f395f4f Use qitem rather than QualityItem::new in XHR.
This is more future-proof.
2015-03-14 11:58:25 +01:00
Ms2ger
2345f5461b Null-check the result of JS_GetStringCharsAndLength. 2015-03-13 21:27:58 +01:00
Ms2ger
0593d77b93 Use USVString for URLUtils and URLUtilsReadOnly. 2015-03-13 21:27:58 +01:00
Ms2ger
bbbdb98897 Implement USVString. 2015-03-13 21:27:58 +01:00
Ms2ger
4157a2b02b Update the WebIDL parser. 2015-03-13 21:27:58 +01:00
bors-servo
c05de08630 auto merge of #5206 : Ms2ger/servo/pre-rustup-codegen-cleanup, r=jdm,SimonSapin 2015-03-13 08:42:49 -06:00
Ms2ger
6eb9607bb9 Don't define empty FooMethods traits. 2015-03-13 14:54:45 +01:00
Ms2ger
b213a80f80 Remove unused lifetime parameters to dictionaries.
They were used for Root members, but those no longer use lifetimes.
2015-03-13 14:49:36 +01:00
bors-servo
8e811229ba auto merge of #4417 : pcwalton/servo/border-spacing, r=larsbergstrom
Table layout code has been refactored to push the spacing down to
rowgroups and rows; this will aid the implementation of
`border-collapse` as well.

r? @SimonSapin
2015-03-12 13:03:49 -06:00
Patrick Walton
586c12ccc4 layout: Implement border-spacing per CSS 2.1 § 17.6.1 and the legacy
`cellspacing` attribute per HTML5 § 14.3.9.

Table layout code has been refactored to push the spacing down to
rowgroups and rows; this will aid the implementation of
`border-collapse` as well.

This commit also fixes two nasty issues in table layout:

* In fixed layout, extra space would not be divided among columns that
  had auto width but had nonzero minimum width.

* In automatic layout, extra space would be distributed to constrained
  columns as well even if unconstrained columns with percentage equal to
  zero were present.
2015-03-12 12:00:40 -07:00
Chris Double
2af19b2675 Fix #2108 by renaming unwrap functions to native_from_reflector
As noted by @bholley. "unwrap" is confusing because we are
both stripping off wrappers *and* getting a native from a
reflector. Changing the "unwrap" usage to "native_from_reflector"
for clarity.

This renames 'unwrap' to 'native_from_reflector' and
'unwrap_jsmanaged' to 'native_from_reflector_jsmanaged'.
2015-03-12 19:15:12 +13:00
Md. Enzam Hossain
6d13361c64 Remove redundant force_relayout calls. 2015-03-11 19:42:59 +00:00
Glenn Watson
33829c0254 Perform reflow if load events dirty any nodes.
This fixes some test failures that begin occurring when other events (such as resize) are fixed to only occur when needed.
2015-03-11 08:43:47 +10:00
bors-servo
e8f1a046c6 auto merge of #5185 : mmatyas/servo/canvas_arc, r=pcwalton
This patch enables the use of `arc()` on the canvas.
I couldn't add reftest this time, as it involves some antialiasing issues, and so the reference doesn't match.
2015-03-10 09:45:49 -06:00
bors-servo
d31e80f894 auto merge of #5182 : zslayton/servo/master, r=jdm
Opening this PR to invite feedback. 

Of the many `match` statement candidates for conversion to `if let`, several included `if` guards. Since `if let` doesn't support this syntax, I used nested if statements. If this is undesirable, say the word and I can revert those cases to `match`.
2015-03-10 07:51:50 -06:00
Zack Slayton
08ac0766ed Use new if let syntax wherever possible. Fixes #4153. 2015-03-10 09:18:55 -04:00
bors-servo
fd1bb49a65 auto merge of #5160 : pcwalton/servo/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
2015-03-09 23:24:47 -06:00
Patrick Walton
f9cdd05d58 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

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.
2015-03-09 17:13:45 -07:00
Mátyás Mustoha
c98bca6130 Canvas: added arc(). 2015-03-09 21:55:40 +01:00
Avi Weinstock
7803f2b216 Subsume ScriptMsg::WorkerDispatchErrorEvent into ScriptMsg::RunnableMsg via introduction of Worker::WorkerErrorHandler (Closes #5171). 2015-03-09 09:24:40 -04:00
bors-servo
4f3feed2be auto merge of #5150 : Adenilson/servo/reflowNotifications03, r=jdm 2015-03-06 21:48:50 -07:00
bors-servo
73e5bbec43 auto merge of #5054 : psdh/servo/scriptimplementation, r=jdm
Fixes #4089
2015-03-06 13:36:53 -07:00
Adenilson Cavalcanti
618f56410d Implements reflow events debugging.
Start servo with -Z relayout-event and you should have
reflow events printed to the terminal.
2015-03-06 12:27:18 -08:00
Guro Bokum
bf26d61d5e ScriptTask::mouse_over_targets is not traced #4985 2015-03-06 20:22:41 +07:00
Prabhjyot Singh Sodhi
64ba4a914e implement missing steps from "prepare a script" algorithm
Fixes #4089
2015-03-06 03:16:59 +05:30
bors-servo
67548a6244 auto merge of #5127 : KiChjang/servo/partial-eq-jsref, r=Ms2ger
Fixes #5112, #3960
2015-03-05 01:15:44 -07:00
Adenilson Cavalcanti
a31d3d7f70 Due to changes on Page/Window interfaces, we no longer have use
for flush_layout().
2015-03-04 11:39:29 -08:00
Josh Matthews
4972b623e1 Separate disposing of layout data from the GCing of the DOM object reflectors. Change the order of operations when shutting down the script task to ensure that Window globals aren't used after they've been GCed. 2015-03-03 16:25:40 -05:00
Josh Matthews
c816975750 Documentation and cleanup. 2015-03-03 16:25:40 -05:00
Josh Matthews
e2c4f5ed67 Move everything unrelated to the frame tree out of Page and into Document or Window. Reduce the API surface of Page to a bare minimum to allow for easier future removal. 2015-03-03 16:25:40 -05:00
bors-servo
621150db1c auto merge of #5124 : Adenilson/servo/cleanupWarning01, r=Ms2ger 2015-03-03 13:51:48 -07:00
Simon Sapin
4c1d778ced Revert "layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1"
This reverts commit 30fd28d107.
2015-03-03 21:16:24 +01:00
bors-servo
e1a50c7719 auto merge of #5133 : servo/servo/background-size, r=SimonSapin
`background-size` per CSS-BACKGROUNDS § 3.9.

Nearest neighbor interpolation is used for `crisp-edges`, like Firefox.
A note has been added that we could do better if we wanted to.

Multiple backgrounds are not yet supported.

Rebase of #4368. Fixes #4368.
2015-03-03 11:48:54 -07:00
bors-servo
5cd6316add auto merge of #5067 : servo/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.
2015-03-03 10:42:52 -07:00
Patrick Walton
09c53f461d layout: Implement image-rendering per CSS-IMAGES-3 § 5.3 and
`background-size` per CSS-BACKGROUNDS § 3.9.

Nearest neighbor interpolation is used for `crisp-edges`, like Firefox.
A note has been added that we could do better if we wanted to.

Multiple backgrounds are not yet supported.
2015-03-03 17:54:12 +01:00
Patrick Walton
30fd28d107 layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1
§ 12.3-12.5.

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.
2015-03-03 17:31:19 +01:00
Patrick Walton
a82fc00806 layout: Implement overflow-x and overflow-y per CSS-OVERFLOW § 3.
Fragmentation is not yet supported.
2015-03-03 17:03:27 +01:00
Avi Weinstock
bcc27d9bd0 Replace borrow with borrow_for_gc_trace in JSTraceable::trace (Issue #4778). 2015-03-03 09:06:45 -05:00
Keith Yeung
a07a0cf39f Added type parameter to PartialEq on JSRef (fixes #5112, #3960) 2015-03-03 11:46:13 +08:00