mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 655877 - Part 31d: Hook SVG text scaling into CSS text frames. r=roc
This commit is contained in:
parent
529122a1a5
commit
c40ceb2917
@ -77,6 +77,7 @@
|
||||
#include "nsSVGIntegrationUtils.h"
|
||||
#include "nsSVGForeignObjectFrame.h"
|
||||
#include "nsSVGOuterSVGFrame.h"
|
||||
#include "nsSVGTextFrame2.h"
|
||||
#include "nsStyleStructInlines.h"
|
||||
|
||||
#include "mozilla/dom/PBrowserChild.h"
|
||||
@ -5290,8 +5291,18 @@ nsLayoutUtils::InflationMinFontSizeFor(const nsIFrame *aFrame)
|
||||
float
|
||||
nsLayoutUtils::FontSizeInflationFor(const nsIFrame *aFrame)
|
||||
{
|
||||
if (aFrame->IsSVGText()) {
|
||||
const nsIFrame* container = aFrame;
|
||||
while (container->GetType() != nsGkAtoms::svgTextFrame2) {
|
||||
container = container->GetParent();
|
||||
}
|
||||
NS_ASSERTION(container, "expected to find an ancestor nsSVGTextFrame2");
|
||||
return
|
||||
static_cast<const nsSVGTextFrame2*>(container)->GetFontSizeScaleFactor();
|
||||
}
|
||||
|
||||
if (!FontSizeInflationEnabled(aFrame->PresContext())) {
|
||||
return 1.0;
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
return FontSizeInflationInner(aFrame, InflationMinFontSizeFor(aFrame));
|
||||
|
Loading…
Reference in New Issue
Block a user