-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Remove unnecessary CSS styles on <p> elements #32043
Conversation
Gold has detected about 5 new digest(s) on patchset 6. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Small question about the "new spans"
lastSpanElement = html.document.createElement('span') as html.HtmlElement; | ||
lastSpanElement = html.document.createElement('flt-span') as html.HtmlElement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Custom elements behave like div
s right? Do you need display: inline
(or inline-block
) to retain what was special of using a span
tag earlier? Or are we just doing display:block on everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point.
The display property doesn't matter anymore. Each <flt-span>
contains a single fragment of text that can't be broken into multiple lines.
A single line of text that is positioned absolutely shouldn't be affected by display:block
or display:inline
.
Gold has detected about 6 new digest(s) on patchset 9. |
With #31907, we started to absolutely position all the spans inside the paragraph, so there's no layout/alignment happening by the DOM. This means we can remove all the CSS styles that were used to make the browser lay things out correctly.
<p>
and<span>
elements to<flt-paragraph>
and<flt-span>
respectively.