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)
Core
CSS Parsing and Computation
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)
Assignee | ||
Comment 1•7 years ago
|
||
This is the patch without clang-format, for reference.
Assignee | ||
Comment 2•7 years ago
|
||
Attachment #8961076 -
Attachment is obsolete: true
Assignee | ||
Comment 3•7 years ago
|
||
Mozreview is timing out when uploading the patches, so will push using splinter.
Assignee | ||
Comment 4•7 years ago
|
||
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)
Assignee | ||
Comment 5•7 years ago
|
||
Also completely automated using find + sed. This in combination with the previous patch make nsStyleContext -> ComputedStyle.
Attachment #8961091 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 6•7 years ago
|
||
This leaves ServoStyleContext and nsStyleContext using the same name, since they're going to be merged in following parts.
Assignee | ||
Updated•7 years ago
|
Attachment #8961092 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 7•7 years ago
|
||
Just moving the files, not build config touched or anything.
Attachment #8961095 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 8•7 years ago
|
||
This was supposed to be in the patch in part 4.
Attachment #8961096 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 9•7 years ago
|
||
This part is manual, though should be mostly straight-forward.
Attachment #8961101 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 10•7 years ago
|
||
(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.
Assignee | ||
Comment 11•7 years ago
|
||
Automatic include fixup for part 5.
Attachment #8961102 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 12•7 years ago
|
||
This will be cleaned in followups to this bug, to make this bug a bit more manageable.
Attachment #8961103 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 13•7 years ago
|
||
Just some manual fixes while I was trying to get this to build.
Attachment #8961104 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 14•7 years ago
|
||
(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.
Assignee | ||
Comment 15•7 years ago
|
||
Automated change to fix a bunch of callers of nsIFrame::ComputedStyle to start calling nsIFrame::Style().
Assignee | ||
Updated•7 years ago
|
Attachment #8961108 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 16•7 years ago
|
||
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)
Assignee | ||
Comment 17•7 years ago
|
||
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)
Assignee | ||
Comment 18•7 years ago
|
||
Automatically fix another large amount of users of ComputedStyle.
Attachment #8961114 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 19•7 years ago
|
||
Attachment #8961116 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 20•7 years ago
|
||
Automatically fix most construction functions and similar.
Attachment #8961117 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 21•7 years ago
|
||
Had missed this before.
Attachment #8961118 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 22•7 years ago
|
||
Attachment #8961119 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 23•7 years ago
|
||
The forward declarations removed are unneeded since all those files include ComputedStyle.h via nsIFrame.h.
Attachment #8961123 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 24•7 years ago
|
||
Attachment #8961127 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 25•7 years ago
|
||
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)
Assignee | ||
Comment 26•7 years ago
|
||
Attachment #8961130 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 27•7 years ago
|
||
Attachment #8961132 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 28•7 years ago
|
||
Attachment #8961133 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 29•7 years ago
|
||
Attachment #8961134 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 30•7 years ago
|
||
Attachment #8961136 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 31•7 years ago
|
||
Attachment #8961137 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 32•7 years ago
|
||
Attachment #8961138 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 33•7 years ago
|
||
Attachment #8961142 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 34•7 years ago
|
||
Attachment #8961144 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 35•7 years ago
|
||
Attachment #8961148 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 36•7 years ago
|
||
Attachment #8961149 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 37•7 years ago
|
||
Attachment #8961150 -
Flags: review?(xidorn+moz)
![]() |
||
Comment 38•7 years ago
|
||
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. ;)
Assignee | ||
Comment 39•7 years ago
|
||
Not terribly happy about the output, I can fix nits manually instead.
Attachment #8961151 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 40•7 years ago
|
||
In case it's easier to review. Includes part 31, but not 32.
Attachment #8961082 -
Attachment is obsolete: true
Assignee | ||
Comment 41•7 years ago
|
||
Assignee | ||
Comment 42•7 years ago
|
||
(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).
Assignee | ||
Comment 43•7 years ago
|
||
This should fix the orange of the try run. Should've seen it coming :-)
Assignee | ||
Updated•7 years ago
|
Attachment #8961175 -
Flags: review?(xidorn+moz)
Assignee | ||
Comment 44•7 years ago
|
||
(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
Assignee | ||
Comment 45•7 years ago
|
||
Assignee | ||
Comment 46•7 years ago
|
||
As requested by jwatt over IRC. This adds a typedef to nsCSSFrameConstructor and nsIFrame to avoid most of the mozilla:: qualifications.
![]() |
||
Comment 47•7 years ago
|
||
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".
![]() |
||
Comment 48•7 years ago
|
||
(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 49•7 years ago
|
||
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+
Assignee | ||
Comment 50•7 years ago
|
||
(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.
Assignee | ||
Comment 51•7 years ago
|
||
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)
Assignee | ||
Comment 52•7 years ago
|
||
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)
Assignee | ||
Comment 53•7 years ago
|
||
Attachment #8961152 -
Attachment is obsolete: true
Attachment #8961379 -
Flags: review?(jwatt)
![]() |
||
Comment 54•7 years ago
|
||
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+
![]() |
||
Updated•7 years ago
|
Attachment #8961175 -
Flags: review?(xidorn+moz) → review+
![]() |
||
Comment 55•7 years ago
|
||
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+
![]() |
||
Updated•7 years ago
|
Attachment #8961088 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961091 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961092 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961095 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961096 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961101 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961102 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961103 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961104 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961108 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961110 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961112 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961114 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961116 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961117 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961118 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961119 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961123 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961127 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961129 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961130 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961132 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961133 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961134 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961136 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961137 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961138 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961142 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961144 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961148 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961149 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961150 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961151 -
Flags: review?(xidorn+moz)
![]() |
||
Updated•7 years ago
|
Attachment #8961151 -
Attachment is obsolete: true
Attachment #8961151 -
Flags: review-
Assignee | ||
Comment 56•7 years ago
|
||
Assignee | ||
Comment 57•7 years ago
|
||
Attachment #8961487 -
Flags: review+
Comment 58•7 years ago
|
||
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/b683bb3f22a1
Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
Comment 59•7 years ago
|
||
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
Comment 60•7 years ago
|
||
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
Comment 61•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
![]() |
||
Comment 62•7 years ago
|
||
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)
Comment 63•7 years ago
|
||
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.
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Comment 65•7 years ago
|
||
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)
Comment 66•7 years ago
|
||
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
Comment 67•7 years ago
|
||
bugherder |
You need to log in
before you can comment on or make changes to this bug.
Description
•