Closed Bug 1268461 Opened 8 years ago Closed 8 years ago

Decouple fronts from stylesheet actors.

Categories

(DevTools :: Inspector, defect, P1)

defect

Tracking

(firefox49 fixed)

RESOLVED FIXED
Firefox 49
Iteration:
49.1 - May 9
Tracking Status
firefox49 --- fixed

People

(Reporter: ejpbruel, Assigned: ejpbruel)

References

Details

Attachments

(5 files)

The stylesheet actors are used by the style actors, so the former have to be decoupled before the latter.
Priority: -- → P1
Blocks: 1263289
Status: NEW → ASSIGNED
Iteration: --- → 49.1 - May 9
Flags: qe-verify?
Whiteboard: [devtools-html]
I didn't realise that the style actors and the style editor actors are separate concepts, so I made this bug a dependency of the wrong bug.
No longer blocks: 1265730
Component: Developer Tools: Style Editor → Developer Tools: Inspector
Blocks: 1268568
I ran into some issues because the order in which the stylesheet actors are defined does not reflect their dependency tree. This patch changes the order in which the stylesheet actors are defined so the leaves of the dependency tree are defined first, their parents next, and so on.
Attachment #8747611 - Flags: review?(jryans)
Try push for the patch to change the order in which the stylesheet actors are defined:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=d26b5eab581d
Attachment #8747620 - Flags: review?(jryans)
Try push for the patch to decouple OriginalSourceFront from OriginalSourceActor:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=db023887cfbb
Attachment #8747620 - Attachment description: Bug 1268461 - Decouple OriginalSourceFront from OriginalSourceActor. → Decouple OriginalSourceFront from OriginalSourceActor.
Attachment #8747650 - Flags: review?(jryans)
Try push for the patch to decouple MediaRuleFront from MediaRuleActor:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=06752aa49934
Attachment #8747651 - Flags: review?(jryans)
Try push for the patch to decouple StyleSheetFront from StyleSheetActor:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b10d5d831740
Attachment #8747653 - Flags: review?(jryans)
Ryan, you already reviewed most of these patches in bug 1265370. I obsoleted them there and reattached them here because we wanted a separate bug for the stylesheet actors.

I am re-requesting review mainly because I had to manually rebase all my patches due to a style change in the code (function() -> function ()), which caused my patches to no longer apply. I tried addressing the merge conflicts automatically using eslint, but unfortunately, that didn't work: even after I update my commit, it is still based on an old commit (which still has function() everywhere), so the resulting diff still doesn't apply. I tried using eslint on the patch directly, but that didn't work either. Even manually search/replacing all instances of function() in my patch didn't make it apply.

You can probably just rubberstamp these patches, but since I had to manually rebase, I wanted to give you an opportunity to re-review.

Needinfo to make sure you're reading this before you start reviewing.
Flags: needinfo?(jryans)
Comment on attachment 8747611 [details] [diff] [review]
Change the order in which the stylesheet actors are defined.

Review of attachment 8747611 [details] [diff] [review]:
-----------------------------------------------------------------

::: devtools/server/actors/stylesheets.js
@@ +267,5 @@
>      return this.conn.getActor(this._form.parentStyleSheet);
>    }
>  });
>  
> +types.addActorType("stylesheet");

Is declaring this type here needed?  Is seems like it should not be, since the next block fully defines the actor for that type.

@@ +978,2 @@
>   */
> +var StyleSheetsActor = exports.StyleSheetsActor = protocol.ActorClass({

This file sets `exports.StyleSheetsActor` twice, so let's remove one of them.

@@ +1186,2 @@
>  
> +XPCOMUtils.defineLazyGetter(this, "DOMUtils", function () {

Move this up to the top of the file where imports are usually found.
Attachment #8747611 - Flags: review?(jryans) → review+
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #12)
> Comment on attachment 8747611 [details] [diff] [review]
> Change the order in which the stylesheet actors are defined.
> 
> Review of attachment 8747611 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: devtools/server/actors/stylesheets.js
> @@ +267,5 @@
> >      return this.conn.getActor(this._form.parentStyleSheet);
> >    }
> >  });
> >  
> > +types.addActorType("stylesheet");
> 
> Is declaring this type here needed?  Is seems like it should not be, since
> the next block fully defines the actor for that type.
> 

This is needed because the stylesheet actor refers to itself, and this is otherwise not possible.

> @@ +978,2 @@
> >   */
> > +var StyleSheetsActor = exports.StyleSheetsActor = protocol.ActorClass({
> 
> This file sets `exports.StyleSheetsActor` twice, so let's remove one of them.
> 
> @@ +1186,2 @@
> >  
> > +XPCOMUtils.defineLazyGetter(this, "DOMUtils", function () {
> 
> Move this up to the top of the file where imports are usually found.

Ok!
Keywords: leave-open
Try push for patch to decouple MediaRuleFront from MediaRuleActor had test failures. New push with issues addressed:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=aa453ae70b92
I introduced an error to the patch to decouple MediaRuleFront from MediaRuleActor, causing the try run to fail. Here is yet another push, with that issue addressed:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=919edd7b2d3b
Running ahead of things a bit, here is another try push for the patch to decouple StyleSheetFront from StyleSheetActor:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=f890054616af
Try push for the patch to decouple StyleSheetFront from StyleSheetActor had test failures due to a missing require. Here is a new try push with that issue addressed:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=9e453ac65ebf
Try push for the patch to decouple StyleSheetsFront from StyleSheets actor:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=69cfe3423d0a
Flags: qe-verify? → qe-verify-
Keywords: leave-open
https://hg.mozilla.org/mozilla-central/rev/9f9f74fa03fe
https://hg.mozilla.org/mozilla-central/rev/9e9cb8b89a10
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
Depends on: 1270186
Blocks: 1277706
No longer blocks: 1263289
Blocks: 1263289
Whiteboard: [devtools-html]
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: