layout/reftests/meta-viewport/dynamic-grow-width.html
author Makoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 14 Jul 2025 05:41:12 +0000 (14 hours ago)
changeset 796406 1e02bb4c2af2efa34f8335befa373d2b39383b02
parent 466512 17f0796b0f6e7c6a8ff3931e6f48ab514711c8b9
permissions -rw-r--r--
Bug 1973726 - Set DOM file path for webkitRelativePath. r=sefeng,geckoview-reviewers,webidl,smaug,ohall Actually, there is no way to set webkitRelativePath from JavaScript. Since GeckoView's folder picker handles virtual file data, we need to set relative path from JavaScript directly. A content URI of System storage document provider only allow file data access from file/folder picker, so there is no way to test it on geckoivew-junit. Also, after landing bug 1591640, GVE always crash when using folder picker. So this includes a fix for it. Differential Revision: https://phabricator.services.mozilla.com/D255615
<!DOCTYPE html>
<html class="reftest-wait">
<meta name="viewport" content="width=device-width, minimum-scale=0.5">
<style>
html {
  overflow-x: hidden;
}
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
}
div {
  height: 100%;
  position: absolute;
}
</style>
<div id="green" style="background: green; width: 100%;"></div>
<div style="background: blue; width: 100%;"></div>
<script>
document.addEventListener('MozReftestInvalidate', () => {
  // Grow width to generate overflow-x:hidden area but the content height is
  // 100vh so that we don't scale down the contents (bug 1508177).
  green.style.width = '200%';
  requestAnimationFrame(() => {
    document.documentElement.classList.remove('reftest-wait');
  });
});
</script>
</html>