aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/query.rs
Commit message (Collapse)AuthorAgeFilesLines
* Properly handle scroll offsets in hit testingMartin Robinson2017-05-161-2/+2
| | | | | | | | | | | | Scroll roots are no longer nested containers holding items, so instead we need to track the offsets of each, carefully handling fixed position items and stacking contexts that create new reference frames. Additionally, we remove the complexity of the pre-computed page scroll offset, instead opting to send script scrolls to the layout task in order to more quickly have a ScrollState there that matches the script's idea of the scroll world. Fixes #16405.
* Send information to script as part of finishing layout.Josh Matthews2017-05-151-20/+0
| | | | | | | This avoids the need for multiple layout RPC operations immediately following return of control to script. This means that layout and script can continue to operate in parallel at this point, rather than one potentially waiting on the shared mutex to be unlocked.
* Root nodes for the duration of their CSS transitions.Josh Matthews2017-05-151-0/+9
| | | | | | | | This ensures that we can pass a node address as part of the asynchronous transition end notification, making it safe to fire the corresponding DOM event on the node from the script thread. Without explicitly rooting this node when the transition starts, we risk the node being GCed before the transition is complete.
* style: Slim down SharedStyleContext.Emilio Cobos Álvarez2017-05-111-4/+0
| | | | | | | | | | | This slims down SharedStyleContext, in preparation for a few things. First, I would like to eventually move the stylist to the document in Servo, in order for it to hold the StyleSheetSet. Also, this gets rid of a fair amount of overhead while creating it in stylo. Fixes bug 1363245.
* Fix up script and layout.Bobby Holley2017-05-021-1/+1
|
* stylo: support all overflow valuesManish Goregaokar2017-04-251-1/+1
| | | | MozReview-Commit-ID: 1iQdUDsb6u9
* Eliminate ScrollRootIdMartin Robinson2017-04-201-4/+7
| | | | | | | Just use WebRender's ClipId directly. This will allow us to create and use ReferenceFrames in the future, if we need to do that. It will also make it easier to have Servo responsible for creating the root scrolling area, which will allow removing some old hacks in the future.
* s/nodes_from_point/nodes_from_point_response and change test from reftest to ↵Fernando Jiménez Moreno2017-03-021-1/+1
| | | | regular test checking only the fixed crash
* Trigger reflow on document.elementsFromPointFernando Jiménez Moreno2017-03-021-29/+9
|
* Make script thread initiate requests for images needed by layout.Josh Matthews2017-02-221-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In support of this goal, the layout thread collects information about CSS images that are missing image data and hands it off to the script thread after layout completes. The script thread stores a list of nodes that will need to be reflowed after the associated network request is complete. The script thread ensures that the nodes are not GCed while a request is ongoing, which the layout thread is incapable of guaranteeing. The image cache's API has also been redesigned in support of this work. No network requests are made by the new image cache, since it does not possess the document-specific information necessary to initiate them. Instead, there is now a single, synchronous query operation that optionally reserves a slot when a cache entry for a URL cannot be found. This reserved slot is then the responsibility of the queryer to populate with the contents of the network response for the URL once it is complete. Any subsequent queries for the same URL will be informed that the response is pending until that occurs. The changes to layout also remove the synchronous image loading code path, which means that reftests now test the same code that non-test binaries execute. The decision to take a screenshot now considers whether there are any outstanding image requests for layout in order to avoid intermittent failures in reftests that use CSS images.
* Bug 1336646 - Apply selector flags during traversal. r=emilioBobby Holley2017-02-081-2/+2
|
* Remove cached thread local context from LayoutContextPu Xingyu2017-02-081-4/+4
| | | | | Remove cached thread local context from LayoutContext, use LayoutContext for assign_inline_sizes(), and simplify the parallel flow traversal code.
* Auto merge of #14839 - Permutatrix:iss-12939, r=emiliobors-servo2017-01-181-24/+89
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make offset parent queries less buggy. <!-- Please describe your changes on the following line: --> Offset parent queries, which are used in the getters for HTMLElement's `offsetParent`, `offsetTop`, `offsetLeft`, `offsetWidth`, and `offsetHeight`, are pretty busted. The most egregious bug is that, as reported in #12939, inline elements are treated as if they're not present in the document. This PR fixes that and all of the other bugs I could trace directly to the offset parent query code, but `offsetTop` and `offsetLeft` are still unreliable in certain circumstances for reasons I haven't looked into (#13708). Inline elements with no content are still treated as not present due to #13982, so #13944 isn't fixed with this PR, either. --- <!-- 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 #12939 and fix #12595 <!-- Either: --> - [X] There are tests for these changes <!-- 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/14839) <!-- Reviewable:end -->
| * Don't take measurements from non-primary fragmentsPermutator2017-01-131-4/+3
| |
| * Use parent padding box, not border boxPermutator2017-01-131-1/+3
| |
| * Broke up some comment lines that were a bit too longPermutator2017-01-131-8/+9
| |
| * Handle hypothetical fragmentsPermutator2017-01-131-4/+14
| |
| * Don't use rposition() and unwrap() to find parent infoPermutator2017-01-131-6/+5
| |
| * Don't store the offset parent's dimensionsPermutator2017-01-131-3/+3
| |
| * "above the root node" -> "below the root node"Permutator2017-01-131-1/+1
| |
| * Made assertions more helpfulPermutator2017-01-131-4/+6
| |
| * Actually, node_position probably won't be needed later.Permutator2017-01-131-12/+4
| | | | | | | | This is why you shouldn't make assumptions about what you'll need later!
| * Split 123-character linePermutator2017-01-131-5/+6
| |
| * Use InlineFragmentNodeFlags in ParentOffsetBorderBoxIteratorPermutator2017-01-131-11/+28
| |
| * Assert self.node_offset_box is None if fragment.node == self.node_addressPermutator2017-01-131-0/+4
| |
| * Replaced trivial pattern matching with is_none() and is_some()Permutator2017-01-131-8/+6
| |
| * Don't crash when offset parent querying an element not in the documentPermutator2017-01-131-5/+4
| |
| * offsetParent queries now basically work on inline nodes.Permutator2017-01-131-13/+52
| |
| * Fixed ParentOffsetBorderBoxIterator's keeping track of parentsPermutator2017-01-131-7/+7
| |
| * Added assertion to process_offset_parent_queryPermutator2017-01-131-0/+2
| |
* | layout: Expose whether the element was rendered in content_box_query to script.Emilio Cobos Álvarez2017-01-171-6/+3
| | | | | | | | But don't change the API yet.
* | gfx: Don't mutate the same point multiple times while translating it to ↵Emilio Cobos Álvarez2017-01-161-2/+2
|/ | | | | | other stacking context space. I don't know how neither review or a test caught this.
* Position insertion point in input field with mouseFlorian Merz2017-01-111-3/+13
|
* style: Add a special, explicit path for lazy style resolution and use it for ↵Bobby Holley2016-12-281-29/+34
| | | | | | GetComputedStyle. MozReview-Commit-ID: KAM9mVoxCHE
* Introduce and use Scoped TLS.Bobby Holley2016-12-211-4/+3
| | | | | | | | | | | | | | | | It turns out that it's problematic to embed ThreadLocalStyleContext within LayoutContext, because parameterizing the former on TElement (which we do in the next patch) infects all the traversal stuff with the trait parameters, which we don't really want. In general, it probably makes sense to use separate scoped TLS types for the separate DOM and Flow tree passes, so we can add a different ScopedTLS type for the Flow pass if we ever need it. We also reorder the |scope| and |shared| parameters in parallel.rs, because it aligns more with the order in style/parallel.rs. I did this when I was adding a TLS parameter to all these functions, which I realized we don't need for now.
* Make the DomTraversalContext own the SharedStyleContext and share it ↵Bobby Holley2016-12-161-8/+15
| | | | | | | | | | immutably across the traversal. This allows us to get rid of a bunch of lifetimes and simplify a lot of code. It also lets us get rid of that nasty lifetime transmute, which is awesome. The situation with thread-local contexts is still suboptimal, but we fix that in subsequent patches.
* Use PropertyId instead of Atom for CSSStyleDeclaration::get_computed_styleSimon Sapin2016-12-091-39/+47
|
* Reimplement scrolling to fragmentsMartin Robinson2016-11-291-1/+16
| | | | | | | | This reimplemntation of the feature uses ScrollRootIds to scroll particular scrollable areas of the page. Fixes #13736. Fixes #10753.
* Bug 1317016 - Basic infrastructure for RestyleHint-driven traversal.Bobby Holley2016-11-241-22/+23
| | | | MozReview-Commit-ID: 7wH5XcILVmX
* Rename selector_impl.rs to selector_parser.rsSimon Sapin2016-11-201-1/+1
| | | | This makes it consistent with an upcoming update of the selectors crate.
* Rename selector_matching.rs to stylist.rsSimon Sapin2016-11-201-1/+1
|
* Prefer Servo-specific ToCss for all typesRavi Shankar2016-11-071-1/+1
|
* Update to string-cache 0.3Simon Sapin2016-11-031-1/+1
|
* Move core pseudo-element handling to ThreadSafeLayoutElement.Bobby Holley2016-10-281-16/+16
|
* Move all *MatchMethods to TElement.Bobby Holley2016-10-271-2/+2
| | | | MozReview-Commit-ID: 3V6JIlOVVhw
* Remove concept of Layers from ServoMartin Robinson2016-10-211-17/+2
| | | | | | | | Layers were a feature of the legacy drawing path. If we re-add them at some point, it probably makes more sense to make them a product of display list inspection. This change also remove a bunch of dead painting code.
* Remove borrow_data and mutate_data from TNode.Bobby Holley2016-10-101-1/+1
| | | | | The new restyle architecture doesn't store these things in consistent places, so we need a more abstract API.
* Pass &mut Flow to query functions.Ms2ger2016-08-251-16/+15
|
* Pass a &mut Flow to iterate_through_flow_tree_fragment_border_boxes.Ms2ger2016-08-251-8/+8
|
* Auto merge of #12813 - emilio:hit-test, r=notriddlebors-servo2016-08-111-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dom: getElementsFromPoint does the hit testing on viewport coordinates. <!-- 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 <!-- Either: --> - [x] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> We got this wrong (I think it wasn't my fault actually), I was just writing a test for #12777 when I found 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/12813) <!-- Reviewable:end -->