Commit graph

10083 commits

Author SHA1 Message Date
Ms2ger
45701002a3 Implement HTMLElement.title. 2014-11-05 22:08:36 +01:00
bors-servo
76cc006a40 auto merge of #3898 : Ms2ger/servo/prefix-clone, r=jdm
The current code calls as_slice() on the Option, yielding &[DOMString], and
then calls to_string, yielding "[prefix]".
2014-11-05 12:57:37 -07:00
Ms2ger
82ff32a710 Pass the correct argument to Element::create when cloning.
The current code calls as_slice() on the Option, yielding &[DOMString], and
then calls to_string, yielding "[prefix]".
2014-11-05 20:51:41 +01:00
bors-servo
fba6cb9c42 auto merge of #3897 : Ms2ger/servo/enable-reflection, r=Manishearth 2014-11-05 11:12:40 -07:00
Ms2ger
e1bb3c3b06 Parse the size attribute on input elements. 2014-11-05 19:07:01 +01:00
Ms2ger
214c356ecd Pass an Atom to VirtualMethods::parse_plain_attribute. 2014-11-05 16:19:11 +01:00
Ms2ger
cdde96e989 Defer to GetAttribute in HasAttribute.
The semantics of has_attribute aren't anywhere close to the ones expected for
Element#hasAttribute, and it fails an assertion when passed non-lower-case
names.
2014-11-05 16:05:06 +01:00
Patrick Walton
10f7b49cf7 Invert control flow, fix resizing, and improve checkerboarding
significantly by giving tiles some time to paint before we render
unrendered content.
2014-11-04 13:51:56 -08:00
Glenn Watson
11cf538ff4 Make media queries work with resize and page zoom. 2014-11-04 13:25:21 -08:00
bors-servo
4e24e4d8e9 auto merge of #3732 : mukilan/servo/xhr-issue-3630, r=jdm
This fixes issue #3630
A short summary of the changes:
* Use atomic generation id to cancel inflight requests
* Handles nested calls to abort, open, send inside handlers
* Adds XHRReleaseMsg to delay freeing XHR object till all
  inflight events are processed
* Handles both timeout, errors and abort/open in a symmetric fashion
  i.e All inflight events will be cancelled for timeouts, aborts,
    errors and on calling open.
* Change the ErroredMsg enum to be more symmetric with the returned
  Error enum

I noticed a few possible changes that could make the code for fetch task simpler:
* We can remove the additional timer task and let the fetch task manage 
  its own timer (or maybe the resource loader can do this.)
* The CORS related steps could also be moved into the resource loader.
* Right now upload events are not support. This requires some support 
  from resource loader.
2014-11-04 05:06:34 -07:00
Bruno de Oliveira Abinader
315f626393 Various fixes to CodegenRust.py 2014-11-03 17:26:23 -08:00
bors-servo
69f8b46f36 auto merge of #3835 : pcwalton/servo/script-microoptzns, r=Ms2ger
This is a grab bag of various microoptimizations for script that I came across when profiling our performance on RoboHornet.

r? @jdm
2014-11-03 15:48:34 -07:00
bors-servo
c9089c45c4 auto merge of #3857 : mrobinson/servo/queries, r=pcwalton
Instead of looking at the display tree, have ContentBox(es)Query consult
the flow tree. This allow optimizing away parts of the display tree
later. To do this we need to be more careful about how we send reflow
requests, only querying the flow tree when possible.

Fixes #3790.
2014-11-03 12:03:37 -07:00
Martin Robinson
2d72f00ccf Have ContentBox(es)Queries consult the flow tree
Instead of looking at the display tree, have ContentBox(es)Query consult
the flow tree. This allow optimizing away parts of the display tree
later. To do this we need to be more careful about how we send reflow
requests, only querying the flow tree when possible.

Fixes #3790.
2014-11-03 10:30:28 -08:00
bors-servo
169e6a2297 auto merge of #3863 : Ms2ger/servo/cleanup-caption, r=Manishearth 2014-11-03 11:27:38 -07:00
Mukilan Thiyagarajan
7435db26ac Fix race condition in XHR and handle other abort/open scenarios
This fixes issue #3630
A short summary of the changes:
* Use generation id to cancel inflight requests
* Handles nested calls to abort, open, send inside handlers
* Adds XHRReleaseMsg to delay freeing XHR object till all
  inflight events are processed
* Change the ErroredMsg enum to be more symmetric with the returned
  Error enum
2014-11-03 22:06:17 +05:30
bors-servo
1a3ff8739c auto merge of #3871 : Ms2ger/servo/node-cleanup, r=Ms2ger 2014-11-02 14:51:33 -07:00
Ms2ger
68f3daa7ef Simplify the implementation of NodeIterator::next_child. 2014-11-02 21:28:06 +01:00
Ms2ger
cb68fbd68e Simplify the implementation of NodeHelpers::child_elements. 2014-11-02 21:26:59 +01:00
Mitchell Van Der Hoeff
536201e2b5 Initialize 'cancelable' to false in Event::new_inherited. Fixes #3855. 2014-11-02 11:36:11 -05:00
Patrick Walton
b245a2475f script: Fix busted document fragment appending code 2014-10-31 10:24:49 -07:00
Bruno de Oliveira Abinader
d5d4d0bec4 s/peek().is_some()/!is_empty()/ 2014-10-31 11:17:08 -04:00
Bruno de Oliveira Abinader
11d2251b1e ChildElementIterator is now peekable 2014-10-31 10:52:39 -04:00
Bruno de Oliveira Abinader
eb1ef59aee s/AbstractNodeChildrenIterator/NodeChildrenIterator/ 2014-10-31 10:52:02 -04:00
Ms2ger
bd547dee5e Cleanup the implementation of HTMLTableElement::GetCaption. 2014-10-31 10:25:44 +01:00
Bruno de Oliveira Abinader
5db3eb0cee Cleanup Element's AttributeHandlers
Remove notify_attribute_{changed,removed} in favor of a unified
notify_content_changed.
2014-10-30 17:14:25 -04:00
bors-servo
7de9ed5fc7 auto merge of #3856 : Ms2ger/servo/tagname, r=Manishearth
format!("{}", atom) yields strings like "Atom('span' type=Inline)", which is
not intended here.
2014-10-30 12:27:35 -06:00
Ms2ger
82216fd5c0 Move build_element_from_tag out of the HTML parser.
This function is not particular to the parser, so should live in the DOM.
2014-10-30 18:03:19 +01:00
Ms2ger
671a487145 Format Element#tagName correctly when there's a prefix.
format!("{}", atom) yields strings like "Atom('span' type=Inline)", which is
not intended here.
2014-10-30 11:51:27 +01:00
Matt Brubeck
598150ea78 Implement cloning steps for script element 2014-10-29 14:31:47 -07:00
Matt Brubeck
f39e01b336 Don't force reflow on content changes
This fixes a performance regression caused by the previous patches.  Once we
allowed script and layout to run during parsing, it was running too often
(every time the document changed and called window.reflow).

Fixes #1269.
2014-10-29 14:31:47 -07:00
Matt Brubeck
fe123ad07c Switch to synchronous script loading
This removes the old code for asyncronously loading scripts during HTML
parsing and then executing them afterward.

Fixes #3356.
2014-10-29 14:31:47 -07:00
Matt Brubeck
65a0d1fe9a Infrastructure for synchronous script loading
This implements the parts of the "prepare a script element" algorithm that are
required for synchronous scripts.  It also adds some infrastructure for future
support of the `async` and `defer` attributes.
2014-10-29 14:30:42 -07:00
bors-servo
5858fccf87 auto merge of #3718 : juzer10/servo/master, r=jdm
We have created parser trait and declared parse_chunk function in this trait. We are yet to implement this parse_chunk for ServoHTMLParser struct.
2014-10-29 14:36:45 -06:00
nchinth
6a736c7f3c Adding initial version of parser trait
Added parse_chunk method declaration to parser

Removed unnecessary visibilty for parse_chunk function

Implemented parse_chunk function

Implemented parse_chunk fn for ServoHTMLParser

Moved parser trait to mod.rs and added finish fn

added licence header to mod.rs and other review comments

Fixed trailing space issue

Fixed failed tabular space test
2014-10-29 11:31:20 -04:00
bors-servo
2d8bd10abe auto merge of #3828 : cgaebel/servo/layout-node-dumping, r=pcwalton
r? @pcwalton
2014-10-28 13:12:52 -06:00
Patrick Walton
a94e13f888 script: Use an FNV hash to hash event listeners.
The security properties of SipHash are irrelevant for event listeners
and the creation of the random number generator was showing up high in
the profiles.
2014-10-28 11:34:06 -07:00
Patrick Walton
8ab354ac08 script: Don't create a temporary vector on the heap when inserting
non-fragment nodes.
2014-10-28 11:18:43 -07:00
Patrick Walton
6a7a96a86c script: Don't dirty nodes that are already dirty. 2014-10-28 11:17:26 -07:00
Patrick Walton
e034c1cee2 script: Use String::new() instead of the formatting infrastructure
when constructing DOM unique IDs.

This was showing up in the RoboHornet profile.
2014-10-28 11:16:20 -07:00
Patrick Walton
6f577c7c84 script: Avoid a temporary when constructing <td> and <tr> elements.
Was a huge improvement to RoboHornet.
2014-10-28 11:14:06 -07:00
Patrick Walton
5e9127e2b2 script: Use a 16-element SmallVec for the root collection.
In my tests the size of the root collection never exceeded 7, so 16
seems like a nice conservative number.
2014-10-28 11:12:09 -07:00
Clark Gaebel
a8f80b89f4 layout: Implement flow tree dumping with RUST_LOG=debug is on.
r? @pcwalton
2014-10-28 10:14:12 -07:00
Clark Gaebel
14b1c320a6 make naming more consistent 2014-10-28 10:06:39 -07:00
Clark Gaebel
6df1cc8e4c Run all task spawning through util, to allow for easy hooking.
During debugging, I found it useful to hook all task creation in a
central location, and util::task was the perfect place for it.

r? @pcwalton (or maybe someone else, I'm kinda sending you a bunch of
reviews today because I don't know who better to give them to)
2014-10-28 09:53:45 -07:00
Mukilan Thiyagarajan
e023662571 Implement [LenientThis] support and enable it in Document.webidl
Closes issue #3760
2014-10-25 12:05:36 +05:30
Keegan McAllister
f508a82582 Provide safety check helpers in release builds
debug_assert! uses

    if cfg!(not(ndebug)) { ... }

so the body in a release build is dead code, but it still needs to compile.
2014-10-24 16:53:58 -07:00
Keegan McAllister
49234484d6 Ignore the HTML parser's borrow flag in GC tracing
Adds some other dynamic checks in debug builds.
2014-10-24 16:27:37 -07:00
Keegan McAllister
6ec0939a22 Dynamically check DOMRefCell access from layout in debug builds 2014-10-24 16:27:37 -07:00
Keegan McAllister
0162214b1f Fix a layout method to use borrow_for_layout() 2014-10-24 16:27:36 -07:00