mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 915053: Remove quirk allowing {} around style attribute. r=heycam
The tests pass with the patch; without the patch test_style_attribute_quirks.html fails 2 tests.
This commit is contained in:
parent
0e77a237fb
commit
eea4b28546
@ -957,22 +957,7 @@ CSSParserImpl::ParseStyleAttribute(const nsAString& aAttributeValue,
|
||||
|
||||
mSection = eCSSSection_General;
|
||||
|
||||
// In quirks mode, allow style declarations to have braces or not
|
||||
// (bug 99554).
|
||||
bool haveBraces;
|
||||
if (mNavQuirkMode && GetToken(true)) {
|
||||
haveBraces = eCSSToken_Symbol == mToken.mType &&
|
||||
'{' == mToken.mSymbol;
|
||||
UngetToken();
|
||||
}
|
||||
else {
|
||||
haveBraces = false;
|
||||
}
|
||||
|
||||
uint32_t parseFlags = eParseDeclaration_AllowImportant;
|
||||
if (haveBraces) {
|
||||
parseFlags |= eParseDeclaration_InBraces;
|
||||
}
|
||||
|
||||
css::Declaration* declaration = ParseDeclarationBlock(parseFlags);
|
||||
if (declaration) {
|
||||
|
@ -154,6 +154,9 @@ MOCHITEST_FILES = test_acid3_test46.html \
|
||||
test_selectors_on_anonymous_content.html \
|
||||
test_shorthand_property_getters.html \
|
||||
test_specified_value_serialization.html \
|
||||
test_style_attribute_quirks.html \
|
||||
test_style_attribute_standards.html \
|
||||
style_attribute_tests.js \
|
||||
test_style_struct_copy_constructors.html \
|
||||
test_supports_rules.html \
|
||||
test_system_font_serialization.html \
|
||||
|
27
layout/style/test/style_attribute_tests.js
Normal file
27
layout/style/test/style_attribute_tests.js
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
window.addEventListener("load", runTests, false);
|
||||
|
||||
function runTests(event)
|
||||
{
|
||||
if (event.target != document) {
|
||||
return;
|
||||
}
|
||||
|
||||
var elt = document.getElementById("content");
|
||||
|
||||
elt.setAttribute("style", "color: blue; background-color: fuchsia");
|
||||
is(elt.style.color, "blue",
|
||||
"setting correct style attribute (color)");
|
||||
is(elt.style.backgroundColor, "fuchsia",
|
||||
"setting correct style attribute (color)");
|
||||
|
||||
elt.setAttribute("style", "{color: blue; background-color: fuchsia}");
|
||||
is(elt.style.color, "",
|
||||
"setting braced style attribute (color)");
|
||||
is(elt.style.backgroundColor, "",
|
||||
"setting braced style attribute (color)");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
18
layout/style/test/test_style_attribute_quirks.html
Normal file
18
layout/style/test/test_style_attribute_quirks.html
Normal file
@ -0,0 +1,18 @@
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=915093
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 915093</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="style_attribute_tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=915093">Mozilla Bug 915093</a>
|
||||
<div id="content"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
19
layout/style/test/test_style_attribute_standards.html
Normal file
19
layout/style/test/test_style_attribute_standards.html
Normal file
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=915093
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 915093</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="style_attribute_tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=915093">Mozilla Bug 915093</a>
|
||||
<div id="content"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user