-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSS Counters not properly updated on style changes
https://bugs.webkit.org/show_bug.cgi?id=256540 rdar://problem/109416780 Reviewed by Simon Fraser. This patch aligns WebKit with Gecko / Firefox and Blink / Chromium. Merge: https://src.chromium.org/viewvc/blink?view=revision&revision=197703 When oldstyle does not have counterDirectives and new style have counterDirectives on style change previous counter nodes were not cleared because of which oldstyle values are reflected. * Source/WebCore/rendering/RenderCounter.cpp: (enderCounter::rendererStyleChangedSlowCase): * LayoutTests/fast/css/counters/counter-increment-not-reflected-on-stylechange.html: Add Test Case * LayoutTests/fast/css/counters/counter-increment-not-reflected-on-stylechange-expected.txt: Add Test Case Expectation Canonical link: https://commits.webkit.org/271451@main
- Loading branch information
1 parent
cc5fbe4
commit f8d357e
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
LayoutTests/fast/css/counters/counter-increment-not-reflected-on-stylechange-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
PASS internals.counterValue(document.getElementById('inner1')) is "1" | ||
PASS internals.counterValue(document.getElementById('inner2')) is "2" | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
36 changes: 36 additions & 0 deletions
36
LayoutTests/fast/css/counters/counter-increment-not-reflected-on-stylechange.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html> | ||
<script src="../../../resources/js-test.js"></script> | ||
<style> | ||
#outer | ||
{ | ||
counter-reset: c; | ||
} | ||
|
||
#outer > div:before | ||
{ | ||
content: counter(c); | ||
} | ||
|
||
.active > div:before { | ||
counter-increment: c; | ||
} | ||
|
||
.inactive > div:before { | ||
counter-increment: none; | ||
} | ||
</style> | ||
|
||
<div id="outer"> | ||
<div id="inner1"></div> | ||
<div id="inner2"></div> | ||
</div> | ||
|
||
<script> | ||
var outerDiv = document.getElementById("outer"); | ||
outerDiv.className = "inactive"; | ||
outerDiv.offsetTop; | ||
outerDiv.className = "active"; | ||
|
||
shouldBeEqualToString("internals.counterValue(document.getElementById('inner1'))", "1"); | ||
shouldBeEqualToString("internals.counterValue(document.getElementById('inner2'))", "2"); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters