Bug 1097499 part 3 - Add a separate anonbox for text nodes. r=heycam

MozReview-Commit-ID: 1GfoFEGhyka
This commit is contained in:
Xidorn Quan
2016-04-22 09:18:41 +10:00
parent 3dc0ea538e
commit 15df861e15
17 changed files with 76 additions and 44 deletions

View File

@@ -35,6 +35,7 @@
#include "nsColor.h"
#include "nsCSSPseudoClasses.h"
#include "nsCSSPseudoElements.h"
#include "nsCSSAnonBoxes.h"
#include "nsNameSpaceManager.h"
#include "nsXMLNameSpaceMap.h"
#include "nsError.h"
@@ -5927,6 +5928,13 @@ CSSParserImpl::ParsePseudoSelector(int32_t& aDataMask,
return eSelectorParsingStatus_Error;
}
if (nsCSSAnonBoxes::IsNonElement(pseudo)) {
// Non-element anonymous boxes should not match any rule.
REPORT_UNEXPECTED_TOKEN(PEPseudoSelUnknown);
UngetToken();
return eSelectorParsingStatus_Error;
}
// We currently allow :-moz-placeholder and ::-moz-placeholder. We have to
// be a bit stricter regarding the pseudo-element parsing rules.
if (pseudoElementType == CSSPseudoElementType::mozPlaceholder &&