Closed Bug 1447483 Opened 7 years ago Closed 7 years ago

Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle.

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Depends on 1 open bug)

Details

Attachments

(38 files, 4 obsolete files)

1.09 MB, patch
Details | Diff | Splinter Review
577.91 KB, patch
Details | Diff | Splinter Review
126.48 KB, patch
Details | Diff | Splinter Review
1.77 KB, patch
Details | Diff | Splinter Review
780 bytes, patch
Details | Diff | Splinter Review
16.68 KB, patch
Details | Diff | Splinter Review
41.44 KB, patch
Details | Diff | Splinter Review
999 bytes, patch
Details | Diff | Splinter Review
34.20 KB, patch
Details | Diff | Splinter Review
64.11 KB, patch
Details | Diff | Splinter Review
265.35 KB, patch
Details | Diff | Splinter Review
36.75 KB, patch
Details | Diff | Splinter Review
20.29 KB, patch
Details | Diff | Splinter Review
3.98 KB, patch
Details | Diff | Splinter Review
67.22 KB, patch
Details | Diff | Splinter Review
3.47 KB, patch
Details | Diff | Splinter Review
67.80 KB, patch
Details | Diff | Splinter Review
5.34 KB, patch
Details | Diff | Splinter Review
10.92 KB, patch
Details | Diff | Splinter Review
45.44 KB, patch
Details | Diff | Splinter Review
3.78 KB, patch
Details | Diff | Splinter Review
6.62 KB, patch
Details | Diff | Splinter Review
5.25 KB, patch
Details | Diff | Splinter Review
11.09 KB, patch
Details | Diff | Splinter Review
4.75 KB, patch
Details | Diff | Splinter Review
8.15 KB, patch
Details | Diff | Splinter Review
2.38 KB, patch
Details | Diff | Splinter Review
4.78 KB, patch
Details | Diff | Splinter Review
77.06 KB, patch
Details | Diff | Splinter Review
2.62 KB, patch
Details | Diff | Splinter Review
1.78 KB, patch
Details | Diff | Splinter Review
1.12 KB, patch
Details | Diff | Splinter Review
1.06 MB, patch
jwatt
: review+
Details | Diff | Splinter Review
1.71 KB, patch
jwatt
: review+
Details | Diff | Splinter Review
270.20 KB, patch
jwatt
: review+
Details | Diff | Splinter Review
1.10 MB, patch
jwatt
: review+
Details | Diff | Splinter Review
41 bytes, text/x-github-pull-request
Details | Review
1.03 MB, patch
emilio
: review+
Details | Diff | Splinter Review
Depends on: 1447484
Attached patch The patch. (obsolete) — Splinter Review
This is the patch without clang-format, for reference.
Attached patch The patch. (obsolete) — Splinter Review
Attachment #8961076 - Attachment is obsolete: true
Mozreview is timing out when uploading the patches, so will push using splinter.
Note that the unwanted changes under widget/gtk and devtools/ go away in following parts. I'll land the patches squashed.
Attachment #8961088 - Flags: review?(xidorn+moz)
Also completely automated using find + sed. This in combination with the previous patch make nsStyleContext -> ComputedStyle.
Attachment #8961091 - Flags: review?(xidorn+moz)
This leaves ServoStyleContext and nsStyleContext using the same name, since they're going to be merged in following parts.
Attachment #8961092 - Flags: review?(xidorn+moz)
Just moving the files, not build config touched or anything.
Attachment #8961095 - Flags: review?(xidorn+moz)
This was supposed to be in the patch in part 4.
Attachment #8961096 - Flags: review?(xidorn+moz)
This part is manual, though should be mostly straight-forward.
Attachment #8961101 - Flags: review?(xidorn+moz)
(In reply to Emilio Cobos Álvarez [:emilio] from comment #9) > Created attachment 8961101 [details] [diff] [review] > Part 5 - Merge what used to be ServoStyleContext and into ComputedStyle. > > This part is manual, though should be mostly straight-forward. This also makes ComputedStyle be in the mozilla::namespace, btw.
Automatic include fixup for part 5.
Attachment #8961102 - Flags: review?(xidorn+moz)
This will be cleaned in followups to this bug, to make this bug a bit more manageable.
Attachment #8961103 - Flags: review?(xidorn+moz)
Just some manual fixes while I was trying to get this to build.
Attachment #8961104 - Flags: review?(xidorn+moz)
(In reply to Emilio Cobos Álvarez [:emilio] from comment #13) > Created attachment 8961104 [details] [diff] [review] > Part 8 - Minor namespacing fixes and manual cleanups / removals. > > Just some manual fixes while I was trying to get this to build. This also renames nsIFrame::ComputedStyle() to nsIFrame::Style(), since (apart that it's nicer IMO), that prevents name ambiguity.
Automated change to fix a bunch of callers of nsIFrame::ComputedStyle to start calling nsIFrame::Style().
Attachment #8961108 - Flags: review?(xidorn+moz)
This patch is autogenerated. Three replacements under the layout directory in order: s/ComputedStyle\* aContext/mozilla::ComputedStyle* aStyle/g To fix most function signatures. s/Frame(aContext,/Frame(aStyle,/g To fix most delegated constructors. s/mozilla::mozilla::ComputedStyle/mozilla::ComputedStyle/g To fix other callers that I had manually fixed already.
Attachment #8961110 - Flags: review?(xidorn+moz)
These arguments are unused now, and can go away. The patches in Part 10 left the signatures very garbled.
Attachment #8961112 - Flags: review?(xidorn+moz)
Automatically fix another large amount of users of ComputedStyle.
Attachment #8961114 - Flags: review?(xidorn+moz)
Attachment #8961116 - Flags: review?(xidorn+moz)
Automatically fix most construction functions and similar.
Attachment #8961117 - Flags: review?(xidorn+moz)
Had missed this before.
Attachment #8961118 - Flags: review?(xidorn+moz)
The forward declarations removed are unneeded since all those files include ComputedStyle.h via nsIFrame.h.
Attachment #8961123 - Flags: review?(xidorn+moz)
This was done semi-automatically, replacing s/ComputedStyle()/Style()/g and then removing the non-relevant replacements, like those mentioning getComputedStyle(), for example.
Attachment #8961129 - Flags: review?(xidorn+moz)
Attachment #8961132 - Flags: review?(xidorn+moz)
Attachment #8961133 - Flags: review?(xidorn+moz)
Attachment #8961134 - Flags: review?(xidorn+moz)
Attachment #8961138 - Flags: review?(xidorn+moz)
Attachment #8961142 - Flags: review?(xidorn+moz)
Attachment #8961148 - Flags: review?(xidorn+moz)
Attachment #8961149 - Flags: review?(xidorn+moz)
Comment on attachment 8961082 [details] [diff] [review] The patch. Review of attachment 8961082 [details] [diff] [review]: ----------------------------------------------------------------- ::: devtools/client/inspector/rules/test/browser_rules_add-rule-with-menu.js @@ +20,4 @@ > function* addNewRuleFromContextMenu(inspector, view) { > info("Waiting for context menu to be shown"); > > + let allMenuItems = openStyleContextMenuAndGetAllItems(view, view.element); Revert the changes to this file. ::: devtools/client/inspector/test/shared-head.js @@ +580,4 @@ > * The instance of the rule-view panel > * @return An array of MenuItems > */ > +function openStyleContextMenuAndGetAllItems(view, target) { And this one. ::: dom/animation/EffectCompositor.cpp @@ +567,4 @@ > Maybe<NonOwningAnimationTarget> result; > > CSSPseudoElementType pseudoType = > + aFrame->Style()->GetPseudoType(); I'm a bit disappointed you didn't take the time to put this on a single line. ;)
Not terribly happy about the output, I can fix nits manually instead.
Attachment #8961151 - Flags: review?(xidorn+moz)
Attached patch Squashed patch.Splinter Review
In case it's easier to review. Includes part 31, but not 32.
Attachment #8961082 - Attachment is obsolete: true
(In reply to Emilio Cobos Álvarez [:emilio] from comment #41) > https://treeherder.mozilla.org/#/ > jobs?repo=try&revision=112d6b763d582419143f1ef592b531b3a6e5094f Rust SpiderMonkey bustage is expected (this is on top of inbound, and bug 888600 broke it).
This should fix the orange of the try run. Should've seen it coming :-)
Attachment #8961175 - Flags: review?(xidorn+moz)
(In reply to Jonathan Watt [:jwatt] from comment #38) > Comment on attachment 8961082 [details] [diff] [review] > The patch. > > Review of attachment 8961082 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: devtools/client/inspector/rules/test/browser_rules_add-rule-with-menu.js > @@ +20,4 @@ > > function* addNewRuleFromContextMenu(inspector, view) { > > info("Waiting for context menu to be shown"); > > > > + let allMenuItems = openStyleContextMenuAndGetAllItems(view, view.element); > > Revert the changes to this file. > > ::: devtools/client/inspector/test/shared-head.js > @@ +580,4 @@ > > * The instance of the rule-view panel > > * @return An array of MenuItems > > */ > > +function openStyleContextMenuAndGetAllItems(view, target) { > > And this one. These are reverted in part 28, so not sure why they ended up there, it's definitely not in the patch from comment 40... Anyway, done. > ::: dom/animation/EffectCompositor.cpp > @@ +567,4 @@ > > Maybe<NonOwningAnimationTarget> result; > > > > CSSPseudoElementType pseudoType = > > + aFrame->Style()->GetPseudoType(); > > I'm a bit disappointed you didn't take the time to put this on a single > line. ;) Yeah, the clang-format bit should take care of it... But I'm not sure if we should land it since it's super-noisy. Maybe I'll fix it manually. Xidorn is on PTO today, so if you want to steal some reviews given you've looked at it already, please go ahead :P
As requested by jwatt over IRC. This adds a typedef to nsCSSFrameConstructor and nsIFrame to avoid most of the mozilla:: qualifications.
Comment on attachment 8961152 [details] [diff] [review] Squashed patch. Review of attachment 8961152 [details] [diff] [review]: ----------------------------------------------------------------- I'm about two thirds through. Here are my comments so far for you to start on. ::: dom/smil/nsSMILCSSProperty.h @@ +35,4 @@ > * Constructs a new nsSMILCSSProperty. > * @param aPropID The CSS property we're interested in animating. > * @param aElement The element whose CSS property is being animated. > + * @param aBaseComputedStyle The style context to use when getting the base Fix indent. ::: dom/smil/nsSMILCompositor.cpp @@ +64,1 @@ > nullptr); Indent. ::: dom/xbl/nsXBLResourceLoader.cpp @@ +23,4 @@ > #include "nsIURI.h" > #include "nsNetUtil.h" > #include "nsGkAtoms.h" > +#include "mozilla/ComputedStyle.h" It would be nice to have the new includes in the correct order in files that already have them ordered. Feel like searching through the patch and fixing that up before committing? :) ::: layout/base/ServoRestyleManager.h @@ +325,1 @@ > ServoStyleSet& aStyleSet); Indent. ::: layout/base/nsBidiPresUtils.h @@ +29,5 @@ > template<class T> class nsTHashtable; > namespace mozilla { > +class ComputedStyle; > +class WritingMode; > +class LogicalMargin; Could sort this while touching. ::: layout/base/nsCSSFrameConstructor.cpp @@ +8615,4 @@ > bool aIsFluid) > { > nsIPresShell* shell = aPresContext->PresShell(); > + ComputedStyle* styleContext = aFrame->Style(); Indent. ::: layout/base/nsCSSFrameConstructor.h @@ +436,4 @@ > * @param aParentFrame the parent frame for the generated frame > * @param aAttrNamespace the namespace of the attribute in question > * @param aAttrName the localname of the attribute > + * @param aComputedStyle the style context to use Fix comment (still using "style context"). @@ +469,1 @@ > * style context fix @@ +587,4 @@ > > @param nsIPresShell the presshell whose arena should be used to allocate > the frame. > + @param ComputedStyle the style context to use for the frame. */ fix @@ +595,5 @@ > /* A function that can be used to get a FrameConstructionData. Such > a function is allowed to return null. > > @param nsIContent the node for which the frame is being constructed. > + @param mozilla::ComputedStyle the style context to be used for the frame. fix @@ +1406,4 @@ > * adjusted to point to the right parent frame. > * @param aFCData the FrameConstructionData that would be used for frame > * construction. > + * @param aComputedStyle the style context for aChildContent fix @@ +1414,4 @@ > // be kept track of in the state... > void AdjustParentFrame(nsContainerFrame** aParentFrame, > const FrameConstructionData* aFCData, > + mozilla::ComputedStyle* aComputedStyle); indent @@ +1464,4 @@ > nsFrameConstructorState& aState, > nsIContent* aContent, > nsContainerFrame* aParentFrame, > + mozilla::ComputedStyle* aComputedStyle, indent @@ +1542,4 @@ > nsAtom* aTag, > int32_t aNameSpaceID, > bool aSuppressWhiteSpaceOptimizations, > + mozilla::ComputedStyle* aComputedStyle, indent @@ +1756,4 @@ > */ > void ProcessChildren(nsFrameConstructorState& aState, > nsIContent* aContent, > + mozilla::ComputedStyle* aComputedStyle, indent @@ +1789,4 @@ > void > BuildScrollFrame(nsFrameConstructorState& aState, > nsIContent* aContent, > + mozilla::ComputedStyle* aContentStyle, indent @@ +1799,3 @@ > BeginBuildingScrollFrame(nsFrameConstructorState& aState, > nsIContent* aContent, > + mozilla::ComputedStyle* aContentStyle, indent @@ +1819,4 @@ > nsContainerFrame* aScrolledFrame, > nsIContent* aContent, > nsContainerFrame* aParentFrame, > + mozilla::ComputedStyle* aComputedStyle, indent @@ +1906,4 @@ > nsIContent* aContent, > nsContainerFrame* aParentFrame, > nsContainerFrame* aContentParentFrame, > + mozilla::ComputedStyle* aComputedStyle, indent @@ +1979,5 @@ > nsIContent* aTextContent, > nsIFrame* aTextFrame, > nsContainerFrame* aParentFrame, > + mozilla::ComputedStyle* aParentComputedStyle, > + mozilla::ComputedStyle* aComputedStyle, indent ::: layout/base/nsLayoutUtils.h @@ +676,4 @@ > * attached to it; returns false otherwise. > * > * @param aContent the content node we're looking at > + * @param aComputedStyle aContent's style context fix comment @@ +1834,4 @@ > * @param aRenderingContext Where to draw the image, set up with an > * appropriate scale and transform for drawing in > * app units. > + * @param aComputedStyle The style context of the nsIFrame (or fix comment ::: layout/forms/nsButtonFrameRenderer.cpp @@ -42,5 @@ > -#ifdef DEBUG > - if (mInnerFocusStyle) { > - mInnerFocusStyle->FrameRelease(); > - } > -#endif For the record for anyone doing bug archeology, this is being removed because FrameRelease() is now an empty method. ::: layout/forms/nsRangeFrame.cpp @@ +920,5 @@ > } > > void > +nsRangeFrame::SetAdditionalComputedStyle(int32_t aIndex, > + ComputedStyle* aComputedStyle) indent ::: layout/generic/nsIFrame.h @@ +799,5 @@ > } > } > > /** > + * SetComputedStyleWithoutNotification is for changes to the style fix comment ::: layout/inspector/InspectorUtils.cpp @@ +949,1 @@ > nsAtom* aPseudo) indent ::: layout/mathml/nsMathMLmencloseFrame.cpp @@ +739,5 @@ > } > > void > +nsMathMLmencloseFrame::SetAdditionalComputedStyle(int32_t aIndex, > + ComputedStyle* aComputedStyle) indent ::: layout/style/ComputedStyle.cpp @@ +82,5 @@ > + CSSPseudoElementType aPseudoType, > + ServoComputedDataForgotten aComputedValues) > + : mPresContext(aPresContext) > + , mSource(aComputedValues) > + , mPseudoTag(aPseudoTag) Hmm, I'm not in love with having the parameters and member initializers align. Personally I'd align the parameters two spaces past the "::". @@ +114,3 @@ > uint32_t* aEqualStructs, > uint32_t* aSamePointerStructs, > bool aIgnoreVariables) indent ::: layout/style/ComputedStyle.h @@ +38,2 @@ > /** > + * An ComputedStyle represents the computed style data for an element. This should now be "A", not "An".
(In reply to Emilio Cobos Álvarez [:emilio] from comment #46) > Created attachment 8961352 [details] [diff] [review] > Part 34 - Remove unnecessary mozilla:: qualifications. > > As requested by jwatt over IRC. This adds a typedef to nsCSSFrameConstructor > and nsIFrame to avoid most of the mozilla:: qualifications. Looks like you did it for everything, not just nsCSSFrameConstructor and nsIFrame. Thanks for doing this. I know it was a bit annoying to do, but it does make the code a bit more pleasant to read. :)
Comment on attachment 8961352 [details] [diff] [review] Part 34 - Remove unnecessary mozilla:: qualifications. Review of attachment 8961352 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/xul/tree/nsTreeColumns.cpp @@ -11,4 @@ > #include "nsTreeColumns.h" > #include "nsTreeUtils.h" > #include "mozilla/ComputedStyle.h" > -#include "nsDOMClassInfoID.h" Bit of an unrelated change here at the end, but I guess it doesn't matter too much. ;)
Attachment #8961352 - Flags: review+
(In reply to Jonathan Watt [:jwatt] from comment #49) > Comment on attachment 8961352 [details] [diff] [review] > Part 34 - Remove unnecessary mozilla:: qualifications. > > Review of attachment 8961352 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: layout/xul/tree/nsTreeColumns.cpp > @@ -11,4 @@ > > #include "nsTreeColumns.h" > > #include "nsTreeUtils.h" > > #include "mozilla/ComputedStyle.h" > > -#include "nsDOMClassInfoID.h" > > Bit of an unrelated change here at the end, but I guess it doesn't matter > too much. ;) This was removed and is rebase fallout, it's gone from the squashed patch.
Fixed the include order and removes most references to style contexts in layout/base, layout/style, servo/, and layout/generic
Attachment #8961374 - Flags: review?(jwatt)
Comment on attachment 8961374 [details] [diff] [review] Squashed patch with more nits addressed. Err, has some changes from my queue. will remove.
Attachment #8961374 - Attachment is obsolete: true
Attachment #8961374 - Flags: review?(jwatt)
Attachment #8961152 - Attachment is obsolete: true
Attachment #8961379 - Flags: review?(jwatt)
Comment on attachment 8961152 [details] [diff] [review] Squashed patch. Review of attachment 8961152 [details] [diff] [review]: ----------------------------------------------------------------- Here's the rest of it, starting at layout/style/ServoBindings.h ::: dom/smil/nsSMILCSSProperty.h @@ +35,4 @@ > * Constructs a new nsSMILCSSProperty. > * @param aPropID The CSS property we're interested in animating. > * @param aElement The element whose CSS property is being animated. > + * @param aBaseComputedStyle The style context to use when getting the base Fix indent. ::: dom/smil/nsSMILCompositor.cpp @@ +64,1 @@ > nullptr); Indent. ::: dom/xbl/nsXBLResourceLoader.cpp @@ +23,4 @@ > #include "nsIURI.h" > #include "nsNetUtil.h" > #include "nsGkAtoms.h" > +#include "mozilla/ComputedStyle.h" It would be nice to have the new includes in the correct order in files that already have them ordered. Feel like searching through the patch and fixing that up before committing? :) ::: layout/base/ServoRestyleManager.h @@ +325,1 @@ > ServoStyleSet& aStyleSet); Indent. ::: layout/base/nsBidiPresUtils.h @@ +29,5 @@ > template<class T> class nsTHashtable; > namespace mozilla { > +class ComputedStyle; > +class WritingMode; > +class LogicalMargin; Could sort this while touching. ::: layout/base/nsCSSFrameConstructor.cpp @@ +8615,4 @@ > bool aIsFluid) > { > nsIPresShell* shell = aPresContext->PresShell(); > + ComputedStyle* styleContext = aFrame->Style(); Indent. ::: layout/base/nsCSSFrameConstructor.h @@ +436,4 @@ > * @param aParentFrame the parent frame for the generated frame > * @param aAttrNamespace the namespace of the attribute in question > * @param aAttrName the localname of the attribute > + * @param aComputedStyle the style context to use Fix comment (still using "style context"). @@ +469,1 @@ > * style context fix @@ +587,4 @@ > > @param nsIPresShell the presshell whose arena should be used to allocate > the frame. > + @param ComputedStyle the style context to use for the frame. */ fix @@ +595,5 @@ > /* A function that can be used to get a FrameConstructionData. Such > a function is allowed to return null. > > @param nsIContent the node for which the frame is being constructed. > + @param mozilla::ComputedStyle the style context to be used for the frame. fix @@ +1406,4 @@ > * adjusted to point to the right parent frame. > * @param aFCData the FrameConstructionData that would be used for frame > * construction. > + * @param aComputedStyle the style context for aChildContent fix @@ +1414,4 @@ > // be kept track of in the state... > void AdjustParentFrame(nsContainerFrame** aParentFrame, > const FrameConstructionData* aFCData, > + mozilla::ComputedStyle* aComputedStyle); indent @@ +1464,4 @@ > nsFrameConstructorState& aState, > nsIContent* aContent, > nsContainerFrame* aParentFrame, > + mozilla::ComputedStyle* aComputedStyle, indent @@ +1542,4 @@ > nsAtom* aTag, > int32_t aNameSpaceID, > bool aSuppressWhiteSpaceOptimizations, > + mozilla::ComputedStyle* aComputedStyle, indent @@ +1756,4 @@ > */ > void ProcessChildren(nsFrameConstructorState& aState, > nsIContent* aContent, > + mozilla::ComputedStyle* aComputedStyle, indent @@ +1789,4 @@ > void > BuildScrollFrame(nsFrameConstructorState& aState, > nsIContent* aContent, > + mozilla::ComputedStyle* aContentStyle, indent @@ +1799,3 @@ > BeginBuildingScrollFrame(nsFrameConstructorState& aState, > nsIContent* aContent, > + mozilla::ComputedStyle* aContentStyle, indent @@ +1819,4 @@ > nsContainerFrame* aScrolledFrame, > nsIContent* aContent, > nsContainerFrame* aParentFrame, > + mozilla::ComputedStyle* aComputedStyle, indent @@ +1906,4 @@ > nsIContent* aContent, > nsContainerFrame* aParentFrame, > nsContainerFrame* aContentParentFrame, > + mozilla::ComputedStyle* aComputedStyle, indent @@ +1979,5 @@ > nsIContent* aTextContent, > nsIFrame* aTextFrame, > nsContainerFrame* aParentFrame, > + mozilla::ComputedStyle* aParentComputedStyle, > + mozilla::ComputedStyle* aComputedStyle, indent ::: layout/base/nsLayoutUtils.h @@ +676,4 @@ > * attached to it; returns false otherwise. > * > * @param aContent the content node we're looking at > + * @param aComputedStyle aContent's style context fix comment @@ +1834,4 @@ > * @param aRenderingContext Where to draw the image, set up with an > * appropriate scale and transform for drawing in > * app units. > + * @param aComputedStyle The style context of the nsIFrame (or fix comment ::: layout/forms/nsButtonFrameRenderer.cpp @@ -42,5 @@ > -#ifdef DEBUG > - if (mInnerFocusStyle) { > - mInnerFocusStyle->FrameRelease(); > - } > -#endif For the record for anyone doing bug archeology, this is being removed because FrameRelease() is now an empty method. ::: layout/forms/nsRangeFrame.cpp @@ +920,5 @@ > } > > void > +nsRangeFrame::SetAdditionalComputedStyle(int32_t aIndex, > + ComputedStyle* aComputedStyle) indent ::: layout/generic/nsIFrame.h @@ +799,5 @@ > } > } > > /** > + * SetComputedStyleWithoutNotification is for changes to the style fix comment ::: layout/inspector/InspectorUtils.cpp @@ +949,1 @@ > nsAtom* aPseudo) indent ::: layout/mathml/nsMathMLmencloseFrame.cpp @@ +739,5 @@ > } > > void > +nsMathMLmencloseFrame::SetAdditionalComputedStyle(int32_t aIndex, > + ComputedStyle* aComputedStyle) indent ::: layout/style/ComputedStyle.cpp @@ +82,5 @@ > + CSSPseudoElementType aPseudoType, > + ServoComputedDataForgotten aComputedValues) > + : mPresContext(aPresContext) > + , mSource(aComputedValues) > + , mPseudoTag(aPseudoTag) Hmm, I'm not in love with having the parameters and member initializers align. Personally I'd align the parameters two spaces past the "::". @@ +114,3 @@ > uint32_t* aEqualStructs, > uint32_t* aSamePointerStructs, > bool aIgnoreVariables) indent ::: layout/style/ComputedStyle.h @@ +38,2 @@ > /** > + * An ComputedStyle represents the computed style data for an element. This should now be "A", not "An". ::: layout/style/ServoBindings.h @@ +162,5 @@ > nsTArray<nsIContent*>* Gecko_GetAnonymousContentForElement(RawGeckoElementBorrowed element); > void Gecko_DestroyAnonymousContentList(nsTArray<nsIContent*>* anon_content); > > +void Gecko_ComputedStyle_Init(mozilla::ComputedStyle* context, > + ComputedStyleBorrowedOrNull parent_context, indent ::: layout/style/ServoStyleSet.cpp @@ +1660,5 @@ > > +already_AddRefed<ComputedStyle> > +ServoStyleSet::ReparentComputedStyle(ComputedStyle* aComputedStyle, > + ComputedStyle* aNewParent, > + ComputedStyle* aNewParentIgnoringFirstLine, indent ::: layout/style/ServoStyleSet.h @@ +467,5 @@ > */ > + already_AddRefed<ComputedStyle> > + ReparentComputedStyle(ComputedStyle* aComputedStyle, > + ComputedStyle* aNewParent, > + ComputedStyle* aNewParentIgnoringFirstLine, indent ::: layout/style/nsComputedDOMStyle.cpp @@ +468,1 @@ > nsAtom* aPseudo, indent @@ +498,1 @@ > nsAtom* aPseudo, indent @@ +820,1 @@ > uint64_t aGeneration) indent @@ +832,1 @@ > uint64_t aGeneration) indent ::: layout/style/nsFontFaceUtils.cpp @@ +19,1 @@ > const gfxUserFontSet* aUserFontSet, indent ::: layout/xul/tree/nsTreeBodyFrame.cpp @@ +4332,3 @@ > { > + return mStyleCache.GetComputedStyle(PresContext(), mContent, > + mComputedStyle, aPseudoElement, indent ::: layout/xul/tree/nsTreeStyleCache.cpp @@ +38,1 @@ > nsIContent* aContent, indent
Attachment #8961152 - Attachment is obsolete: false
Attachment #8961152 - Flags: review+
Attachment #8961175 - Flags: review?(xidorn+moz) → review+
Comment on attachment 8961379 [details] [diff] [review] Actually squashed patch with nits adressed. Review of attachment 8961379 [details] [diff] [review]: ----------------------------------------------------------------- Given that this is a 1.10 MB patch, I'm going to assume that you squashed correctly and just rubber stamp this one. Same for the remaining handful of indent nits I pointed out that you haven't applied yet.
Attachment #8961379 - Flags: review?(jwatt) → review+
Attachment #8961088 - Flags: review?(xidorn+moz)
Attachment #8961091 - Flags: review?(xidorn+moz)
Attachment #8961092 - Flags: review?(xidorn+moz)
Attachment #8961095 - Flags: review?(xidorn+moz)
Attachment #8961096 - Flags: review?(xidorn+moz)
Attachment #8961101 - Flags: review?(xidorn+moz)
Attachment #8961102 - Flags: review?(xidorn+moz)
Attachment #8961103 - Flags: review?(xidorn+moz)
Attachment #8961104 - Flags: review?(xidorn+moz)
Attachment #8961108 - Flags: review?(xidorn+moz)
Attachment #8961110 - Flags: review?(xidorn+moz)
Attachment #8961112 - Flags: review?(xidorn+moz)
Attachment #8961114 - Flags: review?(xidorn+moz)
Attachment #8961116 - Flags: review?(xidorn+moz)
Attachment #8961117 - Flags: review?(xidorn+moz)
Attachment #8961118 - Flags: review?(xidorn+moz)
Attachment #8961119 - Flags: review?(xidorn+moz)
Attachment #8961123 - Flags: review?(xidorn+moz)
Attachment #8961127 - Flags: review?(xidorn+moz)
Attachment #8961129 - Flags: review?(xidorn+moz)
Attachment #8961130 - Flags: review?(xidorn+moz)
Attachment #8961132 - Flags: review?(xidorn+moz)
Attachment #8961133 - Flags: review?(xidorn+moz)
Attachment #8961134 - Flags: review?(xidorn+moz)
Attachment #8961136 - Flags: review?(xidorn+moz)
Attachment #8961137 - Flags: review?(xidorn+moz)
Attachment #8961138 - Flags: review?(xidorn+moz)
Attachment #8961142 - Flags: review?(xidorn+moz)
Attachment #8961144 - Flags: review?(xidorn+moz)
Attachment #8961148 - Flags: review?(xidorn+moz)
Attachment #8961149 - Flags: review?(xidorn+moz)
Attachment #8961150 - Flags: review?(xidorn+moz)
Attachment #8961151 - Flags: review?(xidorn+moz)
Attachment #8961151 - Attachment is obsolete: true
Attachment #8961151 - Flags: review-
Attached file Servo PR
Pushed by ecoal95@gmail.com: https://hg.mozilla.org/integration/autoland/rev/b683bb3f22a1 Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
Pushed by ecoal95@gmail.com: https://hg.mozilla.org/integration/autoland/rev/0016368787a4 Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
Backout by ecoal95@gmail.com: https://hg.mozilla.org/integration/autoland/rev/b7c7195b99f4 Back out changeset b683bb3f22a1 for not landing with all the files. r=me on a CLOSED TREE
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Xidorn, I meant to ask you to be a second pair of eyes on the main changes in the following files: layout/style/ComputedStyle.cpp layout/style/ComputedStyle.h layout/style/ComputedStyleInlines.h layout/style/ServoStyleContext.cpp layout/style/ServoStyleContext.h layout/style/ServoStyleContextInlines.h Can you take a look through the diff of those files in the final push and make sure I didn't miss anything?
Flags: needinfo?(xidorn+moz)
Blocks: 1448294
Comment on attachment 8961379 [details] [diff] [review] Actually squashed patch with nits adressed. Review of attachment 8961379 [details] [diff] [review]: ----------------------------------------------------------------- Mostly looks fine. Some small nits. ::: layout/style/ComputedStyle.cpp @@ +30,4 @@ > #include "mozilla/ArenaObjectID.h" > #include "mozilla/StyleSetHandle.h" > #include "mozilla/StyleSetHandleInlines.h" > +#include "mozilla/ComputedStyle.h" This include is redundant. @@ +159,4 @@ > // whether to return a struct or not, since this->mBits might not yet > // be correct (due to not calling ResolveSameStructsAs on it yet). > #define PEEK(struct_) \ > + ComputedData()->GetStyle##struct_() \ The trailing backslash can be removed. ::: layout/style/ComputedStyle.h @@ +370,5 @@ > + mCachedInheritingStyles.AddSizeOfIncludingThis(aSizes, aCVsSize); > + } > + > + // Needs to be public so that we can call it from Servo. > + ~ComputedStyle() = default; Please keep the destructor protected / private, and add Gecko_ComputedStyle_Destroy as a friend function of this class, instead of making it public. I don't think we want to accidentally release it in C++ code elsewhere. ::: layout/style/ComputedStyleInlines.h @@ +16,3 @@ > > +#include "mozilla/ComputedStyle.h" > +#include "mozilla/ComputedStyle.h" Redundant include.
Flags: needinfo?(xidorn+moz) → needinfo?(emilio)
Blocks: 1448559
Depends on: 1448663
Blocks: 1448663
No longer depends on: 1448663
I can't make an extern function friend (the compiler complains), unless I'm missing something obvious. I can add an explicit API to ComputedStyle, maybe, how does that sound? Other comments are addressed in bug 1448559.
Flags: needinfo?(emilio)
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/abac8caba161 and bug 1448850 followup to fix unification-hidden and now-revealed build bustage causing a CLOSED TREE. r=bkelly
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: