Skip to content

Commit f7e7ee3

Browse files
committed
Fix iOS orientation detection
developer.html and index.html used a different class name for the "Please rotate your device" tag, and the start button. This caused the JS to throw exceptions when running the orientation detection code. So standardize these classes and ids between developer.html and index.html.
1 parent 09981e7 commit f7e7ee3

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

MotionMark/developer.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ <h3>Time measurement method:</h3>
124124
Attempting to detect system frame rate: <span>0</span> FPS (in progress).
125125
</p>
126126
<div class="start-benchmark">
127-
<p class="hidden">Please rotate the device to orientation before starting.</p>
128-
<button id="run-benchmark" onclick="benchmarkController.startBenchmark()">Run benchmark</button>
127+
<p class="portrait-orientation-check hidden">Please rotate the device to orientation before starting.</p>
128+
<button id="start-button" onclick="benchmarkController.startBenchmark()">Run benchmark</button>
129129
</div>
130130
</div>
131131
</section>

MotionMark/resources/debug-runner/debug-runner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ Utilities.extendObject(window.benchmarkController, {
601601

602602
updateStartButtonState: function()
603603
{
604-
var startButton = document.getElementById("run-benchmark");
604+
var startButton = document.getElementById("start-button");
605605
if ("isInLandscapeOrientation" in this && !this.isInLandscapeOrientation) {
606606
startButton.disabled = true;
607607
return;

MotionMark/resources/runner/motionmark.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,15 +521,16 @@ window.benchmarkController = {
521521
{
522522
benchmarkController.isInLandscapeOrientation = match.matches;
523523
if (match.matches)
524-
document.querySelector(".start-benchmark p").classList.add("hidden");
524+
document.querySelector(".portrait-orientation-check").classList.add("hidden");
525525
else
526-
document.querySelector(".start-benchmark p").classList.remove("hidden");
526+
document.querySelector(".portrait-orientation-check").classList.remove("hidden");
527+
527528
benchmarkController.updateStartButtonState();
528529
},
529530

530531
updateStartButtonState: function()
531532
{
532-
document.getElementById("run-benchmark").disabled = !this.isInLandscapeOrientation;
533+
document.getElementById("start-button").disabled = !this.isInLandscapeOrientation;
533534
},
534535

535536
_startBenchmark: function(suites, options, frameContainerID)

0 commit comments

Comments
 (0)