Skip to content

Commit

Permalink
Warn for incompatibility of untrusted scripts properties (bug 691569)
Browse files Browse the repository at this point in the history
baseURIObject, nodePrincipal, or documentURIObject properties are chrome-only
in Firefox 9.
  • Loading branch information
Allen Short committed Oct 13, 2011
1 parent aaab1b0 commit ccc07c4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_compatibility.py
Expand Up @@ -338,6 +338,16 @@ def test_fx9_navigator_taintEnabled():
futureCompatWarning('alert(navigator.taintEnabled);', '9.0a1')


def test_fx9_691569():
"""
baseURIObject, nodePrincipal, documentURIObject are flagged as
unavailable in non-chrome contexts in FX9.
"""
futureCompatWarning('alert(document.documentURIObject);', '9.0a1')
futureCompatWarning('alert(document.nodePrincipal);', '9.0a1')
futureCompatWarning('alert(document.baseURIObject);', '9.0a1')


def test_tb6_nsIImapMailFolderSink():
"""Test that nsIImapMailFolderSink.setUrlState is flagged."""

Expand Down
25 changes: 25 additions & 0 deletions validator/testcases/regex.py
Expand Up @@ -323,6 +323,31 @@ def _compat_test(pattern, title, message, compatibility_type=None,
"information, please see %s.") % TAINTENABLED_BUG,
compatibility_type="warning",
appversions=FX9_DEFINITION)
XRAYPROPS_BUG = BUGZILLA_BUG % 660233
_compat_test(
re.compile(r"\.nodePrincipal"),
("nodePrincipal only available in chrome context"),
("The nodePrincipal property is no longer accessible from "
"untrusted scripts. For more information, please see %s."
) % XRAYPROPS_BUG,
compatibility_type="warning",
appversions=FX9_DEFINITION)
_compat_test(
re.compile(r"\.documentURIObject"),
("documentURIObject only available in chrome context"),
("The documentURIObject property is no longer accessible from "
"untrusted scripts. For more information, please see %s."
) % XRAYPROPS_BUG,
compatibility_type="warning",
appversions=FX9_DEFINITION)
_compat_test(
re.compile(r"\.baseURIObject"),
("baseURIObject only available in chrome context"),
("The baseURIObject property is no longer accessible from "
"untrusted scripts. For more information, please see %s."
) % XRAYPROPS_BUG,
compatibility_type="warning",
appversions=FX9_DEFINITION)

# Thunderbird 7 Compatibility rdf:addressdirectory
if err.supports_version(TB7_DEFINITION):
Expand Down

0 comments on commit ccc07c4

Please sign in to comment.