#375: M1342719 M1342720

This commit is contained in:
Cameron Kaiser 2017-05-08 21:31:13 -07:00
parent bea84e5072
commit f4015e0c10
3 changed files with 6 additions and 5 deletions

View File

@ -3859,7 +3859,6 @@ CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
// calls bidi algo twice since it needs the full text width and the // calls bidi algo twice since it needs the full text width and the
// bounding boxes before rendering anything // bounding boxes before rendering anything
nsBidi bidiEngine;
rv = nsBidiPresUtils::ProcessText(textToDraw.get(), rv = nsBidiPresUtils::ProcessText(textToDraw.get(),
textToDraw.Length(), textToDraw.Length(),
isRTL ? NSBIDI_RTL : NSBIDI_LTR, isRTL ? NSBIDI_RTL : NSBIDI_LTR,
@ -3869,7 +3868,7 @@ CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
nullptr, nullptr,
0, 0,
&totalWidthCoord, &totalWidthCoord,
&bidiEngine); &mBidiEngine);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
return rv; return rv;
} }
@ -3984,7 +3983,7 @@ CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
nullptr, nullptr,
0, 0,
nullptr, nullptr,
&bidiEngine); &mBidiEngine);
mTarget->SetTransform(oldTransform); mTarget->SetTransform(oldTransform);

View File

@ -28,6 +28,7 @@
#include "FilterSupport.h" #include "FilterSupport.h"
#include "nsSVGEffects.h" #include "nsSVGEffects.h"
#include "Layers.h" #include "Layers.h"
#include "nsBidi.h"
class nsGlobalWindow; class nsGlobalWindow;
class nsXULElement; class nsXULElement;
@ -821,6 +822,8 @@ protected:
nsTArray<RegionInfo> mHitRegionsOptions; nsTArray<RegionInfo> mHitRegionsOptions;
nsBidi mBidiEngine;
/** /**
* Returns true if a shadow should be drawn along with a * Returns true if a shadow should be drawn along with a
* drawing operation. * drawing operation.

View File

@ -75,9 +75,8 @@ AccessCheck::wrapperSubsumes(JSObject* wrapper)
bool bool
AccessCheck::isChrome(JSCompartment* compartment) AccessCheck::isChrome(JSCompartment* compartment)
{ {
bool privileged;
nsIPrincipal* principal = GetCompartmentPrincipal(compartment); nsIPrincipal* principal = GetCompartmentPrincipal(compartment);
return NS_SUCCEEDED(nsXPConnect::SecurityManager()->IsSystemPrincipal(principal, &privileged)) && privileged; return nsXPConnect::SystemPrincipal() == principal;
} }
bool bool