aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface/wrapper_traits.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move `*_traits` and other shared types to `shared`Martin Robinson2023-11-031-497/+0
| | | | | | | | | | | | This is the start of the organization of types that are in their own crates in order to break dependency cycles between other crates. The idea here is that putting these packages into their own directory is the first step toward cleaning them up. They have grown organically and it is difficult to explain to new folks where to put new shared types. Many of these crates contain more than traits or don't contain traits at all. Notably, `script_traits` isn't touched because it is vendored from Gecko. Eventually this will move to `third_party`.
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-14/+8
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-0/+3
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Combine DOM-related concepts in Layout 2020 into dom.rsMartin Robinson2023-05-131-1/+6
|
* Remove DangerousThreadSafeLayoutNodeMartin Robinson2023-05-121-8/+0
| | | | | | Remove this trait and replace it by two non-public functions on ServoThreadSafeLayoutNode. This requires making the iterator not generic, which simplifies things a little bit as well.
* Simplify our setup for font metric queries from styleOriol Brufau2023-05-111-3/+0
| | | | | | | | This is a backport of https://phabricator.services.mozilla.com/D157589, by Emilio Cobos Álvarez, plus some additions so that Servo compiles, and some parts from https://phabricator.services.mozilla.com/D144455. Should have no change in behavior.
* Eliminate duplicate Layout DOM wrappersMartin Robinson2023-05-051-0/+2
| | | | | | | | | | There are duplicate sets of Layout DOM wrappers: one for Layout 2013 and one for Layout 2020. As part of cleaning up and simplifying the wrappers, this change parameterizes them on the specific layout data they contain. This allows them to be shared again. In addition, various small cleanups are included. Fixes #29691.
* Detect body elements during layoutMartin Robinson2023-05-041-0/+10
| | | | | | | | | | | | | | | | | During layout it is often useful, for various specification reasons, to know if an element is the `<body>` element of an `<html>` element root. There are a couple places where a brittle heuristic is used to detect `<body>` elements. This information is going to be even more important to properly handle `<html>` elements that inherit their overflow property from their `<body>` children. Implementing this properly requires updating the DOM wrapper interface. This check does reach up to the parent of thread-safe nodes, but this is essentially the same kind of operation that `parent_style()` does, so is ostensibly safe. This change should not change any behavior and is just a preparation step for properly handle `<body>` overflow.
* Replace OpaqueStyleAndLayoutData by StyleAndOpaqueLayoutDataAnthony Ramine2020-04-061-9/+9
|
* Rename a bunch of style/layout data itemsAnthony Ramine2020-04-061-8/+13
| | | | | | | | | | | | | GetLayoutData::get_style_and_layout_data becomes GetOpaqueStyleAndLayoutData::get_opaque_style_and_layout_data. GetRawData::get_raw_data becomes GetStyleAndLayoutData::get_style_and_layout_data. LayoutNode::init_style_and_layout_data becomes LayoutNode::init_opaque_style_and_layout_data. LayoutNode::take_style_and_layout_data becomes LayoutNode::take_opaque_style_and_layout_data.
* Make DOM own the style and layout data, in an UnsafeCellAnthony Ramine2020-04-041-2/+2
| | | | The previous Cell was a lie.
* Make LayoutNodeHelpers::text_content return a cowAnthony Ramine2020-03-311-1/+2
|
* Add a 'dom lifetime to GetLayoutDataAnthony Ramine2020-03-261-25/+22
|
* Fix some warnings new in Rust NightlySimon Sapin2019-11-081-3/+0
|
* Run rustfmtSimon Sapin2019-08-241-3/+2
|
* Only allow UA widgets as children of media elementsFernando Jiménez Moreno2019-07-221-0/+2
| | | | Do not allow pseudo-elements for replaced elements
* style: Do not use borrowed types in the selectors::Element trait.Evgeniy Reizner2019-06-041-3/+3
| | | | | Closes #22972 Closes #23463
* Move is_connected function from style to layout, where it is usedFernando Jiménez Moreno2019-04-261-0/+3
|
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-1/+1
|
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Reorder importsPyfisch2018-11-061-3/+3
|
* Format remaining filesPyfisch2018-11-061-1/+2
|
* Sort `use` statementsSimon Sapin2018-11-061-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-061-5/+5
|
* Make layout use available image data before querying the image cache.Josh Matthews2018-10-121-0/+5
|
* layout: add media_data() method to ThreadSafeLayoutNode traitVíctor Manuel Jáquez Leal2018-10-081-0/+3
|
* Auto merge of #21687 - AnshulMalik:format-script_layout, r=jdmbors-servo2018-09-131-62/+97
|\ | | | | | | | | | | | | | | | | | | | | format script_layout_interface - [x] `./mach test-tidy` does not report any errors <!-- 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/21687) <!-- Reviewable:end -->
| * format script_layout_interfaceAnshul Malik2018-09-121-62/+97
| |
* | Current-pixel-density tests passingpaavininanda2018-09-131-0/+3
|/
* selectors: Remove the get_ prefix from get_local_name and get_namespace.Emilio Cobos Álvarez2018-02-241-4/+4
|
* Update WebRenderMartin Robinson2018-02-061-3/+3
| | | | | | | | | This allows servo to use the ExternalScrollId API from WebRender fixing some issues related to duplicate scroll root ids. Fixes #17176. Fixes #19287. Fixes #19648.
* style: Use CascadeFlags for what they're for.Emilio Cobos Álvarez2018-01-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have an Element around on cascade, we can stop using the cascade flags mechanism to pass various element-related state, like "is this element the root", or "should it use the item-based display fixup". That fixes handwaviness in the handling of those flags from style reparenting, and code duplication to handle tricky stuff like :visited. There are a number of other changes that are worth noticing: * skip_root_and_item_based_display_fixup is renamed to skip_item_display_fixup: TElement::is_root() already implies being the document element, which by definition is not native anonymous and not a pseudo-element. Thus, you never get fixed-up if your NAC or a pseudo, which is what the code tried to avoid, so the only fixup with a point is the item one, which is necessary. * The pseudo-element probing code was refactored to return early a Option::<CascadeInputs>::None, which is nicer than what it was doing. * The visited_links_enabled check has moved to selector-matching time. The rest of the checks aren't based on whether the element is a link, or are properly guarded by parent_style.visited_style().is_some() or visited_rules.is_some(). Thus you can transitively infer that no element will end up with a :visited style, not even from style reparenting. Anyway, the underlying reason why I want the element in StyleAdjuster is because we're going to implement an adjustment in there depending on the tag of the element (converting display: contents to display: none depending on the tag), so computing that information eagerly, including a hash lookup, wouldn't be nice.
* style: Derive debug for CascadeInputs.Emilio Cobos Álvarez2018-01-231-4/+6
| | | | It no longer has anything than rules.
* style: Make the TElement type arrive to the `cascade` function.Emilio Cobos Álvarez2018-01-231-4/+9
| | | | | | | | | | | | | | | | | Not super-proud of this one, but it's the easiest way I could think of. The changeset looks bigger than what it is, because while at it I've rewrapped a fair amount of functions around to use proper block indentation. Alternatives are parameterizing Stylist by <E>, which is not fun, or moving the concrete element from layout_thread to layout, but that implies layout depending on script, which isn't fun either. Other alternative is implementing an empty enum and making anon boxes work on it. It has the advantage of removing the annoying type parameter, but the disadvantage of instantiating `cascade` twice, which isn't great, and having to maintain all the boilerplate of a `TElement` implementation that just does nothing.
* layout: Deduplicate Node::fragment_type and ↵Emilio Cobos Álvarez2018-01-141-7/+11
| | | | FragmentDisplayListBuilding::fragment_type.
* layout: Remove type parameter from PseudoElementType.Emilio Cobos Álvarez2018-01-141-33/+23
| | | | Everyone uses () now.
* style: Remove unused optional display from PseudoElementType definition.Emilio Cobos Álvarez2018-01-141-8/+7
| | | | Everyone passes None now.
* layout: Stop overriding display of the ::-servo-details-content pseudo-element.Emilio Cobos Álvarez2018-01-141-7/+3
| | | | | | | We only override it when there's no "open" attribute. But a display: none pseudo-element is the same as no pseudo-element at all. This should get the same behavior when iterating children in dom_wrapper.rs
* style: Remove some unneeded indirection.Emilio Cobos Álvarez2018-01-101-15/+13
| | | | | | | | | All TElement's implement Copy, and are just pointers, so the double indirection is stupid. I'm going to try to see if removing this double-indirection fixes some selector-matching performance, and this is a trivial pre-requisite while I wait for Talos results.
* style: Remove TNode::set_can_be_fragmented and TNode::can_be_fragmented.Emilio Cobos Álvarez2018-01-041-2/+0
| | | | | Replace them instead by a computed value flag, the same way as the IS_IN_DISPLAY_NONE_SUBTREE flag works.
* style: Make all keywords CamelCase for consistency.Emilio Cobos Álvarez2017-12-061-5/+5
| | | | This prevents confusion and paves the ground for derive(Parse) of them.
* style: Remove PresentationalHintsSynthesizer.Emilio Cobos Álvarez2017-10-261-5/+9
| | | | This is not really an useful abstraction, and I never knew how to spell it.
* Implement XUL tree pseudo style resolution for stylo.Xidorn Quan2017-10-201-1/+2
|
* style: Remove a few unused functions.Emilio Cobos Álvarez2017-10-171-12/+0
|
* style: Refactor children handling.Emilio Cobos Álvarez2017-10-171-8/+0
| | | | | Moving traversal_children away from TNode I can make TNode trivial enough, in order to share a QuerySelector implementation between Servo and Gecko.
* Rename LayoutJS<T> to LayoutDom<T>Anthony Ramine2017-09-261-1/+1
|
* Remove sources of panic when laying out an iframe without a nested browsing ↵Alan Jeffrey2017-09-221-4/+4
| | | | context.
* order derivable traits listsClément DAVID2017-08-231-1/+1
| | | | | | Ignoring : - **generated**.rs - python/tidy/servo_tidy_tests/rust_tidy.rs
* Replace all uses of the style::stylearc alias with servo_arc.Michael Partheil2017-07-191-1/+1
| | | | | | The alias is left there temporarilly and will be removed completely in a later commit where also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still use the old alias).
* style: Cleanup most of the Inner mess.Emilio Cobos Álvarez2017-07-181-2/+2
| | | | MozReview-Commit-ID: Ieg2GJT0yUl