Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[css-text-decor] Don't propagate decorations to inline-flex/inline-grid
https://bugs.webkit.org/show_bug.cgi?id=258420

Reviewed by Tim Nguyen.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

This patch extends our 'shouldInheritTextDecorations' to also account for
additional atomic inlines (i.e., Inline-Flex and Inline-Grid).

* Source/WebCore/style/StyleAdjuster.cpp:
(shouldInheritTextDecorationsInEffect): Add two more display types to not propagate text decorations
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-02.html: Add Test Case
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-02-expected.html: Add Test Case Expectation
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-03.html: Add Test Case
* LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-03-expected.html: Add Test Case Expectation

Canonical link: https://commits.webkit.org/265471@main
  • Loading branch information
Ahmad-S792 authored and nt1m committed Jun 23, 2023
1 parent 23e7f4e commit 1c13b5a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
@@ -0,0 +1,2 @@
<!DOCTYPE html>
This text must not be underlined.
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<link rel="help" href="http://www.w3.org/TR/css-text-decor-3/#line-decoration">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1414859">
<link rel="match" href="reference/text-decoration-propagation-02-ref.html">
<style>
span { text-decoration: underline; }
</style>
<span>
<div style="display: inline-flex;">
This text must not be underlined.
</div>
</span>
@@ -0,0 +1,2 @@
<!DOCTYPE html>
This text must not be underlined.
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<link rel="help" href="http://www.w3.org/TR/css-text-decor-3/#line-decoration">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1414859">
<link rel="match" href="reference/text-decoration-propagation-03-ref.html">
<style>
span { text-decoration: underline; }
</style>
<span>
<div style="display: inline-grid;">
This text must not be underlined.
</div>
</span>
2 changes: 2 additions & 0 deletions Source/WebCore/style/StyleAdjuster.cpp
Expand Up @@ -186,6 +186,8 @@ static bool shouldInheritTextDecorationsInEffect(const RenderStyle& style, const
case DisplayType::Table:
case DisplayType::InlineTable:
case DisplayType::InlineBlock:
case DisplayType::InlineGrid:
case DisplayType::InlineFlex:
case DisplayType::InlineBox:
return false;
default:
Expand Down

0 comments on commit 1c13b5a

Please sign in to comment.