зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1559096
. Rename SVGObserverUtils::GetAndObservePaintServer argument. r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D34851 --HG-- extra : rebase_source : 0a749e4113404983365640c0a9758dd2c73b522b extra : amend_source : e67b5f7daaf3accdb6acd25e1f82d85900c654f3
This commit is contained in:
Родитель
af1b0f2a42
Коммит
4dcb61db3b
|
@ -1464,33 +1464,33 @@ Element* SVGObserverUtils::GetAndObserveBackgroundClip(nsIFrame* aFrame) {
|
||||||
}
|
}
|
||||||
|
|
||||||
nsSVGPaintServerFrame* SVGObserverUtils::GetAndObservePaintServer(
|
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
|
// 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
|
// 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
|
// 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).
|
// anonymous block frame, then we look up to its parent (the SVGTextFrame).
|
||||||
nsIFrame* frame = aTargetFrame;
|
nsIFrame* paintedFrame = aPaintedFrame;
|
||||||
if (frame->GetContent()->IsText()) {
|
if (paintedFrame->GetContent()->IsText()) {
|
||||||
frame = frame->GetParent();
|
paintedFrame = paintedFrame->GetParent();
|
||||||
nsIFrame* grandparent = frame->GetParent();
|
nsIFrame* grandparent = paintedFrame->GetParent();
|
||||||
if (grandparent && grandparent->IsSVGTextFrame()) {
|
if (grandparent && grandparent->IsSVGTextFrame()) {
|
||||||
frame = grandparent;
|
paintedFrame = grandparent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const nsStyleSVG* svgStyle = frame->StyleSVG();
|
const nsStyleSVG* svgStyle = paintedFrame->StyleSVG();
|
||||||
if ((svgStyle->*aPaint).Type() != eStyleSVGPaintType_Server) {
|
if ((svgStyle->*aPaint).Type() != eStyleSVGPaintType_Server) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<URLAndReferrerInfo> paintServerURL =
|
RefPtr<URLAndReferrerInfo> paintServerURL = ResolveURLUsingLocalRef(
|
||||||
ResolveURLUsingLocalRef(frame, (svgStyle->*aPaint).GetPaintServer());
|
paintedFrame, (svgStyle->*aPaint).GetPaintServer());
|
||||||
|
|
||||||
MOZ_ASSERT(aPaint == &nsStyleSVG::mFill || aPaint == &nsStyleSVG::mStroke);
|
MOZ_ASSERT(aPaint == &nsStyleSVG::mFill || aPaint == &nsStyleSVG::mStroke);
|
||||||
PaintingPropertyDescriptor propDesc =
|
PaintingPropertyDescriptor propDesc =
|
||||||
(aPaint == &nsStyleSVG::mFill) ? FillProperty() : StrokeProperty();
|
(aPaint == &nsStyleSVG::mFill) ? FillProperty() : StrokeProperty();
|
||||||
nsSVGPaintingProperty* property =
|
nsSVGPaintingProperty* property =
|
||||||
GetPaintingProperty(paintServerURL, frame, propDesc);
|
GetPaintingProperty(paintServerURL, paintedFrame, propDesc);
|
||||||
if (!property) {
|
if (!property) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,7 +251,7 @@ class SVGObserverUtils {
|
||||||
* Get the paint server for aPaintedFrame.
|
* Get the paint server for aPaintedFrame.
|
||||||
*/
|
*/
|
||||||
static nsSVGPaintServerFrame* GetAndObservePaintServer(
|
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
|
* Get the start/mid/end-markers for the given frame, and add the frame as
|
||||||
|
|
Загрузка…
Ссылка в новой задаче