Commit graph

69 commits

Author SHA1 Message Date
Rafael Quintero
71104c8619 rename of page_fetch_complete and handle_page_fetch_complete
rename

align
2016-05-31 17:27:59 -04:00
Josh Matthews
9e8cf19e51 Add timeline markers for HTTP requests, JS evaluation, and HTML parsing. 2016-05-18 08:02:42 -05:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Ms2ger
703d018f23 Avoid some clones. 2016-04-29 14:55:49 +02:00
Keith Yeung
33acb1937c Remove extraneous script_chan parameter from Trusted::new 2016-04-28 10:52:44 +02:00
Martin Broesamle
7c4489b193 Move abstract parser infrastructure from servohtmlparser.rs to parse 2016-04-27 10:32:59 +02:00
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02:00
Ravi Shankar
5e6f32a59b Propagating the load errors from network loader 2016-04-20 12:38:35 -04:00
Rahul Sharma
2caa9a2a76 refactors entities from script_thread into script_runtime 2016-04-06 12:46:49 +05:30
Michael Wu
fc7f05a751 Update html5ever to 0.5.0 2016-02-08 16:58:18 -05:00
rohan.prinja
1f02c4ebbb task -> thread 2016-01-10 17:58:13 +09:00
Arthur Skobara
8acb21a594 Remove from Trusted::new an unnecessary argument 2015-12-12 22:31:19 +06:00
Ms2ger
14acf1616e Avoid some rooting in parsing. 2015-12-11 09:40:17 -05:00
ronak
d38a1a0d03 Create and invoke XML parser for XML documents. 2015-12-04 16:37:13 -05:00
Josh Matthews
9d3b915cac Introduce abstraction over HTML and XML parsers for parser network listener. 2015-12-04 16:32:54 -05:00
Keith Yeung
d426dd29d1 Use set_plaintext_state instead of plaintext tag 2015-11-27 00:45:34 -08:00
Alan Jeffrey
84bde75b42 Replaced DOMString constructor by conversion functions.
Replaced DOMString(...) by DOMString::from(...).
Replaced ....0 by String::from(...).
Removed any uses of .to_owner() in DOMString::from("...").
2015-11-12 17:52:59 -06:00
Ms2ger
6b75078503 Make DOMString a newtype around String, rather than a typedef.
This should make it somewhat easier to experiment with alternative
representations in the future. To reduce churn, this commit leaves the String
field public, though.

Also, this will allow us to use the default String type to represent the IDL
USVString type, which explicitly forbids unpaired surrogates, ans as such is
a better match to the Rust String type.
2015-11-04 12:09:11 +01:00
David Zbarsky
722aa86c89 Get rid of a bunch of explicit derefs 2015-11-03 19:51:46 -08:00
rohan.prinja
6e774ea6eb merge from master 2015-11-03 19:01:23 +09:00
bors-servo
f432c3c49f Auto merge of #7956 - gkbrk:binary_mime, r=jdm
Made binary files show an info message instead of garbled text.

Content-types with the TopLevel "Application" such as

* application/octet-stream
* application/pdf

now show an info message instead of trying to view binary data as html.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7956)
<!-- Reviewable:end -->
2015-10-31 21:30:52 +05:30
Gökberk Yaltıraklı
aa7a3919c4 Made binary files show an info message instead of garbled text. 2015-10-31 18:07:13 +03:00
nxnfufunezn
d8ef3809a6 Removed JS::root Fixes #8251 2015-10-31 18:15:16 +05:30
rohan.prinja
51df8e310b rearrange imports to be in alphabetical order 2015-10-30 20:28:59 +09:00
rohan.prinja
45224028db more refactoring 2015-10-30 20:26:29 +09:00
Till Schneidereit
a0c5d47910 Improve spec-compliance of script loading and execution during document startup
Including proper support for async and deferred scripts.
2015-10-26 21:35:09 +01:00
Anthony Ramine
68014af78e Clean up the cast calls 2015-10-21 11:40:34 +02:00
Anthony Ramine
13ea3ac413 Introduce trait Castable
This trait is used to hold onto the downcast and upcast functions of all
castable IDL interfaces. A castable IDL interface is one which either derives
from or is derived by other interfaces.

The deriving relation is represented by implementations of marker trait
DerivedFrom<T: Castable> generated in InheritTypes.

/^[ ]*use dom::bindings::codegen::InheritTypes::.*(Base|Cast|Derived)/ {
    /::[a-zA-Z]+(Base|Cast|Derived);/d
    s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g
    s/([{ ])[a-zA-Z]+(Base|Cast|Derived), /\1/g
    s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g
    s/, [a-zA-Z]+(Base|Cast|Derived)([},])/\2/g
    /\{([a-zA-Z]+(Base|Cast|Derived))?\};$/d
    s/\{([a-zA-Z_]+)\};$/\1;/
}

s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.upcast::<\1>()/g
s/([a-zA-Z]+)Cast::from_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.upcast::<\1>()/g
s/\(([a-zA-Z]+)Cast::from_ref\)/\(Castable::upcast::<\1>\)/g

s/([a-zA-Z]+)Cast::from_root/Root::upcast::<\1>/g

s/([a-zA-Z]+)Cast::from_layout_js\(\&([a-zA-Z_.]+)\)/\2.upcast::<\1>()/g

s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.r\(\))?\)/\2.downcast::<\1>()/g
s/([a-zA-Z]+)Cast::to_ref\(\&?\**([a-zA-Z_]+)(\.[a-zA-Z_]+\(\))?\)/\2\3.downcast::<\1>()/g
s/\(([a-zA-Z]+)Cast::to_ref\)/\(Castable::downcast::<\1>\)/g

s/([a-zA-Z]+)Cast::to_root/Root::downcast::<\1>/g

s/([a-zA-Z]+)Cast::to_layout_js\(&?([a-zA-Z_.]+(\(\))?)\)/\2.downcast::<\1>()/g

s/\.is_document\(\)/.is::<Document>()/g
s/\.is_htmlanchorelement\(\)/.is::<HTMLAnchorElement>()/g
s/\.is_htmlappletelement\(\)/.is::<HTMLAppletElement>()/g
s/\.is_htmlareaelement\(\)/.is::<HTMLAreaElement>()/g
s/\.is_htmlbodyelement\(\)/.is::<HTMLBodyElement>()/g
s/\.is_htmlembedelement\(\)/.is::<HTMLEmbedElement>()/g
s/\.is_htmlfieldsetelement\(\)/.is::<HTMLFieldSetElement>()/g
s/\.is_htmlformelement\(\)/.is::<HTMLFormElement>()/g
s/\.is_htmlframesetelement\(\)/.is::<HTMLFrameSetElement>()/g
s/\.is_htmlhtmlelement\(\)/.is::<HTMLHtmlElement>()/g
s/\.is_htmlimageelement\(\)/.is::<HTMLImageElement>()/g
s/\.is_htmllegendelement\(\)/.is::<HTMLLegendElement>()/g
s/\.is_htmloptgroupelement\(\)/.is::<HTMLOptGroupElement>()/g
s/\.is_htmloptionelement\(\)/.is::<HTMLOptionElement>()/g
s/\.is_htmlscriptelement\(\)/.is::<HTMLScriptElement>()/g
s/\.is_htmltabledatacellelement\(\)/.is::<HTMLTableDataCellElement>()/g
s/\.is_htmltableheadercellelement\(\)/.is::<HTMLTableHeaderCellElement>()/g
s/\.is_htmltablerowelement\(\)/.is::<HTMLTableRowElement>()/g
s/\.is_htmltablesectionelement\(\)/.is::<HTMLTableSectionElement>()/g
s/\.is_htmltitleelement\(\)/.is::<HTMLTitleElement>()/g
2015-10-21 11:37:16 +02:00
Anthony Ramine
d28de59e4a Return a reference in ServoHTMLParser::window() 2015-10-19 09:37:08 +02:00
Anthony Ramine
da06341578 Do not root ServoHTMLParser::document 2015-10-19 09:37:07 +02:00
Anthony Ramine
7c47a6b78e Do not root Sink::document 2015-10-19 09:37:06 +02:00
Anthony Ramine
409b5e3695 Return a reference in Document::window() 2015-10-19 09:36:52 +02:00
Eli Friedman
827f2b873c Simplify AsyncResponseListener implementations. 2015-10-15 16:53:47 -07:00
Eli Friedman
c1aff0b678 Make AsyncResponseListener methods take &mut self. 2015-10-15 16:44:39 -07:00
Manish Goregaokar
8819f0d8b8 Update script to work with lint changes 2015-10-16 01:20:27 +05:30
Ravi Shankar
889eec364b sorted the extern crate, mod & use declarations 2015-09-24 02:12:45 +05:30
Brandon Fairchild
de3547e401 Fix reported test-tidy errors for unmerged import blocks
This merges import blocks that were reported by tidy as unmerged.
2015-09-19 12:50:14 -04:00
Anthony Ramine
c0cff59df8 Remove SinkHelpers
Method get_or_create() is now directly on servohtmlparser::Sink.
2015-08-27 16:59:03 +02:00
Anthony Ramine
c831c2c0a5 Remove helper traits
Now that JSRef<T> is gone, there is no need to have helper traits.

On components/script/*.rs:

    # Remove imports.
    /^ *use dom::[a-z]+::\{.*Helpers/ {
        s/\{(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers, /\{/
        s/, (Raw[^L]|[^L][^a])[a-zA-Z]+Helpers([,}])/\2/g
        s/\{([a-zA-Z]+)\}/\1/
        /\{\}/d
        s/::self;$/;/
    }
    /^ *use dom::[a-z]+::\{?(Raw[^L]|[^L][^a])[a-zA-Z]+Helpers\}?;$/d

On components/script/dom/*.rs:

    # Ignore layout things.
    /^(pub )?(impl|trait).*Layout.* \{/,/^}$/ { P; D; }

    # Delete helpers traits.
    /^(pub )?trait ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? \{$/,/^\}$/D

    # Patch private helpers.
    /^impl.*Private.*Helpers/,/^\}$/ {
        s/^impl<'a> Private([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for &'a ([^ ]+) \{$/impl \3 {/
        /^ *(unsafe )?fn .*\(self.*[<&]'a/ {
            s/&'a /\&/g
            s/<'a, /</g
        }
        /^ *(unsafe )?fn /s/\(self([,)])/\(\&self\1/
    }

    # Patch public helpers.
    /^impl.*Helpers/,/^\}$/ {
        s/^impl(<'a>)? ([^L][^ ]|L[^a])[^ ]+Helpers(<'a>)? for (&'a )?([^ ]+) \{$/impl \5 {/
        /^ *(unsafe )?fn .*\(self.*[<&]'a/ {
            s/&'a /\&/g
            s/<'a, /</g
        }
        /^ *(unsafe )?fn .*\(&?self[,)]/s/(unsafe )?fn/pub &/
        /^ *pub (unsafe )?fn /s/\(self([,)])/\(\&self\1/
    }

The few error cases were then fixed by hand.
2015-08-27 16:59:02 +02:00
João Oliveira
fd87c8cb3e make dom_struct derive HeapSizeOf,
closes #7357
2015-08-27 01:17:48 +01:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Manish Goregaokar
19241c95f7 Cleanup NodeIterator, Range, ServoHTMLParser, TextEncoder, URLHelper, URL, VirtualMethods 2015-08-18 19:37:42 +05:30
Josh Matthews
8bb853f643 Fix existing syntactics nits. 2015-08-16 10:30:43 -04:00
Bogdan Cuza
45145108da Measure heap memory usage for more types. Fixes #6951 2015-08-13 21:44:41 +03:00
David Winslow
4cf46bff2d Refactor #[jstraceable] to #[derive(JSTraceable)]
fixes #6524
2015-07-01 18:27:06 -04:00
Michael Wu
de788e0529 Auto-derive JSTraceable and Reflectable for ServoHTMLParser 2015-06-30 15:53:04 -04:00
Simon Sapin
34bfa16517 Update to zero-copy* HTML parsing
html5ever now uses the Tendril string type to minimize copying internally,
but Servo still converts from/to `String` at the boundary
(which involves copying).
2015-06-25 20:40:38 -07:00
Michael Wu
675267b782 Upgrade to SM 39 2015-06-19 18:42:48 -04:00
Patrick Walton
05bf2ffd02 script: Address review comments 2015-05-26 11:03:47 -07:00
Patrick Walton
9e34e82aec script: Reflow 200 milliseconds after the <body> is parsed, like Gecko
does.
2015-05-26 10:38:47 -07:00