Backed out changeset 7d7457d5ca8a (bug 1338936)

This commit is contained in:
Sebastian Hengst 2017-02-19 10:37:26 +01:00
parent c7c107adf2
commit a64b195d9b
5 changed files with 38 additions and 159 deletions

View File

@ -1522,12 +1522,6 @@ nsGenericHTMLElement::MapBackgroundInto(const nsMappedAttributes* aAttributes,
if (!aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Background))) if (!aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Background)))
return; return;
if (aData->IsServo()) {
// FIXME(bug 1339711)
NS_WARNING("stylo: cannot handle background presentation attribute");
return;
}
nsPresContext* presContext = aData->PresContext(); nsPresContext* presContext = aData->PresContext();
if (!aData->PropertyIsSet(eCSSProperty_background_image) && if (!aData->PropertyIsSet(eCSSProperty_background_image) &&
@ -1551,6 +1545,9 @@ nsGenericHTMLElement::MapBackgroundInto(const nsMappedAttributes* aAttributes,
nsCSSValueList* list = backImage->SetListValue(); nsCSSValueList* list = backImage->SetListValue();
list->mValue.SetImageValue(value->GetImageValue()); list->mValue.SetImageValue(value->GetImageValue());
} }
} else {
// FIXME(bug 1330041)
MOZ_ASSERT_UNREACHABLE("stylo: cannot handle background");
} }
} }
} }

View File

@ -490,12 +490,6 @@ void
nsMathMLElement::MapMathMLAttributesInto(const nsMappedAttributes* aAttributes, nsMathMLElement::MapMathMLAttributesInto(const nsMappedAttributes* aAttributes,
GenericSpecifiedValues* aGenericData) GenericSpecifiedValues* aGenericData)
{ {
if (aGenericData->IsServo()) {
// FIXME (bug 1339711) handle MathML properties in Stylo
NS_WARNING("stylo: cannot handle MathML presentation attributes");
return;
}
nsRuleData* aData = aGenericData->AsGecko(); nsRuleData* aData = aGenericData->AsGecko();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Font)) { if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Font)) {
// scriptsizemultiplier // scriptsizemultiplier

View File

@ -175,46 +175,10 @@ SERVO_BINDING_FUNC(Servo_DeclarationBlock_RemoveProperty, void,
SERVO_BINDING_FUNC(Servo_DeclarationBlock_RemovePropertyById, void, SERVO_BINDING_FUNC(Servo_DeclarationBlock_RemovePropertyById, void,
RawServoDeclarationBlockBorrowed declarations, RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property) nsCSSPropertyID property)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_AddPresValue, void,
// presentation attributes
SERVO_BINDING_FUNC(Servo_DeclarationBlock_PropertyIsSet, bool,
RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetIdentStringValue, void,
RawServoDeclarationBlockBorrowed declarations, RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property, nsCSSPropertyID property,
const nsAString& value) nsCSSValueBorrowedMut css_value)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetKeywordValue, void,
RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property,
int32_t value)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetIntValue, void,
RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property,
int32_t value)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetPixelValue, void,
RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property,
float value)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetPercentValue, void,
RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property,
float value)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetAutoValue, void,
RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetCurrentColor, void,
RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetColorValue, void,
RawServoDeclarationBlockBorrowed declarations,
nsCSSPropertyID property,
nscolor value)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetFontFamily, void,
RawServoDeclarationBlockBorrowed declarations,
const nsAString& value)
SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetTextDecorationColorOverride, void,
RawServoDeclarationBlockBorrowed declarations)
// CSS supports() // CSS supports()
SERVO_BINDING_FUNC(Servo_CSSSupports2, bool, SERVO_BINDING_FUNC(Servo_CSSSupports2, bool,

View File

@ -3,7 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/ServoBindings.h"
#include "mozilla/ServoSpecifiedValues.h" #include "mozilla/ServoSpecifiedValues.h"
namespace { namespace {
@ -25,79 +24,3 @@ ServoSpecifiedValues::ServoSpecifiedValues(nsPresContext* aContext,
{ {
} }
bool
ServoSpecifiedValues::PropertyIsSet(nsCSSPropertyID aId)
{
// We always create fresh ServoSpecifiedValues for each property
// mapping, so unlike Gecko there aren't existing properties from
// the cascade that we wish to avoid overwriting.
//
// If a property is being overwritten, that's a bug. Check for it
// in debug mode (this is O(n^2) behavior since Servo will traverse
// the array each time you add a new property)
MOZ_ASSERT(!Servo_DeclarationBlock_PropertyIsSet(mDecl, aId),
"Presentation attribute mappers should never attempt to set the same property twice");
return false;
}
void
ServoSpecifiedValues::SetIdentStringValue(nsCSSPropertyID aId,
const nsString& aValue)
{
Servo_DeclarationBlock_SetIdentStringValue(mDecl, aId, aValue);
}
void
ServoSpecifiedValues::SetKeywordValue(nsCSSPropertyID aId, int32_t aValue)
{
Servo_DeclarationBlock_SetKeywordValue(mDecl, aId, aValue);
}
void
ServoSpecifiedValues::SetIntValue(nsCSSPropertyID aId, int32_t aValue)
{
Servo_DeclarationBlock_SetIntValue(mDecl, aId, aValue);
}
void
ServoSpecifiedValues::SetPixelValue(nsCSSPropertyID aId, float aValue)
{
Servo_DeclarationBlock_SetPixelValue(mDecl, aId, aValue);
}
void
ServoSpecifiedValues::SetPercentValue(nsCSSPropertyID aId, float aValue)
{
Servo_DeclarationBlock_SetPercentValue(mDecl, aId, aValue);
}
void
ServoSpecifiedValues::SetAutoValue(nsCSSPropertyID aId)
{
Servo_DeclarationBlock_SetAutoValue(mDecl, aId);
}
void
ServoSpecifiedValues::SetCurrentColor(nsCSSPropertyID aId)
{
Servo_DeclarationBlock_SetCurrentColor(mDecl, aId);
}
void
ServoSpecifiedValues::SetColorValue(nsCSSPropertyID aId, nscolor aColor)
{
Servo_DeclarationBlock_SetColorValue(mDecl, aId, aColor);
}
void
ServoSpecifiedValues::SetFontFamily(const nsString& aValue)
{
Servo_DeclarationBlock_SetFontFamily(mDecl, aValue);
}
void
ServoSpecifiedValues::SetTextDecorationColorOverride()
{
Servo_DeclarationBlock_SetTextDecorationColorOverride(mDecl);
}

View File

@ -24,80 +24,81 @@ public:
ServoSpecifiedValues(nsPresContext* aContext, RawServoDeclarationBlock* aDecl); ServoSpecifiedValues(nsPresContext* aContext, RawServoDeclarationBlock* aDecl);
// GenericSpecifiedValues overrides // GenericSpecifiedValues overrides
bool PropertyIsSet(nsCSSPropertyID aId); bool PropertyIsSet(nsCSSPropertyID aId) {
return false;
}
void SetIdentStringValue(nsCSSPropertyID aId, void SetIdentStringValue(nsCSSPropertyID aId,
const nsString& aValue); const nsString& aValue) {
}
void SetIdentStringValueIfUnset(nsCSSPropertyID aId, void SetIdentStringValueIfUnset(nsCSSPropertyID aId,
const nsString& aValue) { const nsString& aValue) {
if (!PropertyIsSet(aId)) {
SetIdentStringValue(aId, aValue);
}
} }
void SetKeywordValue(nsCSSPropertyID aId, void SetKeywordValue(nsCSSPropertyID aId,
int32_t aValue); int32_t aValue) {
}
void SetKeywordValueIfUnset(nsCSSPropertyID aId, void SetKeywordValueIfUnset(nsCSSPropertyID aId,
int32_t aValue) { int32_t aValue) {
if (!PropertyIsSet(aId)) {
SetKeywordValue(aId, aValue);
}
} }
void SetIntValue(nsCSSPropertyID aId, void SetIntValue(nsCSSPropertyID aId,
int32_t aValue); int32_t aValue) {
}
void SetPixelValue(nsCSSPropertyID aId, void SetPixelValue(nsCSSPropertyID aId,
float aValue); float aValue) {
}
void SetPixelValueIfUnset(nsCSSPropertyID aId, void SetPixelValueIfUnset(nsCSSPropertyID aId,
float aValue) { float aValue) {
if (!PropertyIsSet(aId)) {
SetPixelValue(aId, aValue);
}
} }
void SetPercentValue(nsCSSPropertyID aId, void SetPercentValue(nsCSSPropertyID aId,
float aValue); float aValue) {
}
void SetAutoValue(nsCSSPropertyID aId); void SetAutoValue(nsCSSPropertyID aId) {
}
void SetAutoValueIfUnset(nsCSSPropertyID aId) { void SetAutoValueIfUnset(nsCSSPropertyID aId) {
if (!PropertyIsSet(aId)) {
SetAutoValue(aId);
}
} }
void SetPercentValueIfUnset(nsCSSPropertyID aId, void SetPercentValueIfUnset(nsCSSPropertyID aId,
float aValue) { float aValue) {
if (!PropertyIsSet(aId)) {
SetPercentValue(aId, aValue);
}
} }
void SetCurrentColor(nsCSSPropertyID aId); void SetCurrentColor(nsCSSPropertyID aId) {
}
void SetCurrentColorIfUnset(nsCSSPropertyID aId) { void SetCurrentColorIfUnset(nsCSSPropertyID aId) {
if (!PropertyIsSet(aId)) {
SetCurrentColor(aId);
}
} }
void SetColorValue(nsCSSPropertyID aId, void SetColorValue(nsCSSPropertyID aId,
nscolor aValue); nscolor aValue) {
}
void SetColorValueIfUnset(nsCSSPropertyID aId, void SetColorValueIfUnset(nsCSSPropertyID aId,
nscolor aValue) { nscolor aValue) {
if (!PropertyIsSet(aId)) {
SetColorValue(aId, aValue);
}
} }
void SetFontFamily(const nsString& aValue); void SetFontFamily(const nsString& aValue) {
void SetTextDecorationColorOverride();
}
void SetTextDecorationColorOverride() {
}
private: private:
RefPtr<RawServoDeclarationBlock> mDecl; RefPtr<RawServoDeclarationBlock> mDecl;