aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/element.rs
Commit message (Collapse)AuthorAgeFilesLines
...
* | style: Track the visited-handling-mode on the MatchingContext.Emilio Cobos Álvarez2018-01-191-2/+0
|/ | | | | | | | | Instead of on the stack. This fixes bugs where we're not passing the value around correctly, like from ::-moz-any. This is a fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1431539.
* selectors: Simplify :visited by only using the "is inside link" information.Emilio Cobos Álvarez2017-12-081-2/+3
| | | | | | | | | | | | | | | | | | | Right now we go through a lot of hoops to see if we ever see a relevant link. However, that information is not needed: if the element is a link, we'll always need to compute its visited style because its its own relevant link. If the element inherits from a link, we need to also compute the visited style anyway. So the "has a relevant link been found" is pretty useless when we know what are we inheriting from. The branches at the beginning of matches_complex_selector_internal were affecting performance, and there are no good reasons to keep them. I've verified that this passes all the visited tests in mozilla central, and that the test-cases too-flaky to be landed still pass.
* style: Make all keywords CamelCase for consistency.Emilio Cobos Álvarez2017-12-061-4/+4
| | | | This prevents confusion and paves the ground for derive(Parse) of them.
* style: Move font-family outside of makoCYBAI2017-11-261-3/+3
|
* Auto merge of #19127 - tigercosmos:overflow10, r=emiliobors-servo2017-11-121-3/+48
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scroll, SetScrollTop, SetScrollLeft in `element.rs` <!-- Please describe your changes on the following line: --> Currently dom-element-scroll have not finished yet. (Step 10) This PR finish the step 10 of `scroll`, `SetScrollTop`, `SetScrollLeft` [Step 10 description](https://drafts.csswg.org/cssom-view/#dom-element-scrolltop): > If the element does not have any associated CSS layout box, the element has no associated scrolling box, or the element has no overflow, terminate these steps. --- <!-- 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 #19114 (github issue number if applicable). <!-- Either: --> - [X] 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/19127) <!-- Reviewable:end -->
| * scroll, SetScrollTop, SetScrollLeft in `dom-element-scroll` with testtigercosmos2017-11-121-3/+48
| |
* | Upgrade to rustc 1.23.0-nightly (02004ef78 2017-11-08)Simon Sapin2017-11-091-1/+0
|/
* fix overflow_y_is_visible()tigercosmos2017-11-061-2/+3
|
* Bump bitflags to 1.0 in every servo crateBastien Orivel2017-10-301-30/+29
|
* style: Add TNode::owner_doc.Emilio Cobos Álvarez2017-10-261-6/+3
|
* Auto merge of #18968 - mbrubeck:try, r=emiliobors-servo2017-10-211-17/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | Use try syntax for Option where appropriate - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because they are refactoring only <!-- 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/18968) <!-- Reviewable:end -->
| * Use try syntax for Option where appropriateMatt Brubeck2017-10-201-17/+13
| |
* | Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest ↵Gecko Backout2017-10-191-29/+30
|/ | | | | | failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE Backs out https://github.com/servo/servo/pull/18809
* Auto merge of #18809 - Eijebong:bitflags, r=noxbors-servo2017-10-191-30/+29
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update bitflags to 1.0 in every servo crate It still needs dependencies update to remove all the other bitflags versions. - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because it's a dependency update <!-- 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/18809) <!-- Reviewable:end -->
| * Update bitflags to 1.0 in every servo crateBastien Orivel2017-10-191-30/+29
| | | | | | | | | | It still needs dependencies update to remove all the other bitflags versions.
* | style: Make MatchingContext generic over SelectorImpl.Emilio Cobos Álvarez2017-10-191-12/+14
|/ | | | | This will help Xidorn implement tree pseudos, and in general makes sense, allowing to put specific matching data in a selectors implementation.
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* Fix commonmark Markdown warnings in docs, part 1Matt Brubeck2017-10-171-11/+11
| | | | | | | | Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is passed to rustdoc. This is mostly a global find-and-replace for bare URIs on lines by themselves in doc comments.
* fix unused warningtigercosmos2017-10-171-1/+1
|
* Remove use of unstable box syntax.Simon Sapin2017-10-161-5/+5
| | | | | | | | | | | | | | | | | | | | http://www.robohornet.org gives a score of 101.36 on master, and 102.68 with this PR. The latter is slightly better, but probably within noise level. So it looks like this PR does not affect DOM performance. This is expected since `Box::new` is defined as: ```rust impl<T> Box<T> { #[inline(always)] pub fn new(x: T) -> Box<T> { box x } } ``` With inlining, it should compile to the same as box syntax.
* Auto merge of #18888 - tigercosmos:xml, r=jdmbors-servo2017-10-161-3/+28
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix #18776: use XML fragment serialization for innerHTML in XML documents <!-- Please describe your changes on the following line: --> I am not sure whether my solution is in the right way. @jdm Can you give some advises? --- <!-- 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 - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #18776 (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/18888) <!-- Reviewable:end -->
| * use XML fragment serialization for outerHTML in XML documentstigercosmos2017-10-161-1/+6
| |
| * use XML fragment serialization for innerHTML in XML documentstigercosmos2017-10-161-2/+22
| |
* | Auto merge of #18886 - servo:urls, r=SimonSapinbors-servo2017-10-151-20/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change AttrValue::Url to AttrValue::ResolvedUrl Things make more sense like this. <!-- 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/18886) <!-- Reviewable:end -->
| * | Change AttrValue::Url to AttrValue::ResolvedUrlAnthony Ramine2017-10-151-20/+8
| |/ | | | | | | | | There is actually only one attribute that can use that, the one for <body background>.
* / style: Hide LocalMatchingContext.Emilio Cobos Álvarez2017-10-141-2/+2
|/ | | | | | | | | | | This type is a lot of complexity related to a very specific thing such as the hover and active quirk. Instead of that, move `nesting_level` to `MatchingContext`, and simplify all this computing whether the quirk applies upfront, for each complex selector we test. This is less error-prone, and also allows simplifying more stuff in a bit.
* Remove an unused import, fix a warning.Simon Sapin2017-10-131-2/+1
|
* style: Share code for Element::Closest.Emilio Cobos Álvarez2017-10-131-20/+12
|
* style: Share code for Element::Matches.Emilio Cobos Álvarez2017-10-131-12/+11
|
* Remove usage of unstable feature try_fromSimon Sapin2017-10-121-7/+7
|
* Fix URL attributesAnthony Ramine2017-10-111-12/+21
| | | | | URL attributes should always use AttrValue::Url, and the input should be resolved against the document's base URL at setting time always.
* Auto merge of #18790 - upsuper:scope, r=emiliobors-servo2017-10-091-2/+7
|\ | | | | | | | | | | | | | | | | | | | | Support :scope pseudo-class This fixes [bug 1406817](https://bugzilla.mozilla.org/show_bug.cgi?id=1406817). <!-- 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/18790) <!-- Reviewable:end -->
| * Support :scope pseudo-class in Element::{matches,closest} in ServoXidorn Quan2017-10-091-2/+7
| |
* | ChildrenOnly -> ChildrenOnly(Option<QualName>)Jyotsna Prakash2017-10-071-1/+4
|/ | | | use this updated type from html5ever
* style: Use a SharedFontList object to store font-family values for Gecko.Cameron McCormack2017-10-041-2/+3
|
* Combine ReflowGoal and ReflowQueryTypeMartin Robinson2017-09-301-8/+4
| | | | | This simplifies the logic in the layout_thread and makes it clearer which types of reflows generate display lists and cause display updates.
* Rename Root<T> to DomRoot<T>Anthony Ramine2017-09-261-66/+66
| | | | | | | In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>, where Root<T> will be able to handle all the things that need to be rooted that have a stable traceable address that doesn't move for the whole lifetime of the root. Stay tuned.
* Rename DOMRefCell<T> to DomRefCell<T>Anthony Ramine2017-09-261-16/+16
| | | | | | | | I don't want to do such a gratuitous rename, but with all the other types now having "Dom" as part of their name, and especially with "DomOnceCell", I feel like the other cell type that we already have should also follow the convention. That argument loses weight though when we realise there is still DOMString and other things.
* Rename LayoutJS<T> to LayoutDom<T>Anthony Ramine2017-09-261-3/+3
|
* Rename MutNullableJS<T> to MutNullableDom<T>Anthony Ramine2017-09-261-3/+3
|
* Rename JS<T> to Dom<T>Anthony Ramine2017-09-261-5/+5
|
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-2/+1
|
* Auto merge of #18600 - servo:promises, r=<try>bors-servo2017-09-221-19/+5
|\ | | | | | | | | | | | | | | | | | | | | Improve Promise The elephant 🐘 (not PHP's) still remains in the room: `Rc<Promise>` shouldn't require `#⁠[allow(unrooted_must_root)]`. <!-- 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/18600) <!-- Reviewable:end -->
| * Use Promise::resolve_native in fullscreen tasksAnthony Ramine2017-09-221-13/+3
| |
| * Make Promise::reject_error soundAnthony Ramine2017-09-221-6/+2
| |
* | Implement an nth-index cache.Bobby Holley2017-09-211-0/+4
|/ | | | MozReview-Commit-ID: Ee0um3QXkxl
* Introduce an NthIndexCache type and pipe it from ThreadLocalStyleContext to ↵Bobby Holley2017-09-201-2/+4
| | | | | | MatchingContext. Some future refactoring here to pass fewer things as parameters would be nice.
* Introduce TaskOnceAnthony Ramine2017-09-201-5/+5
| | | | | Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing from CancellableTask<T>.
* Rename Task to TaskBoxAnthony Ramine2017-09-201-5/+5
|
* Auto merge of #18533 - servo:TASKS, r=SimonSapinbors-servo2017-09-181-5/+6
|\ | | | | | | | | | | | | | | Rename Runnable to Task and other improvements <!-- 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/18533) <!-- Reviewable:end -->