Commit graph

526 commits

Author SHA1 Message Date
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
Anthony Ramine
fcb59d3057 Make reflect_dom_object take a &GlobalScope 2016-10-06 20:59:09 +02:00
Simon Sapin
fbde392c3d Revert "Make DOMRefCell use style’s copy of RefCell"
This reverts commit ec723057b2.
2016-10-04 18:35:01 +02:00
Simon Sapin
89a29a7f12 Use parking_lot::RwLock instead of DOMRefCell for PropertyDeclarationBlock 2016-10-04 18:34:59 +02:00
Simon Sapin
d986fd2d2f Use PropertyDeclarationBlock in a DOMRefCell everywhere. 2016-10-04 18:34:57 +02:00
Simon Sapin
aeb3efda1f Make script build without impl<T: HeapSizeOf> HeapSizeOf for Arc<T>.
The removal of this impl is not included in this commit.
CC https://github.com/servo/heapsize/issues/37#issuecomment-249861171
2016-10-04 13:45:58 +02:00
bors-servo
2fb4dd9ec3 Auto merge of #12703 - sjmelia:12343_test_activation, r=Manishearth
Fix Issue 12343: Add pref-gated methods and test for activatable element

<!-- Please describe your changes on the following line: -->
Add methods to activatable elements; gated by a preference, for use in servo-specific WPT tests.

I cargo-culted over the "redundant check" from #12322, I don't really understand the possible exploit.

Obvious flaw is the copypasta for each element. I understand that the webidl codegen will produce a trait for ActivatableElement, but I can't see how I can provide a default implementation for this? I guess otherwise could be an improvement to have each element just delegate to an Enter.../Exit... method on the Activatable trait?

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

<!-- Either: -->
- [X] 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. -->

…states

<!-- 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/12703)
<!-- Reviewable:end -->
2016-09-16 20:34:25 -05:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Simon Sapin
3ce64fd269 Rename DeclarationBlock to ApplicableDeclarationBlock
Make it more different from PropertyDeclarationBlock
2016-09-06 14:17:26 +08:00
Emilio Cobos Álvarez
468b329645
style: Provide whether we're styling or not to rust-selectors.
This makes us not adding the flags to everything in servo.
2016-08-31 17:27:15 -07:00
Simon Sapin
ad3437b98a Remove now-redundant Arc inside PropertyDeclarationBlock. 2016-08-31 02:34:08 +02:00
Simon Sapin
acc38aa8c2 Use Arc<PropertyDeclarationBlock> everwhere it’s appropriate. 2016-08-31 02:34:07 +02:00
Simon Sapin
ec723057b2 Make DOMRefCell use style’s copy of RefCell 2016-08-31 02:34:04 +02:00
Manish Goregaokar
69ada0d7a3 Support multiple backgrounds in servo layout 2016-08-22 22:42:43 +05:30
Christian Sonne
908b9627a2 Track only the number of important declarations in a declaration block 2016-08-22 14:05:09 +02:00
Simon Sapin
f9150af936 Keep track of the number of important and normal declarations in a block
… instead of the presence (`bool` flags) of each.

This allows removing `recalc_any` which iterated over the `Vec`.
2016-08-21 10:41:26 +02:00