Commit graph

446 commits

Author SHA1 Message Date
bors-servo
09e6f4ac54 Auto merge of #11428 - g-k:csstext, r=SimonSapin
csstext

- [x] These changes fix #4431.
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy --faster` reports one error for the `css_properties_accessors!` macro not having a spec link

```
$ git log -1 --format=oneline
91fb9bf1d3 fixup! implement cssText
$ ./mach build -d
   Compiling style v0.0.1 (file:///Users/greg/servo/components/style)
   Compiling gfx v0.0.1 (file:///Users/greg/servo/components/gfx)
   Compiling script v0.0.1 (file:///Users/greg/servo/components/script)
   Compiling layout_traits v0.0.1 (file:///Users/greg/servo/components/layout_traits)
   Compiling compositing v0.0.1 (file:///Users/greg/servo/components/compositing)
   Compiling glutin_app v0.0.1 (file:///Users/greg/servo/ports/glutin)
   Compiling constellation v0.0.1 (file:///Users/greg/servo/components/constellation)
   Compiling layout v0.0.1 (file:///Users/greg/servo/components/layout)
   Compiling servo v0.0.1 (file:///Users/greg/servo/components/servo)
Build completed in 0:05:11.475584
$ ./mach test-tidy --faster
Checking files for tidiness...
./components/script/dom/cssstyledeclaration.rs:386: method declared in webidl is missing a comment with a specification link
  Progress: 100% (12/12)
```

- [x] There are tests for these changes.  More CSSOM tests pass, but others fail that probably shouldn't:

* `./mach test-css tests/wpt/css-tests/cssom-1_dev/html/index-002.htm` and a bunch of the other tests in `/css-tests/cssom-1_dev/html/ crash when run individually
* `./mach test-css tests/wpt/css-tests/cssom-1_dev/html/cssom-cssText-serialize.htm` fails to strip a trailing semicolon (`left: 10px` vs `left: 10px;`)
* `./mach test-css tests/wpt/css-tests/cssom-1_dev/html/index-001.htm` shared shorthand values aren't coalesced (`margin: 20px` vs. `margin: 20px 20px 20px 20px`)
* `./mach test-css tests/wpt/css-tests/cssom-1_dev/html/cssstyledeclaration-csstext.htm` also crashes and fails for `color: red;` vs. `color: RED;`,  preserving declaration insertion order, whitespace in the value, and setting an unknown style property.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11428)
<!-- Reviewable:end -->
2016-06-01 01:59:12 -05:00
Glenn Watson
ff995d739c implement cssText 2016-05-31 19:32:30 -04:00
Josh Matthews
3cb8af20c2 Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
David Raifaizen
8b39260793 Removed mutation calls from sync_property_with_attrs_style method in order to avoid reparsing serialized output 2016-05-25 09:25:37 +02:00
David Raifaizen
3dafd558c5 Changing update_inline_style to process multiple declarations at once to handle shorthand serialization better 2016-05-25 09:25:35 +02:00
Simon Sapin
dc829da07e Less cloning and dynamic dispatch. 2016-05-25 09:25:33 +02:00
David Raifaizen
51e642e875 Converted serialization methods to implement the to_css trait, writing to string buffers to save string allocations for every result 2016-05-25 09:25:29 +02:00
David Raifaizen
0985d7563f Making fixes based on suggestions from nox and SimonSapin 2016-05-25 09:24:10 +02:00
David Raifaizen
839a7559e7 Added sync_property_with_attrs_style method to serialize style string when inline style is changed 2016-05-25 09:24:08 +02:00
bors-servo
2a2b88f42c Auto merge of #11287 - heycam:moz-binding, r=bholley
Support -moz-binding in geckolib

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 --faster` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

Either:
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because changes target stylo

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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11287)
<!-- Reviewable:end -->
2016-05-24 14:41:04 -07:00
Anthony Ramine
cdc7bca944 Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
2016-05-24 10:54:57 +02:00
Cameron McCormack
bb85f5faf0 Add an extra data field to ParserContext.
This will be used for passing Gecko-specific information through
the CSS parser in stylo.
2016-05-24 12:12:10 +10:00
Bobby Holley
b521c293dc Add string_cache override for geckolib based on gecko atoms.
The work in these patches is based on Ms2ger's gecko-atom crate.
2016-05-18 11:33:38 -07:00
Per Lundberg
2f7ed1d73e Removed unused imports
This fixes #11185.
2016-05-15 22:24:26 +03:00
Yoav Alon
9bf909ac2f added support for :read-only and :read-write pseudo-classes
partial fix for https://github.com/servo/servo/issues/10732
2016-04-27 01:38:58 +03:00
Simon Sapin
7932ab6ac2 Upgrade to rust-url 1.0 and hyper 0.9 2016-04-23 20:27:58 +02:00
Nazım Can Altınova
47f43d45a7 Implement Element::hasAttributes 2016-04-22 15:18:08 +03:00
Zhen Zhang
11b12f677b element scroll setters 2016-04-20 08:29:17 +08:00
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