Automatic update from web-platform-tests [iframe] Resize on `DOMContentLoaded` This patch changes to resize responsive iframes on the `DOMContentLoaded` event, in addition to the `load` event. No behavior changes as changes are under a runtime flag. Bug: 418397278 Change-Id: I81cc34408964cda1b7233c99ec876e8f08c79fde Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7061690 Auto-Submit: Koji Ishii <kojii@chromium.org> Reviewed-by: Kent Tamura <tkent@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1532775} -- wpt-commits: e5f7d98f0724537350a56f16a493be3550fbfea8 wpt-pr: 55568
17 lines
469 B
Python
17 lines
469 B
Python
import os.path
|
|
import time
|
|
|
|
def main(request, response):
|
|
# Sleep for 500ms to delay the `load` events.
|
|
time.sleep(0.5)
|
|
|
|
name = request.GET.first(b"name")
|
|
path = os.path.join(os.path.dirname(__file__), name)
|
|
body = open(path, u"rb").read()
|
|
|
|
response.headers.set(b"Content-Type", b"image")
|
|
response.headers.set(b"Content-Length", len(body))
|
|
response.headers.set(b"Cache-control", b"no-cache, must-revalidate")
|
|
|
|
response.content = body
|