Issue #2490 - Part 12: Convert CSSStyleRule to WebIDL.

The .style PutForwards bit is coming along for the ride here, aligning us with
the behavior of Blink and Gecko.
This commit is contained in:
Moonchild 2024-04-03 13:59:06 +02:00 committed by roytam1
commit 6176bd62d9
15 changed files with 132 additions and 55 deletions

View file

@ -80,7 +80,6 @@
#include "nsIDOMCSSSupportsRule.h"
#include "nsIDOMCSSCounterStyleRule.h"
#include "nsIDOMCSSPageRule.h"
#include "nsIDOMCSSStyleRule.h"
#include "nsIDOMXULCommandDispatcher.h"
#include "nsIControllers.h"
#ifdef MOZ_XUL
@ -188,9 +187,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
// Misc Core related classes
// CSS classes
NS_DEFINE_CLASSINFO_DATA(CSSStyleRule, nsCSSRuleSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS |
nsIXPCScriptable::WANT_PRECREATE)
NS_DEFINE_CLASSINFO_DATA(CSSMediaRule, nsCSSRuleSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS |
nsIXPCScriptable::WANT_PRECREATE)
@ -516,11 +512,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMConstructor)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSStyleRule, nsIDOMCSSStyleRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSMediaRule, nsIDOMCSSMediaRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSMediaRule)
@ -2000,14 +1991,6 @@ nsCSSRuleSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
return NS_ERROR_UNEXPECTED;
}
css::Rule* cssRule = rule->GetCSSRule();
if (!cssRule) {
// A DOMCSSStyleRule whose actual underlying rule has gone away. There
// isn't much a caller can do with this thing anyway, and only chrome code
// can get its hands on it to start with, so just wrap in the current
// global.
*parentObj = globalObj;
return NS_OK;
}
nsIDocument* doc = cssRule->GetDocument();
if (!doc) {
*parentObj = globalObj;