From 28fb705ddf44bf7b2842c56aa20146f43682f8bf Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Thu, 2 Feb 2023 15:53:37 +0000 Subject: [PATCH] "Escape" is a better term than "break out" --- src/core/frames/frame_controller.ts | 12 +++++------ src/tests/fixtures/frames.html | 6 +++--- ...{breakout_frame.html => escape_frame.html} | 4 ++-- src/tests/functional/frame_tests.ts | 20 +++++++++---------- 4 files changed, 21 insertions(+), 21 deletions(-) rename src/tests/fixtures/frames/{breakout_frame.html => escape_frame.html} (73%) diff --git a/src/core/frames/frame_controller.ts b/src/core/frames/frame_controller.ts index 2d5856ae9..03db9d59f 100644 --- a/src/core/frames/frame_controller.ts +++ b/src/core/frames/frame_controller.ts @@ -427,8 +427,8 @@ export class FrameController } private handleFrameMissingFromResponse(fetchResponse: FetchResponse) { - if (this.responsePermittedToBreakOutOfFrame(fetchResponse)) { - this.warnFrameMissingBreakout(fetchResponse) + if (this.responsePermittedToEscapeFrame(fetchResponse)) { + this.warnResponseEscapingFrame(fetchResponse) this.visitResponse(fetchResponse.response) } else { this.showFrameMissingError() @@ -436,16 +436,16 @@ export class FrameController } } - private responsePermittedToBreakOutOfFrame(fetchResponse: FetchResponse) { + private responsePermittedToEscapeFrame(fetchResponse: FetchResponse) { const allowedPathsTag = this.element.ownerDocument.querySelector( - `meta[name=turbo-frame-breakout-paths]` + `meta[name=turbo-frame-escape-paths]` ) const allowedPaths = allowedPathsTag?.content?.split(/\s+/) || [] return allowedPaths.includes(fetchResponse.location.pathname) } - private warnFrameMissingBreakout(fetchResponse: FetchResponse) { + private warnResponseEscapingFrame(fetchResponse: FetchResponse) { console.warn(this.frameMissingMessage(fetchResponse, "Performing a full-page visit.")) } @@ -457,7 +457,7 @@ export class FrameController throw new TurboFrameMissingError( this.frameMissingMessage( fetchResponse, - "To transform the response into a full-page visit, include its path in a turbo-frame-breakout-paths meta tag." + "To transform the response into a full-page visit, include its path in a turbo-frame-escape-paths meta tag." ) ) } diff --git a/src/tests/fixtures/frames.html b/src/tests/fixtures/frames.html index b60f831d7..724335884 100644 --- a/src/tests/fixtures/frames.html +++ b/src/tests/fixtures/frames.html @@ -3,7 +3,7 @@ Frame - + @@ -98,8 +98,8 @@

Frames: #nested-child

Missing frame - Missing frame with breakout - Missing frame with breakout (via redirect) + Missing frame with escape + Missing frame with escape (via redirect) 404 diff --git a/src/tests/fixtures/frames/breakout_frame.html b/src/tests/fixtures/frames/escape_frame.html similarity index 73% rename from src/tests/fixtures/frames/breakout_frame.html rename to src/tests/fixtures/frames/escape_frame.html index 8ee0deb9d..1b5725cbf 100644 --- a/src/tests/fixtures/frames/breakout_frame.html +++ b/src/tests/fixtures/frames/escape_frame.html @@ -2,10 +2,10 @@ - Breakout frame + Escape frame -

Breakout frame

+

Escape frame

diff --git a/src/tests/functional/frame_tests.ts b/src/tests/functional/frame_tests.ts index e8c5ab58c..84d69ac22 100644 --- a/src/tests/functional/frame_tests.ts +++ b/src/tests/functional/frame_tests.ts @@ -187,35 +187,35 @@ test("failing to follow a link to a page without a matching frame shows an error assert.match(error!.message, /The response \(404\) did not contain the expected /) }) -test("following a link to a breakoutable page without a matching frame dispatches a turbo:frame-missing event", async ({ +test("following a link to an escapeable page without a matching frame dispatches a turbo:frame-missing event", async ({ page, }) => { - await page.click("#breakout-frame-link") + await page.click("#escape-frame-link") const { response } = await nextEventOnTarget(page, "missing", "turbo:frame-missing") assert.equal(200, response.status) }) -test("successfully following a link to a breakoutable page without a matching frame performs a visit", async ({ +test("successfully following a link to an escapeable page without a matching frame performs a visit", async ({ page, }) => { - await page.click("#breakout-frame-link") + await page.click("#escape-frame-link") await nextEventNamed(page, "turbo:render") - assert.equal(await page.innerText("h1"), "Breakout frame") - assert.equal(pathname(page.url()), "/src/tests/fixtures/frames/breakout_frame.html") + assert.equal(await page.innerText("h1"), "Escape frame") + assert.equal(pathname(page.url()), "/src/tests/fixtures/frames/escape_frame.html") }) -test("successfully following a link via a redirect to a breakoutable page without a matching frame performs a visit", async ({ +test("successfully following a link via a redirect to an escapeable page without a matching frame performs a visit", async ({ page, }) => { - await page.click("#breakout-redirect-link") + await page.click("#escape-redirect-link") await nextEventNamed(page, "turbo:render") - assert.equal(await page.innerText("h1"), "Breakout frame") - assert.equal(pathname(page.url()), "/src/tests/fixtures/frames/breakout_frame.html") + assert.equal(await page.innerText("h1"), "Escape frame") + assert.equal(pathname(page.url()), "/src/tests/fixtures/frames/escape_frame.html") }) test("test the turbo:frame-missing event following a link to a page without a matching frame can be handled", async ({