Skip to content

Move IFrameLoadInfo struct and IFrameSandboxState enum to script_traits #8841

Closed

Description

@jdm

These are only used by code in compositing/ and script/, so they're prime candidates for moving into the script_traits/ crate. This will improve the compilation time if we ever need to modify them.

Code: components/msg/constellation_msg.rs, components/script_traits/lib.rs

Activity

  1. added
    E-less-complex
    I-refactor
    on Dec 5, 2015
  2. fstr commented on Dec 7, 2015

    @fstr

    I'd like to do this one.

    Is this a duplicate of #8839 ?

  3. KiChjang commented on Dec 7, 2015

    @KiChjang
    Contributor

    This is more inclusive than #8839, but thanks for telling us! This issue is yours.

  4. added
    C-assigned
    on Dec 7, 2015
  5. fstr commented on Dec 7, 2015

    @fstr

    While I'm at it:
    Shouldn't IframeLoadInfo be renamed to IFrameLoadInfo to be consistent?

  6. jdm commented on Dec 7, 2015

    @jdm
    MemberAuthor

    Yep!

  7. fstr commented on Dec 7, 2015

    @fstr

    The script_traits component requires the msg component.
    https://github.com/servo/servo/blob/master/components/script_traits/Cargo.toml#L11

    The msg component components/msg/constellation_msg.rs requires the IframeLoadInfo though, which was now moved to the scripts_traits component.
    https://github.com/servo/servo/blob/master/components/msg/constellation_msg.rs#L299

    This causes a cyclic package dependency. Now I'm not sure how to resolve it.

  8. KiChjang commented on Dec 7, 2015

    @KiChjang
    Contributor

    Create a trait, say, LoadInfo in constellation_msg.rs, and change ScriptLoadedURLInFrame to instead take in a LoadInfo as its parameter. Then do impl LoadInfo for IFrameLoadInfo (which should now be located at script_traits).

  9. jdm commented on Dec 8, 2015

    @jdm
    MemberAuthor

    Ack, you're right, I missed that dependency. A trait is overkill for this; thanks for investigating though!

  10. jdm commented on Jan 9, 2016

    @jdm
    MemberAuthor

    Now that #8833 and #8835 are solved, the problems mentioned earlier no longer exist.

  11. reopened this on Jan 9, 2016
  12. removed
    C-assigned
    on Jan 9, 2016
  13. fmarts commented on Jan 11, 2016

    @fmarts
    Contributor

    Can I pick this one?

    IFrameSandboxState is lacking documentation, so when I move it to script_traits/lib.rs the compiler will complain as this lib has the attribute #![deny(missing_docs)] at the top. Should I leave as it is and add a #[warn(missing_docs)] on IFrameSandboxState enum?

  14. added
    C-assigned
    on Jan 11, 2016
  15. jdm commented on Jan 11, 2016

    @jdm
    MemberAuthor

    You can add /// Whether the sandbox attribute is present for an iframe element.

  16. fmarts commented on Jan 11, 2016

    @fmarts
    Contributor

    Cool, thanks, wasn't sure what to put. Will run the tests and send PR 👍

  17. jdm commented on Jan 11, 2016

    @jdm
    MemberAuthor

    There shouldn't be any need to run tests - if it builds, that's good enough for a refactor like this that just involves moving code around.

  18. added a commit that references this issue on Jan 11, 2016
    fed41a4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-assignedE-less-complexI-refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions