Style inspector strange behavior with ::after pseudo-element
Categories
(Core :: Layout: Block and Inline, defect, P3)
Tracking
()
People
(Reporter: fatarmy214, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
Steps to reproduce:
Version: 64.0.2 (64-bit)
JSFiddle as an alternative to attached HTML: https://jsfiddle.net/g2fku6r1/10/
-
Open attached HTML file
1.1. Star icon overlaps second link's text (covers word "With") -
Open element inspector and find ::after pseudo-element near "Test Link With Long Label"
-
In style inspector find this CSS rule:
.link::after {
...
right: 0;
...
} -
Click checkbox near "right" rule to disable it and then click again to enable it back
4.1. Also, instead of disabling-enabling CSS rule, you can double-click text "Test Link With Long Label" in DOM inspector to enter edit mode and then "apply" the changes without actually changing the text (for example by clicking outside the editable text)
Actual results:
Star icon now don't overlap link's text and placed before the text
Expected results:
Nothing has to changes.
Actually, in Chrome, point 1.1 does not take place, the star icon don't overlap link's text and drawn after this text immediately after page loading. I don't know what behavior is preferred but anyway it seems like a bug
Updated•5 years ago
|
Comment 1•5 years ago
|
||
I couldn't reproduce the workaround with DevTools. Toggling the properties or editing the text doesn't change the layout. This is most likely a CSS layout issue/question.
The root cause is perhaps in the way the absolute positioning is treated within fragmented inline elements.
In Firefox, the text gets fragmented into two boxes and it seems the pseudo-element is positioned against the first one (see attached video). The padding-right does not affect individual fragments, as expected.
In Chrome, the fragmented text seems to reside in a single box and the pseudo-element is absolutely positioned in relation to this box.
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Smells a lot like the other bugs hanging off bug 255139.
Comment 3•5 years ago
|
||
On further research, this seems like a duplicate of Bug 489100.
Description
•