зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 8379a33c1790 (bug 1339252
) for valgrind test failure
This commit is contained in:
Родитель
97743adb2b
Коммит
344c50ee43
|
@ -1,8 +0,0 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
|
||||
<title>Test for whether comments are allowed in SVG presentation attributes</title>
|
||||
<rect width="100%" height="100%" fill="/* comment */lime/* also comment */"/>
|
||||
</svg>
|
До Ширина: | Высота: | Размер: 346 B |
|
@ -0,0 +1,4 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<title>Reference that css comment in attribute is not allowed</title>
|
||||
<rect width="100%" height="100%" fill="black"/>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 170 B |
|
@ -0,0 +1,4 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<title>Testcase that css comment in attribute is not allowed</title>
|
||||
<rect width="100%" height="100%" fill="/* blah */ red"/>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 178 B |
|
@ -27,6 +27,7 @@ include svg-integration/reftest.list
|
|||
|
||||
== baseline-middle-01.svg pass.svg
|
||||
== border-radius-01.html pass.svg
|
||||
== cssComment-in-attribute-01.svg cssComment-in-attribute-01-ref.svg
|
||||
== clip-01.svg pass.svg
|
||||
== clip-02a.svg clip-02-ref.svg
|
||||
== clip-02b.svg clip-02-ref.svg
|
||||
|
@ -42,7 +43,6 @@ fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)||/^Windows\x20NT\x206\.[12]/
|
|||
== clipPath-basic-07.svg pass.svg
|
||||
== clipPath-winding-01.svg pass.svg
|
||||
== clip-surface-clone-01.svg clip-surface-clone-01-ref.svg
|
||||
== comments-in-pres-attrs.svg pass.svg
|
||||
== conditions-01.svg pass.svg
|
||||
== conditions-02.svg pass.svg
|
||||
== conditions-03.svg pass.svg
|
||||
|
|
|
@ -596,6 +596,11 @@ protected:
|
|||
nsAutoSuppressErrors mErrorSuppresser;
|
||||
};
|
||||
|
||||
|
||||
bool IsSVGMode() const {
|
||||
return mScanner->IsSVGMode();
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the current input state, which includes any currently pushed
|
||||
* back token, and the current position of the scanner.
|
||||
|
@ -1459,10 +1464,6 @@ protected:
|
|||
// True if we are in parsing rules for the chrome.
|
||||
bool mIsChrome : 1;
|
||||
|
||||
// True if we're parsing SVG presentation attributes
|
||||
// These attributes allow non-calc lengths to be unitless (mapping to px)
|
||||
bool mIsSVGMode : 1;
|
||||
|
||||
// True if viewport units should be allowed.
|
||||
bool mViewportUnitsEnabled : 1;
|
||||
|
||||
|
@ -1676,7 +1677,6 @@ void
|
|||
CSSParserImpl::ReleaseScanner()
|
||||
{
|
||||
mScanner = nullptr;
|
||||
mIsSVGMode = false;
|
||||
mReporter = nullptr;
|
||||
mBaseURI = nullptr;
|
||||
mSheetURI = nullptr;
|
||||
|
@ -1991,7 +1991,7 @@ CSSParserImpl::ParseProperty(const nsCSSPropertyID aPropID,
|
|||
css::ErrorReporter reporter(scanner, mSheet, mChildLoader, aSheetURI);
|
||||
InitScanner(scanner, reporter, aSheetURI, aBaseURI, aSheetPrincipal);
|
||||
mSection = eCSSSection_General;
|
||||
mIsSVGMode = aIsSVGMode;
|
||||
scanner.SetSVGMode(aIsSVGMode);
|
||||
|
||||
*aChanged = false;
|
||||
|
||||
|
@ -7791,7 +7791,7 @@ CSSParserImpl::ParseVariant(nsCSSValue& aValue,
|
|||
}
|
||||
}
|
||||
|
||||
if (mIsSVGMode && !IsParsingCompoundProperty()) {
|
||||
if (IsSVGMode() && !IsParsingCompoundProperty()) {
|
||||
// STANDARD: SVG Spec states that lengths and coordinates can be unitless
|
||||
// in which case they default to user-units (1 px = 1 user unit)
|
||||
if (((aVariantMask & VARIANT_LENGTH) != 0) &&
|
||||
|
@ -17773,6 +17773,7 @@ CSSParserImpl::IsValueValidForProperty(const nsCSSPropertyID aPropID,
|
|||
nsAutoSuppressErrors suppressErrors(this);
|
||||
|
||||
mSection = eCSSSection_General;
|
||||
scanner.SetSVGMode(false);
|
||||
|
||||
// Check for unknown properties
|
||||
if (eCSSProperty_UNKNOWN == aPropID) {
|
||||
|
|
|
@ -352,6 +352,7 @@ nsCSSScanner::nsCSSScanner(const nsAString& aBuffer, uint32_t aLineNumber)
|
|||
, mRecordStartOffset(0)
|
||||
, mEOFCharacters(eEOFCharacters_None)
|
||||
, mReporter(nullptr)
|
||||
, mSVGMode(false)
|
||||
, mRecording(false)
|
||||
, mSeenBadToken(false)
|
||||
, mSeenVariableReference(false)
|
||||
|
@ -1232,7 +1233,7 @@ nsCSSScanner::Next(nsCSSToken& aToken, nsCSSScannerExclude aSkip)
|
|||
}
|
||||
continue; // start again at the beginning
|
||||
}
|
||||
if (ch == '/' && Peek(1) == '*') {
|
||||
if (ch == '/' && !IsSVGMode() && Peek(1) == '*') {
|
||||
SkipComment();
|
||||
if (aSkip == eCSSScannerExclude_None) {
|
||||
aToken.mType = eCSSToken_Comment;
|
||||
|
|
|
@ -208,6 +208,13 @@ class nsCSSScanner {
|
|||
void SetErrorReporter(mozilla::css::ErrorReporter* aReporter) {
|
||||
mReporter = aReporter;
|
||||
}
|
||||
// Set whether or not we are processing SVG
|
||||
void SetSVGMode(bool aSVGMode) {
|
||||
mSVGMode = aSVGMode;
|
||||
}
|
||||
bool IsSVGMode() const {
|
||||
return mSVGMode;
|
||||
}
|
||||
|
||||
// Reset or check whether a BAD_URL or BAD_STRING token has been seen.
|
||||
void ClearSeenBadToken() { mSeenBadToken = false; }
|
||||
|
@ -358,6 +365,8 @@ protected:
|
|||
|
||||
mozilla::css::ErrorReporter *mReporter;
|
||||
|
||||
// True if we are in SVG mode; false in "normal" CSS
|
||||
bool mSVGMode;
|
||||
bool mRecording;
|
||||
bool mSeenBadToken;
|
||||
bool mSeenVariableReference;
|
||||
|
|
Загрузка…
Ссылка в новой задаче