mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:17:44 +00:00
LibWeb: Move use pseudo element styles from TreeBuilder to StyleComputer
The styling of elements using the `use_pseudo_element()` was only applied on layout. When an element style was recomputed later that styling was not overruled with the pseudo element selector styles. This moves the styling override from `TreeBuilder.cpp` to `StyleComputer.cpp`. Now the styles are always correctly applied. I also removed the method `property_id_by_index()` because it was not needed anymore. Als some calls to `invalidate_layout()` in the Meter, Progress and Select elements where not needed anymore because the style values are update on the changing of the style attribute. This fixes issue #22278.
This commit is contained in:
parent
7578620f25
commit
a05fd28b7b
11 changed files with 44 additions and 49 deletions
17
Tests/LibWeb/Layout/expected/element-use-pseudo-element.txt
Normal file
17
Tests/LibWeb/Layout/expected/element-use-pseudo-element.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
|
||||
BlockContainer <body> at (8,8) content-size 784x21.84375 children: inline
|
||||
line 0 width: 300, height: 21.84375, bottom: 21.84375, baseline: 16.921875
|
||||
frag 0 from BlockContainer start: 0, length: 0, rect: [8,12 300x12]
|
||||
BlockContainer <progress#a> at (8,12) content-size 300x12 inline-block [BFC] children: not-inline
|
||||
BlockContainer <div> at (9,13) content-size 298x12 children: not-inline
|
||||
BlockContainer <div> at (9,13) content-size 298x12 children: not-inline
|
||||
TextNode <#text>
|
||||
TextNode <#text>
|
||||
|
||||
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
|
||||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x21.84375]
|
||||
PaintableWithLines (BlockContainer<PROGRESS>#a) [8,12 300x12] overflow: [8,12 300x14]
|
||||
PaintableWithLines (BlockContainer<DIV>) [8,12 300x14]
|
||||
PaintableWithLines (BlockContainer<DIV>) [9,13 298x12]
|
|
@ -0,0 +1,9 @@
|
|||
<style>
|
||||
* {
|
||||
font: 20px 'SerenitySans';
|
||||
}
|
||||
</style>
|
||||
<progress id="a"></progress>
|
||||
<script>
|
||||
a.style.backgroundColor = 'red'; // Trigger style invalidation
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue