Skip to content

Commit

Permalink
Bug 1559096. Rename SVGObserverUtils::GetAndObservePaintServer argume…
Browse files Browse the repository at this point in the history
…nt. r=longsonr

Differential Revision: https://phabricator.services.mozilla.com/D34851

--HG--
extra : rebase_source : 0a749e4113404983365640c0a9758dd2c73b522b
extra : amend_source : e67b5f7daaf3accdb6acd25e1f82d85900c654f3
  • Loading branch information
jwatt committed Jun 6, 2019
1 parent af1b0f2 commit 4dcb61d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions layout/svg/SVGObserverUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1464,33 +1464,33 @@ Element* SVGObserverUtils::GetAndObserveBackgroundClip(nsIFrame* aFrame) {
}

nsSVGPaintServerFrame* SVGObserverUtils::GetAndObservePaintServer(
nsIFrame* aTargetFrame, nsStyleSVGPaint nsStyleSVG::*aPaint) {
nsIFrame* aPaintedFrame, nsStyleSVGPaint nsStyleSVG::*aPaint) {
// If we're looking at a frame within SVG text, then we need to look up
// to find the right frame to get the painting property off. We should at
// least look up past a text frame, and if the text frame's parent is the
// anonymous block frame, then we look up to its parent (the SVGTextFrame).
nsIFrame* frame = aTargetFrame;
if (frame->GetContent()->IsText()) {
frame = frame->GetParent();
nsIFrame* grandparent = frame->GetParent();
nsIFrame* paintedFrame = aPaintedFrame;
if (paintedFrame->GetContent()->IsText()) {
paintedFrame = paintedFrame->GetParent();
nsIFrame* grandparent = paintedFrame->GetParent();
if (grandparent && grandparent->IsSVGTextFrame()) {
frame = grandparent;
paintedFrame = grandparent;
}
}

const nsStyleSVG* svgStyle = frame->StyleSVG();
const nsStyleSVG* svgStyle = paintedFrame->StyleSVG();
if ((svgStyle->*aPaint).Type() != eStyleSVGPaintType_Server) {
return nullptr;
}

RefPtr<URLAndReferrerInfo> paintServerURL =
ResolveURLUsingLocalRef(frame, (svgStyle->*aPaint).GetPaintServer());
RefPtr<URLAndReferrerInfo> paintServerURL = ResolveURLUsingLocalRef(
paintedFrame, (svgStyle->*aPaint).GetPaintServer());

MOZ_ASSERT(aPaint == &nsStyleSVG::mFill || aPaint == &nsStyleSVG::mStroke);
PaintingPropertyDescriptor propDesc =
(aPaint == &nsStyleSVG::mFill) ? FillProperty() : StrokeProperty();
nsSVGPaintingProperty* property =
GetPaintingProperty(paintServerURL, frame, propDesc);
GetPaintingProperty(paintServerURL, paintedFrame, propDesc);
if (!property) {
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion layout/svg/SVGObserverUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class SVGObserverUtils {
* Get the paint server for aPaintedFrame.
*/
static nsSVGPaintServerFrame* GetAndObservePaintServer(
nsIFrame* aTargetFrame, nsStyleSVGPaint nsStyleSVG::*aPaint);
nsIFrame* aPaintedFrame, nsStyleSVGPaint nsStyleSVG::*aPaint);

/**
* Get the start/mid/end-markers for the given frame, and add the frame as
Expand Down

0 comments on commit 4dcb61d

Please sign in to comment.