https://bugs.webkit.org/show_bug.cgi?id=127041
Reviewed by Ryosuke Niwa.
Fix minor issues in CSS Regions performance tests.
* Layout/RegionsAuto.html: Change type to lower case.
* Layout/RegionsAutoMaxHeight.html: Ditto.
* Layout/RegionsFixed.html: Ditto.
* Layout/RegionsFixedShort.html: Ditto.
* Layout/RegionsSelection.html: Ditto. Move test methods from regions.js.
* Layout/resources/regions.js: Remove moved methods.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162223
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-01-17 Manuel Rego Casasnovas <rego@igalia.com>
+
+ [CSS Regions] Minor fixes in regions performance tests
+ https://bugs.webkit.org/show_bug.cgi?id=127041
+
+ Reviewed by Ryosuke Niwa.
+
+ Fix minor issues in CSS Regions performance tests.
+
+ * Layout/RegionsAuto.html: Change type to lower case.
+ * Layout/RegionsAutoMaxHeight.html: Ditto.
+ * Layout/RegionsFixed.html: Ditto.
+ * Layout/RegionsFixedShort.html: Ditto.
+ * Layout/RegionsSelection.html: Ditto. Move test methods from regions.js.
+ * Layout/resources/regions.js: Remove moved methods.
+
2014-01-17 Ryosuke Niwa <rniwa@webkit.org>
Host DoYouEvenBench on webkit.org
<!DOCTYPE html>
<html>
<head>
- <link rel="stylesheet" href="resources/regions.css" TYPE="text/css"></link>
+ <link rel="stylesheet" href="resources/regions.css" type="text/css"></link>
<script src="../resources/runner.js"></script>
<script src="resources/regions.js"></script>
<style type="text/css">
<!DOCTYPE html>
<html>
<head>
- <link rel="stylesheet" href="resources/regions.css" TYPE="text/css"></link>
+ <link rel="stylesheet" href="resources/regions.css" type="text/css"></link>
<script src="../resources/runner.js"></script>
<script src="resources/regions.js"></script>
<style type="text/css">
<!DOCTYPE html>
<html>
<head>
- <link rel="stylesheet" href="resources/regions.css" TYPE="text/css"></link>
+ <link rel="stylesheet" href="resources/regions.css" type="text/css"></link>
<script src="../resources/runner.js"></script>
<script src="resources/regions.js"></script>
<style type="text/css">
<!DOCTYPE html>
<html>
<head>
- <link rel="stylesheet" href="resources/regions.css" TYPE="text/css"></link>
+ <link rel="stylesheet" href="resources/regions.css" type="text/css"></link>
<script src="../resources/runner.js"></script>
<script src="resources/regions.js"></script>
<style type="text/css">
<!DOCTYPE html>
<html>
<head>
- <link rel="stylesheet" href="resources/regions.css" TYPE="text/css"></link>
+ <link rel="stylesheet" href="resources/regions.css" type="text/css"></link>
<script src="../resources/runner.js"></script>
<script src="resources/regions.js"></script>
<style type="text/css">
<body>
<pre id="log"></pre>
<script>
+ function performSelection(paragraphCount) {
+ var paragraphs = document.getElementsByClassName("contentParagraph");
+ var selection = getSelection();
+
+ selection.collapse(paragraphs[0], 0);
+
+ for (var i = 1; i < paragraphCount; i++)
+ selection.extend(paragraphs[i], 0);
+ }
+
+ function createRegionsSelectionTest(regionCount) {
+ var article = createArticle(regionCount, 1);
+ article.className = "articleInFlow";
+ var regions = createRegions("600px", "auto", regionCount, "auto");
+ document.body.appendChild(article);
+ document.body.appendChild(regions);
+ return {
+ description: "Testing selection with " + regionCount + " regions. Select text from first region to last one passing through all the regions.",
+ run: function() {
+ performSelection(regionCount);
+ },
+ setup: function() {
+ window.getSelection().removeAllRanges();
+ },
+ done: function() {
+ document.body.removeChild(article);
+ document.body.removeChild(regions);
+ templateParagraph = null;
+ templateRegion = null;
+ }
+ };
+ }
+
PerfTestRunner.measureTime(createRegionsSelectionTest(100));
</script>
</body>
};
}
- function performSelection(paragraphCount) {
- var paragraphs = document.getElementsByClassName("contentParagraph");
- var selection = getSelection();
-
- selection.collapse(paragraphs[0], 0);
-
- for (var i = 1; i < paragraphCount; i++)
- selection.extend(paragraphs[i], 0);
- }
-
- function createRegionsSelectionTest(regionCount) {
- var article = createArticle(regionCount, 1);
- article.className = "articleInFlow";
- var regions = createRegions("600px", "auto", regionCount, "auto");
- document.body.appendChild(article);
- document.body.appendChild(regions);
- return {
- description: "Testing selection with " + regionCount + " regions. Select text from first region to last one passing through all the regions.",
- run: function() {
- performSelection(regionCount);
- },
- setup: function() {
- window.getSelection().removeAllRanges();
- },
- done: function() {
- document.body.removeChild(article);
- document.body.removeChild(regions);
- templateParagraph = null;
- templateRegion = null;
- }
- };
- }
-
function createMixedContent(regionCount) {
var container = document.createElement("div");
for (var i = 0; i < regionCount; ++i) {
}
window.createRegionsTest = createRegionsTest;
- window.createRegionsSelectionTest = createRegionsSelectionTest;
window.createArticle = createArticle;
+ window.createRegions = createRegions;
window.createMixedContent = createMixedContent;
})();