Skip to content

Simplify positioning of elements inside markedContent#20492

Merged
calixteman merged 1 commit intomozilla:masterfrom
nicolo-ribaudo:simplify-markedcontent-text-layer
Dec 12, 2025
Merged

Simplify positioning of elements inside markedContent#20492
calixteman merged 1 commit intomozilla:masterfrom
nicolo-ribaudo:simplify-markedcontent-text-layer

Conversation

@nicolo-ribaudo
Copy link
Contributor

Commit message:

Simplify positioning of elements inside markedContent

By setting display: contents on .markedContent containers, they stop affecting the layout of their children. This means that we can always position text layer <span> elements using percentages relative to the page dimensions, rather than having two separate code paths.

For some reason this breaks the workaround for text selection flickering in Chrome/Safari, which can be fixed by setting user-select: text on the .endOfContent div (only in Chrome/Safari, as it would break selection in Firefox).

I noticed this while working on #20491

@nicolo-ribaudo
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @nicolo-ribaudo received. Current queue size: 2

Live output at: http://54.241.84.105:8877/39ac2033934be17/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @nicolo-ribaudo received. Current queue size: 2

Live output at: http://54.193.163.58:8877/eadd4e63dac39d2/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/39ac2033934be17/output.txt

Total script time: 40.18 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 12

Image differences available at: http://54.241.84.105:8877/39ac2033934be17/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/eadd4e63dac39d2/output.txt

Total script time: 74.45 mins

  • Unit tests: FAILED
  • Integration Tests: FAILED
  • Regression tests: FAILED
  different ref/snapshot: 12

Image differences available at: http://54.193.163.58:8877/eadd4e63dac39d2/reftest-analyzer.html#web=eq.log

@nicolo-ribaudo
Copy link
Contributor Author

The Windows integration test failure is an unrelated timeout. The reftest differences are all correct: it's just that before we had different rounding logic for the position of text inside .markedContent, while now it's rounded like everything else.

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me; thanks!

By setting `display: contents` on `.markedContent` containers, they stop
affecting the layout of their children. This means that we can always
position text layer `<span>` elements using percentages relative to the
page dimensions, rather than having two separate code paths.

For some reason this breaks the workaround for text selection flickering
in Chrome/Safari, which can be fixed by setting `user-select: text` on
the `.endOfContent` div (only in Chrome/Safari, as it would break
selection in Firefox).
@nicolo-ribaudo nicolo-ribaudo force-pushed the simplify-markedcontent-text-layer branch from f8ea65c to 7e0c939 Compare December 12, 2025 10:37
@nicolo-ribaudo
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @nicolo-ribaudo received. Current queue size: 0

Live output at: http://54.241.84.105:8877/720d07503e4165f/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @nicolo-ribaudo received. Current queue size: 0

Live output at: http://54.193.163.58:8877/235a0667b2206e8/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/720d07503e4165f/output.txt

Total script time: 39.56 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 12

Image differences available at: http://54.241.84.105:8877/720d07503e4165f/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/235a0667b2206e8/output.txt

Total script time: 78.11 mins

  • Unit tests: FAILED
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 12

Image differences available at: http://54.193.163.58:8877/235a0667b2206e8/reftest-analyzer.html#web=eq.log

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@calixteman calixteman merged commit ff4529d into mozilla:master Dec 12, 2025
9 checks passed
@calixteman
Copy link
Contributor

/botio makeref

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_makeref from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/68e80ca7197d9f0/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/9dcf3897ec7c155/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/9dcf3897ec7c155/output.txt

Total script time: 17.61 mins

  • Make references: Passed
  • Check references: Passed

@nicolo-ribaudo nicolo-ribaudo deleted the simplify-markedcontent-text-layer branch December 12, 2025 16:59
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/68e80ca7197d9f0/output.txt

Total script time: 32.18 mins

  • Make references: Passed
  • Check references: Passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants