Bug 1360488 - Part 2: stylo: Propagate quirks mode information from Gecko to Servo r=bholley

MozReview-Commit-ID: 6AyuC2jd3d4
This commit is contained in:
Nazım Can Altınova
2017-05-06 01:12:03 +03:00
parent 7aed30d8da
commit fe6b4ad014
5 changed files with 11 additions and 6 deletions

View File

@@ -1722,7 +1722,8 @@ nsAttrValue::ParseStyleAttribute(const nsAString& aString,
if (ownerDoc->GetStyleBackendType() == StyleBackendType::Servo) {
RefPtr<URLExtraData> data = new URLExtraData(baseURI, docURI,
aElement->NodePrincipal());
decl = ServoDeclarationBlock::FromCssText(aString, data);
decl = ServoDeclarationBlock::FromCssText(aString, data,
ownerDoc->GetCompatibilityMode());
} else {
css::Loader* cssLoader = ownerDoc->CSSLoader();
nsCSSParser cssParser(cssLoader);

View File

@@ -208,7 +208,8 @@ SERVO_BINDING_FUNC(Servo_AnimationValue_Compute,
// Style attribute
SERVO_BINDING_FUNC(Servo_ParseStyleAttribute, RawServoDeclarationBlockStrong,
const nsACString* data,
RawGeckoURLExtraData* extra_data)
RawGeckoURLExtraData* extra_data,
nsCompatibility quirks_mode)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_CreateEmpty,
RawServoDeclarationBlockStrong)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_Clone, RawServoDeclarationBlockStrong,

View File

@@ -13,12 +13,13 @@ namespace mozilla {
/* static */ already_AddRefed<ServoDeclarationBlock>
ServoDeclarationBlock::FromCssText(const nsAString& aCssText,
URLExtraData* aExtraData)
URLExtraData* aExtraData,
nsCompatibility aMode)
{
NS_ConvertUTF16toUTF8 value(aCssText);
// FIXME (bug 1343964): Figure out a better solution for sending the base uri to servo
RefPtr<RawServoDeclarationBlock>
raw = Servo_ParseStyleAttribute(&value, aExtraData).Consume();
raw = Servo_ParseStyleAttribute(&value, aExtraData, aMode).Consume();
RefPtr<ServoDeclarationBlock> decl = new ServoDeclarationBlock(raw.forget());
return decl.forget();
}

View File

@@ -28,7 +28,8 @@ public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ServoDeclarationBlock)
static already_AddRefed<ServoDeclarationBlock>
FromCssText(const nsAString& aCssText, URLExtraData* aExtraData);
FromCssText(const nsAString& aCssText, URLExtraData* aExtraData,
nsCompatibility aMode);
RawServoDeclarationBlock* Raw() const { return mRaw; }
RawServoDeclarationBlock* const* RefRaw() const {

View File

@@ -130,7 +130,8 @@ nsDOMCSSDeclaration::SetCssText(const nsAString& aCssText)
return NS_ERROR_NOT_AVAILABLE;
}
newdecl = ServoDeclarationBlock::FromCssText(aCssText, servoEnv.mUrlExtraData);
newdecl = ServoDeclarationBlock::FromCssText(aCssText, servoEnv.mUrlExtraData,
servoEnv.mCompatMode);
} else {
CSSParsingEnvironment geckoEnv;
GetCSSParsingEnvironment(geckoEnv);