Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js

Issue 2692043004: [Typed OM] Output correct types from CSSKeywordValue for css-wide keywords (Closed)
Patch Set: Remove debugging code; use getComputedStyle instead of offsetTop Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js
index e3837b564afa2b049dd6a864fcec01c1489b9fc6..5dbcaaf893355e675291428df1692948ce1604a2 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/property-suite.js
@@ -28,6 +28,7 @@
function runInlineStylePropertyMapTests(config) {
let element = document.createElement('div');
+ document.documentElement.appendChild(element);
let validKeywords = config.validKeywords.concat([
// CSS-wide keywords
'initial',
@@ -78,14 +79,19 @@ function runSetterTests(
element.style = '';
element.styleMap.set(propertyName, new CSSKeywordValue(keyword));
assert_equals(element.style[propertyName], keyword);
+ // Force a style recalc to check for crashes in style recalculation.
+ getComputedStyle(element)[propertyName];
+ assert_equals(element.style[propertyName], keyword);
}, 'Setting ' + propertyName + ' to ' + keyword);
}
for (let validObject of validObjects) {
test(function() {
element.style = '';
-
element.styleMap.set(propertyName, validObject);
assert_equals(element.style[propertyName], validObject.cssText);
+ // Force a style recalc to check for crashes in style recalculation.
+ getComputedStyle(element)[propertyName];
+ assert_equals(element.style[propertyName], validObject.cssText);
}, 'Setting ' + propertyName + ' to ' + validObject.constructor.name +
' with value ' + validObject.cssText);
}
@@ -143,11 +149,15 @@ function runSequenceSetterTests(
propertyName, validObject, invalidObject, element) {
test(function() {
element.style = '';
-
element.styleMap.set(propertyName, [validObject, validObject]);
assert_equals(
element.style[propertyName], validObject.cssText + ', ' +
validObject.cssText);
+ // Force a style recalc to check for crashes in style recalculation.
+ getComputedStyle(element)[propertyName];
+ assert_equals(
+ element.style[propertyName], validObject.cssText + ', ' +
+ validObject.cssText);
}, 'Set ' + propertyName + ' to a sequence');
test(function() {
@@ -170,6 +180,11 @@ function runAppendTests(
assert_equals(
element.style[propertyName], validObject.cssText + ', ' +
validObject.cssText);
+ // Force a style recalc to check for crashes in style recalculation.
+ getComputedStyle(element)[propertyName];
+ assert_equals(
+ element.style[propertyName], validObject.cssText + ', ' +
+ validObject.cssText);
}, 'Appending a ' + validObject.constructor.name + ' to ' + propertyName);
test(function() {
@@ -179,6 +194,11 @@ function runAppendTests(
assert_equals(
element.style[propertyName], validObject.cssText + ', ' +
validObject.cssText);
+ // Force a style recalc to check for crashes in style recalculation.
+ getComputedStyle(element)[propertyName];
+ assert_equals(
+ element.style[propertyName], validObject.cssText + ', ' +
+ validObject.cssText);
}, 'Append a sequence to ' + propertyName);
// Negative tests
@@ -237,6 +257,10 @@ function runDeletionTests(propertyName, validObject, element) {
element.styleMap.delete(propertyName);
assert_equals(element.style[propertyName], '');
assert_equals(element.styleMap.get(propertyName), null);
+ // Force a style recalc to check for crashes in style recalculation.
+ getComputedStyle(element)[propertyName];
+ assert_equals(element.style[propertyName], '');
+ assert_equals(element.styleMap.get(propertyName), null);
}, 'Delete ' + propertyName + ' removes the value from the styleMap');
}
@@ -244,9 +268,10 @@ function runGetPropertiesTests(propertyName, validObject, element) {
test(function() {
element.style = '';
assert_array_equals(element.styleMap.getProperties(), []);
-
element.styleMap.set(propertyName, validObject);
-
+ assert_array_equals(element.styleMap.getProperties(), [propertyName]);
+ // Force a style recalc to check for crashes in style recalculation.
+ getComputedStyle(element)[propertyName];
assert_array_equals(element.styleMap.getProperties(), [propertyName]);
}, propertyName + ' shows up in getProperties');
}

Powered by Google App Engine
This is Rietveld 408576698