Commit graph

428 commits

Author SHA1 Message Date
Zhen Zhang
fefdaf76de Implement ScrollTop and ScrollLeft getters:
Add new compositor message to get scroll_offset;
Add new layout query for computed value of overflow-x/y;
Implement layer_id method for ThreadSafeLayoutNode;
Add new layout query for layer_id;
Implement script interface for getting scrollTop and scrollLeft, as well as relavant helper functions.
2016-04-19 12:27:35 +08:00
Di Xu
76f57efb58 replace Fallible<()> with ErrorResult 2016-04-13 19:56:52 +08:00
Keith Yeung
c9193eaeca Remove get_ prefix for functions in LayoutHTMLInputElementHelpers 2016-04-11 09:17:04 -04:00
Corey Farwell
11a3ce1257 Remove get_* on getters as per RFC 0344.
https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#gettersetter-apis

https://github.com/servo/servo/issues/6224
2016-04-10 22:49:35 -04:00
Corey Farwell
3b376bb319 Remove superfluous end-of-file whitespace. 2016-04-10 22:03:27 -04:00
Corey Farwell
e397b30278 Remove dead link. 2016-04-10 22:03:03 -04:00
Adrian Utrilla
bc1b8ef4c6 Inlined content_changed 2016-04-04 11:33:37 +02:00
Corey Farwell
bf4db405e4 Remove get_* on getters as per RFC 0344.
https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#gettersetter-apis

https://github.com/servo/servo/issues/6224
2016-03-31 21:12:38 -04:00
Eduard Burtescu
1060c42225 Use <base> in resolving url attributes (like "href"). 2016-03-29 13:44:38 +03:00
Guillaume Gomez
c05a9b039e Add insert_adjacent methods into Element 2016-03-27 18:32:55 +02:00
Sagar Muchhal
051ffba0e5 Implement initial pieces of form validation. 2016-03-24 09:07:38 -04:00
Daniel Robertson
16d2778ece Add scrollWidth/Height to element interface
Add the scrollWidth and scrollHeight extensions to the element
interface.
2016-03-11 18:22:16 +00:00
Simon Sapin
62034b956e Replace usage of deprecated std::cell::Ref::filter_map 2016-03-07 18:53:38 +01:00
Nick Fitzgerald
d28c9a1588 Implement removeAttributeNode
This commit implement removeAttributeNode, as described here:
https://dom.spec.whatwg.org/#dom-element-removeattributenode

See also #8724 and #8068.
2016-02-26 21:18:24 +01:00
Anthony Ramine
b8ae5897f1 Implement Element.getAttributeNames 2016-02-26 19:15:11 +01:00
Eli Friedman
7b671d13a0 Use presentation hints correctly for the dimensions of <img>.
Mostly straightforward; includes some extra fixes to make `<canvas>`
work the same way as `<img>` for reflow.
2016-02-25 14:04:06 -05:00
Anthony Ramine
0adfb08089 Implement From<DOMString> for Atom 2016-02-24 17:52:17 +01:00
Anthony Ramine
cc030df36e Make use of From<String> for Atom 2016-02-24 17:52:13 +01:00
Matt Brubeck
973918967f Dirty elements whose selectors are affected by sibling changes
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.

* Fixes #8191
* Fixes #9063
* Fixes #9303
* Fixes #9448

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
2016-02-23 17:31:38 -08:00
Anthony Ramine
cb5cd8d881 Say farewell to in-tree HeapSizeOf 2016-02-04 22:03:32 +01:00
Emilio Cobos Álvarez
a1c830f1c1 Update rust-selectors
This commits updates rust-selectors to use the generic parser, and as
such it moves the element state into the style crate.
2016-02-03 02:11:31 +01:00
Mathieu Hordesseaux
322b120f8a Implement SetNamedItem, SetNamedItemNS, SetAttributeNode and SetAttributeNodeNS 2016-01-28 12:35:44 +01:00
Bobby Holley
384cdfcfff Hoist ParseErrorReporter into style and remove the dependency on msg.
The pipeline id stuff is currently unused. If someone needs it, they can add
an additional trait bound on their css error reporter to get the pipeline id.
2016-01-11 18:01:48 -08:00
bors-servo
099beee85c Auto merge of #8983 - Manishearth:cursors, r=jdm
Various textinput fixes

 - Currently the cursor sticks around if you click elsewhere. Now the text inputs are relayout-ed on blur.
 - Currently whitespace gets collapsed in text input (https://github.com/servo/servo/issues/8772). Not anymore.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8983)
<!-- Reviewable:end -->
2016-01-11 23:21:03 +05:30
Manish Goregaokar
f67e208630 Remove virtual call and unconditionally dirty node on set_focus_state 2016-01-07 13:38:05 +05:30
Ying-Ruei Liang (KK)
74905f0f3c Invalid type attribute for HTMLInputElement now fallback as text type (fixes #8773) 2016-01-06 10:56:00 +08:00
Guillaume Gomez
99ac1a81cc Generate PartialEq automatically 2016-01-03 18:07:09 +01:00
bors-servo
4a141fb63f Auto merge of #9137 - iszak:issue-9135, r=nox
Fixes https://github.com/servo/servo/issues/9135

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9137)
<!-- Reviewable:end -->
2016-01-03 11:33:00 +05:30
Iszak Bryan
c02a56c01a Optimise get_root_element for elements in documents 2016-01-03 01:07:00 +00:00
Johannes Linke
6b215f38ee Fix a bunch of clippy lints 2016-01-02 23:27:15 +01:00
bors-servo
5e497cf311 Auto merge of #9099 - frewsxcv:rm-parsed-attr, r=nox
Remove fields with parsed attribute values on HTMLTextAreaElement

https://github.com/servo/servo/issues/7863

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9099)
<!-- Reviewable:end -->
2016-01-01 01:15:13 +05:30
bors-servo
66c8aa8cda Auto merge of #8420 - craftytrickster:8371/generic-font-family, r=glennw
Enabled use of FontFamily enum type

https://github.com/servo/servo/issues/8371

In addition to replacing loose strings with the FontFamily enum in `font_cache_task.rs`, I also centralized the add_generic_font calls into one single function. If centralizing into one function is not desired or if anything else needs to be changed, please let me know.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8420)
<!-- Reviewable:end -->
2015-12-31 16:49:48 +05:30
David Raifaizen
d942bfb474 Enabled use of FontFamily enum type and replaced plain string parameters with enum 2015-12-30 18:21:37 -05:00
Corey Farwell
3eb585f547 Remove fields with parsed attribute values on HTMLTextAreaElement
https://github.com/servo/servo/issues/7863
2015-12-30 12:27:13 -08:00
Josh Matthews
7693b03468 Make button elements activatable. Fixes #4837. Fixes #8101. 2015-12-29 10:45:04 -05:00
bors-servo
89ab368258 Auto merge of #8506 - nox:finish-ranges, r=dzbarsky
Properly propagate changes when range or trees are mutated

Does the same thing as #6817, but storing Range instances directly in their start and end containers.

Cc @dzbarsky

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8506)
<!-- Reviewable:end -->
2015-12-26 04:08:15 +05:30
Mathieu Agopian
11234f5370 Use Url.join instead of UrlParser.base_url(...).parse (#9002) 2015-12-18 17:02:41 +01:00
Alan Jeffrey
348a68fe2c Bump string_cache version to 0.2.5.
Atom::to_lower_case() now returns an Atom rather than a String,
so there are a few asserts that need a different collection of &s and *s.
2015-12-15 17:00:36 -06:00
GauriGNaik
fc81276c8e Add pipeline information to CSS error reporting. 2015-12-14 11:18:30 -05:00
Anthony Ramine
8f01790f06 Introduce UnbindContext
This holds the context that describes the original node that was removed from a tree
when unbinding from a tree.
2015-12-13 21:14:31 +01:00
Simon Sapin
0a8a2c299e Add link to issue for :visited 2015-12-05 21:36:13 +01:00
bors-servo
63762d2b52 Auto merge of #8786 - eefriedman:localname-atom, r=jdm
Remove unnecessary conversion to/from DOMString for localName.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8786)
<!-- Reviewable:end -->
2015-12-03 15:05:22 +05:30
Sam Gibson
9668500e97 Makes setting negative values to maxLength throw an IndexSize exception 2015-12-03 14:00:59 +11:00
Sam Gibson
2ba1750c40 Resolves long-running merge conflicts 2015-12-03 14:00:53 +11:00
Sam Gibson
eecdfdf6c1 Makes int_getter macro, and uses -1 as default maxlength instead of maxint 2015-12-03 14:00:52 +11:00
Eli Friedman
e42dcb3712 Remove unnecessary conversion to/from DOMString for localName. 2015-12-02 13:42:45 -08:00
bors-servo
99223656fb Auto merge of #8675 - GuillaumeGomez:master, r=nox
Add XMLDocument object

Fixes #8000

(Still working on it)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8675)
<!-- Reviewable:end -->
2015-11-27 19:29:04 +05:30
Guillaume Gomez
adf8b359bb Add XMLDocument object 2015-11-27 14:55:41 +01:00
GauriGNaik
996e9e06b2 Defined new trait ParseErrorReporter and added error_reporter member to ParserContext 2015-11-25 18:28:30 -05:00
Alan Jeffrey
3dec6edd10 Update string_cache to 0.2.
Updated string_cache, html5ever, xml5ever and selectors in Cargo.toml files and Cargo.lock.
Removed references to string_cache_plugin.
Import atom! and ns! from string_cache.
Replaced ns!("") by ns!().
Replaced ns!(XML) and co by ns!(xml) and co.
Replaced atom!(foo) by atom!("foo").
Replaced Atom::from_slice by Atom::from.
Replaced atom.as_slice() by &*atom.
2015-11-25 10:13:21 -06:00