Bug 1291390 - Hoist the ParsingMode getter to the superclass and give it a special binary name for WebIDL. r=bholley,r=heycam

In the next patch we want to introduce an accessor called ParsingMode, which conflicts with this one.
This commit is contained in:
Bobby Holley 2016-08-02 13:17:06 -07:00
Родитель 420156f40f
Коммит 1dfd6a8070
5 изменённых файлов: 20 добавлений и 20 удалений

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

@ -20,7 +20,7 @@ interface CSSStyleSheet : StyleSheet {
readonly attribute CSSRule? ownerRule;
[Throws]
readonly attribute CSSRuleList cssRules;
[ChromeOnly]
[ChromeOnly, BinaryName="parsingModeDOM"]
readonly attribute CSSStyleSheetParsingMode parsingMode;
[Throws]
unsigned long insertRule(DOMString rule, unsigned long index);

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

@ -1163,22 +1163,6 @@ CSSStyleSheet::~CSSStyleSheet()
}
}
mozilla::dom::CSSStyleSheetParsingMode
CSSStyleSheet::ParsingMode()
{
#define CHECK(X, Y) \
static_assert(static_cast<int>(X) == static_cast<int>(Y), \
"mozilla::dom::CSSStyleSheetParsingMode and mozilla::css::SheetParsingMode should have identical values");
CHECK(mozilla::dom::CSSStyleSheetParsingMode::Agent, css::eAgentSheetFeatures);
CHECK(mozilla::dom::CSSStyleSheetParsingMode::User, css::eUserSheetFeatures);
CHECK(mozilla::dom::CSSStyleSheetParsingMode::Author, css::eAuthorSheetFeatures);
#undef CHECK
return static_cast<mozilla::dom::CSSStyleSheetParsingMode>(mParsingMode);
}
void
CSSStyleSheet::DropRuleCollection()
{

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

@ -16,7 +16,6 @@
#include "mozilla/StyleSheetInfo.h"
#include "mozilla/css/SheetParsingMode.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/CSSStyleSheetBinding.h"
#include "nscore.h"
#include "nsCOMPtr.h"
@ -321,8 +320,6 @@ public:
void WillDirty();
void DidDirty();
mozilla::dom::CSSStyleSheetParsingMode ParsingMode();
private:
CSSStyleSheet(const CSSStyleSheet& aCopy,
CSSStyleSheet* aParentToUse,

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

@ -33,6 +33,22 @@ StyleSheet::StyleSheet(const StyleSheet& aCopy,
{
}
mozilla::dom::CSSStyleSheetParsingMode
StyleSheet::ParsingModeDOM()
{
#define CHECK(X, Y) \
static_assert(static_cast<int>(X) == static_cast<int>(Y), \
"mozilla::dom::CSSStyleSheetParsingMode and mozilla::css::SheetParsingMode should have identical values");
CHECK(mozilla::dom::CSSStyleSheetParsingMode::Agent, css::eAgentSheetFeatures);
CHECK(mozilla::dom::CSSStyleSheetParsingMode::User, css::eUserSheetFeatures);
CHECK(mozilla::dom::CSSStyleSheetParsingMode::Author, css::eAuthorSheetFeatures);
#undef CHECK
return static_cast<mozilla::dom::CSSStyleSheetParsingMode>(mParsingMode);
}
bool
StyleSheet::IsComplete() const
{

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

@ -8,6 +8,7 @@
#define mozilla_StyleSheet_h
#include "mozilla/css/SheetParsingMode.h"
#include "mozilla/dom/CSSStyleSheetBinding.h"
#include "mozilla/StyleBackendType.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetInfo.h"
@ -42,6 +43,8 @@ public:
mParsingMode = aParsingMode;
}
mozilla::dom::CSSStyleSheetParsingMode ParsingModeDOM();
nsINode* GetOwnerNode() const { return mOwningNode; }
// The document this style sheet is associated with. May be null