Backed out 4 changesets (bug 1420117) for mochitest failures layout/style/test/test_counter_descriptor_storage.html r=backout on a CLOSED TREE

Backed out changeset 2560a150250d (bug 1420117)
Backed out changeset 5cceea9740eb (bug 1420117)
Backed out changeset 83b36cccea28 (bug 1420117)
Backed out changeset f7292e7fee0e (bug 1420117)
This commit is contained in:
Andreea Pavel 2017-12-05 02:16:59 +02:00
Родитель 172683ac43
Коммит 2157e91c44
5 изменённых файлов: 14 добавлений и 88 удалений

Просмотреть файл

@ -755,13 +755,6 @@ SERVO_BINDING_FUNC(Servo_ParseTransformIntoMatrix, bool,
const nsAString* value,
bool* contains_3d_transform,
RawGeckoGfxMatrix4x4* result);
SERVO_BINDING_FUNC(Servo_ParseCounterStyleName, nsAtom*,
const nsACString* value);
SERVO_BINDING_FUNC(Servo_ParseCounterStyleDescriptor, bool,
nsCSSCounterDesc aDescriptor,
const nsACString* aValue,
RawGeckoURLExtraData* aURLExtraData,
nsCSSValue* aResult);
// AddRef / Release functions
#define SERVO_ARC_TYPE(name_, type_) \

Просмотреть файл

@ -517,7 +517,6 @@ structs-types = [
"StyleShapeSource",
"StyleTransition",
"gfxFontFeatureValueSet",
"nsCSSCounterDesc",
"nsCSSCounterStyleRule",
"nsCSSFontFaceRule",
"nsCSSKeyword",

Просмотреть файл

@ -32,22 +32,3 @@ ServoCSSParser::ParseIntersectionObserverRootMargin(const nsAString& aValue,
{
return Servo_ParseIntersectionObserverRootMargin(&aValue, aResult);
}
/* static */ already_AddRefed<nsAtom>
ServoCSSParser::ParseCounterStyleName(const nsAString& aValue)
{
NS_ConvertUTF16toUTF8 value(aValue);
nsAtom* atom = Servo_ParseCounterStyleName(&value);
return already_AddRefed<nsAtom>(atom);
}
/* static */ bool
ServoCSSParser::ParseCounterStyleDescriptor(nsCSSCounterDesc aDescriptor,
const nsAString& aValue,
URLExtraData* aURLExtraData,
nsCSSValue& aResult)
{
NS_ConvertUTF16toUTF8 value(aValue);
return Servo_ParseCounterStyleDescriptor(aDescriptor, &value, aURLExtraData,
&aResult);
}

Просмотреть файл

@ -49,31 +49,6 @@ public:
*/
static bool ParseIntersectionObserverRootMargin(const nsAString& aValue,
nsCSSRect* aResult);
/**
* Parses a @counter-style name.
*
* @param aValue The name to parse.
* @return The name as an atom, lowercased if a built-in counter style name,
* or nullptr if parsing failed or if the name was invalid (like "inherit").
*/
static already_AddRefed<nsAtom> ParseCounterStyleName(const nsAString& aValue);
/**
* Parses a @counter-style descriptor.
*
* @param aDescriptor The descriptor to parse.
* @param aValue The value of the descriptor.
* @param aURLExtraData URL data for parsing. This would be used for
* image value URL resolution.
* @param aResult The nsCSSValue to store the result in.
* @return Whether parsing succeeded.
*/
static bool
ParseCounterStyleDescriptor(nsCSSCounterDesc aDescriptor,
const nsAString& aValue,
URLExtraData* aURLExtraData,
nsCSSValue& aResult);
};
} // namespace mozilla

Просмотреть файл

@ -11,7 +11,6 @@
#include "mozAutoDocUpdate.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/dom/CSSCounterStyleRuleBinding.h"
#include "mozilla/ServoCSSParser.h"
#include "nsCSSParser.h"
#include "nsStyleUtil.h"
@ -133,17 +132,9 @@ nsCSSCounterStyleRule::GetName(nsAString& aName)
NS_IMETHODIMP
nsCSSCounterStyleRule::SetName(const nsAString& aName)
{
RefPtr<nsAtom> name;
nsIDocument* doc = GetDocument();
if (!doc || doc->IsStyledByServo()) {
name = ServoCSSParser::ParseCounterStyleName(aName);
} else {
nsCSSParser parser;
name = parser.ParseCounterStyleName(aName, nullptr);
}
if (name) {
nsCSSParser parser;
if (RefPtr<nsAtom> name = parser.ParseCounterStyleName(aName, nullptr)) {
nsIDocument* doc = GetDocument();
MOZ_AUTO_DOC_UPDATE(doc, UPDATE_STYLE, true);
mName = name;
@ -412,33 +403,20 @@ nsresult
nsCSSCounterStyleRule::SetDescriptor(nsCSSCounterDesc aDescID,
const nsAString& aValue)
{
nsCSSParser parser;
nsCSSValue value;
bool ok;
StyleSheet* sheet = GetStyleSheet();
#ifdef MOZ_STYLO
bool useServo = !sheet || sheet->IsServo();
#else
bool useServo = false;
#endif
if (useServo) {
URLExtraData* data = sheet ? sheet->AsServo()->URLData() : nullptr;
ok = ServoCSSParser::ParseCounterStyleDescriptor(aDescID, aValue, data,
value);
} else {
nsCSSParser parser;
nsIURI* baseURL = sheet ? sheet->GetBaseURI() : nullptr;
nsIPrincipal* principal = sheet ? sheet->Principal() : nullptr;
ok = parser.ParseCounterDescriptor(aDescID, aValue, nullptr,
baseURL, principal, value);
nsIURI* baseURL = nullptr;
nsIPrincipal* principal = nullptr;
if (StyleSheet* sheet = GetStyleSheet()) {
baseURL = sheet->GetBaseURI();
principal = sheet->Principal();
}
if (ok && CheckDescValue(GetSystem(), aDescID, value)) {
SetDesc(aDescID, value);
if (parser.ParseCounterDescriptor(aDescID, aValue, nullptr,
baseURL, principal, value)) {
if (CheckDescValue(GetSystem(), aDescID, value)) {
SetDesc(aDescID, value);
}
}
return NS_OK;
}