Commit graph

541 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
0c102e2350
style: Unbox a bunch of color properties.
This builds on https://github.com/servo/rust-cssparser/pull/118.
2017-02-14 20:18:31 +01:00
Nazım Can Altınova
78afe2b8d1 Box larger specified values to avoid memmove impact 2017-02-09 11:10:08 +01:00
Bobby Holley
9e860df9df Bug 1336646 - Apply selector flags during traversal. r=emilio 2017-02-08 19:21:05 -08:00
Anthony Ramine
55b2c5c1bd Update selectors to 0.17 2017-02-07 20:33:35 -08:00
Emilio Cobos Álvarez
314f2ce714
style: Define a CascadeLevel enum, and make the rule tree operate on it.
We'll use this level to know where to stop replacing nodes in the tree.
2017-01-30 23:53:53 +01:00
Emilio Cobos Álvarez
31ecc9b692
script: Don't avoid all the mutation notification methods when the style attribute changes.
Styling was correct because of the explicit dirtiness, but still not fun.

Some things, like dynamic updates to with things like [style~="color"] ~ foo
selectors, were pretty broken, because we didn't take snapshots of those
attributes.
2017-01-30 19:24:42 +01:00
Emilio Cobos Álvarez
d37e6f8c66
script: Propagate the attribute into the document's element_attr_will_change method. 2017-01-30 19:24:42 +01:00
Atheed Thameem
cbe0810e63 removed unused import 2017-01-29 12:52:49 -05:00
Ravi Shankar
bdb08b9a82 Change LengthOrPercentageOrAuto to make use of NoCalcLength 2017-01-29 02:30:34 +05:30
Ravi Shankar
590c9579f0 Change LengthOrPercentage to make use of NoCalcLength 2017-01-29 02:30:25 +05:30
Ravi Shankar
377a23df50 Refactor and modify stuff to make use of NoCalcLength 2017-01-29 02:04:24 +05:30
bors-servo
ba59ee6627 Auto merge of #15053 - emilio:image-width, r=jdm
Return the intrinsic image dimension when the image is not rendered

See individual commits for details.

r? @jdm

<!-- 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/15053)
<!-- Reviewable:end -->
2017-01-18 08:43:19 -08:00
Emilio Cobos Álvarez
bdd7cb9753
script: Rename bounding_content_box to bounding_content_box_or_zero.
And make bounding_content_box preserve whether the element is rendered.
2017-01-18 16:49:52 +01:00
Manish Goregaokar
f59557d2f2 Box CalcLengthOrPercentage to reduce inline size of PropertyDeclaration(s) 2017-01-17 08:09:54 -08:00
mrnayak
3d9e44a8c4 Handle crossorigin in link and refactor crossorigin handling
Implemented Step three and handled step four of obtain the resource part
of 4.2.4 The link element.
Link to spec : https://html.spec.whatwg.org/multipage/semantics.html#concept-link-obtain

Refactored crossOrigin handling in HTMLScriptElement, HTMLImageElement
2017-01-13 23:35:00 +05:30
karenher
db2082bc6e Store parser's current line when script elements are created.
Use the newly stored line as the starting line number when
evaluating JS. This ensures that inline scripts will report
errors with meaningful line numbers.
2017-01-11 21:11:00 -05:00
bors-servo
9d320d5a34 Auto merge of #14518 - mbrubeck:rowspan2, r=notriddle
Fix inline layout of table cells impacted by rowspan

This is part of the fix for #11297. This PR fixes the inline layout of table cells impacted by row-spanning cells from previous rows. A separate PR to follow will fix the table block size calculations to account for rowspan.

This PR doesn't yet include any test changes. If it doesn't cause any existing tests to pass, I will add a new test to it.

r? @pcwalton

<!-- 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/14518)
<!-- Reviewable:end -->
2016-12-26 10:09:09 -08:00
Emilio Cobos Álvarez
157ce33105
script: Simplify propagation of disabled state for form controls.
That's a silly exponential algorithm btw.
2016-12-25 19:18:27 +01:00
Xidorn Quan
fed488cd01 Change SpecifiedUrl::for_cascade to take ServoUrl 2016-12-21 10:14:04 +11:00
Julien Wajsberg
d024787188 Expose Quirks Mode information in the style shared context r=emilio 2016-12-17 11:15:32 -08:00
Emilio Cobos Álvarez
b9901fbd89
script: Abstract HTMLLinkElement and StyleElement into StylesheetOwner. 2016-12-16 17:59:45 +01:00
Matt Brubeck
e982d6003f Add the HTMLTableCellElement::rowspan property 2016-12-14 09:58:23 -08:00
Anthony Ramine
1327ebd52f Remove HeapGCValue
It could be used to have mutable JSVal fields without GC barriers.
With the removal of that trait, MutHeap and MutNullableHeap can respectively
be replaced by MutJS and MutNullableJS.
2016-12-12 10:47:54 -10:00
Bobby Holley
80460cc549 Make Restyle tracking more granular.
The primary idea of this patch is to ditch the rigid enum of Previous/Current
styles, and replace it with a series of indicators for the various types of
work that needs to be performed (expanding snapshots, rematching, recascading,
and damage processing). This loses us a little bit of sanity checking (since
the up-to-date-ness of our style is no longer baked into the type system), but
gives us a lot more flexibility that we'll need going forward (especially when
we separate matching from cascading). We also eliminate get_styling_mode in
favor of a method on the traversal.

This patch does a few other things as ridealongs:
* Temporarily eliminates the handling for transfering ownership of styles to the
  frame. We'll need this again at some point, but for now it's causing too much
  complexity for a half-implemented feature.
* Ditches TRestyleDamage, which is no longer necessary post-crate-merge, and is
  a constant source of compilation failures from either needing to be imported
  or being unnecessarily imported (which varies between gecko and servo).
* Expands Snapshots for the traversal root, which was missing before.
* Fixes up the skip_root stuff to avoid visiting the skipped root.
* Unifies parallel traversal and avoids spawning for a single work item.
* Adds an explicit pre_traverse step do any pre-processing and determine whether
  we need to traverse at all.

MozReview-Commit-ID: IKhLAkAigXE
2016-12-09 14:46:40 -10:00
Jansen Jan
55f0e56224 Add support for fullscreen #10102 2016-12-09 11:45:50 +01:00
ddh
479a2c1217 added dom obj counting to decide sequential/parallel layout (#10110) 2016-12-05 17:42:17 +00:00
Anthony Ramine
c1bdd3d5ce Properly mark application/xhtml+xml documents as XML
For this to work, we must remove the unimplemented!() call
in Element::parse_fragment because all the tests rely on
setting innerHTML.
2016-12-01 11:55:16 +01:00
Anthony Ramine
0c64bd766a Refactor the locate a namespace algorithm 2016-12-01 11:55:14 +01:00
Anthony Ramine
fb206e2b10 Make Attr::prefix return an Option<&Prefix> 2016-12-01 11:55:13 +01:00
Anthony Ramine
a377caa7e9 Make Element::prefix return an Option<&DOMString> 2016-12-01 11:55:12 +01:00
Anthony Ramine
2fcb908daa Make Element::attrs return a Ref<[_]> 2016-12-01 11:55:10 +01:00
Anthony Ramine
03e04179ae Refactor fragment parsing 2016-12-01 11:55:06 +01:00
Simon Sapin
81a3de3299 Remove SelectorImpl aliases 2016-11-22 14:50:22 +01:00
Simon Sapin
82b13d50e3 Update to selectors 0.15 2016-11-22 14:50:21 +01:00
Simon Sapin
b203ab2419 Rename selector_impl.rs to selector_parser.rs
This makes it consistent with an upcoming update of the selectors crate.
2016-11-20 15:30:37 +01:00
Simon Sapin
08066800cd Rename selector_matching.rs to stylist.rs 2016-11-20 15:29:09 +01:00
bors-servo
22aebdf5d4 Auto merge of #14246 - emilio:servo-url, r=SimonSapin
Urlmageddon

<!-- Please describe your changes on the following line: -->

Still needs a bunch of code in net to be converted in order to get more
advantage of this for images and stuff, but meanwhile this should help quite a
bit with #13778.

Still wanted to get this in.

r? @SimonSapin

<!-- 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/14246)
<!-- Reviewable:end -->
2016-11-17 15:34:47 -06:00
Emilio Cobos Álvarez
913c874cb5
Urlmageddon: Use refcounted urls more often. 2016-11-17 18:34:23 +01:00
Bobby Holley
f1043f6305 Track all node damage with PendingRestyles. 2016-11-16 12:09:47 -08:00
Emilio Cobos Álvarez
5f2e7af864
style: Centralize specified url value handling, and refcount urls. 2016-11-10 13:15:21 +01:00
Emilio Cobos Álvarez
de4fe6e2b6 Concurrent rule tree, v1
This patch introduces infrastructure for the rule tree, and constructs it.

We don't use it yet, nor have good heuristics for GC'ing it, but this should not
happen anymore once we store the rule node reference in the node.

I haven't messed up with memory orders because I want to do a try run with it,
then mess with them.

Take down the ApplicableDeclarationsCache, use the rule tree for doing the cascade.
2016-11-05 17:29:52 +01:00
Maciej Skrzypkowski
af5d109695 fix getElementsByTagName() 2016-11-04 16:58:19 +01:00
Simon Sapin
53b638c0e2 Update to string-cache 0.3 2016-11-03 16:23:05 +01:00
Ting-Yu Lin
0fc38f79d6 Use enum BorderWidth as SpecifiedValue
Use enum BorderWidth instead of a tuple-like struct to store the specified
value. BorderWidth is needed to be used in both longhand and shorthand
border width properties, so I put it in `specified` module.

Fixed #13869.
2016-10-26 16:24:12 +08:00
bors-servo
626d093245 Auto merge of #13640 - servo:CSSStyleDeclaration_in_style, r=mbrubeck
Move some of the CSSStyleDeclaration logic to the style crate

<!-- Please describe your changes on the following line: -->

… so that Stylo can re-use it.

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

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

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

<!-- 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/13640)
<!-- Reviewable:end -->
2016-10-12 14:21:34 -05:00
Anthony Ramine
0b3ab875f4 Remove intrinsic Root::r() 2016-10-11 19:44:32 +02:00
Simon Sapin
0eed39c198 Move CSSStyleDeclaration.SetPropertyPriority logic to style 2016-10-10 16:48:23 +02:00
Simon Sapin
c740a76410 Move (some) CSSStyleDeclaration.SetProperty logic to style 2016-10-10 16:42:23 +02:00
Simon Sapin
bd4a4c38c8 Move CSSStyleDeclaration.RemoveProperty logic to style 2016-10-10 16:20:44 +02:00
Simon Sapin
fc6a536b3a Move CSSStyleDeclaration.GetPropertyPriority logic to style 2016-10-10 16:01:23 +02:00