You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Move IFrameLoadInfo struct and IFrameSandboxState enum to script_traits #8841
C-assignedThere is someone working on resolving the issueE-less-complexStraightforward. Recommended for a new contributor.I-refactorNo impact; the issue is one of maintainability or tidiness. Proposed solution requires refactoring.
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.
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).
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?
C-assignedThere is someone working on resolving the issueE-less-complexStraightforward. Recommended for a new contributor.I-refactorNo impact; the issue is one of maintainability or tidiness. Proposed solution requires refactoring.
Activity
fstr commentedon Dec 7, 2015
I'd like to do this one.
Is this a duplicate of #8839 ?
KiChjang commentedon Dec 7, 2015
This is more inclusive than #8839, but thanks for telling us! This issue is yours.
fstr commentedon Dec 7, 2015
While I'm at it:
Shouldn't IframeLoadInfo be renamed to IFrameLoadInfo to be consistent?
jdm commentedon Dec 7, 2015
Yep!
fstr commentedon Dec 7, 2015
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.rsrequires 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.
KiChjang commentedon Dec 7, 2015
Create a trait, say,
LoadInfoinconstellation_msg.rs, and changeScriptLoadedURLInFrameto instead take in aLoadInfoas its parameter. Then doimpl LoadInfo for IFrameLoadInfo(which should now be located atscript_traits).jdm commentedon Dec 8, 2015
Ack, you're right, I missed that dependency. A trait is overkill for this; thanks for investigating though!
jdm commentedon Jan 9, 2016
Now that #8833 and #8835 are solved, the problems mentioned earlier no longer exist.
fmarts commentedon Jan 11, 2016
Can I pick this one?
IFrameSandboxStateis lacking documentation, so when I move it toscript_traits/lib.rsthe 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)]onIFrameSandboxStateenum?jdm commentedon Jan 11, 2016
You can add
/// Whether the sandbox attribute is present for an iframe element.fmarts commentedon Jan 11, 2016
Cool, thanks, wasn't sure what to put. Will run the tests and send PR 👍
jdm commentedon Jan 11, 2016
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.
Auto merge of #9257 - fmmartins:refactor-scripttraits, r=jdm