Skip to content

Commit 01bf93c

Browse files
cherry-pick(#30800): Revert "fix(highlight): highlight Top Layer elements (#30001)" (#30801)
This PR cherry-picks the following commits: - b06c1df Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 1b2de3f commit 01bf93c

File tree

2 files changed

+0
-41
lines changed

2 files changed

+0
-41
lines changed

packages/playwright-core/src/server/injected/highlight.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export class Highlight {
5555
const document = injectedScript.document;
5656
this._isUnderTest = injectedScript.isUnderTest;
5757
this._glassPaneElement = document.createElement('x-pw-glass');
58-
this._glassPaneElement.popover = 'manual';
5958
this._glassPaneElement.style.position = 'fixed';
6059
this._glassPaneElement.style.top = '0';
6160
this._glassPaneElement.style.right = '0';
@@ -65,12 +64,6 @@ export class Highlight {
6564
this._glassPaneElement.style.pointerEvents = 'none';
6665
this._glassPaneElement.style.display = 'flex';
6766
this._glassPaneElement.style.backgroundColor = 'transparent';
68-
this._glassPaneElement.style.width = 'inherit';
69-
this._glassPaneElement.style.height = 'inherit';
70-
this._glassPaneElement.style.padding = '0';
71-
this._glassPaneElement.style.margin = '0';
72-
this._glassPaneElement.style.border = 'none';
73-
this._glassPaneElement.style.overflow = 'hidden';
7467
for (const eventName of ['click', 'auxclick', 'dragstart', 'input', 'keydown', 'keyup', 'pointerdown', 'pointerup', 'mousedown', 'mouseup', 'mouseleave', 'focus', 'scroll']) {
7568
this._glassPaneElement.addEventListener(eventName, e => {
7669
e.stopPropagation();
@@ -98,8 +91,6 @@ export class Highlight {
9891

9992
install() {
10093
this._injectedScript.document.documentElement.appendChild(this._glassPaneElement);
101-
// Popover is not supported in WebKit-macOS < 14.0
102-
this._glassPaneElement.showPopover?.();
10394
}
10495

10596
setLanguage(language: Language) {
@@ -116,8 +107,6 @@ export class Highlight {
116107
uninstall() {
117108
if (this._rafRequest)
118109
cancelAnimationFrame(this._rafRequest);
119-
// Popover is not supported in WebKit-macOS < 14.0
120-
this._glassPaneElement.hidePopover?.();
121110
this._glassPaneElement.remove();
122111
}
123112

tests/page/page-screenshot.spec.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -482,36 +482,6 @@ it.describe('page screenshot', () => {
482482
})).toMatchSnapshot('should-mask-inside-iframe.png');
483483
});
484484

485-
it('should mask inside <dialog />', async ({ page, server, browserName, isElectron }) => {
486-
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/29878' });
487-
it.skip(browserName === 'webkit' && process.platform === 'darwin' && parseInt(os.release().split('.')[0], 10) < 23, 'SDKAlignedBehavior::PopoverAttributeEnabled is only enabled in macOS 14.0+');
488-
it.fixme(isElectron, 'Requires a more recent Electron version');
489-
490-
await page.setViewportSize({ width: 500, height: 500 });
491-
await page.goto(server.PREFIX + '/grid.html');
492-
await page.evaluate(() => {
493-
const elements = document.body.innerHTML;
494-
document.body.innerHTML = '';
495-
// Move all the elements of the body (grid elements) into a <dialog /> which lives on the Top-Layer.
496-
const dialog = document.createElement('dialog');
497-
dialog.style.padding = '0';
498-
dialog.style.margin = '0';
499-
dialog.style.border = 'none';
500-
dialog.style.maxWidth = 'inherit';
501-
dialog.style.maxHeight = 'inherit';
502-
dialog.style.outline = 'none';
503-
document.body.appendChild(dialog);
504-
dialog.innerHTML = elements;
505-
dialog.showModal();
506-
});
507-
expect(await page.screenshot({
508-
mask: [
509-
page.locator('div').nth(5),
510-
page.frameLocator('#frame1').locator('div').nth(12),
511-
],
512-
})).toMatchSnapshot('should-mask-inside-iframe.png');
513-
});
514-
515485
it('should mask in parallel', async ({ page, server }) => {
516486
await page.setViewportSize({ width: 500, height: 500 });
517487
await attachFrame(page, 'frame1', server.PREFIX + '/grid.html');

0 commit comments

Comments
 (0)