aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/layout_wrapper.rs
Commit message (Collapse)AuthorAgeFilesLines
* Pull decls from Gecko for link preshintsJ. Ryan Stinnett2017-06-021-3/+7
| | | | | | | Based on a link's active state and the visited handling mode, pull in link, vlink, and alink preshint declaration blocks from Gecko as needed. MozReview-Commit-ID: A6udMYbzQnK
* Auto merge of #17025 - emilio:layout-data, r=jdmbors-servo2017-05-251-7/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | script/layout: Stop doing unsafe transmutes between refcell references. This commit splits the style and layout data in two separate refcells. These transmutes have been a source of trouble (for example on Android), and they feel like a hack anyway. Fixes #16982 <!-- 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/17025) <!-- Reviewable:end -->
| * layout: Stop doing unsafe transmutes between refcell references.Emilio Cobos Álvarez2017-05-251-7/+5
| | | | | | | | | | | | | | | | | | This commit splits the style and layout data in two separate refcells. These transmutes have been a source of trouble (for example on Android), and they feel like a hack anyway. Fixes #16982
* | Look for relevant links while matchingJ. Ryan Stinnett2017-05-241-11/+23
|/ | | | | | | | | | | | | | | | | Adjust the matching process to look for a "relevant link" while matching. A "relevant link" is the element being matched if it is a link or the nearest ancestor link. Matching for links now depends on the `VisitedHandlingMode`, which determines whether all links match as if they are unvisited (the default) or if the relevant link matches as visited (and all others remain unvisited). If a relevant link is ever found for any selector, track this as part of the `MatchingContext` object. This is used in the next patch to determine if an additional match and cascade should be performed to compute the styles when visited. MozReview-Commit-ID: 3xUbRo7vpuD
* layout: Stop mutating the style data from layout.Emilio Cobos Álvarez2017-05-211-2/+4
| | | | | | | | | | | | | | | This is part of #16982. Right now we have some code that tries to cache stuff in the style data during layout. This code is extremely rarely executed, only for `<details>` and `<summary>`. I think if we really really want to cache these, we should find a place in the layout data for it. For now, let's move it away (and all the other layout code) from mutating the style data from layout.
* Trigger restyle if important rules are changed.Boris Chiou2017-05-201-1/+4
| | | | | | | | | | | | | | If we add/remove important rules, we may need to update a list of all important rules (in Gecko) which overrides animation properties. Therefore, we need to set a flag if we update the primary rules which includes important ones. If we have animations on this element, we update its effect properties, and also send a task to update cascade results. Calling get_properties_overriding_animations() might cases some impact on performance because we need to walk the rule tree, so if possible, we could just store this set into TNode to avoid finding the properties for both old and new rules each time. This could be a future work if necessary.
* ol[type=…] and li[type=…] preshints need to be case-sensitiveSimon Sapin2017-05-181-1/+4
|
* Remove unused selectors::Element::each_classSimon Sapin2017-05-181-18/+13
|
* Shrink selectors::Component, add case-insensitive for other attr selectorsSimon Sapin2017-05-181-8/+7
| | | | | * https://bugzilla.mozilla.org/show_bug.cgi?id=1364148 * https://bugzilla.mozilla.org/show_bug.cgi?id=1364162
* Simplify rust-selectors API for attribute selectorsSimon Sapin2017-05-181-42/+53
|
* Auto merge of #16909 - emilio:simplify-cascade, r=bholleybors-servo2017-05-171-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | style: Refactor the cascade function. The `cascade_primary_or_pseudo` function was nice when we shared more code, but right now I think it just makes it harder to understand what's going on. <!-- 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/16909) <!-- Reviewable:end -->
| * style: Refactor the cascade function.Emilio Cobos Álvarez2017-05-171-2/+2
| | | | | | | | | | The `cascade_primary_or_pseudo` function was nice when we shared more code, but right now I think it just makes it harder to understand what's going on.
* | Bug 1364850: Move PseudoElement to be just another combinator in selectors. ↵Emilio Cobos Álvarez2017-05-171-0/+16
|/ | | | | | | r=bholley MozReview-Commit-ID: 8OoOIodkKJ5 Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* Auto merge of #16876 - asajeffrey:constellation-rename-frames, r=cbrewsterbors-servo2017-05-161-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed constellation::Frame to constellation::BrowsingContext <!-- Please describe your changes on the following line: --> Now that script has `WindowProxy` rather than `BrowsingContext` objects, we can rename `Frame` in the constellation to `BrowsingContext`. In particular, this means that `FrameId`s are now `BrowsingContextid`s, which better captures their purpose (and they are used in a lot of places, not just the constellation). --- <!-- 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 do not require tests because renaming <!-- 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/16876) <!-- Reviewable:end -->
| * Renamed constellation::Frame to constellation::BrowsingContext.Alan Jeffrey2017-05-151-3/+3
| |
* | Create a MatchingContext to group related matching argsJ. Ryan Stinnett2017-05-161-3/+3
|/ | | | MozReview-Commit-ID: 7XZTn7HDXrm
* Auto merge of #16506 - cbrewster:about_chaos, r=asajeffreybors-servo2017-05-121-1/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make non-initial about:blank loads async <!-- Please describe your changes on the following line: --> --- <!-- 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 #14856 (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/16506) <!-- Reviewable:end -->
| * Make non-initial about:blank loads asynchronousConnor Brewster2017-05-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't update iframe pipeline until load completes To preserve the previous functionality of delaying load events when a new navigation is triggered, pending pipeline id represents the current pending load. The load event is only fired if the load message's pipeline id matches the pending pipeline id. Track frame size on Frame instead of Pipeline Disabled matchMedia test Track creator pipeline id
* | Auto merge of #16785 - aethanyc:fix-typo-and-simplify, r=mbrubeckbors-servo2017-05-121-3/+3
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | Fix typo and simplify for PresentationalHintsSynthesizer <!-- 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 do not require tests because it only affects build. <!-- 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/16785) <!-- Reviewable:end -->
| * Fix typo for PresentationalHintsSynthesizerTing-Yu Lin2017-05-101-3/+3
| |
* | Bug 1355343: Take all the snapshots into account. r=bholleyEmilio Cobos Álvarez2017-05-101-0/+21
|/ | | | | | | | | | | | | | | | | I've chosen this approach mainly because there's no other good way to guarantee the model is correct than holding the snapshots alive until a style refresh. What I tried before this (storing them in a sort of "immutable element data") is a pain, since we call into style from the frame constructor and other content notifications, which makes keeping track of which snapshots should be cleared an which shouldn't an insane task. Ideally we'd have a single entry-point for style, but that's not the case right now, and changing that requires pretty non-trivial changes to the frame constructor. MozReview-Commit-ID: FF1KWZv2iBM Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* Upgrade to rustc 1.19.0-nightly (ced823e26 2017-05-07)Simon Sapin2017-05-081-2/+2
|
* Auto merge of #16689 - servo:m5e, r=noxbors-servo2017-05-031-1/+1
|\ | | | | | | | | | | | | | | Upgrade to html5ever 0.16 <!-- 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/16689) <!-- Reviewable:end -->
| * Upgrade to html5ever 0.16Simon Sapin2017-05-021-1/+1
| |
* | Fix up script and layout.Bobby Holley2017-05-021-1/+1
|/
* Bug 1331047: Implement the new traversal semantics for stylo. r=bholley,hiroEmilio Cobos Álvarez2017-04-271-6/+6
| | | | | MozReview-Commit-ID: 4BXx9JpGZKX Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* Bug 1341372 - Part 2: Support has_css_transitions.Boris Chiou2017-04-171-0/+4
| | | | | | | | Add one FFI to check if there is any transition in CSSTransitionCollection. This will be used to check if we need to update transition and if we should compute the after-change style. MozReview-Commit-ID: 6HpVAtrx6Rc
* Store slow selector flags in a hashmap.Bobby Holley2017-04-131-0/+9
| | | | | This reduces the flag setting overhead on a pessimal testcase from over a second to ~20ms.
* stylo: Store font metrics provider in thread local style contextManish Goregaokar2017-04-091-0/+3
|
* Auto merge of #16096 - stshine:die-modify-style-die, r=emiliobors-servo2017-04-011-10/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use Servo-specific pseudo elements for anonymous box and text <!-- Please describe your changes on the following line: --> Use some fake pseudo elements to style servo-specific boxes in servo. Also, Since for nested inline elements non-inheritable properties are properly stored in the inline context of an inline fragment, so get rid of them on the style using empty pseudo to do cascading. --- <!-- 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 #5625 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because refactoring <!-- 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/16096) <!-- Reviewable:end -->
| * Use empty pseudo to cascade only inheritable properties for textPu Xingyu2017-04-011-10/+1
| | | | | | | | | | | | Since for nested inline elements non-inheritable properties are properly stored in the inline context of an inline fragment, so get rid of them on the style.
* | style: Make the servo and gecko implementations of Element::note_descendants ↵Emilio Cobos Álvarez2017-03-311-8/+16
|/ | | | equivalent.
* Centralize note_dirty_descendants implementation, and fully propagate ↵Bobby Holley2017-03-271-14/+6
| | | | | | | | | dirty_descendants in resolve_style. The current code can leave the tree in an inconsistent state, with the dirty descendants bit not fully propagated. MozReview-Commit-ID: ALI6etmlrDa
* Introduce UpdateAnimationTasks to perform a bunch of animation's tasks in a ↵Hiroyuki Ikezoe2017-03-271-4/+0
| | | | | | | | | | SequentialTask. The UpdateAnimationsTasks is a bitflags and each bit is generated from Gecko's UpdateAnimationsTasks (enum class) values for matching values between C++ and Rust. For this reason, the bitflags is annotated as (feature = "gecko"), as a result update_animations() which uses this bitflags also became gecko-only function.
* Add an FFI to check that a given (pseudo-) element has any type of ↵Hiroyuki Ikezoe2017-03-271-0/+4
| | | | | | | animations or not. If an element has any type of animations in match_elements(), we need to call UpdateEffectProperties() to update KeyframeEffectReadOnly::mProperties.
* Bug 1345950: stylo: Fix slow selector flags. r=bholleyEmilio Cobos Álvarez2017-03-221-8/+14
| | | | | MozReview-Commit-ID: QwuSxulNG0 Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
* Making a few lines in layout_wrapper.rs a bit nicer.Elliott Pardee2017-03-201-5/+6
|
* Move all PropertyDeclarationBlock from RwLock<_> to Locked<_>Simon Sapin2017-03-191-3/+2
|
* Replace RwLock<MediaList> with shared_lock::Locked<MediaList>Simon Sapin2017-03-191-0/+5
|
* Bug 1340683 - stylo: Implement the :-moz-any pseudo-classMatt Brubeck2017-03-161-3/+9
|
* Skip update_animations if we have no running animations and the element ↵Hiroyuki Ikezoe2017-03-101-0/+4
| | | | becomes display:none.
* Update CSS animations in a SequentialTask.Hiroyuki Ikezoe2017-03-101-0/+4
| | | | | | | | | | | | | We create the SequentialTask only if: * We have no old computed values and we have animation name style in the new computed values. * Any animation properties is changed. * display property is changed from 'none' and we have animation name style. * display property is changed to 'none'. In a subsequent patch we skip the SequentialTask if we have no running animations and the display propery is changed to 'none'.
* ext. filtering for lang matchingSendilKumar N2017-03-071-2/+2
|
* Use more idiomatic constructioncrypto-universe2017-03-031-11/+4
| | | | | or_else in more idiomatic rust construction than match, where Some(x) => Some(x)
* Support lang pseudo classKeith Yeung2017-02-271-0/+5
|
* Clean up and simplify the accumulation of restyle damage.Bobby Holley2017-02-101-2/+2
|
* Allow the ComputedValues in ComputedStyle to be null.Bobby Holley2017-02-101-1/+1
| | | | | This is necessary to start synthesizing the styles in match_element and avoid round-tripping them through the caller.
* Bug 1336646 - Apply selector flags during traversal. r=emilioBobby Holley2017-02-081-5/+13
|
* Update selectors to 0.17Anthony Ramine2017-02-071-3/+3
|
* Bug 1325734 - Remove Servo Layout's dependency on the initial-ness of the ↵Bobby Holley2017-01-091-10/+4
| | | | style. r=emilio