Commit graph

14673 commits

Author SHA1 Message Date
Nazım Can Altınova
57d02dc0e9
Handle PseudoElement case in :active and :hover quirk 2017-06-13 17:22:39 +03:00
bors-servo
07f6e11485 Auto merge of #17292 - emilio:better-style-invalidation, r=heycam
style: Implement a more fine-grained invalidation method.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17292)
<!-- Reviewable:end -->
2017-06-13 04:56:09 -07:00
Emilio Cobos Álvarez
30252ee829
style: Update bindings.
MozReview-Commit-ID: K7X7EyYR2X
2017-06-13 13:27:11 +02:00
Emilio Cobos Álvarez
6b0f4c0410
style: Move one-off checks out of the recursive invalidation function.
There isn't a need to pay the cost for them multiple times.

Bug: 1372068
MozReview-Commit-ID: 3K2mRcWTheJ
2017-06-13 13:27:09 +02:00
Emilio Cobos Álvarez
36bac58863
style: Don't try to go down the tree if there aren't invalidations.
This can happen when adding an empty stylesheet, for example.

Bug: 1372068
MozReview-Commit-ID: Jtm4eJBWjEA
2017-06-13 13:27:08 +02:00
Emilio Cobos Álvarez
4434509088
style: Add an AllLinksVisitedAndUnvisited for invalidation.
Otherwise, tests like the following fail, given we always match as unvisited,
and we'd never mark the link as needing invalidation.

<!doctype html>
<style>
a {
  color: red !important;
}

.foo :visited {
  color: green !important;
}
</style>
<div>
  <a href="https://google.es">visit me</a>
  <button onclick="this.parentNode.className = 'foo'">Then click me</button>
</div>

Bug: 1368240
MozReview-Commit-ID: LDv6S28c4ju
2017-06-13 13:27:06 +02:00
Emilio Cobos Álvarez
fdf9093466
style: Add missing visitedness check while invalidating elements.
This is needed for the omta test to pass. This is pretty much the equivalent to
the old restyle hints code.

Bug: 1368240
MozReview-Commit-ID: BLUfw5Wxpxd
2017-06-13 13:27:02 +02:00
Emilio Cobos Álvarez
14bb57c08f
style: Properly handle invalidation of eager pseudo-elements.
Bug: 1368240
MozReview-Commit-ID: EkzDVhC3GPH
2017-06-13 13:26:46 +02:00
Emilio Cobos Álvarez
cb06375fe2
style: Implement a more fine-grained invalidation method.
This commit also removes the old restyle_hints module and splits it into
multiple modules under components/style/invalidation/element/.

The basic approach is to walk down the tree using compound selectors as needed,
in order to do as little selector-matching as possible.

Bug: 1368240
MozReview-Commit-ID: 2YO8fKFygZI
2017-06-13 13:26:41 +02:00
Cameron McCormack
e314dbb4ac style: Don't skip style attributes on NAC. 2017-06-13 17:44:33 +08:00
Emilio Cobos Álvarez
fd10729941
style: Also print the class name when logging elements.
Bug: 1368240
MozReview-Commit-ID: 1MSn4rty5RL
2017-06-13 10:59:17 +02:00
Emilio Cobos Álvarez
151b636562
style: Add a way to match a single compound selector.
Also improve the ergonomics of matches_complex_selector.

Bug: 1368240
MozReview-Commit-ID: 9DWDvyZmetM
2017-06-13 10:58:47 +02:00
Emilio Cobos Álvarez
262f6adc30
Record whether an snapshot is recording a class attribute change or id change.
I'll use this information in order to get fewer dependencies out of the
dependency set.

Bug: 1368240
MozReview-Commit-ID: 5HlmKmSNO8p
2017-06-13 10:57:43 +02:00
Anthony Ramine
f658215f12 Fix Animatable impl for LengthOrPercentageOrNone 2017-06-13 10:19:23 +02:00
Anthony Ramine
43a5257a0c Introduce #[css(function)] for #[derive(ToCss)]
Any variant with this attribute gets serialised as a CSS function,
using the variant name as the function name.
2017-06-13 10:19:23 +02:00
Anthony Ramine
fd1ab75af9 Derive ToCss for ShapeRadius<L> 2017-06-13 10:19:23 +02:00
bors-servo
8449eb4a62 Auto merge of #17285 - heycam:newly-bound, r=bholley
geckolib: Don't panic when attempting to restyle an element with newly applied XBL bindings.

From https://bugzilla.mozilla.org/show_bug.cgi?id=1370793.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17285)
<!-- Reviewable:end -->
2017-06-12 18:46:41 -07:00
Cameron McCormack
f989a2c21c style: Update Gecko bindings. 2017-06-13 08:30:45 +08:00
Xidorn Quan
cdc537f23e Bug 1331291 part 1 - Set stylesheet url_data correctly for import rule. 2017-06-13 10:07:06 +10:00
Simon Sapin
138c03b24d Stylo: avoid atom refcount traffic in ID selector matching 2017-06-13 00:51:41 +02:00
Simon Sapin
b82713924c Pre-compute classes and IDs case-sensitivity 2017-06-13 00:36:12 +02:00
Simon Sapin
9316c41bf7 Make MatchingContext::quirks_mode field private, add read-only accessor. 2017-06-13 00:35:56 +02:00
Simon Sapin
700aaf2bd6 Move MatchingContext to a new module 2017-06-13 00:31:29 +02:00
Simon Sapin
c5c1c1b350 Classes/IDs case-sensitivity: get quirks mode from matching context. 2017-06-13 00:27:41 +02:00
Simon Sapin
5bccf98aa4 ID and class selectors are ASCII case-insensitive in quirks mode.
https://bugzilla.mozilla.org/show_bug.cgi?id=1363778
2017-06-12 23:33:53 +02:00
Simon Sapin
524fcac191 Add Atom::to_ascii_lowercase 2017-06-12 23:33:15 +02:00
bors-servo
75d6796cbd Auto merge of #17281 - bholley:shrink_rule_again, r=emilio
Pack bloom filter hashes better and save a word on Rule

https://bugzilla.mozilla.org/show_bug.cgi?id=1371949

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17281)
<!-- Reviewable:end -->
2017-06-12 12:41:39 -07:00
Bobby Holley
a98fff1af8 Hoist ApplicableDeclaration{Block,List} into a separate file.
MozReview-Commit-ID: EXnAzfyoZ1e
2017-06-12 12:13:21 -07:00
Bobby Holley
0caad2ffdc Use even fewer bits for source order and shrink ApplicableDeclarationsBlock by another word.
MozReview-Commit-ID: 7B1i1g0HLTj
2017-06-12 12:13:16 -07:00
Bobby Holley
3afab1400a Make source_order u32 and shrink Rule.
MozReview-Commit-ID: AKNTZZqke1O
2017-06-12 12:13:10 -07:00
Bobby Holley
6e3e7b282c Pack the fourth ancestor hash into the upper byte of the first three hashes.
MozReview-Commit-ID: KbtKQzLmwVO
2017-06-12 12:13:04 -07:00
Bobby Holley
cf982d17b9 Shift by KEY_SIZE instead of something larger.
Currently all Gecko and Servo do the KEY_SHIFT thing, but there's no reason
we need to follow that here.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1371949#c10

MozReview-Commit-ID: CqNi7r9e5s0
2017-06-12 12:12:39 -07:00
bors-servo
dfffc72691 Auto merge of #17279 - emilio:no-viewport, r=bholley
style: Don't try to compute @viewport unnecessarily.

If the viewport rule is not enabled, there's just no point in computing it.

Bug: 1372058
2017-06-12 11:37:47 -07:00
Emilio Cobos Álvarez
f8755d6cf0
style: Don't try to compute @viewport unnecessarily.
If the viewport rule is not enabled, there's just no point in computing it.

Bug: 1372058
2017-06-12 20:36:37 +02:00
bors-servo
0c929ad3fd Auto merge of #17254 - servo:webidl, r=jdm
Update the WebIDL parser

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17254)
<!-- Reviewable:end -->
2017-06-12 07:37:49 -07:00
Fernando Jiménez Moreno
2cc940384d stylo: Implement GetSpecificity for ServoStyleRule 2017-06-12 14:40:16 +02:00
bors-servo
87140641a4 Auto merge of #16477 - sadmansk:url_param_browser, r=paulrouget
Pass URL to Browser::new(), delegate url checking logic to 3rd party

<!-- Please describe your changes on the following line: -->
1. Move the logic of computing the initial url from `opts.rs` to `/ports/servo/main.rs`
2. Add a `ServoUrl` argument to `Browser::new`

Based on the requested changes by @paulrouget:
>We can read the pref in main() instead. shell.homepage would be used if the url is not passed as an argument. I'm trying to decouple the "app" logic and the "web engine" logic. I think it's up to the app to set the initial URL, and I'm not sure the initial url should be part of opts.

---
<!-- 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 #15636

<!-- Either: -->
- [ ] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16477)
<!-- Reviewable:end -->
2017-06-11 21:16:06 -07:00
bors-servo
03074f4b0e Auto merge of #17270 - emilio:bindgen-does-bitfields-sort-of, r=wafflespeanut
stylo: Use bitfield accessors in string-cache.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17270)
<!-- Reviewable:end -->
2017-06-11 10:31:00 -07:00
Emilio Cobos Álvarez
cb04ef933b
stylo: Use bitfield accessors in string-cache. 2017-06-11 18:39:25 +02:00
Emilio Cobos Álvarez
e3c4d03bde
style: Reduce some code duplication and ugliness when parsing identifiers. 2017-06-11 03:12:02 +02:00
Nazım Can Altınova
309531e5b3
stylo: Fix propagation of quirks mode information to servo side
It was getting inial value from gecko side before and that was always
eCompatibility_NavQuirks. Created an FFI to fetch quirks mode.
2017-06-10 22:18:49 +03:00
Nazım Can Altınova
15fe48f3f6
stylo: Support :hover and :active quirk 2017-06-10 22:18:32 +03:00
bors-servo
ff17af064b Auto merge of #17262 - Manishearth:bindings, r=Manishearth
Update bindings for StyleImageLayerRepeat

https://bugzilla.mozilla.org/show_bug.cgi?id=1371354

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17262)
<!-- Reviewable:end -->
2017-06-09 15:56:10 -07:00
bors-servo
061cb5f48e Auto merge of #16752 - jdm:css-parse-error, r=SimonSapin
Report more informative CSS errors

This requires https://github.com/servo/rust-cssparser/pull/143 for the final commit. There's no better way to split that work up, unfortunately, and it's extremely easy to bitrot. I would appreciate if we could expedite reviewing this work.

This is the work necessary to enable https://bugzilla.mozilla.org/show_bug.cgi?id=1352669. It makes sense to merge it separately because it's so much effort to keep it up to date with the ongoing Stylo work.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16752)
<!-- Reviewable:end -->
2017-06-09 14:31:48 -07:00
Josh Matthews
27ae1ef2e7 Thread ParseError return values through CSS parsing. 2017-06-09 16:46:25 -04:00
Manish Goregaokar
fd0ac4f31e Update bindings for StyleImageLayerRepeat 2017-06-09 13:26:16 -07:00
bors-servo
1e1b7f6ac2 Auto merge of #17258 - jkl445:issue-17249, r=cbrewster
Reduce code duplication when adding a SessionHistoryChange

<!-- Please describe your changes on the following line: -->
Implemented add_pending_change method and refactored code to use this new method

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

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17258)
<!-- Reviewable:end -->
2017-06-09 11:41:53 -07:00
Jeroen Kleijn
bca052e7b3 Reduce code duplication when adding a SessionHistoryChange 2017-06-09 19:50:40 +02:00
Josh Matthews
58e39bfffa The ParseErrorReporter trait no longer needs to be Send. 2017-06-09 13:16:39 -04:00
Josh Matthews
3773a4d499 Encapsulate CSS error reporter creation for stylo. 2017-06-09 13:16:38 -04:00