Commit graph

56 commits

Author SHA1 Message Date
Austin Hicks
033b31979b Convert node serialization to a purely iterative algorithm.
We maintain a stack of open element nodes and non-node elements and use it to determine when to close them.
2017-07-17 12:24:30 -04:00
streichgeorg
fa6fc141c8 replaced ParseNodeID with ParseNodeId 2017-06-26 14:06:26 +02:00
bors-servo
f740366c61 Auto merge of #17515 - frewsxcv:frewsxcv-simple-node-iterator, r=KiChjang
Merge explicit node iterator structures into single generic structure.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17515)
<!-- Reviewable:end -->
2017-06-25 00:38:23 -07:00
Corey Farwell
011ff28aee Merge explicit node iterator structures into single generic structure. 2017-06-25 00:29:08 -04:00
Connor Brewster
062b128688 Add flag for sync/async CE creation 2017-06-23 21:09:57 -06:00
Connor Brewster
2f36d3544f Support is option when creating elements 2017-06-23 21:09:55 -06:00
Nikhil Shagrithaya
48e04d8d8f Remove target and data fields from parse_node_data 2017-06-22 00:40:21 +05:30
Simon Sapin
7af5a7fd54 Untry script 2017-06-18 13:21:49 +02:00
Nikhil Shagrithaya
ad649bb7e3 Added preference to enable/disable async html tokenizer 2017-06-17 13:35:55 +05:30
Nikhil Shagrithaya
161ff15d54 Added Async HTML Tokenizer 2017-06-17 13:10:10 +05:30
Nikhil Shagrithaya
541baafe1c Redirect document loads manually 2017-05-31 17:28:53 +05:30
Simon Sapin
4e4b5ab5c8 Decode UTF-8 code points across network packets 2017-05-27 09:01:45 +02:00
Simon Sapin
6c518c89b9 Upgrade to html5ever 0.16 2017-05-02 19:24:28 +02:00
Anthony Ramine
0d904e387e Properly coalesce whitespace when given a reference child (fixes #15979) 2017-03-17 11:40:03 +01:00
Anthony Ramine
6b43624a71 Properly handle annotation-xml integration points (fixes #15980) 2017-03-16 16:35:38 +01:00
Mukilan Thiyagarajan
38a61712e4 Implement the form owner concept 2017-03-15 16:39:55 +01:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Connor Brewster
bfd7b950ad Add ImmutableOrigin to allow for serializing origins 2017-02-22 11:11:59 -06:00
bors-servo
fa60ce62b8 Auto merge of #15303 - nox:open-your-heart-to-eternal-dimension, r=jdm
Implement document.open and document.close

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15303)
<!-- Reviewable:end -->
2017-02-03 10:53:46 -08:00
Anthony Ramine
ac254046e4 Implement document.open and document.close (fixes #14591) 2017-02-03 16:50:12 +01:00
bors-servo
f0e21d0bbe Auto merge of #15285 - simartin:issue_15017, r=nox
Issue #15017: Properly handle and report network errors on page loads.

<!-- Please describe your changes on the following line: -->
This patch fixes how network errors are handled during page loads: they would not be reported and cause crashes before, and do not anymore.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15017 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15285)
<!-- Reviewable:end -->
2017-02-03 06:04:40 -08:00
Alan Jeffrey
403499a9d5 Allow windows to share browsing contexts. 2017-01-28 21:57:03 -06:00
Simon Martin
abc9f785e8 Issue #15017: Properly handle and report network errors on page loads. 2017-01-28 21:36:36 +01:00
Alan Jeffrey
a43c842099 The constellation notifies the script thread about documents becoming inactive, active and fully active. 2017-01-27 12:39:43 -06:00
Anthony Ramine
d8238646a0 Kill ServoParser::pipeline 2017-01-27 12:12:21 +01:00
Anthony Ramine
90839305ae Reformat dom::servoparser 2017-01-25 13:49:36 +01:00
Anthony Ramine
e9feb20775 Simplify processing of deferred scripts
It is now done on-demand when a deferred script finished loading, and when
the page source finished loading.
2017-01-20 16:41:49 +01:00
Anthony Ramine
0f244d6948 Mark the page source as loaded only after parsing is done 2017-01-19 16:17:14 +01:00
Anthony Ramine
44fd53fd48 Reorder some steps in ServoParser::finish 2017-01-17 14:25:23 +01:00
Anthony Ramine
70ed3e7006 Remove ScriptThread::parsing_complete 2017-01-17 14:24:37 +01:00
karenher
db2082bc6e Store parser's current line when script elements are created.
Use the newly stored line as the starting line number when
evaluating JS. This ensures that inline scripts will report
errors with meaningful line numbers.
2017-01-11 21:11:00 -05:00
Anthony Ramine
30f0553ac7 Introduce PendingScript
This moves scripts' loading results in Document, instead of maintaining them
behind a DOMRefCell in each HTMLScriptElement.
2017-01-11 17:37:19 +01:00
Anthony Ramine
438182a7de Introduce Document::has_pending_parsing_blocking_script 2017-01-11 14:52:40 +01:00
Anthony Ramine
d853e7fee9 Unify text insertion when parsing HTML and XML 2017-01-10 11:16:42 +01:00
Anthony Ramine
0cb09468a0 Properly insert text in document when parsing
If the last child of a node is a Text child and we are inserting text in that node,
we need to append it to that Text child. Doing that means that
HTMLStyleElement::children_changed gets called less frequently, but that's not a
problem during parsing thanks to the pop hook.
2017-01-07 19:21:02 +01:00
Anthony Ramine
8caa564540 Update xml5ever to 0.3.0 2017-01-07 18:10:30 +01:00
Ms2ger
ec5d08c887 Pass the Document's origin to its constructor.
CC #10963.
2016-12-23 11:15:46 +01:00
Julien Wajsberg
d024787188 Expose Quirks Mode information in the style shared context r=emilio 2016-12-17 11:15:32 -08:00
Alan Jeffrey
9be4fd56ce Removed util. 2016-12-14 18:04:37 -06:00
Anthony Ramine
1327ebd52f Remove HeapGCValue
It could be used to have mutable JSVal fields without GC barriers.
With the removal of that trait, MutHeap and MutNullableHeap can respectively
be replaced by MutJS and MutNullableJS.
2016-12-12 10:47:54 -10:00
Anthony Ramine
620a67ff14 Mark JSTraceable and its method as unsafe 2016-12-06 13:15:06 -10:00
Anthony Ramine
a377caa7e9 Make Element::prefix return an Option<&DOMString> 2016-12-01 11:55:12 +01:00
Anthony Ramine
03e04179ae Refactor fragment parsing 2016-12-01 11:55:06 +01:00
Anthony Ramine
4d93ee134c Implement document.write (fixes #3704)
This is a bit crude because of some missing utility methods on BufferQueue.
2016-11-28 23:05:56 +01:00
Anthony Ramine
c801327eab Rewrite how parser handles script scheduling 2016-11-26 22:58:20 +01:00
Anthony Ramine
a3da819d10 Make ServoParser::pending_input hold onto a BufferQueue 2016-11-18 10:12:06 +01:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
Anthony Ramine
15e8e92540 Reorganise ServoParser
Free-standing fonctions parse_html and friends are now static methods
on ServoParser, and the HTML and XML tokenizers have been moved to private
submodules.
2016-11-14 10:21:07 +01:00
Anthony Ramine
330263bf2c Update html5ever to 0.10.1 2016-11-10 14:58:10 +01:00
Simon Sapin
53b638c0e2 Update to string-cache 0.3 2016-11-03 16:23:05 +01:00