Commit graph

468 commits

Author SHA1 Message Date
Simon Sapin
fdb2071b2d Update to selectors 0.8.2 2016-08-09 18:18:38 +02:00
Mitchell Hentges
1ca4a3e32f Compute tag_name a maximum of once per document owner 2016-08-03 20:05:22 -07:00
Steve Melia
04f5369577 Issue 7720: Add target selector and update when scrolling to fragment 2016-08-03 13:23:10 +01:00
Cameron McCormack
baa339f4af Store UrlExtraData in {specified,computed}::Image::Url. 2016-07-29 14:22:35 +08:00
Guillaume Gomez
87800fa902 Replace AdjacentPosition::parse by TryFrom 2016-07-12 23:33:49 +02:00
bors-servo
5afdf7fb5c Auto merge of #11781 - sjmelia:8719_support_for_css_active, r=Manishearth
Issue 8719: Add basic support for :active selector

<!-- Please describe your changes on the following line: -->
Added toggling of active state for element and parents on mousedown/mouseup. Active state is removed when mouseout. (hover)

- As with my other PR i'm struggling a bit with the automated testing. I've added a manual test case and found quirks-mode/active-and-hover-manual.html which - aside from also being a manual test, is functional in Firefox but does not render correctly in Servo.
- Not implemented: In Firefox, behaviour differs with a <!DOCTYPE HTML> and an anchor does not lose it's activation on mouseout; whereas a button does.

---
<!-- 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 #8719  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/11781)
<!-- Reviewable:end -->
2016-07-08 05:06:57 -07:00
Bobby Holley
1d8d1cb9d9 Upgrade rust-selectors. 2016-07-05 18:03:40 -07:00
Steve Melia
421c354d44 Issue 8719: Add basic support for :active selector 2016-07-04 22:24:13 +01:00
Anthony Ramine
a5b524d559 Move util::vec::ForgetfulSink to style::sink and simplify it 2016-07-04 16:48:14 +02:00
Guillaume Gomez
fc88f81de3 Fix insert-adjacent error 2016-06-23 17:18:18 +02:00
bors-servo
77e0089c12 Auto merge of #11548 - kevgs:default_view2, r=Ms2ger
Make Document::DefaultView return a null value when there's no browsing context

Fixes #11469.

<!-- 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/11548)
<!-- Reviewable:end -->
2016-06-09 02:48:30 -05:00
Kosov Eugene
3bb093cc16 Make Document::DefaultView return a null value when there's no browsing context 2016-06-08 23:10:20 +03:00
bors-servo
da5007ef1c Auto merge of #11668 - GuillaumeGomez:insert_adjacent, r=nox
Insert adjacent

Fixes #11622.

r? @nox

<!-- 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/11668)
<!-- Reviewable:end -->
2016-06-08 08:29:42 -05:00
Guillaume Gomez
8c572085c7 Add Element::InsertAdjacentHTML 2016-06-08 15:08:53 +02:00
Guillaume Gomez
40feb524d9 Set Adjacent::Position case-insensitive 2016-06-08 11:47:04 +02:00
Guillaume Gomez
19f9b5bef9 Create AdjacentPosition enum 2016-06-08 11:47:03 +02:00
Ms2ger
684510bc94 Stop re-exporting AttrValue. 2016-06-07 13:15:23 +02:00
bors-servo
0f1f99a4bf Auto merge of #11572 - nox:placeholder-shown, r=SimonSapin
Implement :placeholder-shown (fixes #10561)

<!-- 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/11572)
<!-- Reviewable:end -->
2016-06-06 23:44:16 -05:00
Ms2ger
06a1d04ca6 Move LengthOrPercentageOrAuto to style::attr. 2016-06-06 08:54:34 +02:00
Anthony Ramine
ff899dc703 Implement :placeholder-shown (fixes #10561) 2016-06-03 14:45:14 +02:00
bors-servo
51d41c5161 Auto merge of #11496 - GuillaumeGomez:range, r=nox
Implement Range::createContextualFragment

<!-- 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/11496)
<!-- Reviewable:end -->
2016-06-03 05:32:42 -05:00
Guillaume Gomez
5ab7f54762 Implement Range::createContextualFragment 2016-06-03 01:31:53 +02:00
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