Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix styling of th elements when explicitly specifiying text-align:inh…
…erit https://bugs.webkit.org/show_bug.cgi?id=138577 Patch by Ryan Reno <rreno@apple.com> on 2022-06-16 Reviewed by Tim Nguyen. <th> elements were being incorrectly centered when specifying text-align: inherit. This fixes that bug by adding a new internal CSS value for use in the UA stylesheet. This also removes a non-inherited flag that was meant to be used for detecting this special case but ultimately didn't work due to conflicts with the `all` property. * Source/WebCore/css/CSSValueKeywords.in: * Source/WebCore/css/html.css: (th): * Source/WebCore/css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): * Source/WebCore/css/parser/CSSParserIdioms.cpp: (WebCore::isValueAllowedInMode): * Source/WebCore/rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::RenderStyle): * Source/WebCore/rendering/style/RenderStyle.h: (WebCore::RenderStyle::NonInheritedFlags::operator== const): (WebCore::RenderStyle::hasExplicitlySetTextAlign const): Deleted. (WebCore::RenderStyle::setHasExplicitlySetTextAlign): Deleted. * Source/WebCore/style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjust const): * Source/WebCore/style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertTextAlign): * Source/WebCore/css/CSSProperties.json: * Source/WebCore/style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyInitialTextAlign): Deleted. (WebCore::Style::BuilderCustom::applyValueTextAlign): Deleted. * LayoutTests/fast/css/internal-th-center-ua-only-expected.txt: Added. * LayoutTests/fast/css/internal-th-center-ua-only.html: Added. * LayoutTests/fast/table/center-th-when-parent-has-initial-text-align-expected.html: * LayoutTests/fast/table/center-th-when-parent-has-initial-text-align.html: Canonical link: https://commits.webkit.org/251630@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
71960be
commit 6975dc56ad0e73dcc5f9ae547d08b1ef3d847b96
Showing
14 changed files
with
67 additions
and
46 deletions.
There are no files selected for viewing
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,4 @@ | ||
|
||
PASS "text-align" property does not support value "-internal-th-center". | ||
PASS "text-align" property cannot be set to "-internal-th-center" by the author stylesheet. | ||
|
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,25 @@ | ||
<!DOCTYPE html> | ||
<script src="../../resources/testharness.js"></script> | ||
<script src="../../resources/testharnessreport.js"></script> | ||
|
||
<style> | ||
th { | ||
text-align: right; | ||
text-align: -internal-th-center; | ||
} | ||
</style> | ||
<table> | ||
<tr> | ||
<th id="header"></th> | ||
</tr> | ||
</table> | ||
|
||
<script> | ||
test(function() { | ||
assert_false(CSS.supports('text-align', '-internal-th-center')); | ||
}, '"text-align" property does not support value "-internal-th-center".'); | ||
|
||
test(function() { | ||
assert_equals(getComputedStyle(header).textAlign, 'right'); | ||
}, '"text-align" property cannot be set to "-internal-th-center" by the author stylesheet.'); | ||
</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
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
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
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 |
---|---|---|
@@ -345,6 +345,7 @@ justify | ||
-webkit-center | ||
match-parent | ||
-webkit-match-parent | ||
-internal-th-center | ||
//start | ||
//end | ||
// | ||
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 |
---|---|---|
@@ -269,6 +269,7 @@ td, th { | ||
|
||
th { | ||
font-weight: bold; | ||
text-align: -internal-th-center; | ||
} | ||
|
||
caption { | ||
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
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
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
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
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
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
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