cinera_pre.js: Harden GetRule()
This commit is contained in:
parent
33f6186aa1
commit
20d7e82a66
|
@ -23,7 +23,7 @@ typedef struct
|
||||||
version CINERA_APP_VERSION = {
|
version CINERA_APP_VERSION = {
|
||||||
.Major = 0,
|
.Major = 0,
|
||||||
.Minor = 8,
|
.Minor = 8,
|
||||||
.Patch = 6
|
.Patch = 7
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <stdarg.h> // NOTE(matt): varargs
|
#include <stdarg.h> // NOTE(matt): varargs
|
||||||
|
|
|
@ -226,17 +226,20 @@ function GetRule(SelectorText)
|
||||||
for(var StyleSheetIndex = StyleSheets.length - 1; StyleSheetIndex >= 0; --StyleSheetIndex)
|
for(var StyleSheetIndex = StyleSheets.length - 1; StyleSheetIndex >= 0; --StyleSheetIndex)
|
||||||
{
|
{
|
||||||
var ThisSheet = StyleSheets[StyleSheetIndex];
|
var ThisSheet = StyleSheets[StyleSheetIndex];
|
||||||
var Rules = ThisSheet[cssRuleCode];
|
if(ThisSheet.href.includes(location.hostname))
|
||||||
for(var RuleIndex = Rules.length - 1; RuleIndex >= 0; --RuleIndex)
|
|
||||||
{
|
{
|
||||||
var ThisRule = Rules[RuleIndex];
|
var Rules = ThisSheet[cssRuleCode];
|
||||||
if(SelectorText === ThisRule.selectorText)
|
for(var RuleIndex = Rules.length - 1; RuleIndex >= 0; --RuleIndex)
|
||||||
{
|
{
|
||||||
Result = ThisRule;
|
var ThisRule = Rules[RuleIndex];
|
||||||
break;
|
if(SelectorText === ThisRule.selectorText)
|
||||||
|
{
|
||||||
|
Result = ThisRule;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if(Result !== undefined) { break; }
|
||||||
}
|
}
|
||||||
if(Result !== undefined) { break; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Result;
|
return Result;
|
||||||
|
|
Loading…
Reference in New Issue