Crate split phase 2: extract stylo_common (parser context, shared lock, error reporting, atoms, gecko bindings) - #7
Draft
nicoburns wants to merge 3 commits into
Conversation
…e, use_counters, UrlExtraData, gecko bindings
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second layer of the crate split (stacked on #6). Adds a new
stylo_commoncrate (lib namestyle_common) sitting betweenstylo_traitsandstyle, holding the implementation-support code that can't live instylo_traitsbecause it depends on gecko bindings or engine support types:The
stylecrate re-exports everything at the old paths (style::parser,style::error_reporting,style::shared_lock,style::Atom, ...), so the public API is unchanged.Decoupling changes needed to make the layer acyclic:
error_reportingno longer references the engine's concreteSelectorImpl: the selector-warning visitors are now generic overselectors::parser::SelectorImpl, andContextualParseError::UnsupportedPropertyDeclarationstores precomputedVec<SelectorWarningKind>(via newSelectorWarningKind::from_selector_lists) instead of&[SelectorList<SelectorImpl>].parser.rsusesselectors::matching::QuirksModedirectly instead of thecrate::contextre-export.Parseis now a foreign trait tostyle,impl Parse for InitialValue(=Arc<SpecifiedValue>) hit the orphan rule; replaced with a genericimpl<T: Parse> Parse for servo_arc::Arc<T>instylo_commonplusimpl Parse for SpecifiedValueinstyle.ToComputedValue/ToResolvedValue/SpecifiedValueInfoderives from the moved atom types (their traits live above); replaced withtrivial_to_computed_value!/trivial_to_resolved_value!instyleand manualSpecifiedValueInfoimpls.Verified with
cargo check --workspaceandcargo test --workspace --exclude stylo(thestylotest target fails onmainfor a preexisting pseudo-element issue). Gecko-feature code was moved cfg-intact but can't be compile-verified outside mozilla-central.Link to Devin session: https://app.devin.ai/sessions/5d2d6be20e724623bdc1bcf7e1687af1
Requested by: @nicoburns