Anonymous boxes that wrap inlines should not inherit overflow (#30579)

In legacy layout, anonymous text wrappers were inheriting the `overflow`
and `text-overflow` properties. This results in the creation of extra
clipping for these anonymous wrappers which could clip away floats. We
will likely implement `text-overflow` differently in non-legacy layout.

This change marks all legacy layout pseudo elements as "legacy" and also
adds a new pseudo element for non-legacy layout that does not inherit
`overflow`.

Fixes #30562.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2023-10-19 15:43:55 +02:00 committed by GitHub
parent 634a5d9cf5
commit fd31da9102
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 120 additions and 88 deletions

View file

@ -190,27 +190,27 @@ svg > * {
* broken for stuff like table backgrounds and such. Gecko explicitly inherits
* what it wants, which seems a bit better off-hand.
*/
*|*::-servo-anonymous-table,
*|*::-servo-anonymous-table-wrapper,
*|*::-servo-table-wrapper,
*|*::-servo-anonymous-block,
*|*::-servo-inline-block-wrapper,
*|*::-servo-inline-absolute {
*|*::-servo-legacy-anonymous-table,
*|*::-servo-legacy-anonymous-table-wrapper,
*|*::-servo-legacy-table-wrapper,
*|*::-servo-legacy-anonymous-block,
*|*::-servo-legacy-inline-block-wrapper,
*|*::-servo-legacy-inline-absolute {
all: inherit;
}
/* style for text node. */
*|*::-servo-text {
*|*::-servo-legacy-text {
text-overflow: inherit;
overflow: inherit;
}
*|*::-servo-table-wrapper {
*|*::-servo-legacy-table-wrapper {
display: table;
border: none;
}
*|*::-servo-anonymous-table-wrapper {
*|*::-servo-legacy-anonymous-table-wrapper {
position: static;
margin: 0;
counter-increment: none;
@ -221,7 +221,7 @@ svg > * {
overflow: visible;
}
*|*::-servo-anonymous-table {
*|*::-servo-legacy-anonymous-table {
display: table;
position: static;
border: none;
@ -230,7 +230,7 @@ svg > * {
overflow: visible;
}
*|*::-servo-anonymous-table-row {
*|*::-servo-legacy-anonymous-table-row {
display: table-row;
position: static;
border: none;
@ -238,7 +238,7 @@ svg > * {
overflow: visible;
}
*|*::-servo-anonymous-table-cell {
*|*::-servo-legacy-anonymous-table-cell {
display: table-cell;
position: static;
border: none;
@ -246,7 +246,7 @@ svg > * {
overflow: visible;
}
*|*::-servo-anonymous-block {
*|*::-servo-legacy-anonymous-block {
display: block;
position: static;
border: none;
@ -257,7 +257,7 @@ svg > * {
}
/* The outer fragment wrapper of an inline-block. */
*|*::-servo-inline-block-wrapper {
*|*::-servo-legacy-inline-block-wrapper {
position: static;
border: none;
padding: 0;
@ -265,7 +265,7 @@ svg > * {
}
/* The outer fragment wrapper of an inline absolute hypothetical fragment. */
*|*::-servo-inline-absolute {
*|*::-servo-legacy-inline-absolute {
clip: auto;
border: none;
padding: 0;